@vybesec/sdk 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/v1/sdk.js CHANGED
@@ -1,2 +1,75 @@
1
- "use strict";var VybeSec=(()=>{var p=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var b=(t,e)=>{for(var n in e)p(t,n,{get:e[n],enumerable:!0})},R=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of E(e))!T.call(t,i)&&i!==n&&p(t,i,{get:()=>e[i],enumerable:!(r=v(e,i))||r.enumerable});return t};var k=t=>R(p({},"__esModule",{value:!0}),t);var q={};b(q,{VybeSecSDK:()=>h,captureError:()=>U,captureEvent:()=>D,init:()=>L,vybesec:()=>d});var S="https://vybesec-ingest.hexeldigitalstudio.workers.dev",g="vybesec_session_id";function w(){try{let t=window.localStorage.getItem(g);if(t)return t;let e=crypto.randomUUID();return window.localStorage.setItem(g,e),e}catch{return crypto.randomUUID()}}function x(t){if(t instanceof Error)return t.message||"Unknown error";if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return"Unknown error"}}function _(t){return t instanceof Error&&t.name?t.name:"Error"}function I(t){if(t instanceof Error)return t.stack}function l(t){if(!t)return t;let e=[/sk-[a-zA-Z0-9]{20,}/g,/pk_[a-zA-Z0-9]{20,}/g,/Bearer\s+[a-zA-Z0-9\-_.]{20,}/g,/password["']?\s*[:=]\s*["'][^"']+/gi],n=t;for(let r of e)n=n.replace(r,"[REDACTED]");return n}var M=/(password|token|secret|api[_-]?key|authorization)/i,A=3;function c(t,e=0){if(e>=A)return t;if(typeof t=="string")return l(t)??t;if(Array.isArray(t))return t.map(n=>c(n,e+1));if(t&&typeof t=="object"){let n=t,r={};for(let[i,s]of Object.entries(n)){if(M.test(i)){r[i]="[REDACTED]";continue}r[i]=c(s,e+1)}return r}return t}function y(t){return{...t,message:l(t.message)??t.message,stackTrace:l(t.stackTrace),tags:t.tags?c(t.tags):t.tags,extra:t.extra?c(t.extra):t.extra}}var h=class{config=null;buffer=[];eventTimestamps=[];flushTimer;retryTimer;retryAttempt=0;isFlushing=!1;init(e){this.config={...e,sampleRate:e.sampleRate??1,maxBuffer:e.maxBuffer??100,maxEventsPerMinute:e.maxEventsPerMinute??120,ingestUrl:e.ingestUrl??S},!(typeof window>"u")&&(window.addEventListener("error",n=>{this.captureError(n.error??n.message,{url:n.filename})}),window.addEventListener("unhandledrejection",n=>{this.captureError(n.reason)}),this.patchFetch(),this.patchXHR(),this.trackNavigation(),window.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flushBeacon()}),this.flushTimer&&window.clearInterval(this.flushTimer),this.retryTimer&&(window.clearTimeout(this.retryTimer),this.retryTimer=void 0),this.retryAttempt=0,this.flushTimer=window.setInterval(()=>this.flush(),5e3))}captureError(e,n){if(!this.config||!this.shouldAcceptEvent())return;let r=y({type:"error",message:x(e),stackTrace:I(e),errorType:_(e),url:typeof window<"u"?window.location.href:void 0,sessionId:typeof window<"u"?w():void 0,userId:this.config.userId,timestamp:Date.now(),tags:{...n??{},platform:this.config.platform??"other",environment:this.config.environment??"production",release:this.config.release??""}});this.pushEvent(r)}captureEvent(e){if(!this.config||!this.shouldAcceptEvent())return;let n=y({...e,sessionId:e.sessionId??(typeof window<"u"?w():void 0),userId:e.userId??this.config.userId,timestamp:e.timestamp??Date.now(),tags:{...e.tags??{},platform:this.config.platform??"other",environment:this.config.environment??"production",release:this.config.release??""}});this.pushEvent(n)}pushEvent(e){if(!this.config)return;let n=this.config.maxBuffer??100;if(!(n<=0)){for(;this.buffer.length>=n;)this.buffer.shift();this.buffer.push(e),this.buffer.length>=10&&this.flush()}}async flush(){if(!this.config||this.isFlushing||!this.buffer.length)return;this.isFlushing=!0;let e=this.buffer.splice(0);try{await fetch(`${this.config.ingestUrl}/v1/events/${this.config.key}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),keepalive:!0}),this.retryAttempt=0,this.retryTimer&&(window.clearTimeout(this.retryTimer),this.retryTimer=void 0)}catch{this.buffer.unshift(...e),this.scheduleRetry()}finally{this.isFlushing=!1}}flushBeacon(){if(!this.config||!this.buffer.length)return;let e=this.buffer.splice(0),n=new Blob([JSON.stringify(e)],{type:"application/json"});if(navigator.sendBeacon){navigator.sendBeacon(`${this.config.ingestUrl}/v1/events/${this.config.key}`,n);return}fetch(`${this.config.ingestUrl}/v1/events/${this.config.key}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),keepalive:!0})}scheduleRetry(){if(typeof window>"u")return;let e=Math.min(3e4,1e3*2**this.retryAttempt);this.retryAttempt=Math.min(this.retryAttempt+1,5),this.retryTimer&&window.clearTimeout(this.retryTimer),this.retryTimer=window.setTimeout(()=>this.flush(),e)}shouldAcceptEvent(){return!(!this.config||Math.random()>(this.config.sampleRate??1)||!this.consumeRateLimit())}consumeRateLimit(){if(!this.config)return!1;let e=this.config.maxEventsPerMinute??120;if(e<=0)return!1;let n=Date.now(),r=n-6e4;return this.eventTimestamps=this.eventTimestamps.filter(i=>i>r),this.eventTimestamps.length>=e?!1:(this.eventTimestamps.push(n),!0)}patchFetch(){if(typeof window>"u"||!("fetch"in window))return;let e=window.fetch.bind(window);window.fetch=async(...n)=>{let r=await e(...n);try{let i=n[0],s=(i instanceof Request?i.method:n[1]?.method)??"GET",o=i instanceof Request?i.url:String(i);r.ok||this.captureEvent({type:"error",message:`Request failed with ${r.status}`,errorType:"HttpError",requestUrl:o,requestMethod:s,responseStatus:r.status,url:typeof window<"u"?window.location.href:void 0,timestamp:Date.now()})}catch{}return r}}patchXHR(){if(typeof window>"u"||!("XMLHttpRequest"in window))return;let e=this,n=XMLHttpRequest.prototype;if(n.__vsPatched)return;n.__vsPatched=!0;let r=n.open,i=n.send;n.open=function(s,o,f,a,u){let m=this;return m.__vsMeta={method:s,url:String(o)},r.call(m,s,o,f??!0,a??null,u??null)},n.send=function(s){let o=this,f=o.__vsMeta,a=()=>{try{if(!e.config||!f)return;let u=o.status;(u>=400||u===0)&&e.captureEvent({type:"error",message:`XHR failed with ${u||"network error"}`,errorType:"HttpError",requestUrl:f.url,requestMethod:f.method,responseStatus:u||void 0,url:typeof window<"u"?window.location.href:void 0,timestamp:Date.now()})}finally{o.removeEventListener("loadend",a),o.removeEventListener("error",a)}};return o.addEventListener("loadend",a),o.addEventListener("error",a),i.call(o,s)}}trackNavigation(){if(typeof window>"u")return;let e=history.pushState,n=history.replaceState,r=()=>{this.captureEvent({type:"info",message:`Navigation to ${window.location.href}`,url:window.location.href,timestamp:Date.now()})};history.pushState=function(...i){let s=e.apply(this,i);return r(),s},history.replaceState=function(...i){let s=n.apply(this,i);return r(),s},window.addEventListener("popstate",r)}},d=new h,L=t=>d.init(t),U=t=>d.captureError(t),D=t=>d.captureEvent(t);return k(q);})();
1
+ "use strict";var VybeSec=(()=>{var gs=Object.defineProperty;var du=Object.getOwnPropertyDescriptor;var pu=Object.getOwnPropertyNames;var mu=Object.prototype.hasOwnProperty;var $n=(s,e)=>()=>(s&&(e=s(s=0)),e);var ys=(s,e)=>{for(var t in e)gs(s,t,{get:e[t],enumerable:!0})},gu=(s,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of pu(e))!mu.call(s,i)&&i!==t&&gs(s,i,{get:()=>e[i],enumerable:!(r=du(e,i))||r.enumerable});return s};var yu=s=>gu(gs({},"__esModule",{value:!0}),s);var Jn={};ys(Jn,{CLSThresholds:()=>Cs,FCPThresholds:()=>Ss,FIDThresholds:()=>Ms,INPThresholds:()=>Es,LCPThresholds:()=>Is,TTFBThresholds:()=>xs,onCLS:()=>vu,onFCP:()=>Vn,onFID:()=>Tu,onINP:()=>xu,onLCP:()=>Mu,onTTFB:()=>Ru});var bs,xe,ht,Wn,Ht,zn,Le,Ns,Zt,oe,ze,ae,Rs,ft,Xt,We,Fn,Yt,Un,wu,As,dt,Ss,Vn,Cs,vu,Gn,ws,Gt,bu,jn,Su,pe,jt,Hn,Cu,Eu,Iu,Yn,Es,xu,Is,vs,Mu,xs,Nu,Ru,ct,Au,Bn,Zn,Ou,Xn,Ms,Tu,Kn=$n(()=>{zn=-1,Le=function(s){addEventListener("pageshow",(function(e){e.persisted&&(zn=e.timeStamp,s(e))}),!0)},Ns=function(){var s=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(s&&s.responseStart>0&&s.responseStart<performance.now())return s},Zt=function(){var s=Ns();return s&&s.activationStart||0},oe=function(s,e){var t=Ns(),r="navigate";return zn>=0?r="back-forward-cache":t&&(document.prerendering||Zt()>0?r="prerender":document.wasDiscarded?r="restore":t.type&&(r=t.type.replace(/_/g,"-"))),{name:s,value:e===void 0?-1:e,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},ze=function(s,e,t){try{if(PerformanceObserver.supportedEntryTypes.includes(s)){var r=new PerformanceObserver((function(i){Promise.resolve().then((function(){e(i.getEntries())}))}));return r.observe(Object.assign({type:s,buffered:!0},t||{})),r}}catch{}},ae=function(s,e,t,r){var i,n;return function(o){e.value>=0&&(o||r)&&((n=e.value-(i||0))||i===void 0)&&(i=e.value,e.delta=n,e.rating=(function(a,l){return a>l[1]?"poor":a>l[0]?"needs-improvement":"good"})(e.value,t),s(e))}},Rs=function(s){requestAnimationFrame((function(){return requestAnimationFrame((function(){return s()}))}))},ft=function(s){document.addEventListener("visibilitychange",(function(){document.visibilityState==="hidden"&&s()}))},Xt=function(s){var e=!1;return function(){e||(s(),e=!0)}},We=-1,Fn=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},Yt=function(s){document.visibilityState==="hidden"&&We>-1&&(We=s.type==="visibilitychange"?s.timeStamp:0,wu())},Un=function(){addEventListener("visibilitychange",Yt,!0),addEventListener("prerenderingchange",Yt,!0)},wu=function(){removeEventListener("visibilitychange",Yt,!0),removeEventListener("prerenderingchange",Yt,!0)},As=function(){return We<0&&(We=Fn(),Un(),Le((function(){setTimeout((function(){We=Fn(),Un()}),0)}))),{get firstHiddenTime(){return We}}},dt=function(s){document.prerendering?addEventListener("prerenderingchange",(function(){return s()}),!0):s()},Ss=[1800,3e3],Vn=function(s,e){e=e||{},dt((function(){var t,r=As(),i=oe("FCP"),n=ze("paint",(function(o){o.forEach((function(a){a.name==="first-contentful-paint"&&(n.disconnect(),a.startTime<r.firstHiddenTime&&(i.value=Math.max(a.startTime-Zt(),0),i.entries.push(a),t(!0)))}))}));n&&(t=ae(s,i,Ss,e.reportAllChanges),Le((function(o){i=oe("FCP"),t=ae(s,i,Ss,e.reportAllChanges),Rs((function(){i.value=performance.now()-o.timeStamp,t(!0)}))})))}))},Cs=[.1,.25],vu=function(s,e){e=e||{},Vn(Xt((function(){var t,r=oe("CLS",0),i=0,n=[],o=function(l){l.forEach((function(u){if(!u.hadRecentInput){var c=n[0],h=n[n.length-1];i&&u.startTime-h.startTime<1e3&&u.startTime-c.startTime<5e3?(i+=u.value,n.push(u)):(i=u.value,n=[u])}})),i>r.value&&(r.value=i,r.entries=n,t())},a=ze("layout-shift",o);a&&(t=ae(s,r,Cs,e.reportAllChanges),ft((function(){o(a.takeRecords()),t(!0)})),Le((function(){i=0,r=oe("CLS",0),t=ae(s,r,Cs,e.reportAllChanges),Rs((function(){return t()}))})),setTimeout(t,0))})))},Gn=0,ws=1/0,Gt=0,bu=function(s){s.forEach((function(e){e.interactionId&&(ws=Math.min(ws,e.interactionId),Gt=Math.max(Gt,e.interactionId),Gn=Gt?(Gt-ws)/7+1:0)}))},jn=function(){return bs?Gn:performance.interactionCount||0},Su=function(){"interactionCount"in performance||bs||(bs=ze("event",bu,{type:"event",buffered:!0,durationThreshold:0}))},pe=[],jt=new Map,Hn=0,Cu=function(){var s=Math.min(pe.length-1,Math.floor((jn()-Hn)/50));return pe[s]},Eu=[],Iu=function(s){if(Eu.forEach((function(i){return i(s)})),s.interactionId||s.entryType==="first-input"){var e=pe[pe.length-1],t=jt.get(s.interactionId);if(t||pe.length<10||s.duration>e.latency){if(t)s.duration>t.latency?(t.entries=[s],t.latency=s.duration):s.duration===t.latency&&s.startTime===t.entries[0].startTime&&t.entries.push(s);else{var r={id:s.interactionId,latency:s.duration,entries:[s]};jt.set(r.id,r),pe.push(r)}pe.sort((function(i,n){return n.latency-i.latency})),pe.length>10&&pe.splice(10).forEach((function(i){return jt.delete(i.id)}))}}},Yn=function(s){var e=self.requestIdleCallback||self.setTimeout,t=-1;return s=Xt(s),document.visibilityState==="hidden"?s():(t=e(s),ft(s)),t},Es=[200,500],xu=function(s,e){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(e=e||{},dt((function(){var t;Su();var r,i=oe("INP"),n=function(a){Yn((function(){a.forEach(Iu);var l=Cu();l&&l.latency!==i.value&&(i.value=l.latency,i.entries=l.entries,r())}))},o=ze("event",n,{durationThreshold:(t=e.durationThreshold)!==null&&t!==void 0?t:40});r=ae(s,i,Es,e.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),ft((function(){n(o.takeRecords()),r(!0)})),Le((function(){Hn=jn(),pe.length=0,jt.clear(),i=oe("INP"),r=ae(s,i,Es,e.reportAllChanges)})))})))},Is=[2500,4e3],vs={},Mu=function(s,e){e=e||{},dt((function(){var t,r=As(),i=oe("LCP"),n=function(l){e.reportAllChanges||(l=l.slice(-1)),l.forEach((function(u){u.startTime<r.firstHiddenTime&&(i.value=Math.max(u.startTime-Zt(),0),i.entries=[u],t())}))},o=ze("largest-contentful-paint",n);if(o){t=ae(s,i,Is,e.reportAllChanges);var a=Xt((function(){vs[i.id]||(n(o.takeRecords()),o.disconnect(),vs[i.id]=!0,t(!0))}));["keydown","click"].forEach((function(l){addEventListener(l,(function(){return Yn(a)}),{once:!0,capture:!0})})),ft(a),Le((function(l){i=oe("LCP"),t=ae(s,i,Is,e.reportAllChanges),Rs((function(){i.value=performance.now()-l.timeStamp,vs[i.id]=!0,t(!0)}))}))}}))},xs=[800,1800],Nu=function s(e){document.prerendering?dt((function(){return s(e)})):document.readyState!=="complete"?addEventListener("load",(function(){return s(e)}),!0):setTimeout(e,0)},Ru=function(s,e){e=e||{};var t=oe("TTFB"),r=ae(s,t,xs,e.reportAllChanges);Nu((function(){var i=Ns();i&&(t.value=Math.max(i.responseStart-Zt(),0),t.entries=[i],r(!0),Le((function(){t=oe("TTFB",0),(r=ae(s,t,xs,e.reportAllChanges))(!0)})))}))},ct={passive:!0,capture:!0},Au=new Date,Bn=function(s,e){xe||(xe=e,ht=s,Wn=new Date,Xn(removeEventListener),Zn())},Zn=function(){if(ht>=0&&ht<Wn-Au){var s={entryType:"first-input",name:xe.type,target:xe.target,cancelable:xe.cancelable,startTime:xe.timeStamp,processingStart:xe.timeStamp+ht};Ht.forEach((function(e){e(s)})),Ht=[]}},Ou=function(s){if(s.cancelable){var e=(s.timeStamp>1e12?new Date:performance.now())-s.timeStamp;s.type=="pointerdown"?(function(t,r){var i=function(){Bn(t,r),o()},n=function(){o()},o=function(){removeEventListener("pointerup",i,ct),removeEventListener("pointercancel",n,ct)};addEventListener("pointerup",i,ct),addEventListener("pointercancel",n,ct)})(e,s):Bn(e,s)}},Xn=function(s){["mousedown","keydown","touchstart","pointerdown"].forEach((function(e){return s(e,Ou,ct)}))},Ms=[100,300],Tu=function(s,e){e=e||{},dt((function(){var t,r=As(),i=oe("FID"),n=function(l){l.startTime<r.firstHiddenTime&&(i.value=l.processingStart-l.startTime,i.entries.push(l),t(!0))},o=function(l){l.forEach(n)},a=ze("first-input",o);t=ae(s,i,Ms,e.reportAllChanges),a&&(ft(Xt((function(){o(a.takeRecords()),a.disconnect()}))),Le((function(){var l;i=oe("FID"),t=ae(s,i,Ms,e.reportAllChanges),Ht=[],ht=-1,xe=null,Xn(addEventListener),l=n,Ht.push(l),Zn()})))}))}});var lu={};ys(lu,{EventType:()=>I,IncrementalSource:()=>E,MouseInteractions:()=>k,Replayer:()=>Hi,ReplayerEvents:()=>D,addCustomEvent:()=>Um,canvasMutation:()=>Gi,freezePage:()=>Bm,mirror:()=>jr,record:()=>Te,takeFullSnapshot:()=>Wm,utils:()=>Qp});function Yi(s){if(Jt[s])return Jt[s];let e=globalThis[s],t=e.prototype,r=s in to?to[s]:void 0,i=!!(r&&r.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(t,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),n=s in ro?ro[s]:void 0,o=!!(n&&n.every(a=>{var l;return typeof t[a]=="function"&&((l=t[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&o&&!Fu())return Jt[s]=e.prototype,e.prototype;try{let a=document.createElement("iframe");document.body.appendChild(a);let l=a.contentWindow;if(!l)return e.prototype;let u=l[s].prototype;return document.body.removeChild(a),u?Jt[s]=u:t}catch{return t}}function Ee(s,e,t){var r;let i=`${s}.${String(t)}`;if(Os[i])return Os[i].call(e);let n=Yi(s),o=(r=Object.getOwnPropertyDescriptor(n,t))==null?void 0:r.get;return o?(Os[i]=o,o.call(e)):e[t]}function ca(s,e,t){let r=`${s}.${String(t)}`;if(Ts[r])return Ts[r].bind(e);let n=Yi(s)[t];return typeof n!="function"?e[t]:(Ts[r]=n,n.bind(e))}function Uu(s){return Ee("Node",s,"ownerDocument")}function Bu(s){return Ee("Node",s,"childNodes")}function Wu(s){return Ee("Node",s,"parentNode")}function zu(s){return Ee("Node",s,"parentElement")}function Vu(s){return Ee("Node",s,"textContent")}function Gu(s,e){return ca("Node",s,"contains")(e)}function ju(s){return ca("Node",s,"getRootNode")()}function Hu(s){return!s||!("host"in s)?null:Ee("ShadowRoot",s,"host")}function Yu(s){return s.styleSheets}function Zu(s){return!s||!("shadowRoot"in s)?null:Ee("Element",s,"shadowRoot")}function Xu(s,e){return Ee("Element",s,"querySelector")(e)}function Ju(s,e){return Ee("Element",s,"querySelectorAll")(e)}function Ku(){return Yi("MutationObserver").constructor}function qu(s,e,t){try{if(!(e in s))return()=>{};let r=s[e],i=t(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),s[e]=i,()=>{s[e]=r}}catch{return()=>{}}}function Zi(s){return s.nodeType===s.ELEMENT_NODE}function bt(s){let e=s&&"host"in s&&"mode"in s&&q.host(s)||null;return!!(e&&"shadowRoot"in e&&q.shadowRoot(e)===s)}function St(s){return Object.prototype.toString.call(s)==="[object ShadowRoot]"}function Qu(s){return s.includes(" background-clip: text;")&&!s.includes(" -webkit-background-clip: text;")&&(s=s.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),s}function ec(s){let{cssText:e}=s;if(e.split('"').length<3)return e;let t=["@import",`url(${JSON.stringify(s.href)})`];return s.layerName===""?t.push("layer"):s.layerName&&t.push(`layer(${s.layerName})`),s.supportsText&&t.push(`supports(${s.supportsText})`),s.media.length&&t.push(s.media.mediaText),t.join(" ")+";"}function js(s){try{let e=s.rules||s.cssRules;if(!e)return null;let t=s.href;!t&&s.ownerNode&&(t=s.ownerNode.baseURI);let r=Array.from(e,i=>ha(i,t)).join("");return Qu(r)}catch{return null}}function ha(s,e){if(rc(s)){let t;try{t=js(s.styleSheet)||ec(s)}catch{t=s.cssText}return s.styleSheet.href?Ar(t,s.styleSheet.href):t}else{let t=s.cssText;return sc(s)&&s.selectorText.includes(":")&&(t=tc(t)),e?Ar(t,e):t}}function tc(s){let e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return s.replace(e,"$1\\$2")}function rc(s){return"styleSheet"in s}function sc(s){return"selectorText"in s}function fa(){return new It}function Nr({element:s,maskInputOptions:e,tagName:t,type:r,value:i,maskInputFn:n}){let o=i||"",a=r&&Oe(r);return(e[t.toLowerCase()]||a&&e[a])&&(n?o=n(o,s):o="*".repeat(o.length)),o}function Oe(s){return s.toLowerCase()}function ic(s){let e=s.getContext("2d");if(!e)return!0;let t=50;for(let r=0;r<s.width;r+=t)for(let i=0;i<s.height;i+=t){let n=e.getImageData,o=so in n?n[so]:n;if(new Uint32Array(o.call(e,r,i,Math.min(t,s.width-r),Math.min(t,s.height-i)).data.buffer).some(l=>l!==0))return!1}return!0}function nc(s,e){return!s||!e||s.type!==e.type?!1:s.type===M.Document?s.compatMode===e.compatMode:s.type===M.DocumentType?s.name===e.name&&s.publicId===e.publicId&&s.systemId===e.systemId:s.type===M.Comment||s.type===M.Text||s.type===M.CDATA?s.textContent===e.textContent:s.type===M.Element?s.tagName===e.tagName&&JSON.stringify(s.attributes)===JSON.stringify(e.attributes)&&s.isSVG===e.isSVG&&s.needBlock===e.needBlock:!1}function Rr(s){let e=s.type;return s.hasAttribute("data-rr-is-password")?"password":e?Oe(e):null}function Xi(s,e){let t;try{t=new URL(s,e??window.location.href)}catch{return null}let r=/\.([0-9a-z]+)(?:$)/i,i=t.pathname.match(r);return i?.[1]??null}function oc(s){let e="";return s.indexOf("//")>-1?e=s.split("/").slice(0,3).join("/"):e=s.split("/")[0],e=e.split("?")[0],e}function Ar(s,e){return(s||"").replace(ac,(t,r,i,n,o,a)=>{let l=i||o||a,u=r||n||"";if(!l)return t;if(lc.test(l)||uc.test(l))return`url(${u}${l}${u})`;if(cc.test(l))return`url(${u}${l}${u})`;if(l[0]==="/")return`url(${u}${oc(e)+l}${u})`;let c=e.split("/"),h=l.split("/");c.pop();for(let f of h)f!=="."&&(f===".."?c.pop():c.push(f));return`url(${u}${c.join("/")}${u})`})}function Kt(s,e=!1){return e?s.replace(/(\/\*[^*]*\*\/)|[\s;]/g,""):s.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"").replace(/0px/g,"0")}function hc(s,e,t=!1){let r=Array.from(e.childNodes),i=[],n=0;if(r.length>1&&s&&typeof s=="string"){let o=Kt(s,t),a=o.length/s.length;for(let l=1;l<r.length;l++)if(r[l].textContent&&typeof r[l].textContent=="string"){let u=Kt(r[l].textContent,t),c=100,h=3;for(;h<u.length&&(u[h].match(/[a-zA-Z0-9]/)||u.indexOf(u.substring(0,h),1)!==-1);h++);for(;h<u.length;h++){let f=u.substring(0,h),g=o.split(f),p=-1;if(g.length===2)p=g[0].length;else if(g.length>2&&g[0]===""&&r[l-1].textContent!=="")p=o.indexOf(f,1);else if(g.length===1){if(f=f.substring(0,f.length-1),g=o.split(f),g.length<=1)return i.push(s),i;h=c+1}else h===u.length-1&&(p=o.indexOf(f));if(g.length>=2&&h>c){let m=r[l-1].textContent;if(m&&typeof m=="string"){let d=Kt(m).length;p=o.indexOf(f,d)}p===-1&&(p=g[0].length)}if(p!==-1){let m=Math.floor(p/a);for(;m>0&&m<s.length;){if(n+=1,n>50*r.length)return i.push(s),i;let d=Kt(s.substring(0,m),t);if(d.length===p){i.push(s.substring(0,m)),s=s.substring(m),o=o.substring(p);break}else d.length<p?m+=Math.max(1,Math.floor((p-d.length)/a)):m-=Math.max(1,Math.floor((d.length-p)*a))}break}}}}return i.push(s),i}function fc(s,e){return hc(s,e).join("/* rr_split */")}function da(){return dc++}function mc(s){if(s instanceof HTMLFormElement)return"form";let e=Oe(s.tagName);return pc.test(e)?"div":e}function wc(s,e){if(e.trim()==="")return e;let t=0;function r(n){let o,a=n.exec(e.substring(t));return a?(o=a[0],t+=o.length,o):""}let i=[];for(;r(yc),!(t>=e.length);){let n=r(gc);if(n.slice(-1)===",")n=Ye(s,n.substring(0,n.length-1)),i.push(n);else{let o="";n=Ye(s,n);let a=!1;for(;;){let l=e.charAt(t);if(l===""){i.push((n+o).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){t+=1,i.push((n+o).trim());break}else l==="("&&(a=!0);o+=l,t+=1}}}return i.join(", ")}function Ye(s,e){return!e||e.trim()===""?e:Ji(s,e)}function vc(s){return!!(s.tagName==="svg"||s.ownerSVGElement)}function Ji(s,e){let t=no.get(s);if(t||(t=s.createElement("a"),no.set(s,t)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return t.setAttribute("href",e),t.href}function pa(s,e,t,r){return r&&(t==="src"||t==="href"&&!(e==="use"&&r[0]==="#")||t==="xlink:href"&&r[0]!=="#"||t==="background"&&["table","td","th"].includes(e)?Ye(s,r):t==="srcset"?wc(s,r):t==="style"?Ar(r,Ji(s)):e==="object"&&t==="data"?Ye(s,r):r)}function ma(s,e,t){return["video","audio"].includes(s)&&e==="autoplay"}function bc(s,e,t){try{if(typeof e=="string"){if(s.classList.contains(e))return!0}else for(let r=s.classList.length;r--;){let i=s.classList[r];if(e.test(i))return!0}if(t)return s.matches(t)}catch{}return!1}function Or(s,e,t){if(!s)return!1;if(s.nodeType!==s.ELEMENT_NODE)return t?Or(q.parentNode(s),e,t):!1;for(let r=s.classList.length;r--;){let i=s.classList[r];if(e.test(i))return!0}return t?Or(q.parentNode(s),e,t):!1}function ga(s,e,t,r){let i;if(Zi(s)){if(i=s,!q.childNodes(i).length)return!1}else{if(q.parentElement(s)===null)return!1;i=q.parentElement(s)}try{if(typeof e=="string"){if(r){if(i.closest(`.${e}`))return!0}else if(i.classList.contains(e))return!0}else if(Or(i,e,r))return!0;if(t){if(r){if(i.closest(t))return!0}else if(i.matches(t))return!0}}catch{}return!1}function Sc(s,e,t){let r=s.contentWindow;if(!r)return;let i=!1,n;try{n=r.document.readyState}catch{return}if(n!=="complete"){let a=setTimeout(()=>{i||(e(),i=!0)},t);s.addEventListener("load",()=>{clearTimeout(a),i=!0,e()});return}let o="about:blank";if(r.location.href!==o||s.src===o||s.src==="")return setTimeout(e,0),s.addEventListener("load",e);s.addEventListener("load",e)}function Cc(s,e,t){let r=!1,i;try{i=s.sheet}catch{return}if(i)return;let n=setTimeout(()=>{r||(e(),r=!0)},t);s.addEventListener("load",()=>{clearTimeout(n),r=!0,e()})}function Ec(s,e){let{doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:o,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:u,maskInputFn:c,dataURLOptions:h={},inlineImages:f,recordCanvas:g,keepIframeSrcFn:p,newlyAddedElement:m=!1,cssCaptured:d=!1}=e,y=Ic(t,r);switch(s.nodeType){case s.DOCUMENT_NODE:return s.compatMode!=="CSS1Compat"?{type:M.Document,childNodes:[],compatMode:s.compatMode}:{type:M.Document,childNodes:[]};case s.DOCUMENT_TYPE_NODE:return{type:M.DocumentType,name:s.name,publicId:s.publicId,systemId:s.systemId,rootId:y};case s.ELEMENT_NODE:return Mc(s,{doc:t,blockClass:i,blockSelector:n,inlineStylesheet:a,maskInputOptions:l,maskInputFn:c,dataURLOptions:h,inlineImages:f,recordCanvas:g,keepIframeSrcFn:p,newlyAddedElement:m,rootId:y});case s.TEXT_NODE:return xc(s,{doc:t,needsMask:o,maskTextFn:u,rootId:y,cssCaptured:d});case s.CDATA_SECTION_NODE:return{type:M.CDATA,textContent:"",rootId:y};case s.COMMENT_NODE:return{type:M.Comment,textContent:q.textContent(s)||"",rootId:y};default:return!1}}function Ic(s,e){if(!e.hasNode(s))return;let t=e.getId(s);return t===1?void 0:t}function xc(s,e){let{needsMask:t,maskTextFn:r,rootId:i,cssCaptured:n}=e,o=q.parentNode(s),a=o&&o.tagName,l="",u=a==="STYLE"?!0:void 0,c=a==="SCRIPT"?!0:void 0;return c?l="SCRIPT_PLACEHOLDER":n||(l=q.textContent(s),u&&l&&(l=Ar(l,Ji(e.doc)))),!u&&!c&&l&&t&&(l=r?r(l,q.parentElement(s)):l.replace(/[\S]/g,"*")),{type:M.Text,textContent:l||"",rootId:i}}function Mc(s,e){let{doc:t,blockClass:r,blockSelector:i,inlineStylesheet:n,maskInputOptions:o={},maskInputFn:a,dataURLOptions:l={},inlineImages:u,recordCanvas:c,keepIframeSrcFn:h,newlyAddedElement:f=!1,rootId:g}=e,p=bc(s,r,i),m=mc(s),d={},y=s.attributes.length;for(let w=0;w<y;w++){let S=s.attributes[w];ma(m,S.name,S.value)||(d[S.name]=pa(t,m,Oe(S.name),S.value))}if(m==="link"&&n){let w=Array.from(t.styleSheets).find(x=>x.href===s.href),S=null;w&&(S=js(w)),S&&(delete d.rel,delete d.href,d._cssText=S)}if(m==="style"&&s.sheet){let w=js(s.sheet);w&&(s.childNodes.length>1&&(w=fc(w,s)),d._cssText=w)}if(["input","textarea","select"].includes(m)){let w=s.value,S=s.checked;d.type!=="radio"&&d.type!=="checkbox"&&d.type!=="submit"&&d.type!=="button"&&w?d.value=Nr({element:s,type:Rr(s),tagName:m,value:w,maskInputOptions:o,maskInputFn:a}):S&&(d.checked=S)}if(m==="option"&&(s.selected&&!o.select?d.selected=!0:delete d.selected),m==="dialog"&&s.open&&(d.rr_open_mode=s.matches("dialog:modal")?"modal":"non-modal"),m==="canvas"&&c){if(s.__context==="2d")ic(s)||(d.rr_dataURL=s.toDataURL(l.type,l.quality));else if(!("__context"in s)){let w=s.toDataURL(l.type,l.quality),S=t.createElement("canvas");S.width=s.width,S.height=s.height;let x=S.toDataURL(l.type,l.quality);w!==x&&(d.rr_dataURL=w)}}if(m==="img"&&u){Ve||(Ve=t.createElement("canvas"),io=Ve.getContext("2d"));let w=s,S=w.currentSrc||w.getAttribute("src")||"<unknown-src>",x=w.crossOrigin,N=()=>{w.removeEventListener("load",N);try{Ve.width=w.naturalWidth,Ve.height=w.naturalHeight,io.drawImage(w,0,0),d.rr_dataURL=Ve.toDataURL(l.type,l.quality)}catch(B){if(w.crossOrigin!=="anonymous"){w.crossOrigin="anonymous",w.complete&&w.naturalWidth!==0?N():w.addEventListener("load",N);return}else console.warn(`Cannot inline img src=${S}! Error: ${B}`)}w.crossOrigin==="anonymous"&&(x?d.crossOrigin=x:w.removeAttribute("crossorigin"))};w.complete&&w.naturalWidth!==0?N():w.addEventListener("load",N)}if(["audio","video"].includes(m)){let w=d;w.rr_mediaState=s.paused?"paused":"played",w.rr_mediaCurrentTime=s.currentTime,w.rr_mediaPlaybackRate=s.playbackRate,w.rr_mediaMuted=s.muted,w.rr_mediaLoop=s.loop,w.rr_mediaVolume=s.volume}if(f||(s.scrollLeft&&(d.rr_scrollLeft=s.scrollLeft),s.scrollTop&&(d.rr_scrollTop=s.scrollTop)),p){let{width:w,height:S}=s.getBoundingClientRect();d={class:d.class,rr_width:`${w}px`,rr_height:`${S}px`}}m==="iframe"&&!h(d.src)&&(s.contentDocument||(d.rr_src=d.src),delete d.src);let b;try{customElements.get(m)&&(b=!0)}catch{}return{type:M.Element,tagName:m,attributes:d,childNodes:[],isSVG:vc(s)||void 0,needBlock:p,rootId:g,isCustom:b}}function W(s){return s==null?"":s.toLowerCase()}function ya(s){return s===!0||s==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:s==="all",headMetaDescKeywords:s==="all",headTitleMutations:s==="all"}:s||{}}function Nc(s,e){if(e.comment&&s.type===M.Comment)return!0;if(s.type===M.Element){if(e.script&&(s.tagName==="script"||s.tagName==="link"&&(s.attributes.rel==="preload"&&s.attributes.as==="script"||s.attributes.rel==="modulepreload")||s.tagName==="link"&&s.attributes.rel==="prefetch"&&typeof s.attributes.href=="string"&&Xi(s.attributes.href)==="js"))return!0;if(e.headFavicon&&(s.tagName==="link"&&s.attributes.rel==="shortcut icon"||s.tagName==="meta"&&(W(s.attributes.name).match(/^msapplication-tile(image|color)$/)||W(s.attributes.name)==="application-name"||W(s.attributes.rel)==="icon"||W(s.attributes.rel)==="apple-touch-icon"||W(s.attributes.rel)==="shortcut icon")))return!0;if(s.tagName==="meta"){if(e.headMetaDescKeywords&&W(s.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(W(s.attributes.property).match(/^(og|twitter|fb):/)||W(s.attributes.name).match(/^(og|twitter):/)||W(s.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(W(s.attributes.name)==="robots"||W(s.attributes.name)==="googlebot"||W(s.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&s.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(W(s.attributes.name)==="author"||W(s.attributes.name)==="generator"||W(s.attributes.name)==="framework"||W(s.attributes.name)==="publisher"||W(s.attributes.name)==="progid"||W(s.attributes.property).match(/^article:/)||W(s.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(W(s.attributes.name)==="google-site-verification"||W(s.attributes.name)==="yandex-verification"||W(s.attributes.name)==="csrf-token"||W(s.attributes.name)==="p:domain_verify"||W(s.attributes.name)==="verify-v1"||W(s.attributes.name)==="verification"||W(s.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Ze(s,e){let{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:o,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:h,maskInputFn:f,slimDOMOptions:g,dataURLOptions:p={},inlineImages:m=!1,recordCanvas:d=!1,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:w=5e3,onStylesheetLoad:S,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:N=()=>!1,newlyAddedElement:B=!1,cssCaptured:F=!1}=e,{needsMask:H}=e,{preserveWhiteSpace:K=!0}=e;H||(H=ga(s,o,a,H===void 0));let te=Ec(s,{doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:H,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:f,dataURLOptions:p,inlineImages:m,recordCanvas:d,keepIframeSrcFn:N,newlyAddedElement:B,cssCaptured:F});if(!te)return console.warn(s,"not serialized"),null;let re;r.hasNode(s)?re=r.getId(s):Nc(te,g)||!K&&te.type===M.Text&&!te.textContent.replace(/^\s+|\s+$/gm,"").length?re=xt:re=da();let A=Object.assign(te,{id:re});if(r.add(s,A),re===xt)return null;y&&y(s);let De=!l;if(A.type===M.Element){De=De&&!A.needBlock,delete A.needBlock;let Y=q.shadowRoot(s);Y&&St(Y)&&(A.isShadowHost=!0)}if((A.type===M.Document||A.type===M.Element)&&De){g.headWhitespace&&A.type===M.Element&&A.tagName==="head"&&(K=!1);let Y={doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:H,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:f,slimDOMOptions:g,dataURLOptions:p,inlineImages:m,recordCanvas:d,preserveWhiteSpace:K,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:S,stylesheetLoadTimeout:x,keepIframeSrcFn:N,cssCaptured:!1};if(!(A.type===M.Element&&A.tagName==="textarea"&&A.attributes.value!==void 0)){A.type===M.Element&&A.attributes._cssText!==void 0&&typeof A.attributes._cssText=="string"&&(Y.cssCaptured=!0);for(let le of Array.from(q.childNodes(s))){let se=Ze(le,Y);se&&A.childNodes.push(se)}}let P=null;if(Zi(s)&&(P=q.shadowRoot(s)))for(let le of Array.from(q.childNodes(P))){let se=Ze(le,Y);se&&(St(P)&&(se.isShadow=!0),A.childNodes.push(se))}}let ke=q.parentNode(s);return ke&&bt(ke)&&St(ke)&&(A.isShadow=!0),A.type===M.Element&&A.tagName==="iframe"&&Sc(s,()=>{let Y=s.contentDocument;if(Y&&b){let P=Ze(Y,{doc:Y,mirror:r,blockClass:i,blockSelector:n,needsMask:H,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:f,slimDOMOptions:g,dataURLOptions:p,inlineImages:m,recordCanvas:d,preserveWhiteSpace:K,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:S,stylesheetLoadTimeout:x,keepIframeSrcFn:N});P&&b(s,P)}},w),A.type===M.Element&&A.tagName==="link"&&typeof A.attributes.rel=="string"&&(A.attributes.rel==="stylesheet"||A.attributes.rel==="preload"&&typeof A.attributes.href=="string"&&Xi(A.attributes.href)==="css")&&Cc(s,()=>{if(S){let Y=Ze(s,{doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:H,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:f,slimDOMOptions:g,dataURLOptions:p,inlineImages:m,recordCanvas:d,preserveWhiteSpace:K,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:S,stylesheetLoadTimeout:x,keepIframeSrcFn:N});Y&&S(s,Y)}},x),A}function Rc(s,e){let{mirror:t=new It,blockClass:r="rr-block",blockSelector:i=null,maskTextClass:n="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:h,maskInputFn:f,slimDOM:g=!1,dataURLOptions:p,preserveWhiteSpace:m,onSerialize:d,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:S,keepIframeSrcFn:x=()=>!1}=e||{},N=c===!0?{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}:c===!1?{password:!0}:c,B=ya(g);return Ze(s,{doc:s,mirror:t,blockClass:r,blockSelector:i,maskTextClass:n,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:N,maskTextFn:h,maskInputFn:f,slimDOMOptions:B,dataURLOptions:p,inlineImages:l,recordCanvas:u,preserveWhiteSpace:m,onSerialize:d,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:S,keepIframeSrcFn:x,newlyAddedElement:!1})}function Dc(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function kc(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var i=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return s[r]}})}),t}function $c(s){return s[0].toUpperCase()+s.slice(1)}function Zs(s,e){new Fc(e).stringify(s)}function Xs(s,e){let t=new s.constructor;for(let r in s){if(!Object.prototype.hasOwnProperty.call(s,r)||r==="proxyCache")continue;let i=s[r],n=typeof i;r==="parent"&&n==="object"?e&&(t[r]=e):r==="source"?t[r]=i:Array.isArray(i)?t[r]=i.map(o=>Xs(o,t)):(n==="object"&&i!==null&&(i=Xs(i)),t[r]=i)}return t}function Kc(s){return Buffer?Buffer.from(s,"base64").toString():window.atob(s)}function ka(s){return s.map(e=>(e.nodes&&(e.nodes=ka(e.nodes)),delete e.source,e))}function _a(s){if(s[Na]=!1,s.proxyOf.nodes)for(let e of s.proxyOf.nodes)_a(e)}function Ah(s){for(let e=s.length-1;e>=0;e--){let t=s[e],r=t[3]||t[2];if(r)return r}}function _r(s,e){let t=new _h(s,e),r=new kh(t);try{r.parse()}catch(i){throw i}return r.root}function mt(s){return typeof s=="object"&&typeof s.then=="function"}function ja(s){let e=!1,t=zh[s.type];return s.type==="decl"?e=s.prop.toLowerCase():s.type==="atrule"&&(e=s.name.toLowerCase()),e&&s.append?[t,t+"-"+e,et,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:s.append?[t,et,t+"Exit"]:[t,t+"Exit"]}function Eo(s){let e;return s.type==="document"?e=["Document",et,"DocumentExit"]:s.type==="root"?e=["Root",et,"RootExit"]:e=ja(s),{eventIndex:0,events:e,iterator:0,node:s,visitorIndex:0,visitors:[]}}function ii(s){return s[me]=!1,s.nodes&&s.nodes.forEach(e=>ii(e)),s}function At(s,e){if(Array.isArray(s))return s.map(i=>At(i));let{inputs:t,...r}=s;if(t){e=[];for(let i of t){let n={...i,__proto__:of.prototype};n.map&&(n.map={...n.map,__proto__:rf.prototype}),e.push(n)}}if(r.nodes&&(r.nodes=s.nodes.map(i=>At(i,e))),r.source){let{inputId:i,...n}=r.source;r.source=n,i!=null&&(r.source.input=e[i])}if(r.type==="root")return new af(r);if(r.type==="decl")return new tf(r);if(r.type==="rule")return new lf(r);if(r.type==="comment")return new sf(r);if(r.type==="atrule")return new nf(r);throw new Error("Unknown node type: "+s.type)}function L(...s){return s.length===1&&Array.isArray(s[0])&&(s=s[0]),new an(s)}function Cf(s){let e=Io[s.tagName]?Io[s.tagName]:s.tagName;return e==="link"&&s.attributes._cssText&&(e="style"),e}function rs(s,e){let t=e?.stylesWithHoverClass.get(s);if(t)return t;let r=s;try{r=G([Oc,Tc]).process(s).css}catch(i){console.warn("Failed to adapt css for replay",i)}return e?.stylesWithHoverClass.set(s,r),r}function xo(){return{stylesWithHoverClass:new Map}}function Ef(s,e,t,r){let i=[];for(let l of s.childNodes)l.type===M.Text&&i.push(l);let n=e.split("/* rr_split */");for(;n.length>1&&n.length>i.length;)n.splice(-2,2,n.slice(-2).join(""));let o="";t&&(o=rs(n.join(""),r));let a=0;for(let l=0;l<i.length&&l!==n.length;l++){let u=i[l];if(!t)u.textContent=n[l];else if(l<n.length-1){let c=a,h=n[l+1].length;h=Math.min(h,30);let f=!1;for(;h>2;h--){let g=n[l+1].substring(0,h),p=o.substring(a).indexOf(g);if(f=p!==-1,f){c+=p;break}}f||(c+=n[l].length),u.textContent=o.substring(a,c),a=c}else u.textContent=o.substring(a)}}function If(s,e,t,r){let{doc:i,hackCss:n,cache:o}=r;s.childNodes.length?Ef(s,t,n,o):(n&&(t=rs(t,o)),e.appendChild(i.createTextNode(t)))}function xf(s,e){var t;let{doc:r,hackCss:i,cache:n}=e;switch(s.type){case M.Document:return r.implementation.createDocument(null,"",null);case M.DocumentType:return r.implementation.createDocumentType(s.name||"html",s.publicId,s.systemId);case M.Element:{let o=Cf(s),a;s.isSVG?a=r.createElementNS("http://www.w3.org/2000/svg",o):(s.isCustom&&((t=r.defaultView)!=null&&t.customElements)&&!r.defaultView.customElements.get(s.tagName)&&r.defaultView.customElements.define(s.tagName,class extends r.defaultView.HTMLElement{}),a=r.createElement(o));let l={};for(let u in s.attributes){if(!Object.prototype.hasOwnProperty.call(s.attributes,u))continue;let c=s.attributes[u];if(!(o==="option"&&u==="selected"&&c===!1)&&c!==null){if(c===!0&&(c=""),u.startsWith("rr_")){l[u]=c;continue}if(typeof c=="string"){if(o==="style"&&u==="_cssText"){If(s,a,c,e);continue}else if(o==="textarea"&&u==="value"){a.appendChild(r.createTextNode(c)),s.childNodes=[];continue}}try{if(s.isSVG&&u==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",u,c.toString());else if(u==="onload"||u==="onclick"||u.substring(0,7)==="onmouse")a.setAttribute("_"+u,c.toString());else if(o==="meta"&&s.attributes["http-equiv"]==="Content-Security-Policy"&&u==="content"){a.setAttribute("csp-content",c.toString());continue}else o==="link"&&(s.attributes.rel==="preload"&&s.attributes.as==="script"||s.attributes.rel==="modulepreload")||o==="link"&&s.attributes.rel==="prefetch"&&typeof s.attributes.href=="string"&&Xi(s.attributes.href)==="js"||(o==="img"&&s.attributes.srcset&&s.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",s.attributes.srcset):a.setAttribute(u,c.toString()))}catch{}}}for(let u in l){let c=l[u];if(o==="canvas"&&u==="rr_dataURL"){let h=r.createElement("img");h.onload=()=>{let f=a.getContext("2d");f&&f.drawImage(h,0,0,h.width,h.height)},h.src=c.toString(),a.RRNodeType&&(a.rr_dataURL=c.toString())}else if(o==="img"&&u==="rr_dataURL"){let h=a;h.currentSrc.startsWith("data:")||(h.setAttribute("rrweb-original-src",s.attributes.src),h.src=c.toString())}if(u==="rr_width")a.style.setProperty("width",c.toString());else if(u==="rr_height")a.style.setProperty("height",c.toString());else if(u==="rr_mediaCurrentTime"&&typeof c=="number")a.currentTime=c;else if(u==="rr_mediaState")switch(c){case"played":a.play().catch(h=>console.warn("media playback error",h));break;case"paused":a.pause();break}else u==="rr_mediaPlaybackRate"&&typeof c=="number"?a.playbackRate=c:u==="rr_mediaMuted"&&typeof c=="boolean"?a.muted=c:u==="rr_mediaLoop"&&typeof c=="boolean"?a.loop=c:u==="rr_mediaVolume"&&typeof c=="number"?a.volume=c:u==="rr_open_mode"&&a.setAttribute("rr_open_mode",c)}if(s.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return a}case M.Text:return s.isStyle&&i?r.createTextNode(rs(s.textContent,n)):r.createTextNode(s.textContent);case M.CDATA:return r.createCDATASection(s.textContent);case M.Comment:return r.createComment(s.textContent);default:return null}}function Ct(s,e){let{doc:t,mirror:r,skipChild:i=!1,hackCss:n=!0,afterAppend:o,cache:a}=e;if(r.has(s.id)){let u=r.getNode(s.id),c=r.getMeta(u);if(nc(c,s))return r.getNode(s.id)}let l=xf(s,{doc:t,hackCss:n,cache:a});if(!l)return null;if(s.rootId&&r.getNode(s.rootId)!==t&&r.replace(s.rootId,t),s.type===M.Document&&(t.close(),t.open(),s.compatMode==="BackCompat"&&s.childNodes&&s.childNodes[0].type!==M.DocumentType&&(s.childNodes[0].type===M.Element&&"xmlns"in s.childNodes[0].attributes&&s.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?t.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):t.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),l=t),r.add(l,s),(s.type===M.Document||s.type===M.Element)&&!i)for(let u of s.childNodes){let c=Ct(u,{doc:t,mirror:r,skipChild:!1,hackCss:n,afterAppend:o,cache:a});if(!c){console.warn("Failed to rebuild",u);continue}if(u.isShadow&&Zi(l)&&l.shadowRoot)l.shadowRoot.appendChild(c);else if(s.type===M.Document&&u.type==M.Element){let h=c,f=null;h.childNodes.forEach(g=>{g.nodeName==="BODY"&&(f=g)}),f?(h.removeChild(f),l.appendChild(c),h.appendChild(f)):l.appendChild(c)}else l.appendChild(c);o&&o(c,u.id)}return l}function Mf(s,e){function t(r){e(r)}for(let r of s.getIds())s.has(r)&&t(s.getNode(r))}function Nf(s,e){let t=e.getMeta(s);if(t?.type!==M.Element)return;let r=s;for(let i in t.attributes){if(!(Object.prototype.hasOwnProperty.call(t.attributes,i)&&i.startsWith("rr_")))continue;let n=t.attributes[i];i==="rr_scrollLeft"&&(r.scrollLeft=n),i==="rr_scrollTop"&&(r.scrollTop=n)}}function Rf(s,e){let{doc:t,onVisit:r,hackCss:i=!0,afterAppend:n,cache:o,mirror:a=new It}=e,l=Ct(s,{doc:t,mirror:a,skipChild:!1,hackCss:i,afterAppend:n,cache:o});return Mf(a,u=>{r&&r(u),Nf(u,a)}),l}function _f(){return new kf}function Pf(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Lf(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var i=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return s[r]}})}),t}function Bf(s){return s[0].toUpperCase()+s.slice(1)}function ui(s,e){new Wf(e).stringify(s)}function ci(s,e){let t=new s.constructor;for(let r in s){if(!Object.prototype.hasOwnProperty.call(s,r)||r==="proxyCache")continue;let i=s[r],n=typeof i;r==="parent"&&n==="object"?e&&(t[r]=e):r==="source"?t[r]=i:Array.isArray(i)?t[r]=i.map(o=>ci(o,t)):(n==="object"&&i!==null&&(i=ci(i)),t[r]=i)}return t}function ed(s){return Buffer?Buffer.from(s,"base64").toString():window.atob(s)}function ml(s){return s.map(e=>(e.nodes&&(e.nodes=ml(e.nodes)),delete e.source,e))}function gl(s){if(s[ul]=!1,s.proxyOf.nodes)for(let e of s.proxyOf.nodes)gl(e)}function Dd(s){for(let e=s.length-1;e>=0;e--){let t=s[e],r=t[3]||t[2];if(r)return r}}function Fr(s,e){let t=new $d(s,e),r=new Ld(t);try{r.parse()}catch(i){throw i}return r.root}function yt(s){return typeof s=="object"&&typeof s.then=="function"}function Nl(s){let e=!1,t=jd[s.type];return s.type==="decl"?e=s.prop.toLowerCase():s.type==="atrule"&&(e=s.name.toLowerCase()),e&&s.append?[t,t+"-"+e,st,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:s.append?[t,st,t+"Exit"]:[t,t+"Exit"]}function zo(s){let e;return s.type==="document"?e=["Document",st,"DocumentExit"]:s.type==="root"?e=["Root",st,"RootExit"]:e=Nl(s),{eventIndex:0,events:e,iterator:0,node:s,visitorIndex:0,visitors:[]}}function vi(s){return s[ge]=!1,s.nodes&&s.nodes.forEach(e=>vi(e)),s}function kt(s,e){if(Array.isArray(s))return s.map(i=>kt(i));let{inputs:t,...r}=s;if(t){e=[];for(let i of t){let n={...i,__proto__:lp.prototype};n.map&&(n.map={...n.map,__proto__:np.prototype}),e.push(n)}}if(r.nodes&&(r.nodes=s.nodes.map(i=>kt(i,e))),r.source){let{inputId:i,...n}=r.source;r.source=n,i!=null&&(r.source.input=e[i])}if(r.type==="root")return new up(r);if(r.type==="decl")return new ip(r);if(r.type==="rule")return new cp(r);if(r.type==="comment")return new op(r);if(r.type==="atrule")return new ap(r);throw new Error("Unknown node type: "+s.type)}function $(...s){return s.length===1&&Array.isArray(s[0])&&(s=s[0]),new yn(s)}function Ip(s){let e={},t=/;(?![^(]*\))/g,r=/:(.+)/,i=/\/\*.*?\*\//g;return s.replace(i,"").split(t).forEach(function(n){if(n){let o=n.split(r);o.length>1&&(e[Ci(o[0].trim())]=o[1].trim())}}),e}function Vo(s){let e=[];for(let t in s){let r=s[t];if(typeof r!="string")continue;let i=Rp(t);e.push(`${i}: ${r};`)}return e.join(" ")}function wn(s,e){return e.parentNode&&e.parentNode.removeChild(e),s.lastChild?(s.lastChild.nextSibling=e,e.previousSibling=s.lastChild):(s.firstChild=e,e.previousSibling=null),s.lastChild=e,e.nextSibling=null,e.parentNode=s,e.parentElement=s,e.ownerDocument=s.ownerDocument,e}function Ll(s,e,t){if(!t)return wn(s,e);if(t.parentNode!==s)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return e===t||(e.parentNode&&e.parentNode.removeChild(e),e.previousSibling=t.previousSibling,t.previousSibling=e,e.nextSibling=t,e.previousSibling?e.previousSibling.nextSibling=e:s.firstChild=e,e.parentElement=s,e.parentNode=s,e.ownerDocument=s.ownerDocument),e}function $l(s,e){if(e.parentNode!==s)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return e.previousSibling?e.previousSibling.nextSibling=e.nextSibling:s.firstChild=e.nextSibling,e.nextSibling?e.nextSibling.previousSibling=e.previousSibling:s.lastChild=e.previousSibling,e.previousSibling=null,e.nextSibling=null,e.parentElement=null,e.parentNode=null,e}function Vr(s,e,t,r=e.mirror||e.ownerDocument.mirror){s=Op(s,e,t,r),Fl(s,e,t,r),Tp(s,e,t)}function Op(s,e,t,r){var i;if(t.afterAppend&&!ye&&(ye=new WeakSet,setTimeout(()=>{ye=null},0)),!vn(s,e)){let n=Gr(e,t.mirror,r);(i=s.parentNode)==null||i.replaceChild(n,s),s=n}switch(e.RRNodeType){case O.Document:{if(!Ge(s,e,t.mirror,r)){let n=r.getMeta(e);n&&(t.mirror.removeNodeFromMap(s),s.close(),s.open(),t.mirror.add(s,n),ye?.add(s))}break}case O.Element:{let n=s,o=e;switch(o.tagName){case"IFRAME":{let a=s.contentDocument;if(!a)break;Vr(a,e.contentDocument,t,r);break}}o.shadowRoot&&(n.shadowRoot||n.attachShadow({mode:"open"}),Fl(n.shadowRoot,o.shadowRoot,t,r)),Dp(n,o,r);break}}return s}function Tp(s,e,t){var r;switch(e.RRNodeType){case O.Document:{let i=e.scrollData;i&&t.applyScroll(i,!0);break}case O.Element:{let i=s,n=e;switch(n.scrollData&&t.applyScroll(n.scrollData,!0),n.inputData&&t.applyInput(n.inputData),n.tagName){case"AUDIO":case"VIDEO":{let o=s,a=n;a.paused!==void 0&&(a.paused?o.pause():o.play()),a.muted!==void 0&&(o.muted=a.muted),a.volume!==void 0&&(o.volume=a.volume),a.currentTime!==void 0&&(o.currentTime=a.currentTime),a.playbackRate!==void 0&&(o.playbackRate=a.playbackRate),a.loop!==void 0&&(o.loop=a.loop);break}case"CANVAS":{let o=e;if(o.rr_dataURL!==null){let a=document.createElement("img");a.onload=()=>{let l=i.getContext("2d");l&&l.drawImage(a,0,0,a.width,a.height)},a.src=o.rr_dataURL}o.canvasMutations.forEach(a=>t.applyCanvas(a.event,a.mutation,s));break}case"STYLE":{let o=i.sheet;o&&e.rules.forEach(a=>t.applyStyleSheetMutation(a,o));break}case"DIALOG":{let o=i,a=n,l=o.open,u=o.matches("dialog:modal"),c=a.open,h=a.isModal,f=u!==h,g=l!==c;if((f||l&&g)&&o.close(),c&&(g||f))try{h?o.showModal():o.show()}catch(p){console.warn(p)}break}}break}case O.Text:case O.Comment:case O.CDATA:{s.textContent!==e.data&&(s.textContent=e.data);break}}ye?.has(s)&&(ye.delete(s),(r=t.afterAppend)==null||r.call(t,s,t.mirror.getId(s)))}function Dp(s,e,t){let r=s.attributes,i=e.attributes;for(let n in i){let o=i[n],a=t.getMeta(e);if(a?.isSVG&&Ni[n])s.setAttributeNS(Ni[n],n,o);else if(e.tagName==="CANVAS"&&n==="rr_dataURL"){let l=document.createElement("img");l.src=o,l.onload=()=>{let u=s.getContext("2d");u&&u.drawImage(l,0,0,l.width,l.height)}}else{if(e.tagName==="IFRAME"&&n==="srcdoc")continue;try{s.setAttribute(n,o)}catch(l){console.warn(l)}}}for(let{name:n}of Array.from(r))n in i||s.removeAttribute(n);e.scrollLeft&&(s.scrollLeft=e.scrollLeft),e.scrollTop&&(s.scrollTop=e.scrollTop)}function Fl(s,e,t,r){let i=Array.from(s.childNodes),n=e.childNodes;if(i.length===0&&n.length===0)return;let o=0,a=i.length-1,l=0,u=n.length-1,c=i[o],h=i[a],f=n[l],g=n[u],p,m;for(;o<=a&&l<=u;)if(c===void 0)c=i[++o];else if(h===void 0)h=i[--a];else if(Ge(c,f,t.mirror,r))c=i[++o],f=n[++l];else if(Ge(h,g,t.mirror,r))h=i[--a],g=n[--u];else if(Ge(c,g,t.mirror,r)){try{s.insertBefore(c,h.nextSibling)}catch(b){console.warn(b)}c=i[++o],g=n[--u]}else if(Ge(h,f,t.mirror,r)){try{s.insertBefore(h,c)}catch(b){console.warn(b)}h=i[--a],f=n[++l]}else{if(!p){p={};for(let w=o;w<=a;w++){let S=i[w];S&&t.mirror.hasNode(S)&&(p[t.mirror.getId(S)]=w)}}m=p[r.getId(f)];let b=i[m];if(m!==void 0&&b&&Ge(b,f,t.mirror,r)){try{s.insertBefore(b,c)}catch(w){console.warn(w)}i[m]=void 0}else{let w=Gr(f,t.mirror,r);s.nodeName==="#document"&&c&&(w.nodeType===w.DOCUMENT_TYPE_NODE&&c.nodeType===c.DOCUMENT_TYPE_NODE||w.nodeType===w.ELEMENT_NODE&&c.nodeType===c.ELEMENT_NODE)&&(s.removeChild(c),t.mirror.removeNodeFromMap(c),c=i[++o]);try{s.insertBefore(w,c||null)}catch(S){console.warn(S)}}f=n[++l]}if(o>a){let b=n[u+1],w=null;for(b&&(w=t.mirror.getNode(r.getId(b)));l<=u;++l){let S=Gr(n[l],t.mirror,r);try{s.insertBefore(S,w)}catch(x){console.warn(x)}}}else if(l>u)for(;o<=a;o++){let b=i[o];if(!(!b||b.parentNode!==s))try{s.removeChild(b),t.mirror.removeNodeFromMap(b)}catch(w){console.warn(w)}}let d=s.firstChild,y=e.firstChild;for(;d!==null&&y!==null;)Vr(d,y,t,r),d=d.nextSibling,y=y.nextSibling}function Gr(s,e,t){let r=t.getId(s),i=t.getMeta(s),n=null;if(r>-1&&(n=e.getNode(r)),n!==null&&vn(n,s))return n;switch(s.RRNodeType){case O.Document:n=new Document;break;case O.DocumentType:n=document.implementation.createDocumentType(s.name,s.publicId,s.systemId);break;case O.Element:{let o=s.tagName.toLowerCase();o=Ap[o]||o,i&&"isSVG"in i&&i?.isSVG?n=document.createElementNS(Ni.svg,o):n=document.createElement(s.tagName);break}case O.Text:n=document.createTextNode(s.data);break;case O.Comment:n=document.createComment(s.data);break;case O.CDATA:n=document.createCDATASection(s.data);break}i&&e.add(n,{...i});try{ye?.add(n)}catch{}return n}function vn(s,e){return s.nodeType!==e.nodeType?!1:s.nodeType!==s.ELEMENT_NODE||s.tagName.toUpperCase()===e.tagName}function Ge(s,e,t,r){let i=t.getId(s),n=r.getId(e);return i===-1||i!==n?!1:vn(s,e)}function $p(s){return s instanceof HTMLFormElement?"FORM":s.tagName.toUpperCase()}function Ul(s,e,t,r){let i;switch(s.nodeType){case ne.DOCUMENT_NODE:r&&r.nodeName==="IFRAME"?i=r.contentDocument:(i=e,i.compatMode=s.compatMode);break;case ne.DOCUMENT_TYPE_NODE:{let o=s;i=e.createDocumentType(o.name,o.publicId,o.systemId);break}case ne.ELEMENT_NODE:{let o=s,a=$p(o);i=e.createElement(a);let l=i;for(let{name:u,value:c}of Array.from(o.attributes))l.attributes[u]=c;o.scrollLeft&&(l.scrollLeft=o.scrollLeft),o.scrollTop&&(l.scrollTop=o.scrollTop);break}case ne.TEXT_NODE:i=e.createTextNode(s.textContent||"");break;case ne.CDATA_SECTION_NODE:i=e.createCDATASection(s.data);break;case ne.COMMENT_NODE:i=e.createComment(s.textContent||"");break;case ne.DOCUMENT_FRAGMENT_NODE:i=r.attachShadow({mode:"open"});break;default:return null}let n=t.getMeta(s);return e instanceof ot&&(n||(n=Bl(i,e.unserializedId),t.add(s,n)),e.mirror.add(i,{...n})),i}function Fp(s,e=_f(),t=new ot){function r(i,n){let o=Ul(i,t,e,n);if(o!==null)if(n?.nodeName!=="IFRAME"&&i.nodeType!==ne.DOCUMENT_FRAGMENT_NODE&&(n?.appendChild(o),o.parentNode=n,o.parentElement=n),i.nodeName==="IFRAME"){let a=i.contentDocument;a&&r(a,o)}else(i.nodeType===ne.DOCUMENT_NODE||i.nodeType===ne.ELEMENT_NODE||i.nodeType===ne.DOCUMENT_FRAGMENT_NODE)&&(i.nodeType===ne.ELEMENT_NODE&&i.shadowRoot&&r(i.shadowRoot,o),i.childNodes.forEach(a=>r(a,o)))}return r(s,null),t}function Up(){return new ki}function Bl(s,e){switch(s.RRNodeType){case O.Document:return{id:e,type:s.RRNodeType,childNodes:[]};case O.DocumentType:{let t=s;return{id:e,type:s.RRNodeType,name:t.name,publicId:t.publicId,systemId:t.systemId}}case O.Element:return{id:e,type:s.RRNodeType,tagName:s.tagName.toLowerCase(),attributes:{},childNodes:[]};case O.Text:return{id:e,type:s.RRNodeType,textContent:s.textContent||""};case O.Comment:return{id:e,type:s.RRNodeType,textContent:s.textContent||""};case O.CDATA:return{id:e,type:s.RRNodeType,textContent:""}}}function bn(s){if(gr[s])return gr[s];let e=globalThis[s],t=e.prototype,r=s in Go?Go[s]:void 0,i=!!(r&&r.every(a=>{var l,u;return!!((u=(l=Object.getOwnPropertyDescriptor(t,a))==null?void 0:l.get)!=null&&u.toString().includes("[native code]"))})),n=s in jo?jo[s]:void 0,o=!!(n&&n.every(a=>{var l;return typeof t[a]=="function"&&((l=t[a])==null?void 0:l.toString().includes("[native code]"))}));if(i&&o&&!Bp())return gr[s]=e.prototype,e.prototype;try{let a=document.createElement("iframe");document.body.appendChild(a);let l=a.contentWindow;if(!l)return e.prototype;let u=l[s].prototype;return document.body.removeChild(a),u?gr[s]=u:t}catch{return t}}function Ie(s,e,t){var r;let i=`${s}.${String(t)}`;if(Bs[i])return Bs[i].call(e);let n=bn(s),o=(r=Object.getOwnPropertyDescriptor(n,t))==null?void 0:r.get;return o?(Bs[i]=o,o.call(e)):e[t]}function Wl(s,e,t){let r=`${s}.${String(t)}`;if(Ws[r])return Ws[r].bind(e);let n=bn(s)[t];return typeof n!="function"?e[t]:(Ws[r]=n,n.bind(e))}function Wp(s){return Ie("Node",s,"ownerDocument")}function zp(s){return Ie("Node",s,"childNodes")}function Vp(s){return Ie("Node",s,"parentNode")}function Gp(s){return Ie("Node",s,"parentElement")}function jp(s){return Ie("Node",s,"textContent")}function Hp(s,e){return Wl("Node",s,"contains")(e)}function Yp(s){return Wl("Node",s,"getRootNode")()}function Zp(s){return!s||!("host"in s)?null:Ie("ShadowRoot",s,"host")}function Xp(s){return s.styleSheets}function Jp(s){return!s||!("shadowRoot"in s)?null:Ie("Element",s,"shadowRoot")}function Kp(s,e){return Ie("Element",s,"querySelector")(e)}function qp(s,e){return Ie("Element",s,"querySelectorAll")(e)}function zl(){return bn("MutationObserver").constructor}function Be(s,e,t){try{if(!(e in s))return()=>{};let r=s[e],i=t(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),s[e]=i,()=>{s[e]=r}}catch{return()=>{}}}function Q(s,e,t=document){let r={capture:!0,passive:!0};return t.addEventListener(s,e,r),()=>t.removeEventListener(s,e,r)}function lt(s,e,t={}){let r=null,i=0;return function(...n){let o=Date.now();!i&&t.leading===!1&&(i=o);let a=e-(o-i),l=this;a<=0||a>e?(r&&(clearTimeout(r),r=null),i=o,s.apply(l,n)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,s.apply(l,n)},a))}}function Bt(s,e,t,r,i=window){let n=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(o){setTimeout(()=>{t.set.call(this,o)},0),n&&n.set&&n.set.call(this,o)}}),()=>Bt(s,e,n||{},!0)}function Sn(s){var e,t,r,i;let n=s.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:n.documentElement.scrollLeft||n?.body&&((e=R.parentElement(n.body))==null?void 0:e.scrollLeft)||((t=n?.body)==null?void 0:t.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:n?.documentElement.scrollTop||n?.body&&((r=R.parentElement(n.body))==null?void 0:r.scrollTop)||((i=n?.body)==null?void 0:i.scrollTop)||0}}function Cn(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function En(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function In(s){return s?s.nodeType===s.ELEMENT_NODE?s:R.parentElement(s):null}function ee(s,e,t,r){if(!s)return!1;let i=In(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(Or(i,e,r))return!0}catch{}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function Vl(s,e){return e.getId(s)!==-1}function Ir(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===xt}function xn(s,e){if(bt(s))return!1;let t=e.getId(s);if(!e.has(t))return!0;let r=R.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?xn(r,e):!0}function Hr(s){return!!s.changedTouches}function Mn(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Gl(s){let e={},t=(i,n)=>{let o={value:i,parent:n,children:[]};return e[i.node.id]=o,o},r=[];for(let i of s){let{nextId:n,parentId:o}=i;if(n&&n in e){let a=e[n];if(a.parent){let l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,t(i,a.parent))}else{let l=r.indexOf(a);r.splice(l,0,t(i,null))}continue}if(o in e){let a=e[o];a.children.push(t(i,a));continue}r.push(t(i,null))}return r}function Nn(s,e){e(s.value);for(let t=s.children.length-1;t>=0;t--)Nn(s.children[t],e)}function qe(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function Rn(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function An(s,e){var t,r;let i=(r=(t=s.ownerDocument)==null?void 0:t.defaultView)==null?void 0:r.frameElement;if(!i||i===e)return{x:0,y:0,relativeScale:1,absoluteScale:1};let n=i.getBoundingClientRect(),o=An(i,e),a=n.height/i.clientHeight;return{x:n.x*o.relativeScale+o.x,y:n.y*o.relativeScale+o.y,relativeScale:a,absoluteScale:o.absoluteScale*a}}function Re(s){return s?s instanceof he&&"shadowRoot"in s?!!s.shadowRoot:!!R.shadowRoot(s):!1}function Xe(s,e){let t=s[e[0]];return e.length===1?t:Xe(t.cssRules[e[1]].cssRules,e.slice(2))}function _i(s){let e=[...s],t=e.pop();return{positions:e,index:t}}function jl(s){let e=new Set,t=[];for(let r=s.length;r--;){let i=s[r];e.has(i.id)||(t.push(i),e.add(i.id))}return t}function On(s){var e;let t=null;return"getRootNode"in s&&((e=R.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&R.host(R.getRootNode(s))&&(t=R.host(R.getRootNode(s))),t}function Hl(s){let e=s,t;for(;t=On(e);)e=t;return e}function Yl(s){let e=R.ownerDocument(s);if(!e)return!1;let t=Hl(s);return R.contains(e,t)}function Tn(s){let e=R.ownerDocument(s);return e?R.contains(e,s)||Yl(s):!1}function Ho(s){return"__ln"in s}function $i(s,e){s.delete(e),R.childNodes(e).forEach(t=>$i(s,t))}function em(s,e){let t=[s];for(;t.length;){let r=t.pop();e.has(r)||(e.add(r),R.childNodes(r).forEach(i=>t.push(i)))}}function Zo(s,e,t){return s.size===0?!1:tm(s,e)}function tm(s,e,t){let r=R.parentNode(e);return r?s.has(r):!1}function Xo(s,e){return s.size===0?!1:Zl(s,e)}function Zl(s,e){let t=R.parentNode(e);return t?s.has(t)?!0:Zl(s,t):!1}function rm(s){Et=s}function sm(){Et=void 0}function Wt(s){try{if("composedPath"in s){let e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch{}return s&&s.target}function Xl(s,e){let t=new Li;$e.push(t),t.init(s);let r=new(zl())(T(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function im({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};let i=typeof e.mousemove=="number"?e.mousemove:50,n=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500,o=[],a,l=lt(T(h=>{let f=Date.now()-a;s(o.map(g=>(g.timeOffset-=f,g)),h),o=[],a=null}),n),u=T(lt(T(h=>{let f=Wt(h),{clientX:g,clientY:p}=Hr(h)?h.changedTouches[0]:h;a||(a=_t()),o.push({x:g,y:p,id:r.getId(f),timeOffset:_t()-a}),l(typeof DragEvent<"u"&&h instanceof DragEvent?E.Drag:h instanceof MouseEvent?E.MouseMove:E.TouchMove)}),i,{trailing:!1})),c=[Q("mousemove",u,t),Q("touchmove",u,t),Q("drag",u,t)];return T(()=>{c.forEach(h=>h())})}function nm({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){if(n.mouseInteraction===!1)return()=>{};let o=n.mouseInteraction===!0||n.mouseInteraction===void 0?{}:n.mouseInteraction,a=[],l=null,u=c=>h=>{let f=Wt(h);if(ee(f,r,i,!0))return;let g=null,p=c;if("pointerType"in h){switch(h.pointerType){case"mouse":g=we.Mouse;break;case"touch":g=we.Touch;break;case"pen":g=we.Pen;break}g===we.Touch?k[c]===k.MouseDown?p="TouchStart":k[c]===k.MouseUp&&(p="TouchEnd"):we.Pen}else Hr(h)&&(g=we.Touch);g!==null?(l=g,(p.startsWith("Touch")&&g===we.Touch||p.startsWith("Mouse")&&g===we.Mouse)&&(g=null)):k[c]===k.Click&&(g=l,l=null);let m=Hr(h)?h.changedTouches[0]:h;if(!m)return;let d=t.getId(f),{clientX:y,clientY:b}=m;T(s)({type:k[p],id:d,x:y,y:b,...g!==null&&{pointerType:g}})};return Object.keys(k).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&o[c]!==!1).forEach(c=>{let h=Oe(c),f=u(c);if(window.PointerEvent)switch(k[c]){case k.MouseDown:case k.MouseUp:h=h.replace("mouse","pointer");break;case k.TouchStart:case k.TouchEnd:return}a.push(Q(h,f,e))}),T(()=>{a.forEach(c=>c())})}function Jl({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){let o=T(lt(T(a=>{let l=Wt(a);if(!l||ee(l,r,i,!0))return;let u=t.getId(l);if(l===e&&e.defaultView){let c=Sn(e.defaultView);s({id:u,x:c.left,y:c.top})}else s({id:u,x:l.scrollLeft,y:l.scrollTop})}),n.scroll||100));return Q("scroll",o,e)}function om({viewportResizeCb:s},{win:e}){let t=-1,r=-1,i=T(lt(T(()=>{let n=Cn(),o=En();(t!==n||r!==o)&&(s({width:Number(o),height:Number(n)}),t=n,r=o)}),200));return Q("resize",i,e)}function lm({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:n,ignoreSelector:o,maskInputOptions:a,maskInputFn:l,sampling:u,userTriggeredOnInput:c}){function h(b){let w=Wt(b),S=b.isTrusted,x=w&&w.tagName;if(w&&x==="OPTION"&&(w=R.parentElement(w)),!w||!x||am.indexOf(x)<0||ee(w,r,i,!0)||w.classList.contains(n)||o&&w.matches(o))return;let N=w.value,B=!1,F=Rr(w)||"";F==="radio"||F==="checkbox"?B=w.checked:(a[x.toLowerCase()]||a[F])&&(N=Nr({element:w,maskInputOptions:a,tagName:x,type:F,value:N,maskInputFn:l})),f(w,c?{text:N,isChecked:B,userTriggered:S}:{text:N,isChecked:B});let H=w.name;F==="radio"&&H&&B&&e.querySelectorAll(`input[type="radio"][name="${H}"]`).forEach(K=>{if(K!==w){let te=K.value;f(K,c?{text:te,isChecked:!B,userTriggered:!1}:{text:te,isChecked:!B})}})}function f(b,w){let S=Jo.get(b);if(!S||S.text!==w.text||S.isChecked!==w.isChecked){Jo.set(b,w);let x=t.getId(b);T(s)({...w,id:x})}}let p=(u.input==="last"?["change"]:["input","change"]).map(b=>Q(b,T(h),e)),m=e.defaultView;if(!m)return()=>{p.forEach(b=>b())};let d=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),y=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return d&&d.set&&p.push(...y.map(b=>Bt(b[0],b[1],{set(){T(h)({target:this,isTrusted:!1})}},!1,m))),T(()=>{p.forEach(b=>b())})}function Yr(s){let e=[];function t(r,i){if(yr("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||yr("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||yr("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||yr("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){let o=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(o)}else if(r.parentStyleSheet){let o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(o)}return i}return t(s,e)}function Me(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function um({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};let i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:T((c,h,f)=>{let[g,p]=f,{id:m,styleId:d}=Me(h,e,t.styleMirror);return(m&&m!==-1||d&&d!==-1)&&s({id:m,styleId:d,adds:[{rule:g,index:p}]}),c.apply(h,f)})}),r.CSSStyleSheet.prototype.addRule=function(c,h,f=this.cssRules.length){let g=`${c} { ${h} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[g,f])};let n=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:T((c,h,f)=>{let[g]=f,{id:p,styleId:m}=Me(h,e,t.styleMirror);return(p&&p!==-1||m&&m!==-1)&&s({id:p,styleId:m,removes:[{index:g}]}),c.apply(h,f)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:T((c,h,f)=>{let[g]=f,{id:p,styleId:m}=Me(h,e,t.styleMirror);return(p&&p!==-1||m&&m!==-1)&&s({id:p,styleId:m,replace:g}),c.apply(h,f)})}));let a;r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:T((c,h,f)=>{let[g]=f,{id:p,styleId:m}=Me(h,e,t.styleMirror);return(p&&p!==-1||m&&m!==-1)&&s({id:p,styleId:m,replaceSync:g}),c.apply(h,f)})}));let l={};wr("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(wr("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),wr("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),wr("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));let u={};return Object.entries(l).forEach(([c,h])=>{u[c]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(u[c].insertRule,{apply:T((f,g,p)=>{let[m,d]=p,{id:y,styleId:b}=Me(g.parentStyleSheet,e,t.styleMirror);return(y&&y!==-1||b&&b!==-1)&&s({id:y,styleId:b,adds:[{rule:m,index:[...Yr(g),d||0]}]}),f.apply(g,p)})}),h.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:T((f,g,p)=>{let[m]=p,{id:d,styleId:y}=Me(g.parentStyleSheet,e,t.styleMirror);return(d&&d!==-1||y&&y!==-1)&&s({id:d,styleId:y,removes:[{index:[...Yr(g),m]}]}),f.apply(g,p)})})}),T(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=n,o&&(r.CSSStyleSheet.prototype.replace=o),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([c,h])=>{h.prototype.insertRule=u[c].insertRule,h.prototype.deleteRule=u[c].deleteRule})})}function Kl({mirror:s,stylesheetManager:e},t){var r,i,n;let o=null;t.nodeName==="#document"?o=s.getId(t):o=s.getId(R.host(t));let a=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(n=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:n.ShadowRoot,l=a?.prototype?Object.getOwnPropertyDescriptor(a?.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!a||!l?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var u;return(u=l.get)==null?void 0:u.call(this)},set(u){var c;let h=(c=l.set)==null?void 0:c.call(this,u);if(o!==null&&o!==-1)try{e.adoptStyleSheets(u,o)}catch{}return h}}),T(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function cm({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){let n=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:T((a,l,u)=>{var c;let[h,f,g]=u;if(t.has(h))return n.apply(l,[h,f,g]);let{id:p,styleId:m}=Me((c=l.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||m&&m!==-1)&&s({id:p,styleId:m,set:{property:h,value:f,priority:g},index:Yr(l.parentRule)}),a.apply(l,u)})});let o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:T((a,l,u)=>{var c;let[h]=u;if(t.has(h))return o.apply(l,[h]);let{id:f,styleId:g}=Me((c=l.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(f&&f!==-1||g&&g!==-1)&&s({id:f,styleId:g,remove:{property:h},index:Yr(l.parentRule)}),a.apply(l,u)})}),T(()=>{i.CSSStyleDeclaration.prototype.setProperty=n,i.CSSStyleDeclaration.prototype.removeProperty=o})}function hm({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:n}){let o=T(l=>lt(T(u=>{let c=Wt(u);if(!c||ee(c,e,t,!0))return;let{currentTime:h,volume:f,muted:g,playbackRate:p,loop:m}=c;s({type:l,id:r.getId(c),currentTime:h,volume:f,muted:g,playbackRate:p,loop:m})}),i.media||500)),a=[Q("play",o(Ne.Play),n),Q("pause",o(Ne.Pause),n),Q("seeked",o(Ne.Seeked),n),Q("volumechange",o(Ne.VolumeChange),n),Q("ratechange",o(Ne.RateChange),n)];return T(()=>{a.forEach(l=>l())})}function fm({fontCb:s,doc:e}){let t=e.defaultView;if(!t)return()=>{};let r=[],i=new WeakMap,n=t.FontFace;t.FontFace=function(l,u,c){let h=new n(l,u,c);return i.set(h,{family:l,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),h};let o=Be(e.fonts,"add",function(a){return function(l){return setTimeout(T(()=>{let u=i.get(l);u&&(s(u),i.delete(l))}),0),a.apply(this,[l])}});return r.push(()=>{t.FontFace=n}),r.push(o),T(()=>{r.forEach(a=>a())})}function dm(s){let{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:n}=s,o=!0,a=T(()=>{let l=e.getSelection();if(!l||o&&l?.isCollapsed)return;o=l.isCollapsed||!1;let u=[],c=l.rangeCount||0;for(let h=0;h<c;h++){let f=l.getRangeAt(h),{startContainer:g,startOffset:p,endContainer:m,endOffset:d}=f;ee(g,r,i,!0)||ee(m,r,i,!0)||u.push({start:t.getId(g),startOffset:p,end:t.getId(m),endOffset:d})}n({ranges:u})});return a(),Q("selectionchange",a)}function pm({doc:s,customElementCb:e}){let t=s.defaultView;return!t||!t.customElements?()=>{}:Be(t.customElements,"define",function(i){return function(n,o,a){try{e({define:{name:n}})}catch{console.warn(`Custom element callback failed for ${n}`)}return i.apply(this,[n,o,a])}})}function mm(s,e){let{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:n,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:f,selectionCb:g,customElementCb:p}=s;s.mutationCb=(...m)=>{e.mutation&&e.mutation(...m),t(...m)},s.mousemoveCb=(...m)=>{e.mousemove&&e.mousemove(...m),r(...m)},s.mouseInteractionCb=(...m)=>{e.mouseInteraction&&e.mouseInteraction(...m),i(...m)},s.scrollCb=(...m)=>{e.scroll&&e.scroll(...m),n(...m)},s.viewportResizeCb=(...m)=>{e.viewportResize&&e.viewportResize(...m),o(...m)},s.inputCb=(...m)=>{e.input&&e.input(...m),a(...m)},s.mediaInteractionCb=(...m)=>{e.mediaInteaction&&e.mediaInteaction(...m),l(...m)},s.styleSheetRuleCb=(...m)=>{e.styleSheetRule&&e.styleSheetRule(...m),u(...m)},s.styleDeclarationCb=(...m)=>{e.styleDeclaration&&e.styleDeclaration(...m),c(...m)},s.canvasMutationCb=(...m)=>{e.canvasMutation&&e.canvasMutation(...m),h(...m)},s.fontCb=(...m)=>{e.font&&e.font(...m),f(...m)},s.selectionCb=(...m)=>{e.selection&&e.selection(...m),g(...m)},s.customElementCb=(...m)=>{e.customElement&&e.customElement(...m),p(...m)}}function gm(s,e={}){let t=s.doc.defaultView;if(!t)return()=>{};mm(s,e);let r;s.recordDOM&&(r=Xl(s,s.doc));let i=im(s),n=nm(s),o=Jl(s),a=om(s,{win:t}),l=lm(s),u=hm(s),c=()=>{},h=()=>{},f=()=>{},g=()=>{};s.recordDOM&&(c=um(s,{win:t}),h=Kl(s,s.doc),f=cm(s,{win:t}),s.collectFonts&&(g=fm(s)));let p=dm(s),m=pm(s),d=[];for(let y of s.plugins)d.push(y.observer(y.callback,t,y.options));return T(()=>{$e.forEach(y=>y.reset()),r?.disconnect(),i(),n(),o(),a(),l(),u(),c(),h(),f(),g(),p(),m(),d.forEach(y=>y())})}function yr(s){return typeof window[s]<"u"}function wr(s){return!!(typeof window[s]<"u"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}function vm(s,e){let t=Ko.get(s);return t||(t=new Map,Ko.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}function xr(s,e,t){if(s instanceof Array)return s.map(r=>xr(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return{rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){let r=s.constructor.name,i=ym(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[xr(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){let r=s.constructor.name,{src:i}=s;return{rr_type:r,src:i}}else if(s instanceof HTMLCanvasElement){let r="HTMLImageElement",i=s.toDataURL();return{rr_type:r,src:i}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[xr(s.data,e,t),s.width,s.height]};if(eu(s,e)||typeof s=="object"){let r=s.constructor.name,i=ql(s,e,t);return{rr_type:r,index:i}}}}return s}function bm(s,e,t,r){let i=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(let o of n)try{if(typeof e.CanvasRenderingContext2D.prototype[o]!="function")continue;let a=Be(e.CanvasRenderingContext2D.prototype,o,function(l){return function(...u){return ee(this.canvas,t,r,!0)||setTimeout(()=>{let c=Ql(u,e,this);s(this.canvas,{type:Ce["2D"],property:o,args:c})},0),l.apply(this,u)}});i.push(a)}catch{let a=Bt(e.CanvasRenderingContext2D.prototype,o,{set(l){s(this.canvas,{type:Ce["2D"],property:o,args:[l],setter:!0})}});i.push(a)}return()=>{i.forEach(o=>o())}}function Sm(s){return s==="experimental-webgl"?"webgl":s}function qo(s,e,t,r){let i=[];try{let n=Be(s.HTMLCanvasElement.prototype,"getContext",function(o){return function(a,...l){if(!ee(this,e,t,!0)){let u=Sm(a);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(l[0]&&typeof l[0]=="object"){let c=l[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[a,...l])}});i.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(n=>n())}}function Qo(s,e,t,r,i,n){let o=[],a=Object.getOwnPropertyNames(s);for(let l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof s[l]!="function")continue;let u=Be(s,l,function(c){return function(...h){let f=c.apply(this,h);if(ql(f,n,this),"tagName"in this.canvas&&!ee(this.canvas,r,i,!0)){let g=Ql(h,n,this),p={type:e,property:l,args:g};t(this.canvas,p)}return f}});o.push(u)}catch{let u=Bt(s,l,{set(c){t(this.canvas,{type:e,property:l,args:[c],setter:!0})}});o.push(u)}return o}function Cm(s,e,t,r){let i=[];return i.push(...Qo(e.WebGLRenderingContext.prototype,Ce.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext<"u"&&i.push(...Qo(e.WebGL2RenderingContext.prototype,Ce.WebGL2,s,t,r,e)),()=>{i.forEach(n=>n())}}function Im(s){let e;try{if(e=ea&&(window.URL||window.webkitURL).createObjectURL(ea),!e)throw"";let t=new Worker(e,{name:s?.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;base64,"+tu,{name:s?.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}function Te(s={}){let{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:n=null,ignoreClass:o="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:f,slimDOMOptions:g,maskInputFn:p,maskTextFn:m,hooks:d,packFn:y,sampling:b={},dataURLOptions:w={},mousemoveWait:S,recordDOM:x=!0,recordCanvas:N=!1,recordCrossOriginIframes:B=!1,recordAfter:F=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:H=!1,collectFonts:K=!1,inlineImages:te=!1,plugins:re,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:De=new Set([]),errorHandler:ke}=s;rm(ke);let Y=B?window.parent===window:!0,P=!1;if(!Y)try{window.parent.document&&(P=!1)}catch{P=!0}if(Y&&!e)throw new Error("emit function is required");if(!Y&&!P)return()=>{};S!==void 0&&b.mousemove===void 0&&(b.mousemove=S),ce.reset();let le=h===!0?{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}:f!==void 0?f:{password:!0},se=ya(g);Mn();let ut,ds=0,_n=_=>{for(let ue of re||[])ue.eventProcessor&&(_=ue.eventProcessor(_));return y&&!P&&(_=y(_)),_};J=(_,ue)=>{var Z;let X=_;if(X.timestamp=_t(),(Z=$e[0])!=null&&Z.isFrozen()&&X.type!==I.FullSnapshot&&!(X.type===I.IncrementalSnapshot&&X.data.source===E.Mutation)&&$e.forEach(ie=>ie.unfreeze()),Y)e?.(_n(X),ue);else if(P){let ie={type:"rrweb",event:_n(X),origin:window.location.origin,isCheckout:ue};window.parent.postMessage(ie,"*")}if(X.type===I.FullSnapshot)ut=X,ds=0;else if(X.type===I.IncrementalSnapshot){if(X.data.source===E.Mutation&&X.data.isAttachIframe)return;ds++;let ie=r&&ds>=r,U=t&&X.timestamp-ut.timestamp>t;(ie||U)&&Mr(!0)}};let zt=_=>{J({type:I.IncrementalSnapshot,data:{source:E.Mutation,..._}})},Pn=_=>J({type:I.IncrementalSnapshot,data:{source:E.Scroll,..._}}),Ln=_=>J({type:I.IncrementalSnapshot,data:{source:E.CanvasMutation,..._}}),fu=_=>J({type:I.IncrementalSnapshot,data:{source:E.AdoptedStyleSheet,..._}}),_e=new Wi({mutationCb:zt,adoptedStyleSheetCb:fu}),Pe=new Fi({mirror:ce,mutationCb:zt,stylesheetManager:_e,recordCrossOriginIframes:B,wrappedEmit:J});for(let _ of re||[])_.getMirror&&_.getMirror({nodeMirror:ce,crossOriginIframeMirror:Pe.crossOriginIframeMirror,crossOriginIframeStyleMirror:Pe.crossOriginIframeStyleMirror});let ps=new zi;zs=new Bi({recordCanvas:N,mutationCb:Ln,win:window,blockClass:i,blockSelector:n,mirror:ce,sampling:b.canvas,dataURLOptions:w});let Vt=new Ui({mutationCb:zt,scrollCb:Pn,bypassOptions:{blockClass:i,blockSelector:n,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:le,dataURLOptions:w,maskTextFn:m,maskInputFn:p,recordCanvas:N,inlineImages:te,sampling:b,slimDOMOptions:se,iframeManager:Pe,stylesheetManager:_e,canvasManager:zs,keepIframeSrcFn:A,processedNodeManager:ps},mirror:ce});Mr=(_=!1)=>{if(!x)return;J({type:I.Meta,data:{href:window.location.href,width:En(),height:Cn()}},_),_e.reset(),Vt.init(),$e.forEach(Z=>Z.lock());let ue=Rc(document,{mirror:ce,blockClass:i,blockSelector:n,maskTextClass:l,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:le,maskTextFn:m,maskInputFn:p,slimDOM:se,dataURLOptions:w,recordCanvas:N,inlineImages:te,onSerialize:Z=>{qe(Z,ce)&&Pe.addIframe(Z),Rn(Z,ce)&&_e.trackLinkElement(Z),Re(Z)&&Vt.addShadowRoot(R.shadowRoot(Z),document)},onIframeLoad:(Z,X)=>{Pe.attachIframe(Z,X),Vt.observeAttachShadow(Z)},onStylesheetLoad:(Z,X)=>{_e.attachLinkElement(Z,X)},keepIframeSrcFn:A});if(!ue)return console.warn("Failed to snapshot the document");J({type:I.FullSnapshot,data:{node:ue,initialOffset:Sn(window)}},_),$e.forEach(Z=>Z.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&_e.adoptStyleSheets(document.adoptedStyleSheets,ce.getId(document))};try{let _=[],ue=X=>{var ie;return T(gm)({mutationCb:zt,mousemoveCb:(U,ms)=>J({type:I.IncrementalSnapshot,data:{source:ms,positions:U}}),mouseInteractionCb:U=>J({type:I.IncrementalSnapshot,data:{source:E.MouseInteraction,...U}}),scrollCb:Pn,viewportResizeCb:U=>J({type:I.IncrementalSnapshot,data:{source:E.ViewportResize,...U}}),inputCb:U=>J({type:I.IncrementalSnapshot,data:{source:E.Input,...U}}),mediaInteractionCb:U=>J({type:I.IncrementalSnapshot,data:{source:E.MediaInteraction,...U}}),styleSheetRuleCb:U=>J({type:I.IncrementalSnapshot,data:{source:E.StyleSheetRule,...U}}),styleDeclarationCb:U=>J({type:I.IncrementalSnapshot,data:{source:E.StyleDeclaration,...U}}),canvasMutationCb:Ln,fontCb:U=>J({type:I.IncrementalSnapshot,data:{source:E.Font,...U}}),selectionCb:U=>{J({type:I.IncrementalSnapshot,data:{source:E.Selection,...U}})},customElementCb:U=>{J({type:I.IncrementalSnapshot,data:{source:E.CustomElement,...U}})},blockClass:i,ignoreClass:o,ignoreSelector:a,maskTextClass:l,maskTextSelector:u,maskInputOptions:le,inlineStylesheet:c,sampling:b,recordDOM:x,recordCanvas:N,inlineImages:te,userTriggeredOnInput:H,collectFonts:K,doc:X,maskInputFn:p,maskTextFn:m,keepIframeSrcFn:A,blockSelector:n,slimDOMOptions:se,dataURLOptions:w,mirror:ce,iframeManager:Pe,stylesheetManager:_e,shadowDomManager:Vt,processedNodeManager:ps,canvasManager:zs,ignoreCSSAttributes:De,plugins:((ie=re?.filter(U=>U.observer))==null?void 0:ie.map(U=>({observer:U.observer,options:U.options,callback:ms=>J({type:I.Plugin,data:{plugin:U.name,payload:ms}})})))||[]},d)};Pe.addLoadListener(X=>{try{_.push(ue(X.contentDocument))}catch(ie){console.warn(ie)}});let Z=()=>{Mr(),_.push(ue(document)),Xr=!0};return["interactive","complete"].includes(document.readyState)?Z():(_.push(Q("DOMContentLoaded",()=>{J({type:I.DomContentLoaded,data:{}}),F==="DOMContentLoaded"&&Z()})),_.push(Q("load",()=>{J({type:I.Load,data:{}}),F==="load"&&Z()},window))),()=>{_.forEach(X=>{try{X()}catch(ie){String(ie).toLowerCase().includes("cross-origin")||console.warn(ie)}}),ps.destroy(),Xr=!1,sm()}}catch(_){console.warn(_)}}function ru(s){return{all:s=s||new Map,on:function(e,t){var r=s.get(e);r?r.push(t):s.set(e,[t])},off:function(e,t){var r=s.get(e);r&&(t?r.splice(r.indexOf(t)>>>0,1):s.set(e,[]))},emit:function(e,t){var r=s.get(e);r&&r.slice().map(function(i){i(t)}),(r=s.get("*"))&&r.slice().map(function(i){i(e,t)})}}}function Mm(s=window,e=document){if("scrollBehavior"in e.documentElement.style&&s.__forceSmoothScrollPolyfill__!==!0)return;let t=s.HTMLElement||s.Element,r=468,i={scroll:s.scroll||s.scrollTo,scrollBy:s.scrollBy,elementScroll:t.prototype.scroll||l,scrollIntoView:t.prototype.scrollIntoView},n=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now;function o(y){let b=["MSIE ","Trident/","Edge/"];return new RegExp(b.join("|")).test(y)}let a=o(s.navigator.userAgent)?1:0;function l(y,b){this.scrollLeft=y,this.scrollTop=b}function u(y){return .5*(1-Math.cos(Math.PI*y))}function c(y){if(y===null||typeof y!="object"||y.behavior===void 0||y.behavior==="auto"||y.behavior==="instant")return!0;if(typeof y=="object"&&y.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+y.behavior+" is not a valid value for enumeration ScrollBehavior.")}function h(y,b){if(b==="Y")return y.clientHeight+a<y.scrollHeight;if(b==="X")return y.clientWidth+a<y.scrollWidth}function f(y,b){let w=s.getComputedStyle(y,null)["overflow"+b];return w==="auto"||w==="scroll"}function g(y){let b=h(y,"Y")&&f(y,"Y"),w=h(y,"X")&&f(y,"X");return b||w}function p(y){for(;y!==e.body&&g(y)===!1;)y=y.parentNode||y.host;return y}function m(y){let b=n(),w,S,x,N=(b-y.startTime)/r;N=N>1?1:N,w=u(N),S=y.startX+(y.x-y.startX)*w,x=y.startY+(y.y-y.startY)*w,y.method.call(y.scrollable,S,x),(S!==y.x||x!==y.y)&&s.requestAnimationFrame(m.bind(s,y))}function d(y,b,w){let S,x,N,B,F=n();y===e.body?(S=s,x=s.scrollX||s.pageXOffset,N=s.scrollY||s.pageYOffset,B=i.scroll):(S=y,x=y.scrollLeft,N=y.scrollTop,B=l),m({scrollable:S,method:B,startTime:F,startX:x,startY:N,x:b,y:w})}s.scroll=s.scrollTo=function(){if(arguments[0]!==void 0){if(c(arguments[0])===!0){i.scroll.call(s,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:s.scrollX||s.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:s.scrollY||s.pageYOffset);return}d.call(s,e.body,arguments[0].left!==void 0?~~arguments[0].left:s.scrollX||s.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:s.scrollY||s.pageYOffset)}},s.scrollBy=function(){if(arguments[0]!==void 0){if(c(arguments[0])){i.scrollBy.call(s,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}d.call(s,e.body,~~arguments[0].left+(s.scrollX||s.pageXOffset),~~arguments[0].top+(s.scrollY||s.pageYOffset))}},t.prototype.scroll=t.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(c(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}let y=arguments[0].left,b=arguments[0].top;d.call(this,this,typeof y>"u"?this.scrollLeft:~~y,typeof b>"u"?this.scrollTop:~~b)},t.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(c(arguments[0])===!0){i.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},t.prototype.scrollIntoView=function(){if(c(arguments[0])===!0){i.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}let y=p(this),b=y.getBoundingClientRect(),w=this.getBoundingClientRect();y!==e.body?(d.call(this,y,y.scrollLeft+w.left-b.left,y.scrollTop+w.top-b.top),s.getComputedStyle(y).position!=="fixed"&&s.scrollBy({left:b.left,top:b.top,behavior:"smooth"})):s.scrollBy({left:w.left,top:w.top,behavior:"smooth"})}}function ta(s,e){if(s.type===I.IncrementalSnapshot&&s.data.source===E.MouseMove&&s.data.positions&&s.data.positions.length){let t=s.data.positions[0].timeOffset,r=s.timestamp+t;return s.delay=r-e,r-e}return s.delay=s.timestamp-e,s.delay}function ra(s,e){var t=typeof Symbol=="function"&&s[Symbol.iterator];if(!t)return s;var r,i,n=t.call(s),o=[];try{for(;(e===void 0||e-- >0)&&!(r=n.next()).done;)o.push(r.value)}catch(a){i={error:a}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(i)throw i.error}}return o}function Vs(s){return s===void 0?[]:[].concat(s)}function He(s){return{type:"xstate.assign",assignment:s}}function sa(s,e){return typeof(s=typeof s=="string"&&e&&e[s]?e[s]:s)=="string"?{type:s}:typeof s=="function"?{type:s.name,exec:s}:s}function Jr(s){return function(e){return s===e}}function iu(s){return typeof s=="string"?{type:s}:s}function ia(s,e){return{value:s,context:e,actions:[],changed:!1,matches:Jr(s)}}function na(s,e,t){var r=e,i=!1;return[s.filter(function(n){if(n.type==="xstate.assign"){i=!0;var o=Object.assign({},r);return typeof n.assignment=="function"?o=n.assignment(r,t):Object.keys(n.assignment).forEach(function(a){o[a]=typeof n.assignment[a]=="function"?n.assignment[a](r,t):n.assignment[a]}),r=o,!1}return!0}),r,i]}function nu(s,e){e===void 0&&(e={});var t=ra(na(Vs(s.states[s.initial].entry).map(function(o){return sa(o,e.actions)}),s.context,su),2),r=t[0],i=t[1],n={config:s,_options:e,initialState:{value:s.initial,actions:r,context:i,matches:Jr(s.initial)},transition:function(o,a){var l,u,c=typeof o=="string"?{value:o,context:s.context}:o,h=c.value,f=c.context,g=iu(a),p=s.states[h];if(p.on){var m=Vs(p.on[g.type]);try{for(var d=(function(P){var le=typeof Symbol=="function"&&Symbol.iterator,se=le&&P[le],ut=0;if(se)return se.call(P);if(P&&typeof P.length=="number")return{next:function(){return P&&ut>=P.length&&(P=void 0),{value:P&&P[ut++],done:!P}}};throw new TypeError(le?"Object is not iterable.":"Symbol.iterator is not defined.")})(m),y=d.next();!y.done;y=d.next()){var b=y.value;if(b===void 0)return ia(h,f);var w=typeof b=="string"?{target:b}:b,S=w.target,x=w.actions,N=x===void 0?[]:x,B=w.cond,F=B===void 0?function(){return!0}:B,H=S===void 0,K=S??h,te=s.states[K];if(F(f,g)){var re=ra(na((H?Vs(N):[].concat(p.exit,N,te.entry).filter(function(P){return P})).map(function(P){return sa(P,n._options.actions)}),f,g),3),A=re[0],De=re[1],ke=re[2],Y=S??h;return{value:Y,context:De,actions:A,changed:S!==h||A.length>0||ke,matches:Jr(Y)}}}}catch(P){l={error:P}}finally{try{y&&!y.done&&(u=d.return)&&u.call(d)}finally{if(l)throw l.error}}}return ia(h,f)}};return n}function ou(s){var e=s.initialState,t=Ke.NotStarted,r=new Set,i={_machine:s,send:function(n){t===Ke.Running&&(e=s.transition(e,n),oa(e,iu(n)),r.forEach(function(o){return o(e)}))},subscribe:function(n){return r.add(n),n(e),{unsubscribe:function(){return r.delete(n)}}},start:function(n){if(n){var o=typeof n=="object"?n:{context:s.config.context,value:n};e={value:o.value,actions:[],context:o.context,matches:Jr(o.value)}}return t=Ke.Running,oa(e,su),i},stop:function(){return t=Ke.Stopped,r.clear(),i},get state(){return e},get status(){return t}};return i}function Nm(s,e){for(let t=s.length-1;t>=0;t--){let r=s[t];if(r.type===I.Meta&&r.timestamp<=e)return s.slice(t)}return s}function Rm(s,{getCastFn:e,applyEventsSynchronously:t,emitter:r}){let i=nu({id:"player",context:s,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:He({lastPlayedEvent:(n,o)=>o.type==="CAST_EVENT"?o.payload.event:n.lastPlayedEvent}),recordTimeOffset:He((n,o)=>{let a=n.timeOffset;return"payload"in o&&"timeOffset"in o.payload&&(a=o.payload.timeOffset),{...n,timeOffset:a,baselineTime:n.events[0].timestamp+a}}),play(n){var o;let{timer:a,events:l,baselineTime:u,lastPlayedEvent:c}=n;a.clear();for(let p of l)ta(p,u);let h=Nm(l,u),f=c?.timestamp;c?.type===I.IncrementalSnapshot&&c.data.source===E.MouseMove&&(f=c.timestamp+((o=c.data.positions[0])==null?void 0:o.timeOffset)),u<(f||0)&&r.emit(D.PlayBack);let g=new Array;for(let p of h)if(!(f&&f<u&&(p.timestamp<=f||p===c)))if(p.timestamp<u)g.push(p);else{let m=e(p,!1);a.addAction({doAction:()=>{m()},delay:p.delay})}t(g),r.emit(D.Flush),a.start()},pause(n){n.timer.clear()},resetLastPlayedEvent:He(n=>({...n,lastPlayedEvent:null})),startLive:He({baselineTime:(n,o)=>(n.timer.start(),o.type==="TO_LIVE"&&o.payload.baselineTime?o.payload.baselineTime:Date.now())}),addEvent:He((n,o)=>{let{baselineTime:a,timer:l,events:u}=n;if(o.type==="ADD_EVENT"){let{event:c}=o.payload;ta(c,a);let h=u.length-1;if(!u[h]||u[h].timestamp<=c.timestamp)u.push(c);else{let p=-1,m=0;for(;m<=h;){let d=Math.floor((m+h)/2);u[d].timestamp<=c.timestamp?m=d+1:h=d-1}p===-1&&(p=m),u.splice(p,0,c)}let f=c.timestamp<a,g=e(c,f);f?g():l.isActive()&&l.addAction({doAction:()=>{g()},delay:c.delay})}return{...n,events:u}})}});return ou(i)}function Am(s){let e=nu({id:"speed",context:s,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(t,r)=>{"payload"in r&&t.timer.setSpeed(r.payload.speed)},recordSpeed:He({normalSpeed:t=>t.timer.speed}),restoreSpeed:t=>{t.timer.setSpeed(t.normalSpeed)}}});return ou(e)}function au(s,e){let t=aa.get(s);return t||(t=new Map,aa.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}function Ae(s,e,t){return async r=>{if(r&&typeof r=="object"&&"rr_type"in r)if(t&&(t.isUnchanged=!1),r.rr_type==="ImageBitmap"&&"args"in r){let i=await Ae(s,e,t)(r.args);return await createImageBitmap.apply(null,i)}else if("index"in r){if(t||e===null)return r;let{rr_type:i,index:n}=r;return au(e,i)[n]}else if("args"in r){let{rr_type:i,args:n}=r,o=window[i];return new o(...await Promise.all(n.map(Ae(s,e,t))))}else{if("base64"in r)return wm(r.base64);if("src"in r){let i=s.get(r.src);if(i)return i;{let n=new Image;return n.src=r.src,s.set(r.src,n),n}}else if("data"in r&&r.rr_type==="Blob"){let i=await Promise.all(r.data.map(Ae(s,e,t)));return new Blob(i,{type:r.type})}}else if(Array.isArray(r))return await Promise.all(r.map(Ae(s,e,t)));return r}}function Tm(s,e){try{return e===Ce.WebGL?s.getContext("webgl")||s.getContext("experimental-webgl"):s.getContext("webgl2")}catch{return null}}function km(s,e){if(!e?.constructor)return;let{name:t}=e.constructor;if(!Dm.includes(t))return;let r=au(s,t);r.includes(e)||r.push(e)}async function _m({mutation:s,target:e,type:t,imageMap:r,errorHandler:i}){try{let n=Tm(e,t);if(!n)return;if(s.setter){n[s.property]=s.args[0];return}let o=n[s.property],a=await Promise.all(s.args.map(Ae(r,n))),l=o.apply(n,a);km(n,l);let u=!1}catch(n){i(s,n)}}async function Pm({event:s,mutations:e,target:t,imageMap:r,errorHandler:i}){let n=t.getContext("2d");if(!n){i(e[0],new Error("Canvas context is null"));return}let o=e.map(async l=>Promise.all(l.args.map(Ae(r,n))));(await Promise.all(o)).forEach((l,u)=>{let c=e[u];try{if(c.setter){n[c.property]=c.args[0];return}let h=n[c.property];c.property==="drawImage"&&typeof c.args[0]=="string"?(r.get(s),h.apply(n,c.args)):h.apply(n,l)}catch(h){i(c,h)}})}async function Gi({event:s,mutation:e,target:t,imageMap:r,canvasEventMap:i,errorHandler:n}){try{let o=i.get(s)||e,a="commands"in o?o.commands:[o];if([Ce.WebGL,Ce.WebGL2].includes(e.type)){for(let l=0;l<a.length;l++){let u=a[l];await _m({mutation:u,type:e.type,target:t,imageMap:r,errorHandler:n})}return}await Pm({event:s,mutations:a,target:t,imageMap:r,errorHandler:n})}catch(o){n(e,o)}}function vr(s,e){if(s.nodeName!=="DIALOG"||s instanceof he)return;let t=s,r=t.open,i=r&&t.matches("dialog:modal"),n=t.getAttribute("rr_open_mode"),o=typeof e?.attributes.open=="string"||typeof t.getAttribute("open")=="string",a=n==="modal";if(!(r&&!(i&&n==="non-modal"||!i&&a))){if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}r&&t.close(),o&&(a?t.showModal():t.show())}}function Lm(s,e){if(s.nodeName!=="DIALOG"||s instanceof he)return;let t=s;if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}e.attributes.open===null&&(t.removeAttribute("open"),t.removeAttribute("rr_open_mode"))}function ua(s){return s.type==I.IncrementalSnapshot&&(s.data.source==E.TouchMove||s.data.source==E.MouseInteraction&&s.data.type==k.TouchStart)}var _u,Pu,v,Qn,Lu,$u,eo,M,to,ro,Jt,Fu,Os,Ts,q,It,so,ac,lc,uc,cc,dc,pc,xt,Ve,io,gc,yc,no,Ac,oo,Oc,Tc,Ki,z,wa,_c,Pc,Lc,fe,ao,lo,Hs,qi,Lt,uo,Ys,ba,Fc,Kr,qt,Uc,Bc,Wc,zc,Js,qr,Vc,Ks,Qr,Gc,jc,Hc,Yc,co,ho,Zc,Xc,Ds,Jc,qs,Sa,qc,Qc,fo,Qt,Qs,ei,eh,ks,po,th,_s,rh,mo,Tr,es,Ca,br,Sr,Ea,Ia,xa,go,sh,ih,nh,oh,Ma,ah,ti,ts,Na,Ra,Aa,Oa,lh,Ta,Qi,en,Da,be,Fe,uh,La,$a,Mt,tn,ri,Fa,ch,si,rn,Ps,yo,er,wo,tr,pt,rr,sr,ir,hh,fh,dh,ph,mh,gh,yh,wh,vh,bh,nr,or,Sh,vo,Ch,Ua,Dr,sn,Ba,Wa,za,Qe,$t,Nt,Va,Ga,Eh,kr,nn,Ih,xh,Mh,Nh,Rh,bo,So,Oh,Th,Dh,kh,_h,on,me,Ph,Lh,$h,Fh,Uh,Co,Bh,Wh,zh,Vh,Gh,et,ni,tt,Ya,jh,Hh,Yh,Zh,oi,Xh,Jh,Kh,qh,Qh,Rt,ef,tf,rf,sf,nf,of,af,lf,uf,cf,Za,hf,ff,an,df,pf,Xa,mf,Ja,Ka,gf,yf,wf,vf,qa,Qa,bf,Sf,G,Io,Af,Of,C,Tf,Df,Mo,kf,ln,V,el,$f,Ff,Uf,de,No,Ro,ai,un,Ft,Ao,li,rl,Wf,ss,ar,zf,Vf,Gf,jf,hi,is,Hf,fi,ns,Yf,Zf,Xf,Jf,Oo,To,Kf,qf,Ls,Qf,di,sl,td,rd,Do,lr,pi,mi,sd,$s,ko,id,Fs,nd,_o,Pr,os,il,Cr,Er,nl,ol,al,Po,od,ad,ld,ud,ll,cd,gi,as,ul,cl,hl,fl,hd,dl,cn,hn,pl,Se,Ue,fd,wl,vl,Ot,fn,yi,bl,dd,wi,dn,Us,Lo,ur,$o,cr,gt,hr,fr,dr,pd,md,gd,yd,wd,vd,bd,Sd,Cd,Ed,pr,mr,Id,Fo,xd,Sl,Lr,pn,Cl,El,Il,rt,Ut,Tt,xl,Ml,Md,$r,mn,Nd,Rd,Ad,Od,Td,Uo,Bo,kd,_d,Pd,Ld,$d,gn,ge,Fd,Ud,Bd,Wd,zd,Wo,Vd,Gd,jd,Hd,Yd,st,bi,it,Al,Zd,Xd,Jd,Kd,Si,qd,Qd,ep,tp,rp,Dt,sp,ip,np,op,ap,lp,up,cp,hp,fp,Ol,dp,pp,yn,mp,gp,Tl,yp,Dl,kl,wp,vp,bp,Sp,_l,Pl,Cp,Ep,j,O,xp,Mp,Ci,Np,Rp,he,Ei,Ur,nt,Ii,xi,Br,Wr,zr,Mi,ne,Ni,Ap,ye,ot,kp,at,Ri,Ai,Oi,Ti,Di,_p,Pp,Lp,ki,Go,jo,gr,Bp,Bs,Ws,R,je,jr,_t,Pt,Qp,I,E,k,we,Ce,Ne,D,ve,Pi,Yo,Li,Et,T,$e,am,Jo,Zr,Fi,Ui,Je,vt,wt,ym,wm,Ko,ql,Ql,eu,tu,Em,ea,Bi,Wi,zi,J,Mr,zs,Xr,ce,xm,Vi,Ke,su,oa,Om,aa,Dm,ji,$m,Fm,la,Gs,Hi,Um,Bm,Wm,uu=$n(()=>{_u=Object.defineProperty,Pu=(s,e,t)=>e in s?_u(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,v=(s,e,t)=>Pu(s,typeof e!="symbol"?e+"":e,t),Lu=Object.defineProperty,$u=(s,e,t)=>e in s?Lu(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,eo=(s,e,t)=>$u(s,typeof e!="symbol"?e+"":e,t),M=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(M||{}),to={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ro={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Jt={},Fu=()=>!!globalThis.Zone;Os={};Ts={};q={ownerDocument:Uu,childNodes:Bu,parentNode:Wu,parentElement:zu,textContent:Vu,contains:Gu,getRootNode:ju,host:Hu,styleSheets:Yu,shadowRoot:Zu,querySelector:Xu,querySelectorAll:Ju,mutationObserver:Ku,patch:qu};It=class{constructor(){eo(this,"idNodeMap",new Map),eo(this,"nodeMetaMap",new WeakMap)}getId(e){var t;return e?((t=this.getMeta(e))==null?void 0:t.id)??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){let r=this.getNode(e);if(r){let i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};so="__rrweb_original__";ac=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,lc=/^(?:[a-z+]+:)?\/\//i,uc=/^www\..*/i,cc=/^(data:)([^,]*),(.*)/i;dc=1,pc=new RegExp("[^a-z0-9-_:]"),xt=-2;gc=/^[^ \t\n\r\u000c]+/,yc=/^[, \t\n\r\u000c]+/;no=new WeakMap;Ac=/(max|min)-device-(width|height)/,oo=new RegExp(Ac.source,"g"),Oc={postcssPlugin:"postcss-custom-selectors",prepare(){return{postcssPlugin:"postcss-custom-selectors",AtRule:function(s){s.params.match(oo)&&(s.params=s.params.replace(oo,"$1-$2"))}}}},Tc={postcssPlugin:"postcss-hover-classes",prepare:function(){let s=[];return{Rule:function(e){s.indexOf(e)===-1&&(s.push(e),e.selectors.forEach(function(t){t.includes(":hover")&&(e.selector+=`,
2
+ `+t.replace(/:hover/g,".\\:hover"))}))}}}};Ki={exports:{}},z=String,wa=function(){return{isColorSupported:!1,reset:z,bold:z,dim:z,italic:z,underline:z,inverse:z,hidden:z,strikethrough:z,black:z,red:z,green:z,yellow:z,blue:z,magenta:z,cyan:z,white:z,gray:z,bgBlack:z,bgRed:z,bgGreen:z,bgYellow:z,bgBlue:z,bgMagenta:z,bgCyan:z,bgWhite:z}};Ki.exports=wa();Ki.exports.createColors=wa;_c=Ki.exports,Pc={},Lc=Object.freeze(Object.defineProperty({__proto__:null,default:Pc},Symbol.toStringTag,{value:"Module"})),fe=kc(Lc),ao=_c,lo=fe,Hs=class va extends Error{constructor(e,t,r,i,n,o){super(e),this.name="CssSyntaxError",this.reason=e,n&&(this.file=n),i&&(this.source=i),o&&(this.plugin=o),typeof t<"u"&&typeof r<"u"&&(typeof t=="number"?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,va)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=ao.isColorSupported),lo&&e&&(t=lo(t));let r=t.split(/\r?\n/),i=Math.max(this.line-3,0),n=Math.min(this.line+2,r.length),o=String(n).length,a,l;if(e){let{bold:u,gray:c,red:h}=ao.createColors(!0);a=f=>u(h(f)),l=f=>c(f)}else a=l=u=>u;return r.slice(i,n).map((u,c)=>{let h=i+1+c,f=" "+(" "+h).slice(-o)+" | ";if(h===this.line){let g=l(f.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(f)+u+`
3
+ `+g+a("^")}return" "+l(f)+u}).join(`
4
+ `)}toString(){let e=this.showSourceCode();return e&&(e=`
5
+
6
+ `+e+`
7
+ `),this.name+": "+this.message+e}},qi=Hs;Hs.default=Hs;Lt={};Lt.isClean=Symbol("isClean");Lt.my=Symbol("my");uo={after:`
8
+ `,beforeClose:`
9
+ `,beforeComment:`
10
+ `,beforeDecl:`
11
+ `,beforeOpen:" ",beforeRule:`
12
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};Ys=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,i=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?r+=e.raws.afterName:i&&(r+=" "),e.nodes)this.block(e,r+i);else{let n=(e.raws.between||"")+(t?";":"");this.builder(r+i+n,e)}}beforeAfter(e,t){let r;e.type==="decl"?r=this.raw(e,null,"beforeDecl"):e.type==="comment"?r=this.raw(e,null,"beforeComment"):t==="before"?r=this.raw(e,null,"beforeRule"):r=this.raw(e,null,"beforeClose");let i=e.parent,n=0;for(;i&&i.type!=="root";)n+=1,i=i.parent;if(r.includes(`
13
+ `)){let o=this.raw(e,null,"indent");if(o.length)for(let a=0;a<n;a++)r+=o}return r}block(e,t){let r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start");let i;e.nodes&&e.nodes.length?(this.body(e),i=this.raw(e,"after")):i=this.raw(e,"after","emptyBody"),i&&this.builder(i),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let i=0;i<e.nodes.length;i++){let n=e.nodes[i],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==i||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"),i=e.prop+r+this.rawValue(e,"value");e.important&&(i+=e.raws.important||" !important"),t&&(i+=";"),this.builder(i,e)}document(e){this.body(e)}raw(e,t,r){let i;if(r||(r=t),t&&(i=e.raws[t],typeof i<"u"))return i;let n=e.parent;if(r==="before"&&(!n||n.type==="root"&&n.first===e||n&&n.type==="document"))return"";if(!n)return uo[r];let o=e.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[r]<"u")return o.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let a="raw"+$c(r);this[a]?i=this[a](o,e):o.walk(l=>{if(i=l.raws[t],typeof i<"u")return!1})}return typeof i>"u"&&(i=uo[r]),o.rawCache[r]=i,i}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return t=r.raws.after,t.includes(`
14
+ `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
15
+ `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
16
+ `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(r=>{if(r.type!=="decl"&&(t=r.raws.between,typeof t<"u"))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&typeof r.raws.before<"u")return t=r.raws.before,t.includes(`
17
+ `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(r=>{if(typeof r.raws.between<"u")return t=r.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length===0&&(t=r.raws.after,typeof t<"u"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let i=r.parent;if(i&&i!==e&&i.parent&&i.parent===e&&typeof r.raws.before<"u"){let n=r.raws.before.split(`
18
+ `);return t=n[n.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(t=r.raws.semicolon,typeof t<"u"))return!1}),t}rawValue(e,t){let r=e[t],i=e.raws[t];return i&&i.value===r?i.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)}},ba=Ys;Ys.default=Ys;Fc=ba;Kr=Zs;Zs.default=Zs;({isClean:qt,my:Uc}=Lt),Bc=qi,Wc=ba,zc=Kr;Js=class{constructor(e={}){this.raws={},this[qt]=!1,this[Uc]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let r of e[t])typeof r.clone=="function"?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=Xs(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:i}=this.rangeBy(t);return this.source.input.error(e,{column:i.column,line:i.line},{column:r.column,line:r.line},t)}return new Bc(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markDirty(){if(this[qt]){this[qt]=!1;let e=this;for(;e=e.parent;)e[qt]=!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){t=this.toString();let i=t.indexOf(e.word);i!==-1&&(r=this.positionInside(i,t))}return r}positionInside(e,t){let r=t||this.toString(),i=this.source.start.column,n=this.source.start.line;for(let o=0;o<e;o++)r[o]===`
19
+ `?(i=1,n+=1):i+=1;return{column:i,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let i=this.toString(),n=i.indexOf(e.word);n!==-1&&(t=this.positionInside(n,i),r=this.positionInside(n+e.word.length,i))}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}:typeof e.endIndex=="number"?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 Wc().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 i of e)i===this?r=!0:r?(this.parent.insertAfter(t,i),t=i):this.parent.insertBefore(t,i);r||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let r={},i=t==null;t=t||new Map;let n=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let a=this[o];if(Array.isArray(a))r[o]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,t):l);else if(typeof a=="object"&&a.toJSON)r[o]=a.toJSON(null,t);else if(o==="source"){let l=t.get(a.input);l==null&&(l=n,t.set(a.input,n),n++),r[o]={end:a.end,inputId:l,start:a.start}}else r[o]=a}return i&&(r.inputs=[...t.keys()].map(o=>o.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=zc){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let i={node:this};for(let n in r)i[n]=r[n];return e.warn(t,i)}get proxyOf(){return this}},qr=Js;Js.default=Js;Vc=qr,Ks=class extends Vc{constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}},Qr=Ks;Ks.default=Ks;Gc="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",jc=(s,e=21)=>(t=e)=>{let r="",i=t;for(;i--;)r+=s[Math.random()*s.length|0];return r},Hc=(s=21)=>{let e="",t=s;for(;t--;)e+=Gc[Math.random()*64|0];return e},Yc={nanoid:Hc,customAlphabet:jc},{SourceMapConsumer:co,SourceMapGenerator:ho}=fe,{existsSync:Zc,readFileSync:Xc}=fe,{dirname:Ds,join:Jc}=fe;qs=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,i=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Ds(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new co(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,n=/^data:application\/json,/;if(i.test(e)||n.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||r.test(e))return Kc(e.substr(RegExp.lastMatch.length));let o=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+o)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),i=e.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,i)))}loadFile(e){if(this.root=Ds(e),Zc(e))return this.mapFile=e,Xc(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let r=t(e);if(r){let i=this.loadFile(r);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(t instanceof co)return ho.fromSourceMap(t).toString();if(t instanceof ho)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=Jc(Ds(e),r)),this.loadFile(r)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},Sa=qs;qs.default=qs;({SourceMapConsumer:qc,SourceMapGenerator:Qc}=fe),{fileURLToPath:fo,pathToFileURL:Qt}=fe,{isAbsolute:Qs,resolve:ei}=fe,{nanoid:eh}=Yc,ks=fe,po=qi,th=Sa,_s=Symbol("fromOffsetCache"),rh=!!(qc&&Qc),mo=!!(ei&&Qs),Tr=class{constructor(e,t={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!mo||/^\w+:\/\//.test(t.from)||Qs(t.from)?this.file=t.from:this.file=ei(t.from)),mo&&rh){let r=new th(this.css,t);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+eh(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let n,o,a;if(t&&typeof t=="object"){let u=t,c=r;if(typeof u.offset=="number"){let h=this.fromOffset(u.offset);t=h.line,r=h.col}else t=u.line,r=u.column;if(typeof c.offset=="number"){let h=this.fromOffset(c.offset);o=h.line,a=h.col}else o=c.line,a=c.column}else if(!r){let u=this.fromOffset(t);t=u.line,r=u.col}let l=this.origin(t,r,o,a);return l?n=new po(e,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):n=new po(e,o===void 0?t:{column:r,line:t},o===void 0?r:{column:a,line:o},this.css,this.file,i.plugin),n.input={column:r,endColumn:a,endLine:o,line:t,source:this.css},this.file&&(Qt&&(n.input.url=Qt(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[_s])r=this[_s];else{let n=this.css.split(`
20
+ `);r=new Array(n.length);let o=0;for(let a=0,l=n.length;a<l;a++)r[a]=o,o+=n[a].length+1;this[_s]=r}t=r[r.length-1];let i=0;if(e>=t)i=r.length-1;else{let n=r.length-2,o;for(;i<n;)if(o=i+(n-i>>1),e<r[o])n=o-1;else if(e>=r[o+1])i=o+1;else{i=o;break}}return{col:e-r[i]+1,line:i+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:ei(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,i){if(!this.map)return!1;let n=this.map.consumer(),o=n.originalPositionFor({column:t,line:e});if(!o.source)return!1;let a;typeof r=="number"&&(a=n.originalPositionFor({column:i,line:r}));let l;Qs(o.source)?l=Qt(o.source):l=new URL(o.source,this.map.consumer().sourceRoot||Qt(this.map.mapFile));let u={column:o.column,endColumn:a&&a.column,endLine:a&&a.line,line:o.line,url:l.toString()};if(l.protocol==="file:")if(fo)u.file=fo(l);else throw new Error("file: protocol is not available in this PostCSS build");let c=n.sourceContentFor(o.source);return c&&(u.source=c),u}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(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}},es=Tr;Tr.default=Tr;ks&&ks.registerInput&&ks.registerInput(Tr);({SourceMapConsumer:Ca,SourceMapGenerator:br}=fe),{dirname:Sr,relative:Ea,resolve:Ia,sep:xa}=fe,{pathToFileURL:go}=fe,sh=es,ih=!!(Ca&&br),nh=!!(Sr&&Ia&&Ea&&xa),oh=class{constructor(e,t,r,i){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=`
21
+ `;this.css.includes(`\r
22
+ `)&&(t=`\r
23
+ `),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||Sr(e.file),i;this.mapOpts.sourcesContent===!1?(i=new Ca(e.text),i.sourcesContent&&(i.sourcesContent=null)):i=e.consumer(),this.map.applySourceMap(i,t,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),nh&&ih&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=br.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new br({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 br({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},n,o;this.stringify(this.root,(a,l,u)=>{if(this.css+=a,l&&u!=="end"&&(i.generated.line=e,i.generated.column=t-1,l.source&&l.source.start?(i.source=this.sourcePath(l),i.original.line=l.source.start.line,i.original.column=l.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),n=a.match(/\n/g),n?(e+=n.length,o=a.lastIndexOf(`
24
+ `),t=a.length-o):t+=a.length,l&&u!=="start"){let c=l.parent||{raws:{}};(!(l.type==="decl"||l.type==="atrule"&&!l.nodes)||l!==c.last||c.raws.semicolon)&&(l.source&&l.source.end?(i.source=this.sourcePath(l),i.original.line=l.source.end.line,i.original.column=l.source.end.column-1,i.generated.line=e,i.generated.column=t-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=t-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(e=>e.withContent()):!0}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||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Sr(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Sr(Ia(r,this.mapOpts.annotation)));let i=Ea(r,e);return this.memoizedPaths.set(e,i),i}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 sh(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 i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,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(go){let r=go(e).toString();return this.memoizedFileURLs.set(e,r),r}else 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;xa==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},Ma=oh,ah=qr,ti=class extends ah{constructor(e){super(e),this.type="comment"}},ts=ti;ti.default=ti;({isClean:Na,my:Ra}=Lt),Aa=Qr,Oa=ts,lh=qr;be=class Pa extends lh{append(...e){for(let t of e){let r=this.normalize(t,this.last);for(let i of r)this.proxyOf.nodes.push(i)}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=this.getIterator(),r,i;for(;this.indexes[t]<this.proxyOf.nodes.length&&(r=this.indexes[t],i=e(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[t]+=1;return delete this.indexes[t],i}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){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...r)=>e[t](...r.map(i=>typeof i=="function"?(n,o)=>i(n.toProxy(),o):i)):t==="every"||t==="some"?r=>e[t]((i,...n)=>r(i.toProxy(),...n)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(r=>r.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let o of i)this.proxyOf.nodes.splice(r+1,0,o);let n;for(let o in this.indexes)n=this.indexes[o],r<n&&(this.indexes[o]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),i=r===0?"prepend":!1,n=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let a of n)this.proxyOf.nodes.splice(r,0,a);let o;for(let a in this.indexes)o=this.indexes[a],r<=o&&(this.indexes[a]=o+n.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=ka(Ta(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Aa(e)]}else if(e.selector)e=[new Qi(e)];else if(e.name)e=[new en(e)];else if(e.text)e=[new Oa(e)];else throw new Error("Unknown node type in node creation");return e.map(i=>(i[Ra]||Pa.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Na]&&_a(i),typeof i.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(i.raws.before=t.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.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){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;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(i=>{t.props&&!t.props.includes(i.prop)||t.fast&&!i.value.includes(t.fast)||(i.value=i.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let i;try{i=e(t,r)}catch(n){throw t.addToError(n)}return i!==!1&&t.walk&&(i=t.walk(e)),i})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="atrule")return t(r,i)}))}walkComments(e){return this.walk((t,r)=>{if(t.type==="comment")return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="decl")return t(r,i)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&e.test(r.selector))return t(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="rule")return t(r,i)}))}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]}};be.registerParse=s=>{Ta=s};be.registerRule=s=>{Qi=s};be.registerAtRule=s=>{en=s};be.registerRoot=s=>{Da=s};Fe=be;be.default=be;be.rebuild=s=>{s.type==="atrule"?Object.setPrototypeOf(s,en.prototype):s.type==="rule"?Object.setPrototypeOf(s,Qi.prototype):s.type==="decl"?Object.setPrototypeOf(s,Aa.prototype):s.type==="comment"?Object.setPrototypeOf(s,Oa.prototype):s.type==="root"&&Object.setPrototypeOf(s,Da.prototype),s[Ra]=!0,s.nodes&&s.nodes.forEach(e=>{be.rebuild(e)})};uh=Fe,Mt=class extends uh{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new La(new $a,this,e).stringify()}};Mt.registerLazyResult=s=>{La=s};Mt.registerProcessor=s=>{$a=s};tn=Mt;Mt.default=Mt;ri=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.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}},Fa=ri;ri.default=ri;ch=Fa,si=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 ch(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}},rn=si;si.default=si;Ps=39,yo=34,er=92,wo=47,tr=10,pt=32,rr=12,sr=9,ir=13,hh=91,fh=93,dh=40,ph=41,mh=123,gh=125,yh=59,wh=42,vh=58,bh=64,nr=/[\t\n\f\r "#'()/;[\\\]{}]/g,or=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Sh=/.[\r\n"'(/\\]/,vo=/[\da-f]/i,Ch=function(e,t={}){let r=e.css.valueOf(),i=t.ignoreErrors,n,o,a,l,u,c,h,f,g,p,m=r.length,d=0,y=[],b=[];function w(){return d}function S(F){throw e.error("Unclosed "+F,d)}function x(){return b.length===0&&d>=m}function N(F){if(b.length)return b.pop();if(d>=m)return;let H=F?F.ignoreUnclosed:!1;switch(n=r.charCodeAt(d),n){case tr:case pt:case sr:case ir:case rr:{o=d;do o+=1,n=r.charCodeAt(o);while(n===pt||n===tr||n===sr||n===ir||n===rr);p=["space",r.slice(d,o)],d=o-1;break}case hh:case fh:case mh:case gh:case vh:case yh:case ph:{let K=String.fromCharCode(n);p=[K,K,d];break}case dh:{if(f=y.length?y.pop()[1]:"",g=r.charCodeAt(d+1),f==="url"&&g!==Ps&&g!==yo&&g!==pt&&g!==tr&&g!==sr&&g!==rr&&g!==ir){o=d;do{if(c=!1,o=r.indexOf(")",o+1),o===-1)if(i||H){o=d;break}else S("bracket");for(h=o;r.charCodeAt(h-1)===er;)h-=1,c=!c}while(c);p=["brackets",r.slice(d,o+1),d,o],d=o}else o=r.indexOf(")",d+1),l=r.slice(d,o+1),o===-1||Sh.test(l)?p=["(","(",d]:(p=["brackets",l,d,o],d=o);break}case Ps:case yo:{a=n===Ps?"'":'"',o=d;do{if(c=!1,o=r.indexOf(a,o+1),o===-1)if(i||H){o=d+1;break}else S("string");for(h=o;r.charCodeAt(h-1)===er;)h-=1,c=!c}while(c);p=["string",r.slice(d,o+1),d,o],d=o;break}case bh:{nr.lastIndex=d+1,nr.test(r),nr.lastIndex===0?o=r.length-1:o=nr.lastIndex-2,p=["at-word",r.slice(d,o+1),d,o],d=o;break}case er:{for(o=d,u=!0;r.charCodeAt(o+1)===er;)o+=1,u=!u;if(n=r.charCodeAt(o+1),u&&n!==wo&&n!==pt&&n!==tr&&n!==sr&&n!==ir&&n!==rr&&(o+=1,vo.test(r.charAt(o)))){for(;vo.test(r.charAt(o+1));)o+=1;r.charCodeAt(o+1)===pt&&(o+=1)}p=["word",r.slice(d,o+1),d,o],d=o;break}default:{n===wo&&r.charCodeAt(d+1)===wh?(o=r.indexOf("*/",d+2)+1,o===0&&(i||H?o=r.length:S("comment")),p=["comment",r.slice(d,o+1),d,o],d=o):(or.lastIndex=d+1,or.test(r),or.lastIndex===0?o=r.length-1:o=or.lastIndex-2,p=["word",r.slice(d,o+1),d,o],y.push(p),d=o);break}}return d++,p}function B(F){b.push(F)}return{back:B,endOfFile:x,nextToken:N,position:w}},Ua=Fe,Dr=class extends Ua{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)}},sn=Dr;Dr.default=Dr;Ua.registerAtRule(Dr);Ba=Fe,Qe=class extends Ba{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let i=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let n of i)n.raws.before=t.raws.before}return i}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new Wa(new za,this,e).stringify()}};Qe.registerLazyResult=s=>{Wa=s};Qe.registerProcessor=s=>{za=s};$t=Qe;Qe.default=Qe;Ba.registerRoot(Qe);Nt={comma(s){return Nt.split(s,[","],!0)},space(s){let e=[" ",`
25
+ `," "];return Nt.split(s,e)},split(s,e,t){let r=[],i="",n=!1,o=0,a=!1,l="",u=!1;for(let c of s)u?u=!1:c==="\\"?u=!0:a?c===l&&(a=!1):c==='"'||c==="'"?(a=!0,l=c):c==="("?o+=1:c===")"?o>0&&(o-=1):o===0&&e.includes(c)&&(n=!0),n?(i!==""&&r.push(i.trim()),i="",n=!1):i+=c;return(t||i!=="")&&r.push(i.trim()),r}},Va=Nt;Nt.default=Nt;Ga=Fe,Eh=Va,kr=class extends Ga{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Eh.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)}},nn=kr;kr.default=kr;Ga.registerRule(kr);Ih=Qr,xh=Ch,Mh=ts,Nh=sn,Rh=$t,bo=nn,So={empty:!0,space:!0};Oh=class{constructor(e){this.input=e,this.root=new Rh,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=new Nh;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,i,n,o=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){a=!0;break}else if(r==="}"){if(l.length>0){for(n=l.length-1,i=l[n];i&&i[0]==="space";)i=l[--n];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else l.push(e);else l.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(t.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(t,"params",l),o&&(e=l[l.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),a&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,i;for(let n=t-1;n>=0&&(i=e[n],!(i[0]!=="space"&&(r+=1,r===2)));n--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(e){let t=0,r,i,n;for(let[o,a]of e.entries()){if(r=a,i=r[0],i==="("&&(t+=1),i===")"&&(t-=1),t===0&&i===":")if(!n)this.doubleColon(r);else{if(n[0]==="word"&&n[1]==="progid")continue;return o}n=r}return!1}comment(e){let t=new Mh;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 i=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=i[2],t.raws.left=i[1],t.raws.right=i[3]}}createTokenizer(){this.tokenizer=xh(this.input)}decl(e,t){let r=new Ih;this.init(r,e[0][2]);let i=e[e.length-1];for(i[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||Ah(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let u=e[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let n;for(;e.length;)if(n=e.shift(),n[0]===":"){r.raws.between+=n[1];break}else n[0]==="word"&&/\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=[],a;for(;e.length&&(a=e[0][0],!(a!=="space"&&a!=="comment"));)o.push(e.shift());this.precheckMissedSemicolon(e);for(let u=e.length-1;u>=0;u--){if(n=e[u],n[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(e,u);c=this.spacesFromEnd(e)+c,c!==" !important"&&(r.raws.important=c);break}else if(n[1].toLowerCase()==="important"){let c=e.slice(0),h="";for(let f=u;f>0;f--){let g=c[f][0];if(h.trim().indexOf("!")===0&&g!=="space")break;h=c.pop()[1]+h}h.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=h,e=c)}if(n[0]!=="space"&&n[0]!=="comment")break}e.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=o.map(u=>u[1]).join(""),o=[]),this.raw(r,"value",o.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 bo;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 t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.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="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,i=!1,n=null,o=[],a=e[1].startsWith("--"),l=[],u=e;for(;u;){if(r=u[0],l.push(u),r==="("||r==="[")n||(n=u),o.push(r==="("?")":"]");else if(a&&i&&r==="{")n||(n=u),o.push("}");else if(o.length===0)if(r===";")if(i){this.decl(l,a);return}else break;else if(r==="{"){this.rule(l);return}else if(r==="}"){this.tokenizer.back(l.pop()),t=!0;break}else r===":"&&(i=!0);else r===o[o.length-1]&&(o.pop(),o.length===0&&(n=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&i){if(!a)for(;l.length&&(u=l[l.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(l.pop());this.decl(l,a)}else this.unknownWord(l)}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);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,i){let n,o,a=r.length,l="",u=!0,c,h;for(let f=0;f<a;f+=1)n=r[f],o=n[0],o==="space"&&f===a-1&&!i?u=!1:o==="comment"?(h=r[f-1]?r[f-1][0]:"empty",c=r[f+1]?r[f+1][0]:"empty",!So[h]&&!So[c]?l.slice(-1)===","?u=!1:l+=n[1]:u=!1):l+=n[1];if(!u){let f=r.reduce((g,p)=>g+p[1],"");e.raws[t]={raw:f,value:l}}e[t]=l}rule(e){e.pop();let t=new bo;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],!(t!=="space"&&t!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let i=t;i<e.length;i++)r+=e[i][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})}},Th=Oh,Dh=Fe,kh=Th,_h=es;on=_r;_r.default=_r;Dh.registerParse(_r);({isClean:me,my:Ph}=Lt),Lh=Ma,$h=Kr,Fh=Fe,Uh=tn,Co=rn,Bh=on,Wh=$t,zh={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Vh={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},Gh={Once:!0,postcssPlugin:!0,prepare:!0},et=0;ni={},tt=class Ha{constructor(e,t,r){this.stringified=!1,this.processed=!1;let i;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))i=ii(t);else if(t instanceof Ha||t instanceof Co)i=ii(t.root),t.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let n=Bh;r.syntax&&(n=r.syntax.parse),r.parser&&(n=r.parser),n.parse&&(n=n.parse);try{i=n(t,r)}catch(o){this.processed=!0,this.error=o}i&&!i[Ph]&&Fh.rebuild(i)}this.result=new Co(e,i,r),this.helpers={...ni,postcss:ni,result:this.result},this.plugins=this.processor.plugins.map(n=>typeof n=="object"&&n.prepare?{...n,...n.prepare(this.result)}:n)}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{t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=r.postcssPlugin,e.setMessage()):r.postcssVersion}catch(i){console&&console.error&&console.error(i)}return e}prepareVisitors(){this.listeners={};let e=(t,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([t,i])};for(let t of this.plugins)if(typeof t=="object")for(let r in t){if(!Vh[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Gh[r])if(typeof t[r]=="object")for(let i in t[r])i==="*"?e(t,r,t[r][i]):e(t,r+"-"+i.toLowerCase(),t[r][i]);else typeof t[r]=="function"&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(mt(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[me];){e[me]=!0;let t=[Eo(e)];for(;t.length>0;){let r=this.visitTick(t);if(mt(r))try{await r}catch(i){let n=t[t.length-1].node;throw this.handleError(i,n)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let i=e.nodes.map(n=>r(n,this.helpers));await Promise.all(i)}else await r(e,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return mt(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")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=$h;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new Lh(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[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){let t=this.runOnRoot(e);if(mt(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[me];)e[me]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,i]of e){this.result.lastPlugin=r;let n;try{n=i(t,this.helpers)}catch(o){throw this.handleError(o,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(mt(n))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:i}=t;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(i.length>0&&t.visitorIndex<i.length){let[o,a]=i[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===i.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return a(r.toProxy(),this.helpers)}catch(l){throw this.handleError(l,r)}}if(t.iterator!==0){let o=t.iterator,a;for(;a=r.nodes[r.indexes[o]];)if(r.indexes[o]+=1,!a[me]){a[me]=!0,e.push(Eo(a));return}t.iterator=0,delete r.indexes[o]}let n=t.events;for(;t.eventIndex<n.length;){let o=n[t.eventIndex];if(t.eventIndex+=1,o===et){r.nodes&&r.nodes.length&&(r[me]=!0,t.iterator=r.getIterator());return}else if(this.listeners[o]){t.visitors=this.listeners[o];return}}e.pop()}walkSync(e){e[me]=!0;let t=ja(e);for(let r of t)if(r===et)e.nodes&&e.each(i=>{i[me]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,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"}};tt.registerPostcss=s=>{ni=s};Ya=tt;tt.default=tt;Wh.registerLazyResult(tt);Uh.registerLazyResult(tt);jh=Ma,Hh=Kr,Yh=on,Zh=rn,oi=class{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let i,n=Hh;this.result=new Zh(this._processor,i,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let a=new jh(n,i,this._opts,t);if(a.isMap()){let[l,u]=a.generate();l&&(this.result.css=l),u&&(this.result.map=u)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Yh;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"}},Xh=oi;oi.default=oi;Jh=Xh,Kh=Ya,qh=tn,Qh=$t,Rt=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new Jh(this,e,t):new Kh(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}},ef=Rt;Rt.default=Rt;Qh.registerProcessor(Rt);qh.registerProcessor(Rt);tf=Qr,rf=Sa,sf=ts,nf=sn,of=es,af=$t,lf=nn;uf=At;At.default=At;cf=qi,Za=Qr,hf=Ya,ff=Fe,an=ef,df=Kr,pf=uf,Xa=tn,mf=Fa,Ja=ts,Ka=sn,gf=rn,yf=es,wf=on,vf=Va,qa=nn,Qa=$t,bf=qr;L.plugin=function(e,t){let r=!1;function i(...o){console&&console.warn&&!r&&(r=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
26
+ https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
27
+ https://www.w3ctech.com/topic/2226`));let a=t(...o);return a.postcssPlugin=e,a.postcssVersion=new an().version,a}let n;return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(o,a,l){return L([i(l)]).process(o,a)},i};L.stringify=df;L.parse=wf;L.fromJSON=pf;L.list=vf;L.comment=s=>new Ja(s);L.atRule=s=>new Ka(s);L.decl=s=>new Za(s);L.rule=s=>new qa(s);L.root=s=>new Qa(s);L.document=s=>new Xa(s);L.CssSyntaxError=cf;L.Declaration=Za;L.Container=ff;L.Processor=an;L.Document=Xa;L.Comment=Ja;L.Warning=mf;L.AtRule=Ka;L.Result=gf;L.Input=yf;L.Rule=qa;L.Root=Qa;L.Node=bf;hf.registerPostcss(L);Sf=L;L.default=L;G=Dc(Sf);G.stringify;G.fromJSON;G.plugin;G.parse;G.list;G.document;G.comment;G.atRule;G.rule;G.decl;G.root;G.CssSyntaxError;G.Declaration;G.Container;G.Processor;G.Document;G.Comment;G.Warning;G.AtRule;G.Result;G.Input;G.Rule;G.Root;G.Node;Io={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};Af=Object.defineProperty,Of=(s,e,t)=>e in s?Af(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,C=(s,e,t)=>Of(s,typeof e!="symbol"?e+"":e,t),Tf=Object.defineProperty,Df=(s,e,t)=>e in s?Tf(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,Mo=(s,e,t)=>Df(s,typeof e!="symbol"?e+"":e,t),kf=class{constructor(){Mo(this,"idNodeMap",new Map),Mo(this,"nodeMetaMap",new WeakMap)}getId(e){var t;return e?((t=this.getMeta(e))==null?void 0:t.id)??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){let r=this.getNode(e);if(r){let i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};ln={exports:{}},V=String,el=function(){return{isColorSupported:!1,reset:V,bold:V,dim:V,italic:V,underline:V,inverse:V,hidden:V,strikethrough:V,black:V,red:V,green:V,yellow:V,blue:V,magenta:V,cyan:V,white:V,gray:V,bgBlack:V,bgRed:V,bgGreen:V,bgYellow:V,bgBlue:V,bgMagenta:V,bgCyan:V,bgWhite:V}};ln.exports=el();ln.exports.createColors=el;$f=ln.exports,Ff={},Uf=Object.freeze(Object.defineProperty({__proto__:null,default:Ff},Symbol.toStringTag,{value:"Module"})),de=Lf(Uf),No=$f,Ro=de,ai=class tl extends Error{constructor(e,t,r,i,n,o){super(e),this.name="CssSyntaxError",this.reason=e,n&&(this.file=n),i&&(this.source=i),o&&(this.plugin=o),typeof t<"u"&&typeof r<"u"&&(typeof t=="number"?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,tl)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=No.isColorSupported),Ro&&e&&(t=Ro(t));let r=t.split(/\r?\n/),i=Math.max(this.line-3,0),n=Math.min(this.line+2,r.length),o=String(n).length,a,l;if(e){let{bold:u,gray:c,red:h}=No.createColors(!0);a=f=>u(h(f)),l=f=>c(f)}else a=l=u=>u;return r.slice(i,n).map((u,c)=>{let h=i+1+c,f=" "+(" "+h).slice(-o)+" | ";if(h===this.line){let g=l(f.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(f)+u+`
28
+ `+g+a("^")}return" "+l(f)+u}).join(`
29
+ `)}toString(){let e=this.showSourceCode();return e&&(e=`
30
+
31
+ `+e+`
32
+ `),this.name+": "+this.message+e}},un=ai;ai.default=ai;Ft={};Ft.isClean=Symbol("isClean");Ft.my=Symbol("my");Ao={after:`
33
+ `,beforeClose:`
34
+ `,beforeComment:`
35
+ `,beforeDecl:`
36
+ `,beforeOpen:" ",beforeRule:`
37
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};li=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,i=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?r+=e.raws.afterName:i&&(r+=" "),e.nodes)this.block(e,r+i);else{let n=(e.raws.between||"")+(t?";":"");this.builder(r+i+n,e)}}beforeAfter(e,t){let r;e.type==="decl"?r=this.raw(e,null,"beforeDecl"):e.type==="comment"?r=this.raw(e,null,"beforeComment"):t==="before"?r=this.raw(e,null,"beforeRule"):r=this.raw(e,null,"beforeClose");let i=e.parent,n=0;for(;i&&i.type!=="root";)n+=1,i=i.parent;if(r.includes(`
38
+ `)){let o=this.raw(e,null,"indent");if(o.length)for(let a=0;a<n;a++)r+=o}return r}block(e,t){let r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start");let i;e.nodes&&e.nodes.length?(this.body(e),i=this.raw(e,"after")):i=this.raw(e,"after","emptyBody"),i&&this.builder(i),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let i=0;i<e.nodes.length;i++){let n=e.nodes[i],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==i||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"),i=e.prop+r+this.rawValue(e,"value");e.important&&(i+=e.raws.important||" !important"),t&&(i+=";"),this.builder(i,e)}document(e){this.body(e)}raw(e,t,r){let i;if(r||(r=t),t&&(i=e.raws[t],typeof i<"u"))return i;let n=e.parent;if(r==="before"&&(!n||n.type==="root"&&n.first===e||n&&n.type==="document"))return"";if(!n)return Ao[r];let o=e.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[r]<"u")return o.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let a="raw"+Bf(r);this[a]?i=this[a](o,e):o.walk(l=>{if(i=l.raws[t],typeof i<"u")return!1})}return typeof i>"u"&&(i=Ao[r]),o.rawCache[r]=i,i}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return t=r.raws.after,t.includes(`
39
+ `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
40
+ `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
41
+ `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(r=>{if(r.type!=="decl"&&(t=r.raws.between,typeof t<"u"))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&typeof r.raws.before<"u")return t=r.raws.before,t.includes(`
42
+ `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(r=>{if(typeof r.raws.between<"u")return t=r.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length===0&&(t=r.raws.after,typeof t<"u"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let i=r.parent;if(i&&i!==e&&i.parent&&i.parent===e&&typeof r.raws.before<"u"){let n=r.raws.before.split(`
43
+ `);return t=n[n.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(t=r.raws.semicolon,typeof t<"u"))return!1}),t}rawValue(e,t){let r=e[t],i=e.raws[t];return i&&i.value===r?i.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)}},rl=li;li.default=li;Wf=rl;ss=ui;ui.default=ui;({isClean:ar,my:zf}=Ft),Vf=un,Gf=rl,jf=ss;hi=class{constructor(e={}){this.raws={},this[ar]=!1,this[zf]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let r of e[t])typeof r.clone=="function"?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=ci(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:i}=this.rangeBy(t);return this.source.input.error(e,{column:i.column,line:i.line},{column:r.column,line:r.line},t)}return new Vf(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markDirty(){if(this[ar]){this[ar]=!1;let e=this;for(;e=e.parent;)e[ar]=!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){t=this.toString();let i=t.indexOf(e.word);i!==-1&&(r=this.positionInside(i,t))}return r}positionInside(e,t){let r=t||this.toString(),i=this.source.start.column,n=this.source.start.line;for(let o=0;o<e;o++)r[o]===`
44
+ `?(i=1,n+=1):i+=1;return{column:i,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let i=this.toString(),n=i.indexOf(e.word);n!==-1&&(t=this.positionInside(n,i),r=this.positionInside(n+e.word.length,i))}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}:typeof e.endIndex=="number"?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 Gf().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 i of e)i===this?r=!0:r?(this.parent.insertAfter(t,i),t=i):this.parent.insertBefore(t,i);r||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let r={},i=t==null;t=t||new Map;let n=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let a=this[o];if(Array.isArray(a))r[o]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,t):l);else if(typeof a=="object"&&a.toJSON)r[o]=a.toJSON(null,t);else if(o==="source"){let l=t.get(a.input);l==null&&(l=n,t.set(a.input,n),n++),r[o]={end:a.end,inputId:l,start:a.start}}else r[o]=a}return i&&(r.inputs=[...t.keys()].map(o=>o.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=jf){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let i={node:this};for(let n in r)i[n]=r[n];return e.warn(t,i)}get proxyOf(){return this}},is=hi;hi.default=hi;Hf=is,fi=class extends Hf{constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}},ns=fi;fi.default=fi;Yf="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",Zf=(s,e=21)=>(t=e)=>{let r="",i=t;for(;i--;)r+=s[Math.random()*s.length|0];return r},Xf=(s=21)=>{let e="",t=s;for(;t--;)e+=Yf[Math.random()*64|0];return e},Jf={nanoid:Xf,customAlphabet:Zf},{SourceMapConsumer:Oo,SourceMapGenerator:To}=de,{existsSync:Kf,readFileSync:qf}=de,{dirname:Ls,join:Qf}=de;di=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,i=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Ls(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Oo(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,n=/^data:application\/json,/;if(i.test(e)||n.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||r.test(e))return ed(e.substr(RegExp.lastMatch.length));let o=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+o)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),i=e.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,i)))}loadFile(e){if(this.root=Ls(e),Kf(e))return this.mapFile=e,qf(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let r=t(e);if(r){let i=this.loadFile(r);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(t instanceof Oo)return To.fromSourceMap(t).toString();if(t instanceof To)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=Qf(Ls(e),r)),this.loadFile(r)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},sl=di;di.default=di;({SourceMapConsumer:td,SourceMapGenerator:rd}=de),{fileURLToPath:Do,pathToFileURL:lr}=de,{isAbsolute:pi,resolve:mi}=de,{nanoid:sd}=Jf,$s=de,ko=un,id=sl,Fs=Symbol("fromOffsetCache"),nd=!!(td&&rd),_o=!!(mi&&pi),Pr=class{constructor(e,t={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!_o||/^\w+:\/\//.test(t.from)||pi(t.from)?this.file=t.from:this.file=mi(t.from)),_o&&nd){let r=new id(this.css,t);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+sd(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let n,o,a;if(t&&typeof t=="object"){let u=t,c=r;if(typeof u.offset=="number"){let h=this.fromOffset(u.offset);t=h.line,r=h.col}else t=u.line,r=u.column;if(typeof c.offset=="number"){let h=this.fromOffset(c.offset);o=h.line,a=h.col}else o=c.line,a=c.column}else if(!r){let u=this.fromOffset(t);t=u.line,r=u.col}let l=this.origin(t,r,o,a);return l?n=new ko(e,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,i.plugin):n=new ko(e,o===void 0?t:{column:r,line:t},o===void 0?r:{column:a,line:o},this.css,this.file,i.plugin),n.input={column:r,endColumn:a,endLine:o,line:t,source:this.css},this.file&&(lr&&(n.input.url=lr(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[Fs])r=this[Fs];else{let n=this.css.split(`
45
+ `);r=new Array(n.length);let o=0;for(let a=0,l=n.length;a<l;a++)r[a]=o,o+=n[a].length+1;this[Fs]=r}t=r[r.length-1];let i=0;if(e>=t)i=r.length-1;else{let n=r.length-2,o;for(;i<n;)if(o=i+(n-i>>1),e<r[o])n=o-1;else if(e>=r[o+1])i=o+1;else{i=o;break}}return{col:e-r[i]+1,line:i+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:mi(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,i){if(!this.map)return!1;let n=this.map.consumer(),o=n.originalPositionFor({column:t,line:e});if(!o.source)return!1;let a;typeof r=="number"&&(a=n.originalPositionFor({column:i,line:r}));let l;pi(o.source)?l=lr(o.source):l=new URL(o.source,this.map.consumer().sourceRoot||lr(this.map.mapFile));let u={column:o.column,endColumn:a&&a.column,endLine:a&&a.line,line:o.line,url:l.toString()};if(l.protocol==="file:")if(Do)u.file=Do(l);else throw new Error("file: protocol is not available in this PostCSS build");let c=n.sourceContentFor(o.source);return c&&(u.source=c),u}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(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}},os=Pr;Pr.default=Pr;$s&&$s.registerInput&&$s.registerInput(Pr);({SourceMapConsumer:il,SourceMapGenerator:Cr}=de),{dirname:Er,relative:nl,resolve:ol,sep:al}=de,{pathToFileURL:Po}=de,od=os,ad=!!(il&&Cr),ld=!!(Er&&ol&&nl&&al),ud=class{constructor(e,t,r,i){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=`
46
+ `;this.css.includes(`\r
47
+ `)&&(t=`\r
48
+ `),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||Er(e.file),i;this.mapOpts.sourcesContent===!1?(i=new il(e.text),i.sourcesContent&&(i.sourcesContent=null)):i=e.consumer(),this.map.applySourceMap(i,t,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),ld&&ad&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Cr.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Cr({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 Cr({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},n,o;this.stringify(this.root,(a,l,u)=>{if(this.css+=a,l&&u!=="end"&&(i.generated.line=e,i.generated.column=t-1,l.source&&l.source.start?(i.source=this.sourcePath(l),i.original.line=l.source.start.line,i.original.column=l.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),n=a.match(/\n/g),n?(e+=n.length,o=a.lastIndexOf(`
49
+ `),t=a.length-o):t+=a.length,l&&u!=="start"){let c=l.parent||{raws:{}};(!(l.type==="decl"||l.type==="atrule"&&!l.nodes)||l!==c.last||c.raws.semicolon)&&(l.source&&l.source.end?(i.source=this.sourcePath(l),i.original.line=l.source.end.line,i.original.column=l.source.end.column-1,i.generated.line=e,i.generated.column=t-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=t-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(e=>e.withContent()):!0}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||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Er(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Er(ol(r,this.mapOpts.annotation)));let i=nl(r,e);return this.memoizedPaths.set(e,i),i}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 od(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 i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,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(Po){let r=Po(e).toString();return this.memoizedFileURLs.set(e,r),r}else 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;al==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}},ll=ud,cd=is,gi=class extends cd{constructor(e){super(e),this.type="comment"}},as=gi;gi.default=gi;({isClean:ul,my:cl}=Ft),hl=ns,fl=as,hd=is;Se=class yl extends hd{append(...e){for(let t of e){let r=this.normalize(t,this.last);for(let i of r)this.proxyOf.nodes.push(i)}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=this.getIterator(),r,i;for(;this.indexes[t]<this.proxyOf.nodes.length&&(r=this.indexes[t],i=e(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[t]+=1;return delete this.indexes[t],i}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){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...r)=>e[t](...r.map(i=>typeof i=="function"?(n,o)=>i(n.toProxy(),o):i)):t==="every"||t==="some"?r=>e[t]((i,...n)=>r(i.toProxy(),...n)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(r=>r.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let o of i)this.proxyOf.nodes.splice(r+1,0,o);let n;for(let o in this.indexes)n=this.indexes[o],r<n&&(this.indexes[o]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),i=r===0?"prepend":!1,n=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let a of n)this.proxyOf.nodes.splice(r,0,a);let o;for(let a in this.indexes)o=this.indexes[a],r<=o&&(this.indexes[a]=o+n.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=ml(dl(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new hl(e)]}else if(e.selector)e=[new cn(e)];else if(e.name)e=[new hn(e)];else if(e.text)e=[new fl(e)];else throw new Error("Unknown node type in node creation");return e.map(i=>(i[cl]||yl.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[ul]&&gl(i),typeof i.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(i.raws.before=t.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.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){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;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(i=>{t.props&&!t.props.includes(i.prop)||t.fast&&!i.value.includes(t.fast)||(i.value=i.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let i;try{i=e(t,r)}catch(n){throw t.addToError(n)}return i!==!1&&t.walk&&(i=t.walk(e)),i})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="atrule")return t(r,i)}))}walkComments(e){return this.walk((t,r)=>{if(t.type==="comment")return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="decl")return t(r,i)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&e.test(r.selector))return t(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="rule")return t(r,i)}))}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]}};Se.registerParse=s=>{dl=s};Se.registerRule=s=>{cn=s};Se.registerAtRule=s=>{hn=s};Se.registerRoot=s=>{pl=s};Ue=Se;Se.default=Se;Se.rebuild=s=>{s.type==="atrule"?Object.setPrototypeOf(s,hn.prototype):s.type==="rule"?Object.setPrototypeOf(s,cn.prototype):s.type==="decl"?Object.setPrototypeOf(s,hl.prototype):s.type==="comment"?Object.setPrototypeOf(s,fl.prototype):s.type==="root"&&Object.setPrototypeOf(s,pl.prototype),s[cl]=!0,s.nodes&&s.nodes.forEach(e=>{Se.rebuild(e)})};fd=Ue,Ot=class extends fd{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new wl(new vl,this,e).stringify()}};Ot.registerLazyResult=s=>{wl=s};Ot.registerProcessor=s=>{vl=s};fn=Ot;Ot.default=Ot;yi=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.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}},bl=yi;yi.default=yi;dd=bl,wi=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new dd(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}},dn=wi;wi.default=wi;Us=39,Lo=34,ur=92,$o=47,cr=10,gt=32,hr=12,fr=9,dr=13,pd=91,md=93,gd=40,yd=41,wd=123,vd=125,bd=59,Sd=42,Cd=58,Ed=64,pr=/[\t\n\f\r "#'()/;[\\\]{}]/g,mr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Id=/.[\r\n"'(/\\]/,Fo=/[\da-f]/i,xd=function(e,t={}){let r=e.css.valueOf(),i=t.ignoreErrors,n,o,a,l,u,c,h,f,g,p,m=r.length,d=0,y=[],b=[];function w(){return d}function S(F){throw e.error("Unclosed "+F,d)}function x(){return b.length===0&&d>=m}function N(F){if(b.length)return b.pop();if(d>=m)return;let H=F?F.ignoreUnclosed:!1;switch(n=r.charCodeAt(d),n){case cr:case gt:case fr:case dr:case hr:{o=d;do o+=1,n=r.charCodeAt(o);while(n===gt||n===cr||n===fr||n===dr||n===hr);p=["space",r.slice(d,o)],d=o-1;break}case pd:case md:case wd:case vd:case Cd:case bd:case yd:{let K=String.fromCharCode(n);p=[K,K,d];break}case gd:{if(f=y.length?y.pop()[1]:"",g=r.charCodeAt(d+1),f==="url"&&g!==Us&&g!==Lo&&g!==gt&&g!==cr&&g!==fr&&g!==hr&&g!==dr){o=d;do{if(c=!1,o=r.indexOf(")",o+1),o===-1)if(i||H){o=d;break}else S("bracket");for(h=o;r.charCodeAt(h-1)===ur;)h-=1,c=!c}while(c);p=["brackets",r.slice(d,o+1),d,o],d=o}else o=r.indexOf(")",d+1),l=r.slice(d,o+1),o===-1||Id.test(l)?p=["(","(",d]:(p=["brackets",l,d,o],d=o);break}case Us:case Lo:{a=n===Us?"'":'"',o=d;do{if(c=!1,o=r.indexOf(a,o+1),o===-1)if(i||H){o=d+1;break}else S("string");for(h=o;r.charCodeAt(h-1)===ur;)h-=1,c=!c}while(c);p=["string",r.slice(d,o+1),d,o],d=o;break}case Ed:{pr.lastIndex=d+1,pr.test(r),pr.lastIndex===0?o=r.length-1:o=pr.lastIndex-2,p=["at-word",r.slice(d,o+1),d,o],d=o;break}case ur:{for(o=d,u=!0;r.charCodeAt(o+1)===ur;)o+=1,u=!u;if(n=r.charCodeAt(o+1),u&&n!==$o&&n!==gt&&n!==cr&&n!==fr&&n!==dr&&n!==hr&&(o+=1,Fo.test(r.charAt(o)))){for(;Fo.test(r.charAt(o+1));)o+=1;r.charCodeAt(o+1)===gt&&(o+=1)}p=["word",r.slice(d,o+1),d,o],d=o;break}default:{n===$o&&r.charCodeAt(d+1)===Sd?(o=r.indexOf("*/",d+2)+1,o===0&&(i||H?o=r.length:S("comment")),p=["comment",r.slice(d,o+1),d,o],d=o):(mr.lastIndex=d+1,mr.test(r),mr.lastIndex===0?o=r.length-1:o=mr.lastIndex-2,p=["word",r.slice(d,o+1),d,o],y.push(p),d=o);break}}return d++,p}function B(F){b.push(F)}return{back:B,endOfFile:x,nextToken:N,position:w}},Sl=Ue,Lr=class extends Sl{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)}},pn=Lr;Lr.default=Lr;Sl.registerAtRule(Lr);Cl=Ue,rt=class extends Cl{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let i=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let n of i)n.raws.before=t.raws.before}return i}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new El(new Il,this,e).stringify()}};rt.registerLazyResult=s=>{El=s};rt.registerProcessor=s=>{Il=s};Ut=rt;rt.default=rt;Cl.registerRoot(rt);Tt={comma(s){return Tt.split(s,[","],!0)},space(s){let e=[" ",`
50
+ `," "];return Tt.split(s,e)},split(s,e,t){let r=[],i="",n=!1,o=0,a=!1,l="",u=!1;for(let c of s)u?u=!1:c==="\\"?u=!0:a?c===l&&(a=!1):c==='"'||c==="'"?(a=!0,l=c):c==="("?o+=1:c===")"?o>0&&(o-=1):o===0&&e.includes(c)&&(n=!0),n?(i!==""&&r.push(i.trim()),i="",n=!1):i+=c;return(t||i!=="")&&r.push(i.trim()),r}},xl=Tt;Tt.default=Tt;Ml=Ue,Md=xl,$r=class extends Ml{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Md.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)}},mn=$r;$r.default=$r;Ml.registerRule($r);Nd=ns,Rd=xd,Ad=as,Od=pn,Td=Ut,Uo=mn,Bo={empty:!0,space:!0};kd=class{constructor(e){this.input=e,this.root=new Td,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=new Od;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,i,n,o=!1,a=!1,l=[],u=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){a=!0;break}else if(r==="}"){if(l.length>0){for(n=l.length-1,i=l[n];i&&i[0]==="space";)i=l[--n];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else l.push(e);else l.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(t.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(t,"params",l),o&&(e=l[l.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),a&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,i;for(let n=t-1;n>=0&&(i=e[n],!(i[0]!=="space"&&(r+=1,r===2)));n--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(e){let t=0,r,i,n;for(let[o,a]of e.entries()){if(r=a,i=r[0],i==="("&&(t+=1),i===")"&&(t-=1),t===0&&i===":")if(!n)this.doubleColon(r);else{if(n[0]==="word"&&n[1]==="progid")continue;return o}n=r}return!1}comment(e){let t=new Ad;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 i=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=i[2],t.raws.left=i[1],t.raws.right=i[3]}}createTokenizer(){this.tokenizer=Rd(this.input)}decl(e,t){let r=new Nd;this.init(r,e[0][2]);let i=e[e.length-1];for(i[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||Dd(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let u=e[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let n;for(;e.length;)if(n=e.shift(),n[0]===":"){r.raws.between+=n[1];break}else n[0]==="word"&&/\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=[],a;for(;e.length&&(a=e[0][0],!(a!=="space"&&a!=="comment"));)o.push(e.shift());this.precheckMissedSemicolon(e);for(let u=e.length-1;u>=0;u--){if(n=e[u],n[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(e,u);c=this.spacesFromEnd(e)+c,c!==" !important"&&(r.raws.important=c);break}else if(n[1].toLowerCase()==="important"){let c=e.slice(0),h="";for(let f=u;f>0;f--){let g=c[f][0];if(h.trim().indexOf("!")===0&&g!=="space")break;h=c.pop()[1]+h}h.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=h,e=c)}if(n[0]!=="space"&&n[0]!=="comment")break}e.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=o.map(u=>u[1]).join(""),o=[]),this.raw(r,"value",o.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 Uo;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 t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.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="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,i=!1,n=null,o=[],a=e[1].startsWith("--"),l=[],u=e;for(;u;){if(r=u[0],l.push(u),r==="("||r==="[")n||(n=u),o.push(r==="("?")":"]");else if(a&&i&&r==="{")n||(n=u),o.push("}");else if(o.length===0)if(r===";")if(i){this.decl(l,a);return}else break;else if(r==="{"){this.rule(l);return}else if(r==="}"){this.tokenizer.back(l.pop()),t=!0;break}else r===":"&&(i=!0);else r===o[o.length-1]&&(o.pop(),o.length===0&&(n=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&i){if(!a)for(;l.length&&(u=l[l.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(l.pop());this.decl(l,a)}else this.unknownWord(l)}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);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,i){let n,o,a=r.length,l="",u=!0,c,h;for(let f=0;f<a;f+=1)n=r[f],o=n[0],o==="space"&&f===a-1&&!i?u=!1:o==="comment"?(h=r[f-1]?r[f-1][0]:"empty",c=r[f+1]?r[f+1][0]:"empty",!Bo[h]&&!Bo[c]?l.slice(-1)===","?u=!1:l+=n[1]:u=!1):l+=n[1];if(!u){let f=r.reduce((g,p)=>g+p[1],"");e.raws[t]={raw:f,value:l}}e[t]=l}rule(e){e.pop();let t=new Uo;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],!(t!=="space"&&t!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let i=t;i<e.length;i++)r+=e[i][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})}},_d=kd,Pd=Ue,Ld=_d,$d=os;gn=Fr;Fr.default=Fr;Pd.registerParse(Fr);({isClean:ge,my:Fd}=Ft),Ud=ll,Bd=ss,Wd=Ue,zd=fn,Wo=dn,Vd=gn,Gd=Ut,jd={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Hd={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},Yd={Once:!0,postcssPlugin:!0,prepare:!0},st=0;bi={},it=class Rl{constructor(e,t,r){this.stringified=!1,this.processed=!1;let i;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))i=vi(t);else if(t instanceof Rl||t instanceof Wo)i=vi(t.root),t.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let n=Vd;r.syntax&&(n=r.syntax.parse),r.parser&&(n=r.parser),n.parse&&(n=n.parse);try{i=n(t,r)}catch(o){this.processed=!0,this.error=o}i&&!i[Fd]&&Wd.rebuild(i)}this.result=new Wo(e,i,r),this.helpers={...bi,postcss:bi,result:this.result},this.plugins=this.processor.plugins.map(n=>typeof n=="object"&&n.prepare?{...n,...n.prepare(this.result)}:n)}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{t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=r.postcssPlugin,e.setMessage()):r.postcssVersion}catch(i){console&&console.error&&console.error(i)}return e}prepareVisitors(){this.listeners={};let e=(t,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([t,i])};for(let t of this.plugins)if(typeof t=="object")for(let r in t){if(!Hd[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Yd[r])if(typeof t[r]=="object")for(let i in t[r])i==="*"?e(t,r,t[r][i]):e(t,r+"-"+i.toLowerCase(),t[r][i]);else typeof t[r]=="function"&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(yt(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ge];){e[ge]=!0;let t=[zo(e)];for(;t.length>0;){let r=this.visitTick(t);if(yt(r))try{await r}catch(i){let n=t[t.length-1].node;throw this.handleError(i,n)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let i=e.nodes.map(n=>r(n,this.helpers));await Promise.all(i)}else await r(e,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return yt(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")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=Bd;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new Ud(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[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){let t=this.runOnRoot(e);if(yt(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ge];)e[ge]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,i]of e){this.result.lastPlugin=r;let n;try{n=i(t,this.helpers)}catch(o){throw this.handleError(o,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(yt(n))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:i}=t;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(i.length>0&&t.visitorIndex<i.length){let[o,a]=i[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===i.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return a(r.toProxy(),this.helpers)}catch(l){throw this.handleError(l,r)}}if(t.iterator!==0){let o=t.iterator,a;for(;a=r.nodes[r.indexes[o]];)if(r.indexes[o]+=1,!a[ge]){a[ge]=!0,e.push(zo(a));return}t.iterator=0,delete r.indexes[o]}let n=t.events;for(;t.eventIndex<n.length;){let o=n[t.eventIndex];if(t.eventIndex+=1,o===st){r.nodes&&r.nodes.length&&(r[ge]=!0,t.iterator=r.getIterator());return}else if(this.listeners[o]){t.visitors=this.listeners[o];return}}e.pop()}walkSync(e){e[ge]=!0;let t=Nl(e);for(let r of t)if(r===st)e.nodes&&e.each(i=>{i[ge]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,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"}};it.registerPostcss=s=>{bi=s};Al=it;it.default=it;Gd.registerLazyResult(it);zd.registerLazyResult(it);Zd=ll,Xd=ss,Jd=gn,Kd=dn,Si=class{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let i,n=Xd;this.result=new Kd(this._processor,i,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let a=new Zd(n,i,this._opts,t);if(a.isMap()){let[l,u]=a.generate();l&&(this.result.css=l),u&&(this.result.map=u)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Jd;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"}},qd=Si;Si.default=Si;Qd=qd,ep=Al,tp=fn,rp=Ut,Dt=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(!(typeof r=="object"&&(r.parse||r.stringify)))throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new Qd(this,e,t):new ep(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}},sp=Dt;Dt.default=Dt;rp.registerProcessor(Dt);tp.registerProcessor(Dt);ip=ns,np=sl,op=as,ap=pn,lp=os,up=Ut,cp=mn;hp=kt;kt.default=kt;fp=un,Ol=ns,dp=Al,pp=Ue,yn=sp,mp=ss,gp=hp,Tl=fn,yp=bl,Dl=as,kl=pn,wp=dn,vp=os,bp=gn,Sp=xl,_l=mn,Pl=Ut,Cp=is;$.plugin=function(e,t){let r=!1;function i(...o){console&&console.warn&&!r&&(r=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
51
+ https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
52
+ https://www.w3ctech.com/topic/2226`));let a=t(...o);return a.postcssPlugin=e,a.postcssVersion=new yn().version,a}let n;return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(o,a,l){return $([i(l)]).process(o,a)},i};$.stringify=mp;$.parse=bp;$.fromJSON=gp;$.list=Sp;$.comment=s=>new Dl(s);$.atRule=s=>new kl(s);$.decl=s=>new Ol(s);$.rule=s=>new _l(s);$.root=s=>new Pl(s);$.document=s=>new Tl(s);$.CssSyntaxError=fp;$.Declaration=Ol;$.Container=pp;$.Processor=yn;$.Document=Tl;$.Comment=Dl;$.Warning=yp;$.AtRule=kl;$.Result=wp;$.Input=vp;$.Rule=_l;$.Root=Pl;$.Node=Cp;dp.registerPostcss($);Ep=$;$.default=$;j=Pf(Ep);j.stringify;j.fromJSON;j.plugin;j.parse;j.list;j.document;j.comment;j.atRule;j.rule;j.decl;j.root;j.CssSyntaxError;j.Declaration;j.Container;j.Processor;j.Document;j.Comment;j.Warning;j.AtRule;j.Result;j.Input;j.Rule;j.Root;j.Node;O=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(O||{});xp=/-([a-z])/g,Mp=/^--[a-zA-Z0-9-]+$/,Ci=s=>Mp.test(s)?s:s.replace(xp,(e,t)=>t?t.toUpperCase():""),Np=/\B([A-Z])/g,Rp=s=>s.replace(Np,"-$1").toLowerCase(),he=class s{constructor(...e){C(this,"parentElement",null),C(this,"parentNode",null),C(this,"ownerDocument"),C(this,"firstChild",null),C(this,"lastChild",null),C(this,"previousSibling",null),C(this,"nextSibling",null),C(this,"ELEMENT_NODE",1),C(this,"TEXT_NODE",3),C(this,"nodeType"),C(this,"nodeName"),C(this,"RRNodeType")}get childNodes(){let e=[],t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(e instanceof s){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;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"}},Ei=class s extends he{constructor(...e){super(e),C(this,"nodeType",9),C(this,"nodeName","#document"),C(this,"compatMode","CSS1Compat"),C(this,"RRNodeType",O.Document),C(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(e=>e.RRNodeType===O.Element&&e.tagName==="HTML")||null}get body(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(t=>t.RRNodeType===O.Element&&t.tagName==="BODY"))||null}get head(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(t=>t.RRNodeType===O.Element&&t.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){let t=e.RRNodeType;if((t===O.Element||t===O.DocumentType)&&this.childNodes.some(i=>i.RRNodeType===t))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${t===O.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);let r=wn(this,e);return r.parentElement=null,r}insertBefore(e,t){let r=e.RRNodeType;if((r===O.Element||r===O.DocumentType)&&this.childNodes.some(n=>n.RRNodeType===r))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${r===O.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);let i=Ll(this,e,t);return i.parentElement=null,i}removeChild(e){return $l(this,e)}open(){this.firstChild=null,this.lastChild=null}close(){}write(e){let t;if(e==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?t="-//W3C//DTD XHTML 1.0 Transitional//EN":e==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(t="-//W3C//DTD HTML 4.0 Transitional//EN"),t){let r=this.createDocumentType("html",t,"");this.open(),this.appendChild(r)}}createDocument(e,t,r){return new s}createDocumentType(e,t,r){let i=new Ur(e,t,r);return i.ownerDocument=this,i}createElement(e){let t=new nt(e);return t.ownerDocument=this,t}createElementNS(e,t){return this.createElement(t)}createTextNode(e){let t=new Br(e);return t.ownerDocument=this,t}createComment(e){let t=new Wr(e);return t.ownerDocument=this,t}createCDATASection(e){let t=new zr(e);return t.ownerDocument=this,t}toString(){return"RRDocument"}},Ur=class extends he{constructor(e,t,r){super(),C(this,"nodeType",10),C(this,"RRNodeType",O.DocumentType),C(this,"name"),C(this,"publicId"),C(this,"systemId"),C(this,"textContent",null),this.name=e,this.publicId=t,this.systemId=r,this.nodeName=e}toString(){return"RRDocumentType"}},nt=class extends he{constructor(e){super(),C(this,"nodeType",1),C(this,"RRNodeType",O.Element),C(this,"tagName"),C(this,"attributes",{}),C(this,"shadowRoot",null),C(this,"scrollLeft"),C(this,"scrollTop"),this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach(t=>e+=t.textContent),e}set textContent(e){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(e))}get classList(){return new Mi(this.attributes.class,e=>{this.attributes.class=e})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){let e=this.attributes.style?Ip(this.attributes.style):{},t=/\B([A-Z])/g;return e.setProperty=(r,i,n)=>{if(t.test(r))return;let o=Ci(r);i?e[o]=i:delete e[o],n==="important"&&(e[o]+=" !important"),this.attributes.style=Vo(e)},e.removeProperty=r=>{if(t.test(r))return"";let i=Ci(r),n=e[i]||"";return delete e[i],this.attributes.style=Vo(e),n},e}getAttribute(e){return this.attributes[e]===void 0?null:this.attributes[e]}setAttribute(e,t){this.attributes[e]=t}setAttributeNS(e,t,r){this.setAttribute(t,r)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return wn(this,e)}insertBefore(e,t){return Ll(this,e,t)}removeChild(e){return $l(this,e)}attachShadow(e){let t=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=t,t}dispatchEvent(e){return!0}toString(){let e="";for(let t in this.attributes)e+=`${t}="${this.attributes[t]}" `;return`${this.tagName} ${e}`}},Ii=class extends nt{constructor(){super(...arguments),C(this,"currentTime"),C(this,"volume"),C(this,"paused"),C(this,"muted"),C(this,"playbackRate"),C(this,"loop")}attachShadow(e){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}},xi=class extends nt{constructor(){super(...arguments),C(this,"tagName","DIALOG"),C(this,"nodeName","DIALOG")}get isModal(){return this.getAttribute("rr_open_mode")==="modal"}get open(){return this.getAttribute("open")!==null}close(){this.removeAttribute("open"),this.removeAttribute("rr_open_mode")}show(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","non-modal")}showModal(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","modal")}},Br=class extends he{constructor(e){super(),C(this,"nodeType",3),C(this,"nodeName","#text"),C(this,"RRNodeType",O.Text),C(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}},Wr=class extends he{constructor(e){super(),C(this,"nodeType",8),C(this,"nodeName","#comment"),C(this,"RRNodeType",O.Comment),C(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}},zr=class extends he{constructor(e){super(),C(this,"nodeName","#cdata-section"),C(this,"nodeType",4),C(this,"RRNodeType",O.CDATA),C(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}},Mi=class{constructor(e,t){if(C(this,"onChange"),C(this,"classes",[]),C(this,"add",(...r)=>{for(let i of r){let n=String(i);this.classes.indexOf(n)>=0||this.classes.push(n)}this.onChange&&this.onChange(this.classes.join(" "))}),C(this,"remove",(...r)=>{this.classes=this.classes.filter(i=>r.indexOf(i)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),e){let r=e.trim().split(/\s+/);this.classes.push(...r)}this.onChange=t}};ne=(s=>(s[s.PLACEHOLDER=0]="PLACEHOLDER",s[s.ELEMENT_NODE=1]="ELEMENT_NODE",s[s.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",s[s.TEXT_NODE=3]="TEXT_NODE",s[s.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",s[s.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",s[s.ENTITY_NODE=6]="ENTITY_NODE",s[s.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",s[s.COMMENT_NODE=8]="COMMENT_NODE",s[s.DOCUMENT_NODE=9]="DOCUMENT_NODE",s[s.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",s[s.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",s))(ne||{}),Ni={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Ap={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"},ye=null;ot=class s extends Ei{constructor(e){super(),C(this,"UNSERIALIZED_STARTING_ID",-2),C(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),C(this,"mirror",Up()),C(this,"scrollData",null),e&&(this.mirror=e)}get unserializedId(){return this._unserializedId--}createDocument(e,t,r){return new s}createDocumentType(e,t,r){let i=new kp(e,t,r);return i.ownerDocument=this,i}createElement(e){let t=e.toUpperCase(),r;switch(t){case"AUDIO":case"VIDEO":r=new Ri(t);break;case"IFRAME":r=new Di(t,this.mirror);break;case"CANVAS":r=new Oi(t);break;case"STYLE":r=new Ti(t);break;case"DIALOG":r=new Ai(t);break;default:r=new at(t);break}return r.ownerDocument=this,r}createComment(e){let t=new Pp(e);return t.ownerDocument=this,t}createCDATASection(e){let t=new Lp(e);return t.ownerDocument=this,t}createTextNode(e){let t=new _p(e);return t.ownerDocument=this,t}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}},kp=Ur,at=class extends nt{constructor(){super(...arguments),C(this,"inputData",null),C(this,"scrollData",null)}},Ri=class extends Ii{},Ai=class extends xi{},Oi=class extends at{constructor(){super(...arguments),C(this,"rr_dataURL",null),C(this,"canvasMutations",[])}getContext(){return null}},Ti=class extends at{constructor(){super(...arguments),C(this,"rules",[])}},Di=class extends at{constructor(e,t){super(e),C(this,"contentDocument",new ot),this.contentDocument.mirror=t}},_p=Br,Pp=Wr,Lp=zr;ki=class{constructor(){C(this,"idNodeMap",new Map),C(this,"nodeMetaMap",new WeakMap)}getId(e){var t;return e?((t=this.getMeta(e))==null?void 0:t.id)??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){let r=this.getNode(e);if(r){let i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};Go={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},jo={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},gr={},Bp=()=>!!globalThis.Zone;Bs={};Ws={};R={ownerDocument:Wp,childNodes:zp,parentNode:Vp,parentElement:Gp,textContent:jp,contains:Hp,getRootNode:Yp,host:Zp,styleSheets:Xp,shadowRoot:Jp,querySelector:Kp,querySelectorAll:qp,mutationObserver:zl,patch:Be};je=`Please stop import mirror directly. Instead of that,\r
53
+ now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
54
+ or you can use record.mirror to access the mirror instance during recording.`,jr={map:{},getId(){return console.error(je),-1},getNode(){return console.error(je),null},removeNodeFromMap(){console.error(je)},has(){return console.error(je),!1},reset(){console.error(je)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(jr=new Proxy(jr,{get(s,e,t){return e==="map"&&console.error(je),Reflect.get(s,e,t)}}));_t=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(_t=()=>new Date().getTime());Pt=class{constructor(){v(this,"id",1),v(this,"styleIDMap",new WeakMap),v(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 t===void 0?r=this.id++:r=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++}};Qp=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:Pt,get _mirror(){return jr},closestElementOfNode:In,getBaseDimension:An,getNestedRule:Xe,getPositionsAndIndex:_i,getRootShadowHost:Hl,getShadowHost:On,getWindowHeight:Cn,getWindowScroll:Sn,getWindowWidth:En,hasShadowRoot:Re,hookSetter:Bt,inDom:Tn,isAncestorRemoved:xn,isBlocked:ee,isIgnored:Ir,isSerialized:Vl,isSerializedIframe:qe,isSerializedStylesheet:Rn,iterateResolveTree:Nn,legacy_isTouchEvent:Hr,get nowTimestamp(){return _t},on:Q,polyfill:Mn,queueToResolveTrees:Gl,shadowHostInDom:Yl,throttle:lt,uniqueTextMutations:jl},Symbol.toStringTag,{value:"Module"})),I=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(I||{}),E=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(E||{}),k=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(k||{}),we=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(we||{}),Ce=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(Ce||{}),Ne=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(Ne||{}),D=(s=>(s.Start="start",s.Pause="pause",s.Resume="resume",s.Resize="resize",s.Finish="finish",s.FullsnapshotRebuilded="fullsnapshot-rebuilded",s.LoadStylesheetStart="load-stylesheet-start",s.LoadStylesheetEnd="load-stylesheet-end",s.SkipStart="skip-start",s.SkipEnd="skip-end",s.MouseInteraction="mouse-interaction",s.EventCast="event-cast",s.CustomEvent="custom-event",s.Flush="flush",s.StateChange="state-change",s.PlayBack="play-back",s.Destroy="destroy",s))(D||{}),ve=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(ve||{});Pi=class{constructor(){v(this,"length",0),v(this,"head",null),v(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=t?.next||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&Ho(e.previousSibling)){let 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&&Ho(e.nextSibling)&&e.nextSibling.__ln.previous){let 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;t.next===null&&(this.tail=t),this.length++}removeNode(e){let 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--)}},Yo=(s,e)=>`${s}@${e}`,Li=class{constructor(){v(this,"frozen",!1),v(this,"locked",!1),v(this,"texts",[]),v(this,"attributes",[]),v(this,"attributeMap",new WeakMap),v(this,"removes",[]),v(this,"mapRemoves",[]),v(this,"movedMap",{}),v(this,"addedSet",new Set),v(this,"movedSet",new Set),v(this,"droppedSet",new Set),v(this,"removesSubTreeCache",new Set),v(this,"mutationCb"),v(this,"blockClass"),v(this,"blockSelector"),v(this,"maskTextClass"),v(this,"maskTextSelector"),v(this,"inlineStylesheet"),v(this,"maskInputOptions"),v(this,"maskTextFn"),v(this,"maskInputFn"),v(this,"keepIframeSrcFn"),v(this,"recordCanvas"),v(this,"inlineImages"),v(this,"slimDOMOptions"),v(this,"dataURLOptions"),v(this,"doc"),v(this,"mirror"),v(this,"iframeManager"),v(this,"stylesheetManager"),v(this,"shadowDomManager"),v(this,"canvasManager"),v(this,"processedNodeManager"),v(this,"unattachedDoc"),v(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),v(this,"emit",()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,r=new Pi,i=l=>{let u=l,c=xt;for(;c===xt;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},n=l=>{let u=R.parentNode(l);if(!u||!Tn(l))return;let c=!1;if(l.nodeType===Node.TEXT_NODE){let p=u.tagName;if(p==="TEXTAREA")return;p==="STYLE"&&this.addedSet.has(u)&&(c=!0)}let h=bt(u)?this.mirror.getId(On(l)):this.mirror.getId(u),f=i(l);if(h===-1||f===-1)return r.addNode(l);let g=Ze(l,{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:p=>{qe(p,this.mirror)&&this.iframeManager.addIframe(p),Rn(p,this.mirror)&&this.stylesheetManager.trackLinkElement(p),Re(l)&&this.shadowDomManager.addShadowRoot(R.shadowRoot(l),this.doc)},onIframeLoad:(p,m)=>{this.iframeManager.attachIframe(p,m),this.shadowDomManager.observeAttachShadow(p)},onStylesheetLoad:(p,m)=>{this.stylesheetManager.attachLinkElement(p,m)},cssCaptured:c});g&&(e.push({parentId:h,nextId:f,node:g}),t.add(g.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)Zo(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(R.parentNode(l))||n(l);for(let l of this.addedSet)!Xo(this.droppedSet,l)&&!Zo(this.removesSubTreeCache,l,this.mirror)||Xo(this.movedSet,l)?n(l):this.droppedSet.add(l);let o=null;for(;r.length;){let l=null;if(o){let u=this.mirror.getId(R.parentNode(o.value)),c=i(o.value);u!==-1&&c!==-1&&(l=o)}if(!l){let u=r.tail;for(;u;){let c=u;if(u=u.previous,c){let h=this.mirror.getId(R.parentNode(c.value));if(i(c.value)===-1)continue;if(h!==-1){l=c;break}else{let g=c.value,p=R.parentNode(g);if(p&&p.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let m=R.host(p);if(this.mirror.getId(m)!==-1){l=c;break}}}}}}if(!l){for(;r.head;)r.removeNode(r.head.value);break}o=l.previous,r.removeNode(l.value),n(l.value)}let a={texts:this.texts.map(l=>{let u=l.node,c=R.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:l.value}}).filter(l=>!t.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{let{attributes:u}=l;if(typeof u.style=="string"){let c=JSON.stringify(l.styleDiff),h=JSON.stringify(l._unchangedStyles);c.length<u.style.length&&(c+h).split("var(").length===u.style.split("var(").length&&(u.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:u}}).filter(l=>!t.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:e};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.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(a))}),v(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));let r=Array.from(R.childNodes(e),i=>R.textContent(i)||"").join("");t.attributes.value=Nr({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:Rr(e),value:r,maskInputFn:this.maskInputFn})}),v(this,"processMutation",e=>{if(!Ir(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{let t=R.textContent(e.target);!ee(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:ga(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,In(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){let o=Rr(t);i=Nr({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(ee(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let n=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!ma(t.tagName,r))if(n.attributes[r]=pa(this.doc,Oe(t.tagName),Oe(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(let a of Array.from(t.style)){let l=t.style.getPropertyValue(a),u=t.style.getPropertyPriority(a);l!==o.style.getPropertyValue(a)||u!==o.style.getPropertyPriority(a)?u===""?n.styleDiff[a]=l:n.styleDiff[a]=[l,u]:n._unchangedStyles[a]=[l,u]}for(let a of Array.from(o.style))t.style.getPropertyValue(a)===""&&(n.styleDiff[a]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal");break}case"childList":{if(ee(e.target,this.blockClass,this.blockSelector,!0))return;if(e.target.tagName==="TEXTAREA"){this.genTextAreaValueMutation(e.target);return}e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{let r=this.mirror.getId(t),i=bt(e.target)?this.mirror.getId(R.host(e.target)):this.mirror.getId(e.target);ee(e.target,this.blockClass,this.blockSelector,!1)||Ir(t,this.mirror,this.slimDOMOptions)||!Vl(t,this.mirror)||(this.addedSet.has(t)?($i(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||xn(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Yo(r,i)]?$i(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:bt(e.target)&&St(e.target)?!0:void 0}),em(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),v(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Ir(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let r=null;t&&this.mirror.hasNode(t)&&(r=this.mirror.getId(t)),r&&r!==-1&&(this.movedMap[Yo(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ee(e,this.blockClass,this.blockSelector,!1)||(R.childNodes(e).forEach(r=>this.genAdds(r)),Re(e)&&R.childNodes(R.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,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()}};T=s=>Et?(...t)=>{try{return s(...t)}catch(r){if(Et&&Et(r)===!0)return;throw r}}:s,$e=[];am=["INPUT","TEXTAREA","SELECT"],Jo=new WeakMap;Zr=class{constructor(e){v(this,"iframeIdToRemoteIdMap",new WeakMap),v(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){let n=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e),a=n.get(t);return a||(a=this.generateIdFn(),n.set(t,a),o.set(a,t)),a}getIds(e,t){let r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(n=>this.getId(e,n,r,i))}getRemoteId(e,t,r){let i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;let n=i.get(t);return n||-1}getRemoteIds(e,t){let r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}},Fi=class{constructor(e){v(this,"iframes",new WeakMap),v(this,"crossOriginIframeMap",new WeakMap),v(this,"crossOriginIframeMirror",new Zr(da)),v(this,"crossOriginIframeStyleMirror"),v(this,"crossOriginIframeRootIdMap",new WeakMap),v(this,"mirror"),v(this,"mutationCb"),v(this,"wrappedEmit"),v(this,"loadListener"),v(this,"stylesheetManager"),v(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Zr(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,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.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){let t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;let i=this.crossOriginIframeMap.get(e.source);if(!i)return;let n=this.transformCrossOriginEvent(i,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case I.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:I.IncrementalSnapshot,data:{source:E.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case I.Meta:case I.Load:case I.DomContentLoaded:return!1;case I.Plugin:return t;case I.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case I.IncrementalSnapshot:switch(t.data.source){case E.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(i.node,n)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case E.Drag:case E.TouchMove:case E.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case E.ViewportResize:return!1;case E.MediaInteraction:case E.MouseInteraction:case E.Scroll:case E.CanvasMutation:case E.Input:return this.replaceIds(t.data,e,["id"]),t;case E.StyleSheetRule:case E.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case E.Font:return t;case E.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case E.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,r,i){for(let n of i)!Array.isArray(t[n])&&typeof t[n]!="number"||(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==ve.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}},Ui=class{constructor(e){v(this,"shadowDoms",new WeakSet),v(this,"mutationCb"),v(this,"scrollCb"),v(this,"bypassOptions"),v(this,"mirror"),v(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(!St(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let r=Xl({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Jl({...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(R.host(e))),this.restoreHandlers.push(Kl({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){let r=this;this.restoreHandlers.push(Be(e.prototype,"attachShadow",function(i){return function(n){let o=i.call(this,n),a=R.shadowRoot(this);return a&&Tn(this)&&r.addShadowRoot(a,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},Je="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",vt=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(wt=0;wt<Je.length;wt++)vt[Je.charCodeAt(wt)]=wt;ym=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=Je[e[t]>>2],i+=Je[(e[t]&3)<<4|e[t+1]>>4],i+=Je[(e[t+1]&15)<<2|e[t+2]>>6],i+=Je[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i},wm=function(s){var e=s.length*.75,t=s.length,r,i=0,n,o,a,l;s[s.length-1]==="="&&(e--,s[s.length-2]==="="&&e--);var u=new ArrayBuffer(e),c=new Uint8Array(u);for(r=0;r<t;r+=4)n=vt[s.charCodeAt(r)],o=vt[s.charCodeAt(r+1)],a=vt[s.charCodeAt(r+2)],l=vt[s.charCodeAt(r+3)],c[i++]=n<<2|o>>4,c[i++]=(o&15)<<4|a>>2,c[i++]=(a&3)<<6|l&63;return u},Ko=new Map;ql=(s,e,t)=>{if(!s||!(eu(s,e)||typeof s=="object"))return;let r=s.constructor.name,i=vm(t,r),n=i.indexOf(s);return n===-1&&(n=i.length,i.push(s)),n};Ql=(s,e,t)=>s.map(r=>xr(r,e,t)),eu=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>s instanceof e[i]);tu="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Em=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),ea=typeof window<"u"&&window.Blob&&new Blob([Em(tu)],{type:"text/javascript;charset=utf-8"});Bi=class{constructor(e){v(this,"pendingCanvasMutations",new Map),v(this,"rafStamps",{latestId:0,invokeId:null}),v(this,"mirror"),v(this,"mutationCb"),v(this,"resetObservers"),v(this,"frozen",!1),v(this,"locked",!1),v(this,"processMutation",(l,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(u)});let{sampling:t="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t==="all"&&this.initCanvasMutationObserver(r,i,n),o&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,i,n){let o=qo(t,r,i,!0),a=new Map,l=new Im;l.onmessage=p=>{let{id:m}=p.data;if(a.set(m,!1),!("base64"in p.data))return;let{base64:d,type:y,width:b,height:w}=p.data;this.mutationCb({id:m,type:Ce["2D"],commands:[{property:"clearRect",args:[0,0,b,w]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:d}],type:y}]},0,0]}]})};let u=1e3/e,c=0,h,f=()=>{let p=[];return t.document.querySelectorAll("canvas").forEach(m=>{ee(m,r,i,!0)||p.push(m)}),p},g=p=>{if(c&&p-c<u){h=requestAnimationFrame(g);return}c=p,f().forEach(async m=>{var d;let y=this.mirror.getId(m);if(a.get(y)||m.width===0||m.height===0)return;if(a.set(y,!0),["webgl","webgl2"].includes(m.__context)){let w=m.getContext(m.__context);((d=w?.getContextAttributes())==null?void 0:d.preserveDrawingBuffer)===!1&&w.clear(w.COLOR_BUFFER_BIT)}let b=await createImageBitmap(m);l.postMessage({id:y,bitmap:b,width:m.width,height:m.height,dataURLOptions:n.dataURLOptions},[b])}),h=requestAnimationFrame(g)};h=requestAnimationFrame(g),this.resetObservers=()=>{o(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let i=qo(e,t,r,!1),n=bm(this.processMutation.bind(this),e,t,r),o=Cm(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;let i=r.map(o=>{let{type:a,...l}=o;return l}),{type:n}=r[0];this.mutationCb({id:t,type:n,commands:i}),this.pendingCanvasMutations.delete(e)}},Wi=class{constructor(e){v(this,"trackedLinkElements",new WeakSet),v(this,"mutationCb"),v(this,"adoptedStyleSheetCb"),v(this,"styleMirror",new Pt),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(e.length===0)return;let r={id:t,styleIds:[]},i=[];for(let n of e){let o;this.styleMirror.has(n)?o=this.styleMirror.getId(n):(o=this.styleMirror.add(n),i.push({styleId:o,rules:Array.from(n.rules||CSSRule,(a,l)=>({rule:ha(a,n.href),index:l}))})),r.styleIds.push(o)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},zi=class{constructor(){v(this,"nodeMap",new WeakMap),v(this,"active",!1)}inOtherBuffer(e,t){let r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==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(){}},Xr=!1;try{if(Array.from([1],s=>s*2)[0]!==2){let s=document.createElement("iframe");document.body.appendChild(s),Array.from=((Qn=s.contentWindow)==null?void 0:Qn.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}ce=fa();Te.addCustomEvent=(s,e)=>{if(!Xr)throw new Error("please add custom event after start recording");J({type:I.Custom,data:{tag:s,payload:e}})};Te.freezePage=()=>{$e.forEach(s=>s.freeze())};Te.takeFullSnapshot=s=>{if(!Xr)throw new Error("please take full snapshot after start recording");Mr(s)};Te.mirror=ce;xm=Object.freeze(Object.defineProperty({__proto__:null,default:ru},Symbol.toStringTag,{value:"Module"}));Vi=class{constructor(e=[],t){v(this,"timeOffset",0),v(this,"speed"),v(this,"actions"),v(this,"raf",null),v(this,"lastTimestamp"),this.actions=e,this.speed=t.speed}addAction(e){let t=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{let r=this.findActionIndex(e);this.actions.splice(r,0,e)}t&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){let e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){let t=this.actions[0];if(this.timeOffset>=t.delay)this.actions.shift(),t.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return this.raf!==null}findActionIndex(e){let t=0,r=this.actions.length-1;for(;t<=r;){let i=Math.floor((t+r)/2);if(this.actions[i].delay<e.delay)t=i+1;else if(this.actions[i].delay>e.delay)r=i-1;else return i+1}return t}};(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(Ke||(Ke={}));su={type:"xstate.init"};oa=function(s,e){return s.actions.forEach(function(t){var r=t.exec;return r&&r(s.context,e)})};Om=s=>[`.${s} { background: currentColor }`,"noscript { display: none !important; }"],aa=new Map;Dm=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];ji=class{constructor(e){v(this,"mediaMap",new Map),v(this,"warn"),v(this,"service"),v(this,"speedService"),v(this,"emitter"),v(this,"getCurrentTime"),v(this,"metadataCallbackMap",new Map),this.warn=e.warn,this.service=e.service,this.speedService=e.speedService,this.emitter=e.emitter,this.getCurrentTime=e.getCurrentTime,this.emitter.on(D.Start,this.start.bind(this)),this.emitter.on(D.SkipStart,this.start.bind(this)),this.emitter.on(D.Pause,this.pause.bind(this)),this.emitter.on(D.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((t,r)=>{this.syncTargetWithState(r),e.pause&&r.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:t,mediaState:r}){if(r.isPlaying){let n=(e-r.lastInteractionTimeOffset)/1e3*r.playbackRate,o="duration"in t&&t.duration;if(Number.isNaN(o)){this.waitForMetadata(t);return}let a=r.currentTimeAtLastInteraction+n;t.loop&&o!==!1&&(a=a%o),t.currentTime=a}else t.pause(),t.currentTime=r.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!("addEventListener"in e))return;let t=()=>{this.metadataCallbackMap.delete(e);let r=this.mediaMap.get(e);r&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:r})};this.metadataCallbackMap.set(e,t),e.addEventListener("loadedmetadata",t,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:t,mutation:r}){let i=this.mediaMap.get(e),{type:n,playbackRate:o,currentTime:a,muted:l,volume:u,loop:c}=r;return{isPlaying:n===Ne.Play||n!==Ne.Pause&&(i?.isPlaying||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:a??i?.currentTimeAtLastInteraction??0,lastInteractionTimeOffset:t,playbackRate:o??i?.playbackRate??1,volume:u??i?.volume??1,muted:l??i?.muted??e.getAttribute("muted")===null,loop:c??i?.loop??e.getAttribute("loop")===null}}syncTargetWithState(e){let t=this.mediaMap.get(e);if(!t)return;let{muted:r,loop:i,volume:n,isPlaying:o}=t,a=this.service.state.matches("paused"),l=t.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:t}),e.volume!==n&&(e.volume=n),e.muted=r,e.loop=i,e.playbackRate!==l&&(e.playbackRate=l),o&&!a?e.play():e.pause()}catch(u){this.warn(`Failed to replay media interactions: ${u.message||u}`)}}addMediaElements(e,t,r){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;let i=e,n=r.getMeta(i);if(!n||!("attributes"in n))return;let o=this.service.state.matches("paused"),a=n.attributes,l=!1;a.rr_mediaState?l=a.rr_mediaState==="played":l=i.getAttribute("autoplay")!==null,l&&o&&i.pause();let u=1;typeof a.rr_mediaPlaybackRate=="number"&&(u=a.rr_mediaPlaybackRate);let c=!1;typeof a.rr_mediaMuted=="boolean"?c=a.rr_mediaMuted:c=i.getAttribute("muted")!==null;let h=!1;typeof a.rr_mediaLoop=="boolean"?h=a.rr_mediaLoop:h=i.getAttribute("loop")!==null;let f=1;typeof a.rr_mediaVolume=="number"&&(f=a.rr_mediaVolume);let g=0;typeof a.rr_mediaCurrentTime=="number"&&(g=a.rr_mediaCurrentTime),this.mediaMap.set(i,{isPlaying:l,currentTimeAtLastInteraction:g,lastInteractionTimeOffset:t,playbackRate:u,volume:f,muted:c,loop:h}),this.syncTargetWithState(i)}mediaMutation({target:e,timeOffset:t,mutation:r}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:t,mutation:r})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}};$m=5*1e3,Fm=ru||xm,la="[replayer]",Gs={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};Hi=class{constructor(e,t){if(v(this,"wrapper"),v(this,"iframe"),v(this,"service"),v(this,"speedService"),v(this,"config"),v(this,"usingVirtualDom",!1),v(this,"virtualDom",new ot),v(this,"mouse"),v(this,"mouseTail",null),v(this,"tailPositions",[]),v(this,"emitter",Fm()),v(this,"nextUserInteractionEvent"),v(this,"legacy_missingNodeRetryMap",{}),v(this,"cache",xo()),v(this,"imageMap",new Map),v(this,"canvasEventMap",new Map),v(this,"mirror",fa()),v(this,"styleMirror",new Pt),v(this,"mediaManager"),v(this,"firstFullSnapshot",null),v(this,"newDocumentQueue",[]),v(this,"mousePos",null),v(this,"touchActive",null),v(this,"lastMouseDownEvent",null),v(this,"lastHoveredRootNode"),v(this,"lastSelectionData",null),v(this,"constructedStyleMutations",[]),v(this,"adoptedStyleSheets",[]),v(this,"handleResize",a=>{this.iframe.style.display="inherit";for(let l of[this.mouseTail,this.iframe])l&&(l.setAttribute("width",String(a.width)),l.setAttribute("height",String(a.height)))}),v(this,"applyEventsSynchronously",a=>{for(let l of a){switch(l.type){case I.DomContentLoaded:case I.Load:case I.Custom:continue;case I.FullSnapshot:case I.Meta:case I.Plugin:case I.IncrementalSnapshot:break}this.getCastFn(l,!0)()}}),v(this,"getCastFn",(a,l=!1)=>{let u;switch(a.type){case I.DomContentLoaded:case I.Load:break;case I.Custom:u=()=>{this.emitter.emit(D.CustomEvent,a)};break;case I.Meta:u=()=>this.emitter.emit(D.Resize,{width:a.data.width,height:a.data.height});break;case I.FullSnapshot:u=()=>{var h;if(this.firstFullSnapshot){if(this.firstFullSnapshot===a){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(a,l),(h=this.iframe.contentWindow)==null||h.scrollTo(a.data.initialOffset)};break;case I.IncrementalSnapshot:u=()=>{if(this.applyIncremental(a,l),!l&&(a===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(let h of this.service.state.context.events)if(!(h.timestamp<=a.timestamp)&&this.isUserInteraction(h)){h.delay-a.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=h);break}if(this.nextUserInteractionEvent){let h=this.nextUserInteractionEvent.delay-a.delay,f={speed:Math.min(Math.round(h/$m),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:f}),this.emitter.emit(D.SkipStart,f)}}};break}return()=>{u&&u();for(let f of this.config.plugins||[])f.handler&&f.handler(a,l,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:a}});let h=this.service.state.context.events.length-1;if(!this.config.liveMode&&a===this.service.state.context.events[h]){let f=()=>{h<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(D.Finish))},g=50;a.type===I.IncrementalSnapshot&&a.data.source===E.MouseMove&&a.data.positions.length&&(g+=Math.max(0,-a.data.positions[0].timeOffset)),setTimeout(f,g)}this.emitter.emit(D.EventCast,a)}}),!t?.liveMode&&e.length<2)throw new Error("Replayer need at least 2 events.");let r={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:10*1e3,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:Gs,useVirtualDom:!0,logger:console};this.config=Object.assign({},r,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(D.Resize,this.handleResize),this.setupDom();for(let a of this.config.plugins||[])a.getMirror&&a.getMirror({nodeMirror:this.mirror});this.emitter.on(D.Flush,()=>{if(this.usingVirtualDom){let a={mirror:this.mirror,applyCanvas:(l,u,c)=>{Gi({event:l,mutation:u,target:c,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(l,u)=>{l.source===E.StyleSheetRule?this.applyStyleSheetRule(l,u):l.source===E.StyleDeclaration&&this.applyStyleDeclaration(l,u)},afterAppend:(l,u)=>{for(let c of this.config.plugins||[])c.onBuild&&c.onBuild(l,{id:u,replayer:this})}};if(this.iframe.contentDocument)try{Vr(this.iframe.contentDocument,this.virtualDom,a,this.virtualDom.mirror)}catch(l){console.warn(l)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(let l in this.legacy_missingNodeRetryMap)try{let u=this.legacy_missingNodeRetryMap[l],c=Gr(u.node,this.mirror,this.virtualDom.mirror);Vr(c,u.node,a,this.virtualDom.mirror),u.node=c}catch(u){this.warn(u)}this.constructedStyleMutations.forEach(l=>{this.applyStyleSheetMutation(l)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(l=>{this.applyAdoptedStyleSheet(l)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){let[a,l]=this.lastMouseDownEvent;a.dispatchEvent(l)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(D.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});let i=new Vi([],{speed:this.config.speed});this.service=Rm({events:e.map(a=>t&&t.unpackFn?t.unpackFn(a):a).sort((a,l)=>a.timestamp-l.timestamp),timer:i,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(a=>{this.emitter.emit(D.StateChange,{player:a})}),this.speedService=Am({normalSpeed:-1,timer:i}),this.speedService.start(),this.speedService.subscribe(a=>{this.emitter.emit(D.StateChange,{speed:a})}),this.mediaManager=new ji({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});let n=this.service.state.context.events.find(a=>a.type===I.Meta),o=this.service.state.context.events.find(a=>a.type===I.FullSnapshot);if(n){let{width:a,height:l}=n.data;setTimeout(()=>{this.emitter.emit(D.Resize,{width:a,height:l})},0)}o&&setTimeout(()=>{var a;this.firstFullSnapshot||(this.firstFullSnapshot=o,this.rebuildFullSnapshot(o),(a=this.iframe.contentWindow)==null||a.scrollTo(o.data.initialOffset))},1),this.service.state.context.events.find(ua)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,t){return this.emitter.on(e,t),this}off(e,t){return this.emitter.off(e,t),this}setConfig(e){Object.keys(e).forEach(t=>{e[t],this.config[t]=e[t]}),this.config.skipInactive||this.backToNormal(),typeof e.speed<"u"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail<"u"&&(e.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){let e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){let{baselineTime:e,events:t}=this.service.state.context;return e-t[0].timestamp}getMirror(){return this.mirror}play(e=0){var t,r;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(r=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||r.classList.remove("rrweb-paused"),this.emitter.emit(D.Start)}pause(e){var t,r;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(r=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||r.classList.add("rrweb-paused"),this.emitter.emit(D.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(D.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(D.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){let t=this.config.unpackFn?this.config.unpackFn(e):e;ua(t)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:t}}))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=xo()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");let e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(Mm(this.iframe.contentWindow,this.iframe.contentDocument),Mn(this.iframe.contentWindow))}rebuildFullSnapshot(e,t=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};let r=[],i=new Set,n=(l,u)=>{if(l.nodeName==="DIALOG"&&i.add(l),this.collectIframeAndAttachDocument(r,l),this.mediaManager.isSupportedMediaElement(l)){let{events:c}=this.service.state.context;this.mediaManager.addMediaElements(l,e.timestamp-c[0].timestamp,this.mirror)}for(let c of this.config.plugins||[])c.onBuild&&c.onBuild(l,{id:u,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),Rf(e.data.node,{doc:this.iframe.contentDocument,afterAppend:n,cache:this.cache,mirror:this.mirror}),n(this.iframe.contentDocument,e.data.node.id);for(let{mutationInQueue:l,builtNode:u}of r)this.attachDocumentToIframe(l,u),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==l);let{documentElement:o,head:a}=this.iframe.contentDocument;this.insertStyleRules(o,a),i.forEach(l=>vr(l)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(D.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var r;let i=Om(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&i.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!i.length)if(this.usingVirtualDom){let n=this.virtualDom.createElement("style");this.virtualDom.mirror.add(n,Bl(n,this.virtualDom.unserializedId)),e.insertBefore(n,t),n.rules.push({source:E.StyleSheetRule,adds:i.map((o,a)=>({rule:o,index:a}))})}else{let n=document.createElement("style");e.insertBefore(n,t);for(let o=0;o<i.length;o++)(r=n.sheet)==null||r.insertRule(i[o],o)}}attachDocumentToIframe(e,t){let r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,i=[],n=new Set,o=(a,l)=>{a.nodeName==="DIALOG"&&n.add(a),this.collectIframeAndAttachDocument(i,a);let u=r.getMeta(a);if(u?.type===ve.Element&&u?.tagName.toUpperCase()==="HTML"){let{documentElement:c,head:h}=t.contentDocument;this.insertStyleRules(c,h)}if(!this.usingVirtualDom)for(let c of this.config.plugins||[])c.onBuild&&c.onBuild(a,{id:l,replayer:this})};Ct(e.node,{doc:t.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(t.contentDocument,e.node.id);for(let{mutationInQueue:a,builtNode:l}of i)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(u=>u!==a);n.forEach(a=>vr(a))}collectIframeAndAttachDocument(e,t){if(qe(t,this.mirror)){let r=this.newDocumentQueue.find(i=>i.parentId===this.mirror.getId(t));r&&e.push({mutationInQueue:r,builtNode:t})}}waitForStylesheetLoad(){var e;let t=(e=this.iframe.contentDocument)==null?void 0:e.head;if(t){let r=new Set,i,n=this.service.state,o=()=>{n=this.service.state};this.emitter.on(D.Start,o),this.emitter.on(D.Pause,o);let a=()=>{this.emitter.off(D.Start,o),this.emitter.off(D.Pause,o)};t.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(r.add(l),l.addEventListener("load",()=>{r.delete(l),r.size===0&&i!==-1&&(n.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(D.LoadStylesheetEnd),i&&clearTimeout(i),a())}))}),r.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(D.LoadStylesheetStart),i=setTimeout(()=>{n.matches("playing")&&this.play(this.getCurrentTime()),i=-1,a()},this.config.loadTimeout))}}async preloadAllImages(){let e=[];for(let t of this.service.state.context.events)t.type===I.IncrementalSnapshot&&t.data.source===E.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(t.data,t)),("commands"in t.data?t.data.commands:[t.data]).forEach(i=>{this.preloadImages(i,t)}));return Promise.all(e)}preloadImages(e,t){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(t)){let r=document.createElement("canvas"),i=r.getContext("2d"),n=i?.createImageData(r.width,r.height);i?.putImageData(n,0,0)}}async deserializeAndPreloadCanvasEvents(e,t){if(!this.canvasEventMap.has(t)){let r={isUnchanged:!0};if("commands"in e){let i=await Promise.all(e.commands.map(async n=>{let o=await Promise.all(n.args.map(Ae(this.imageMap,null,r)));return{...n,args:o}}));r.isUnchanged===!1&&this.canvasEventMap.set(t,{...e,commands:i})}else{let i=await Promise.all(e.args.map(Ae(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(t,{...e,args:i})}}}applyIncremental(e,t){var r,i,n;let{data:o}=e;switch(o.source){case E.Mutation:{try{this.applyMutation(o,t)}catch(a){this.warn(`Exception in mutation ${a.message||a}`,o)}break}case E.Drag:case E.TouchMove:case E.MouseMove:if(t){let a=o.positions[o.positions.length-1];this.mousePos={x:a.x,y:a.y,id:a.id,debugData:o}}else o.positions.forEach(a=>{let l={doAction:()=>{this.moveAndHover(a.x,a.y,a.id,t,o)},delay:a.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(l)}),this.timer.addAction({doAction(){},delay:e.delay-((r=o.positions[0])==null?void 0:r.timeOffset)});break;case E.MouseInteraction:{if(o.id===-1)break;let a=new Event(Oe(k[o.type])),l=this.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);this.emitter.emit(D.MouseInteraction,{type:o.type,target:l});let{triggerFocus:u}=this.config;switch(o.type){case k.Blur:"blur"in l&&l.blur();break;case k.Focus:u&&l.focus&&l.focus({preventScroll:!0});break;case k.Click:case k.TouchStart:case k.TouchEnd:case k.MouseDown:case k.MouseUp:t?(o.type===k.TouchStart?this.touchActive=!0:o.type===k.TouchEnd&&(this.touchActive=!1),o.type===k.MouseDown?this.lastMouseDownEvent=[l,a]:o.type===k.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:o.x||0,y:o.y||0,id:o.id,debugData:o}):(o.type===k.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(o.x||0,o.y||0,o.id,t,o),o.type===k.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):o.type===k.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):o.type===k.TouchEnd?this.mouse.classList.remove("touch-active"):l.dispatchEvent(a));break;case k.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:l.dispatchEvent(a)}break}case E.Scroll:{if(o.id===-1)break;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);a.scrollData=o;break}this.applyScroll(o,t);break}case E.ViewportResize:this.emitter.emit(D.Resize,{width:o.width,height:o.height});break;case E.Input:{if(o.id===-1)break;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);a.inputData=o;break}this.applyInput(o);break}case E.MediaInteraction:{let a=this.usingVirtualDom?this.virtualDom.mirror.getNode(o.id):this.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);let l=a,{events:u}=this.service.state.context;this.mediaManager.mediaMutation({target:l,timeOffset:e.timestamp-u[0].timestamp,mutation:o});break}case E.StyleSheetRule:case E.StyleDeclaration:{this.usingVirtualDom?o.styleId?this.constructedStyleMutations.push(o):o.id&&((i=this.virtualDom.mirror.getNode(o.id))==null||i.rules.push(o)):this.applyStyleSheetMutation(o);break}case E.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);a.canvasMutations.push({event:e,mutation:o})}else{let a=this.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);Gi({event:e,mutation:o,target:a,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case E.Font:{try{let a=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.descriptors);(n=this.iframe.contentDocument)==null||n.fonts.add(a)}catch(a){this.warn(a)}break}case E.Selection:{if(t){this.lastSelectionData=o;break}this.applySelection(o);break}case E.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(o):this.applyAdoptedStyleSheet(o);break}}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,Fp(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(let u in this.legacy_missingNodeRetryMap)try{let c=this.legacy_missingNodeRetryMap[u],h=Ul(c.node,this.virtualDom,this.mirror);h&&(c.node=h)}catch(c){this.warn(c)}let r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(u=>r.getNode(u.id)?!0:(this.warnNodeNotFound(e,u.id),!1)),e.removes.forEach(u=>{var c;let h=r.getNode(u.id);if(!h)return;let f=r.getNode(u.parentId);if(!f)return this.warnNodeNotFound(e,u.parentId);if(u.isShadow&&Re(f)&&(f=f.shadowRoot),r.removeNodeFromMap(h),f)try{f.removeChild(h),this.usingVirtualDom&&h.nodeName==="#text"&&f.nodeName==="STYLE"&&((c=f.rules)==null?void 0:c.length)>0&&(f.rules=[])}catch(g){if(g instanceof DOMException)this.warn("parent could not remove child in mutation",f,h,e);else throw g}});let i={...this.legacy_missingNodeRetryMap},n=[],o=u=>{let c=null;return u.nextId&&(c=r.getNode(u.nextId)),u.nextId!==null&&u.nextId!==void 0&&u.nextId!==-1&&!c},a=u=>{var c,h;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let f=r.getNode(u.parentId);if(!f)return u.node.type===ve.Document?this.newDocumentQueue.push(u):n.push(u);u.node.isShadow&&(Re(f)||f.attachShadow({mode:"open"}),f=f.shadowRoot);let g=null,p=null;if(u.previousId&&(g=r.getNode(u.previousId)),u.nextId&&(p=r.getNode(u.nextId)),o(u))return n.push(u);if(u.node.rootId&&!r.getNode(u.node.rootId))return;let m=u.node.rootId?r.getNode(u.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(qe(f,r)){this.attachDocumentToIframe(u,f);return}let d=(w,S)=>{if(!this.usingVirtualDom){vr(w);for(let x of this.config.plugins||[])x.onBuild&&x.onBuild(w,{id:S,replayer:this})}},y=Ct(u.node,{doc:m,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:d});if(u.previousId===-1||u.nextId===-1){i[u.node.id]={node:y,mutation:u};return}let b=r.getMeta(f);if(b&&b.type===ve.Element&&u.node.type===ve.Text){let w=Array.isArray(f.childNodes)?f.childNodes:Array.from(f.childNodes);if(b.tagName==="textarea")for(let S of w)S.nodeType===f.TEXT_NODE&&f.removeChild(S);else if(b.tagName==="style"&&w.length===1)for(let S of w)S.nodeType===f.TEXT_NODE&&!r.hasNode(S)&&(y.textContent=S.textContent,f.removeChild(S))}else if(b?.type===ve.Document){let w=f;u.node.type===ve.DocumentType&&((c=w.childNodes[0])==null?void 0:c.nodeType)===Node.DOCUMENT_TYPE_NODE&&w.removeChild(w.childNodes[0]),y.nodeName==="HTML"&&w.documentElement&&w.removeChild(w.documentElement)}if(g&&g.nextSibling&&g.nextSibling.parentNode?f.insertBefore(y,g.nextSibling):p&&p.parentNode?f.contains(p)?f.insertBefore(y,p):f.insertBefore(y,null):f.appendChild(y),d(y,u.node.id),this.usingVirtualDom&&y.nodeName==="#text"&&f.nodeName==="STYLE"&&((h=f.rules)==null?void 0:h.length)>0&&(f.rules=[]),qe(y,this.mirror)){let w=this.mirror.getId(y),S=this.newDocumentQueue.find(x=>x.parentId===w);S&&(this.attachDocumentToIframe(S,y),this.newDocumentQueue=this.newDocumentQueue.filter(x=>x!==S))}(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(i,f,y,u)};e.adds.forEach(u=>{a(u)});let l=Date.now();for(;n.length;){let u=Gl(n);if(n.length=0,Date.now()-l>500){this.warn("Timeout in the loop, please check the resolve tree data:",u);break}for(let c of u)r.getNode(c.value.parentId)?Nn(c,f=>{a(f)}):this.debug("Drop resolve tree since there is no parent for the root node.",c)}Object.keys(i).length&&Object.assign(this.legacy_missingNodeRetryMap,i),jl(e.texts).forEach(u=>{var c;let h=r.getNode(u.id);if(!h)return e.removes.find(g=>g.id===u.id)?void 0:this.warnNodeNotFound(e,u.id);let f=h.parentElement;if(u.value&&f&&f.tagName==="STYLE"?h.textContent=rs(u.value,this.cache):h.textContent=u.value,this.usingVirtualDom){let g=h.parentNode;((c=g?.rules)==null?void 0:c.length)>0&&(g.rules=[])}}),e.attributes.forEach(u=>{var c;let h=r.getNode(u.id);if(!h)return e.removes.find(f=>f.id===u.id)?void 0:this.warnNodeNotFound(e,u.id);for(let f in u.attributes)if(typeof f=="string"){let g=u.attributes[f];if(g===null)h.removeAttribute(f),f==="open"&&Lm(h,u);else if(typeof g=="string")try{if(f==="_cssText"&&(h.nodeName==="LINK"||h.nodeName==="STYLE"))try{let p=r.getMeta(h),m=Ct({...p,attributes:{...p.attributes,...u.attributes}},{doc:h.ownerDocument,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(p.attributes,u.attributes);let d=h.nextSibling,y=h.parentNode;if(m&&y){y.removeChild(h),y.insertBefore(m,d),r.replace(u.id,m);break}}catch{}if(f==="value"&&h.nodeName==="TEXTAREA"){let p=h;p.childNodes.forEach(d=>p.removeChild(d));let m=(c=h.ownerDocument)==null?void 0:c.createTextNode(g);m&&p.appendChild(m)}else h.setAttribute(f,g);f==="rr_open_mode"&&h.nodeName==="DIALOG"&&vr(h,u)}catch(p){this.warn("An error occurred may due to the checkout feature.",p)}else if(f==="style"){let p=g,m=h;for(let d in p)if(p[d]===!1)m.style.removeProperty(d);else if(p[d]instanceof Array){let y=p[d];m.style.setProperty(d,y[0],y[1])}else{let y=p[d];m.style.setProperty(d,y)}}}})}applyScroll(e,t){var r,i;let n=this.mirror.getNode(e.id);if(!n)return this.debugNodeNotFound(e,e.id);let o=this.mirror.getMeta(n);if(n===this.iframe.contentDocument)(r=this.iframe.contentWindow)==null||r.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if(o?.type===ve.Document)(i=n.defaultView)==null||i.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{n.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"})}catch{}}applyInput(e){let t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch{}}applySelection(e){try{let t=new Set,r=e.ranges.map(({start:i,startOffset:n,end:o,endOffset:a})=>{let l=this.mirror.getNode(i),u=this.mirror.getNode(o);if(!l||!u)return;let c=new Range;c.setStart(l,n),c.setEnd(u,a);let h=l.ownerDocument,f=h?.getSelection();return f&&t.add(f),{range:c,selection:f}});t.forEach(i=>i.removeAllRanges()),r.forEach(i=>{var n;return i&&((n=i.selection)==null?void 0:n.addRange(i.range))})}catch{}}applyStyleSheetMutation(e){var t;let r=null;e.styleId?r=this.styleMirror.getStyle(e.styleId):e.id&&(r=((t=this.mirror.getNode(e.id))==null?void 0:t.sheet)||null),r&&(e.source===E.StyleSheetRule?this.applyStyleSheetRule(e,r):e.source===E.StyleDeclaration&&this.applyStyleDeclaration(e,r))}applyStyleSheetRule(e,t){var r,i,n,o;if((r=e.adds)==null||r.forEach(({rule:a,index:l})=>{try{if(Array.isArray(l)){let{positions:u,index:c}=_i(l);Xe(t.cssRules,u).insertRule(a,c)}else{let u=l===void 0?void 0:Math.min(l,t.cssRules.length);t?.insertRule(a,u)}}catch{}}),(i=e.removes)==null||i.forEach(({index:a})=>{try{if(Array.isArray(a)){let{positions:l,index:u}=_i(a);Xe(t.cssRules,l).deleteRule(u||0)}else t?.deleteRule(a)}catch{}}),e.replace)try{(n=t.replace)==null||n.call(t,e.replace)}catch{}if(e.replaceSync)try{(o=t.replaceSync)==null||o.call(t,e.replaceSync)}catch{}}applyStyleDeclaration(e,t){e.set&&Xe(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&Xe(t.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var t;let r=this.mirror.getNode(e.id);if(!r)return;(t=e.styles)==null||t.forEach(a=>{var l;let u=null,c=null;if(Re(r)?c=((l=r.ownerDocument)==null?void 0:l.defaultView)||null:r.nodeName==="#document"&&(c=r.defaultView),!!c)try{u=new c.CSSStyleSheet,this.styleMirror.add(u,a.styleId),this.applyStyleSheetRule({source:E.StyleSheetRule,adds:a.rules},u)}catch{}});let i=10,n=0,o=(a,l)=>{let u=l.map(c=>this.styleMirror.getStyle(c)).filter(c=>c!==null);Re(a)?a.shadowRoot.adoptedStyleSheets=u:a.nodeName==="#document"&&(a.adoptedStyleSheets=u),u.length!==l.length&&n<i&&(setTimeout(()=>o(a,l),0+100*n),n++)};o(r,e.styleIds)}legacy_resolveMissingNode(e,t,r,i){let{previousId:n,nextId:o}=i,a=n&&e[n],l=o&&e[o];if(a){let{node:u,mutation:c}=a;t.insertBefore(u,r),delete e[c.node.id],delete this.legacy_missingNodeRetryMap[c.node.id],(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(e,t,u,c)}if(l){let{node:u,mutation:c}=l;t.insertBefore(u,r.nextSibling),delete e[c.node.id],delete this.legacy_missingNodeRetryMap[c.node.id],(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(e,t,u,c)}}moveAndHover(e,t,r,i,n){let o=this.mirror.getNode(r);if(!o)return this.debugNodeNotFound(n,r);let a=An(o,this.iframe),l=e*a.absoluteScale+a.x,u=t*a.absoluteScale+a.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${u}px`,i||this.drawMouseTail({x:l,y:u}),this.hoverElements(o)}drawMouseTail(e){if(!this.mouseTail)return;let{lineCap:t,lineWidth:r,strokeStyle:i,duration:n}=this.config.mouseTail===!0?Gs:Object.assign({},Gs,this.config.mouseTail),o=()=>{if(!this.mouseTail)return;let a=this.mouseTail.getContext("2d");!a||!this.tailPositions.length||(a.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),a.beginPath(),a.lineWidth=r,a.lineCap=t,a.strokeStyle=i,a.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>a.lineTo(l.x,l.y)),a.stroke())};this.tailPositions.push(e),o(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(a=>a!==e),o()},n/this.speedService.state.context.timer.speed)}hoverElements(e){var t;(t=this.lastHoveredRootNode||this.iframe.contentDocument)==null||t.querySelectorAll(".\\:hover").forEach(i=>{i.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let r=e;for(;r;)r.classList&&r.classList.add(":hover"),r=r.parentElement}isUserInteraction(e){return e.type!==I.IncrementalSnapshot?!1:e.data.source>E.Mutation&&e.data.source<=E.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(D.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,t){this.warn(`Node with id '${t}' not found. `,e)}warnCanvasMutationFailed(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)}debugNodeNotFound(e,t){this.debug(`Node with id '${t}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn(la,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(la,...e)}},{addCustomEvent:Um}=Te,{freezePage:Bm}=Te,{takeFullSnapshot:Wm}=Te});var tg={};ys(tg,{VybeSecSDK:()=>hs,captureError:()=>Qm,captureEvent:()=>eg,init:()=>qm,vybesec:()=>fs});var Du={LCP:[2500,4e3],TTFB:[800,1800],FCP:[1800,3e3],INP:[200,500],CLS:[.1,.25]};function ku(s){let[e,t]=Du[s.name]??[0,0];return s.value<=e?"good":s.value<=t?"needs_improvement":"poor"}async function qn(s){let{onLCP:e,onTTFB:t,onFCP:r,onINP:i,onCLS:n}=await Promise.resolve().then(()=>(Kn(),Jn)),o=a=>{s({metricName:a.name,value:a.value,rating:ku(a)})};e(o),t(o),r(o),i(o),n(o)}var ls=class{events=[];stopFn;flushed=!1;async start(){if(this.stopFn)return;let{record:e}=await Promise.resolve().then(()=>(uu(),lu));this.stopFn=e({emit:t=>{let r=Date.now();this.events.push(t);let i=r-60*1e3;for(;this.events.length>0&&this.events[0].timestamp<i;)this.events.shift();this.events.length>2e3&&(this.events=this.events.slice(-2e3))},maskAllInputs:!0,maskInputOptions:{password:!0,email:!0,tel:!0,text:!0,number:!1,search:!1},blockClass:"vybesec-block",maskTextClass:"vybesec-mask",ignoreClass:"vybesec-ignore",recordCrossOriginIframes:!1,sampling:{mousemove:100,scroll:150,input:"last"}})}async flushOnError(e,t){if(this.flushed||this.events.length<10)return;this.flushed=!0;let r=zm(this.events.map(o=>JSON.stringify(o)).join(`
55
+ `)),i=new Blob([r],{type:"application/x-ndjson"}),n=new URL(`${e.replayUrl}/v1/replay/${e.publicKey}/${e.sessionId}`);if(t&&n.searchParams.set("fingerprint",t),typeof window<"u"&&n.searchParams.set("urlPath",window.location.pathname),navigator.sendBeacon){navigator.sendBeacon(n.toString(),i);return}await fetch(n.toString(),{method:"POST",headers:{"Content-Type":"application/x-ndjson"},body:i})}stop(){this.stopFn?.(),this.stopFn=void 0}};function zm(s){return s.replace(/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,"[email]").replace(/\b\d{4}[\s-]?\d{4}[\s-]?\d{4}[\s-]?\d{4}\b/g,"[card]").replace(/sk-[a-zA-Z0-9]{20,}/g,"[api-key]").replace(/Bearer\\s[a-zA-Z0-9\\-_.]{20,}/g,"Bearer [token]").replace(/\b\d{3}-\d{2}-\d{4}\b/g,"[ssn]")}var Dn="https://vybesec-ingest.hexeldigitalstudio.workers.dev",cu="vybesec_session_id";function us(){try{let s=window.localStorage.getItem(cu);if(s)return s;let e=crypto.randomUUID();return window.localStorage.setItem(cu,e),e}catch{return crypto.randomUUID()}}function Vm(s){if(s instanceof Error)return s.message||"Unknown error";if(typeof s=="string")return s;try{return JSON.stringify(s)}catch{return"Unknown error"}}function Gm(s){return s instanceof Error&&s.name?s.name:"Error"}function jm(s){if(s instanceof Error)return s.stack}function Hm(s){return s.replace(/0x[0-9a-f]+/gi,"0xADDR").replace(/\d+:\d+/g,"L:C").replace(/\"[^\"]{0,50}\"/g,'"VAL"')}function Ym(s){if(!s)return[];let e=s.split(`
56
+ `),t=[];for(let r of e){let i=r.match(/at\\s+(.*?)(?:\\s+\\(|\\s)(.+?):\\d+:\\d+\\)?/);i&&t.push({fn:i[1]||"anonymous",file:i[2]||"unknown"})}return t}async function Zm(s){let e=new TextEncoder().encode(s),t=await crypto.subtle.digest("SHA-256",e);return Array.from(new Uint8Array(t)).map(r=>r.toString(16).padStart(2,"0")).join("")}async function Xm(s){let e=Hm(s.message??""),t=Ym(s.stackTrace).slice(0,3).map(o=>`${o.file}:${o.fn}`).join("|"),i=`${s.errorType??"Error"}:${e}:${t}`;return(await Zm(i)).slice(0,16)}function kn(s){if(!s)return s;let e=[/sk-[a-zA-Z0-9]{20,}/g,/pk_[a-zA-Z0-9]{20,}/g,/Bearer\s+[a-zA-Z0-9\-_.]{20,}/g,/password["']?\s*[:=]\s*["'][^"']+/gi],t=s;for(let r of e)t=t.replace(r,"[REDACTED]");return t}var Jm=/(password|token|secret|api[_-]?key|authorization)/i,Km=3;function cs(s,e=0){if(e>=Km)return s;if(typeof s=="string")return kn(s)??s;if(Array.isArray(s))return s.map(t=>cs(t,e+1));if(s&&typeof s=="object"){let t=s,r={};for(let[i,n]of Object.entries(t)){if(Jm.test(i)){r[i]="[REDACTED]";continue}r[i]=cs(n,e+1)}return r}return s}function hu(s){return{...s,message:kn(s.message)??s.message,stackTrace:kn(s.stackTrace),tags:s.tags?cs(s.tags):s.tags,extra:s.extra?cs(s.extra):s.extra}}var hs=class{config=null;buffer=[];eventTimestamps=[];flushTimer;retryTimer;retryAttempt=0;isFlushing=!1;replayCapture;replayEnabled=!1;replayStarted=!1;sessionId;init(e){this.config={...e,sampleRate:e.sampleRate??1,maxBuffer:e.maxBuffer??100,maxEventsPerMinute:e.maxEventsPerMinute??120,ingestUrl:e.ingestUrl??Dn,replayUrl:e.replayUrl??e.ingestUrl??Dn,enableVitals:e.enableVitals??!0,enableReplay:e.enableReplay??!0},!(typeof window>"u")&&(this.sessionId=us(),this.replayEnabled=!1,this.replayStarted=!1,this.config.enableReplay&&(this.replayCapture=new ls),window.addEventListener("error",t=>{this.captureError(t.error??t.message,{url:t.filename})}),window.addEventListener("unhandledrejection",t=>{this.captureError(t.reason)}),this.patchFetch(),this.patchXHR(),this.trackNavigation(),window.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&this.flushBeacon()}),this.config.enableVitals&&qn(t=>{this.captureEvent({type:"performance",message:t.metricName,timestamp:Date.now(),sessionId:this.sessionId,extra:{metricName:t.metricName,value:t.value,rating:t.rating}})}),this.flushTimer&&window.clearInterval(this.flushTimer),this.retryTimer&&(window.clearTimeout(this.retryTimer),this.retryTimer=void 0),this.retryAttempt=0,this.flushTimer=window.setInterval(()=>this.flush(),5e3))}captureError(e,t){if(!this.config||!this.shouldAcceptEvent())return;let r=hu({type:"error",message:Vm(e),stackTrace:jm(e),errorType:Gm(e),url:typeof window<"u"?window.location.href:void 0,sessionId:typeof window<"u"?this.sessionId??us():void 0,userId:this.config.userId,timestamp:Date.now(),tags:{...t??{},platform:this.config.platform??"other",environment:this.config.environment??"production",release:this.config.release??""}});this.pushEvent(r),this.flushReplayOnError(r)}captureEvent(e){if(!this.config||!this.shouldAcceptEvent())return;let t=hu({...e,sessionId:e.sessionId??(typeof window<"u"?this.sessionId??us():void 0),userId:e.userId??this.config.userId,timestamp:e.timestamp??Date.now(),tags:{...e.tags??{},platform:this.config.platform??"other",environment:this.config.environment??"production",release:this.config.release??""}});this.pushEvent(t)}pushEvent(e){if(!this.config)return;let t=this.config.maxBuffer??100;if(!(t<=0)){for(;this.buffer.length>=t;)this.buffer.shift();this.buffer.push(e),this.buffer.length>=10&&this.flush()}}async startReplay(){!this.replayCapture||this.replayStarted||(await this.replayCapture.start(),this.replayStarted=!0)}async flushReplayOnError(e){if(!this.config||!this.replayCapture||!this.replayEnabled)return;let t=await Xm(e);await this.replayCapture.flushOnError({publicKey:this.config.key,sessionId:this.sessionId??us(),replayUrl:this.config.replayUrl??this.config.ingestUrl??Dn},t)}async flush(){if(!this.config||this.isFlushing||!this.buffer.length)return;this.isFlushing=!0;let e=this.buffer.splice(0);try{let t=await fetch(`${this.config.ingestUrl}/v1/events/${this.config.key}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),keepalive:!0});if(t.ok){let r=await t.json().catch(()=>null);r&&typeof r.replayEnabled=="boolean"&&(this.replayEnabled=r.replayEnabled,this.replayEnabled&&await this.startReplay())}this.retryAttempt=0,this.retryTimer&&(window.clearTimeout(this.retryTimer),this.retryTimer=void 0)}catch{this.buffer.unshift(...e),this.scheduleRetry()}finally{this.isFlushing=!1}}flushBeacon(){if(!this.config||!this.buffer.length)return;let e=this.buffer.splice(0),t=new Blob([JSON.stringify(e)],{type:"application/json"});if(navigator.sendBeacon){navigator.sendBeacon(`${this.config.ingestUrl}/v1/events/${this.config.key}`,t);return}fetch(`${this.config.ingestUrl}/v1/events/${this.config.key}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),keepalive:!0})}scheduleRetry(){if(typeof window>"u")return;let e=Math.min(3e4,1e3*2**this.retryAttempt);this.retryAttempt=Math.min(this.retryAttempt+1,5),this.retryTimer&&window.clearTimeout(this.retryTimer),this.retryTimer=window.setTimeout(()=>this.flush(),e)}shouldAcceptEvent(){return!(!this.config||Math.random()>(this.config.sampleRate??1)||!this.consumeRateLimit())}consumeRateLimit(){if(!this.config)return!1;let e=this.config.maxEventsPerMinute??120;if(e<=0)return!1;let t=Date.now(),r=t-6e4;return this.eventTimestamps=this.eventTimestamps.filter(i=>i>r),this.eventTimestamps.length>=e?!1:(this.eventTimestamps.push(t),!0)}patchFetch(){if(typeof window>"u"||!("fetch"in window))return;let e=window.fetch.bind(window);window.fetch=async(...t)=>{let r=Date.now(),i=await e(...t),n=Date.now()-r;try{let o=t[0],a=(o instanceof Request?o.method:t[1]?.method)??"GET",l=o instanceof Request?o.url:String(o);i.ok||this.captureEvent({type:"error",message:`Request failed with ${i.status}`,errorType:"HttpError",requestUrl:l,requestMethod:a,responseStatus:i.status,responseTimeMs:n,url:typeof window<"u"?window.location.href:void 0,timestamp:Date.now()})}catch{}return i}}patchXHR(){if(typeof window>"u"||!("XMLHttpRequest"in window))return;let e=this,t=XMLHttpRequest.prototype;if(t.__vsPatched)return;t.__vsPatched=!0;let r=t.open,i=t.send;t.open=function(n,o,a,l,u){let c=this;return c.__vsMeta={method:n,url:String(o)},r.call(c,n,o,a??!0,l??null,u??null)},t.send=function(n){let o=this,a=o.__vsMeta,l=Date.now(),u=()=>{try{if(!e.config||!a)return;let c=o.status;(c>=400||c===0)&&e.captureEvent({type:"error",message:`XHR failed with ${c||"network error"}`,errorType:"HttpError",requestUrl:a.url,requestMethod:a.method,responseStatus:c||void 0,responseTimeMs:Date.now()-l,url:typeof window<"u"?window.location.href:void 0,timestamp:Date.now()})}finally{o.removeEventListener("loadend",u),o.removeEventListener("error",u)}};return o.addEventListener("loadend",u),o.addEventListener("error",u),i.call(o,n)}}trackNavigation(){if(typeof window>"u")return;let e=history.pushState,t=history.replaceState,r=()=>{this.captureEvent({type:"info",message:`Navigation to ${window.location.href}`,url:window.location.href,timestamp:Date.now()})};history.pushState=function(...i){let n=e.apply(this,i);return r(),n},history.replaceState=function(...i){let n=t.apply(this,i);return r(),n},window.addEventListener("popstate",r)}},fs=new hs,qm=s=>fs.init(s),Qm=s=>fs.captureError(s),eg=s=>fs.captureEvent(s);return yu(tg);})();
57
+ /*! Bundled license information:
58
+
59
+ rrweb/dist/rrweb.js:
60
+ (*! *****************************************************************************
61
+ Copyright (c) Microsoft Corporation.
62
+
63
+ Permission to use, copy, modify, and/or distribute this software for any
64
+ purpose with or without fee is hereby granted.
65
+
66
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
67
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
68
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
69
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
70
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
71
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
72
+ PERFORMANCE OF THIS SOFTWARE.
73
+ ***************************************************************************** *)
74
+ */
2
75
  //# sourceMappingURL=sdk.js.map