@h-ai/feedback 1.0.0-beta.2 → 1.0.0-beta.20

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.
@@ -0,0 +1,442 @@
1
+ import { core, ok, err, HaiCommonError } from '@h-ai/core';
2
+ import { strToU8, zipSync, unzipSync, strFromU8 } from 'fflate';
3
+
4
+ // src/bundle/feedback-bundle-functions.ts
5
+ var VIEWER_SCRIPT = `
6
+ const messages = {
7
+ zh: {title:'\u95EE\u9898\u53CD\u9988',facts:'\u91C7\u96C6\u4E8B\u5B9E',user:'\u7528\u6237\u63CF\u8FF0',evidence:'\u8BC1\u636E',attachments:'\u622A\u56FE\u4E0E\u9644\u4EF6',missing:'\u7F3A\u5931\u6750\u6599',history:'\u5904\u7406\u8BB0\u5F55',error:'\u95EE\u9898\u5305\u8BFB\u53D6\u5931\u8D25',all:'\u5168\u90E8',next:'\u4E0B\u4E00\u9875',previous:'\u4E0A\u4E00\u9875',download:'\u4E0B\u8F7D',empty:'\u672A\u586B\u5199',replay:'\u9875\u9762\u56DE\u653E',play:'\u64AD\u653E',pause:'\u6682\u505C',unavailable:'\u56DE\u653E\u4E0D\u53EF\u7528\uFF0C\u5DF2\u4FDD\u7559\u539F\u59CB\u8BC1\u636E',boundary:'\u56DE\u653E\u5C55\u793A\u91C7\u96C6\u7684\u9875\u9762\u5FEB\u7167\u4E0E\u4EA4\u4E92\uFF0C\u4E0D\u6267\u884C\u539F\u5E94\u7528\u811A\u672C\u3002\u672A\u5185\u5D4C\u7684\u5916\u90E8\u56FE\u7247\u3001\u5B57\u4F53\u548C\u6837\u5F0F\u88AB\u79BB\u7EBF\u7B56\u7565\u963B\u6B62\uFF1B\u7F3A\u5931\u8BB0\u5F55\u89C1\u4E0B\u65B9\u3002'},
8
+ en: {title:'Feedback report',facts:'Collected facts',user:'User description',evidence:'Evidence',attachments:'Screenshots and attachments',missing:'Missing evidence',history:'Processing history',error:'Unable to read the bundle',all:'All',next:'Next',previous:'Previous',download:'Download',empty:'Not provided',replay:'Page replay',play:'Play',pause:'Pause',unavailable:'Replay unavailable; original evidence is preserved',boundary:'Replay shows captured snapshots and interactions without running application scripts. External images, fonts and styles that were not embedded are blocked by offline policy. See missing evidence below.'},
9
+ ja: {title:'\u554F\u984C\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF',facts:'\u53CE\u96C6\u3057\u305F\u4E8B\u5B9F',user:'\u30E6\u30FC\u30B6\u30FC\u306E\u8AAC\u660E',evidence:'\u8A3C\u62E0',attachments:'\u30B9\u30AF\u30EA\u30FC\u30F3\u30B7\u30E7\u30C3\u30C8\u3068\u6DFB\u4ED8',missing:'\u4E0D\u8DB3\u8CC7\u6599',history:'\u51E6\u7406\u8A18\u9332',error:'\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093',all:'\u3059\u3079\u3066',next:'\u6B21\u3078',previous:'\u524D\u3078',download:'\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9',empty:'\u672A\u5165\u529B',replay:'\u30DA\u30FC\u30B8\u518D\u751F',play:'\u518D\u751F',pause:'\u4E00\u6642\u505C\u6B62',unavailable:'\u518D\u751F\u3067\u304D\u307E\u305B\u3093\u3002\u5143\u306E\u8A3C\u62E0\u306F\u4FDD\u6301\u3055\u308C\u3066\u3044\u307E\u3059',boundary:'\u53CE\u96C6\u3057\u305F\u30B9\u30CA\u30C3\u30D7\u30B7\u30E7\u30C3\u30C8\u3068\u64CD\u4F5C\u3092\u518D\u751F\u3057\u3001\u5143\u306E\u30A2\u30D7\u30EA\u306E\u30B9\u30AF\u30EA\u30D7\u30C8\u306F\u5B9F\u884C\u3057\u307E\u305B\u3093\u3002\u57CB\u3081\u8FBC\u307E\u308C\u3066\u3044\u306A\u3044\u5916\u90E8\u753B\u50CF\u3001\u30D5\u30A9\u30F3\u30C8\u3001\u30B9\u30BF\u30A4\u30EB\u306F\u30AA\u30D5\u30E9\u30A4\u30F3\u65B9\u91DD\u3067\u906E\u65AD\u3055\u308C\u307E\u3059\u3002\u4E0D\u8DB3\u8CC7\u6599\u3082\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002'}
10
+ };
11
+ const language = navigator.language.startsWith('ja') ? 'ja' : navigator.language.startsWith('zh') ? 'zh' : 'en';
12
+ const m = messages[language];
13
+ function text(tag,value,parent){const node=document.createElement(tag);node.textContent=String(value??'');parent.append(node);return node;}
14
+ function section(title){const block=document.createElement('section');text('h2',title,block);document.querySelector('main').append(block);return block;}
15
+ function safeImage(file){return ['image/png','image/jpeg','image/webp'].includes(file.contentType);}
16
+ async function load(path){const response=await fetch('../'+path);if(!response.ok)throw Error('Missing file');return response.json();}
17
+ try {
18
+ const [manifest,report,evidence,history]=await Promise.all([load('manifest.json'),load('report.json'),load('evidence/records.json'),load('evidence/history.json')]);
19
+ text('h1',m.title+' '+(report.number||report.id),document.querySelector('header'));
20
+ text('pre',JSON.stringify(report,null,2),section(m.facts));
21
+ text('p',report.description||m.empty,section(m.user));
22
+ const attachments=section(m.attachments);
23
+ for(const file of manifest.files.filter(item=>item.kind==='attachment')){
24
+ if(!/^attachments\\/[\\w-]+\\.(png|jpg|webp|webm|mp4|txt|json|bin)$/.test(file.path))continue;
25
+ const figure=document.createElement('figure');attachments.append(figure);text('figcaption',file.name||file.attachmentId,figure);
26
+ if(safeImage(file)){const image=document.createElement('img');image.src='../'+file.path;image.alt=file.name||'';image.loading='lazy';figure.append(image);}
27
+ if(['video/webm','video/mp4'].includes(file.contentType)){const video=document.createElement('video');video.src='../'+file.path;video.controls=true;video.preload='metadata';video.style.maxWidth='100%';figure.append(video);}
28
+ const link=text('a',m.download,figure);link.href='../'+file.path;link.download=file.name||file.path.split('/').pop();
29
+ }
30
+ const replayEvents=evidence.filter(item=>item.kind==='replay'&&item.data&&item.data.event).map(item=>item.data.event).sort((a,b)=>a.timestamp-b.timestamp);
31
+
32
+ if(replayEvents.length){
33
+ const replay=section(m.replay);text('p',m.boundary,replay);
34
+ try{
35
+ await import('./replay.js');
36
+ if(typeof globalThis.__HAI_FEEDBACK_REPLAY__!=='function')throw Error('Replay unavailable');
37
+ const fullSnapshot=replayEvents.find(event=>event.type===2);
38
+ if(!fullSnapshot)throw Error('Replay full snapshot unavailable');
39
+ const target=document.createElement('div');replay.append(target);
40
+ let player;
41
+ const origin=replayEvents[0].timestamp;
42
+ const duration=Math.max(0,replayEvents.at(-1).timestamp-origin);
43
+ const snapshotOffset=Math.max(0,fullSnapshot.timestamp-origin);
44
+ const play=text('button',m.play,replay);const pause=text('button',m.pause,replay);
45
+ const slider=document.createElement('input');slider.type='range';slider.min='0';slider.max=String(Math.max(1,duration));slider.value='0';slider.setAttribute('aria-label',m.replay);replay.append(slider);
46
+ let current=0;let playing=false;let frame=0;
47
+ function position(value){return Math.max(0,Math.min(duration,Number.isFinite(value)?value:0));}
48
+ function stop(){if(frame)cancelAnimationFrame(frame);frame=0;}
49
+ // \u6BCF\u6B21\u5B9A\u4F4D\u91CD\u5EFA\u5B9E\u4F8B\uFF0C\u9694\u79BB\u65E7\u56DE\u653E\u672B\u5C3E\u5EF6\u8FDF\u5230\u8FBE\u7684 finish\uFF0C\u907F\u514D\u8986\u76D6\u65B0\u7684\u8FDB\u5EA6\u3002
50
+ function construct(){const instance=globalThis.__HAI_FEEDBACK_REPLAY__(replayEvents,target);player=instance;instance.on('finish',()=>{if(instance!==player||!playing)return;playing=false;stop();current=duration;slider.value=String(current);});}
51
+ function update(){if(!playing)return;current=position(player.getCurrentTime());slider.value=String(current);frame=requestAnimationFrame(update);}
52
+ // rrweb \u4EC5\u540C\u6B65\u5E94\u7528\u4E25\u683C\u65E9\u4E8E\u504F\u79FB\u7684\u4E8B\u4EF6\uFF1B\u589E\u52A0 1ms \u4F7F\u7CBE\u786E\u4E8B\u4EF6\u65F6\u95F4\u4E0E\u9996\u5E27\u8FB9\u754C\u90FD\u5305\u542B\u5728\u5185\u3002
53
+ function seek(value){playing=false;stop();const requested=position(value);player?.destroy();construct();player.pause(Math.max(requested,snapshotOffset)+1);current=requested;slider.value=String(current);}
54
+
55
+ play.onclick=()=>{stop();current=position(Number(slider.value));if(current>=duration)seek(0);playing=true;player.play(Math.max(current,snapshotOffset));update();};
56
+ pause.onclick=()=>{player.pause();playing=false;stop();current=position(player.getCurrentTime());slider.value=String(current);};
57
+ slider.oninput=()=>seek(Number(slider.value));
58
+ window.addEventListener('pagehide',()=>{playing=false;stop();player.destroy();},{once:true});
59
+ seek(0);
60
+ }catch{text('p',m.unavailable,replay);}
61
+ }
62
+ const block=section(m.evidence);const filter=document.createElement('select');block.append(filter);const all=text('option',m.all,filter);all.value='';
63
+ for(const kind of [...new Set(evidence.map(item=>item.kind))]){const option=text('option',kind,filter);option.value=kind;}
64
+ const request=document.createElement('input');request.placeholder='requestId';request.setAttribute('aria-label','requestId');block.append(request);
65
+ const output=text('pre','',block);const previous=text('button',m.previous,block);const next=text('button',m.next,block);const counter=text('span','',block);let page=1;
66
+ function render(){const rows=evidence.filter(item=>(!filter.value||item.kind===filter.value)&&(!request.value||item.requestId===request.value));const pages=Math.max(1,Math.ceil(rows.length/20));page=Math.min(page,pages);output.textContent=JSON.stringify(rows.slice((page-1)*20,page*20),null,2);counter.textContent=' '+page+' / '+pages+' ('+rows.length+')';previous.disabled=page<=1;next.disabled=page>=pages;}
67
+ filter.onchange=()=>{page=1;render();};request.oninput=()=>{page=1;render();};previous.onclick=()=>{page--;render();};next.onclick=()=>{page++;render();};render();
68
+ text('pre',JSON.stringify(history,null,2),section(m.history));text('pre',manifest.missing.join('\\n')||'\u2014',section(m.missing));
69
+ } catch {text('p',m.error,document.querySelector('main'));}
70
+ `;
71
+ function feedbackViewerFiles() {
72
+ return {
73
+ "viewer/index.html": strToU8(`<!doctype html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta http-equiv="Content-Security-Policy" content="default-src 'none'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' blob: data:; media-src 'self' blob:; connect-src 'self'; frame-src 'self' about: blob:; font-src 'self' data:; base-uri 'none'; form-action 'none'"><title>Feedback</title><link rel="stylesheet" href="style.css"></head><body><header></header><main></main><script type="module" src="app.js"></script></body></html>`),
74
+ "viewer/style.css": strToU8("body{font:15px system-ui,sans-serif;line-height:1.6;margin:0;background:#f5f6f8;color:#172033}header,main{max-width:1080px;margin:auto;padding:24px}section{background:white;padding:24px;margin-bottom:20px;border:1px solid #dce1e8;border-radius:12px}h1{font-size:26px}h2{font-size:19px;margin-top:0}pre{white-space:pre-wrap;overflow-wrap:anywhere;font:13px/1.6 ui-monospace,monospace}img{max-width:100%;height:auto;border:1px solid #dce1e8}figure{margin:16px 0}input,select,button{font:inherit;padding:8px;margin:4px;border:1px solid #ccd2dc;border-radius:6px}button{cursor:pointer}a{display:block;color:#215dc0}"),
75
+ "viewer/app.js": strToU8(VIEWER_SCRIPT),
76
+ "viewer/replay.js": strToU8('(()=>{var Ir=Object.defineProperty,ji=(e,t)=>{let r={};for(var o in e)Ir(r,o,{get:e[o],enumerable:!0});return t||Ir(r,Symbol.toStringTag,{value:"Module"}),r},Vi=Object.create,gs=Object.defineProperty,Gi=Object.getOwnPropertyDescriptor,Hi=Object.getOwnPropertyNames,qi=Object.getPrototypeOf,ys=Object.prototype.hasOwnProperty,H=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),Yi=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var c=Hi(t),f=0,d=c.length,g;f<d;f++)g=c[f],!ys.call(e,g)&&g!==r&&gs(e,g,{get:(p=>t[p]).bind(null,g),enumerable:!(o=Gi(t,g))||o.enumerable});return e},Ji=(e,t,r)=>(r=e!=null?Vi(qi(e)):{},Yi(t||!e||!e.__esModule||!ys.call(e,"default")?gs(r,"default",{value:e,enumerable:!0}):r,e)),B=(function(e){return e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e})({}),Dr={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Ar={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Ye={},Jt={},Tr=0;function Xi(e){let t=globalThis?.Zone?.__symbol__?.(e);if(t&&globalThis[t])return globalThis[t]}function lr(e){if(Ye[e])return Ye[e];let t=Xi(e)||globalThis[e],r=t.prototype,o=e in Dr?Dr[e]:void 0,c=!!(o&&o.every(g=>!!Object.getOwnPropertyDescriptor(r,g)?.get?.toString().includes("[native code]"))),f=e in Ar?Ar[e]:void 0,d=!!(f&&f.every(g=>typeof r[g]=="function"&&r[g]?.toString().includes("[native code]")));if(c&&d)return Ye[e]=t.prototype,t.prototype;try{let g=document.createElement("iframe");g.style.display="none",document.body.appendChild(g);let p=g.contentWindow;if(!p)return t.prototype;let m=p[e].prototype;if(!m)return g.remove(),r;let w=navigator.userAgent;return w.includes("Safari")&&!w.includes("Chrome")?(g.classList.add("rr-block"),g.setAttribute("__rrwebUntaintedMutationObserver",""),Jt[e]=()=>g.remove()):g.remove(),Ye[e]=m}catch{return r}}var _r={};function fe(e,t,r){let o=_r[e]?.[r];if(o)return o.call(t);let c=lr(e),f=Object.getOwnPropertyDescriptor(c,r)?.get;return f?((_r[e]||={})[r]=f,f.call(t)):t[r]}var zt={};function ws(e,t,r){let o=`${e}.${String(r)}`;if(zt[o])return zt[o].bind(t);let c=lr(e)[r];return typeof c!="function"?t[r]:(zt[o]=c,c.bind(t))}function Qi(e){return fe("Node",e,"ownerDocument")}function Zi(e){return fe("Node",e,"childNodes")}function Ki(e){return fe("Node",e,"parentNode")}function en(e){return fe("Node",e,"parentElement")}function tn(e){return fe("Node",e,"textContent")}function rn(e){return fe("Node",e,"firstChild")}function sn(e){return fe("Node",e,"lastChild")}function nn(e){return fe("Node",e,"nextSibling")}function on(e){return fe("Node",e,"previousSibling")}function an(e,t){return ws("Node",e,"contains")(t)}function ln(e){return ws("Node",e,"getRootNode")()}function un(e){return!e||!("host"in e)?null:fe("ShadowRoot",e,"host")}function cn(e){return e.styleSheets}function hn(e){return!e||!("shadowRoot"in e)?null:fe("Element",e,"shadowRoot")}function fn(e,t){return fe("Element",e,"querySelector")(t)}function dn(e,t){return fe("Element",e,"querySelectorAll")(t)}function pn(){let e=lr("MutationObserver");Tr++;let t=!1;return[e.constructor,()=>{if(t||(t=!0,--Tr!==0))return;let r=Jt.MutationObserver;if(r)try{r()}finally{delete Ye.MutationObserver,delete Jt.MutationObserver}}]}var vs=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(vs=()=>new Date().getTime());function mn(e,t,r){try{if(!(t in e))return()=>{};let o=e[t],c=r(o);return typeof c=="function"&&(c.prototype=c.prototype||{},Object.defineProperties(c,{__rrweb_original__:{enumerable:!1,value:o}})),e[t]=c,()=>{e[t]=o}}catch{return()=>{}}}var ne={ownerDocument:Qi,childNodes:Zi,parentNode:Ki,parentElement:en,textContent:tn,firstChild:rn,lastChild:sn,nextSibling:nn,previousSibling:on,contains:an,getRootNode:ln,host:un,styleSheets:cn,shadowRoot:hn,querySelector:fn,querySelectorAll:dn,nowTimestamp:vs,mutationObserverCtor:pn,patch:mn};function ur(e){return e.nodeType===e.ELEMENT_NODE}function Ke(e){let t=e&&"host"in e&&"mode"in e&&ne.host(e)||null;return!!(t&&"shadowRoot"in t&&ne.shadowRoot(t)===e)}function et(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function gn(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\\sbackground-clip:\\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function yn(e){let{cssText:t}=e;if(t.split(\'"\').length<3)return t;let r=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?r.push("layer"):e.layerName&&r.push(`layer(${e.layerName})`),e.supportsText&&r.push(`supports(${e.supportsText})`),e.media.length&&r.push(e.media.mediaText),r.join(" ")+";"}function Xt(e){try{let t=e.rules||e.cssRules;if(!t)return null;let r=e.href;return!r&&e.ownerNode&&(r=e.ownerNode.baseURI),gn(Array.from(t,o=>bs(o,r)).join(""))}catch{return null}}function bs(e,t){if(vn(e)){let r;try{r=Xt(e.styleSheet)||yn(e)}catch{r=e.cssText}return e.styleSheet.href?wt(r,e.styleSheet.href):r}else{let r=e.cssText;return bn(e)&&e.selectorText.includes(":")&&(r=wn(r)),t?wt(r,t):r}}function wn(e){return e.replace(/(\\[(?:[\\w-]+)[^\\\\])(:(?:[\\w-]+)\\])/gm,"$1\\\\$2")}function vn(e){return"styleSheet"in e}function bn(e){return"selectorText"in e}var cr=class{idNodeMap=new Map;nodeMetaMap=new WeakMap;getId(e){return e?this.getMeta(e)?.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(o=>this.removeNodeFromMap(o));let r=ne.shadowRoot(e);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 o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(t,o)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function Ss(){return new cr}function gt({element:e,maskInputOptions:t,tagName:r,type:o,value:c,maskInputFn:f}){let d=c||"",g=o&&Ce(o);return(t[r.toLowerCase()]||g&&t[g])&&(f?d=f(d,e):d="*".repeat(d.length)),d}function Ce(e){return e.toLowerCase()}var Lr="__rrweb_original__";function Sn(e){let t=e.getContext("2d");if(!t)return!0;let r=50;for(let o=0;o<e.width;o+=r)for(let c=0;c<e.height;c+=r){let f=t.getImageData,d=Lr in f?f[Lr]:f;if(new Uint32Array(d.call(t,o,c,Math.min(r,e.width-o),Math.min(r,e.height-c)).data.buffer).some(g=>g!==0))return!1}return!0}function Cn(e,t){return!e||!t||e.type!==t.type?!1:e.type===B.Document?e.compatMode===t.compatMode:e.type===B.DocumentType?e.name===t.name&&e.publicId===t.publicId&&e.systemId===t.systemId:e.type===B.Comment||e.type===B.Text||e.type===B.CDATA?e.textContent===t.textContent:e.type===B.Element?e.tagName===t.tagName&&JSON.stringify(e.attributes)===JSON.stringify(t.attributes)&&e.isSVG===t.isSVG&&e.needBlock===t.needBlock:!1}function yt(e){let t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?Ce(t):null}function hr(e,t){let r;try{r=new URL(e,t??window.location.href)}catch{return null}return r.pathname.match(/\\.([0-9a-z]+)(?:$)/i)?.[1]??null}function xn(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}var En=/url\\((?:(\')([^\']*)\'|(")(.*?)"|([^)]*))\\)/gm,Mn=/^(?:[a-z+]+:)?\\/\\//i,Rn=/^www\\..*/i,Nn=/^(data:)([^,]*),(.*)/i,On=/^blob:/i;function wt(e,t){return(e||"").replace(En,(r,o,c,f,d,g)=>{let p=c||d||g,m=o||f||"";if(!p)return r;if(Mn.test(p)||Rn.test(p))return`url(${m}${p}${m})`;if(Nn.test(p)||On.test(p))return`url(${m}${p}${m})`;if(p[0]==="#")return`url(${m}${p}${m})`;if(p[0]==="/")return`url(${m}${xn(t)+p}${m})`;let w=p.split("#")[0],u=p.substring(w.length),n=t.split("#")[0].split("/"),i=w.split("/");n.pop();for(let l of i)l!=="."&&(l===".."?n.pop():n.push(l));return`url(${m}${n.join("/")}${u}${m})`})}var Cs="(?:/\\\\*[^*]*\\\\*/)|[\\\\s;]",In=new RegExp(`${Cs}|\\\\b(0)px?`,"g"),Dn=new RegExp(Cs,"g");function ct(e,t=!1){return t?e.replace(Dn,""):e.replace(In,"$1")}function An(e,t,r=!1){let o=Array.from(t.childNodes),c=[],f=0;if(o.length>1&&e&&typeof e=="string"){let d=ct(e,r),g=d.length/e.length;for(let p=1;p<o.length;p++)if(o[p].textContent&&typeof o[p].textContent=="string"){let m=ct(o[p].textContent,r),w=100,u=3;for(;u<m.length&&(m[u].match(/[a-zA-Z0-9]/)||m.indexOf(m.substring(0,u),1)!==-1);u++);for(;u<m.length;u++){let n=m.substring(0,u),i=d.split(n),l=-1;if(i.length===2)l=i[0].length;else if(i.length>2&&i[0]===""&&o[p-1].textContent!=="")l=d.indexOf(n,1);else if(i.length===1){if(n=n.substring(0,n.length-1),i=d.split(n),i.length<=1)return c.push(e),c;u=101}else u===m.length-1&&(l=d.indexOf(n));if(i.length>=2&&u>w){let s=o[p-1].textContent;if(s&&typeof s=="string"){let a=ct(s).length;l=d.indexOf(n,a)}l===-1&&(l=i[0].length)}if(l!==-1){let s=Math.floor(l/g);for(;s>0&&s<e.length;){if(f+=1,f>50*o.length)return c.push(e),c;let a=ct(e.substring(0,s),r);if(a.length===l){c.push(e.substring(0,s)),e=e.substring(s),d=d.substring(l);break}else a.length<l?s+=Math.max(1,Math.floor((l-a.length)/g)):s-=Math.max(1,Math.floor((a.length-l)*g))}break}}}}return c.push(e),c}function Tn(e,t){return An(e,t).join("/* rr_split */")}var _n=1,Ln=new RegExp("[^a-z0-9-_:]");function xs(){return _n++}function kn(e){if(e instanceof HTMLFormElement)return"form";let t=Ce(e.tagName);return Ln.test(t)?"div":t}var Ue,kr,Pn=/^[^ \\t\\n\\r\\u000c]+/,Fn=/^[, \\t\\n\\r\\u000c]+/;function Un(e,t){if(t.trim()==="")return t;let r=0;function o(f){let d,g=f.exec(t.substring(r));return g?(d=g[0],r+=d.length,d):""}let c=[];for(;o(Fn),!(r>=t.length);){let f=o(Pn);if(f.slice(-1)===",")f=ze(e,f.substring(0,f.length-1)),c.push(f);else{let d="";f=ze(e,f);let g=!1;for(;;){let p=t.charAt(r);if(p===""){c.push((f+d).trim());break}else if(g)p===")"&&(g=!1);else if(p===","){r+=1,c.push((f+d).trim());break}else p==="("&&(g=!0);d+=p,r+=1}}}return c.join(", ")}var Pr=new WeakMap;function ze(e,t){return!t||t.trim()===""?t:fr(e,t)}function Bn(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function fr(e,t){let r=Pr.get(e);if(r||(r=e.createElement("a"),Pr.set(e,r)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return r.setAttribute("href",t),r.href}function Es(e,t,r,o){return o&&(r==="src"||r==="href"&&!(t==="use"&&o[0]==="#")||r==="xlink:href"&&o[0]!=="#"||r==="background"&&["table","td","th"].includes(t)?ze(e,o):r==="srcset"?Un(e,o):r==="style"?wt(o,fr(e)):t==="object"&&r==="data"?ze(e,o):o)}function Ms(e,t,r){return["video","audio"].includes(e)&&Ce(t)==="autoplay"}function Rs(e,t,r){try{if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let o=e.classList.length;o--;){let c=e.classList[o];if(t.test(c))return!0}if(r)return e.matches(r)}catch{}return!1}function vt(e,t,r){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return r?vt(ne.parentNode(e),t,r):!1;for(let o=e.classList.length;o--;){let c=e.classList[o];if(t.test(c))return!0}return r?vt(ne.parentNode(e),t,r):!1}function Ns(e,t,r,o){let c;if(ur(e)){if(c=e,!ne.childNodes(c).length)return!1}else{if(ne.parentElement(e)===null)return!1;c=ne.parentElement(e)}try{if(typeof t=="string"){if(o){if(c.closest(`.${t}`))return!0}else if(c.classList.contains(t))return!0}else if(vt(c,t,o))return!0;if(r){if(o){if(c.closest(r))return!0}else if(c.matches(r))return!0}}catch{}return!1}function Wn(e,t,r){let o=e.contentWindow;if(!o)return;let c=!1,f;try{f=o.document.readyState}catch{return}if(f!=="complete"){let g=setTimeout(()=>{c||(t(),c=!0)},r);e.addEventListener("load",()=>{clearTimeout(g),c=!0,t()});return}let d="about:blank";if(o.location.href!==d||e.src===d||e.src==="")return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function $n(e,t,r){let o=!1,c;try{c=e.sheet}catch{return}if(c)return;let f=setTimeout(()=>{o||(t(),o=!0)},r);e.addEventListener("load",()=>{clearTimeout(f),o=!0,t()})}function zn(e,t){let{doc:r,mirror:o,blockClass:c,blockSelector:f,needsMask:d,inlineStylesheet:g,maskInputOptions:p={},maskTextFn:m,maskInputFn:w,dataURLOptions:u={},inlineImages:n,recordCanvas:i,keepIframeSrcFn:l,newlyAddedElement:s=!1,cssCaptured:a=!1}=t,h=jn(r,o);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:B.Document,childNodes:[],compatMode:e.compatMode}:{type:B.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:B.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:h};case e.ELEMENT_NODE:return Gn(e,{doc:r,blockClass:c,blockSelector:f,inlineStylesheet:g,maskInputOptions:p,maskInputFn:w,dataURLOptions:u,inlineImages:n,recordCanvas:i,keepIframeSrcFn:l,newlyAddedElement:s,rootId:h});case e.TEXT_NODE:return Vn(e,{doc:r,needsMask:d,maskTextFn:m,rootId:h,cssCaptured:a});case e.CDATA_SECTION_NODE:return{type:B.CDATA,textContent:"",rootId:h};case e.COMMENT_NODE:return{type:B.Comment,textContent:ne.textContent(e)||"",rootId:h};default:return!1}}function jn(e,t){if(!t.hasNode(e))return;let r=t.getId(e);return r===1?void 0:r}function Vn(e,t){let{needsMask:r,maskTextFn:o,rootId:c,cssCaptured:f}=t,d=ne.parentNode(e),g=d&&d.tagName,p="",m=g==="STYLE"?!0:void 0,w=g==="SCRIPT"?!0:void 0;return w?p="SCRIPT_PLACEHOLDER":f||(p=ne.textContent(e),m&&p&&(p=wt(p,fr(t.doc)))),!m&&!w&&p&&r&&(p=o?o(p,ne.parentElement(e)):p.replace(/[\\S]/g,"*")),{type:B.Text,textContent:p||"",rootId:c}}function Gn(e,t){let{doc:r,blockClass:o,blockSelector:c,inlineStylesheet:f,maskInputOptions:d={},maskInputFn:g,dataURLOptions:p={},inlineImages:m,recordCanvas:w,keepIframeSrcFn:u,newlyAddedElement:n=!1,rootId:i}=t,l=Rs(e,o,c),s=kn(e),a={},h=e.attributes.length;for(let b=0;b<h;b++){let v=e.attributes[b];Ms(s,v.name,v.value)||(a[v.name]=Es(r,s,Ce(v.name),v.value))}if(s==="link"&&f){let b=Array.from(r.styleSheets).find(M=>M.href===e.href),v=null;b&&(v=Xt(b)),v&&(delete a.rel,delete a.href,a._cssText=v)}if(s==="style"&&e.sheet){let b=Xt(e.sheet);b&&(e.childNodes.length>1&&(b=Tn(b,e)),a._cssText=b)}if(["input","textarea","select"].includes(s)){let b=e.value,v=e.checked;a.type!=="radio"&&a.type!=="checkbox"&&a.type!=="submit"&&a.type!=="button"&&b?a.value=gt({element:e,type:yt(e),tagName:s,value:b,maskInputOptions:d,maskInputFn:g}):v&&(a.checked=v)}if(s==="option"&&(e.selected&&!d.select?a.selected=!0:delete a.selected),s==="dialog"&&e.open&&(a.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),s==="canvas"&&w){if(e.__context==="2d")Sn(e)||(a.rr_dataURL=e.toDataURL(p.type,p.quality));else if(!("__context"in e)){let b=e.toDataURL(p.type,p.quality),v=r.createElement("canvas");v.width=e.width,v.height=e.height,b!==v.toDataURL(p.type,p.quality)&&(a.rr_dataURL=b)}}if(s==="img"&&m){Ue||(Ue=r.createElement("canvas"),kr=Ue.getContext("2d"));let b=e,v=b.currentSrc||b.getAttribute("src")||"<unknown-src>",M=b.crossOrigin,x=()=>{b.removeEventListener("load",x);try{Ue.width=b.naturalWidth,Ue.height=b.naturalHeight,kr.drawImage(b,0,0),a.rr_dataURL=Ue.toDataURL(p.type,p.quality)}catch(C){if(b.crossOrigin!=="anonymous"){b.crossOrigin="anonymous",b.complete&&b.naturalWidth!==0?x():b.addEventListener("load",x);return}else console.warn(`Cannot inline img src=${v}! Error: ${C}`)}b.crossOrigin==="anonymous"&&(M?a.crossOrigin=M:b.removeAttribute("crossorigin"))};b.complete&&b.naturalWidth!==0?x():b.addEventListener("load",x)}if(["audio","video"].includes(s)){let b=a;b.rr_mediaState=e.paused?"paused":"played",b.rr_mediaCurrentTime=e.currentTime,b.rr_mediaPlaybackRate=e.playbackRate,b.rr_mediaMuted=e.muted,b.rr_mediaLoop=e.loop,b.rr_mediaVolume=e.volume}if(n||(e.scrollLeft&&(a.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(a.rr_scrollTop=e.scrollTop)),l){let{width:b,height:v}=e.getBoundingClientRect();a={class:a.class,rr_width:`${b}px`,rr_height:`${v}px`}}s==="iframe"&&!u(a.src)&&(e.contentDocument||(a.rr_src=a.src),delete a.src);let y;try{customElements.get(s)&&(y=!0)}catch{}return{type:B.Element,tagName:s,attributes:a,childNodes:[],isSVG:Bn(e)||void 0,needBlock:l,rootId:i,isCustom:y}}function J(e){return e==null?"":e.toLowerCase()}function Os(e){return e===!0||e==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:e==="all",headMetaDescKeywords:e==="all",headTitleMutations:e==="all"}:e||{}}function Hn(e,t){if(t.comment&&e.type===B.Comment)return!0;if(e.type===B.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&hr(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(J(e.attributes.name).match(/^msapplication-tile(image|color)$/)||J(e.attributes.name)==="application-name"||J(e.attributes.rel)==="icon"||J(e.attributes.rel)==="apple-touch-icon"||J(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&J(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(J(e.attributes.property).match(/^(og|twitter|fb):/)||J(e.attributes.name).match(/^(og|twitter):/)||J(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(J(e.attributes.name)==="robots"||J(e.attributes.name)==="googlebot"||J(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(J(e.attributes.name)==="author"||J(e.attributes.name)==="generator"||J(e.attributes.name)==="framework"||J(e.attributes.name)==="publisher"||J(e.attributes.name)==="progid"||J(e.attributes.property).match(/^article:/)||J(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(J(e.attributes.name)==="google-site-verification"||J(e.attributes.name)==="yandex-verification"||J(e.attributes.name)==="csrf-token"||J(e.attributes.name)==="p:domain_verify"||J(e.attributes.name)==="verify-v1"||J(e.attributes.name)==="verification"||J(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function je(e,t){let{doc:r,mirror:o,blockClass:c,blockSelector:f,maskTextClass:d,maskTextSelector:g,skipChild:p=!1,inlineStylesheet:m=!0,maskInputOptions:w={},maskTextFn:u,maskInputFn:n,slimDOMOptions:i,dataURLOptions:l={},inlineImages:s=!1,recordCanvas:a=!1,onSerialize:h,onIframeLoad:y,iframeLoadTimeout:b=5e3,onStylesheetLoad:v,stylesheetLoadTimeout:M=5e3,keepIframeSrcFn:x=()=>!1,newlyAddedElement:C=!1,cssCaptured:S=!1}=t,{needsMask:E}=t,{preserveWhiteSpace:R=!0}=t;E||(E=Ns(e,d,g,E===void 0));let I=zn(e,{doc:r,mirror:o,blockClass:c,blockSelector:f,needsMask:E,inlineStylesheet:m,maskInputOptions:w,maskTextFn:u,maskInputFn:n,dataURLOptions:l,inlineImages:s,recordCanvas:a,keepIframeSrcFn:x,newlyAddedElement:C,cssCaptured:S});if(!I)return console.warn(e,"not serialized"),null;let N;o.hasNode(e)?N=o.getId(e):Hn(I,i)||!R&&I.type===B.Text&&!I.textContent.replace(/^\\s+|\\s+$/gm,"").length?N=-2:N=xs();let A=Object.assign(I,{id:N});if(o.add(e,A),N===-2)return null;h&&h(e);let L=!p;if(A.type===B.Element){L=L&&!A.needBlock,delete A.needBlock;let V=ne.shadowRoot(e);V&&et(V)&&(A.isShadowHost=!0)}if((A.type===B.Document||A.type===B.Element)&&L){i.headWhitespace&&A.type===B.Element&&A.tagName==="head"&&(R=!1);let V={doc:r,mirror:o,blockClass:c,blockSelector:f,needsMask:E,maskTextClass:d,maskTextSelector:g,skipChild:p,inlineStylesheet:m,maskInputOptions:w,maskTextFn:u,maskInputFn:n,slimDOMOptions:i,dataURLOptions:l,inlineImages:s,recordCanvas:a,preserveWhiteSpace:R,onSerialize:h,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:M,keepIframeSrcFn:x,cssCaptured:!1};if(!(A.type===B.Element&&A.tagName==="textarea"&&A.attributes.value!==void 0)){A.type===B.Element&&A.attributes._cssText!==void 0&&typeof A.attributes._cssText=="string"&&(V.cssCaptured=!0);for(let re of Array.from(ne.childNodes(e))){let F=je(re,V);F&&A.childNodes.push(F)}}let O=null;if(ur(e)&&(O=ne.shadowRoot(e)))for(let re of Array.from(ne.childNodes(O))){let F=je(re,V);F&&(et(O)&&(F.isShadow=!0),A.childNodes.push(F))}}let ae=ne.parentNode(e);return ae&&Ke(ae)&&et(ae)&&(A.isShadow=!0),A.type===B.Element&&A.tagName==="iframe"&&!Rs(e,c,f)&&Wn(e,()=>{let V=e.contentDocument;if(V&&y){let O=je(V,{doc:V,mirror:o,blockClass:c,blockSelector:f,needsMask:E,maskTextClass:d,maskTextSelector:g,skipChild:!1,inlineStylesheet:m,maskInputOptions:w,maskTextFn:u,maskInputFn:n,slimDOMOptions:i,dataURLOptions:l,inlineImages:s,recordCanvas:a,preserveWhiteSpace:R,onSerialize:h,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:M,keepIframeSrcFn:x});O&&y(e,O)}},b),A.type===B.Element&&A.tagName==="link"&&typeof A.attributes.rel=="string"&&(A.attributes.rel==="stylesheet"||A.attributes.rel==="preload"&&typeof A.attributes.href=="string"&&hr(A.attributes.href)==="css")&&$n(e,()=>{if(v){let V=je(e,{doc:r,mirror:o,blockClass:c,blockSelector:f,needsMask:E,maskTextClass:d,maskTextSelector:g,skipChild:!1,inlineStylesheet:m,maskInputOptions:w,maskTextFn:u,maskInputFn:n,slimDOMOptions:i,dataURLOptions:l,inlineImages:s,recordCanvas:a,preserveWhiteSpace:R,onSerialize:h,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:M,keepIframeSrcFn:x});V&&v(e,V)}},M),A}function qn(e,t){let{mirror:r=new cr,blockClass:o="rr-block",blockSelector:c=null,maskTextClass:f="rr-mask",maskTextSelector:d=null,inlineStylesheet:g=!0,inlineImages:p=!1,recordCanvas:m=!1,maskAllInputs:w=!1,maskTextFn:u,maskInputFn:n,slimDOM:i=!1,dataURLOptions:l,preserveWhiteSpace:s,onSerialize:a,onIframeLoad:h,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:v,keepIframeSrcFn:M=()=>!1}=t||{};return je(e,{doc:e,mirror:r,blockClass:o,blockSelector:c,maskTextClass:f,maskTextSelector:d,skipChild:!1,inlineStylesheet:g,maskInputOptions:w===!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}:w===!1?{password:!0}:w,maskTextFn:u,maskInputFn:n,slimDOMOptions:Os(i),dataURLOptions:l,inlineImages:p,recordCanvas:m,preserveWhiteSpace:s,onSerialize:a,onIframeLoad:h,iframeLoadTimeout:y,onStylesheetLoad:b,stylesheetLoadTimeout:v,keepIframeSrcFn:M,newlyAddedElement:!1})}var Fr=new RegExp(/(max|min)-device-(width|height)/.source,"g"),Yn={postcssPlugin:"postcss-custom-selectors",prepare(){return{postcssPlugin:"postcss-custom-selectors",AtRule:function(e){e.params.match(Fr)&&(e.params=e.params.replace(Fr,"$1-$2"))}}}},Jn={postcssPlugin:"postcss-hover-classes",prepare:function(){let e=[];return{Rule:function(t){e.indexOf(t)===-1&&(e.push(t),t.selectors.forEach(function(r){r.includes(":hover")&&(t.selector+=`,\n`+r.replace(/:hover/g,".\\\\:hover"))}))}}}},Xn=H(((e,t)=>{var r=String,o=function(){return{isColorSupported:!1,reset:r,bold:r,dim:r,italic:r,underline:r,inverse:r,hidden:r,strikethrough:r,black:r,red:r,green:r,yellow:r,blue:r,magenta:r,cyan:r,white:r,gray:r,bgBlack:r,bgRed:r,bgGreen:r,bgYellow:r,bgBlue:r,bgMagenta:r,bgCyan:r,bgWhite:r,blackBright:r,redBright:r,greenBright:r,yellowBright:r,blueBright:r,magentaBright:r,cyanBright:r,whiteBright:r,bgBlackBright:r,bgRedBright:r,bgGreenBright:r,bgYellowBright:r,bgBlueBright:r,bgMagentaBright:r,bgCyanBright:r,bgWhiteBright:r}};t.exports=o(),t.exports.createColors=o})),ye=H(((e,t)=>{t.exports={}})),dr=H(((e,t)=>{var r=Xn(),o=ye(),c=class Is extends Error{constructor(d,g,p,m,w,u){super(d),this.name="CssSyntaxError",this.reason=d,w&&(this.file=w),m&&(this.source=m),u&&(this.plugin=u),typeof g<"u"&&typeof p<"u"&&(typeof g=="number"?(this.line=g,this.column=p):(this.line=g.line,this.column=g.column,this.endLine=p.line,this.endColumn=p.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Is)}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(d){if(!this.source)return"";let g=this.source;d==null&&(d=r.isColorSupported);let p=s=>s,m=s=>s,w=s=>s;if(d){let{bold:s,gray:a,red:h}=r.createColors(!0);m=y=>s(h(y)),p=y=>a(y),o&&(w=y=>o(y))}let u=g.split(/\\r?\\n/),n=Math.max(this.line-3,0),i=Math.min(this.line+2,u.length),l=String(i).length;return u.slice(n,i).map((s,a)=>{let h=n+1+a,y=" "+(" "+h).slice(-l)+" | ";if(h===this.line){if(s.length>160){let v=20,M=Math.max(0,this.column-v),x=Math.max(this.column+v,this.endColumn+v),C=s.slice(M,x),S=p(y.replace(/\\d/g," "))+s.slice(0,Math.min(this.column-1,19)).replace(/[^\\t]/g," ");return m(">")+p(y)+w(C)+`\n `+S+m("^")}let b=p(y.replace(/\\d/g," "))+s.slice(0,this.column-1).replace(/[^\\t]/g," ");return m(">")+p(y)+w(s)+`\n `+b+m("^")}return" "+p(y)+w(s)}).join(`\n`)}toString(){let d=this.showSourceCode();return d&&(d=`\n\n`+d+`\n`),this.name+": "+this.message+d}};t.exports=c,c.default=c})),Ds=H(((e,t)=>{var r=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/,o={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function c(w){return w[0].toUpperCase()+w.slice(1)}function f(w,u){let n="@"+u.name,i=u.params?w.rawValue(u,"params"):"",l=u.raws.afterName;return typeof l>"u"?l=i?" ":"":l===""&&i&&!r.test(i[0])&&(l=" "),n+l+i}function d(w){if(!w.prop.startsWith("--"))return!1;let u=w.raws.before;return typeof u>"u"||!/[^\\s;]$/.test(u)}function g(w,u,n){let i=n.nodes,l=i.length-1;for(;l>0&&i[l].type==="comment";)l-=1;let s=w.raw(n,"semicolon"),a=n.type==="document";for(let h=i.length-1;h>=0;h--){let y=i[h],b=l!==h||s;!b&&h<i.length-1&&(y.type==="atrule"&&!y.nodes||y.type==="decl"&&d(y))&&(b=!0),u.push({document:a,node:y,semicolon:b})}}function p(w,u,n,i){let l=w.raw(n,"between","beforeOpen");w.builder(i+l+"{",n,"start");let s=n.nodes&&n.nodes.length,a=()=>{let h=s?w.raw(n,"after"):w.raw(n,"after","emptyBody");h&&w.builder(h),w.builder("}",n,"end"),n.type==="rule"&&n.raws.ownSemicolon&&w.builder(n.raws.ownSemicolon,n,"end")};s?(u.push(a),g(w,u,n)):a()}var m=class As{constructor(u){this.builder=u}atrule(u,n){let i=f(this,u);if(u.nodes)this.block(u,i);else{let l=(u.raws.between||"")+(n?";":"");this.builder(i+l,u)}}beforeAfter(u,n){let i;u.type==="decl"?i=this.raw(u,null,"beforeDecl"):u.type==="comment"?i=this.raw(u,null,"beforeComment"):n==="before"?i=this.raw(u,null,"beforeRule"):i=this.raw(u,null,"beforeClose");let l=u.parent,s=0;for(;l&&l.type!=="root";)s+=1,l=l.parent;if(i.includes(`\n`)){let a=this.raw(u,null,"indent");if(a.length)for(let h=0;h<s;h++)i+=a}return i}block(u,n){let i=this.raw(u,"between","beforeOpen");this.builder(n+i+"{",u,"start");let l;u.nodes&&u.nodes.length?(this.body(u),l=this.raw(u,"after")):l=this.raw(u,"after","emptyBody"),l&&this.builder(l),this.builder("}",u,"end")}body(u){let n=As.prototype,i=["atrule","block","body","rule","stringify"].every(s=>this[s]===n[s]),l=[];for(g(this,l,u);l.length>0;){let s=l.pop();if(typeof s=="function"){s();continue}let a=s.node,h=this.raw(a,"before");h&&this.builder(h),i&&a.type==="rule"?p(this,l,a,this.rawValue(a,"selector")):i&&a.type==="atrule"&&a.nodes?p(this,l,a,f(this,a)):this.stringify(a,s.semicolon)}}comment(u){let n=this.raw(u,"left","commentLeft"),i=this.raw(u,"right","commentRight");this.builder("/*"+n+u.text+i+"*/",u)}decl(u,n){let i=u.raws,l=this.raw(u,"between","colon"),s=u.prop+l+this.rawValue(u,"value");u.important&&(s+=i.important||" !important"),n&&(s+=";"),this.builder(s,u)}document(u){this.body(u)}raw(u,n,i){let l;if(i||(i=n),n&&(l=u.raws[n],typeof l<"u"))return l;let s=u.parent;if(i==="before"&&(!s||s.type==="root"&&s.first===u||s&&s.type==="document"))return"";if(!s)return o[i];let a=u.root(),h=a.rawCache||(a.rawCache={});if(typeof h[i]<"u")return h[i];if(i==="before"||i==="after")return this.beforeAfter(u,i);{let y="raw"+c(i);this[y]?l=this[y](a,u):a.walk(b=>{if(l=b.raws[n],typeof l<"u")return!1})}return typeof l>"u"&&(l=o[i]),h[i]=l,l}rawBeforeClose(u){let n;return u.walk(i=>{if(i.nodes&&i.nodes.length>0&&typeof i.raws.after<"u")return n=i.raws.after,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),n&&(n=n.replace(/\\S/g,"")),n}rawBeforeComment(u,n){let i;return u.walkComments(l=>{if(typeof l.raws.before<"u")return i=l.raws.before,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(n,null,"beforeDecl"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeDecl(u,n){let i;return u.walkDecls(l=>{if(typeof l.raws.before<"u")return i=l.raws.before,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(n,null,"beforeRule"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeOpen(u){let n;return u.walk(i=>{if(i.type!=="decl"&&(n=i.raws.between,typeof n<"u"))return!1}),n}rawBeforeRule(u){let n;return u.walk(i=>{if(i.nodes&&(i.parent!==u||u.first!==i)&&typeof i.raws.before<"u")return n=i.raws.before,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),n&&(n=n.replace(/\\S/g,"")),n}rawColon(u){let n;return u.walkDecls(i=>{if(typeof i.raws.between<"u")return n=i.raws.between.replace(/[^\\s:]/g,""),!1}),n}rawEmptyBody(u){let n;return u.walk(i=>{if(i.nodes&&i.nodes.length===0&&(n=i.raws.after,typeof n<"u"))return!1}),n}rawIndent(u){if(u.raws.indent)return u.raws.indent;let n;return u.walk(i=>{let l=i.parent;if(l&&l!==u&&l.parent&&l.parent===u&&typeof i.raws.before<"u"){let s=i.raws.before.split(`\n`);return n=s[s.length-1],n=n.replace(/\\S/g,""),!1}}),n}rawSemicolon(u){let n;return u.walk(i=>{if(i.nodes&&i.nodes.length&&i.last.type==="decl"&&(n=i.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(u,n){let i=u[n],l=u.raws[n];return l&&l.value===i?l.raw:i}root(u){!(u.parent&&u.parent.type==="document")&&u.source&&u.source.input.hasBOM&&this.builder("\\uFEFF",u,"start"),this.body(u),u.raws.after&&this.builder(u.raws.after)}rule(u){this.block(u,this.rawValue(u,"selector")),u.raws.ownSemicolon&&this.builder(u.raws.ownSemicolon,u,"end")}stringify(u,n){if(!this[u.type])throw new Error("Unknown AST node type "+u.type+". Maybe you need to change PostCSS stringifier.");this[u.type](u,n)}};t.exports=m,m.default=m})),Et=H(((e,t)=>{var r=Ds(),o=/(<)(\\/?style\\b)/gi,c=/(<)(!--)/g;function f(m){return m.includes("<")?m.replace(o,"\\\\3c $2").replace(c,"\\\\3c $2"):m}function d(m,w,u){let n=[],i=0,l=0;for(let s=0;s<m.length;s+=3){let a=l,h=i+m[s].length;for(;i<h;)w[i]===u[l]?(i+=1,l+=1):(i+=1,l+=4);n.push(u.slice(a,l))}return n}var g=class extends r{escapeHTML(m){let w=this.builder,u,n;if(this.builder=(l,s,a)=>{u?(n+=l,u.push(l,s,a)):l.includes("<")?(n=l,u=[l,s,a]):w(l,s,a)},m(),this.builder=w,!u)return;let i=f(n);if(i===n)for(let l=0;l<u.length;l+=3)w(u[l],u[l+1],u[l+2]);else{let l=d(u,n,i);for(let s=0;s<u.length;s+=3)w(l[s/3],u[s+1],u[s+2])}}root(m){m.parent&&m.parent.type==="document"?(this.escapeHTML(()=>this.body(m)),m.raws.after&&this.builder(m.raws.after)):this.escapeHTML(()=>super.root(m))}};function p(m,w){let u=new g(w);m.type==="root"||m.type==="document"?u.stringify(m):u.escapeHTML(()=>u.stringify(m))}t.exports=p,p.default=p})),Mt=H(((e,t)=>{t.exports.isClean=Symbol("isClean"),t.exports.my=Symbol("my")})),Rt=H(((e,t)=>{var r=dr(),o=Ds(),c=Et(),{isClean:f,my:d}=Mt();function g(w,u){let n=new w.constructor,i=[[w,n,u]];for(;i.length>0;){let[l,s,a]=i.pop();for(let h in l){if(!Object.prototype.hasOwnProperty.call(l,h)||h==="proxyCache")continue;let y=l[h],b=typeof y;if(h==="parent"&&b==="object")a&&(s[h]=a);else if(h==="source")s[h]=y;else if(Array.isArray(y)){let v=[];s[h]=v;for(let M of y){let x=new M.constructor;v.push(x),i.push([M,x,s])}}else{if(b==="object"&&y!==null){let v=new y.constructor;i.push([y,v,void 0]),y=v}s[h]=y}}}return n}function p(w,u){if(u&&typeof u.offset<"u")return u.offset;let n=1,i=1,l=0;for(let s=0;s<w.length;s++){if(i===u.line&&n===u.column){l=s;break}w[s]===`\n`?(n=1,i+=1):n+=1}return l}var m=class Qt{get proxyOf(){return this}constructor(u={}){this.raws={},this[f]=!1,this[d]=!0;for(let n of Object.keys(u))if(n!=="__proto__")if(n==="nodes"){this.nodes=[];for(let i of u[n])typeof i.clone=="function"&&i.parent?this.append(i.clone()):this.append(i)}else this[n]=u[n]}addToError(u){if(u.postcssNode=this,u.stack&&this.source&&/\\n\\s{4}at /.test(u.stack)){let n=this.source;u.stack=u.stack.replace(/\\n\\s{4}at /,`$&${n.input.from}:${n.start.line}:${n.start.column}$&`)}return u}after(u){return this.parent.insertAfter(this,u),this}assign(u={}){for(let n in u)this[n]=u[n];return this}before(u){return this.parent.insertBefore(this,u),this}cleanRaws(u){delete this.raws.before,delete this.raws.after,u||delete this.raws.between}clone(u={}){let n=g(this);for(let i in u)n[i]=u[i];return n}cloneAfter(u={}){let n=this.clone(u);return this.parent.insertAfter(this,n),n}cloneBefore(u={}){let n=this.clone(u);return this.parent.insertBefore(this,n),n}error(u,n={}){if(this.source){let{end:i,start:l}=this.rangeBy(n);return this.source.input.error(u,{column:l.column,line:l.line},{column:i.column,line:i.line},n)}return new r(u)}getProxyProcessor(){return{get(u,n){return n==="proxyOf"?u:n==="root"?()=>u.root().toProxy():u[n]},set(u,n,i){return u[n]===i||(u[n]=i,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&u.markDirty()),!0}}}markClean(){this[f]=!0}markDirty(){if(this[f]){this[f]=!1;let u=this;for(;u=u.parent;)u[f]=!1}}next(){if(!this.parent)return;let u=this.parent.index(this);return this.parent.nodes[u+1]}positionBy(u={}){let n="document"in this.source.input?this.source.input.document:this.source.input.css,i={column:this.source.start.column,line:this.source.start.line,offset:p(n,this.source.start)};if(u.index)i=this.positionInside(u.index);else if(u.word){let l=n.slice(p(n,this.source.start),this.rangeBy().end.offset).indexOf(u.word);l!==-1&&(i=this.positionInside(l))}return i}positionInside(u){let n=this.source.start.column,i=this.source.start.line,l="document"in this.source.input?this.source.input.document:this.source.input.css,s=p(l,this.source.start),a=s+u;for(let h=s;h<a;h++)l[h]===`\n`?(n=1,i+=1):n+=1;return{column:n,line:i,offset:a}}prev(){if(!this.parent)return;let u=this.parent.index(this);return this.parent.nodes[u-1]}rangeBy(u={}){let n="document"in this.source.input?this.source.input.document:this.source.input.css,i={column:this.source.start.column,line:this.source.start.line,offset:p(n,this.source.start)},l=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:p(n,this.source.end)+1}:{column:i.column+1,line:i.line,offset:i.offset+1};if(u.word){let s=n.slice(p(n,this.source.start),l.offset).indexOf(u.word);s!==-1&&(i=this.positionInside(s),l=this.positionInside(s+u.word.length))}else u.start?i={column:u.start.column,line:u.start.line,offset:p(n,u.start)}:typeof u.index=="number"&&(i=this.positionInside(u.index)),u.end?l={column:u.end.column,line:u.end.line,offset:p(n,u.end)}:typeof u.endIndex=="number"?l=this.positionInside(u.endIndex):typeof u.index=="number"&&(l=this.positionInside(u.index+1));return(l.line<i.line||l.line===i.line&&l.column<=i.column)&&(l={column:i.column+1,line:i.line,offset:i.offset+1}),{end:l,start:i}}raw(u,n){return new o().raw(this,u,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...u){if(this.parent){let n=this,i=!1;for(let l of u)l===this?i=!0:i?(this.parent.insertAfter(n,l),n=l):this.parent.insertBefore(n,l);i||this.remove()}return this}root(){let u=this;for(;u.parent&&u.parent.type!=="document";)u=u.parent;return u}toJSON(u,n){let i=n==null;n=n||new Map;let l=[],s=[[this,l,0]];for(let h=0;h<s.length;h++){let[y,b,v]=s[h],M={};b[v]=M;for(let x in y){if(!Object.prototype.hasOwnProperty.call(y,x)||x==="parent"||x==="proxyCache")continue;let C=y[x];if(Array.isArray(C)){let S=[];M[x]=S;for(let E=0;E<C.length;E++){let R=C[E];typeof R=="object"&&R.toJSON?R.toJSON===Qt.prototype.toJSON?s.push([R,S,E]):S[E]=R.toJSON(null,n):S[E]=R}}else if(typeof C=="object"&&C.toJSON)C.toJSON===Qt.prototype.toJSON?s.push([C,M,x]):M[x]=C.toJSON(null,n);else if(x==="source"){if(C==null)continue;let S=n.get(C.input);S==null&&(S=n.size,n.set(C.input,S)),M[x]={end:C.end,inputId:S,start:C.start}}else M[x]=C}}let a=l[0];return i&&(a.inputs=[...n.keys()].map(h=>h.toJSON())),a}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(u=c){u.stringify&&(u=u.stringify);let n="";return u(this,i=>{n+=i}),n}warn(u,n,i={}){let l={node:this};for(let s in i)l[s]=i[s];return u.warn(n,l)}};t.exports=m,m.default=m})),Nt=H(((e,t)=>{var r=Rt(),o=class extends r{constructor(c){super(c),this.type="comment"}};t.exports=o,o.default=o})),Ot=H(((e,t)=>{var r=Rt(),o=class extends r{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(c){c&&typeof c.value<"u"&&typeof c.value!="string"&&(c={...c,value:String(c.value)}),super(c),this.type="decl"}};t.exports=o,o.default=o})),De=H(((e,t)=>{var r=Nt(),o=Ot(),c=Rt(),{isClean:f,my:d}=Mt(),g,p,m,w;function u(l){let s=l.slice();for(;s.length>0;){let a=s.pop();if(delete a.source,a.nodes){a.nodes=a.nodes.slice();for(let h of a.nodes)s.push(h)}}return l.slice()}function n(l){let s=[l];for(;s.length>0;){let a=s.pop();if(a[f]=!1,a.proxyOf.nodes)for(let h of a.proxyOf.nodes)s.push(h)}}var i=class Zt extends c{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]}append(...s){for(let a of s){let h=this.normalize(a,this.last);for(let y of h)this.proxyOf.nodes.push(y)}return this.markDirty(),this}cleanRaws(s){let a=[this];for(;a.length>0;){let h=a.pop();if(h!==this&&h.cleanRaws!==Zt.prototype.cleanRaws){h.cleanRaws(s);continue}if(c.prototype.cleanRaws.call(h,s),h.nodes)for(let y of h.nodes)a.push(y)}}each(s){if(!this.proxyOf.nodes)return;let a=this.getIterator(),h,y;for(;this.indexes[a]<this.proxyOf.nodes.length&&(h=this.indexes[a],y=s(this.proxyOf.nodes[h],h),y!==!1);)this.indexes[a]+=1;return delete this.indexes[a],y}every(s){return this.nodes.every(s)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let s=this.lastEach;return this.indexes[s]=0,s}getProxyProcessor(){return{get(s,a){return a==="proxyOf"?s:s[a]?a==="each"||typeof a=="string"&&a.startsWith("walk")?(...h)=>s[a](...h.map(y=>typeof y=="function"?(b,v)=>y(b.toProxy(),v):y)):a==="every"||a==="some"?h=>s[a]((y,...b)=>h(y.toProxy(),...b)):a==="root"?()=>s.root().toProxy():a==="nodes"?s.nodes.map(h=>h.toProxy()):a==="first"||a==="last"?s[a].toProxy():s[a]:s[a]},set(s,a,h){return s[a]===h||(s[a]=h,(a==="name"||a==="params"||a==="selector")&&s.markDirty()),!0}}}index(s){return typeof s=="number"?s:(s.proxyOf&&(s=s.proxyOf),this.proxyOf.nodes.indexOf(s))}insertAfter(s,a){let h=this.index(s),y=this.normalize(a,this.proxyOf.nodes[h]).reverse();h=this.index(s);for(let v of y)this.proxyOf.nodes.splice(h+1,0,v);let b;for(let v in this.indexes)b=this.indexes[v],h<b&&(this.indexes[v]=b+y.length);return this.markDirty(),this}insertBefore(s,a){let h=this.index(s),y=h===0?"prepend":!1,b=this.normalize(a,this.proxyOf.nodes[h],y).reverse();h=this.index(s);for(let M of b)this.proxyOf.nodes.splice(h,0,M);let v;for(let M in this.indexes)v=this.indexes[M],h<=v&&(this.indexes[M]=v+b.length);return this.markDirty(),this}normalize(s,a){if(typeof s=="string")s=u(p(s).nodes);else if(typeof s>"u")s=[];else if(Array.isArray(s)){s=s.slice(0);for(let h of s)h.parent&&h.parent.removeChild(h,"ignore")}else if(s.type==="root"&&this.type!=="document"){s=s.nodes.slice(0);for(let h of s)h.parent&&h.parent.removeChild(h,"ignore")}else if(s.type)s=[s];else if(s.prop){if(typeof s.value>"u")throw new Error("Value field is missed in node creation");typeof s.value!="string"&&(s.value=String(s.value)),s=[new o(s)]}else if(s.selector||s.selectors)s=[new w(s)];else if(s.name)s=[new g(s)];else if(s.text)s=[new r(s)];else throw new Error("Unknown node type in node creation");return s.map(h=>(h[d]||Zt.rebuild(h),h=h.proxyOf,h.parent&&h.parent.removeChild(h),h[f]&&n(h),h.raws||(h.raws={}),typeof h.raws.before>"u"&&a&&typeof a.raws.before<"u"&&(h.raws.before=a.raws.before.replace(/\\S/g,"")),h.parent=this.proxyOf,h))}prepend(...s){s=s.reverse();for(let a of s){let h=this.normalize(a,this.first,"prepend").reverse();for(let y of h)this.proxyOf.nodes.unshift(y);for(let y in this.indexes)this.indexes[y]=this.indexes[y]+h.length}return this.markDirty(),this}push(s){return s.parent=this,this.proxyOf.nodes.push(s),this}removeAll(){for(let s of this.proxyOf.nodes)s.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(s){s=this.index(s),this.proxyOf.nodes[s].parent=void 0,this.proxyOf.nodes.splice(s,1);let a;for(let h in this.indexes)a=this.indexes[h],a>=s&&(this.indexes[h]=a-1);return this.markDirty(),this}replaceValues(s,a,h){return h||(h=a,a={}),this.walkDecls(y=>{a.props&&!a.props.includes(y.prop)||a.fast&&!y.value.includes(a.fast)||(y.value=y.value.replace(s,h))}),this.markDirty(),this}some(s){return this.nodes.some(s)}walk(s){if(!this.proxyOf.nodes)return;let a=[{iterator:this.getIterator(),node:this.proxyOf}];for(;a.length>0;){let{iterator:h,node:y}=a[a.length-1],b=y.indexes[h];if(b>=y.proxyOf.nodes.length){delete y.indexes[h],a.pop();let x=a[a.length-1];x&&(x.node.indexes[x.iterator]+=1);continue}let v=y.proxyOf.nodes[b],M;try{M=s(v,b)}catch(x){throw v.addToError(x)}if(M===!1){for(let x of a)delete x.node.indexes[x.iterator];return!1}v.walk&&v.proxyOf.nodes?a.push({iterator:v.getIterator(),node:v}):y.indexes[h]+=1}}walkAtRules(s,a){return a?s instanceof RegExp?this.walk((h,y)=>{if(h.type==="atrule"&&s.test(h.name))return a(h,y)}):this.walk((h,y)=>{if(h.type==="atrule"&&h.name===s)return a(h,y)}):(a=s,this.walk((h,y)=>{if(h.type==="atrule")return a(h,y)}))}walkComments(s){return this.walk((a,h)=>{if(a.type==="comment")return s(a,h)})}walkDecls(s,a){return a?s instanceof RegExp?this.walk((h,y)=>{if(h.type==="decl"&&s.test(h.prop))return a(h,y)}):this.walk((h,y)=>{if(h.type==="decl"&&h.prop===s)return a(h,y)}):(a=s,this.walk((h,y)=>{if(h.type==="decl")return a(h,y)}))}walkRules(s,a){return a?s instanceof RegExp?this.walk((h,y)=>{if(h.type==="rule"&&s.test(h.selector))return a(h,y)}):this.walk((h,y)=>{if(h.type==="rule"&&h.selector===s)return a(h,y)}):(a=s,this.walk((h,y)=>{if(h.type==="rule")return a(h,y)}))}};i.registerParse=l=>{p=l},i.registerRule=l=>{w=l},i.registerAtRule=l=>{g=l},i.registerRoot=l=>{m=l},t.exports=i,i.default=i,i.rebuild=l=>{let s=[l];for(;s.length>0;){let a=s.pop();if(a.type==="atrule"?Object.setPrototypeOf(a,g.prototype):a.type==="rule"?Object.setPrototypeOf(a,w.prototype):a.type==="decl"?Object.setPrototypeOf(a,o.prototype):a.type==="comment"?Object.setPrototypeOf(a,r.prototype):a.type==="root"&&Object.setPrototypeOf(a,m.prototype),a[d]=!0,a.nodes)for(let h of a.nodes)s.push(h)}}})),pr=H(((e,t)=>{var r=De(),o=class extends r{constructor(c){super(c),this.type="atrule"}append(...c){return this.proxyOf.nodes||(this.nodes=[]),super.append(...c)}prepend(...c){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...c)}};t.exports=o,o.default=o,r.registerAtRule(o)})),mr=H(((e,t)=>{var r=De(),o,c,f=class extends r{constructor(d){super({type:"document",...d}),this.nodes||(this.nodes=[])}toResult(d={}){return new o(new c,this,d).stringify()}};f.registerLazyResult=d=>{o=d},f.registerProcessor=d=>{c=d},t.exports=f,f.default=f})),Qn=H(((e,t)=>{var r="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",o=(f,d=21)=>(g=d)=>{let p="",m=g|0;for(;m-- >0;)p+=f[Math.random()*f.length|0];return p},c=(f=21)=>{let d="",g=f|0;for(;g-- >0;)d+=r[Math.random()*64|0];return d};t.exports={nanoid:c,customAlphabet:o}})),Ts=H(((e,t)=>{var{existsSync:r,readFileSync:o,realpathSync:c}=ye(),{dirname:f,isAbsolute:d,join:g,relative:p,sep:m}=ye(),{SourceMapConsumer:w,SourceMapGenerator:u}=ye();function n(s){try{return c(s)}catch{return s}}function i(s){return Buffer?Buffer.from(s,"base64").toString():window.atob(s)}var l=class{constructor(s,a){if(a.map===!1)return;a.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(s),this.inline=this.startWith(this.annotation,"data:");let h=a.map?a.map.prev:void 0,y=this.loadMap(a.from,h);!this.mapFile&&a.from&&(this.mapFile=a.from),this.mapFile&&(this.root=f(this.mapFile)),y&&(this.text=y)}consumer(){return this.consumerCache||(this.consumerCache=new w(this.json||this.text)),this.consumerCache}decodeInline(s){let a=/^data:application\\/json;charset=utf-?8;base64,/,h=/^data:application\\/json;base64,/,y=s.match(/^data:application\\/json;charset=utf-?8,/)||s.match(/^data:application\\/json,/);if(y)return decodeURIComponent(s.substr(y[0].length));let b=s.match(a)||s.match(h);if(b)return i(s.substr(b[0].length));let v=s.slice(22);throw v=v.slice(0,v.indexOf(",")),new Error("Unsupported source map encoding "+v)}getAnnotationURL(s){return s.replace(/^\\/\\*\\s*# sourceMappingURL=/,"").trim()}isMap(s){return typeof s!="object"?!1:typeof s.mappings=="string"||typeof s._mappings=="string"||Array.isArray(s.sections)}loadAnnotation(s){let a=s.match(/\\/\\*\\s*# sourceMappingURL=/g);if(!a)return;let h=s.lastIndexOf(a.pop()),y=s.indexOf("*/",h);h>-1&&y>-1&&(this.annotation=this.getAnnotationURL(s.substring(h,y)))}loadFile(s,a,h){if(!h&&!this.unsafeMap){if(!/\\.map$/i.test(s)||!a)return;let y=p(n(f(a)),n(s));if(y===".."||y.startsWith(".."+m)||d(y))return}if(this.root=f(s),r(s))return this.mapFile=s,o(s,"utf-8").toString().trim()}loadMap(s,a){if(a===!1)return!1;if(a){if(typeof a=="string")return a;if(typeof a=="function"){let h=a(s);if(h){let y=this.loadFile(h,s,!0);if(!y)throw new Error("Unable to load previous source map: "+h.toString());return y}}else{if(a instanceof w)return u.fromSourceMap(a).toString();if(a instanceof u)return a.toString();if(this.isMap(a))return JSON.stringify(a);throw new Error("Unsupported previous source map format: "+a.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let h=this.annotation;s&&(h=g(f(s),h));let y=this.loadFile(h,s,!1);if(y)try{this.json=JSON.parse(y.replace(/^\\)]}\'[^\\n]*\\n/,""))}catch{return}return y}}}startWith(s,a){return s?s.substr(0,a.length)===a:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};t.exports=l,l.default=l})),It=H(((e,t)=>{var{nanoid:r}=Qn(),{isAbsolute:o,resolve:c}=ye(),{SourceMapConsumer:f,SourceMapGenerator:d}=ye(),{fileURLToPath:g,pathToFileURL:p}=ye(),m=dr(),w=Ts(),u=ye(),n=Symbol("lineToIndexCache"),i=!!(f&&d),l=!!(c&&o);function s(h){if(h[n])return h[n];let y=h.css.split(`\n`),b=new Array(y.length),v=0;for(let M=0,x=y.length;M<x;M++)b[M]=v,v+=y[M].length+1;return h[n]=b,b}var a=class{get from(){return this.file||this.id}constructor(h,y={}){if(h===null||typeof h>"u"||typeof h=="object"&&!h.toString)throw new Error(`PostCSS received ${h} instead of CSS string`);if(this.css=h.toString(),this.css[0]==="\\uFEFF"||this.css[0]==="\\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,y.document&&(this.document=y.document.toString()),y.from&&(!l||/^\\w+:\\/\\//.test(y.from)||o(y.from)?this.file=y.from:this.file=c(y.from)),l&&i){let b=new w(this.css,y);if(b.text){this.map=b;let v=b.consumer().file;!this.file&&v&&(this.file=this.mapResolve(v))}}this.file||(this.id="<input css "+r(6)+">"),this.map&&(this.map.file=this.from)}error(h,y,b,v={}){let M,x,C,S,E;if(y&&typeof y=="object"){let I=y,N=b;if(typeof I.offset=="number"){S=I.offset;let A=this.fromOffset(S);y=A.line,b=A.col}else y=I.line,b=I.column,S=this.fromLineAndColumn(y,b);if(typeof N.offset=="number"){C=N.offset;let A=this.fromOffset(C);x=A.line,M=A.col}else x=N.line,M=N.column,C=this.fromLineAndColumn(N.line,N.column)}else if(b)S=this.fromLineAndColumn(y,b);else{S=y;let I=this.fromOffset(S);y=I.line,b=I.col}let R=this.origin(y,b,x,M);return R?E=new m(h,R.endLine===void 0?R.line:{column:R.column,line:R.line},R.endLine===void 0?R.column:{column:R.endColumn,line:R.endLine},R.source,R.file,v.plugin):E=new m(h,x===void 0?y:{column:b,line:y},x===void 0?b:{column:M,line:x},this.css,this.file,v.plugin),E.input={column:b,endColumn:M,endLine:x,endOffset:C,line:y,offset:S,source:this.css},this.file&&(p&&(E.input.url=p(this.file).toString()),E.input.file=this.file),E}fromLineAndColumn(h,y){return s(this)[h-1]+y-1}fromOffset(h){let y=s(this),b=y[y.length-1],v=0;if(h>=b)v=y.length-1;else{let M=y.length-2,x;for(;v<M;)if(x=v+(M-v>>1),h<y[x])M=x-1;else if(h>=y[x+1])v=x+1;else{v=x;break}}return{col:h-y[v]+1,line:v+1}}mapResolve(h){return/^\\w+:\\/\\//.test(h)?h:c(this.map.consumer().sourceRoot||this.map.root||".",h)}origin(h,y,b,v){if(!this.map)return!1;let M=this.map.consumer(),x=M.originalPositionFor({column:y-1,line:h});if(!x.source)return!1;let C;if(typeof b=="number"){let I=M.originalPositionFor({column:v-1,line:b});I.source&&(C=I)}let S;o(x.source)?S=p(x.source):S=new URL(x.source,p(this.map.mapFile||c(".")+"/"));let E={column:x.column+1,endColumn:C&&C.column+1,endLine:C&&C.line,line:x.line,url:S.toString()};if(S.protocol==="file:")if(g)E.file=g(S);else throw new Error("file: protocol is not available in this PostCSS build");let R=M.sourceContentFor(x.source);return R&&(E.source=R),E}toJSON(){let h={};for(let y of["hasBOM","css","file","id"])this[y]!=null&&(h[y]=this[y]);return this.map&&(h.map={...this.map},h.map.consumerCache&&(h.map.consumerCache=void 0)),h}};t.exports=a,a.default=a,u&&u.registerInput&&u.registerInput(a)})),at=H(((e,t)=>{var r=De(),o,c,f=class extends r{constructor(d){super(d),this.type="root",this.nodes||(this.nodes=[])}normalize(d,g,p){let m=new Set;for(let u of Array.isArray(d)?d:[d])u&&typeof u=="object"&&!u.parent&&u.raws&&typeof u.raws.before<"u"&&m.add(u.raws);let w=super.normalize(d);if(g){if(p==="prepend")this.nodes.length>1?g.raws.before=this.nodes[1].raws.before:delete g.raws.before;else if(this.first!==g)for(let u of w)m.has(u.raws)||(u.raws.before=g.raws.before)}return w}removeChild(d,g){let p=this.index(d);return!g&&p===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[p].raws.before),super.removeChild(d)}toResult(d={}){return new o(new c,this,d).stringify()}};f.registerLazyResult=d=>{o=d},f.registerProcessor=d=>{c=d},t.exports=f,f.default=f,r.registerRoot(f)})),_s=H(((e,t)=>{var r={comma(o){return r.split(o,[","],!0)},space(o){return r.split(o,[" ",`\n`," "])},split(o,c,f){if(typeof o!="string")return[];let d=[],g="",p=!1,m=0,w=!1,u="",n=!1,i=!1;for(let s=0;s<o.length;s++){let a=o[s];if(i){g+=a,a==="*"&&o[s+1]==="/"&&(g+="/",s+=1,i=!1);continue}if(n)n=!1;else if(a==="\\\\")n=!0;else if(w)a===u&&(w=!1);else if(a===\'"\'||a==="\'")w=!0,u=a;else if(a==="/"&&o[s+1]==="*"){g+="/*",s+=1,i=!0;continue}else a==="("?m+=1:a===")"?m>0&&(m-=1):m===0&&c.includes(a)&&(p=!0);if(p){let h=g.trim();(f||h!=="")&&d.push(h),g="",p=!1}else g+=a}let l=g.trim();return(f||l!=="")&&d.push(l),d}};t.exports=r,r.default=r})),gr=H(((e,t)=>{var r=De(),o=_s(),c=class extends r{get selectors(){return o.comma(this.selector)}set selectors(f){let d=this.selector?this.selector.match(/,\\s*/):null,g=d?d[0]:","+this.raw("between","beforeOpen");this.selector=f.join(g)}constructor(f){super(f),this.type="rule",this.nodes||(this.nodes=[])}};t.exports=c,c.default=c,r.registerRule(c)})),Zn=H(((e,t)=>{var r=pr(),o=Nt(),c=Ot(),f=It(),d=Ts(),g=at(),p=gr();function m(n,i){return n.inputs?n.inputs.map(l=>{let s={...l,__proto__:f.prototype};return s.map&&(s.map={...s.map,__proto__:d.prototype}),s}):i}function w(n,i,l){let s={...n};if(delete s.inputs,delete s.nodes,s.source){let{inputId:h,...y}=s.source;s.source=y,h!=null&&(s.source.input=i[h])}let a;if(s.type==="root")a=new g(s);else if(s.type==="decl")a=new c(s);else if(s.type==="rule")a=new p(s);else if(s.type==="comment")a=new o(s);else if(s.type==="atrule")a=new r(s);else throw new Error("Unknown node type: "+n.type);if(l){a.nodes=l;for(let h of l)h.parent=a}return a}function u(n,i){if(Array.isArray(n))return n.map(a=>u(a));let l,s=[{childIndex:0,children:[],inputs:m(n,i),json:n}];for(;s.length>0;){let a=s[s.length-1],h=a.json.nodes;if(h&&a.childIndex<h.length){let b=h[a.childIndex];a.childIndex+=1,s.push({childIndex:0,children:[],inputs:m(b,a.inputs),json:b});continue}s.pop();let y=w(a.json,a.inputs,h?a.children:void 0);s.length>0?s[s.length-1].children.push(y):l=y}return l}t.exports=u,u.default=u})),Ls=H(((e,t)=>{var{dirname:r,relative:o,resolve:c,sep:f}=ye(),{SourceMapConsumer:d,SourceMapGenerator:g}=ye(),{pathToFileURL:p}=ye(),m=It(),w=!!(d&&g),u=!!(r&&c&&o&&f),n=class{constructor(i,l,s,a){this.stringify=i,this.mapOpts=s.map||{},this.root=l,this.opts=s,this.css=a,this.originalCSS=a,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let i;this.isInline()?i="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?i=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?i=this.mapOpts.annotation(this.opts.to,this.root):i=this.outputFile()+".map";let l=`\n`;this.css.includes(`\\r\n`)&&(l=`\\r\n`),this.css+=l+"/*# sourceMappingURL="+i+" */"}applyPrevMaps(){for(let i of this.previous()){let l=this.toUrl(this.path(i.file)),s=i.root||r(i.file),a;this.mapOpts.sourcesContent===!1?(a=new d(i.text),a.sourcesContent&&(a.sourcesContent=null)):a=i.consumer(),this.map.applySourceMap(a,l,this.toUrl(this.path(s)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let i;for(let l=this.root.nodes.length-1;l>=0;l--)i=this.root.nodes[l],i.type==="comment"&&i.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(l)}else if(this.css){let i="/*# sourceMappingURL=",l="",s=0,a;for(;(a=this.css.indexOf(i,s))!==-1;){let h=this.css.indexOf("*/",a+21);if(h===-1)break;for(;a>s&&this.css[a-1]===`\n`;)a--;l+=this.css.slice(s,a),s=h+2}s>0&&(this.css=l+this.css.slice(s))}}}generate(){if(this.clearAnnotation(),u&&w&&this.isMap())return this.generateMap();{let i="";return this.stringify(this.root,l=>{i+=l}),[i]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let i=this.previous()[0].consumer();i.file=this.outputFile(),this.map=g.fromSourceMap(i,{ignoreInvalidMapping:!0})}else this.map=new g({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 g({file:this.outputFile(),ignoreInvalidMapping:!0});let i=1,l=1,s="<no source>",a={generated:{column:0,line:0},original:{column:0,line:0},source:""},h,y;this.stringify(this.root,(b,v,M)=>{if(this.css+=b,v&&M!=="end"&&(a.generated.line=i,a.generated.column=l-1,v.source&&v.source.start?(a.source=this.sourcePath(v),a.original.line=v.source.start.line,a.original.column=v.source.start.column-1,this.map.addMapping(a)):(a.source=s,a.original.line=1,a.original.column=0,this.map.addMapping(a))),y=b.match(/\\n/g),y?(i+=y.length,h=b.lastIndexOf(`\n`),l=b.length-h):l+=b.length,v&&M!=="start"){let x=v.parent||{raws:{}};(!(v.type==="decl"||v.type==="atrule"&&!v.nodes)||v!==x.last||x.raws.semicolon)&&(v.source&&v.source.end?(a.source=this.sourcePath(v),a.original.line=v.source.end.line,a.original.column=v.source.end.column-1,a.generated.line=i,a.generated.column=l-2,this.map.addMapping(a)):(a.source=s,a.original.line=1,a.original.column=0,a.generated.line=i,a.generated.column=l-1,this.map.addMapping(a)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(i=>i.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let i=this.mapOpts.annotation;return typeof i<"u"&&i!==!0?!1:this.previous().length?this.previous().some(l=>l.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(i=>i.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(i){if(this.mapOpts.absolute||i.charCodeAt(0)===60||/^\\w+:\\/\\//.test(i))return i;let l=this.memoizedPaths.get(i);if(l)return l;let s=this.opts.to?r(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(s=r(c(s,this.mapOpts.annotation)));let a=o(s,i);return this.memoizedPaths.set(i,a),a}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(i=>{if(i.source&&i.source.input.map){let l=i.source.input.map;this.previousMaps.includes(l)||this.previousMaps.push(l)}});else{let i=new m(this.originalCSS,this.opts);i.map&&this.previousMaps.push(i.map)}return this.previousMaps}setSourcesContent(){let i={};if(this.root)this.root.walk(l=>{if(l.source){let s=l.source.input.from;if(s&&!i[s]){i[s]=!0;let a=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(a,l.source.input.css)}}});else if(this.css){let l=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(l,this.css)}}sourcePath(i){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(i.source.input.from):this.toUrl(this.path(i.source.input.from))}toBase64(i){return Buffer?Buffer.from(i).toString("base64"):window.btoa(unescape(encodeURIComponent(i)))}toFileUrl(i){let l=this.memoizedFileURLs.get(i);if(l)return l;if(p){let s=p(i).toString();return this.memoizedFileURLs.set(i,s),s}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(i){let l=this.memoizedURLs.get(i);if(l)return l;f==="\\\\"&&(i=i.replace(/\\\\/g,"/"));let s=encodeURI(i).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(i,s),s}};t.exports=n})),Kn=H(((e,t)=>{var r=39,o=34,c=92,f=47,d=10,g=32,p=12,m=9,w=13,u=91,n=93,i=40,l=41,s=123,a=125,h=59,y=42,b=58,v=64,M=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,x=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,C=/.[\\r\\n"\'(/\\\\]/,S=/[\\da-f]/i;t.exports=function(R,I={}){let N=R.css.valueOf(),A=I.ignoreErrors,L,ae,V,O,re,F,Z,se,ee,ve,be=N.length,D=0,Se=[],ie=[],le=-1;function _e(){return D}function he(Y){throw R.error("Unclosed "+Y,D)}function z(){return ie.length===0&&D>=be}function ue(Y){if(ie.length)return ie.pop();if(D>=be)return;let te=Y?Y.ignoreUnclosed:!1;switch(L=N.charCodeAt(D),L){case d:case g:case m:case w:case p:O=D;do O+=1,L=N.charCodeAt(O);while(L===g||L===d||L===m||L===w||L===p);F=["space",N.slice(D,O)],D=O-1;break;case u:case n:case s:case a:case b:case h:case l:{let k=String.fromCharCode(L);F=[k,k,D];break}case i:if(ve=Se.length?Se.pop()[1]:"",ee=N.charCodeAt(D+1),ve==="url"&&ee!==r&&ee!==o&&ee!==g&&ee!==d&&ee!==m&&ee!==p&&ee!==w){O=D;do{if(Z=!1,O=N.indexOf(")",O+1),O===-1)if(A||te){O=D;break}else he("bracket");for(se=O;N.charCodeAt(se-1)===c;)se-=1,Z=!Z}while(Z);F=["brackets",N.slice(D,O+1),D,O],D=O}else D<=le?F=["(","(",D]:(O=N.indexOf(")",D+1),ae=N.slice(D,O+1),O===-1||C.test(ae)?(le=O===-1?be:O,F=["(","(",D]):(F=["brackets",ae,D,O],D=O));break;case r:case o:re=L===r?"\'":\'"\',O=D;do{if(Z=!1,O=N.indexOf(re,O+1),O===-1)if(A||te){O=D+1;break}else he("string");for(se=O;N.charCodeAt(se-1)===c;)se-=1,Z=!Z}while(Z);F=["string",N.slice(D,O+1),D,O],D=O;break;case v:M.lastIndex=D+1,M.test(N),M.lastIndex===0?O=N.length-1:O=M.lastIndex-2,F=["at-word",N.slice(D,O+1),D,O],D=O;break;case c:for(O=D,V=!0;N.charCodeAt(O+1)===c;)O+=1,V=!V;if(L=N.charCodeAt(O+1),V&&L!==f&&L!==g&&L!==d&&L!==m&&L!==w&&L!==p&&(O+=1,S.test(N.charAt(O)))){for(;S.test(N.charAt(O+1));)O+=1;N.charCodeAt(O+1)===g&&(O+=1)}F=["word",N.slice(D,O+1),D,O],D=O;break;default:L===f&&N.charCodeAt(D+1)===y?(O=N.indexOf("*/",D+2)+1,O===0&&(A||te?O=N.length:he("comment")),F=["comment",N.slice(D,O+1),D,O],D=O):(x.lastIndex=D+1,x.test(N),x.lastIndex===0?O=N.length-1:O=x.lastIndex-2,F=["word",N.slice(D,O+1),D,O],Se.push(F),D=O)}return D++,F}function U(Y){ie.push(Y)}return{back:U,endOfFile:z,nextToken:ue,position:_e}}})),eo=H(((e,t)=>{var r=pr(),o=Nt(),c=Ot(),f=at(),d=gr(),g=Kn(),p={empty:!0,space:!0};function m(n){for(let i=n.length-1;i>=0;i--){let l=n[i],s=l[3]||l[2];if(s)return s}}function w(n,i,l){let s="";for(let a=i;a<l;a++)s+=n[a][1];return s}var u=class{constructor(n){this.input=n,this.root=new f,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:n,start:{column:1,line:1,offset:0}}}atrule(n){let i=new r;i.name=n[1].slice(1),i.name===""&&this.unnamedAtrule(i,n),this.init(i,n[2]);let l,s,a,h=!1,y=!1,b=[],v=[];for(;!this.tokenizer.endOfFile();){if(n=this.tokenizer.nextToken(),l=n[0],l==="("||l==="["?v.push(l==="("?")":"]"):l==="{"&&v.length>0?v.push("}"):l===v[v.length-1]&&v.pop(),v.length===0)if(l===";"){i.source.end=this.getPosition(n[2]),i.source.end.offset++,this.semicolon=!0;break}else if(l==="{"){y=!0;break}else if(l==="}"){if(b.length>0){for(a=b.length-1,s=b[a];s&&s[0]==="space";)s=b[--a];s&&(i.source.end=this.getPosition(s[3]||s[2]),i.source.end.offset++)}this.end(n);break}else b.push(n);else b.push(n);if(this.tokenizer.endOfFile()){h=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(b),b.length?(i.raws.afterName=this.spacesAndCommentsFromStart(b),this.raw(i,"params",b),h&&(n=b[b.length-1],i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),y&&(i.nodes=[],this.current=i)}checkMissedSemicolon(n){let i=this.colon(n);if(i===!1)return;let l=0,s;for(let a=i-1;a>=0&&(s=n[a],!(s[0]!=="space"&&(l+=1,l===2)));a--);throw this.input.error("Missed semicolon",s[0]==="word"?s[3]+1:s[2])}colon(n){let i=0,l,s,a;for(let[h,y]of n.entries()){if(s=y,a=s[0],a==="("&&(i+=1),a===")"&&(i-=1),i===0&&a===":")if(!l)this.doubleColon(s);else{if(l[0]==="word"&&l[1]==="progid")continue;return h}l=s}return!1}comment(n){let i=new o;this.init(i,n[2]),i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++;let l=n[1].slice(2,-2);if(!l.trim())i.text="",i.raws.left=l,i.raws.right="";else{let s=l.match(/^(\\s*)([^]*\\S)(\\s*)$/);i.text=s[2],i.raws.left=s[1],i.raws.right=s[3]}}createTokenizer(){this.tokenizer=g(this.input)}decl(n,i){let l=new c;this.init(l,n[0][2]);let s=n[n.length-1];s[0]===";"&&(this.semicolon=!0,n.pop()),l.source.end=this.getPosition(s[3]||s[2]||m(n)),l.source.end.offset++;let a=0;for(;n[a][0]!=="word";)a===n.length-1&&this.unknownWord([n[a]]),a++;l.raws.before+=w(n,0,a),l.source.start=this.getPosition(n[a][2]);let h=a;for(;a<n.length;){let x=n[a][0];if(x===":"||x==="space"||x==="comment")break;a++}l.prop=w(n,h,a);let y=a,b;for(;a<n.length&&(b=n[a],a++,b[0]!==":");)b[0]==="word"&&/\\w/.test(b[1])&&this.unknownWord([b]);l.raws.between=w(n,y,a),(l.prop[0]==="_"||l.prop[0]==="*")&&(l.raws.before+=l.prop[0],l.prop=l.prop.slice(1));let v=a;for(;a<n.length;){let x=n[a][0];if(x!=="space"&&x!=="comment")break;a++}let M=n.slice(v,a);n=n.slice(a),this.precheckMissedSemicolon(n);for(let x=n.length-1;x>=0;x--){if(b=n[x],b[1].toLowerCase()==="!important"){l.important=!0;let C=this.stringFrom(n,x);C=this.spacesFromEnd(n)+C,C!==" !important"&&(l.raws.important=C);break}else if(b[1].toLowerCase()==="important"){let C=n.slice(0),S="";for(let E=x;E>0;E--){let R=C[E][0];if(S.trim().startsWith("!")&&R!=="space")break;S=C.pop()[1]+S}S.trim().startsWith("!")&&(l.important=!0,l.raws.important=S,n=C)}if(b[0]!=="space"&&b[0]!=="comment")break}n.some(x=>x[0]!=="space"&&x[0]!=="comment")&&(l.raws.between+=M.map(x=>x[1]).join(""),M=[]),this.raw(l,"value",M.concat(n),i),l.value.includes(":")&&!i&&this.checkMissedSemicolon(n)}doubleColon(n){throw this.input.error("Double colon",{offset:n[2]},{offset:n[2]+n[1].length})}emptyRule(n){let i=new d;this.init(i,n[2]),i.selector="",i.raws.between="",this.current=i}end(n){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(n[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(n)}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(n){if(this.spaces+=n[1],this.current.nodes){let i=this.current.nodes[this.current.nodes.length-1];i&&i.type==="rule"&&!i.raws.ownSemicolon&&(i.raws.ownSemicolon=this.spaces,this.spaces="",i.source.end=this.getPosition(n[2]),i.source.end.offset++)}}getPosition(n){let i=this.input.fromOffset(n);return{column:i.col,line:i.line,offset:n}}init(n,i){this.current.push(n),n.source={input:this.input,start:this.getPosition(i)},n.raws.before=this.spaces,this.spaces="",n.type!=="comment"&&(this.semicolon=!1)}other(n){let i=!1,l=null,s=!1,a=null,h=[],y=n[1].startsWith("--"),b=[],v=n;for(;v;){if(l=v[0],b.push(v),l==="("||l==="[")a||(a=v),h.push(l==="("?")":"]");else if(y&&s&&l==="{")a||(a=v),h.push("}");else if(h.length===0)if(l===";")if(s){this.decl(b,y);return}else break;else if(l==="{"){this.rule(b);return}else if(l==="}"){this.tokenizer.back(b.pop()),i=!0;break}else l===":"&&(s=!0);else l===h[h.length-1]&&(h.pop(),h.length===0&&(a=null));v=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(i=!0),h.length>0&&this.unclosedBracket(a),i&&s){if(!y)for(;b.length&&(v=b[b.length-1][0],!(v!=="space"&&v!=="comment"));)this.tokenizer.back(b.pop());this.decl(b,y)}else this.unknownWord(b)}parse(){let n;for(;!this.tokenizer.endOfFile();)switch(n=this.tokenizer.nextToken(),n[0]){case"space":this.spaces+=n[1];break;case";":this.freeSemicolon(n);break;case"}":this.end(n);break;case"comment":this.comment(n);break;case"at-word":this.atrule(n);break;case"{":this.emptyRule(n);break;default:this.other(n)}this.endFile()}precheckMissedSemicolon(){}raw(n,i,l,s){let a,h,y=l.length,b="",v="",M=!0,x,C;for(let S=0;S<y;S+=1)a=l[S],h=a[0],h==="space"&&S===y-1&&!s?M=!1:h==="comment"?(C=l[S-1]?l[S-1][0]:"empty",x=l[S+1]?l[S+1][0]:"empty",!p[C]&&!p[x]?v===","?M=!1:(b+=a[1],v=a[1].slice(-1)):M=!1):(b+=a[1],v=a[1].slice(-1));if(!M){let S=l.reduce((E,R)=>E+R[1],"");n.raws[i]={raw:S,value:b}}n[i]=b}rule(n){n.pop();let i=new d;this.init(i,n[0][2]),i.raws.between=this.spacesAndCommentsFromEnd(n),this.raw(i,"selector",n),this.current=i}spacesAndCommentsFromEnd(n){let i,l="";for(;n.length&&(i=n[n.length-1][0],!(i!=="space"&&i!=="comment"));)l=n.pop()[1]+l;return l}spacesAndCommentsFromStart(n){let i,l="";for(;n.length&&(i=n[0][0],!(i!=="space"&&i!=="comment"));)l+=n.shift()[1];return l}spacesFromEnd(n){let i,l="";for(;n.length&&(i=n[n.length-1][0],i==="space");)l=n.pop()[1]+l;return l}stringFrom(n,i){let l="";for(let s=i;s<n.length;s++)l+=n[s][1];return n.splice(i,n.length-i),l}unclosedBlock(){let n=this.current.source.start;throw this.input.error("Unclosed block",n.line,n.column)}unclosedBracket(n){throw this.input.error("Unclosed bracket",{offset:n[2]},{offset:n[2]+1})}unexpectedClose(n){throw this.input.error("Unexpected }",{offset:n[2]},{offset:n[2]+1})}unknownWord(n){throw this.input.error("Unknown word "+n[0][1],{offset:n[0][2]},{offset:n[0][2]+n[0][1].length})}unnamedAtrule(n,i){throw this.input.error("At-rule without name",{offset:i[2]},{offset:i[2]+i[1].length})}};t.exports=u})),yr=H(((e,t)=>{var r=De(),o=It(),c=eo();function f(d,g){let p=new c(new o(d,g));try{p.parse()}catch(m){throw m}return p.root}t.exports=f,f.default=f,r.registerParse(f)})),ks=H(((e,t)=>{var r=De(),{my:o}=Mt(),c=class{constructor(f,d={}){if(this.type="warning",this.text=f,d.node&&d.node.source){d.node[o]||r.rebuild(d.node);let g=d.node.rangeBy(d);this.line=g.start.line,this.column=g.start.column,this.endLine=g.end.line,this.endColumn=g.end.column}for(let g in d)this[g]=d[g]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,start:this.start,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};t.exports=c,c.default=c})),wr=H(((e,t)=>{var r=ks(),o=class{get content(){return this.css}constructor(c,f,d){this.processor=c,this.messages=[],this.root=f,this.opts=d,this.css="",this.map=void 0}toString(){return this.css}warn(c,f={}){f.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(f.plugin=this.lastPlugin.postcssPlugin);let d=new r(c,f);return this.messages.push(d),d}warnings(){return this.messages.filter(c=>c.type==="warning")}};t.exports=o,o.default=o})),Ps=H(((e,t)=>{var r={};t.exports=function(c){r[c]||(r[c]=!0,typeof console<"u"&&console.warn&&console.warn(c))}})),Fs=H(((e,t)=>{var r=De(),o=mr(),c=Ls(),f=yr(),d=wr(),g=at(),p=Et(),{isClean:m,my:w}=Mt(),u=Ps(),n={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},i={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},l={Once:!0,postcssPlugin:!0,prepare:!0},s=0;function a(x){return typeof x=="object"&&typeof x.then=="function"}function h(x){let C=!1,S=n[x.type];return x.type==="decl"?C=x.prop.toLowerCase():x.type==="atrule"&&(C=x.name.toLowerCase()),C&&x.append?[S,S+"-"+C,s,S+"Exit",S+"Exit-"+C]:C?[S,S+"-"+C,S+"Exit",S+"Exit-"+C]:x.append?[S,s,S+"Exit"]:[S,S+"Exit"]}function y(x){let C;return x.type==="document"?C=["Document",s,"DocumentExit"]:x.type==="root"?C=["Root",s,"RootExit"]:C=h(x),{eventIndex:0,events:C,iterator:0,node:x,visitorIndex:0,visitors:[]}}function b(x){let C=[x];for(;C.length>0;){let S=C.pop();if(S[m]=!1,S.nodes)for(let E of S.nodes)C.push(E)}return x}var v={},M=class Us{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"}constructor(C,S,E){this.stringified=!1,this.processed=!1;let R;if(typeof S=="object"&&S!==null&&(S.type==="root"||S.type==="document"))R=b(S);else if(S instanceof Us||S instanceof d)R=b(S.root),S.map&&(typeof E.map>"u"&&(E.map={}),E.map.inline||(E.map.inline=!1),E.map.prev=S.map);else{let I=f;E.syntax&&(I=E.syntax.parse),E.parser&&(I=E.parser),I.parse&&(I=I.parse);try{R=I(S,E)}catch(N){this.processed=!0,this.error=N}R&&!R[w]&&r.rebuild(R)}this.result=new d(C,R,E),this.helpers={...v,postcss:v,result:this.result},this.plugins=this.processor.plugins.map(I=>typeof I=="object"&&I.prepare?{...I,...I.prepare(this.result)}:I)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(C){return this.async().catch(C)}finally(C){return this.async().finally(C)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(C,S){let E=this.result.lastPlugin;try{S&&S.addToError(C),this.error=C,C.name==="CssSyntaxError"&&!C.plugin?(C.plugin=E.postcssPlugin,C.setMessage()):E.postcssVersion}catch(R){console&&console.error&&console.error(R)}return C}prepareVisitors(){this.listeners={};let C=(S,E,R)=>{this.listeners[E]||(this.listeners[E]=[]),this.listeners[E].push([S,R])};for(let S of this.plugins)if(typeof S=="object")for(let E in S){if(!i[E]&&/^[A-Z]/.test(E))throw new Error(`Unknown event ${E} in ${S.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!l[E])if(typeof S[E]=="object")for(let R in S[E])R==="*"?C(S,E,S[E][R]):C(S,E+"-"+R.toLowerCase(),S[E][R]);else typeof S[E]=="function"&&C(S,E,S[E])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let C=0;C<this.plugins.length;C++){let S=this.plugins[C],E=this.runOnRoot(S);if(a(E))try{await E}catch(R){throw this.handleError(R)}}if(this.prepareVisitors(),this.hasListener){let C=this.result.root;for(;!C[m];){C[m]=!0;let S=[y(C)];for(;S.length>0;){let E=this.visitTick(S);if(a(E))try{await E}catch(R){let I=S[S.length-1].node;throw this.handleError(R,I)}}}if(this.listeners.OnceExit)for(let[S,E]of this.listeners.OnceExit){this.result.lastPlugin=S;try{if(C.type==="document"){let R=C.nodes.map(I=>E(I,this.helpers));await Promise.all(R)}else await E(C,this.helpers)}catch(R){throw this.handleError(R)}}}return this.processed=!0,this.stringify()}runOnRoot(C){this.result.lastPlugin=C;try{if(typeof C=="object"&&C.Once){if(this.result.root.type==="document"){let S=this.result.root.nodes.map(E=>C.Once(E,this.helpers));return a(S[0])?Promise.all(S):S}return C.Once(this.result.root,this.helpers)}else if(typeof C=="function")return C(this.result.root,this.result)}catch(S){throw this.handleError(S)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let C=this.result.opts,S=p;C.syntax&&(S=C.syntax.stringify),C.stringifier&&(S=C.stringifier),S.stringify&&(S=S.stringify);let E=this.result.root.source;if(C.map===void 0&&!(E&&E.input&&E.input.map)){let I="";return S(this.result.root,N=>{I+=N}),this.result.css=I,this.result}let R=new c(S,this.result.root,this.result.opts).generate();return this.result.css=R[0],this.result.map=R[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let C of this.plugins)if(a(this.runOnRoot(C)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let C=this.result.root;for(;!C[m];)C[m]=!0,this.walkSync(C);if(this.listeners.OnceExit)if(C.type==="document")for(let S of C.nodes)this.visitSync(this.listeners.OnceExit,S);else this.visitSync(this.listeners.OnceExit,C)}return this.result}then(C,S){return this.async().then(C,S)}toString(){return this.css}visitSync(C,S){for(let[E,R]of C){this.result.lastPlugin=E;let I;try{I=R(S,this.helpers)}catch(N){throw this.handleError(N,S.proxyOf)}if(S.type!=="root"&&S.type!=="document"&&!S.parent)return!0;if(a(I))throw this.getAsyncError()}}visitTick(C){let S=C[C.length-1],{node:E,visitors:R}=S;if(E.type!=="root"&&E.type!=="document"&&!E.parent){C.pop();return}if(R.length>0&&S.visitorIndex<R.length){let[N,A]=R[S.visitorIndex];S.visitorIndex+=1,S.visitorIndex===R.length&&(S.visitors=[],S.visitorIndex=0),this.result.lastPlugin=N;try{return A(E.toProxy(),this.helpers)}catch(L){throw this.handleError(L,E)}}if(S.iterator!==0){let N=S.iterator;S.descending&&(S.descending=!1,E.indexes[N]+=1);let A;for(;A=E.nodes[E.indexes[N]];){if(!A[m]){A[m]=!0,S.descending=!0,C.push(y(A));return}E.indexes[N]+=1}S.iterator=0,delete E.indexes[N]}let I=S.events;for(;S.eventIndex<I.length;){let N=I[S.eventIndex];if(S.eventIndex+=1,N===s){E.nodes&&E.nodes.length&&(E[m]=!0,S.iterator=E.getIterator());return}else if(this.listeners[N]){S.visitors=this.listeners[N];return}}C.pop()}walkSync(C){C[m]=!0;let S=[{eventIndex:0,events:h(C),iterator:0,node:C}];for(;S.length>0;){let E=S[S.length-1],R=E.node;if(E.iterator!==0){let I=E.iterator;E.descending&&(E.descending=!1,R.indexes[I]+=1);let N,A=!1;for(;N=R.nodes[R.indexes[I]];){if(!N[m]){N[m]=!0,E.descending=!0,S.push({eventIndex:0,events:h(N),iterator:0,node:N}),A=!0;break}R.indexes[I]+=1}if(A)continue;E.iterator=0,delete R.indexes[I]}if(E.eventIndex<E.events.length){let I=E.events[E.eventIndex];if(E.eventIndex+=1,I===s)R.nodes&&R.nodes.length&&(E.iterator=R.getIterator());else{let N=this.listeners[I];N&&this.visitSync(N,R.toProxy())&&S.pop()}continue}S.pop()}}warnings(){return this.sync().warnings()}};M.registerPostcss=x=>{v=x},t.exports=M,M.default=M,g.registerLazyResult(M),o.registerLazyResult(M)})),to=H(((e,t)=>{var r=Ls(),o=yr(),c=wr(),f=Et(),d=Ps(),g=class{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 p,m=o;try{p=m(this._css,this._opts)}catch(w){this.error=w}if(this.error)throw this.error;return this._root=p,p}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(p,m,w){m=m.toString(),this.stringified=!1,this._processor=p,this._css=m,this._opts=w,this._map=void 0;let u=f;this.result=new c(this._processor,void 0,this._opts),this.result.css=m;let n=this;Object.defineProperty(this.result,"root",{get(){return n.root}});let i=new r(u,void 0,this._opts,m);if(i.isMap()){let[l,s]=i.generate();l&&(this.result.css=l),s&&(this.result.map=s)}else i.clearAnnotation(),this.result.css=i.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(p){return this.async().catch(p)}finally(p){return this.async().finally(p)}sync(){if(this.error)throw this.error;return this.result}then(p,m){return this.async().then(p,m)}toString(){return this._css}warnings(){return[]}};t.exports=g,g.default=g})),ro=H(((e,t)=>{var r=mr(),o=Fs(),c=to(),f=at(),d=class{constructor(g=[]){this.version="8.5.32",this.plugins=this.normalize(g)}normalize(g){let p=[];for(let m of g)if(m.postcss===!0?m=m():m.postcss&&(m=m.postcss),typeof m=="object"&&Array.isArray(m.plugins))p=p.concat(m.plugins);else if(typeof m=="object"&&m.postcssPlugin)p.push(m);else if(typeof m=="function")p.push(m);else if(!(typeof m=="object"&&(m.parse||m.stringify)))throw new Error(m+" is not a PostCSS plugin");return p}process(g,p={}){return!this.plugins.length&&!p.parser&&!p.stringifier&&!p.syntax?new c(this,g,p):new o(this,g,p)}use(g){return this.plugins=this.plugins.concat(this.normalize([g])),this}};t.exports=d,d.default=d,f.registerProcessor(d),r.registerProcessor(d)})),X=Ji(H(((e,t)=>{var r=pr(),o=Nt(),c=De(),f=dr(),d=Ot(),g=mr(),p=Zn(),m=It(),w=Fs(),u=_s(),n=Rt(),i=yr(),l=ro(),s=wr(),a=at(),h=gr(),y=Et(),b=ks();function v(...M){return M.length===1&&Array.isArray(M[0])&&(M=M[0]),new l(M)}v.plugin=function(x,C){let S=!1;function E(...I){console&&console.warn&&!S&&(S=!0,console.warn(x+`: postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("zh")&&console.warn(x+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let N=C(...I);return N.postcssPlugin=x,N.postcssVersion=new l().version,N}let R;return Object.defineProperty(E,"postcss",{get(){return R||(R=E()),R}}),E.process=function(I,N,A){return v([E(A)]).process(I,N)},E},v.stringify=y,v.parse=i,v.fromJSON=p,v.list=u,v.comment=M=>new o(M),v.atRule=M=>new r(M),v.decl=M=>new d(M),v.rule=M=>new h(M),v.root=M=>new a(M),v.document=M=>new g(M),v.CssSyntaxError=f,v.Declaration=d,v.Container=c,v.Processor=l,v.Document=g,v.Comment=o,v.Warning=b,v.AtRule=r,v.Result=s,v.Input=m,v.Rule=h,v.Root=a,v.Node=n,w.registerPostcss(v),t.exports=v,v.default=v}))(),1),so=X.default;X.default.stringify;X.default.fromJSON;X.default.plugin;X.default.parse;X.default.list;X.default.document;X.default.comment;X.default.atRule;X.default.rule;X.default.decl;X.default.root;X.default.CssSyntaxError;X.default.Declaration;X.default.Container;X.default.Processor;X.default.Document;X.default.Comment;X.default.Warning;X.default.AtRule;X.default.Result;X.default.Input;X.default.Rule;X.default.Root;X.default.Node;var Ur={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"};function io(e){let t=Ur[e.tagName]?Ur[e.tagName]:e.tagName;return t==="link"&&e.attributes._cssText&&(t="style"),t}function Dt(e,t){let r=t?.stylesWithHoverClass.get(e);if(r)return r;let o=e;try{o=so([Yn,Jn]).process(e).css}catch(c){console.warn("Failed to adapt css for replay",c)}return t?.stylesWithHoverClass.set(e,o),o}function Br(){return{stylesWithHoverClass:new Map}}var no="rrweb-snapshot.rebuild() cannot rebuild into an unprotected browser document. Use rebuildIntoSandboxedIframe() or set UNSAFE_allowUnprotectedRebuild: true only when you accept the script-execution risk.",Wr="rrweb-snapshot.createSandboxedIframe() requires root to be connected to a document before creating a sandboxed iframe.",Bs=new WeakSet;function oo(e){if(!e||e.tagName!=="IFRAME"||!("sandbox"in e))return!1;let t=Array.from(e.sandbox);return t.length===1&&t[0]==="allow-same-origin"}function ao(e){if(e.UNSAFE_allowUnprotectedRebuild)return;let t=e.doc.defaultView;if(t&&!(Bs.has(e.doc)&&oo(t.frameElement)))throw new Error(no)}function lo(e,t,r,o){let c=[];for(let m of e.childNodes)m.type===B.Text&&c.push(m);let f=t.split("/* rr_split */");for(;f.length>1&&f.length>c.length;)f.splice(-2,2,f.slice(-2).join(""));let d="";r&&(d=Dt(f.join(""),o));let g=0,p=-1;for(let m=0;m<c.length&&m!==f.length;m++){let w=c[m],u=f[m],n=m<f.length-1?f[m+1]:null;if(r&&n){let i=g,l=n.length;l=Math.min(l,30);let s=!1;for(;l>2;l--){let a=n.substring(0,l),h=d.substring(g).indexOf(a);if(s=h!==-1,s){i+=h;break}}s||(i+=u.length),u=d.substring(g,i),g=i}else r&&(u=d.substring(g));p!==-1&&(u=u.substring(p)),n&&(p!==-1||u.endsWith("0p")&&n.startsWith("x"))&&(p=n.indexOf("}"),p!==-1&&(p+=1,u+=n.substring(0,p))),w.textContent=u}}function uo(e,t,r,o){let{doc:c,hackCss:f,cache:d}=o;e.childNodes.length?lo(e,r,f,d):(f&&(r=Dt(r,d)),t.appendChild(c.createTextNode(r)))}function co(e,t){let{doc:r,hackCss:o,cache:c}=t;switch(e.type){case B.Document:return r.implementation.createDocument(null,"",null);case B.DocumentType:return r.implementation.createDocumentType(e.name||"html",e.publicId,e.systemId);case B.Element:{let f=io(e),d;e.isSVG?d=r.createElementNS("http://www.w3.org/2000/svg",f):(e.isCustom&&r.defaultView?.customElements&&!r.defaultView.customElements.get(e.tagName)&&r.defaultView.customElements.define(e.tagName,class extends r.defaultView.HTMLElement{}),d=r.createElement(f));let g={};for(let p in e.attributes){if(!Object.prototype.hasOwnProperty.call(e.attributes,p))continue;let m=e.attributes[p];if(!(f==="option"&&p==="selected"&&m===!1)&&m!==null){if(m===!0&&(m=""),p.startsWith("rr_")){g[p]=m;continue}if(typeof m=="string"){if(f==="style"&&p==="_cssText"){uo(e,d,m,t);continue}else if(f==="textarea"&&p==="value"){d.appendChild(r.createTextNode(m)),e.childNodes=[];continue}}try{if(e.isSVG&&p==="xlink:href")d.setAttributeNS("http://www.w3.org/1999/xlink",p,m.toString());else if(p==="onload"||p==="onclick"||p.substring(0,7)==="onmouse")d.setAttribute("_"+p,m.toString());else if(f==="meta"&&e.attributes["http-equiv"]==="Content-Security-Policy"&&p==="content"){d.setAttribute("csp-content",m.toString());continue}else f==="link"&&(e.attributes.rel==="preload"&&e.attributes.as==="script"||e.attributes.rel==="modulepreload")||f==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&hr(e.attributes.href)==="js"||(f==="img"&&e.attributes.srcset&&e.attributes.rr_dataURL?d.setAttribute("rrweb-original-srcset",e.attributes.srcset):d.setAttribute(p,m.toString()))}catch{}}}for(let p in g){let m=g[p];if(f==="canvas"&&p==="rr_dataURL"){let w=r.createElement("img");w.onload=()=>{let u=d.getContext("2d");u&&u.drawImage(w,0,0,w.width,w.height)},w.src=m.toString(),d.RRNodeType&&(d.rr_dataURL=m.toString())}else if(f==="img"&&p==="rr_dataURL"){let w=d;w.currentSrc.startsWith("data:")||(w.setAttribute("rrweb-original-src",e.attributes.src),w.src=m.toString())}if(p==="rr_width")d.style.setProperty("width",m.toString());else if(p==="rr_height")d.style.setProperty("height",m.toString());else if(p==="rr_mediaCurrentTime"&&typeof m=="number")d.currentTime=m;else if(p==="rr_mediaState")switch(m){case"played":d.play().catch(w=>console.warn("media playback error",w));break;case"paused":d.pause()}else p==="rr_mediaPlaybackRate"&&typeof m=="number"?d.playbackRate=m:p==="rr_mediaMuted"&&typeof m=="boolean"?d.muted=m:p==="rr_mediaLoop"&&typeof m=="boolean"?d.loop=m:p==="rr_mediaVolume"&&typeof m=="number"?d.volume=m:p==="rr_open_mode"&&d.setAttribute("rr_open_mode",m)}if(e.isShadowHost)if(!d.shadowRoot)d.attachShadow({mode:"open"});else for(;d.shadowRoot.firstChild;)d.shadowRoot.removeChild(d.shadowRoot.firstChild);return(f==="input"||f==="textarea")&&d.setAttribute("autocomplete","off"),d}case B.Text:return e.isStyle&&o?r.createTextNode(Dt(e.textContent,c)):r.createTextNode(e.textContent);case B.CDATA:return r.createCDATASection(e.textContent);case B.Comment:return r.createComment(e.textContent);default:return null}}function tt(e,t){let{doc:r,mirror:o,skipChild:c=!1,hackCss:f=!0,afterAppend:d,cache:g}=t;if(o.has(e.id)){let m=o.getNode(e.id);if(Cn(o.getMeta(m),e))return o.getNode(e.id)}let p=co(e,{doc:r,hackCss:f,cache:g});if(!p)return null;if(e.rootId&&o.getNode(e.rootId)!==r&&o.replace(e.rootId,r),e.type===B.Document&&(r.close(),r.open(),e.compatMode==="BackCompat"&&e.childNodes&&e.childNodes[0].type!==B.DocumentType&&(e.childNodes[0].type===B.Element&&"xmlns"in e.childNodes[0].attributes&&e.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?r.write(\'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">\'):r.write(\'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">\')),p=r),o.add(p,e),(e.type===B.Document||e.type===B.Element)&&!c)for(let m of e.childNodes){let w=tt(m,{doc:r,mirror:o,skipChild:!1,hackCss:f,afterAppend:d,cache:g});if(!w){console.warn("Failed to rebuild",m);continue}if(m.isShadow&&ur(p)&&p.shadowRoot)p.shadowRoot.appendChild(w);else if(e.type===B.Document&&m.type==B.Element){let u=w,n=null;u.childNodes.forEach(i=>{i.nodeName==="BODY"&&(n=i)}),n?(u.removeChild(n),p.appendChild(w),u.appendChild(n)):p.appendChild(w)}else p.appendChild(w);d&&d(w,m.id)}return p}function ho(e,t){function r(o){t(o)}for(let o of e.getIds())e.has(o)&&r(e.getNode(o))}function fo(e,t){let r=t.getMeta(e);if(r?.type!==B.Element)return;let o=e;for(let c in r.attributes){if(!(Object.prototype.hasOwnProperty.call(r.attributes,c)&&c.startsWith("rr_")))continue;let f=r.attributes[c];c==="rr_scrollLeft"&&(o.scrollLeft=f),c==="rr_scrollTop"&&(o.scrollTop=f)}}function po(e,t){ao(t);let{doc:r,onVisit:o,hackCss:c=!0,afterAppend:f,cache:d,mirror:g=new cr}=t,p=tt(e,{doc:r,mirror:g,skipChild:!1,hackCss:c,afterAppend:f,cache:d});return ho(g,m=>{o&&o(m),fo(m,g)}),p}function mo(e){if(!e.root.isConnected)throw new Error(Wr);let t=e.root.ownerDocument.createElement("iframe");for(let[o,c]of Object.entries(e.iframeAttributes||{}))o!=="sandbox"&&t.setAttribute(o,c);t.setAttribute("sandbox","allow-same-origin"),e.root.appendChild(t);let r=t.contentDocument;if(!r||!t.contentWindow)throw t.parentNode?.removeChild(t),new Error(Wr);return Bs.add(r),t}var go=Object.create,Ws=Object.defineProperty,yo=Object.getOwnPropertyDescriptor,wo=Object.getOwnPropertyNames,vo=Object.getPrototypeOf,$s=Object.prototype.hasOwnProperty,q=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),bo=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(var c=wo(t),f=0,d=c.length,g;f<d;f++)g=c[f],!$s.call(e,g)&&g!==r&&Ws(e,g,{get:(p=>t[p]).bind(null,g),enumerable:!(o=yo(t,g))||o.enumerable});return e},So=(e,t,r)=>(r=e!=null?go(vo(e)):{},bo(t||!e||!e.__esModule||!$s.call(e,"default")?Ws(r,"default",{value:e,enumerable:!0}):r,e)),$r={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},zr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Je={},Kt={},jr=0;function Co(e){let t=globalThis?.Zone?.__symbol__?.(e);if(t&&globalThis[t])return globalThis[t]}function vr(e){if(Je[e])return Je[e];let t=Co(e)||globalThis[e],r=t.prototype,o=e in $r?$r[e]:void 0,c=!!(o&&o.every(g=>!!Object.getOwnPropertyDescriptor(r,g)?.get?.toString().includes("[native code]"))),f=e in zr?zr[e]:void 0,d=!!(f&&f.every(g=>typeof r[g]=="function"&&r[g]?.toString().includes("[native code]")));if(c&&d)return Je[e]=t.prototype,t.prototype;try{let g=document.createElement("iframe");g.style.display="none",document.body.appendChild(g);let p=g.contentWindow;if(!p)return t.prototype;let m=p[e].prototype;if(!m)return g.remove(),r;let w=navigator.userAgent;return w.includes("Safari")&&!w.includes("Chrome")?(g.classList.add("rr-block"),g.setAttribute("__rrwebUntaintedMutationObserver",""),Kt[e]=()=>g.remove()):g.remove(),Je[e]=m}catch{return r}}var Vr={};function de(e,t,r){let o=Vr[e]?.[r];if(o)return o.call(t);let c=vr(e),f=Object.getOwnPropertyDescriptor(c,r)?.get;return f?((Vr[e]||={})[r]=f,f.call(t)):t[r]}var jt={};function zs(e,t,r){let o=`${e}.${String(r)}`;if(jt[o])return jt[o].bind(t);let c=vr(e)[r];return typeof c!="function"?t[r]:(jt[o]=c,c.bind(t))}function xo(e){return de("Node",e,"ownerDocument")}function Eo(e){return de("Node",e,"childNodes")}function Mo(e){return de("Node",e,"parentNode")}function Ro(e){return de("Node",e,"parentElement")}function No(e){return de("Node",e,"textContent")}function Oo(e){return de("Node",e,"firstChild")}function Io(e){return de("Node",e,"lastChild")}function Do(e){return de("Node",e,"nextSibling")}function Ao(e){return de("Node",e,"previousSibling")}function To(e,t){return zs("Node",e,"contains")(t)}function _o(e){return zs("Node",e,"getRootNode")()}function Lo(e){return!e||!("host"in e)?null:de("ShadowRoot",e,"host")}function ko(e){return e.styleSheets}function Po(e){return!e||!("shadowRoot"in e)?null:de("Element",e,"shadowRoot")}function Fo(e,t){return de("Element",e,"querySelector")(t)}function Uo(e,t){return de("Element",e,"querySelectorAll")(t)}function Bo(){let e=vr("MutationObserver");jr++;let t=!1;return[e.constructor,()=>{if(t||(t=!0,--jr!==0))return;let r=Kt.MutationObserver;if(r)try{r()}finally{delete Je.MutationObserver,delete Kt.MutationObserver}}]}var js=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(js=()=>new Date().getTime());function Wo(e,t,r){try{if(!(t in e))return()=>{};let o=e[t],c=r(o);return typeof c=="function"&&(c.prototype=c.prototype||{},Object.defineProperties(c,{__rrweb_original__:{enumerable:!1,value:o}})),e[t]=c,()=>{e[t]=o}}catch{return()=>{}}}var $o={ownerDocument:xo,childNodes:Eo,parentNode:Mo,parentElement:Ro,textContent:No,firstChild:Oo,lastChild:Io,nextSibling:Do,previousSibling:Ao,contains:To,getRootNode:_o,host:Lo,styleSheets:ko,shadowRoot:Po,querySelector:Fo,querySelectorAll:Uo,nowTimestamp:js,mutationObserverCtor:Bo,patch:Wo},zo=class{idNodeMap=new Map;nodeMetaMap=new WeakMap;getId(e){return e?this.getMeta(e)?.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(o=>this.removeNodeFromMap(o));let r=$o.shadowRoot(e);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 o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(t,o)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function jo(){return new zo}var Vs="(?:/\\\\*[^*]*\\\\*/)|[\\\\s;]";new RegExp(`${Vs}|\\\\b(0)px?`,"g");new RegExp(Vs,"g");new RegExp(/(max|min)-device-(width|height)/.source,"g");var Vo=q(((e,t)=>{var r=String,o=function(){return{isColorSupported:!1,reset:r,bold:r,dim:r,italic:r,underline:r,inverse:r,hidden:r,strikethrough:r,black:r,red:r,green:r,yellow:r,blue:r,magenta:r,cyan:r,white:r,gray:r,bgBlack:r,bgRed:r,bgGreen:r,bgYellow:r,bgBlue:r,bgMagenta:r,bgCyan:r,bgWhite:r,blackBright:r,redBright:r,greenBright:r,yellowBright:r,blueBright:r,magentaBright:r,cyanBright:r,whiteBright:r,bgBlackBright:r,bgRedBright:r,bgGreenBright:r,bgYellowBright:r,bgBlueBright:r,bgMagentaBright:r,bgCyanBright:r,bgWhiteBright:r}};t.exports=o(),t.exports.createColors=o})),we=q(((e,t)=>{t.exports={}})),br=q(((e,t)=>{var r=Vo(),o=we(),c=class Gs extends Error{constructor(d,g,p,m,w,u){super(d),this.name="CssSyntaxError",this.reason=d,w&&(this.file=w),m&&(this.source=m),u&&(this.plugin=u),typeof g<"u"&&typeof p<"u"&&(typeof g=="number"?(this.line=g,this.column=p):(this.line=g.line,this.column=g.column,this.endLine=p.line,this.endColumn=p.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Gs)}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(d){if(!this.source)return"";let g=this.source;d==null&&(d=r.isColorSupported);let p=s=>s,m=s=>s,w=s=>s;if(d){let{bold:s,gray:a,red:h}=r.createColors(!0);m=y=>s(h(y)),p=y=>a(y),o&&(w=y=>o(y))}let u=g.split(/\\r?\\n/),n=Math.max(this.line-3,0),i=Math.min(this.line+2,u.length),l=String(i).length;return u.slice(n,i).map((s,a)=>{let h=n+1+a,y=" "+(" "+h).slice(-l)+" | ";if(h===this.line){if(s.length>160){let v=20,M=Math.max(0,this.column-v),x=Math.max(this.column+v,this.endColumn+v),C=s.slice(M,x),S=p(y.replace(/\\d/g," "))+s.slice(0,Math.min(this.column-1,19)).replace(/[^\\t]/g," ");return m(">")+p(y)+w(C)+`\n `+S+m("^")}let b=p(y.replace(/\\d/g," "))+s.slice(0,this.column-1).replace(/[^\\t]/g," ");return m(">")+p(y)+w(s)+`\n `+b+m("^")}return" "+p(y)+w(s)}).join(`\n`)}toString(){let d=this.showSourceCode();return d&&(d=`\n\n`+d+`\n`),this.name+": "+this.message+d}};t.exports=c,c.default=c})),Hs=q(((e,t)=>{var r=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/,o={after:`\n`,beforeClose:`\n`,beforeComment:`\n`,beforeDecl:`\n`,beforeOpen:" ",beforeRule:`\n`,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function c(w){return w[0].toUpperCase()+w.slice(1)}function f(w,u){let n="@"+u.name,i=u.params?w.rawValue(u,"params"):"",l=u.raws.afterName;return typeof l>"u"?l=i?" ":"":l===""&&i&&!r.test(i[0])&&(l=" "),n+l+i}function d(w){if(!w.prop.startsWith("--"))return!1;let u=w.raws.before;return typeof u>"u"||!/[^\\s;]$/.test(u)}function g(w,u,n){let i=n.nodes,l=i.length-1;for(;l>0&&i[l].type==="comment";)l-=1;let s=w.raw(n,"semicolon"),a=n.type==="document";for(let h=i.length-1;h>=0;h--){let y=i[h],b=l!==h||s;!b&&h<i.length-1&&(y.type==="atrule"&&!y.nodes||y.type==="decl"&&d(y))&&(b=!0),u.push({document:a,node:y,semicolon:b})}}function p(w,u,n,i){let l=w.raw(n,"between","beforeOpen");w.builder(i+l+"{",n,"start");let s=n.nodes&&n.nodes.length,a=()=>{let h=s?w.raw(n,"after"):w.raw(n,"after","emptyBody");h&&w.builder(h),w.builder("}",n,"end"),n.type==="rule"&&n.raws.ownSemicolon&&w.builder(n.raws.ownSemicolon,n,"end")};s?(u.push(a),g(w,u,n)):a()}var m=class qs{constructor(u){this.builder=u}atrule(u,n){let i=f(this,u);if(u.nodes)this.block(u,i);else{let l=(u.raws.between||"")+(n?";":"");this.builder(i+l,u)}}beforeAfter(u,n){let i;u.type==="decl"?i=this.raw(u,null,"beforeDecl"):u.type==="comment"?i=this.raw(u,null,"beforeComment"):n==="before"?i=this.raw(u,null,"beforeRule"):i=this.raw(u,null,"beforeClose");let l=u.parent,s=0;for(;l&&l.type!=="root";)s+=1,l=l.parent;if(i.includes(`\n`)){let a=this.raw(u,null,"indent");if(a.length)for(let h=0;h<s;h++)i+=a}return i}block(u,n){let i=this.raw(u,"between","beforeOpen");this.builder(n+i+"{",u,"start");let l;u.nodes&&u.nodes.length?(this.body(u),l=this.raw(u,"after")):l=this.raw(u,"after","emptyBody"),l&&this.builder(l),this.builder("}",u,"end")}body(u){let n=qs.prototype,i=["atrule","block","body","rule","stringify"].every(s=>this[s]===n[s]),l=[];for(g(this,l,u);l.length>0;){let s=l.pop();if(typeof s=="function"){s();continue}let a=s.node,h=this.raw(a,"before");h&&this.builder(h),i&&a.type==="rule"?p(this,l,a,this.rawValue(a,"selector")):i&&a.type==="atrule"&&a.nodes?p(this,l,a,f(this,a)):this.stringify(a,s.semicolon)}}comment(u){let n=this.raw(u,"left","commentLeft"),i=this.raw(u,"right","commentRight");this.builder("/*"+n+u.text+i+"*/",u)}decl(u,n){let i=u.raws,l=this.raw(u,"between","colon"),s=u.prop+l+this.rawValue(u,"value");u.important&&(s+=i.important||" !important"),n&&(s+=";"),this.builder(s,u)}document(u){this.body(u)}raw(u,n,i){let l;if(i||(i=n),n&&(l=u.raws[n],typeof l<"u"))return l;let s=u.parent;if(i==="before"&&(!s||s.type==="root"&&s.first===u||s&&s.type==="document"))return"";if(!s)return o[i];let a=u.root(),h=a.rawCache||(a.rawCache={});if(typeof h[i]<"u")return h[i];if(i==="before"||i==="after")return this.beforeAfter(u,i);{let y="raw"+c(i);this[y]?l=this[y](a,u):a.walk(b=>{if(l=b.raws[n],typeof l<"u")return!1})}return typeof l>"u"&&(l=o[i]),h[i]=l,l}rawBeforeClose(u){let n;return u.walk(i=>{if(i.nodes&&i.nodes.length>0&&typeof i.raws.after<"u")return n=i.raws.after,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),n&&(n=n.replace(/\\S/g,"")),n}rawBeforeComment(u,n){let i;return u.walkComments(l=>{if(typeof l.raws.before<"u")return i=l.raws.before,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(n,null,"beforeDecl"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeDecl(u,n){let i;return u.walkDecls(l=>{if(typeof l.raws.before<"u")return i=l.raws.before,i.includes(`\n`)&&(i=i.replace(/[^\\n]+$/,"")),!1}),typeof i>"u"?i=this.raw(n,null,"beforeRule"):i&&(i=i.replace(/\\S/g,"")),i}rawBeforeOpen(u){let n;return u.walk(i=>{if(i.type!=="decl"&&(n=i.raws.between,typeof n<"u"))return!1}),n}rawBeforeRule(u){let n;return u.walk(i=>{if(i.nodes&&(i.parent!==u||u.first!==i)&&typeof i.raws.before<"u")return n=i.raws.before,n.includes(`\n`)&&(n=n.replace(/[^\\n]+$/,"")),!1}),n&&(n=n.replace(/\\S/g,"")),n}rawColon(u){let n;return u.walkDecls(i=>{if(typeof i.raws.between<"u")return n=i.raws.between.replace(/[^\\s:]/g,""),!1}),n}rawEmptyBody(u){let n;return u.walk(i=>{if(i.nodes&&i.nodes.length===0&&(n=i.raws.after,typeof n<"u"))return!1}),n}rawIndent(u){if(u.raws.indent)return u.raws.indent;let n;return u.walk(i=>{let l=i.parent;if(l&&l!==u&&l.parent&&l.parent===u&&typeof i.raws.before<"u"){let s=i.raws.before.split(`\n`);return n=s[s.length-1],n=n.replace(/\\S/g,""),!1}}),n}rawSemicolon(u){let n;return u.walk(i=>{if(i.nodes&&i.nodes.length&&i.last.type==="decl"&&(n=i.raws.semicolon,typeof n<"u"))return!1}),n}rawValue(u,n){let i=u[n],l=u.raws[n];return l&&l.value===i?l.raw:i}root(u){!(u.parent&&u.parent.type==="document")&&u.source&&u.source.input.hasBOM&&this.builder("\\uFEFF",u,"start"),this.body(u),u.raws.after&&this.builder(u.raws.after)}rule(u){this.block(u,this.rawValue(u,"selector")),u.raws.ownSemicolon&&this.builder(u.raws.ownSemicolon,u,"end")}stringify(u,n){if(!this[u.type])throw new Error("Unknown AST node type "+u.type+". Maybe you need to change PostCSS stringifier.");this[u.type](u,n)}};t.exports=m,m.default=m})),At=q(((e,t)=>{var r=Hs(),o=/(<)(\\/?style\\b)/gi,c=/(<)(!--)/g;function f(m){return m.includes("<")?m.replace(o,"\\\\3c $2").replace(c,"\\\\3c $2"):m}function d(m,w,u){let n=[],i=0,l=0;for(let s=0;s<m.length;s+=3){let a=l,h=i+m[s].length;for(;i<h;)w[i]===u[l]?(i+=1,l+=1):(i+=1,l+=4);n.push(u.slice(a,l))}return n}var g=class extends r{escapeHTML(m){let w=this.builder,u,n;if(this.builder=(l,s,a)=>{u?(n+=l,u.push(l,s,a)):l.includes("<")?(n=l,u=[l,s,a]):w(l,s,a)},m(),this.builder=w,!u)return;let i=f(n);if(i===n)for(let l=0;l<u.length;l+=3)w(u[l],u[l+1],u[l+2]);else{let l=d(u,n,i);for(let s=0;s<u.length;s+=3)w(l[s/3],u[s+1],u[s+2])}}root(m){m.parent&&m.parent.type==="document"?(this.escapeHTML(()=>this.body(m)),m.raws.after&&this.builder(m.raws.after)):this.escapeHTML(()=>super.root(m))}};function p(m,w){let u=new g(w);m.type==="root"||m.type==="document"?u.stringify(m):u.escapeHTML(()=>u.stringify(m))}t.exports=p,p.default=p})),Tt=q(((e,t)=>{t.exports.isClean=Symbol("isClean"),t.exports.my=Symbol("my")})),_t=q(((e,t)=>{var r=br(),o=Hs(),c=At(),{isClean:f,my:d}=Tt();function g(w,u){let n=new w.constructor,i=[[w,n,u]];for(;i.length>0;){let[l,s,a]=i.pop();for(let h in l){if(!Object.prototype.hasOwnProperty.call(l,h)||h==="proxyCache")continue;let y=l[h],b=typeof y;if(h==="parent"&&b==="object")a&&(s[h]=a);else if(h==="source")s[h]=y;else if(Array.isArray(y)){let v=[];s[h]=v;for(let M of y){let x=new M.constructor;v.push(x),i.push([M,x,s])}}else{if(b==="object"&&y!==null){let v=new y.constructor;i.push([y,v,void 0]),y=v}s[h]=y}}}return n}function p(w,u){if(u&&typeof u.offset<"u")return u.offset;let n=1,i=1,l=0;for(let s=0;s<w.length;s++){if(i===u.line&&n===u.column){l=s;break}w[s]===`\n`?(n=1,i+=1):n+=1}return l}var m=class er{get proxyOf(){return this}constructor(u={}){this.raws={},this[f]=!1,this[d]=!0;for(let n of Object.keys(u))if(n!=="__proto__")if(n==="nodes"){this.nodes=[];for(let i of u[n])typeof i.clone=="function"&&i.parent?this.append(i.clone()):this.append(i)}else this[n]=u[n]}addToError(u){if(u.postcssNode=this,u.stack&&this.source&&/\\n\\s{4}at /.test(u.stack)){let n=this.source;u.stack=u.stack.replace(/\\n\\s{4}at /,`$&${n.input.from}:${n.start.line}:${n.start.column}$&`)}return u}after(u){return this.parent.insertAfter(this,u),this}assign(u={}){for(let n in u)this[n]=u[n];return this}before(u){return this.parent.insertBefore(this,u),this}cleanRaws(u){delete this.raws.before,delete this.raws.after,u||delete this.raws.between}clone(u={}){let n=g(this);for(let i in u)n[i]=u[i];return n}cloneAfter(u={}){let n=this.clone(u);return this.parent.insertAfter(this,n),n}cloneBefore(u={}){let n=this.clone(u);return this.parent.insertBefore(this,n),n}error(u,n={}){if(this.source){let{end:i,start:l}=this.rangeBy(n);return this.source.input.error(u,{column:l.column,line:l.line},{column:i.column,line:i.line},n)}return new r(u)}getProxyProcessor(){return{get(u,n){return n==="proxyOf"?u:n==="root"?()=>u.root().toProxy():u[n]},set(u,n,i){return u[n]===i||(u[n]=i,(n==="prop"||n==="value"||n==="name"||n==="params"||n==="important"||n==="text")&&u.markDirty()),!0}}}markClean(){this[f]=!0}markDirty(){if(this[f]){this[f]=!1;let u=this;for(;u=u.parent;)u[f]=!1}}next(){if(!this.parent)return;let u=this.parent.index(this);return this.parent.nodes[u+1]}positionBy(u={}){let n="document"in this.source.input?this.source.input.document:this.source.input.css,i={column:this.source.start.column,line:this.source.start.line,offset:p(n,this.source.start)};if(u.index)i=this.positionInside(u.index);else if(u.word){let l=n.slice(p(n,this.source.start),this.rangeBy().end.offset).indexOf(u.word);l!==-1&&(i=this.positionInside(l))}return i}positionInside(u){let n=this.source.start.column,i=this.source.start.line,l="document"in this.source.input?this.source.input.document:this.source.input.css,s=p(l,this.source.start),a=s+u;for(let h=s;h<a;h++)l[h]===`\n`?(n=1,i+=1):n+=1;return{column:n,line:i,offset:a}}prev(){if(!this.parent)return;let u=this.parent.index(this);return this.parent.nodes[u-1]}rangeBy(u={}){let n="document"in this.source.input?this.source.input.document:this.source.input.css,i={column:this.source.start.column,line:this.source.start.line,offset:p(n,this.source.start)},l=this.source.end?{column:this.source.end.column+1,line:this.source.end.line,offset:typeof this.source.end.offset=="number"?this.source.end.offset:p(n,this.source.end)+1}:{column:i.column+1,line:i.line,offset:i.offset+1};if(u.word){let s=n.slice(p(n,this.source.start),l.offset).indexOf(u.word);s!==-1&&(i=this.positionInside(s),l=this.positionInside(s+u.word.length))}else u.start?i={column:u.start.column,line:u.start.line,offset:p(n,u.start)}:typeof u.index=="number"&&(i=this.positionInside(u.index)),u.end?l={column:u.end.column,line:u.end.line,offset:p(n,u.end)}:typeof u.endIndex=="number"?l=this.positionInside(u.endIndex):typeof u.index=="number"&&(l=this.positionInside(u.index+1));return(l.line<i.line||l.line===i.line&&l.column<=i.column)&&(l={column:i.column+1,line:i.line,offset:i.offset+1}),{end:l,start:i}}raw(u,n){return new o().raw(this,u,n)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...u){if(this.parent){let n=this,i=!1;for(let l of u)l===this?i=!0:i?(this.parent.insertAfter(n,l),n=l):this.parent.insertBefore(n,l);i||this.remove()}return this}root(){let u=this;for(;u.parent&&u.parent.type!=="document";)u=u.parent;return u}toJSON(u,n){let i=n==null;n=n||new Map;let l=[],s=[[this,l,0]];for(let h=0;h<s.length;h++){let[y,b,v]=s[h],M={};b[v]=M;for(let x in y){if(!Object.prototype.hasOwnProperty.call(y,x)||x==="parent"||x==="proxyCache")continue;let C=y[x];if(Array.isArray(C)){let S=[];M[x]=S;for(let E=0;E<C.length;E++){let R=C[E];typeof R=="object"&&R.toJSON?R.toJSON===er.prototype.toJSON?s.push([R,S,E]):S[E]=R.toJSON(null,n):S[E]=R}}else if(typeof C=="object"&&C.toJSON)C.toJSON===er.prototype.toJSON?s.push([C,M,x]):M[x]=C.toJSON(null,n);else if(x==="source"){if(C==null)continue;let S=n.get(C.input);S==null&&(S=n.size,n.set(C.input,S)),M[x]={end:C.end,inputId:S,start:C.start}}else M[x]=C}}let a=l[0];return i&&(a.inputs=[...n.keys()].map(h=>h.toJSON())),a}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(u=c){u.stringify&&(u=u.stringify);let n="";return u(this,i=>{n+=i}),n}warn(u,n,i={}){let l={node:this};for(let s in i)l[s]=i[s];return u.warn(n,l)}};t.exports=m,m.default=m})),Lt=q(((e,t)=>{var r=_t(),o=class extends r{constructor(c){super(c),this.type="comment"}};t.exports=o,o.default=o})),kt=q(((e,t)=>{var r=_t(),o=class extends r{get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}constructor(c){c&&typeof c.value<"u"&&typeof c.value!="string"&&(c={...c,value:String(c.value)}),super(c),this.type="decl"}};t.exports=o,o.default=o})),Ae=q(((e,t)=>{var r=Lt(),o=kt(),c=_t(),{isClean:f,my:d}=Tt(),g,p,m,w;function u(l){let s=l.slice();for(;s.length>0;){let a=s.pop();if(delete a.source,a.nodes){a.nodes=a.nodes.slice();for(let h of a.nodes)s.push(h)}}return l.slice()}function n(l){let s=[l];for(;s.length>0;){let a=s.pop();if(a[f]=!1,a.proxyOf.nodes)for(let h of a.proxyOf.nodes)s.push(h)}}var i=class tr extends c{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]}append(...s){for(let a of s){let h=this.normalize(a,this.last);for(let y of h)this.proxyOf.nodes.push(y)}return this.markDirty(),this}cleanRaws(s){let a=[this];for(;a.length>0;){let h=a.pop();if(h!==this&&h.cleanRaws!==tr.prototype.cleanRaws){h.cleanRaws(s);continue}if(c.prototype.cleanRaws.call(h,s),h.nodes)for(let y of h.nodes)a.push(y)}}each(s){if(!this.proxyOf.nodes)return;let a=this.getIterator(),h,y;for(;this.indexes[a]<this.proxyOf.nodes.length&&(h=this.indexes[a],y=s(this.proxyOf.nodes[h],h),y!==!1);)this.indexes[a]+=1;return delete this.indexes[a],y}every(s){return this.nodes.every(s)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let s=this.lastEach;return this.indexes[s]=0,s}getProxyProcessor(){return{get(s,a){return a==="proxyOf"?s:s[a]?a==="each"||typeof a=="string"&&a.startsWith("walk")?(...h)=>s[a](...h.map(y=>typeof y=="function"?(b,v)=>y(b.toProxy(),v):y)):a==="every"||a==="some"?h=>s[a]((y,...b)=>h(y.toProxy(),...b)):a==="root"?()=>s.root().toProxy():a==="nodes"?s.nodes.map(h=>h.toProxy()):a==="first"||a==="last"?s[a].toProxy():s[a]:s[a]},set(s,a,h){return s[a]===h||(s[a]=h,(a==="name"||a==="params"||a==="selector")&&s.markDirty()),!0}}}index(s){return typeof s=="number"?s:(s.proxyOf&&(s=s.proxyOf),this.proxyOf.nodes.indexOf(s))}insertAfter(s,a){let h=this.index(s),y=this.normalize(a,this.proxyOf.nodes[h]).reverse();h=this.index(s);for(let v of y)this.proxyOf.nodes.splice(h+1,0,v);let b;for(let v in this.indexes)b=this.indexes[v],h<b&&(this.indexes[v]=b+y.length);return this.markDirty(),this}insertBefore(s,a){let h=this.index(s),y=h===0?"prepend":!1,b=this.normalize(a,this.proxyOf.nodes[h],y).reverse();h=this.index(s);for(let M of b)this.proxyOf.nodes.splice(h,0,M);let v;for(let M in this.indexes)v=this.indexes[M],h<=v&&(this.indexes[M]=v+b.length);return this.markDirty(),this}normalize(s,a){if(typeof s=="string")s=u(p(s).nodes);else if(typeof s>"u")s=[];else if(Array.isArray(s)){s=s.slice(0);for(let h of s)h.parent&&h.parent.removeChild(h,"ignore")}else if(s.type==="root"&&this.type!=="document"){s=s.nodes.slice(0);for(let h of s)h.parent&&h.parent.removeChild(h,"ignore")}else if(s.type)s=[s];else if(s.prop){if(typeof s.value>"u")throw new Error("Value field is missed in node creation");typeof s.value!="string"&&(s.value=String(s.value)),s=[new o(s)]}else if(s.selector||s.selectors)s=[new w(s)];else if(s.name)s=[new g(s)];else if(s.text)s=[new r(s)];else throw new Error("Unknown node type in node creation");return s.map(h=>(h[d]||tr.rebuild(h),h=h.proxyOf,h.parent&&h.parent.removeChild(h),h[f]&&n(h),h.raws||(h.raws={}),typeof h.raws.before>"u"&&a&&typeof a.raws.before<"u"&&(h.raws.before=a.raws.before.replace(/\\S/g,"")),h.parent=this.proxyOf,h))}prepend(...s){s=s.reverse();for(let a of s){let h=this.normalize(a,this.first,"prepend").reverse();for(let y of h)this.proxyOf.nodes.unshift(y);for(let y in this.indexes)this.indexes[y]=this.indexes[y]+h.length}return this.markDirty(),this}push(s){return s.parent=this,this.proxyOf.nodes.push(s),this}removeAll(){for(let s of this.proxyOf.nodes)s.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(s){s=this.index(s),this.proxyOf.nodes[s].parent=void 0,this.proxyOf.nodes.splice(s,1);let a;for(let h in this.indexes)a=this.indexes[h],a>=s&&(this.indexes[h]=a-1);return this.markDirty(),this}replaceValues(s,a,h){return h||(h=a,a={}),this.walkDecls(y=>{a.props&&!a.props.includes(y.prop)||a.fast&&!y.value.includes(a.fast)||(y.value=y.value.replace(s,h))}),this.markDirty(),this}some(s){return this.nodes.some(s)}walk(s){if(!this.proxyOf.nodes)return;let a=[{iterator:this.getIterator(),node:this.proxyOf}];for(;a.length>0;){let{iterator:h,node:y}=a[a.length-1],b=y.indexes[h];if(b>=y.proxyOf.nodes.length){delete y.indexes[h],a.pop();let x=a[a.length-1];x&&(x.node.indexes[x.iterator]+=1);continue}let v=y.proxyOf.nodes[b],M;try{M=s(v,b)}catch(x){throw v.addToError(x)}if(M===!1){for(let x of a)delete x.node.indexes[x.iterator];return!1}v.walk&&v.proxyOf.nodes?a.push({iterator:v.getIterator(),node:v}):y.indexes[h]+=1}}walkAtRules(s,a){return a?s instanceof RegExp?this.walk((h,y)=>{if(h.type==="atrule"&&s.test(h.name))return a(h,y)}):this.walk((h,y)=>{if(h.type==="atrule"&&h.name===s)return a(h,y)}):(a=s,this.walk((h,y)=>{if(h.type==="atrule")return a(h,y)}))}walkComments(s){return this.walk((a,h)=>{if(a.type==="comment")return s(a,h)})}walkDecls(s,a){return a?s instanceof RegExp?this.walk((h,y)=>{if(h.type==="decl"&&s.test(h.prop))return a(h,y)}):this.walk((h,y)=>{if(h.type==="decl"&&h.prop===s)return a(h,y)}):(a=s,this.walk((h,y)=>{if(h.type==="decl")return a(h,y)}))}walkRules(s,a){return a?s instanceof RegExp?this.walk((h,y)=>{if(h.type==="rule"&&s.test(h.selector))return a(h,y)}):this.walk((h,y)=>{if(h.type==="rule"&&h.selector===s)return a(h,y)}):(a=s,this.walk((h,y)=>{if(h.type==="rule")return a(h,y)}))}};i.registerParse=l=>{p=l},i.registerRule=l=>{w=l},i.registerAtRule=l=>{g=l},i.registerRoot=l=>{m=l},t.exports=i,i.default=i,i.rebuild=l=>{let s=[l];for(;s.length>0;){let a=s.pop();if(a.type==="atrule"?Object.setPrototypeOf(a,g.prototype):a.type==="rule"?Object.setPrototypeOf(a,w.prototype):a.type==="decl"?Object.setPrototypeOf(a,o.prototype):a.type==="comment"?Object.setPrototypeOf(a,r.prototype):a.type==="root"&&Object.setPrototypeOf(a,m.prototype),a[d]=!0,a.nodes)for(let h of a.nodes)s.push(h)}}})),Sr=q(((e,t)=>{var r=Ae(),o=class extends r{constructor(c){super(c),this.type="atrule"}append(...c){return this.proxyOf.nodes||(this.nodes=[]),super.append(...c)}prepend(...c){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...c)}};t.exports=o,o.default=o,r.registerAtRule(o)})),Cr=q(((e,t)=>{var r=Ae(),o,c,f=class extends r{constructor(d){super({type:"document",...d}),this.nodes||(this.nodes=[])}toResult(d={}){return new o(new c,this,d).stringify()}};f.registerLazyResult=d=>{o=d},f.registerProcessor=d=>{c=d},t.exports=f,f.default=f})),Go=q(((e,t)=>{var r="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",o=(f,d=21)=>(g=d)=>{let p="",m=g|0;for(;m-- >0;)p+=f[Math.random()*f.length|0];return p},c=(f=21)=>{let d="",g=f|0;for(;g-- >0;)d+=r[Math.random()*64|0];return d};t.exports={nanoid:c,customAlphabet:o}})),Ys=q(((e,t)=>{var{existsSync:r,readFileSync:o,realpathSync:c}=we(),{dirname:f,isAbsolute:d,join:g,relative:p,sep:m}=we(),{SourceMapConsumer:w,SourceMapGenerator:u}=we();function n(s){try{return c(s)}catch{return s}}function i(s){return Buffer?Buffer.from(s,"base64").toString():window.atob(s)}var l=class{constructor(s,a){if(a.map===!1)return;a.unsafeMap&&(this.unsafeMap=!0),this.loadAnnotation(s),this.inline=this.startWith(this.annotation,"data:");let h=a.map?a.map.prev:void 0,y=this.loadMap(a.from,h);!this.mapFile&&a.from&&(this.mapFile=a.from),this.mapFile&&(this.root=f(this.mapFile)),y&&(this.text=y)}consumer(){return this.consumerCache||(this.consumerCache=new w(this.json||this.text)),this.consumerCache}decodeInline(s){let a=/^data:application\\/json;charset=utf-?8;base64,/,h=/^data:application\\/json;base64,/,y=s.match(/^data:application\\/json;charset=utf-?8,/)||s.match(/^data:application\\/json,/);if(y)return decodeURIComponent(s.substr(y[0].length));let b=s.match(a)||s.match(h);if(b)return i(s.substr(b[0].length));let v=s.slice(22);throw v=v.slice(0,v.indexOf(",")),new Error("Unsupported source map encoding "+v)}getAnnotationURL(s){return s.replace(/^\\/\\*\\s*# sourceMappingURL=/,"").trim()}isMap(s){return typeof s!="object"?!1:typeof s.mappings=="string"||typeof s._mappings=="string"||Array.isArray(s.sections)}loadAnnotation(s){let a=s.match(/\\/\\*\\s*# sourceMappingURL=/g);if(!a)return;let h=s.lastIndexOf(a.pop()),y=s.indexOf("*/",h);h>-1&&y>-1&&(this.annotation=this.getAnnotationURL(s.substring(h,y)))}loadFile(s,a,h){if(!h&&!this.unsafeMap){if(!/\\.map$/i.test(s)||!a)return;let y=p(n(f(a)),n(s));if(y===".."||y.startsWith(".."+m)||d(y))return}if(this.root=f(s),r(s))return this.mapFile=s,o(s,"utf-8").toString().trim()}loadMap(s,a){if(a===!1)return!1;if(a){if(typeof a=="string")return a;if(typeof a=="function"){let h=a(s);if(h){let y=this.loadFile(h,s,!0);if(!y)throw new Error("Unable to load previous source map: "+h.toString());return y}}else{if(a instanceof w)return u.fromSourceMap(a).toString();if(a instanceof u)return a.toString();if(this.isMap(a))return JSON.stringify(a);throw new Error("Unsupported previous source map format: "+a.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let h=this.annotation;s&&(h=g(f(s),h));let y=this.loadFile(h,s,!1);if(y)try{this.json=JSON.parse(y.replace(/^\\)]}\'[^\\n]*\\n/,""))}catch{return}return y}}}startWith(s,a){return s?s.substr(0,a.length)===a:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};t.exports=l,l.default=l})),Pt=q(((e,t)=>{var{nanoid:r}=Go(),{isAbsolute:o,resolve:c}=we(),{SourceMapConsumer:f,SourceMapGenerator:d}=we(),{fileURLToPath:g,pathToFileURL:p}=we(),m=br(),w=Ys(),u=we(),n=Symbol("lineToIndexCache"),i=!!(f&&d),l=!!(c&&o);function s(h){if(h[n])return h[n];let y=h.css.split(`\n`),b=new Array(y.length),v=0;for(let M=0,x=y.length;M<x;M++)b[M]=v,v+=y[M].length+1;return h[n]=b,b}var a=class{get from(){return this.file||this.id}constructor(h,y={}){if(h===null||typeof h>"u"||typeof h=="object"&&!h.toString)throw new Error(`PostCSS received ${h} instead of CSS string`);if(this.css=h.toString(),this.css[0]==="\\uFEFF"||this.css[0]==="\\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,this.document=this.css,y.document&&(this.document=y.document.toString()),y.from&&(!l||/^\\w+:\\/\\//.test(y.from)||o(y.from)?this.file=y.from:this.file=c(y.from)),l&&i){let b=new w(this.css,y);if(b.text){this.map=b;let v=b.consumer().file;!this.file&&v&&(this.file=this.mapResolve(v))}}this.file||(this.id="<input css "+r(6)+">"),this.map&&(this.map.file=this.from)}error(h,y,b,v={}){let M,x,C,S,E;if(y&&typeof y=="object"){let I=y,N=b;if(typeof I.offset=="number"){S=I.offset;let A=this.fromOffset(S);y=A.line,b=A.col}else y=I.line,b=I.column,S=this.fromLineAndColumn(y,b);if(typeof N.offset=="number"){C=N.offset;let A=this.fromOffset(C);x=A.line,M=A.col}else x=N.line,M=N.column,C=this.fromLineAndColumn(N.line,N.column)}else if(b)S=this.fromLineAndColumn(y,b);else{S=y;let I=this.fromOffset(S);y=I.line,b=I.col}let R=this.origin(y,b,x,M);return R?E=new m(h,R.endLine===void 0?R.line:{column:R.column,line:R.line},R.endLine===void 0?R.column:{column:R.endColumn,line:R.endLine},R.source,R.file,v.plugin):E=new m(h,x===void 0?y:{column:b,line:y},x===void 0?b:{column:M,line:x},this.css,this.file,v.plugin),E.input={column:b,endColumn:M,endLine:x,endOffset:C,line:y,offset:S,source:this.css},this.file&&(p&&(E.input.url=p(this.file).toString()),E.input.file=this.file),E}fromLineAndColumn(h,y){return s(this)[h-1]+y-1}fromOffset(h){let y=s(this),b=y[y.length-1],v=0;if(h>=b)v=y.length-1;else{let M=y.length-2,x;for(;v<M;)if(x=v+(M-v>>1),h<y[x])M=x-1;else if(h>=y[x+1])v=x+1;else{v=x;break}}return{col:h-y[v]+1,line:v+1}}mapResolve(h){return/^\\w+:\\/\\//.test(h)?h:c(this.map.consumer().sourceRoot||this.map.root||".",h)}origin(h,y,b,v){if(!this.map)return!1;let M=this.map.consumer(),x=M.originalPositionFor({column:y-1,line:h});if(!x.source)return!1;let C;if(typeof b=="number"){let I=M.originalPositionFor({column:v-1,line:b});I.source&&(C=I)}let S;o(x.source)?S=p(x.source):S=new URL(x.source,p(this.map.mapFile||c(".")+"/"));let E={column:x.column+1,endColumn:C&&C.column+1,endLine:C&&C.line,line:x.line,url:S.toString()};if(S.protocol==="file:")if(g)E.file=g(S);else throw new Error("file: protocol is not available in this PostCSS build");let R=M.sourceContentFor(x.source);return R&&(E.source=R),E}toJSON(){let h={};for(let y of["hasBOM","css","file","id"])this[y]!=null&&(h[y]=this[y]);return this.map&&(h.map={...this.map},h.map.consumerCache&&(h.map.consumerCache=void 0)),h}};t.exports=a,a.default=a,u&&u.registerInput&&u.registerInput(a)})),lt=q(((e,t)=>{var r=Ae(),o,c,f=class extends r{constructor(d){super(d),this.type="root",this.nodes||(this.nodes=[])}normalize(d,g,p){let m=new Set;for(let u of Array.isArray(d)?d:[d])u&&typeof u=="object"&&!u.parent&&u.raws&&typeof u.raws.before<"u"&&m.add(u.raws);let w=super.normalize(d);if(g){if(p==="prepend")this.nodes.length>1?g.raws.before=this.nodes[1].raws.before:delete g.raws.before;else if(this.first!==g)for(let u of w)m.has(u.raws)||(u.raws.before=g.raws.before)}return w}removeChild(d,g){let p=this.index(d);return!g&&p===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[p].raws.before),super.removeChild(d)}toResult(d={}){return new o(new c,this,d).stringify()}};f.registerLazyResult=d=>{o=d},f.registerProcessor=d=>{c=d},t.exports=f,f.default=f,r.registerRoot(f)})),Js=q(((e,t)=>{var r={comma(o){return r.split(o,[","],!0)},space(o){return r.split(o,[" ",`\n`," "])},split(o,c,f){if(typeof o!="string")return[];let d=[],g="",p=!1,m=0,w=!1,u="",n=!1,i=!1;for(let s=0;s<o.length;s++){let a=o[s];if(i){g+=a,a==="*"&&o[s+1]==="/"&&(g+="/",s+=1,i=!1);continue}if(n)n=!1;else if(a==="\\\\")n=!0;else if(w)a===u&&(w=!1);else if(a===\'"\'||a==="\'")w=!0,u=a;else if(a==="/"&&o[s+1]==="*"){g+="/*",s+=1,i=!0;continue}else a==="("?m+=1:a===")"?m>0&&(m-=1):m===0&&c.includes(a)&&(p=!0);if(p){let h=g.trim();(f||h!=="")&&d.push(h),g="",p=!1}else g+=a}let l=g.trim();return(f||l!=="")&&d.push(l),d}};t.exports=r,r.default=r})),xr=q(((e,t)=>{var r=Ae(),o=Js(),c=class extends r{get selectors(){return o.comma(this.selector)}set selectors(f){let d=this.selector?this.selector.match(/,\\s*/):null,g=d?d[0]:","+this.raw("between","beforeOpen");this.selector=f.join(g)}constructor(f){super(f),this.type="rule",this.nodes||(this.nodes=[])}};t.exports=c,c.default=c,r.registerRule(c)})),Ho=q(((e,t)=>{var r=Sr(),o=Lt(),c=kt(),f=Pt(),d=Ys(),g=lt(),p=xr();function m(n,i){return n.inputs?n.inputs.map(l=>{let s={...l,__proto__:f.prototype};return s.map&&(s.map={...s.map,__proto__:d.prototype}),s}):i}function w(n,i,l){let s={...n};if(delete s.inputs,delete s.nodes,s.source){let{inputId:h,...y}=s.source;s.source=y,h!=null&&(s.source.input=i[h])}let a;if(s.type==="root")a=new g(s);else if(s.type==="decl")a=new c(s);else if(s.type==="rule")a=new p(s);else if(s.type==="comment")a=new o(s);else if(s.type==="atrule")a=new r(s);else throw new Error("Unknown node type: "+n.type);if(l){a.nodes=l;for(let h of l)h.parent=a}return a}function u(n,i){if(Array.isArray(n))return n.map(a=>u(a));let l,s=[{childIndex:0,children:[],inputs:m(n,i),json:n}];for(;s.length>0;){let a=s[s.length-1],h=a.json.nodes;if(h&&a.childIndex<h.length){let b=h[a.childIndex];a.childIndex+=1,s.push({childIndex:0,children:[],inputs:m(b,a.inputs),json:b});continue}s.pop();let y=w(a.json,a.inputs,h?a.children:void 0);s.length>0?s[s.length-1].children.push(y):l=y}return l}t.exports=u,u.default=u})),Xs=q(((e,t)=>{var{dirname:r,relative:o,resolve:c,sep:f}=we(),{SourceMapConsumer:d,SourceMapGenerator:g}=we(),{pathToFileURL:p}=we(),m=Pt(),w=!!(d&&g),u=!!(r&&c&&o&&f),n=class{constructor(i,l,s,a){this.stringify=i,this.mapOpts=s.map||{},this.root=l,this.opts=s,this.css=a,this.originalCSS=a,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let i;this.isInline()?i="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?i=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?i=this.mapOpts.annotation(this.opts.to,this.root):i=this.outputFile()+".map";let l=`\n`;this.css.includes(`\\r\n`)&&(l=`\\r\n`),this.css+=l+"/*# sourceMappingURL="+i+" */"}applyPrevMaps(){for(let i of this.previous()){let l=this.toUrl(this.path(i.file)),s=i.root||r(i.file),a;this.mapOpts.sourcesContent===!1?(a=new d(i.text),a.sourcesContent&&(a.sourcesContent=null)):a=i.consumer(),this.map.applySourceMap(a,l,this.toUrl(this.path(s)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1){if(this.root){let i;for(let l=this.root.nodes.length-1;l>=0;l--)i=this.root.nodes[l],i.type==="comment"&&i.text.startsWith("# sourceMappingURL=")&&this.root.removeChild(l)}else if(this.css){let i="/*# sourceMappingURL=",l="",s=0,a;for(;(a=this.css.indexOf(i,s))!==-1;){let h=this.css.indexOf("*/",a+21);if(h===-1)break;for(;a>s&&this.css[a-1]===`\n`;)a--;l+=this.css.slice(s,a),s=h+2}s>0&&(this.css=l+this.css.slice(s))}}}generate(){if(this.clearAnnotation(),u&&w&&this.isMap())return this.generateMap();{let i="";return this.stringify(this.root,l=>{i+=l}),[i]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let i=this.previous()[0].consumer();i.file=this.outputFile(),this.map=g.fromSourceMap(i,{ignoreInvalidMapping:!0})}else this.map=new g({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 g({file:this.outputFile(),ignoreInvalidMapping:!0});let i=1,l=1,s="<no source>",a={generated:{column:0,line:0},original:{column:0,line:0},source:""},h,y;this.stringify(this.root,(b,v,M)=>{if(this.css+=b,v&&M!=="end"&&(a.generated.line=i,a.generated.column=l-1,v.source&&v.source.start?(a.source=this.sourcePath(v),a.original.line=v.source.start.line,a.original.column=v.source.start.column-1,this.map.addMapping(a)):(a.source=s,a.original.line=1,a.original.column=0,this.map.addMapping(a))),y=b.match(/\\n/g),y?(i+=y.length,h=b.lastIndexOf(`\n`),l=b.length-h):l+=b.length,v&&M!=="start"){let x=v.parent||{raws:{}};(!(v.type==="decl"||v.type==="atrule"&&!v.nodes)||v!==x.last||x.raws.semicolon)&&(v.source&&v.source.end?(a.source=this.sourcePath(v),a.original.line=v.source.end.line,a.original.column=v.source.end.column-1,a.generated.line=i,a.generated.column=l-2,this.map.addMapping(a)):(a.source=s,a.original.line=1,a.original.column=0,a.generated.line=i,a.generated.column=l-1,this.map.addMapping(a)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(i=>i.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let i=this.mapOpts.annotation;return typeof i<"u"&&i!==!0?!1:this.previous().length?this.previous().some(l=>l.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(i=>i.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(i){if(this.mapOpts.absolute||i.charCodeAt(0)===60||/^\\w+:\\/\\//.test(i))return i;let l=this.memoizedPaths.get(i);if(l)return l;let s=this.opts.to?r(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(s=r(c(s,this.mapOpts.annotation)));let a=o(s,i);return this.memoizedPaths.set(i,a),a}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(i=>{if(i.source&&i.source.input.map){let l=i.source.input.map;this.previousMaps.includes(l)||this.previousMaps.push(l)}});else{let i=new m(this.originalCSS,this.opts);i.map&&this.previousMaps.push(i.map)}return this.previousMaps}setSourcesContent(){let i={};if(this.root)this.root.walk(l=>{if(l.source){let s=l.source.input.from;if(s&&!i[s]){i[s]=!0;let a=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(a,l.source.input.css)}}});else if(this.css){let l=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(l,this.css)}}sourcePath(i){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(i.source.input.from):this.toUrl(this.path(i.source.input.from))}toBase64(i){return Buffer?Buffer.from(i).toString("base64"):window.btoa(unescape(encodeURIComponent(i)))}toFileUrl(i){let l=this.memoizedFileURLs.get(i);if(l)return l;if(p){let s=p(i).toString();return this.memoizedFileURLs.set(i,s),s}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(i){let l=this.memoizedURLs.get(i);if(l)return l;f==="\\\\"&&(i=i.replace(/\\\\/g,"/"));let s=encodeURI(i).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(i,s),s}};t.exports=n})),qo=q(((e,t)=>{var r=39,o=34,c=92,f=47,d=10,g=32,p=12,m=9,w=13,u=91,n=93,i=40,l=41,s=123,a=125,h=59,y=42,b=58,v=64,M=/[\\t\\n\\f\\r "#\'()/;[\\\\\\]{}]/g,x=/[\\t\\n\\f\\r !"#\'():;@[\\\\\\]{}]|\\/(?=\\*)/g,C=/.[\\r\\n"\'(/\\\\]/,S=/[\\da-f]/i;t.exports=function(R,I={}){let N=R.css.valueOf(),A=I.ignoreErrors,L,ae,V,O,re,F,Z,se,ee,ve,be=N.length,D=0,Se=[],ie=[],le=-1;function _e(){return D}function he(Y){throw R.error("Unclosed "+Y,D)}function z(){return ie.length===0&&D>=be}function ue(Y){if(ie.length)return ie.pop();if(D>=be)return;let te=Y?Y.ignoreUnclosed:!1;switch(L=N.charCodeAt(D),L){case d:case g:case m:case w:case p:O=D;do O+=1,L=N.charCodeAt(O);while(L===g||L===d||L===m||L===w||L===p);F=["space",N.slice(D,O)],D=O-1;break;case u:case n:case s:case a:case b:case h:case l:{let k=String.fromCharCode(L);F=[k,k,D];break}case i:if(ve=Se.length?Se.pop()[1]:"",ee=N.charCodeAt(D+1),ve==="url"&&ee!==r&&ee!==o&&ee!==g&&ee!==d&&ee!==m&&ee!==p&&ee!==w){O=D;do{if(Z=!1,O=N.indexOf(")",O+1),O===-1)if(A||te){O=D;break}else he("bracket");for(se=O;N.charCodeAt(se-1)===c;)se-=1,Z=!Z}while(Z);F=["brackets",N.slice(D,O+1),D,O],D=O}else D<=le?F=["(","(",D]:(O=N.indexOf(")",D+1),ae=N.slice(D,O+1),O===-1||C.test(ae)?(le=O===-1?be:O,F=["(","(",D]):(F=["brackets",ae,D,O],D=O));break;case r:case o:re=L===r?"\'":\'"\',O=D;do{if(Z=!1,O=N.indexOf(re,O+1),O===-1)if(A||te){O=D+1;break}else he("string");for(se=O;N.charCodeAt(se-1)===c;)se-=1,Z=!Z}while(Z);F=["string",N.slice(D,O+1),D,O],D=O;break;case v:M.lastIndex=D+1,M.test(N),M.lastIndex===0?O=N.length-1:O=M.lastIndex-2,F=["at-word",N.slice(D,O+1),D,O],D=O;break;case c:for(O=D,V=!0;N.charCodeAt(O+1)===c;)O+=1,V=!V;if(L=N.charCodeAt(O+1),V&&L!==f&&L!==g&&L!==d&&L!==m&&L!==w&&L!==p&&(O+=1,S.test(N.charAt(O)))){for(;S.test(N.charAt(O+1));)O+=1;N.charCodeAt(O+1)===g&&(O+=1)}F=["word",N.slice(D,O+1),D,O],D=O;break;default:L===f&&N.charCodeAt(D+1)===y?(O=N.indexOf("*/",D+2)+1,O===0&&(A||te?O=N.length:he("comment")),F=["comment",N.slice(D,O+1),D,O],D=O):(x.lastIndex=D+1,x.test(N),x.lastIndex===0?O=N.length-1:O=x.lastIndex-2,F=["word",N.slice(D,O+1),D,O],Se.push(F),D=O)}return D++,F}function U(Y){ie.push(Y)}return{back:U,endOfFile:z,nextToken:ue,position:_e}}})),Yo=q(((e,t)=>{var r=Sr(),o=Lt(),c=kt(),f=lt(),d=xr(),g=qo(),p={empty:!0,space:!0};function m(n){for(let i=n.length-1;i>=0;i--){let l=n[i],s=l[3]||l[2];if(s)return s}}function w(n,i,l){let s="";for(let a=i;a<l;a++)s+=n[a][1];return s}var u=class{constructor(n){this.input=n,this.root=new f,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:n,start:{column:1,line:1,offset:0}}}atrule(n){let i=new r;i.name=n[1].slice(1),i.name===""&&this.unnamedAtrule(i,n),this.init(i,n[2]);let l,s,a,h=!1,y=!1,b=[],v=[];for(;!this.tokenizer.endOfFile();){if(n=this.tokenizer.nextToken(),l=n[0],l==="("||l==="["?v.push(l==="("?")":"]"):l==="{"&&v.length>0?v.push("}"):l===v[v.length-1]&&v.pop(),v.length===0)if(l===";"){i.source.end=this.getPosition(n[2]),i.source.end.offset++,this.semicolon=!0;break}else if(l==="{"){y=!0;break}else if(l==="}"){if(b.length>0){for(a=b.length-1,s=b[a];s&&s[0]==="space";)s=b[--a];s&&(i.source.end=this.getPosition(s[3]||s[2]),i.source.end.offset++)}this.end(n);break}else b.push(n);else b.push(n);if(this.tokenizer.endOfFile()){h=!0;break}}i.raws.between=this.spacesAndCommentsFromEnd(b),b.length?(i.raws.afterName=this.spacesAndCommentsFromStart(b),this.raw(i,"params",b),h&&(n=b[b.length-1],i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++,this.spaces=i.raws.between,i.raws.between="")):(i.raws.afterName="",i.params=""),y&&(i.nodes=[],this.current=i)}checkMissedSemicolon(n){let i=this.colon(n);if(i===!1)return;let l=0,s;for(let a=i-1;a>=0&&(s=n[a],!(s[0]!=="space"&&(l+=1,l===2)));a--);throw this.input.error("Missed semicolon",s[0]==="word"?s[3]+1:s[2])}colon(n){let i=0,l,s,a;for(let[h,y]of n.entries()){if(s=y,a=s[0],a==="("&&(i+=1),a===")"&&(i-=1),i===0&&a===":")if(!l)this.doubleColon(s);else{if(l[0]==="word"&&l[1]==="progid")continue;return h}l=s}return!1}comment(n){let i=new o;this.init(i,n[2]),i.source.end=this.getPosition(n[3]||n[2]),i.source.end.offset++;let l=n[1].slice(2,-2);if(!l.trim())i.text="",i.raws.left=l,i.raws.right="";else{let s=l.match(/^(\\s*)([^]*\\S)(\\s*)$/);i.text=s[2],i.raws.left=s[1],i.raws.right=s[3]}}createTokenizer(){this.tokenizer=g(this.input)}decl(n,i){let l=new c;this.init(l,n[0][2]);let s=n[n.length-1];s[0]===";"&&(this.semicolon=!0,n.pop()),l.source.end=this.getPosition(s[3]||s[2]||m(n)),l.source.end.offset++;let a=0;for(;n[a][0]!=="word";)a===n.length-1&&this.unknownWord([n[a]]),a++;l.raws.before+=w(n,0,a),l.source.start=this.getPosition(n[a][2]);let h=a;for(;a<n.length;){let x=n[a][0];if(x===":"||x==="space"||x==="comment")break;a++}l.prop=w(n,h,a);let y=a,b;for(;a<n.length&&(b=n[a],a++,b[0]!==":");)b[0]==="word"&&/\\w/.test(b[1])&&this.unknownWord([b]);l.raws.between=w(n,y,a),(l.prop[0]==="_"||l.prop[0]==="*")&&(l.raws.before+=l.prop[0],l.prop=l.prop.slice(1));let v=a;for(;a<n.length;){let x=n[a][0];if(x!=="space"&&x!=="comment")break;a++}let M=n.slice(v,a);n=n.slice(a),this.precheckMissedSemicolon(n);for(let x=n.length-1;x>=0;x--){if(b=n[x],b[1].toLowerCase()==="!important"){l.important=!0;let C=this.stringFrom(n,x);C=this.spacesFromEnd(n)+C,C!==" !important"&&(l.raws.important=C);break}else if(b[1].toLowerCase()==="important"){let C=n.slice(0),S="";for(let E=x;E>0;E--){let R=C[E][0];if(S.trim().startsWith("!")&&R!=="space")break;S=C.pop()[1]+S}S.trim().startsWith("!")&&(l.important=!0,l.raws.important=S,n=C)}if(b[0]!=="space"&&b[0]!=="comment")break}n.some(x=>x[0]!=="space"&&x[0]!=="comment")&&(l.raws.between+=M.map(x=>x[1]).join(""),M=[]),this.raw(l,"value",M.concat(n),i),l.value.includes(":")&&!i&&this.checkMissedSemicolon(n)}doubleColon(n){throw this.input.error("Double colon",{offset:n[2]},{offset:n[2]+n[1].length})}emptyRule(n){let i=new d;this.init(i,n[2]),i.selector="",i.raws.between="",this.current=i}end(n){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(n[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(n)}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(n){if(this.spaces+=n[1],this.current.nodes){let i=this.current.nodes[this.current.nodes.length-1];i&&i.type==="rule"&&!i.raws.ownSemicolon&&(i.raws.ownSemicolon=this.spaces,this.spaces="",i.source.end=this.getPosition(n[2]),i.source.end.offset++)}}getPosition(n){let i=this.input.fromOffset(n);return{column:i.col,line:i.line,offset:n}}init(n,i){this.current.push(n),n.source={input:this.input,start:this.getPosition(i)},n.raws.before=this.spaces,this.spaces="",n.type!=="comment"&&(this.semicolon=!1)}other(n){let i=!1,l=null,s=!1,a=null,h=[],y=n[1].startsWith("--"),b=[],v=n;for(;v;){if(l=v[0],b.push(v),l==="("||l==="[")a||(a=v),h.push(l==="("?")":"]");else if(y&&s&&l==="{")a||(a=v),h.push("}");else if(h.length===0)if(l===";")if(s){this.decl(b,y);return}else break;else if(l==="{"){this.rule(b);return}else if(l==="}"){this.tokenizer.back(b.pop()),i=!0;break}else l===":"&&(s=!0);else l===h[h.length-1]&&(h.pop(),h.length===0&&(a=null));v=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(i=!0),h.length>0&&this.unclosedBracket(a),i&&s){if(!y)for(;b.length&&(v=b[b.length-1][0],!(v!=="space"&&v!=="comment"));)this.tokenizer.back(b.pop());this.decl(b,y)}else this.unknownWord(b)}parse(){let n;for(;!this.tokenizer.endOfFile();)switch(n=this.tokenizer.nextToken(),n[0]){case"space":this.spaces+=n[1];break;case";":this.freeSemicolon(n);break;case"}":this.end(n);break;case"comment":this.comment(n);break;case"at-word":this.atrule(n);break;case"{":this.emptyRule(n);break;default:this.other(n)}this.endFile()}precheckMissedSemicolon(){}raw(n,i,l,s){let a,h,y=l.length,b="",v="",M=!0,x,C;for(let S=0;S<y;S+=1)a=l[S],h=a[0],h==="space"&&S===y-1&&!s?M=!1:h==="comment"?(C=l[S-1]?l[S-1][0]:"empty",x=l[S+1]?l[S+1][0]:"empty",!p[C]&&!p[x]?v===","?M=!1:(b+=a[1],v=a[1].slice(-1)):M=!1):(b+=a[1],v=a[1].slice(-1));if(!M){let S=l.reduce((E,R)=>E+R[1],"");n.raws[i]={raw:S,value:b}}n[i]=b}rule(n){n.pop();let i=new d;this.init(i,n[0][2]),i.raws.between=this.spacesAndCommentsFromEnd(n),this.raw(i,"selector",n),this.current=i}spacesAndCommentsFromEnd(n){let i,l="";for(;n.length&&(i=n[n.length-1][0],!(i!=="space"&&i!=="comment"));)l=n.pop()[1]+l;return l}spacesAndCommentsFromStart(n){let i,l="";for(;n.length&&(i=n[0][0],!(i!=="space"&&i!=="comment"));)l+=n.shift()[1];return l}spacesFromEnd(n){let i,l="";for(;n.length&&(i=n[n.length-1][0],i==="space");)l=n.pop()[1]+l;return l}stringFrom(n,i){let l="";for(let s=i;s<n.length;s++)l+=n[s][1];return n.splice(i,n.length-i),l}unclosedBlock(){let n=this.current.source.start;throw this.input.error("Unclosed block",n.line,n.column)}unclosedBracket(n){throw this.input.error("Unclosed bracket",{offset:n[2]},{offset:n[2]+1})}unexpectedClose(n){throw this.input.error("Unexpected }",{offset:n[2]},{offset:n[2]+1})}unknownWord(n){throw this.input.error("Unknown word "+n[0][1],{offset:n[0][2]},{offset:n[0][2]+n[0][1].length})}unnamedAtrule(n,i){throw this.input.error("At-rule without name",{offset:i[2]},{offset:i[2]+i[1].length})}};t.exports=u})),Er=q(((e,t)=>{var r=Ae(),o=Pt(),c=Yo();function f(d,g){let p=new c(new o(d,g));try{p.parse()}catch(m){throw m}return p.root}t.exports=f,f.default=f,r.registerParse(f)})),Qs=q(((e,t)=>{var r=Ae(),{my:o}=Tt(),c=class{constructor(f,d={}){if(this.type="warning",this.text=f,d.node&&d.node.source){d.node[o]||r.rebuild(d.node);let g=d.node.rangeBy(d);this.line=g.start.line,this.column=g.start.column,this.endLine=g.end.line,this.endColumn=g.end.column}for(let g in d)this[g]=d[g]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,start:this.start,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};t.exports=c,c.default=c})),Mr=q(((e,t)=>{var r=Qs(),o=class{get content(){return this.css}constructor(c,f,d){this.processor=c,this.messages=[],this.root=f,this.opts=d,this.css="",this.map=void 0}toString(){return this.css}warn(c,f={}){f.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(f.plugin=this.lastPlugin.postcssPlugin);let d=new r(c,f);return this.messages.push(d),d}warnings(){return this.messages.filter(c=>c.type==="warning")}};t.exports=o,o.default=o})),Zs=q(((e,t)=>{var r={};t.exports=function(c){r[c]||(r[c]=!0,typeof console<"u"&&console.warn&&console.warn(c))}})),Ks=q(((e,t)=>{var r=Ae(),o=Cr(),c=Xs(),f=Er(),d=Mr(),g=lt(),p=At(),{isClean:m,my:w}=Tt(),u=Zs(),n={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},i={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},l={Once:!0,postcssPlugin:!0,prepare:!0},s=0;function a(x){return typeof x=="object"&&typeof x.then=="function"}function h(x){let C=!1,S=n[x.type];return x.type==="decl"?C=x.prop.toLowerCase():x.type==="atrule"&&(C=x.name.toLowerCase()),C&&x.append?[S,S+"-"+C,s,S+"Exit",S+"Exit-"+C]:C?[S,S+"-"+C,S+"Exit",S+"Exit-"+C]:x.append?[S,s,S+"Exit"]:[S,S+"Exit"]}function y(x){let C;return x.type==="document"?C=["Document",s,"DocumentExit"]:x.type==="root"?C=["Root",s,"RootExit"]:C=h(x),{eventIndex:0,events:C,iterator:0,node:x,visitorIndex:0,visitors:[]}}function b(x){let C=[x];for(;C.length>0;){let S=C.pop();if(S[m]=!1,S.nodes)for(let E of S.nodes)C.push(E)}return x}var v={},M=class ei{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"}constructor(C,S,E){this.stringified=!1,this.processed=!1;let R;if(typeof S=="object"&&S!==null&&(S.type==="root"||S.type==="document"))R=b(S);else if(S instanceof ei||S instanceof d)R=b(S.root),S.map&&(typeof E.map>"u"&&(E.map={}),E.map.inline||(E.map.inline=!1),E.map.prev=S.map);else{let I=f;E.syntax&&(I=E.syntax.parse),E.parser&&(I=E.parser),I.parse&&(I=I.parse);try{R=I(S,E)}catch(N){this.processed=!0,this.error=N}R&&!R[w]&&r.rebuild(R)}this.result=new d(C,R,E),this.helpers={...v,postcss:v,result:this.result},this.plugins=this.processor.plugins.map(I=>typeof I=="object"&&I.prepare?{...I,...I.prepare(this.result)}:I)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(C){return this.async().catch(C)}finally(C){return this.async().finally(C)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(C,S){let E=this.result.lastPlugin;try{S&&S.addToError(C),this.error=C,C.name==="CssSyntaxError"&&!C.plugin?(C.plugin=E.postcssPlugin,C.setMessage()):E.postcssVersion}catch(R){console&&console.error&&console.error(R)}return C}prepareVisitors(){this.listeners={};let C=(S,E,R)=>{this.listeners[E]||(this.listeners[E]=[]),this.listeners[E].push([S,R])};for(let S of this.plugins)if(typeof S=="object")for(let E in S){if(!i[E]&&/^[A-Z]/.test(E))throw new Error(`Unknown event ${E} in ${S.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!l[E])if(typeof S[E]=="object")for(let R in S[E])R==="*"?C(S,E,S[E][R]):C(S,E+"-"+R.toLowerCase(),S[E][R]);else typeof S[E]=="function"&&C(S,E,S[E])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let C=0;C<this.plugins.length;C++){let S=this.plugins[C],E=this.runOnRoot(S);if(a(E))try{await E}catch(R){throw this.handleError(R)}}if(this.prepareVisitors(),this.hasListener){let C=this.result.root;for(;!C[m];){C[m]=!0;let S=[y(C)];for(;S.length>0;){let E=this.visitTick(S);if(a(E))try{await E}catch(R){let I=S[S.length-1].node;throw this.handleError(R,I)}}}if(this.listeners.OnceExit)for(let[S,E]of this.listeners.OnceExit){this.result.lastPlugin=S;try{if(C.type==="document"){let R=C.nodes.map(I=>E(I,this.helpers));await Promise.all(R)}else await E(C,this.helpers)}catch(R){throw this.handleError(R)}}}return this.processed=!0,this.stringify()}runOnRoot(C){this.result.lastPlugin=C;try{if(typeof C=="object"&&C.Once){if(this.result.root.type==="document"){let S=this.result.root.nodes.map(E=>C.Once(E,this.helpers));return a(S[0])?Promise.all(S):S}return C.Once(this.result.root,this.helpers)}else if(typeof C=="function")return C(this.result.root,this.result)}catch(S){throw this.handleError(S)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let C=this.result.opts,S=p;C.syntax&&(S=C.syntax.stringify),C.stringifier&&(S=C.stringifier),S.stringify&&(S=S.stringify);let E=this.result.root.source;if(C.map===void 0&&!(E&&E.input&&E.input.map)){let I="";return S(this.result.root,N=>{I+=N}),this.result.css=I,this.result}let R=new c(S,this.result.root,this.result.opts).generate();return this.result.css=R[0],this.result.map=R[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let C of this.plugins)if(a(this.runOnRoot(C)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let C=this.result.root;for(;!C[m];)C[m]=!0,this.walkSync(C);if(this.listeners.OnceExit)if(C.type==="document")for(let S of C.nodes)this.visitSync(this.listeners.OnceExit,S);else this.visitSync(this.listeners.OnceExit,C)}return this.result}then(C,S){return this.async().then(C,S)}toString(){return this.css}visitSync(C,S){for(let[E,R]of C){this.result.lastPlugin=E;let I;try{I=R(S,this.helpers)}catch(N){throw this.handleError(N,S.proxyOf)}if(S.type!=="root"&&S.type!=="document"&&!S.parent)return!0;if(a(I))throw this.getAsyncError()}}visitTick(C){let S=C[C.length-1],{node:E,visitors:R}=S;if(E.type!=="root"&&E.type!=="document"&&!E.parent){C.pop();return}if(R.length>0&&S.visitorIndex<R.length){let[N,A]=R[S.visitorIndex];S.visitorIndex+=1,S.visitorIndex===R.length&&(S.visitors=[],S.visitorIndex=0),this.result.lastPlugin=N;try{return A(E.toProxy(),this.helpers)}catch(L){throw this.handleError(L,E)}}if(S.iterator!==0){let N=S.iterator;S.descending&&(S.descending=!1,E.indexes[N]+=1);let A;for(;A=E.nodes[E.indexes[N]];){if(!A[m]){A[m]=!0,S.descending=!0,C.push(y(A));return}E.indexes[N]+=1}S.iterator=0,delete E.indexes[N]}let I=S.events;for(;S.eventIndex<I.length;){let N=I[S.eventIndex];if(S.eventIndex+=1,N===s){E.nodes&&E.nodes.length&&(E[m]=!0,S.iterator=E.getIterator());return}else if(this.listeners[N]){S.visitors=this.listeners[N];return}}C.pop()}walkSync(C){C[m]=!0;let S=[{eventIndex:0,events:h(C),iterator:0,node:C}];for(;S.length>0;){let E=S[S.length-1],R=E.node;if(E.iterator!==0){let I=E.iterator;E.descending&&(E.descending=!1,R.indexes[I]+=1);let N,A=!1;for(;N=R.nodes[R.indexes[I]];){if(!N[m]){N[m]=!0,E.descending=!0,S.push({eventIndex:0,events:h(N),iterator:0,node:N}),A=!0;break}R.indexes[I]+=1}if(A)continue;E.iterator=0,delete R.indexes[I]}if(E.eventIndex<E.events.length){let I=E.events[E.eventIndex];if(E.eventIndex+=1,I===s)R.nodes&&R.nodes.length&&(E.iterator=R.getIterator());else{let N=this.listeners[I];N&&this.visitSync(N,R.toProxy())&&S.pop()}continue}S.pop()}}warnings(){return this.sync().warnings()}};M.registerPostcss=x=>{v=x},t.exports=M,M.default=M,g.registerLazyResult(M),o.registerLazyResult(M)})),Jo=q(((e,t)=>{var r=Xs(),o=Er(),c=Mr(),f=At(),d=Zs(),g=class{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 p,m=o;try{p=m(this._css,this._opts)}catch(w){this.error=w}if(this.error)throw this.error;return this._root=p,p}get[Symbol.toStringTag](){return"NoWorkResult"}constructor(p,m,w){m=m.toString(),this.stringified=!1,this._processor=p,this._css=m,this._opts=w,this._map=void 0;let u=f;this.result=new c(this._processor,void 0,this._opts),this.result.css=m;let n=this;Object.defineProperty(this.result,"root",{get(){return n.root}});let i=new r(u,void 0,this._opts,m);if(i.isMap()){let[l,s]=i.generate();l&&(this.result.css=l),s&&(this.result.map=s)}else i.clearAnnotation(),this.result.css=i.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(p){return this.async().catch(p)}finally(p){return this.async().finally(p)}sync(){if(this.error)throw this.error;return this.result}then(p,m){return this.async().then(p,m)}toString(){return this._css}warnings(){return[]}};t.exports=g,g.default=g})),Xo=q(((e,t)=>{var r=Cr(),o=Ks(),c=Jo(),f=lt(),d=class{constructor(g=[]){this.version="8.5.32",this.plugins=this.normalize(g)}normalize(g){let p=[];for(let m of g)if(m.postcss===!0?m=m():m.postcss&&(m=m.postcss),typeof m=="object"&&Array.isArray(m.plugins))p=p.concat(m.plugins);else if(typeof m=="object"&&m.postcssPlugin)p.push(m);else if(typeof m=="function")p.push(m);else if(!(typeof m=="object"&&(m.parse||m.stringify)))throw new Error(m+" is not a PostCSS plugin");return p}process(g,p={}){return!this.plugins.length&&!p.parser&&!p.stringifier&&!p.syntax?new c(this,g,p):new o(this,g,p)}use(g){return this.plugins=this.plugins.concat(this.normalize([g])),this}};t.exports=d,d.default=d,f.registerProcessor(d),r.registerProcessor(d)})),Q=So(q(((e,t)=>{var r=Sr(),o=Lt(),c=Ae(),f=br(),d=kt(),g=Cr(),p=Ho(),m=Pt(),w=Ks(),u=Js(),n=_t(),i=Er(),l=Xo(),s=Mr(),a=lt(),h=xr(),y=At(),b=Qs();function v(...M){return M.length===1&&Array.isArray(M[0])&&(M=M[0]),new l(M)}v.plugin=function(x,C){let S=!1;function E(...I){console&&console.warn&&!S&&(S=!0,console.warn(x+`: postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("zh")&&console.warn(x+`: \\u91CC\\u9762 postcss.plugin \\u88AB\\u5F03\\u7528. \\u8FC1\\u79FB\\u6307\\u5357:\nhttps://www.w3ctech.com/topic/2226`));let N=C(...I);return N.postcssPlugin=x,N.postcssVersion=new l().version,N}let R;return Object.defineProperty(E,"postcss",{get(){return R||(R=E()),R}}),E.process=function(I,N,A){return v([E(A)]).process(I,N)},E},v.stringify=y,v.parse=i,v.fromJSON=p,v.list=u,v.comment=M=>new o(M),v.atRule=M=>new r(M),v.decl=M=>new d(M),v.rule=M=>new h(M),v.root=M=>new a(M),v.document=M=>new g(M),v.CssSyntaxError=f,v.Declaration=d,v.Container=c,v.Processor=l,v.Document=g,v.Comment=o,v.Warning=b,v.AtRule=r,v.Result=s,v.Input=m,v.Rule=h,v.Root=a,v.Node=n,w.registerPostcss(v),t.exports=v,v.default=v}))(),1);Q.default;Q.default.stringify;Q.default.fromJSON;Q.default.plugin;Q.default.parse;Q.default.list;Q.default.document;Q.default.comment;Q.default.atRule;Q.default.rule;Q.default.decl;Q.default.root;Q.default.CssSyntaxError;Q.default.Declaration;Q.default.Container;Q.default.Processor;Q.default.Document;Q.default.Comment;Q.default.Warning;Q.default.AtRule;Q.default.Result;Q.default.Input;Q.default.Rule;Q.default.Root;Q.default.Node;var W=(function(e){return e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e})({});function Qo(e){let t={},r=/;(?![^(]*\\))/g,o=/:(.+)/;return e.replace(/\\/\\*.*?\\*\\//g,"").split(r).forEach(function(c){if(c){let f=c.split(o);f.length>1&&(t[rr(f[0].trim())]=f[1].trim())}}),t}function Gr(e){let t=[];for(let r in e){let o=e[r];if(typeof o!="string")continue;let c=ta(r);t.push(`${c}: ${o};`)}return t.join(" ")}var Zo=/-([a-z])/g,Ko=/^--[a-zA-Z0-9-]+$/,rr=e=>Ko.test(e)?e:e.replace(Zo,(t,r)=>r?r.toUpperCase():""),ea=/\\B([A-Z])/g,ta=e=>e.replace(ea,"-$1").toLowerCase(),xe=class ti{parentElement=null;parentNode=null;ownerDocument;firstChild=null;lastChild=null;previousSibling=null;nextSibling=null;ELEMENT_NODE=1;TEXT_NODE=3;nodeType;nodeName;RRNodeType;constructor(...t){}get childNodes(){let t=[],r=this.firstChild;for(;r;)t.push(r),r=r.nextSibling;return t}contains(t){if(t instanceof ti){if(t.ownerDocument!==this.ownerDocument)return!1;if(t===this)return!0}else return!1;for(;t.parentNode;){if(t.parentNode===this)return!0;t=t.parentNode}return!1}appendChild(t){throw new Error("RRDomException: Failed to execute \'appendChild\' on \'RRNode\': This RRNode type does not support this method.")}insertBefore(t,r){throw new Error("RRDomException: Failed to execute \'insertBefore\' on \'RRNode\': This RRNode type does not support this method.")}removeChild(t){throw new Error("RRDomException: Failed to execute \'removeChild\' on \'RRNode\': This RRNode type does not support this method.")}toString(){return"RRNode"}},ra=class ri extends xe{nodeType=9;nodeName="#document";compatMode="CSS1Compat";RRNodeType=W.Document;textContent=null;constructor(...t){super(t),this.ownerDocument=this}get documentElement(){return this.childNodes.find(t=>t.RRNodeType===W.Element&&t.tagName==="HTML")||null}get body(){return this.documentElement?.childNodes.find(t=>t.RRNodeType===W.Element&&t.tagName==="BODY")||null}get head(){return this.documentElement?.childNodes.find(t=>t.RRNodeType===W.Element&&t.tagName==="HEAD")||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(t){let r=t.RRNodeType;if((r===W.Element||r===W.DocumentType)&&this.childNodes.some(c=>c.RRNodeType===r))throw new Error(`RRDomException: Failed to execute \'appendChild\' on \'RRNode\': Only one ${r===W.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);let o=Rr(this,t);return o.parentElement=null,o}insertBefore(t,r){let o=t.RRNodeType;if((o===W.Element||o===W.DocumentType)&&this.childNodes.some(f=>f.RRNodeType===o))throw new Error(`RRDomException: Failed to execute \'insertBefore\' on \'RRNode\': Only one ${o===W.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);let c=ai(this,t,r);return c.parentElement=null,c}removeChild(t){return li(this,t)}open(){this.firstChild=null,this.lastChild=null}close(){}write(t){let r;if(t===\'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">\'?r="-//W3C//DTD XHTML 1.0 Transitional//EN":t===\'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">\'&&(r="-//W3C//DTD HTML 4.0 Transitional//EN"),r){let o=this.createDocumentType("html",r,"");this.open(),this.appendChild(o)}}createDocument(t,r,o){return new ri}createDocumentType(t,r,o){let c=new si(t,r,o);return c.ownerDocument=this,c}createElement(t){let r=new Ft(t);return r.ownerDocument=this,r}createElementNS(t,r){return this.createElement(r)}createTextNode(t){let r=new ii(t);return r.ownerDocument=this,r}createComment(t){let r=new ni(t);return r.ownerDocument=this,r}createCDATASection(t){let r=new oi(t);return r.ownerDocument=this,r}toString(){return"RRDocument"}},si=class extends xe{nodeType=10;RRNodeType=W.DocumentType;name;publicId;systemId;textContent=null;constructor(e,t,r){super(),this.name=e,this.publicId=t,this.systemId=r,this.nodeName=e}toString(){return"RRDocumentType"}},Ft=class extends xe{nodeType=1;RRNodeType=W.Element;tagName;attributes={};shadowRoot=null;scrollLeft;scrollTop;constructor(e){super(),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 na(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?Qo(this.attributes.style):{},t=/\\B([A-Z])/g;return e.setProperty=(r,o,c)=>{if(t.test(r))return;let f=rr(r);o?e[f]=o:delete e[f],c==="important"&&(e[f]+=" !important"),this.attributes.style=Gr(e)},e.removeProperty=r=>{if(t.test(r))return"";let o=rr(r),c=e[o]||"";return delete e[o],this.attributes.style=Gr(e),c},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 Rr(this,e)}insertBefore(e,t){return ai(this,e,t)}removeChild(e){return li(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}`}},sa=class extends Ft{currentTime;volume;paused;muted;playbackRate;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}},ia=class extends Ft{tagName="DIALOG";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")}},ii=class extends xe{nodeType=3;nodeName="#text";RRNodeType=W.Text;data;constructor(e){super(),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}},ni=class extends xe{nodeType=8;nodeName="#comment";RRNodeType=W.Comment;data;constructor(e){super(),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}},oi=class extends xe{nodeName="#cdata-section";nodeType=4;RRNodeType=W.CDATA;data;constructor(e){super(),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}},na=class{onChange;classes=[];constructor(e,t){if(e){let r=e.trim().split(/\\s+/);this.classes.push(...r)}this.onChange=t}add=(...e)=>{for(let t of e){let r=String(t);this.classes.indexOf(r)>=0||this.classes.push(r)}this.onChange&&this.onChange(this.classes.join(" "))};remove=(...e)=>{this.classes=this.classes.filter(t=>e.indexOf(t)===-1),this.onChange&&this.onChange(this.classes.join(" "))}};function Rr(e,t){return t.parentNode&&t.parentNode.removeChild(t),e.lastChild?(e.lastChild.nextSibling=t,t.previousSibling=e.lastChild):(e.firstChild=t,t.previousSibling=null),e.lastChild=t,t.nextSibling=null,t.parentNode=e,t.parentElement=e,t.ownerDocument=e.ownerDocument,t}function ai(e,t,r){if(!r)return Rr(e,t);if(r.parentNode!==e)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 t===r||(t.parentNode&&t.parentNode.removeChild(t),t.previousSibling=r.previousSibling,r.previousSibling=t,t.nextSibling=r,t.previousSibling?t.previousSibling.nextSibling=t:e.firstChild=t,t.parentElement=e,t.parentNode=e,t.ownerDocument=e.ownerDocument),t}function li(e,t){if(t.parentNode!==e)throw new Error("Failed to execute \'removeChild\' on \'RRNode\': The RRNode to be removed is not a child of this RRNode.");return t.previousSibling?t.previousSibling.nextSibling=t.nextSibling:e.firstChild=t.nextSibling,t.nextSibling?t.nextSibling.previousSibling=t.previousSibling:e.lastChild=t.previousSibling,t.previousSibling=null,t.nextSibling=null,t.parentElement=null,t.parentNode=null,t}var ge=(function(e){return e[e.PLACEHOLDER=0]="PLACEHOLDER",e[e.ELEMENT_NODE=1]="ELEMENT_NODE",e[e.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",e[e.TEXT_NODE=3]="TEXT_NODE",e[e.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",e[e.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",e[e.ENTITY_NODE=6]="ENTITY_NODE",e[e.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",e[e.COMMENT_NODE=8]="COMMENT_NODE",e[e.DOCUMENT_NODE=9]="DOCUMENT_NODE",e[e.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",e[e.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",e})({}),sr={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},oa={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"},ke=null;function bt(e,t,r,o=t.mirror||t.ownerDocument.mirror){e=aa(e,t,r,o),ui(e,t,r,o),la(e,t,r)}function aa(e,t,r,o){if(r.afterAppend&&!ke&&(ke=new WeakSet,setTimeout(()=>{ke=null},0)),!Nr(e,t)){let c=St(t,r.mirror,o);e.parentNode?.replaceChild(c,e),e=c}switch(t.RRNodeType){case W.Document:if(!Be(e,t,r.mirror,o)){let c=o.getMeta(t);c&&(r.mirror.removeNodeFromMap(e),e.close(),e.open(),r.mirror.add(e,c),ke?.add(e))}break;case W.Element:{let c=e,f=t;switch(f.tagName){case"IFRAME":{let d=e.contentDocument;if(!d)break;bt(d,t.contentDocument,r,o);break}}f.shadowRoot&&(c.shadowRoot||c.attachShadow({mode:"open"}),ui(c.shadowRoot,f.shadowRoot,r,o)),ua(c,f,o);break}}return e}function la(e,t,r){switch(t.RRNodeType){case W.Document:{let o=t.scrollData;o&&r.applyScroll(o,!0);break}case W.Element:{let o=e,c=t;switch(c.scrollData&&r.applyScroll(c.scrollData,!0),c.inputData&&r.applyInput(c.inputData),c.tagName){case"AUDIO":case"VIDEO":{let f=e,d=c;d.paused!==void 0&&(d.paused?f.pause():f.play()),d.muted!==void 0&&(f.muted=d.muted),d.volume!==void 0&&(f.volume=d.volume),d.currentTime!==void 0&&(f.currentTime=d.currentTime),d.playbackRate!==void 0&&(f.playbackRate=d.playbackRate),d.loop!==void 0&&(f.loop=d.loop);break}case"CANVAS":{let f=t;if(f.rr_dataURL!==null){let d=document.createElement("img");d.onload=()=>{let g=o.getContext("2d");g&&g.drawImage(d,0,0,d.width,d.height)},d.src=f.rr_dataURL}f.canvasMutations.forEach(d=>r.applyCanvas(d.event,d.mutation,e));break}case"STYLE":{let f=o.sheet;f&&t.rules.forEach(d=>r.applyStyleSheetMutation(d,f));break}case"DIALOG":{let f=o,d=c,g=f.open,p=f.matches("dialog:modal"),m=d.open,w=d.isModal,u=p!==w,n=g!==m;if((u||g&&n)&&f.close(),m&&(n||u))try{w?f.showModal():f.show()}catch(i){console.warn(i)}break}}break}case W.Text:case W.Comment:case W.CDATA:e.textContent!==t.data&&(e.textContent=t.data)}ke?.has(e)&&(ke.delete(e),r.afterAppend?.(e,r.mirror.getId(e)))}function ua(e,t,r){let o=e.attributes,c=t.attributes;for(let f in c){let d=c[f];if(r.getMeta(t)?.isSVG&&sr[f])e.setAttributeNS(sr[f],f,d);else if(t.tagName==="CANVAS"&&f==="rr_dataURL"){let g=document.createElement("img");g.src=d,g.onload=()=>{let p=e.getContext("2d");p&&p.drawImage(g,0,0,g.width,g.height)}}else{if(t.tagName==="IFRAME"&&f==="srcdoc")continue;try{e.setAttribute(f,d)}catch(g){console.warn(g)}}}for(let{name:f}of Array.from(o))f in c||e.removeAttribute(f);t.scrollLeft&&(e.scrollLeft=t.scrollLeft),t.scrollTop&&(e.scrollTop=t.scrollTop)}function ui(e,t,r,o){let c=Array.from(e.childNodes),f=t.childNodes;if(c.length===0&&f.length===0)return;let d=0,g=c.length-1,p=0,m=f.length-1,w=c[d],u=c[g],n=f[p],i=f[m],l,s;for(;d<=g&&p<=m;)if(w===void 0)w=c[++d];else if(u===void 0)u=c[--g];else if(Be(w,n,r.mirror,o))w=c[++d],n=f[++p];else if(Be(u,i,r.mirror,o))u=c[--g],i=f[--m];else if(Be(w,i,r.mirror,o)){try{e.insertBefore(w,u.nextSibling)}catch(y){console.warn(y)}w=c[++d],i=f[--m]}else if(Be(u,n,r.mirror,o)){try{e.insertBefore(u,w)}catch(y){console.warn(y)}u=c[--g],n=f[++p]}else{if(!l){l={};for(let b=d;b<=g;b++){let v=c[b];v&&r.mirror.hasNode(v)&&(l[r.mirror.getId(v)]=b)}}s=l[o.getId(n)];let y=c[s];if(s!==void 0&&y&&Be(y,n,r.mirror,o)){try{e.insertBefore(y,w)}catch(b){console.warn(b)}c[s]=void 0}else{let b=St(n,r.mirror,o);e.nodeName==="#document"&&w&&(b.nodeType===b.DOCUMENT_TYPE_NODE&&w.nodeType===w.DOCUMENT_TYPE_NODE||b.nodeType===b.ELEMENT_NODE&&w.nodeType===w.ELEMENT_NODE)&&(e.removeChild(w),r.mirror.removeNodeFromMap(w),w=c[++d]);try{e.insertBefore(b,w||null)}catch(v){console.warn(v)}}n=f[++p]}if(d>g){let y=f[m+1],b=null;for(y&&(b=r.mirror.getNode(o.getId(y)));p<=m;++p){let v=St(f[p],r.mirror,o);try{e.insertBefore(v,b)}catch(M){console.warn(M)}}}else if(p>m)for(;d<=g;d++){let y=c[d];if(!(!y||y.parentNode!==e))try{e.removeChild(y),r.mirror.removeNodeFromMap(y)}catch(b){console.warn(b)}}let a=e.firstChild,h=t.firstChild;for(;a!==null&&h!==null;)bt(a,h,r,o),a=a.nextSibling,h=h.nextSibling}function St(e,t,r){let o=r.getId(e),c=r.getMeta(e),f=null;if(o>-1&&(f=t.getNode(o)),f!==null&&Nr(f,e))return f;switch(e.RRNodeType){case W.Document:f=new Document;break;case W.DocumentType:f=document.implementation.createDocumentType(e.name,e.publicId,e.systemId);break;case W.Element:{let d=e.tagName.toLowerCase();d=oa[d]||d,c&&"isSVG"in c&&c?.isSVG?f=document.createElementNS(sr.svg,d):f=document.createElement(e.tagName);break}case W.Text:f=document.createTextNode(e.data);break;case W.Comment:f=document.createComment(e.data);break;case W.CDATA:f=document.createCDATASection(e.data)}c&&t.add(f,{...c});try{ke?.add(f)}catch{}return f}function Nr(e,t){return e.nodeType!==t.nodeType?!1:e.nodeType!==e.ELEMENT_NODE||e.tagName.toUpperCase()===t.tagName}function Be(e,t,r,o){let c=r.getId(e),f=o.getId(t);return c===-1||c!==f?!1:Nr(e,t)}var Ut=class ci extends ra{UNSERIALIZED_STARTING_ID=-2;_unserializedId=this.UNSERIALIZED_STARTING_ID;get unserializedId(){return this._unserializedId--}mirror=Sa();scrollData=null;constructor(t){super(),t&&(this.mirror=t)}createDocument(t,r,o){return new ci}createDocumentType(t,r,o){let c=new ca(t,r,o);return c.ownerDocument=this,c}createElement(t){let r=t.toUpperCase(),o;switch(r){case"AUDIO":case"VIDEO":o=new ha(r);break;case"IFRAME":o=new ma(r,this.mirror);break;case"CANVAS":o=new da(r);break;case"STYLE":o=new pa(r);break;case"DIALOG":o=new fa(r);break;default:o=new Bt(r)}return o.ownerDocument=this,o}createComment(t){let r=new ya(t);return r.ownerDocument=this,r}createCDATASection(t){let r=new wa(t);return r.ownerDocument=this,r}createTextNode(t){let r=new ga(t);return r.ownerDocument=this,r}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}},ca=si,Bt=class extends Ft{inputData=null;scrollData=null},ha=class extends sa{},fa=class extends ia{},da=class extends Bt{rr_dataURL=null;canvasMutations=[];getContext(){return null}},pa=class extends Bt{rules=[]},ma=class extends Bt{contentDocument=new Ut;constructor(e,t){super(e),this.contentDocument.mirror=t}},ga=ii,ya=ni,wa=oi;function va(e){return e instanceof HTMLFormElement?"FORM":e.tagName.toUpperCase()}function hi(e,t,r,o){let c;switch(e.nodeType){case ge.DOCUMENT_NODE:o&&o.nodeName==="IFRAME"?c=o.contentDocument:(c=t,c.compatMode=e.compatMode);break;case ge.DOCUMENT_TYPE_NODE:{let d=e;c=t.createDocumentType(d.name,d.publicId,d.systemId);break}case ge.ELEMENT_NODE:{let d=e,g=va(d);c=t.createElement(g);let p=c;for(let{name:m,value:w}of Array.from(d.attributes))p.attributes[m]=w;d.scrollLeft&&(p.scrollLeft=d.scrollLeft),d.scrollTop&&(p.scrollTop=d.scrollTop);break}case ge.TEXT_NODE:c=t.createTextNode(e.textContent||"");break;case ge.CDATA_SECTION_NODE:c=t.createCDATASection(e.data);break;case ge.COMMENT_NODE:c=t.createComment(e.textContent||"");break;case ge.DOCUMENT_FRAGMENT_NODE:c=o.attachShadow({mode:"open"});break;default:return null}let f=r.getMeta(e);return t instanceof Ut&&(f||(f=fi(c,t.unserializedId),r.add(e,f)),t.mirror.add(c,{...f})),c}function ba(e,t=jo(),r=new Ut){function o(c,f){let d=hi(c,r,t,f);if(d!==null)if(f?.nodeName!=="IFRAME"&&c.nodeType!==ge.DOCUMENT_FRAGMENT_NODE&&(f?.appendChild(d),d.parentNode=f,d.parentElement=f),c.nodeName==="IFRAME"){let g=c.contentDocument;g&&o(g,d)}else(c.nodeType===ge.DOCUMENT_NODE||c.nodeType===ge.ELEMENT_NODE||c.nodeType===ge.DOCUMENT_FRAGMENT_NODE)&&(c.nodeType===ge.ELEMENT_NODE&&c.shadowRoot&&o(c.shadowRoot,d),c.childNodes.forEach(g=>o(g,d)))}return o(e,null),r}function Sa(){return new Ca}var Ca=class{idNodeMap=new Map;nodeMetaMap=new WeakMap;getId(e){return e?this.getMeta(e)?.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 o=this.nodeMetaMap.get(r);o&&this.nodeMetaMap.set(t,o)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};function fi(e,t){switch(e.RRNodeType){case W.Document:return{id:t,type:e.RRNodeType,childNodes:[]};case W.DocumentType:{let r=e;return{id:t,type:e.RRNodeType,name:r.name,publicId:r.publicId,systemId:r.systemId}}case W.Element:return{id:t,type:e.RRNodeType,tagName:e.tagName.toLowerCase(),attributes:{},childNodes:[]};case W.Text:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case W.Comment:return{id:t,type:e.RRNodeType,textContent:e.textContent||""};case W.CDATA:return{id:t,type:e.RRNodeType,textContent:""}}}var Hr={Node:["childNodes","parentNode","parentElement","textContent","ownerDocument","firstChild","lastChild","nextSibling","previousSibling"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},qr={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Xe={},ir={},Yr=0;function xa(e){let t=globalThis?.Zone?.__symbol__?.(e);if(t&&globalThis[t])return globalThis[t]}function Or(e){if(Xe[e])return Xe[e];let t=xa(e)||globalThis[e],r=t.prototype,o=e in Hr?Hr[e]:void 0,c=!!(o&&o.every(g=>!!Object.getOwnPropertyDescriptor(r,g)?.get?.toString().includes("[native code]"))),f=e in qr?qr[e]:void 0,d=!!(f&&f.every(g=>typeof r[g]=="function"&&r[g]?.toString().includes("[native code]")));if(c&&d)return Xe[e]=t.prototype,t.prototype;try{let g=document.createElement("iframe");g.style.display="none",document.body.appendChild(g);let p=g.contentWindow;if(!p)return t.prototype;let m=p[e].prototype;if(!m)return g.remove(),r;let w=navigator.userAgent;return w.includes("Safari")&&!w.includes("Chrome")?(g.classList.add("rr-block"),g.setAttribute("__rrwebUntaintedMutationObserver",""),ir[e]=()=>g.remove()):g.remove(),Xe[e]=m}catch{return r}}var Jr={};function pe(e,t,r){let o=Jr[e]?.[r];if(o)return o.call(t);let c=Or(e),f=Object.getOwnPropertyDescriptor(c,r)?.get;return f?((Jr[e]||={})[r]=f,f.call(t)):t[r]}var Vt={};function di(e,t,r){let o=`${e}.${String(r)}`;if(Vt[o])return Vt[o].bind(t);let c=Or(e)[r];return typeof c!="function"?t[r]:(Vt[o]=c,c.bind(t))}function Ea(e){return pe("Node",e,"ownerDocument")}function Ma(e){return pe("Node",e,"childNodes")}function Ra(e){return pe("Node",e,"parentNode")}function Na(e){return pe("Node",e,"parentElement")}function Oa(e){return pe("Node",e,"textContent")}function Ia(e){return pe("Node",e,"firstChild")}function Da(e){return pe("Node",e,"lastChild")}function Aa(e){return pe("Node",e,"nextSibling")}function Ta(e){return pe("Node",e,"previousSibling")}function _a(e,t){return di("Node",e,"contains")(t)}function La(e){return di("Node",e,"getRootNode")()}function ka(e){return!e||!("host"in e)?null:pe("ShadowRoot",e,"host")}function Pa(e){return e.styleSheets}function Fa(e){return!e||!("shadowRoot"in e)?null:pe("Element",e,"shadowRoot")}function Ua(e,t){return pe("Element",e,"querySelector")(t)}function Ba(e,t){return pe("Element",e,"querySelectorAll")(t)}function pi(){let e=Or("MutationObserver");Yr++;let t=!1;return[e.constructor,()=>{if(t||(t=!0,--Yr!==0))return;let r=ir.MutationObserver;if(r)try{r()}finally{delete Xe.MutationObserver,delete ir.MutationObserver}}]}var it=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(it=()=>new Date().getTime());function Fe(e,t,r){try{if(!(t in e))return()=>{};let o=e[t],c=r(o);return typeof c=="function"&&(c.prototype=c.prototype||{},Object.defineProperties(c,{__rrweb_original__:{enumerable:!1,value:o}})),e[t]=c,()=>{e[t]=o}}catch{return()=>{}}}var P={ownerDocument:Ea,childNodes:Ma,parentNode:Ra,parentElement:Na,textContent:Oa,firstChild:Ia,lastChild:Da,nextSibling:Aa,previousSibling:Ta,contains:_a,getRootNode:La,host:ka,styleSheets:Pa,shadowRoot:Fa,querySelector:Ua,querySelectorAll:Ba,nowTimestamp:it,mutationObserverCtor:pi,patch:Fe};function oe(e,t,r=document){let o={capture:!0,passive:!0};return r.addEventListener(e,t,o),()=>r.removeEventListener(e,t,o)}var We=`Please stop import mirror directly. Instead of that,\\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\\r\nor you can use record.mirror to access the mirror instance during recording.`,Xr={map:{},getId(){return console.error(We),-1},getNode(){return console.error(We),null},removeNodeFromMap(){console.error(We)},has(){return console.error(We),!1},reset(){console.error(We)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Xr=new Proxy(Xr,{get(e,t,r){return t==="map"&&console.error(We),Reflect.get(e,t,r)}}));function nt(e,t,r={}){let o=null,c=0;return function(...f){let d=Date.now();!c&&r.leading===!1&&(c=d);let g=t-(d-c),p=this;g<=0||g>t?(o&&(clearTimeout(o),o=null),c=d,e.apply(p,f)):!o&&r.trailing!==!1&&(o=setTimeout(()=>{c=r.leading===!1?0:Date.now(),o=null,e.apply(p,f)},g))}}function Wt(e,t,r,o,c=window){let f=c.Object.getOwnPropertyDescriptor(e,t);return c.Object.defineProperty(e,t,o?r:{set(d){setTimeout(()=>{r.set.call(this,d)},0),f&&f.set&&f.set.call(this,d)}}),()=>Wt(e,t,f||{},!0)}function mi(e){let t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:t.documentElement.scrollLeft||t?.body&&P.parentElement(t.body)?.scrollLeft||t?.body?.scrollLeft||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:t?.documentElement.scrollTop||t?.body&&P.parentElement(t.body)?.scrollTop||t?.body?.scrollTop||0}}function gi(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function yi(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function wi(e){return e?e.nodeType===e.ELEMENT_NODE?e:P.parentElement(e):null}function ce(e,t,r,o){if(!e)return!1;let c=wi(e);if(!c)return!1;try{if(typeof t=="string"){if(c.classList.contains(t)||o&&c.closest("."+t)!==null)return!0}else if(vt(c,t,o))return!0}catch{}return!!(r&&(c.matches(r)||o&&c.closest(r)!==null))}function Wa(e,t){return t.getId(e)!==-1}function Gt(e,t,r){return e.tagName==="TITLE"&&r.headTitleMutations?!0:t.getId(e)===-2}function vi(e,t){if(Ke(e))return!1;let r=t.getId(e);if(!t.has(r))return!0;let o=P.parentNode(e);return o&&o.nodeType===e.DOCUMENT_NODE?!1:o?vi(o,t):!0}function nr(e){return!!e.changedTouches}function bi(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function $a(e){let t={},r=(c,f)=>{let d={value:c,parent:f,children:[]};return t[c.node.id]=d,d},o=[];for(let c of e){let{nextId:f,parentId:d}=c;if(f&&f in t){let g=t[f];if(g.parent){let p=g.parent.children.indexOf(g);g.parent.children.splice(p,0,r(c,g.parent))}else{let p=o.indexOf(g);o.splice(p,0,r(c,null))}continue}if(d in t){let g=t[d];g.children.push(r(c,g));continue}o.push(r(c,null))}return o}function Si(e,t){t(e.value);for(let r=e.children.length-1;r>=0;r--)Si(e.children[r],t)}function rt(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Ci(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function xi(e,t){let r=e.ownerDocument?.defaultView?.frameElement;if(!r||r===t)return{x:0,y:0,relativeScale:1,absoluteScale:1};let o=r.getBoundingClientRect(),c=xi(r,t),f=o.height/r.clientHeight;return{x:o.x*c.relativeScale+c.x,y:o.y*c.relativeScale+c.y,relativeScale:f,absoluteScale:c.absoluteScale*f}}function Pe(e){return e?e instanceof xe&&"shadowRoot"in e?!!e.shadowRoot:!!P.shadowRoot(e):!1}function Qe(e,t){let r=e?.[t[0]];return r?t.length===1?r:Qe(r.cssRules,t.slice(1)):null}function Qr(e){let t=[...e];return{positions:t,index:t.pop()}}function za(e){let t=new Set,r=[];for(let o=e.length;o--;){let c=e[o];t.has(c.id)||(r.push(c),t.add(c.id))}return r}var Ei=class{id=1;styleIDMap=new WeakMap;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++}};function Mi(e){let t=null;return"getRootNode"in e&&P.getRootNode(e)?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&P.host(P.getRootNode(e))&&(t=P.host(P.getRootNode(e))),t}function ja(e){let t=e,r;for(;r=Mi(t);)t=r;return t}function Va(e){let t=P.ownerDocument(e);if(!t)return!1;let r=ja(e);return P.contains(t,r)}function or(e){let t=P.ownerDocument(e);return t?P.contains(t,e)||Va(e):!1}var _=(function(e){return e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e[e.Asset=7]="Asset",e[e.Annotation=8]="Annotation",e})({}),T=(function(e){return e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e})({}),G=(function(e){return e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e})({}),Ee=(function(e){return e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e})({}),Ie=(function(e){return e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e})({}),Le=(function(e){return e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e})({}),j=(function(e){return e.Start="start",e.Pause="pause",e.Resume="resume",e.Resize="resize",e.Finish="finish",e.FullsnapshotRebuilded="fullsnapshot-rebuilded",e.LoadStylesheetStart="load-stylesheet-start",e.LoadStylesheetEnd="load-stylesheet-end",e.SkipStart="skip-start",e.SkipEnd="skip-end",e.MouseInteraction="mouse-interaction",e.EventCast="event-cast",e.CustomEvent="custom-event",e.Annotation="annotation",e.Flush="flush",e.StateChange="state-change",e.PlayBack="play-back",e.Destroy="destroy",e})({}),Me=(function(e){return e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e})({}),Zr=(e,t)=>`${e}@${t}`,Ga=class{frozen=!1;locked=!1;texts=[];attributes=[];attributeMap=new WeakMap;removes=[];mapRemoves=[];movedMap={};addedSet=new Set;movedSet=new Set;droppedSet=new Set;removesSubTreeCache=new Set;mutationCb;blockClass;blockSelector;maskTextClass;maskTextSelector;inlineStylesheet;maskInputOptions;maskTextFn;maskInputFn;keepIframeSrcFn;recordCanvas;inlineImages;slimDOMOptions;dataURLOptions;doc;mirror;iframeManager;stylesheetManager;shadowDomManager;processedNodeManager;unattachedDoc;init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1,this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0}unlock(){this.locked=!1,this.emit()}processMutations=e=>{e.forEach(this.processMutation),this.emit()};emit=()=>{if(this.frozen||this.locked)return;let e=[],t=new Set;for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let u of this.movedSet){let n=P.parentNode(u);this.removesSubTreeCache.has(n)&&!this.movedSet.has(n)||this.addedSet.add(u)}let r=null,o=null,c=-1,f=null,d=!1,g=new Set,p=this.addedSet.values(),m=p.next();for(;this.addedSet.size;){if(r!==null&&this.addedSet.has(P.previousSibling(r)))f=r,r=P.previousSibling(r);else{for(this.addedSet.has(m.value)||(m=p.next()),r=m.value;;){if(o=P.parentNode(r),this.addedSet.has(o)){r=o;continue}break}if(g.has(o))o=null;else if(o){if(or(o)?(d=Kr(this.droppedSet,o)||this.removesSubTreeCache.has(o),d&&Kr(this.movedSet,r)&&(d=!1)):d=!0,this.addedSet.has(P.lastChild(o)))r=P.lastChild(o),f=null;else for(;;){if(f=P.nextSibling(r),this.addedSet.has(f)){r=f;continue}break}if(c=Ke(o)?this.mirror.getId(Mi(r)):this.mirror.getId(o),c===-1&&o.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let l=P.host(o);c=this.mirror.getId(l)}}}if(this.addedSet.delete(r),!o||c===-1){g.add(r);continue}else if(d){this.droppedSet.add(r);continue}let u=!1;if(r.nodeType===Node.TEXT_NODE){let l=o.tagName;if(l==="TEXTAREA")continue;l==="STYLE"&&t.has(c)&&(u=!0)}let n=f?this.mirror.getId(f):null;for(;n===-2;)f=f&&P.nextSibling(f),n=f&&this.mirror.getId(f);if(n===-1){console.warn("Couldn\'t record new node. Couldn\'t find mirror id for nextSibling:",f),r=null;continue}let i=je(r,{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:l=>{rt(l,this.mirror)&&this.iframeManager.addIframe(l),Ci(l,this.mirror)&&this.stylesheetManager.trackLinkElement(l),Pe(r)&&this.shadowDomManager.addShadowRoot(P.shadowRoot(r),this.doc)},onIframeLoad:(l,s)=>{this.iframeManager.attachIframe(l,s),this.shadowDomManager.observeAttachShadow(l)},onStylesheetLoad:(l,s)=>{this.stylesheetManager.attachLinkElement(l,s)},cssCaptured:u});i&&(e.push({parentId:c,nextId:n,node:i}),t.add(i.id))}let w={texts:this.texts.map(u=>{let n=u.node,i=P.parentNode(n);return i&&i.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(i),{id:this.mirror.getId(n),value:u.value}}).filter(u=>!t.has(u.id)).filter(u=>this.mirror.has(u.id)),attributes:this.attributes.map(u=>{let{attributes:n}=u;if(typeof n.style=="string"){let i=JSON.stringify(u.styleDiff),l=JSON.stringify(u._unchangedStyles);i.length<n.style.length&&(i+l).split("var(").length===n.style.split("var(").length&&(n.style=u.styleDiff)}return{id:this.mirror.getId(u.node),attributes:n}}).filter(u=>!t.has(u.id)).filter(u=>this.mirror.has(u.id)),removes:this.removes,adds:e};!w.texts.length&&!w.attributes.length&&!w.removes.length&&!w.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(w))};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(P.childNodes(e),o=>P.textContent(o)||"").join("");t.attributes.value=gt({element:e,maskInputOptions:this.maskInputOptions,tagName:e.tagName,type:yt(e),value:r,maskInputFn:this.maskInputFn})};processMutation=e=>{if(!Gt(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{let t=P.textContent(e.target);!ce(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:Ns(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,wi(e.target)):t.replace(/[\\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,r=Ce(t.tagName),o=e.attributeName,c=e.target.getAttribute(o);if(o==="value"){let d=yt(t);c=gt({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:d,value:c,maskInputFn:this.maskInputFn})}if(ce(e.target,this.blockClass,this.blockSelector,!1)||c===e.oldValue)return;let f=this.attributeMap.get(e.target);if(r==="iframe"&&o==="src"&&!this.keepIframeSrcFn(c))if(!t.contentDocument)o="rr_src";else return;if(f||(f={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(f),this.attributeMap.set(e.target,f)),o==="type"&&r==="input"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!Ms(r,o,c))if(f.attributes[o]=Es(this.doc,r,Ce(o),c),o==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}let d=this.unattachedDoc.createElement("span");e.oldValue&&d.setAttribute("style",e.oldValue);for(let g of Array.from(t.style)){let p=t.style.getPropertyValue(g),m=t.style.getPropertyPriority(g);p!==d.style.getPropertyValue(g)||m!==d.style.getPropertyPriority(g)?m===""?f.styleDiff[g]=p:f.styleDiff[g]=[p,m]:f._unchangedStyles[g]=[p,m]}for(let g of Array.from(d.style))t.style.getPropertyValue(g)===""&&(f.styleDiff[g]=!1)}else o==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?f.attributes.rr_open_mode="modal":f.attributes.rr_open_mode="non-modal");break}case"childList":if(ce(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=>{or(t)||this.shadowDomManager.removeShadowRootsIn(t);let r=this.mirror.getId(t),o=Ke(e.target)?this.mirror.getId(P.host(e.target)):this.mirror.getId(e.target);ce(e.target,this.blockClass,this.blockSelector,!1)||Gt(t,this.mirror,this.slimDOMOptions)||!Wa(t,this.mirror)||(this.addedSet.has(t)?(ar(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||vi(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Zr(r,o)]?ar(this.movedSet,t):(this.removes.push({parentId:o,id:r,isShadow:Ke(e.target)&&et(e.target)?!0:void 0}),Ha(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}};genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Gt(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[Zr(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);ce(e,this.blockClass,this.blockSelector,!1)||(P.childNodes(e).forEach(r=>this.genAdds(r)),Pe(e)&&P.childNodes(P.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}}};function ar(e,t){e.delete(t),P.childNodes(t).forEach(r=>ar(e,r))}function Ha(e,t){let r=[e];for(;r.length;){let o=r.pop();t.has(o)||(t.add(o),P.childNodes(o).forEach(c=>r.push(c)))}}function Kr(e,t){return e.size===0?!1:Ri(e,t)}function Ri(e,t){if(e.has(t))return!0;let r=P.parentNode(t);return r?Ri(e,r):!1}var st;function qa(e){st=e}function Ya(){st=void 0}var $=e=>st?((...r)=>{try{return e(...r)}catch(o){if(st&&st(o)===!0)return;throw o}}):e,He=new Set;function ut(e){try{if("composedPath"in e){let t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Ni(e,t){let r=new Ga;He.add(r),r.init(e);let[o,c]=pi(),f=new o($(r.processMutations.bind(r)));return f.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),()=>{f.disconnect(),He.delete(r),c()}}function Ja({mousemoveCb:e,sampling:t,doc:r,mirror:o}){if(t.mousemove===!1)return()=>{};let c=typeof t.mousemove=="number"?t.mousemove:50,f=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500,d=[],g,p=nt($(u=>{let n=Date.now()-g;e(d.map(i=>(i.timeOffset-=n,i)),u),d=[],g=null}),f),m=$(nt($(u=>{let n=ut(u),{clientX:i,clientY:l}=nr(u)?u.changedTouches[0]:u;g||(g=it()),d.push({x:i,y:l,id:o.getId(n),timeOffset:it()-g}),p(typeof DragEvent<"u"&&u instanceof DragEvent?T.Drag:u instanceof MouseEvent?T.MouseMove:T.TouchMove)}),c,{trailing:!1})),w=[oe("mousemove",m,r),oe("touchmove",m,r),oe("drag",m,r)];return $(()=>{w.forEach(u=>u())})}function Xa({mouseInteractionCb:e,doc:t,mirror:r,blockClass:o,blockSelector:c,sampling:f}){if(f.mouseInteraction===!1)return()=>{};let d=f.mouseInteraction===!0||f.mouseInteraction===void 0?{}:f.mouseInteraction,g=[],p=null,m=w=>u=>{let n=ut(u);if(ce(n,o,c,!0))return;let i=null,l=w;if("pointerType"in u){switch(u.pointerType){case"mouse":i=Ee.Mouse;break;case"touch":i=Ee.Touch;break;case"pen":i=Ee.Pen}i===Ee.Touch?G[w]===G.MouseDown?l="TouchStart":G[w]===G.MouseUp&&(l="TouchEnd"):Ee.Pen}else nr(u)&&(i=Ee.Touch);i!==null?(p=i,(l.startsWith("Touch")&&i===Ee.Touch||l.startsWith("Mouse")&&i===Ee.Mouse)&&(i=null)):G[w]===G.Click&&(i=p,p=null);let s=nr(u)?u.changedTouches[0]:u;if(!s)return;let a=r.getId(n),{clientX:h,clientY:y}=s;$(e)({type:G[l],id:a,x:h,y,...i!==null&&{pointerType:i}})};return Object.keys(G).filter(w=>Number.isNaN(Number(w))&&!w.endsWith("_Departed")&&d[w]!==!1).forEach(w=>{let u=Ce(w),n=m(w);if(window.PointerEvent)switch(G[w]){case G.MouseDown:case G.MouseUp:u=u.replace("mouse","pointer");break;case G.TouchStart:case G.TouchEnd:return}g.push(oe(u,n,t))}),$(()=>{g.forEach(w=>w())})}function Oi({scrollCb:e,doc:t,mirror:r,blockClass:o,blockSelector:c,sampling:f}){return oe("scroll",$(nt($(d=>{let g=ut(d);if(!g||ce(g,o,c,!0))return;let p=r.getId(g);if(g===t&&t.defaultView){let m=mi(t.defaultView);e({id:p,x:m.left,y:m.top})}else e({id:p,x:g.scrollLeft,y:g.scrollTop})}),f.scroll||100)),t)}function Qa({viewportResizeCb:e},{win:t}){let r=-1,o=-1;return oe("resize",$(nt($(()=>{let c=gi(),f=yi();(r!==c||o!==f)&&(e({width:Number(f),height:Number(c)}),r=c,o=f)}),200)),t)}var Za=["INPUT","TEXTAREA","SELECT"],es=new WeakMap;function Ka({inputCb:e,doc:t,mirror:r,blockClass:o,blockSelector:c,ignoreClass:f,ignoreSelector:d,maskInputOptions:g,maskInputFn:p,sampling:m,userTriggeredOnInput:w}){function u(h){let y=ut(h),b=h.isTrusted,v=y&&y.tagName;if(y&&v==="OPTION"&&(y=P.parentElement(y)),!y||!v||Za.indexOf(v)<0||ce(y,o,c,!0)||y.classList.contains(f)||d&&y.matches(d))return;let M=y.value,x=!1,C=yt(y)||"";C==="radio"||C==="checkbox"?x=y.checked:(g[v.toLowerCase()]||g[C])&&(M=gt({element:y,maskInputOptions:g,tagName:v,type:C,value:M,maskInputFn:p})),n(y,w?{text:M,isChecked:x,userTriggered:b}:{text:M,isChecked:x});let S=y.name;C==="radio"&&S&&x&&t.querySelectorAll(`input[type="radio"][name="${S}"]`).forEach(E=>{if(E!==y){let R=E.value;n(E,w?{text:R,isChecked:!x,userTriggered:!1}:{text:R,isChecked:!x})}})}function n(h,y){let b=es.get(h);if(!b||b.text!==y.text||b.isChecked!==y.isChecked){es.set(h,y);let v=r.getId(h);$(e)({...y,id:v})}}let i=(m.input==="last"?["change"]:["input","change"]).map(h=>oe(h,$(u),t)),l=t.defaultView;if(!l)return()=>{i.forEach(h=>h())};let s=l.Object.getOwnPropertyDescriptor(l.HTMLInputElement.prototype,"value"),a=[[l.HTMLInputElement.prototype,"value"],[l.HTMLInputElement.prototype,"checked"],[l.HTMLSelectElement.prototype,"value"],[l.HTMLTextAreaElement.prototype,"value"],[l.HTMLSelectElement.prototype,"selectedIndex"],[l.HTMLOptionElement.prototype,"selected"]];return s&&s.set&&i.push(...a.map(h=>Wt(h[0],h[1],{set(){$(u)({target:this,isTrusted:!1})}},!1,l))),$(()=>{i.forEach(h=>h())})}function Ct(e){let t=[];function r(o,c){if(ht("CSSGroupingRule")&&o.parentRule instanceof CSSGroupingRule||ht("CSSMediaRule")&&o.parentRule instanceof CSSMediaRule||ht("CSSSupportsRule")&&o.parentRule instanceof CSSSupportsRule||ht("CSSConditionRule")&&o.parentRule instanceof CSSConditionRule){let f=Array.from(o.parentRule.cssRules).indexOf(o);return c.unshift(f),r(o.parentRule,c)}else if(o.parentStyleSheet){let f=Array.from(o.parentStyleSheet.cssRules).indexOf(o);c.unshift(f)}return c}return r(e,t)}function Ne(e,t,r){let o,c;return e?(e.ownerNode?o=t.getId(e.ownerNode):c=r.getId(e),{styleId:c,id:o}):{}}function el({styleSheetRuleCb:e,mirror:t,stylesheetManager:r},{win:o}){if(!o.CSSStyleSheet||!o.CSSStyleSheet.prototype)return()=>{};let c=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=new Proxy(c,{apply:$((w,u,n)=>{let[i,l]=n,{id:s,styleId:a}=Ne(u,t,r.styleMirror);return(s&&s!==-1||a&&a!==-1)&&e({id:s,styleId:a,adds:[{rule:i,index:l}]}),w.apply(u,n)})}),o.CSSStyleSheet.prototype.addRule=function(w,u,n=this.cssRules.length){let i=`${w} { ${u} }`;return o.CSSStyleSheet.prototype.insertRule.apply(this,[i,n])};let f=o.CSSStyleSheet.prototype.deleteRule;o.CSSStyleSheet.prototype.deleteRule=new Proxy(f,{apply:$((w,u,n)=>{let[i]=n,{id:l,styleId:s}=Ne(u,t,r.styleMirror);return(l&&l!==-1||s&&s!==-1)&&e({id:l,styleId:s,removes:[{index:i}]}),w.apply(u,n)})}),o.CSSStyleSheet.prototype.removeRule=function(w){return o.CSSStyleSheet.prototype.deleteRule.apply(this,[w])};let d;o.CSSStyleSheet.prototype.replace&&(d=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=new Proxy(d,{apply:$((w,u,n)=>{let[i]=n,{id:l,styleId:s}=Ne(u,t,r.styleMirror);return(l&&l!==-1||s&&s!==-1)&&e({id:l,styleId:s,replace:i}),w.apply(u,n)})}));let g;o.CSSStyleSheet.prototype.replaceSync&&(g=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=new Proxy(g,{apply:$((w,u,n)=>{let[i]=n,{id:l,styleId:s}=Ne(u,t,r.styleMirror);return(l&&l!==-1||s&&s!==-1)&&e({id:l,styleId:s,replaceSync:i}),w.apply(u,n)})}));let p={};ft("CSSGroupingRule")?p.CSSGroupingRule=o.CSSGroupingRule:(ft("CSSMediaRule")&&(p.CSSMediaRule=o.CSSMediaRule),ft("CSSConditionRule")&&(p.CSSConditionRule=o.CSSConditionRule),ft("CSSSupportsRule")&&(p.CSSSupportsRule=o.CSSSupportsRule));let m={};return Object.entries(p).forEach(([w,u])=>{m[w]={insertRule:u.prototype.insertRule,deleteRule:u.prototype.deleteRule},u.prototype.insertRule=new Proxy(m[w].insertRule,{apply:$((n,i,l)=>{let[s,a]=l,{id:h,styleId:y}=Ne(i.parentStyleSheet,t,r.styleMirror);return(h&&h!==-1||y&&y!==-1)&&e({id:h,styleId:y,adds:[{rule:s,index:[...Ct(i),a||0]}]}),n.apply(i,l)})}),u.prototype.deleteRule=new Proxy(m[w].deleteRule,{apply:$((n,i,l)=>{let[s]=l,{id:a,styleId:h}=Ne(i.parentStyleSheet,t,r.styleMirror);return(a&&a!==-1||h&&h!==-1)&&e({id:a,styleId:h,removes:[{index:[...Ct(i),s]}]}),n.apply(i,l)})})}),$(()=>{o.CSSStyleSheet.prototype.insertRule=c,o.CSSStyleSheet.prototype.deleteRule=f,d&&(o.CSSStyleSheet.prototype.replace=d),g&&(o.CSSStyleSheet.prototype.replaceSync=g),Object.entries(p).forEach(([w,u])=>{u.prototype.insertRule=m[w].insertRule,u.prototype.deleteRule=m[w].deleteRule})})}function Ii({mirror:e,stylesheetManager:t},r){let o=null;r.nodeName==="#document"?o=e.getId(r):o=e.getId(P.host(r));let c=r.nodeName==="#document"?r.defaultView?.Document:r.ownerDocument?.defaultView?.ShadowRoot,f=c?.prototype?Object.getOwnPropertyDescriptor(c?.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!c||!f?()=>{}:(Object.defineProperty(r,"adoptedStyleSheets",{configurable:f.configurable,enumerable:f.enumerable,get(){return f.get?.call(this)},set(d){let g=f.set?.call(this,d);if(o!==null&&o!==-1)try{t.adoptStyleSheets(d,o)}catch{}return g}}),$(()=>{Object.defineProperty(r,"adoptedStyleSheets",{configurable:f.configurable,enumerable:f.enumerable,get:f.get,set:f.set})}))}function tl({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:r,stylesheetManager:o},{win:c}){let f=c.CSSStyleDeclaration.prototype.setProperty;c.CSSStyleDeclaration.prototype.setProperty=new Proxy(f,{apply:$((g,p,m)=>{let[w,u,n]=m;if(r.has(w))return f.apply(p,[w,u,n]);let{id:i,styleId:l}=Ne(p.parentRule?.parentStyleSheet,t,o.styleMirror);return(i&&i!==-1||l&&l!==-1)&&e({id:i,styleId:l,set:{property:w,value:u,priority:n},index:Ct(p.parentRule)}),g.apply(p,m)})});let d=c.CSSStyleDeclaration.prototype.removeProperty;return c.CSSStyleDeclaration.prototype.removeProperty=new Proxy(d,{apply:$((g,p,m)=>{let[w]=m;if(r.has(w))return d.apply(p,[w]);let{id:u,styleId:n}=Ne(p.parentRule?.parentStyleSheet,t,o.styleMirror);return(u&&u!==-1||n&&n!==-1)&&e({id:u,styleId:n,remove:{property:w},index:Ct(p.parentRule)}),g.apply(p,m)})}),$(()=>{c.CSSStyleDeclaration.prototype.setProperty=f,c.CSSStyleDeclaration.prototype.removeProperty=d})}function rl({mediaInteractionCb:e,blockClass:t,blockSelector:r,mirror:o,sampling:c,doc:f}){let d=$(p=>nt($(m=>{let w=ut(m);if(!w||!(w instanceof HTMLMediaElement)||ce(w,t,r,!0))return;let{currentTime:u,volume:n,muted:i,playbackRate:l,loop:s}=w;e({type:p,id:o.getId(w),currentTime:u,volume:n,muted:i,playbackRate:l,loop:s})}),c.media||500)),g=[oe("play",d(Le.Play),f),oe("pause",d(Le.Pause),f),oe("seeked",d(Le.Seeked),f),oe("volumechange",d(Le.VolumeChange),f),oe("ratechange",d(Le.RateChange),f)];return $(()=>{g.forEach(p=>p())})}function sl({fontCb:e,doc:t}){let r=t.defaultView;if(!r)return()=>{};let o=[],c=new WeakMap,f=r.FontFace;r.FontFace=function(p,m,w){let u=new f(p,m,w);return c.set(u,{family:p,buffer:typeof m!="string",descriptors:w,fontSource:typeof m=="string"?m:JSON.stringify(Array.from(new Uint8Array(m)))}),u};let d=Fe(t.fonts,"add",function(g){return function(p){return setTimeout($(()=>{let m=c.get(p);m&&(e(m),c.delete(p))}),0),g.apply(this,[p])}});return o.push(()=>{r.FontFace=f}),o.push(d),$(()=>{o.forEach(g=>g())})}function il(e){let{doc:t,mirror:r,blockClass:o,blockSelector:c,selectionCb:f}=e,d=!0,g=$(()=>{let p=t.getSelection();if(!p||d&&p?.isCollapsed)return;d=p.isCollapsed||!1;let m=[],w=p.rangeCount||0;for(let u=0;u<w;u++){let{startContainer:n,startOffset:i,endContainer:l,endOffset:s}=p.getRangeAt(u);ce(n,o,c,!0)||ce(l,o,c,!0)||m.push({start:r.getId(n),startOffset:i,end:r.getId(l),endOffset:s})}f({ranges:m})});return g(),oe("selectionchange",g)}function nl({doc:e,customElementCb:t}){let r=e.defaultView;return!r||!r.customElements?()=>{}:Fe(r.customElements,"define",function(o){return function(c,f,d){try{t({define:{name:c}})}catch{console.warn(`Custom element callback failed for ${c}`)}return o.apply(this,[c,f,d])}})}function ol(e,t){let{mutationCb:r,mousemoveCb:o,mouseInteractionCb:c,scrollCb:f,viewportResizeCb:d,inputCb:g,mediaInteractionCb:p,styleSheetRuleCb:m,styleDeclarationCb:w,canvasMutationCb:u,fontCb:n,selectionCb:i,customElementCb:l}=e;e.mutationCb=(...s)=>{t.mutation&&t.mutation(...s),r(...s)},e.mousemoveCb=(...s)=>{t.mousemove&&t.mousemove(...s),o(...s)},e.mouseInteractionCb=(...s)=>{t.mouseInteraction&&t.mouseInteraction(...s),c(...s)},e.scrollCb=(...s)=>{t.scroll&&t.scroll(...s),f(...s)},e.viewportResizeCb=(...s)=>{t.viewportResize&&t.viewportResize(...s),d(...s)},e.inputCb=(...s)=>{t.input&&t.input(...s),g(...s)},e.mediaInteractionCb=(...s)=>{t.mediaInteaction&&t.mediaInteaction(...s),p(...s)},e.styleSheetRuleCb=(...s)=>{t.styleSheetRule&&t.styleSheetRule(...s),m(...s)},e.styleDeclarationCb=(...s)=>{t.styleDeclaration&&t.styleDeclaration(...s),w(...s)},e.canvasMutationCb=(...s)=>{t.canvasMutation&&t.canvasMutation(...s),u(...s)},e.fontCb=(...s)=>{t.font&&t.font(...s),n(...s)},e.selectionCb=(...s)=>{t.selection&&t.selection(...s),i(...s)},e.customElementCb=(...s)=>{t.customElement&&t.customElement(...s),l(...s)}}function al(e,t={}){let r=e.doc.defaultView;if(!r)return()=>{};ol(e,t);let o;e.recordDOM&&(o=Ni(e,e.doc));let c=Ja(e),f=Xa(e),d=Oi(e),g=Qa(e,{win:r}),p=Ka(e),m=rl(e),w=()=>{},u=()=>{},n=()=>{},i=()=>{};e.recordDOM&&(w=el(e,{win:r}),u=Ii(e,e.doc),n=tl(e,{win:r}),e.collectFonts&&(i=sl(e)));let l=il(e),s=nl(e),a=[];for(let h of e.plugins)a.push(h.observer(h.callback,r,h.options));return $(()=>{o?.(),c(),f(),d(),g(),p(),m(),w(),u(),n(),i(),l(),s(),a.forEach(h=>h())})}function ht(e){return typeof window[e]<"u"}function ft(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}var ts=class{generateIdFn;iframeIdToRemoteIdMap=new WeakMap;iframeRemoteIdToIdMap=new WeakMap;constructor(e){this.generateIdFn=e}getId(e,t,r,o){let c=r||this.getIdToRemoteIdMap(e),f=o||this.getRemoteIdToIdMap(e),d=c.get(t);return d||(d=this.generateIdFn(),c.set(t,d),f.set(d,t)),d}getIds(e,t){let r=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return t.map(c=>this.getId(e,c,r,o))}getRemoteId(e,t,r){let o=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;let c=o.get(t);return c||-1}getRemoteIds(e,t){let r=this.getRemoteIdToIdMap(e);return t.map(o=>this.getRemoteId(e,o,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}},ll=class{iframes=new WeakMap;crossOriginIframeMap=new WeakMap;crossOriginIframeMirror=new ts(xs);crossOriginIframeStyleMirror;crossOriginIframeRootIdMap=new WeakMap;mirror;mutationCb;wrappedEmit;loadListener;unloadListener;attachedWindows=new Map;messageHandler=e=>this.handleMessage(e);stylesheetManager;recordCrossOriginIframes;constructor(e){this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new ts(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.messageHandler)}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}addUnloadListener(e){this.unloadListener=e}attachIframe(e,t){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.watchIframeWindow(e),this.loadListener?.(e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}destroy(){window.removeEventListener("message",this.messageHandler),this.attachedWindows.forEach(e=>e())}watchIframeWindow(e){let t=e.contentWindow;if(!t||this.attachedWindows.has(t))return;let r=[],o=()=>{this.attachedWindows.delete(t),r.forEach(c=>{try{c()}catch{}})};this.attachedWindows.set(t,o),this.recordCrossOriginIframes&&r.push(oe("message",this.messageHandler,t)),r.push(oe("pagehide",c=>{if(c.persisted)return;let f=t.document;o(),this.unloadListener?.(f)},t))}handleMessage(e){let t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;let r=this.crossOriginIframeMap.get(e.source);if(!r)return;let o=this.transformCrossOriginEvent(r,t.data.event);o&&this.wrappedEmit(o,t.data.isCheckout)}transformCrossOriginEvent(e,t){switch(t.type){case _.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let r=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,r),this.patchRootIdOnNode(t.data.node,r),{timestamp:t.timestamp,type:_.IncrementalSnapshot,data:{source:T.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case _.Meta:case _.Load:case _.DomContentLoaded:return!1;case _.Annotation:case _.Plugin:return t;case _.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case _.IncrementalSnapshot:switch(t.data.source){case T.Mutation:return t.data.adds.forEach(r=>{this.replaceIds(r,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(r.node,e);let o=this.crossOriginIframeRootIdMap.get(e);o&&this.patchRootIdOnNode(r.node,o)}),t.data.removes.forEach(r=>{this.replaceIds(r,e,["parentId","id"])}),t.data.attributes.forEach(r=>{this.replaceIds(r,e,["id"])}),t.data.texts.forEach(r=>{this.replaceIds(r,e,["id"])}),t;case T.Drag:case T.TouchMove:case T.MouseMove:return t.data.positions.forEach(r=>{this.replaceIds(r,e,["id"])}),t;case T.ViewportResize:return!1;case T.MediaInteraction:case T.MouseInteraction:case T.Scroll:case T.CanvasMutation:case T.Input:return this.replaceIds(t.data,e,["id"]),t;case T.StyleSheetRule:case T.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case T.Font:return t;case T.Selection:return t.data.ranges.forEach(r=>{this.replaceIds(r,e,["start","end"])}),t;case T.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),t.data.styles?.forEach(r=>{this.replaceStyleIds(r,e,["styleId"])}),t}}return!1}replace(e,t,r,o){for(let c of o)!Array.isArray(t[c])&&typeof t[c]!="number"||(Array.isArray(t[c])?t[c]=e.getIds(r,t[c]):t[c]=e.getId(r,t[c]));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!==Me.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}},ul=class{shadowDoms=new Map;mutationCb;scrollCb;bypassOptions;mirror;restoreHandlers=[];constructor(e){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(!et(e)||this.shadowDoms.has(e))return;let r=[];this.shadowDoms.set(e,r);let o=Ni({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);r.push(o),r.push(Oi({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{this.shadowDoms.get(e)===r&&(e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(P.host(e))),r.push(Ii({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)))},0)}removeShadowRootsIn(e){if(this.shadowDoms.size===0)return;let t=P.shadowRoot(e);t&&(this.shadowDoms.has(t)&&this.removeShadowRoot(t),this.removeShadowRootsIn(t)),P.childNodes(e).forEach(r=>this.removeShadowRootsIn(r))}removeShadowRoot(e){let t=this.shadowDoms.get(e);this.shadowDoms.delete(e),t?.forEach(Ht)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){let r=this;this.restoreHandlers.push(Fe(e.prototype,"attachShadow",function(o){return function(c){let f=o.call(this,c),d=P.shadowRoot(this);return d&&or(this)&&r.addShadowRoot(d,t),f}}))}reset(){this.restoreHandlers.forEach(Ht),this.restoreHandlers=[];let e=this.shadowDoms;this.shadowDoms=new Map,e.forEach(t=>t.forEach(Ht))}};function Ht(e){try{e()}catch{}}var Ve="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ze=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(qe=0;qe<Ve.length;qe++)Ze[Ve.charCodeAt(qe)]=qe;var qe,cl=function(e){var t=new Uint8Array(e),r,o=t.length,c="";for(r=0;r<o;r+=3)c+=Ve[t[r]>>2],c+=Ve[(t[r]&3)<<4|t[r+1]>>4],c+=Ve[(t[r+1]&15)<<2|t[r+2]>>6],c+=Ve[t[r+2]&63];return o%3===2?c=c.substring(0,c.length-1)+"=":o%3===1&&(c=c.substring(0,c.length-2)+"=="),c},hl=function(e){var t=e.length*.75,r=e.length,o,c=0,f,d,g,p;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var m=new ArrayBuffer(t),w=new Uint8Array(m);for(o=0;o<r;o+=4)f=Ze[e.charCodeAt(o)],d=Ze[e.charCodeAt(o+1)],g=Ze[e.charCodeAt(o+2)],p=Ze[e.charCodeAt(o+3)],w[c++]=f<<2|d>>4,w[c++]=(d&15)<<4|g>>2,w[c++]=(g&3)<<6|p&63;return m},rs=new Map;function fl(e,t){let r=rs.get(e);return r||(r=new Map,rs.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}var Di=(e,t,r)=>{if(!e||!(Ti(e,t)||typeof e=="object"))return;let o=e.constructor.name,c=fl(r,o),f=c.indexOf(e);return f===-1&&(f=c.length,c.push(e)),f};function pt(e,t,r){if(e instanceof Array)return e.map(o=>pt(o,t,r));if(e===null)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:cl(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[pt(e.buffer,t,r),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){let o=e.constructor.name,{src:c}=e;return{rr_type:o,src:c}}else{if(e instanceof HTMLCanvasElement)return{rr_type:"HTMLImageElement",src:e.toDataURL()};if(e instanceof ImageData)return{rr_type:e.constructor.name,args:[pt(e.data,t,r),e.width,e.height]};if(Ti(e,t)||typeof e=="object")return{rr_type:e.constructor.name,index:Di(e,t,r)}}return e}var Ai=(e,t,r)=>e.map(o=>pt(o,t,r)),Ti=(e,t)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(o=>typeof t[o]=="function").find(o=>e instanceof t[o]);function dl(e,t,r,o){let c=[],f=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(let d of f)try{if(typeof t.CanvasRenderingContext2D.prototype[d]!="function")continue;let g=Fe(t.CanvasRenderingContext2D.prototype,d,function(p){return function(...m){return ce(this.canvas,r,o,!0)||setTimeout(()=>{let w=Ai(m,t,this);e(this.canvas,{type:Ie["2D"],property:d,args:w})},0),p.apply(this,m)}});c.push(g)}catch{let g=Wt(t.CanvasRenderingContext2D.prototype,d,{set(p){e(this.canvas,{type:Ie["2D"],property:d,args:[p],setter:!0})}});c.push(g)}return()=>{c.forEach(d=>d())}}function pl(e){return e==="experimental-webgl"?"webgl":e}function ss(e,t,r,o){let c=[];try{let f=Fe(e.HTMLCanvasElement.prototype,"getContext",function(d){return function(g,...p){if(!ce(this,t,r,!0)){let m=pl(g);if("__context"in this||(this.__context=m),o&&["webgl","webgl2"].includes(m))if(p[0]&&typeof p[0]=="object"){let w=p[0];w.preserveDrawingBuffer||(w.preserveDrawingBuffer=!0)}else p.splice(0,1,{preserveDrawingBuffer:!0})}return d.apply(this,[g,...p])}});c.push(f)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{c.forEach(f=>f())}}function is(e,t,r,o,c,f){let d=[],g=Object.getOwnPropertyNames(e);for(let p of g)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(p))try{if(typeof e[p]!="function")continue;let m=Fe(e,p,function(w){return function(...u){let n=w.apply(this,u);if(Di(n,f,this),"tagName"in this.canvas&&!ce(this.canvas,o,c,!0)){let i=Ai(u,f,this),l={type:t,property:p,args:i};r(this.canvas,l)}return n}});d.push(m)}catch{let m=Wt(e,p,{set(w){r(this.canvas,{type:t,property:p,args:[w],setter:!0})}});d.push(m)}return d}function ml(e,t,r,o){let c=[];return typeof t.WebGLRenderingContext<"u"&&c.push(...is(t.WebGLRenderingContext.prototype,Ie.WebGL,e,r,o,t)),typeof t.WebGL2RenderingContext<"u"&&c.push(...is(t.WebGL2RenderingContext.prototype,Ie.WebGL2,e,r,o,t)),()=>{c.forEach(f=>f())}}var _i=`(function() {\n // ../../node_modules/base64-arraybuffer/dist/base64-arraybuffer.es5.js\n var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";\n var lookup = typeof Uint8Array === "undefined" ? [] : /* @__PURE__ */ new Uint8Array(256);\n for (var i = 0; i < chars.length; i++) lookup[chars.charCodeAt(i)] = i;\n var encode = function(arraybuffer) {\n var bytes = new Uint8Array(arraybuffer), i, len = bytes.length, base64 = "";\n for (i = 0; i < len; i += 3) {\n base64 += chars[bytes[i] >> 2];\n base64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64 += chars[bytes[i + 2] & 63];\n }\n if (len % 3 === 2) base64 = base64.substring(0, base64.length - 1) + "=";\n else if (len % 3 === 1) base64 = base64.substring(0, base64.length - 2) + "==";\n return base64;\n };\n // src/record/workers/image-bitmap-data-url-worker.ts\n const lastBlobMap = /* @__PURE__ */ new Map();\n const transparentBlobMap = /* @__PURE__ */ new Map();\n async function getTransparentBlobFor(width, height, dataURLOptions) {\n const id = \\`\\${width}-\\${height}\\`;\n if ("OffscreenCanvas" in globalThis) {\n if (transparentBlobMap.has(id)) return transparentBlobMap.get(id);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d");\n const base64 = encode(await (await offscreen.convertToBlob(dataURLOptions)).arrayBuffer());\n transparentBlobMap.set(id, base64);\n return base64;\n } else return "";\n }\n const worker = self;\n worker.onmessage = async function(e) {\n if ("OffscreenCanvas" in globalThis) {\n const { id, bitmap, width, height, dataURLOptions } = e.data;\n const transparentBase64 = getTransparentBlobFor(width, height, dataURLOptions);\n const offscreen = new OffscreenCanvas(width, height);\n offscreen.getContext("2d").drawImage(bitmap, 0, 0);\n bitmap.close();\n const blob = await offscreen.convertToBlob(dataURLOptions);\n const type = blob.type;\n const base64 = encode(await blob.arrayBuffer());\n if (!lastBlobMap.has(id) && await transparentBase64 === base64) {\n lastBlobMap.set(id, base64);\n return worker.postMessage({ id });\n }\n if (lastBlobMap.get(id) === base64) return worker.postMessage({ id });\n worker.postMessage({\n id,\n type,\n base64,\n width,\n height\n });\n lastBlobMap.set(id, base64);\n } else return worker.postMessage({ id: e.data.id });\n };\n})();\n\n//# sourceMappingURL=image-bitmap-data-url-worker-NVDCVKXO.js.map`,ns=typeof self<"u"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",_i],{type:"text/javascript;charset=utf-8"});function gl(e){let t;try{if(t=ns&&(self.URL||self.webkitURL).createObjectURL(ns),!t)throw"";let r=new Worker(t,{name:e?.name});return r.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(t)}),r}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(_i),{name:e?.name})}}var yl=class{pendingCanvasMutations=new Map;rafStamps={latestId:0,invokeId:null};mirror;mutationCb;resetObservers;frozen=!1;locked=!1;reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}constructor(e){let{sampling:t="all",win:r,blockClass:o,blockSelector:c,recordCanvas:f,dataURLOptions:d}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,f&&t==="all"&&this.initCanvasMutationObserver(r,o,c),f&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,o,c,{dataURLOptions:d})}processMutation=(e,t)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};initCanvasFPSObserver(e,t,r,o,c){let f=ss(t,r,o,!0),d=new Map,g=new gl;g.onmessage=i=>{let{id:l}=i.data;if(d.set(l,!1),!("base64"in i.data))return;let{base64:s,type:a,width:h,height:y}=i.data;this.mutationCb({id:l,type:Ie["2D"],commands:[{property:"clearRect",args:[0,0,h,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:s}],type:a}]},0,0]}]})};let p=1e3/e,m=0,w,u=()=>{let i=[];return t.document.querySelectorAll("canvas").forEach(l=>{ce(l,r,o,!0)||i.push(l)}),i},n=i=>{if(m&&i-m<p){w=requestAnimationFrame(n);return}m=i,u().forEach(async l=>{let s=this.mirror.getId(l);if(d.get(s)||l.width===0||l.height===0)return;if(d.set(s,!0),["webgl","webgl2"].includes(l.__context)){let h=l.getContext(l.__context);h?.getContextAttributes()?.preserveDrawingBuffer===!1&&h.clear(h.COLOR_BUFFER_BIT)}let a=await createImageBitmap(l);g.postMessage({id:s,bitmap:a,width:l.width,height:l.height,dataURLOptions:c.dataURLOptions},[a])}),w=requestAnimationFrame(n)};w=requestAnimationFrame(n),this.resetObservers=()=>{f(),cancelAnimationFrame(w)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let o=ss(e,t,r,!1),c=dl(this.processMutation.bind(this),e,t,r),f=ml(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{o(),c(),f()}}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 o=r.map(f=>{let{type:d,...g}=f;return g}),{type:c}=r[0];this.mutationCb({id:t,type:c,commands:o}),this.pendingCanvasMutations.delete(e)}},wl=class{trackedLinkElements=new WeakSet;mutationCb;adoptedStyleSheetCb;styleMirror=new Ei;constructor(e){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:[]},o=[];for(let c of e){let f;this.styleMirror.has(c)?f=this.styleMirror.getId(c):(f=this.styleMirror.add(c),o.push({styleId:f,rules:Array.from(c.rules||CSSRule,(d,g)=>({rule:bs(d,c.href),index:g}))})),r.styleIds.push(f)}o.length>0&&(r.styles=o),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},vl=class{nodeMap=new WeakMap;active=!1;inOtherBuffer(e,t){let r=this.nodeMap.get(e);return r&&Array.from(r).some(o=>o!==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(){}},K,mt,Re,ot=!1;try{if(Array.from([1],e=>e*2)[0]!==2){let e=document.createElement("iframe");document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var me=Ss();function Te(e={}){let{emit:t,checkoutEveryNms:r,checkoutEveryNth:o,blockClass:c="rr-block",blockSelector:f=null,ignoreClass:d="rr-ignore",ignoreSelector:g=null,maskTextClass:p="rr-mask",maskTextSelector:m=null,inlineStylesheet:w=!0,maskAllInputs:u,maskInputOptions:n,slimDOMOptions:i,maskInputFn:l,maskTextFn:s,hooks:a,packFn:h,sampling:y={},dataURLOptions:b={},mousemoveWait:v,recordDOM:M=!0,recordCanvas:x=!1,recordCrossOriginIframes:C=!1,recordAfter:S=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:E=!1,collectFonts:R=!1,inlineImages:I=!1,plugins:N,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:L=new Set([]),errorHandler:ae}=e;qa(ae);let V=C?window.parent===window:!0,O=!1;if(!V)try{window.parent.document&&(O=!1)}catch{O=!0}if(V&&!t)throw new Error("emit function is required");if(!V&&!O)return()=>{};v!==void 0&&y.mousemove===void 0&&(y.mousemove=v),me.reset();let re=u===!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}:n!==void 0?n:{password:!0},F=Os(i);bi();let Z,se=0,ee=z=>{for(let ue of N||[])ue.eventProcessor&&(z=ue.eventProcessor(z));return h&&!O&&(z=h(z)),z};K=(z,ue)=>{let U=z;if(U.timestamp=it(),U.type!==_.FullSnapshot&&!(U.type===_.IncrementalSnapshot&&U.data.source===T.Mutation)){Re.unfreeze();for(let Y of He)if(Y.isFrozen())Y.unfreeze();else break}if(V)t?.(ee(U),ue);else if(O){let Y={type:"rrweb",event:ee(U),origin:window.location.origin,isCheckout:ue};window.parent.postMessage(Y,"*")}if(U.type===_.FullSnapshot)Z=U,se=0;else if(U.type===_.IncrementalSnapshot){if(U.data.source===T.Mutation&&U.data.isAttachIframe)return;se++;let Y=o&&se>=o,te=r&&U.timestamp-Z.timestamp>r;(Y||te)&&mt(!0)}};let ve=z=>{K({type:_.IncrementalSnapshot,data:{source:T.Mutation,...z}})},be=z=>K({type:_.IncrementalSnapshot,data:{source:T.Scroll,...z}}),D=z=>K({type:_.IncrementalSnapshot,data:{source:T.CanvasMutation,...z}}),Se=z=>K({type:_.IncrementalSnapshot,data:{source:T.AdoptedStyleSheet,...z}}),ie=new wl({mutationCb:ve,adoptedStyleSheetCb:Se}),le=new ll({mirror:me,mutationCb:ve,stylesheetManager:ie,recordCrossOriginIframes:C,wrappedEmit:K});for(let z of N||[])z.getMirror&&z.getMirror({nodeMirror:me,crossOriginIframeMirror:le.crossOriginIframeMirror,crossOriginIframeStyleMirror:le.crossOriginIframeStyleMirror});let _e=new vl;Re=new yl({recordCanvas:x,mutationCb:D,win:window,blockClass:c,blockSelector:f,mirror:me,sampling:y.canvas,dataURLOptions:b});let he=new ul({mutationCb:ve,scrollCb:be,bypassOptions:{blockClass:c,blockSelector:f,maskTextClass:p,maskTextSelector:m,inlineStylesheet:w,maskInputOptions:re,dataURLOptions:b,maskTextFn:s,maskInputFn:l,recordCanvas:x,inlineImages:I,sampling:y,slimDOMOptions:F,iframeManager:le,stylesheetManager:ie,canvasManager:Re,keepIframeSrcFn:A,processedNodeManager:_e},mirror:me});mt=(z=!1)=>{if(!M)return;K({type:_.Meta,data:{href:window.location.href,width:yi(),height:gi()}},z),ie.reset(),he.init(),Re.lock(),He.forEach(U=>U.lock());let ue=qn(document,{mirror:me,blockClass:c,blockSelector:f,maskTextClass:p,maskTextSelector:m,inlineStylesheet:w,maskAllInputs:re,maskTextFn:s,maskInputFn:l,slimDOM:F,dataURLOptions:b,recordCanvas:x,inlineImages:I,onSerialize:U=>{rt(U,me)&&le.addIframe(U),Ci(U,me)&&ie.trackLinkElement(U),Pe(U)&&he.addShadowRoot(P.shadowRoot(U),document)},onIframeLoad:(U,Y)=>{le.attachIframe(U,Y),he.observeAttachShadow(U)},onStylesheetLoad:(U,Y)=>{ie.attachLinkElement(U,Y)},keepIframeSrcFn:A});if(!ue)return console.warn("Failed to snapshot the document");K({type:_.FullSnapshot,data:{node:ue,initialOffset:mi(window)}},z),Re.unlock(),He.forEach(U=>U.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ie.adoptStyleSheets(document.adoptedStyleSheets,me.getId(document))};try{let z=[],ue=te=>$(al)({mutationCb:ve,mousemoveCb:(k,$t)=>K({type:_.IncrementalSnapshot,data:{source:$t,positions:k}}),mouseInteractionCb:k=>K({type:_.IncrementalSnapshot,data:{source:T.MouseInteraction,...k}}),scrollCb:be,viewportResizeCb:k=>K({type:_.IncrementalSnapshot,data:{source:T.ViewportResize,...k}}),inputCb:k=>K({type:_.IncrementalSnapshot,data:{source:T.Input,...k}}),mediaInteractionCb:k=>K({type:_.IncrementalSnapshot,data:{source:T.MediaInteraction,...k}}),styleSheetRuleCb:k=>K({type:_.IncrementalSnapshot,data:{source:T.StyleSheetRule,...k}}),styleDeclarationCb:k=>K({type:_.IncrementalSnapshot,data:{source:T.StyleDeclaration,...k}}),canvasMutationCb:D,fontCb:k=>K({type:_.IncrementalSnapshot,data:{source:T.Font,...k}}),selectionCb:k=>{K({type:_.IncrementalSnapshot,data:{source:T.Selection,...k}})},customElementCb:k=>{K({type:_.IncrementalSnapshot,data:{source:T.CustomElement,...k}})},blockClass:c,ignoreClass:d,ignoreSelector:g,maskTextClass:p,maskTextSelector:m,maskInputOptions:re,inlineStylesheet:w,sampling:y,recordDOM:M,recordCanvas:x,inlineImages:I,userTriggeredOnInput:E,collectFonts:R,doc:te,maskInputFn:l,maskTextFn:s,keepIframeSrcFn:A,blockSelector:f,slimDOMOptions:F,dataURLOptions:b,mirror:me,iframeManager:le,stylesheetManager:ie,shadowDomManager:he,processedNodeManager:_e,canvasManager:Re,ignoreCSSAttributes:L,plugins:N?.filter(k=>k.observer)?.map(k=>({observer:k.observer,options:k.options,callback:$t=>K({type:_.Plugin,data:{plugin:k.name,payload:$t}})}))||[]},a),U=new Map;le.addLoadListener(te=>{try{let k=te.contentDocument;if(U.has(k))return;U.set(k,ue(k))}catch(k){console.warn(k)}}),le.addUnloadListener(te=>{let k=U.get(te);k&&(U.delete(te),k(),he.removeShadowRootsIn(te),me.removeNodeFromMap(te))});let Y=()=>{mt(),z.push(ue(document)),ot=!0};return["interactive","complete"].includes(document.readyState)?Y():(z.push(oe("DOMContentLoaded",()=>{K({type:_.DomContentLoaded,data:{}}),S==="DOMContentLoaded"&&Y()})),z.push(oe("load",()=>{K({type:_.Load,data:{}}),S==="load"&&Y()},window))),()=>{[...z,...U.values()].forEach(te=>{try{te()}catch(k){String(k).toLowerCase().includes("cross-origin")||console.warn(k)}}),U.clear(),le.destroy(),_e.destroy(),he.reset(),Re.reset(),ot=!1,Ya()}}catch(z){console.warn(z)}}Te.addCustomEvent=(e,t)=>{if(!ot)throw new Error("please add custom event after start recording");K({type:_.Custom,data:{tag:e,payload:t}})};Te.addAnnotation=e=>{if(!ot)throw new Error("please add annotation after recording started");K({type:_.Annotation,data:e})};Te.freezePage=()=>{Re.freeze(),He.forEach(e=>e.freeze())};Te.takeFullSnapshot=e=>{if(!ot)throw new Error("please take full snapshot after start recording");mt(e)};Te.mirror=me;var bl=ji({default:()=>Li});function Li(e){return{all:e=e||new Map,on:function(t,r){var o=e.get(t);o?o.push(r):e.set(t,[r])},off:function(t,r){var o=e.get(t);o&&(r?o.splice(o.indexOf(r)>>>0,1):e.set(t,[]))},emit:function(t,r){var o=e.get(t);o&&o.slice().map(function(c){c(r)}),(o=e.get("*"))&&o.slice().map(function(c){c(t,r)})}}}function Sl(e=window,t=document){if("scrollBehavior"in t.documentElement.style&&e.__forceSmoothScrollPolyfill__!==!0)return;let r=e.HTMLElement||e.Element,o=468,c={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||p,scrollIntoView:r.prototype.scrollIntoView},f=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now;function d(h){return new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(h)}let g=d(e.navigator.userAgent)?1:0;function p(h,y){this.scrollLeft=h,this.scrollTop=y}function m(h){return .5*(1-Math.cos(Math.PI*h))}function w(h){if(h===null||typeof h!="object"||h.behavior===void 0||h.behavior==="auto"||h.behavior==="instant")return!0;if(typeof h=="object"&&h.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+h.behavior+" is not a valid value for enumeration ScrollBehavior.")}function u(h,y){if(y==="Y")return h.clientHeight+g<h.scrollHeight;if(y==="X")return h.clientWidth+g<h.scrollWidth}function n(h,y){let b=e.getComputedStyle(h,null)["overflow"+y];return b==="auto"||b==="scroll"}function i(h){let y=u(h,"Y")&&n(h,"Y"),b=u(h,"X")&&n(h,"X");return y||b}function l(h){for(;h!==t.body&&i(h)===!1;)h=h.parentNode||h.host;return h}function s(h){let y=f(),b,v,M,x=(y-h.startTime)/o;x=x>1?1:x,b=m(x),v=h.startX+(h.x-h.startX)*b,M=h.startY+(h.y-h.startY)*b,h.method.call(h.scrollable,v,M),(v!==h.x||M!==h.y)&&e.requestAnimationFrame(s.bind(e,h))}function a(h,y,b){let v,M,x,C,S=f();h===t.body?(v=e,M=e.scrollX||e.pageXOffset,x=e.scrollY||e.pageYOffset,C=c.scroll):(v=h,M=h.scrollLeft,x=h.scrollTop,C=p),s({scrollable:v,method:C,startTime:S,startX:M,startY:x,x:y,y:b})}e.scroll=e.scrollTo=function(){if(arguments[0]!==void 0){if(w(arguments[0])===!0){c.scroll.call(e,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:e.scrollY||e.pageYOffset);return}a.call(e,t.body,arguments[0].left!==void 0?~~arguments[0].left:e.scrollX||e.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:e.scrollY||e.pageYOffset)}},e.scrollBy=function(){if(arguments[0]!==void 0){if(w(arguments[0])){c.scrollBy.call(e,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}a.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset))}},r.prototype.scroll=r.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(w(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");c.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 h=arguments[0].left,y=arguments[0].top;a.call(this,this,typeof h>"u"?this.scrollLeft:~~h,typeof y>"u"?this.scrollTop:~~y)},r.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(w(arguments[0])===!0){c.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})}},r.prototype.scrollIntoView=function(){if(w(arguments[0])===!0){c.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}let h=l(this),y=h.getBoundingClientRect(),b=this.getBoundingClientRect();h!==t.body?(a.call(this,h,h.scrollLeft+b.left-y.left,h.scrollTop+b.top-y.top),e.getComputedStyle(h).position!=="fixed"&&e.scrollBy({left:y.left,top:y.top,behavior:"smooth"})):e.scrollBy({left:b.left,top:b.top,behavior:"smooth"})}}var Cl=class{timeOffset=0;speed;actions;raf=null;lastTimestamp;constructor(e=[],t){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))}updateLiveTime(){this.raf===!0&&this.rafCheck()}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 o=Math.floor((t+r)/2);if(this.actions[o].delay<e.delay)t=o+1;else if(this.actions[o].delay>e.delay)r=o-1;else return o+1}return t}};function os(e,t){if(e.type===_.IncrementalSnapshot&&e.data.source===T.MouseMove&&e.data.positions&&e.data.positions.length){let r=e.data.positions[0].timeOffset,o=e.timestamp+r;return e.delay=o-t,o-t}return e.delay=e.timestamp-t,e.delay}/*! *****************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */function as(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var o,c,f=r.call(e),d=[];try{for(;(t===void 0||t-- >0)&&!(o=f.next()).done;)d.push(o.value)}catch(g){c={error:g}}finally{try{o&&!o.done&&(r=f.return)&&r.call(f)}finally{if(c)throw c.error}}return d}var Ge;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(Ge||(Ge={}));var ki={type:"xstate.init"};function qt(e){return e===void 0?[]:[].concat(e)}function $e(e){return{type:"xstate.assign",assignment:e}}function ls(e,t){return typeof(e=typeof e=="string"&&t&&t[e]?t[e]:e)=="string"?{type:e}:typeof e=="function"?{type:e.name,exec:e}:e}function xt(e){return function(t){return e===t}}function Pi(e){return typeof e=="string"?{type:e}:e}function us(e,t){return{value:e,context:t,actions:[],changed:!1,matches:xt(e)}}function cs(e,t,r){var o=t,c=!1;return[e.filter((function(f){if(f.type==="xstate.assign"){c=!0;var d=Object.assign({},o);return typeof f.assignment=="function"?d=f.assignment(o,r):Object.keys(f.assignment).forEach((function(g){d[g]=typeof f.assignment[g]=="function"?f.assignment[g](o,r):f.assignment[g]})),o=d,!1}return!0})),o,c]}function Fi(e,t){t===void 0&&(t={});var r=as(cs(qt(e.states[e.initial].entry).map((function(d){return ls(d,t.actions)})),e.context,ki),2),o=r[0],c=r[1],f={config:e,_options:t,initialState:{value:e.initial,actions:o,context:c,matches:xt(e.initial)},transition:function(d,g){var p,m,w=typeof d=="string"?{value:d,context:e.context}:d,u=w.value,n=w.context,i=Pi(g),l=e.states[u];if(l.on){var s=qt(l.on[i.type]);try{for(var a=(function(O){var re=typeof Symbol=="function"&&Symbol.iterator,F=re&&O[re],Z=0;if(F)return F.call(O);if(O&&typeof O.length=="number")return{next:function(){return O&&Z>=O.length&&(O=void 0),{value:O&&O[Z++],done:!O}}};throw new TypeError(re?"Object is not iterable.":"Symbol.iterator is not defined.")})(s),h=a.next();!h.done;h=a.next()){var y=h.value;if(y===void 0)return us(u,n);var b=typeof y=="string"?{target:y}:y,v=b.target,M=b.actions,x=M===void 0?[]:M,C=b.cond,S=C===void 0?function(){return!0}:C,E=v===void 0,R=v??u,I=e.states[R];if(S(n,i)){var N=as(cs((E?qt(x):[].concat(l.exit,x,I.entry).filter((function(O){return O}))).map((function(O){return ls(O,f._options.actions)})),n,i),3),A=N[0],L=N[1],ae=N[2],V=v??u;return{value:V,context:L,actions:A,changed:v!==u||A.length>0||ae,matches:xt(V)}}}}catch(O){p={error:O}}finally{try{h&&!h.done&&(m=a.return)&&m.call(a)}finally{if(p)throw p.error}}}return us(u,n)}};return f}var hs=function(e,t){return e.actions.forEach((function(r){var o=r.exec;return o&&o(e.context,t)}))};function Ui(e){var t=e.initialState,r=Ge.NotStarted,o=new Set,c={_machine:e,send:function(f){r===Ge.Running&&(t=e.transition(t,f),hs(t,Pi(f)),o.forEach((function(d){return d(t)})))},subscribe:function(f){return o.add(f),f(t),{unsubscribe:function(){return o.delete(f)}}},start:function(f){if(f){var d=typeof f=="object"?f:{context:e.config.context,value:f};t={value:d.value,actions:[],context:d.context,matches:xt(d.value)}}return r=Ge.Running,hs(t,ki),c},stop:function(){return r=Ge.Stopped,o.clear(),c},get state(){return t},get status(){return r}};return c}function xl(e,t){for(let r=e.length-1;r>=0;r--){let o=e[r];if(o.type===_.Meta&&o.timestamp<=t)return e.slice(r)}return e}function El(e,{getCastFn:t,applyEventsSynchronously:r,emitter:o}){return Ui(Fi({id:"player",context:e,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:$e({lastPlayedEvent:(c,f)=>f.type==="CAST_EVENT"?f.payload.event:c.lastPlayedEvent}),recordTimeOffset:$e((c,f)=>{let d=c.timeOffset;return"payload"in f&&"timeOffset"in f.payload&&(d=f.payload.timeOffset),{...c,timeOffset:d,baselineTime:c.events[0].timestamp+d}}),play(c){let{timer:f,events:d,baselineTime:g,lastPlayedEvent:p}=c;f.clear();for(let n of d)os(n,g);let m=xl(d,g),w=p?.timestamp;p?.type===_.IncrementalSnapshot&&p.data.source===T.MouseMove&&(w=p.timestamp+p.data.positions[0]?.timeOffset),g<(w||0)&&o.emit(j.PlayBack);let u=new Array;for(let n of m)if(!(w&&w<g&&(n.timestamp<=w||n===p)))if(n.timestamp<g)u.push(n);else{let i=t(n,!1);f.addAction({doAction:()=>{i()},delay:n.delay})}r(u),o.emit(j.Flush),f.start()},pause(c){c.timer.clear()},resetLastPlayedEvent:$e(c=>({...c,lastPlayedEvent:null})),startLive:$e({baselineTime:(c,f)=>(c.timer.start(),f.type==="TO_LIVE"&&f.payload.baselineTime?f.payload.baselineTime:Date.now())}),addEvent:$e((c,f)=>{let{baselineTime:d,timer:g,events:p}=c;if(f.type==="ADD_EVENT"){let{event:m}=f.payload;os(m,d);let w=p.length-1;if(!p[w]||p[w].timestamp<=m.timestamp)p.push(m);else{let i=-1,l=0;for(;l<=w;){let s=Math.floor((l+w)/2);p[s].timestamp<=m.timestamp?l=s+1:w=s-1}i===-1&&(i=l),p.splice(i,0,m)}let u=m.timestamp<d,n=t(m,u);u?n():g.isActive()&&g.addAction({doAction:()=>{n()},delay:m.delay})}return{...c,events:p}})}}))}function Ml(e){return Ui(Fi({id:"speed",context:e,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:$e({normalSpeed:t=>t.timer.speed}),restoreSpeed:t=>{t.timer.setSpeed(t.normalSpeed)}}}))}var Rl=e=>[`.${e} { background: currentColor }`,"noscript { display: none !important; }"],fs=new Map;function Bi(e,t){let r=fs.get(e);return r||(r=new Map,fs.set(e,r)),r.has(t)||r.set(t,[]),r.get(t)}function Oe(e,t,r){return async o=>{if(o&&typeof o=="object"&&"rr_type"in o)if(r&&(r.isUnchanged=!1),o.rr_type==="ImageBitmap"&&"args"in o){let c=await Oe(e,t,r)(o.args);return await createImageBitmap.apply(null,c)}else if("index"in o){if(r||t===null)return o;let{rr_type:c,index:f}=o;return Bi(t,c)[f]}else if("args"in o){let{rr_type:c,args:f}=o,d=window[c];return new d(...await Promise.all(f.map(Oe(e,t,r))))}else{if("base64"in o)return hl(o.base64);if("src"in o){let c=e.get(o.src);if(c)return c;{let f=new Image;return f.src=o.src,e.set(o.src,f),f}}else if("data"in o&&o.rr_type==="Blob"){let c=await Promise.all(o.data.map(Oe(e,t,r)));return new Blob(c,{type:o.type})}}else if(Array.isArray(o))return await Promise.all(o.map(Oe(e,t,r)));return o}}function Nl(e,t){try{return t===Ie.WebGL?e.getContext("webgl")||e.getContext("experimental-webgl"):e.getContext("webgl2")}catch{return null}}var Ol=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];function Il(e,t){if(!t?.constructor)return;let{name:r}=t.constructor;if(!Ol.includes(r))return;let o=Bi(e,r);o.includes(t)||o.push(t)}async function Dl({mutation:e,target:t,type:r,imageMap:o,errorHandler:c}){try{let f=Nl(t,r);if(!f)return;if(e.setter){f[e.property]=e.args[0];return}let d=f[e.property],g=await Promise.all(e.args.map(Oe(o,f)));Il(f,d.apply(f,g))}catch(f){c(e,f)}}async function Al({event:e,mutations:t,target:r,imageMap:o,errorHandler:c}){let f=r.getContext("2d");if(!f){c(t[0],new Error("Canvas context is null"));return}let d=t.map(async g=>Promise.all(g.args.map(Oe(o,f))));(await Promise.all(d)).forEach((g,p)=>{let m=t[p];try{if(m.setter){f[m.property]=m.args[0];return}let w=f[m.property];m.property==="drawImage"&&typeof m.args[0]=="string"?(o.get(e),w.apply(f,m.args)):w.apply(f,g)}catch(w){c(m,w)}})}async function ds({event:e,mutation:t,target:r,imageMap:o,canvasEventMap:c,errorHandler:f}){try{let d=c.get(e)||t,g="commands"in d?d.commands:[d];if([Ie.WebGL,Ie.WebGL2].includes(t.type)){for(let p=0;p<g.length;p++){let m=g[p];await Dl({mutation:m,type:t.type,target:r,imageMap:o,errorHandler:f})}return}await Al({event:e,mutations:g,target:r,imageMap:o,errorHandler:f})}catch(d){f(t,d)}}var Tl=class{mediaMap=new Map;warn;service;speedService;emitter;getCurrentTime;metadataCallbackMap=new Map;constructor(e){this.warn=e.warn,this.service=e.service,this.speedService=e.speedService,this.emitter=e.emitter,this.getCurrentTime=e.getCurrentTime,this.emitter.on(j.Start,this.start.bind(this)),this.emitter.on(j.SkipStart,this.start.bind(this)),this.emitter.on(j.Pause,this.pause.bind(this)),this.emitter.on(j.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((t,r)=>{if(this.syncTargetWithState(r),e.pause)try{r.pause()}catch(o){this.warn(`Failed to sync media element: ${o.message||o}`)}})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:t,mediaState:r}){if(r.isPlaying){let o=(e-r.lastInteractionTimeOffset)/1e3*r.playbackRate,c="duration"in t&&t.duration;if(Number.isNaN(c)){this.waitForMetadata(t);return}let f=r.currentTimeAtLastInteraction+o;t.loop&&c!==!1&&(f=f%c),t.currentTime=f}else{try{t.pause()}catch(o){this.warn(`Failed to pause during seek: ${o.message||o}`)}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 o=this.mediaMap.get(e),{type:c,playbackRate:f,currentTime:d,muted:g,volume:p,loop:m}=r;return{isPlaying:c===Le.Play||c!==Le.Pause&&(o?.isPlaying||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:d??o?.currentTimeAtLastInteraction??0,lastInteractionTimeOffset:t,playbackRate:f??o?.playbackRate??1,volume:p??o?.volume??1,muted:g??o?.muted??e.getAttribute("muted")===null,loop:m??o?.loop??e.getAttribute("loop")===null}}syncTargetWithState(e){let t=this.mediaMap.get(e);if(!t)return;let{muted:r,loop:o,volume:c,isPlaying:f}=t,d=this.service.state.matches("paused"),g=t.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:t}),e.volume!==c&&(e.volume=c),e.muted=r,e.loop=o,e.playbackRate!==g&&(e.playbackRate=g),f&&!d?e.play():e.pause()}catch(p){this.warn(`Failed to replay media interactions: ${p.message||p}`)}}addMediaElements(e,t,r){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;let o=e,c=r.getMeta(o);if(!c||!("attributes"in c))return;let f=this.service.state.matches("paused"),d=c.attributes,g=!1;d.rr_mediaState?g=d.rr_mediaState==="played":g=o.getAttribute("autoplay")!==null,g&&f&&o.pause();let p=1;typeof d.rr_mediaPlaybackRate=="number"&&(p=d.rr_mediaPlaybackRate);let m=!1;typeof d.rr_mediaMuted=="boolean"?m=d.rr_mediaMuted:m=o.getAttribute("muted")!==null;let w=!1;typeof d.rr_mediaLoop=="boolean"?w=d.rr_mediaLoop:w=o.getAttribute("loop")!==null;let u=1;typeof d.rr_mediaVolume=="number"&&(u=d.rr_mediaVolume);let n=0;typeof d.rr_mediaCurrentTime=="number"&&(n=d.rr_mediaCurrentTime),this.mediaMap.set(o,{isPlaying:g,currentTimeAtLastInteraction:n,lastInteractionTimeOffset:t,playbackRate:p,volume:u,muted:m,loop:w}),this.syncTargetWithState(o)}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()}};function dt(e,t){if(e.nodeName!=="DIALOG"||e instanceof xe)return;let r=e,o=r.open,c=o&&r.matches("dialog:modal"),f=r.getAttribute("rr_open_mode"),d=typeof t?.attributes.open=="string"||typeof r.getAttribute("open")=="string",g=f==="modal";if(!(o&&!(c&&f==="non-modal"||!c&&g))){if(!r.isConnected){console.warn("dialog is not attached to the dom",r);return}o&&r.close(),d&&(g?r.showModal():r.show())}}function _l(e,t){if(e.nodeName!=="DIALOG"||e instanceof xe)return;let r=e;if(!r.isConnected){console.warn("dialog is not attached to the dom",r);return}t.attributes.open===null&&(r.removeAttribute("open"),r.removeAttribute("rr_open_mode"))}var Ll=5e3,kl=Li||bl,ps="[replayer]",Yt={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};function ms(e){return e.type==_.IncrementalSnapshot&&(e.data.source==T.TouchMove||e.data.source==T.MouseInteraction&&e.data.type==G.TouchStart)}var Wi=class{wrapper;iframe;UNSAFE_replayCanvas=!1;service;speedService;get timer(){return this.service.state.context.timer}config;usingVirtualDom=!1;virtualDom=new Ut;mouse;mouseTail=null;tailPositions=[];emitter=kl();nextUserInteractionEvent;legacy_missingNodeRetryMap={};cache=Br();imageMap=new Map;canvasEventMap=new Map;mirror=Ss();styleMirror=new Ei;mediaManager;firstFullSnapshot=null;newDocumentQueue=[];mousePos=null;touchActive=null;lastMouseDownEvent=null;lastHoveredRootNode;lastSelectionData=null;constructedStyleMutations=[];adoptedStyleSheets=[];constructor(e,t){if(!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:1e4,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:Yt,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(j.Resize,this.handleResize),this.setupDom();for(let d of this.config.plugins||[])d.getMirror&&d.getMirror({nodeMirror:this.mirror});this.emitter.on(j.Flush,()=>{if(this.usingVirtualDom){let d={mirror:this.mirror,applyCanvas:(g,p,m)=>{ds({event:g,mutation:p,target:m,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(g,p)=>{g.source===T.StyleSheetRule?this.applyStyleSheetRule(g,p):g.source===T.StyleDeclaration&&this.applyStyleDeclaration(g,p)},afterAppend:(g,p)=>{for(let m of this.config.plugins||[])m.onBuild&&m.onBuild(g,{id:p,replayer:this})}};if(this.iframe.contentDocument)try{bt(this.iframe.contentDocument,this.virtualDom,d,this.virtualDom.mirror)}catch(g){this.warn(g)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(let g in this.legacy_missingNodeRetryMap)try{let p=this.legacy_missingNodeRetryMap[g],m=St(p.node,this.mirror,this.virtualDom.mirror);bt(m,p.node,d,this.virtualDom.mirror),p.node=m}catch(p){this.warn(p)}this.constructedStyleMutations.forEach(g=>{this.applyStyleSheetMutation(g)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(g=>{this.applyAdoptedStyleSheet(g)}),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[d,g]=this.lastMouseDownEvent;d.dispatchEvent(g)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(j.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});let o=new Cl([],{speed:this.config.speed});this.service=El({events:e.map(d=>t&&t.unpackFn?t.unpackFn(d):d).sort((d,g)=>d.timestamp-g.timestamp),timer:o,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(d=>{this.emitter.emit(j.StateChange,{player:d})}),this.speedService=Ml({normalSpeed:-1,timer:o}),this.speedService.start(),this.speedService.subscribe(d=>{this.emitter.emit(j.StateChange,{speed:d})}),this.mediaManager=new Tl({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});let c=this.service.state.context.events.find(d=>d.type===_.Meta),f=this.service.state.context.events.find(d=>d.type===_.FullSnapshot);if(c){let{width:d,height:g}=c.data;setTimeout(()=>{this.emitter.emit(j.Resize,{width:d,height:g})},0)}f&&setTimeout(()=>{this.firstFullSnapshot||(this.firstFullSnapshot=f,this.rebuildFullSnapshot(f),this.iframe.contentWindow?.scrollTo(f.data.initialOffset))},1),this.service.state.context.events.find(ms)&&this.mouse.classList.add("touch-device")}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.config.liveMode&&this.timer.updateLiveTime(),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){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}})),this.iframe.contentDocument?.getElementsByTagName("html")[0]?.classList.remove("rrweb-paused"),this.emitter.emit(j.Start)}pause(e){e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),this.iframe.contentDocument?.getElementsByTagName("html")[0]?.classList.add("rrweb-paused"),this.emitter.emit(j.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(j.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(j.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){let t=this.config.unpackFn?this.config.unpackFn(e):e;ms(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=Br()}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.config.UNSAFE_replayCanvas?(this.iframe=document.createElement("iframe"),this.iframe.setAttribute("sandbox","allow-same-origin allow-scripts"),this.wrapper.appendChild(this.iframe),this.UNSAFE_replayCanvas=!0):(this.iframe=mo({root:this.wrapper}),this.UNSAFE_replayCanvas=!1),this.iframe.style.display="none",this.disableInteract(),this.iframe.contentWindow&&this.iframe.contentDocument&&(Sl(this.iframe.contentWindow,this.iframe.contentDocument),bi(this.iframe.contentWindow))}handleResize=e=>{this.iframe.style.display="inherit";for(let t of[this.mouseTail,this.iframe])t&&(t.setAttribute("width",String(e.width)),t.setAttribute("height",String(e.height)))};applyEventsSynchronously=e=>{for(let t of e){switch(t.type){case _.DomContentLoaded:case _.Load:continue;case _.FullSnapshot:case _.Meta:case _.Plugin:case _.IncrementalSnapshot:}this.getCastFn(t,!0)()}};getCastFn=(e,t=!1)=>{let r;switch(e.type){case _.DomContentLoaded:case _.Load:break;case _.Annotation:r=()=>this.emitter.emit(j.Annotation,e);break;case _.Custom:r=()=>{this.emitter.emit(j.CustomEvent,e)};break;case _.Meta:r=()=>this.emitter.emit(j.Resize,{width:e.data.width,height:e.data.height});break;case _.FullSnapshot:r=()=>{if(this.firstFullSnapshot){if(this.firstFullSnapshot===e){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(e,t),this.iframe.contentWindow?.scrollTo(e.data.initialOffset)};break;case _.IncrementalSnapshot:r=()=>{if(this.applyIncremental(e,t),!t&&(e===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(let c of this.service.state.context.events)if(!(c.timestamp<=e.timestamp)&&this.isUserInteraction(c)){c.delay-e.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=c);break}if(this.nextUserInteractionEvent){let c=this.nextUserInteractionEvent.delay-e.delay,f={speed:Math.min(Math.round(c/Ll),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:f}),this.emitter.emit(j.SkipStart,f)}}}}return()=>{r&&r();for(let f of this.config.plugins||[])f.handler&&f.handler(e,t,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:e}});let c=this.service.state.context.events.length-1;if(!this.config.liveMode&&e===this.service.state.context.events[c]){let f=()=>{c<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(j.Finish))},d=50;e.type===_.IncrementalSnapshot&&e.data.source===T.MouseMove&&e.data.positions.length&&(d+=Math.max(0,-e.data.positions[0].timeOffset)),setTimeout(f,d)}this.emitter.emit(j.EventCast,e)}};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=[],o=new Set,c=(g,p)=>{if(g.nodeName==="DIALOG"&&o.add(g),this.collectIframeAndAttachDocument(r,g),this.mediaManager.isSupportedMediaElement(g)){let{events:m}=this.service.state.context;this.mediaManager.addMediaElements(g,e.timestamp-m[0].timestamp,this.mirror)}for(let m of this.config.plugins||[])m.onBuild&&m.onBuild(g,{id:p,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),po(e.data.node,{doc:this.iframe.contentDocument,afterAppend:c,cache:this.cache,mirror:this.mirror,UNSAFE_allowUnprotectedRebuild:this.UNSAFE_replayCanvas}),c(this.iframe.contentDocument,e.data.node.id);for(let{mutationInQueue:g,builtNode:p}of r)this.attachDocumentToIframe(g,p),this.newDocumentQueue=this.newDocumentQueue.filter(m=>m!==g);let{documentElement:f,head:d}=this.iframe.contentDocument;this.insertStyleRules(f,d),o.forEach(g=>dt(g)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(j.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){let r=Rl(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&r.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!r.length)if(this.usingVirtualDom){let o=this.virtualDom.createElement("style");this.virtualDom.mirror.add(o,fi(o,this.virtualDom.unserializedId)),e.insertBefore(o,t),o.rules.push({source:T.StyleSheetRule,adds:r.map((c,f)=>({rule:c,index:f}))})}else{let o=document.createElement("style");e.insertBefore(o,t);for(let c=0;c<r.length;c++)o.sheet?.insertRule(r[c],c)}}attachDocumentToIframe(e,t){let r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,o=[],c=new Set,f=(d,g)=>{d.nodeName==="DIALOG"&&c.add(d),this.collectIframeAndAttachDocument(o,d);let p=r.getMeta(d);if(p?.type===Me.Element&&p?.tagName.toUpperCase()==="HTML"){let{documentElement:m,head:w}=t.contentDocument;this.insertStyleRules(m,w)}if(!this.usingVirtualDom)for(let m of this.config.plugins||[])m.onBuild&&m.onBuild(d,{id:g,replayer:this})};tt(e.node,{doc:t.contentDocument,mirror:r,hackCss:!0,skipChild:!1,afterAppend:f,cache:this.cache}),f(t.contentDocument,e.node.id);for(let{mutationInQueue:d,builtNode:g}of o)this.attachDocumentToIframe(d,g),this.newDocumentQueue=this.newDocumentQueue.filter(p=>p!==d);c.forEach(d=>dt(d))}collectIframeAndAttachDocument(e,t){if(rt(t,this.mirror)){let r=this.newDocumentQueue.find(o=>o.parentId===this.mirror.getId(t));r&&e.push({mutationInQueue:r,builtNode:t})}}waitForStylesheetLoad(){let e=this.iframe.contentDocument?.head;if(e){let t=new Set,r,o=this.service.state,c=()=>{o=this.service.state};this.emitter.on(j.Start,c),this.emitter.on(j.Pause,c);let f=()=>{this.emitter.off(j.Start,c),this.emitter.off(j.Pause,c)};e.querySelectorAll(\'link[rel="stylesheet"]\').forEach(d=>{d.sheet||(t.add(d),d.addEventListener("load",()=>{t.delete(d),t.size===0&&r!==-1&&(o.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(j.LoadStylesheetEnd),r&&clearTimeout(r),f())}))}),t.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(j.LoadStylesheetStart),r=setTimeout(()=>{o.matches("playing")&&this.play(this.getCurrentTime()),r=-1,f()},this.config.loadTimeout))}}async preloadAllImages(){let e=[];for(let t of this.service.state.context.events)t.type===_.IncrementalSnapshot&&t.data.source===T.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(t.data,t)),("commands"in t.data?t.data.commands:[t.data]).forEach(r=>{this.preloadImages(r,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"),o=r.getContext("2d"),c=o?.createImageData(r.width,r.height);o?.putImageData(c,0,0)}}async deserializeAndPreloadCanvasEvents(e,t){if(!this.canvasEventMap.has(t)){let r={isUnchanged:!0};if("commands"in e){let o=await Promise.all(e.commands.map(async c=>{let f=await Promise.all(c.args.map(Oe(this.imageMap,null,r)));return{...c,args:f}}));r.isUnchanged===!1&&this.canvasEventMap.set(t,{...e,commands:o})}else{let o=await Promise.all(e.args.map(Oe(this.imageMap,null,r)));r.isUnchanged===!1&&this.canvasEventMap.set(t,{...e,args:o})}}}applyIncremental(e,t){let{data:r}=e;switch(r.source){case T.Mutation:try{this.applyMutation(r,t)}catch(o){this.warn(`Exception in mutation ${o.message||o}`,r)}break;case T.Drag:case T.TouchMove:case T.MouseMove:if(t){let o=r.positions[r.positions.length-1];this.mousePos={x:o.x,y:o.y,id:o.id,debugData:r}}else r.positions.forEach(o=>{let c={doAction:()=>{this.moveAndHover(o.x,o.y,o.id,t,r)},delay:o.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(c)}),this.timer.addAction({doAction(){},delay:e.delay-r.positions[0]?.timeOffset});break;case T.MouseInteraction:{if(r.id===-1)break;let o=new Event(Ce(G[r.type])),c=this.mirror.getNode(r.id);if(!c)return this.debugNodeNotFound(r,r.id);this.emitter.emit(j.MouseInteraction,{type:r.type,target:c});let{triggerFocus:f}=this.config;switch(r.type){case G.Blur:"blur"in c&&c.blur();break;case G.Focus:f&&c.focus&&c.focus({preventScroll:!0});break;case G.Click:case G.TouchStart:case G.TouchEnd:case G.MouseDown:case G.MouseUp:t?(r.type===G.TouchStart?this.touchActive=!0:r.type===G.TouchEnd&&(this.touchActive=!1),r.type===G.MouseDown?this.lastMouseDownEvent=[c,o]:r.type===G.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:r.x||0,y:r.y||0,id:r.id,debugData:r}):(r.type===G.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(r.x||0,r.y||0,r.id,t,r),r.type===G.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):r.type===G.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):r.type===G.TouchEnd?this.mouse.classList.remove("touch-active"):c.dispatchEvent(o));break;case G.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:c.dispatchEvent(o)}break}case T.Scroll:if(r.id===-1)break;if(this.usingVirtualDom){let o=this.virtualDom.mirror.getNode(r.id);if(!o)return this.debugNodeNotFound(r,r.id);o.scrollData=r;break}this.applyScroll(r,t);break;case T.ViewportResize:this.emitter.emit(j.Resize,{width:r.width,height:r.height});break;case T.Input:if(r.id===-1)break;if(this.usingVirtualDom){let o=this.virtualDom.mirror.getNode(r.id);if(!o)return this.debugNodeNotFound(r,r.id);o.inputData=r;break}this.applyInput(r);break;case T.MediaInteraction:{let o=this.usingVirtualDom?this.virtualDom.mirror.getNode(r.id):this.mirror.getNode(r.id);if(!o)return this.debugNodeNotFound(r,r.id);let c=o,{events:f}=this.service.state.context;this.mediaManager.mediaMutation({target:c,timeOffset:e.timestamp-f[0].timestamp,mutation:r});break}case T.StyleSheetRule:case T.StyleDeclaration:this.usingVirtualDom?r.styleId?this.constructedStyleMutations.push(r):r.id&&this.virtualDom.mirror.getNode(r.id)?.rules.push(r):this.applyStyleSheetMutation(r);break;case T.CanvasMutation:if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){let o=this.virtualDom.mirror.getNode(r.id);if(!o)return this.debugNodeNotFound(r,r.id);o.canvasMutations.push({event:e,mutation:r})}else{let o=this.mirror.getNode(r.id);if(!o)return this.debugNodeNotFound(r,r.id);ds({event:e,mutation:r,target:o,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break;case T.Font:try{let o=new FontFace(r.family,r.buffer?new Uint8Array(JSON.parse(r.fontSource)):r.fontSource,r.descriptors);this.iframe.contentDocument?.fonts.add(o)}catch(o){this.warn(o)}break;case T.Selection:if(t){this.lastSelectionData=r;break}this.applySelection(r);break;case T.AdoptedStyleSheet:this.usingVirtualDom?this.adoptedStyleSheets.push(r):this.applyAdoptedStyleSheet(r)}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,ba(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(let p in this.legacy_missingNodeRetryMap)try{let m=this.legacy_missingNodeRetryMap[p],w=hi(m.node,this.virtualDom,this.mirror);w&&(m.node=w)}catch(m){this.warn(m)}let r=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(p=>r.getNode(p.id)?!0:(this.warnNodeNotFound(e,p.id),!1)),e.removes.forEach(p=>{let m=r.getNode(p.id);if(!m)return;let w=r.getNode(p.parentId);if(!w)return this.warnNodeNotFound(e,p.parentId);if(p.isShadow&&Pe(w)&&(w=w.shadowRoot),r.removeNodeFromMap(m),w)try{w.removeChild(m),this.usingVirtualDom&&m.nodeName==="#text"&&w.nodeName==="STYLE"&&w.rules?.length>0&&(w.rules=[])}catch(u){if(u instanceof DOMException)this.warn("parent could not remove child in mutation",w,m,e);else throw u}});let o={...this.legacy_missingNodeRetryMap},c=[],f=p=>{let m=null;return p.nextId&&(m=r.getNode(p.nextId)),p.nextId!==null&&p.nextId!==void 0&&p.nextId!==-1&&!m},d=p=>{if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let m=r.getNode(p.parentId);if(!m)return p.node.type===Me.Document?this.newDocumentQueue.push(p):c.push(p);p.node.isShadow&&(Pe(m)||m.attachShadow({mode:"open"}),m=m.shadowRoot);let w=null,u=null;if(p.previousId&&(w=r.getNode(p.previousId)),p.nextId&&(u=r.getNode(p.nextId)),f(p))return c.push(p);if(p.node.rootId&&!r.getNode(p.node.rootId))return;let n=p.node.rootId?r.getNode(p.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(rt(m,r)){this.attachDocumentToIframe(p,m);return}let i=(a,h)=>{if(!this.usingVirtualDom){dt(a);for(let y of this.config.plugins||[])y.onBuild&&y.onBuild(a,{id:h,replayer:this})}},l=tt(p.node,{doc:n,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:i});if(p.previousId===-1||p.nextId===-1){o[p.node.id]={node:l,mutation:p};return}let s=r.getMeta(m);if(s&&s.type===Me.Element&&p.node.type===Me.Text){let a=Array.isArray(m.childNodes)?m.childNodes:Array.from(m.childNodes);if(s.tagName==="textarea")for(let h of a)h.nodeType===m.TEXT_NODE&&m.removeChild(h);else if(s.tagName==="style"&&a.length===1)for(let h of a)h.nodeType===m.TEXT_NODE&&!r.hasNode(h)&&(l.textContent=h.textContent,m.removeChild(h))}else if(s?.type===Me.Document){let a=m;p.node.type===Me.DocumentType&&a.childNodes[0]?.nodeType===Node.DOCUMENT_TYPE_NODE&&a.removeChild(a.childNodes[0]),l.nodeName==="HTML"&&a.documentElement&&a.removeChild(a.documentElement)}if(w&&w.nextSibling&&w.nextSibling.parentNode?m.insertBefore(l,w.nextSibling):u&&u.parentNode?m.contains(u)?m.insertBefore(l,u):m.insertBefore(l,null):m.appendChild(l),i(l,p.node.id),this.usingVirtualDom&&l.nodeName==="#text"&&m.nodeName==="STYLE"&&m.rules?.length>0&&(m.rules=[]),rt(l,this.mirror)){let a=this.mirror.getId(l),h=this.newDocumentQueue.find(y=>y.parentId===a);h&&(this.attachDocumentToIframe(h,l),this.newDocumentQueue=this.newDocumentQueue.filter(y=>y!==h))}(p.previousId||p.nextId)&&this.legacy_resolveMissingNode(o,m,l,p)};e.adds.forEach(p=>{d(p)});let g=Date.now();for(;c.length;){let p=$a(c);if(c.length=0,Date.now()-g>500){this.warn("Timeout in the loop, please check the resolve tree data:",p);break}for(let m of p)r.getNode(m.value.parentId)?Si(m,w=>{d(w)}):this.debug("Drop resolve tree since there is no parent for the root node.",m)}Object.keys(o).length&&Object.assign(this.legacy_missingNodeRetryMap,o),za(e.texts).forEach(p=>{let m=r.getNode(p.id);if(!m)return e.removes.find(u=>u.id===p.id)?void 0:this.warnNodeNotFound(e,p.id);let w=m.parentElement;if(p.value&&w&&w.tagName==="STYLE"?m.textContent=Dt(p.value,this.cache):m.textContent=p.value,this.usingVirtualDom){let u=m.parentNode;u?.rules?.length>0&&(u.rules=[])}}),e.attributes.forEach(p=>{let m=r.getNode(p.id);if(!m)return e.removes.find(w=>w.id===p.id)?void 0:this.warnNodeNotFound(e,p.id);for(let w in p.attributes)if(typeof w=="string"){let u=p.attributes[w];if(u===null)m.removeAttribute(w),w==="open"&&_l(m,p);else if(typeof u=="string")try{if(w==="_cssText"&&(m.nodeName==="LINK"||m.nodeName==="STYLE"))try{let n=r.getMeta(m),i=tt({...n,attributes:{...n.attributes,...p.attributes}},{doc:m.ownerDocument,mirror:r,skipChild:!0,hackCss:!0,cache:this.cache});Object.assign(n.attributes,p.attributes);let l=m.nextSibling,s=m.parentNode;if(i&&s){s.removeChild(m),s.insertBefore(i,l),r.replace(p.id,i);break}}catch{}if(w==="value"&&m.nodeName==="TEXTAREA"){let n=m;n.childNodes.forEach(l=>n.removeChild(l));let i=m.ownerDocument?.createTextNode(u);i&&n.appendChild(i)}else m.setAttribute(w,u);w==="rr_open_mode"&&m.nodeName==="DIALOG"&&dt(m,p)}catch(n){this.warn("An error occurred may due to the checkout feature.",n)}else if(w==="style"){let n=u,i=m;for(let l in n)if(n[l]===!1)i.style.removeProperty(l);else if(n[l]instanceof Array){let s=n[l];i.style.setProperty(l,s[0],s[1])}else{let s=n[l];i.style.setProperty(l,s)}}}})}applyScroll(e,t){let r=this.mirror.getNode(e.id);if(!r)return this.debugNodeNotFound(e,e.id);let o=this.mirror.getMeta(r);if(r===this.iframe.contentDocument)this.iframe.contentWindow?.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if(o?.type===Me.Document)r.defaultView?.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{r.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:o,startOffset:c,end:f,endOffset:d})=>{let g=this.mirror.getNode(o),p=this.mirror.getNode(f);if(!g||!p)return;let m=new Range;m.setStart(g,c),m.setEnd(p,d);let w=g.ownerDocument?.getSelection();return w&&t.add(w),{range:m,selection:w}});t.forEach(o=>o.removeAllRanges()),r.forEach(o=>o&&o.selection?.addRange(o.range))}catch{}}applyStyleSheetMutation(e){let t=null;e.styleId?t=this.styleMirror.getStyle(e.styleId):e.id&&(t=this.mirror.getNode(e.id)?.sheet||null),t&&(e.source===T.StyleSheetRule?this.applyStyleSheetRule(e,t):e.source===T.StyleDeclaration&&this.applyStyleDeclaration(e,t))}applyStyleSheetRule(e,t){if(e.adds?.forEach(({rule:r,index:o})=>{try{if(Array.isArray(o)){let{positions:c,index:f}=Qr(o);Qe(t.cssRules,c)?.insertRule(r,f)}else{let c=o===void 0?void 0:Math.min(o,t.cssRules.length);t?.insertRule(r,c)}}catch{}}),e.removes?.forEach(({index:r})=>{try{if(Array.isArray(r)){let{positions:o,index:c}=Qr(r);Qe(t.cssRules,o)?.deleteRule(c||0)}else t?.deleteRule(r)}catch{}}),typeof e.replace=="string")try{t.replace?.(e.replace)}catch{}if(typeof e.replaceSync=="string")try{t.replaceSync?.(e.replaceSync)}catch{}}applyStyleDeclaration(e,t){if(e.set){let r=Qe(t.rules,e.index);r?.style&&r.style.setProperty(e.set.property,e.set.value,e.set.priority)}if(e.remove){let r=Qe(t.rules,e.index);r?.style&&r.style.removeProperty(e.remove.property)}}applyAdoptedStyleSheet(e){let t=this.mirror.getNode(e.id);if(!t)return;e.styles?.forEach(f=>{let d=null,g=null;if(Pe(t)?g=t.ownerDocument?.defaultView||null:t.nodeName==="#document"&&(g=t.defaultView),!!g)try{d=new g.CSSStyleSheet,this.styleMirror.add(d,f.styleId),this.applyStyleSheetRule({source:T.StyleSheetRule,adds:f.rules},d)}catch{}});let r=10,o=0,c=(f,d)=>{let g=d.map(p=>this.styleMirror.getStyle(p)).filter(p=>p!==null);Pe(f)?f.shadowRoot.adoptedStyleSheets=g:f.nodeName==="#document"&&(f.adoptedStyleSheets=g),g.length!==d.length&&o<r&&(setTimeout(()=>c(f,d),0+100*o),o++)};c(t,e.styleIds)}legacy_resolveMissingNode(e,t,r,o){let{previousId:c,nextId:f}=o,d=c&&e[c],g=f&&e[f];if(d){let{node:p,mutation:m}=d;t.insertBefore(p,r),delete e[m.node.id],delete this.legacy_missingNodeRetryMap[m.node.id],(m.previousId||m.nextId)&&this.legacy_resolveMissingNode(e,t,p,m)}if(g){let{node:p,mutation:m}=g;t.insertBefore(p,r.nextSibling),delete e[m.node.id],delete this.legacy_missingNodeRetryMap[m.node.id],(m.previousId||m.nextId)&&this.legacy_resolveMissingNode(e,t,p,m)}}moveAndHover(e,t,r,o,c){let f=this.mirror.getNode(r);if(!f)return this.debugNodeNotFound(c,r);let d=xi(f,this.iframe),g=e*d.absoluteScale+d.x,p=t*d.absoluteScale+d.y;this.mouse.style.left=`${g}px`,this.mouse.style.top=`${p}px`,o||this.drawMouseTail({x:g,y:p}),this.hoverElements(f)}drawMouseTail(e){if(!this.mouseTail)return;let{lineCap:t,lineWidth:r,strokeStyle:o,duration:c}=this.config.mouseTail===!0?Yt:Object.assign({},Yt,this.config.mouseTail),f=()=>{if(!this.mouseTail)return;let d=this.mouseTail.getContext("2d");!d||!this.tailPositions.length||(d.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),d.beginPath(),d.lineWidth=r,d.lineCap=t,d.strokeStyle=o,d.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(g=>d.lineTo(g.x,g.y)),d.stroke())};this.tailPositions.push(e),f(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(d=>d!==e),f()},c/this.speedService.state.context.timer.speed)}hoverElements(e){(this.lastHoveredRootNode||this.iframe.contentDocument)?.querySelectorAll(".\\\\:hover").forEach(r=>{r.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let t=e;for(;t;)t.classList&&t.classList.add(":hover"),t=t.parentElement}isUserInteraction(e){return e.type!==_.IncrementalSnapshot?!1:e.data.source>T.Mutation&&e.data.source<=T.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(j.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(ps,...e)}debug(...e){this.config.showDebug&&this.config.logger.log(ps,...e)}},{addCustomEvent:Fl,addAnnotation:Ul}=Te,{freezePage:Bl}=Te,{takeFullSnapshot:Wl}=Te;var $i=`.replayer-wrapper {\n position: relative;\n}\n.replayer-mouse {\n position: absolute;\n width: 20px;\n height: 20px;\n transition: left 0.05s linear, top 0.05s linear;\n background-size: contain;\n background-position: center center;\n background-repeat: no-repeat;\n background-image: url(\'data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzMwMHB4JyB3aWR0aD0nMzAwcHgnICBmaWxsPSIjMDAwMDAwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGRhdGEtbmFtZT0iTGF5ZXIgMSIgdmlld0JveD0iMCAwIDUwIDUwIiB4PSIwcHgiIHk9IjBweCI+PHRpdGxlPkRlc2lnbl90bnA8L3RpdGxlPjxwYXRoIGQ9Ik00OC43MSw0Mi45MUwzNC4wOCwyOC4yOSw0NC4zMywxOEExLDEsMCwwLDAsNDQsMTYuMzlMMi4zNSwxLjA2QTEsMSwwLDAsMCwxLjA2LDIuMzVMMTYuMzksNDRhMSwxLDAsMCwwLDEuNjUuMzZMMjguMjksMzQuMDgsNDIuOTEsNDguNzFhMSwxLDAsMCwwLDEuNDEsMGw0LjM4LTQuMzhBMSwxLDAsMCwwLDQ4LjcxLDQyLjkxWm0tNS4wOSwzLjY3TDI5LDMyYTEsMSwwLDAsMC0xLjQxLDBsLTkuODUsOS44NUwzLjY5LDMuNjlsMzguMTIsMTRMMzIsMjcuNThBMSwxLDAsMCwwLDMyLDI5TDQ2LjU5LDQzLjYyWiI+PC9wYXRoPjwvc3ZnPg==\');\n border-color: transparent; /* otherwise we transition from black when .touch-device class is added */\n}\n.replayer-mouse::after {\n content: \'\';\n display: inline-block;\n width: 20px;\n height: 20px;\n background: rgb(73, 80, 246);\n border-radius: 100%;\n transform: translate(-50%, -50%);\n opacity: 0.3;\n}\n.replayer-mouse.active::after {\n animation: click 0.2s ease-in-out 1;\n}\n.replayer-mouse.touch-device {\n background-image: none; /* there\'s no passive cursor on touch-only screens */\n width: 70px;\n height: 70px;\n border-width: 4px;\n border-style: solid;\n border-radius: 100%;\n margin-left: -37px;\n margin-top: -37px;\n border-color: rgba(73, 80, 246, 0);\n transition: left 0s linear, top 0s linear, border-color 0.2s ease-in-out;\n}\n.replayer-mouse.touch-device.touch-active {\n border-color: rgba(73, 80, 246, 1);\n transition: left 0.25s linear, top 0.25s linear, border-color 0.2s ease-in-out;\n}\n.replayer-mouse.touch-device::after {\n opacity: 0; /* there\'s no passive cursor on touch-only screens */\n}\n.replayer-mouse.touch-device.active::after {\n animation: touch-click 0.2s ease-in-out 1;\n}\n.replayer-mouse-tail {\n position: absolute;\n pointer-events: none;\n}\n\n@keyframes click {\n 0% {\n opacity: 0.3;\n width: 20px;\n height: 20px;\n }\n 50% {\n opacity: 0.5;\n width: 10px;\n height: 10px;\n }\n}\n\n@keyframes touch-click {\n 0% {\n opacity: 0;\n width: 20px;\n height: 20px;\n }\n 50% {\n opacity: 0.5;\n width: 10px;\n height: 10px;\n }\n}\n/*$vite$:1*//*$vite$:1*/`;var zi=document.createElement("style");zi.textContent=$i;document.head.append(zi);globalThis.__HAI_FEEDBACK_REPLAY__=(e,t)=>new Wi(e,{root:t,showWarning:!1,showDebug:!1,loadTimeout:1e3});})();\n' )
77
+ };
78
+ }
79
+
80
+ // src/bundle/feedback-bundle-functions.ts
81
+ var bundleM = core.i18n.createMessageGetter({
82
+ "zh-CN": {
83
+ invalid: "\u95EE\u9898\u5305\u683C\u5F0F\u3001\u5BB9\u91CF\u6216\u5B8C\u6574\u6027\u6821\u9A8C\u5931\u8D25",
84
+ title: "\u95EE\u9898\u53CD\u9988",
85
+ facts: "\u91C7\u96C6\u4E8B\u5B9E",
86
+ missing: "\u7F3A\u5931\u6750\u6599",
87
+ user: "\u7528\u6237\u63CF\u8FF0",
88
+ empty: "\u672A\u586B\u5199",
89
+ evidence: "\u8BC1\u636E",
90
+ attachments: "\u9644\u4EF6"
91
+ },
92
+ "en-US": {
93
+ invalid: "The feedback bundle failed format, size or integrity validation",
94
+ title: "Feedback report",
95
+ facts: "Collected facts",
96
+ missing: "Missing evidence",
97
+ user: "User description",
98
+ empty: "Not provided",
99
+ evidence: "Evidence",
100
+ attachments: "Attachments"
101
+ },
102
+ "ja-JP": {
103
+ invalid: "\u554F\u984C\u30D1\u30C3\u30B1\u30FC\u30B8\u306E\u5F62\u5F0F\u3001\u5BB9\u91CF\u307E\u305F\u306F\u6574\u5408\u6027\u306E\u691C\u8A3C\u306B\u5931\u6557\u3057\u307E\u3057\u305F",
104
+ title: "\u554F\u984C\u30D5\u30A3\u30FC\u30C9\u30D0\u30C3\u30AF",
105
+ facts: "\u53CE\u96C6\u3057\u305F\u4E8B\u5B9F",
106
+ missing: "\u4E0D\u8DB3\u3057\u3066\u3044\u308B\u8CC7\u6599",
107
+ user: "\u30E6\u30FC\u30B6\u30FC\u306E\u8AAC\u660E",
108
+ empty: "\u672A\u5165\u529B",
109
+ evidence: "\u8A3C\u62E0",
110
+ attachments: "\u6DFB\u4ED8\u30D5\u30A1\u30A4\u30EB"
111
+ }
112
+ });
113
+ var MAX_FILES = 1024;
114
+ var MAX_BYTES = 64 * 1024 * 1024;
115
+ var MAX_FILE_BYTES = 16 * 1024 * 1024;
116
+ var SHA256 = /^[a-f0-9]{64}$/;
117
+ var SAFE_ID = /^[\w-]{1,128}$/;
118
+ function jsonObject(value) {
119
+ const parsed = JSON.parse(JSON.stringify(value));
120
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
121
+ throw new Error("Expected object");
122
+ return parsed;
123
+ }
124
+ function safePath(value) {
125
+ return /^[a-z0-9][\w./-]*$/i.test(value) && !value.endsWith("/") && !value.split("/").some((segment) => !segment || segment === "." || segment === "..");
126
+ }
127
+ async function checksum(bytes) {
128
+ const hash = await globalThis.crypto.subtle.digest("SHA-256", new Uint8Array(bytes).buffer);
129
+ return Array.from(new Uint8Array(hash), (byte) => byte.toString(16).padStart(2, "0")).join("");
130
+ }
131
+ function objectFromFile(files, path) {
132
+ const bytes = files[path];
133
+ if (!bytes)
134
+ throw new Error("Missing file");
135
+ const parsed = JSON.parse(strFromU8(bytes));
136
+ return jsonObject(parsed);
137
+ }
138
+ function evidenceFrom(value) {
139
+ const record = jsonObject(value);
140
+ if (typeof record.source !== "string" || typeof record.kind !== "string" || typeof record.timestamp !== "number" || !Number.isFinite(record.timestamp))
141
+ throw new TypeError("Invalid evidence");
142
+ for (const key of [
143
+ "id",
144
+ "requestId",
145
+ "errorId",
146
+ "missingReason"
147
+ ]) {
148
+ if (record[key] !== void 0 && typeof record[key] !== "string")
149
+ throw new Error("Invalid evidence field");
150
+ }
151
+ if (record.sequence !== void 0 && (typeof record.sequence !== "number" || !Number.isSafeInteger(record.sequence) || record.sequence < 0))
152
+ throw new Error("Invalid evidence sequence");
153
+ return {
154
+ source: record.source,
155
+ kind: record.kind,
156
+ timestamp: record.timestamp,
157
+ ...typeof record.id === "string" ? { id: record.id } : {},
158
+ ...typeof record.sequence === "number" ? { sequence: record.sequence } : {},
159
+ ...typeof record.requestId === "string" ? { requestId: record.requestId } : {},
160
+ ...typeof record.errorId === "string" ? { errorId: record.errorId } : {},
161
+ ...typeof record.missingReason === "string" ? { missingReason: record.missingReason } : {},
162
+ ...record.data !== void 0 ? { data: record.data } : {}
163
+ };
164
+ }
165
+ function limitsFor(options = {}) {
166
+ const limits = { maxFiles: options.maxFiles ?? MAX_FILES, maxBytes: options.maxBytes ?? MAX_BYTES, maxFileBytes: options.maxFileBytes ?? MAX_FILE_BYTES };
167
+ if (Object.values(limits).some((value) => !Number.isSafeInteger(value) || value <= 0))
168
+ throw new Error("Invalid limits");
169
+ return limits;
170
+ }
171
+ function preflight(bytes, limits) {
172
+ if (bytes.byteLength > limits.maxBytes || bytes.byteLength < 22)
173
+ throw new Error("Invalid archive size");
174
+ const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
175
+ let end = -1;
176
+ for (let offset2 = bytes.length - 22; offset2 >= Math.max(0, bytes.length - 65557); offset2--) {
177
+ if (view.getUint32(offset2, true) === 101010256 && offset2 + 22 + view.getUint16(offset2 + 20, true) === bytes.length) {
178
+ end = offset2;
179
+ break;
180
+ }
181
+ }
182
+ if (end < 0 || view.getUint16(end + 4, true) !== 0 || view.getUint16(end + 6, true) !== 0)
183
+ throw new Error("Invalid archive directory");
184
+ const count = view.getUint16(end + 10, true);
185
+ const size = view.getUint32(end + 12, true);
186
+ let offset = view.getUint32(end + 16, true);
187
+ if (count === 0 || count > limits.maxFiles || count !== view.getUint16(end + 8, true) || offset + size !== end)
188
+ throw new Error("Invalid archive directory size");
189
+ let total = 0;
190
+ const names = /* @__PURE__ */ new Set();
191
+ for (let index = 0; index < count; index++) {
192
+ if (offset + 46 > end || view.getUint32(offset, true) !== 33639248)
193
+ throw new Error("Invalid archive entry");
194
+ const nameLength = view.getUint16(offset + 28, true);
195
+ const next = offset + 46 + nameLength + view.getUint16(offset + 30, true) + view.getUint16(offset + 32, true);
196
+ if (next > end)
197
+ throw new Error("Invalid archive entry length");
198
+ const name = strFromU8(bytes.subarray(offset + 46, offset + 46 + nameLength));
199
+ const originalSize = view.getUint32(offset + 24, true);
200
+ const method = view.getUint16(offset + 10, true);
201
+ const mode = view.getUint32(offset + 38, true) >>> 16 & 61440;
202
+ if (!safePath(name) || names.has(name.toLowerCase()) || originalSize > limits.maxFileBytes || view.getUint16(offset + 8, true) & 1 || ![0, 8].includes(method) || mode !== 0 && mode !== 32768) {
203
+ throw new Error("Unsafe archive entry");
204
+ }
205
+ total += originalSize;
206
+ if (total > limits.maxBytes)
207
+ throw new Error("Archive expansion limit");
208
+ names.add(name.toLowerCase());
209
+ offset = next;
210
+ }
211
+ if (offset !== end)
212
+ throw new Error("Unexpected archive entry");
213
+ }
214
+ function parseManifest(value) {
215
+ if (value.format !== "hai-feedback" || value.version !== 1 || typeof value.reportId !== "string" || typeof value.evidenceRevision !== "number" || !Number.isSafeInteger(value.evidenceRevision) || value.evidenceRevision < 0 || typeof value.createdAt !== "number" || !Number.isFinite(value.createdAt) || !Array.isArray(value.files) || !Array.isArray(value.missing) || value.missing.some((item) => typeof item !== "string")) {
216
+ throw new Error("Unsupported manifest");
217
+ }
218
+ const files = value.files.map((item) => {
219
+ const file = jsonObject(item);
220
+ if (typeof file.path !== "string" || !safePath(file.path) || file.path === "manifest.json" || typeof file.size !== "number" || !Number.isSafeInteger(file.size) || file.size < 0 || typeof file.sha256 !== "string" || !SHA256.test(file.sha256) || ![
221
+ "report",
222
+ "evidence",
223
+ "history",
224
+ "attachment",
225
+ "summary",
226
+ "viewer"
227
+ ].includes(String(file.kind))) {
228
+ throw new Error("Invalid manifest file");
229
+ }
230
+ return {
231
+ path: file.path,
232
+ size: file.size,
233
+ sha256: file.sha256,
234
+ kind: file.kind,
235
+ ...typeof file.attachmentId === "string" ? { attachmentId: file.attachmentId } : {},
236
+ ...typeof file.name === "string" ? { name: file.name } : {},
237
+ ...typeof file.contentType === "string" ? { contentType: file.contentType } : {}
238
+ };
239
+ });
240
+ if (new Set(files.map((file) => file.path)).size !== files.length)
241
+ throw new Error("Duplicate manifest file");
242
+ return {
243
+ format: "hai-feedback",
244
+ version: 1,
245
+ reportId: value.reportId,
246
+ evidenceRevision: value.evidenceRevision,
247
+ createdAt: value.createdAt,
248
+ missing: value.missing,
249
+ files
250
+ };
251
+ }
252
+ async function createFeedbackBundle(input) {
253
+ try {
254
+ if (input.createdAt !== void 0 && (!Number.isSafeInteger(input.createdAt) || input.createdAt < 0))
255
+ throw new Error("Invalid bundle creation time");
256
+ const report = jsonObject(input.report);
257
+ if (typeof report.id !== "string" || !SAFE_ID.test(report.id))
258
+ throw new Error("Invalid report");
259
+ if (["appVersion", "buildId", "commit"].some((key) => report[key] !== void 0 && (typeof report[key] !== "string" || report[key].length > 128)))
260
+ throw new Error("Invalid build metadata");
261
+ if (report.evidenceRevision !== void 0 && (typeof report.evidenceRevision !== "number" || !Number.isSafeInteger(report.evidenceRevision) || report.evidenceRevision < 0))
262
+ throw new Error("Invalid evidence revision");
263
+ const evidence = input.evidence.map(evidenceFrom);
264
+ const history = (input.history ?? []).map(jsonObject);
265
+ const missing = [
266
+ ...input.missing ?? []
267
+ ];
268
+ if (missing.some((item) => typeof item !== "string"))
269
+ throw new Error("Invalid missing evidence");
270
+ const files = {
271
+ "report.json": strToU8(JSON.stringify(report)),
272
+ "timeline.ndjson": strToU8(evidence.map((record) => JSON.stringify(record)).join("\n")),
273
+ "evidence/records.json": strToU8(JSON.stringify(evidence)),
274
+ "evidence/history.json": strToU8(JSON.stringify(history)),
275
+ ...feedbackViewerFiles()
276
+ };
277
+ const manifestFiles = [];
278
+ const ids = /* @__PURE__ */ new Set();
279
+ for (const attachment of input.attachments ?? []) {
280
+ if (typeof attachment.id !== "string" || attachment.id.length < 1 || attachment.id.length > 128 || ids.has(attachment.id) || attachment.bytes.byteLength > MAX_FILE_BYTES)
281
+ throw new Error("Invalid attachment");
282
+ ids.add(attachment.id);
283
+ const suffix = {
284
+ "image/png": "png",
285
+ "image/jpeg": "jpg",
286
+ "image/webp": "webp",
287
+ "video/webm": "webm",
288
+ "video/mp4": "mp4",
289
+ "text/plain": "txt",
290
+ "application/json": "json",
291
+ "application/pdf": "pdf"
292
+ }[attachment.contentType] ?? "bin";
293
+ const path = `attachments/${await checksum(strToU8(JSON.stringify(attachment.id)))}.${suffix}`;
294
+ const hash = await checksum(attachment.bytes);
295
+ if (attachment.checksum && attachment.checksum !== hash)
296
+ throw new Error("Attachment checksum mismatch");
297
+ files[path] = new Uint8Array(attachment.bytes);
298
+ manifestFiles.push({
299
+ path,
300
+ size: attachment.bytes.byteLength,
301
+ sha256: hash,
302
+ kind: "attachment",
303
+ attachmentId: attachment.id,
304
+ name: attachment.name,
305
+ contentType: attachment.contentType
306
+ });
307
+ }
308
+ const manifest = {
309
+ format: "hai-feedback",
310
+ version: 1,
311
+ reportId: report.id,
312
+ evidenceRevision: typeof report.evidenceRevision === "number" ? report.evidenceRevision : 0,
313
+ createdAt: input.createdAt ?? Date.now(),
314
+ missing,
315
+ files: manifestFiles
316
+ };
317
+ const temporary = {
318
+ report: { ...report, id: report.id },
319
+ evidence,
320
+ history,
321
+ manifest,
322
+ files
323
+ };
324
+ files["summary.md"] = strToU8(summarizeFeedbackBundle(temporary));
325
+ for (const [path, bytes] of Object.entries(files)) {
326
+ if (manifestFiles.some((file) => file.path === path))
327
+ continue;
328
+ const kind = path === "report.json" ? "report" : path === "summary.md" ? "summary" : path.startsWith("viewer/") ? "viewer" : path.endsWith("history.json") ? "history" : "evidence";
329
+ manifest.files.push({
330
+ path,
331
+ size: bytes.byteLength,
332
+ sha256: await checksum(bytes),
333
+ kind
334
+ });
335
+ }
336
+ files["manifest.json"] = strToU8(JSON.stringify(manifest, null, 2));
337
+ const total = Object.values(files).reduce((sum, file) => sum + file.byteLength, 0);
338
+ if (Object.keys(files).length > MAX_FILES || total > Math.min(input.maxBytes ?? MAX_BYTES, MAX_BYTES) || Object.values(files).some((file) => file.byteLength > MAX_FILE_BYTES))
339
+ throw new Error("Bundle limits exceeded");
340
+ return ok(zipSync(files, {
341
+ level: 1,
342
+ mtime: new Date(1980, 0, 1)
343
+ }));
344
+ } catch {
345
+ return err(HaiCommonError.VALIDATION_ERROR, bundleM("invalid"));
346
+ }
347
+ }
348
+ async function readFeedbackBundle(bytes, options) {
349
+ try {
350
+ const limits = limitsFor(options);
351
+ preflight(bytes, limits);
352
+ const files = unzipSync(bytes);
353
+ const manifest = parseManifest(objectFromFile(files, "manifest.json"));
354
+ if (Object.keys(files).length !== manifest.files.length + 1)
355
+ throw new Error("Unexpected bundle file");
356
+ let total = 0;
357
+ for (const file of manifest.files) {
358
+ const content = files[file.path];
359
+ if (!content || content.byteLength !== file.size || content.byteLength > limits.maxFileBytes || await checksum(content) !== file.sha256)
360
+ throw new Error("File integrity failed");
361
+ total += content.byteLength;
362
+ }
363
+ if (total > limits.maxBytes)
364
+ throw new Error("Bundle expansion limit");
365
+ const report = objectFromFile(files, "report.json");
366
+ if (["appVersion", "buildId", "commit"].some((key) => report[key] !== void 0 && (typeof report[key] !== "string" || report[key].length > 128)))
367
+ throw new Error("Invalid build metadata");
368
+ if (typeof report.id !== "string" || report.id !== manifest.reportId)
369
+ throw new Error("Report mismatch");
370
+ const records = JSON.parse(strFromU8(files["evidence/records.json"] ?? new Uint8Array()));
371
+ const history = JSON.parse(strFromU8(files["evidence/history.json"] ?? new Uint8Array()));
372
+ if (!Array.isArray(records) || !Array.isArray(history))
373
+ throw new TypeError("Invalid evidence collection");
374
+ return ok({
375
+ manifest,
376
+ report: { ...report, id: report.id },
377
+ evidence: records.map(evidenceFrom),
378
+ history: history.map(jsonObject),
379
+ files
380
+ });
381
+ } catch {
382
+ return err(HaiCommonError.VALIDATION_ERROR, bundleM("invalid"));
383
+ }
384
+ }
385
+ function summarizeFeedbackBundle(bundle) {
386
+ const report = bundle.report;
387
+ const safeText = (value) => typeof value === "string" || typeof value === "number" ? String(value).replaceAll("\r", "").replaceAll("\n", " ") : "";
388
+ return [
389
+ `# ${bundleM("title")} ${safeText(report.number ?? report.id)}`,
390
+ "",
391
+ `## ${bundleM("user")}`,
392
+ "",
393
+ safeText(report.description) || bundleM("empty"),
394
+ "",
395
+ `## ${bundleM("facts")}`,
396
+ "",
397
+ `- ID: ${safeText(report.id)}`,
398
+ `- App: ${safeText(report.appId)} ${safeText(report.appVersion)}`,
399
+ `- Build: ${safeText(report.buildId)} ${safeText(report.commit)}`,
400
+ `- Revision: ${bundle.manifest.evidenceRevision}`,
401
+ `- ${bundleM("evidence")}: ${bundle.evidence.length}`,
402
+ `- ${bundleM("attachments")}: ${bundle.manifest.files.filter((file) => file.kind === "attachment").length}`,
403
+ "",
404
+ `## ${bundleM("missing")}`,
405
+ "",
406
+ ...bundle.manifest.missing.map((reason) => `- ${safeText(reason)}`),
407
+ ""
408
+ ].join("\n");
409
+ }
410
+ function queryFeedbackBundle(bundle, query = {}) {
411
+ const page = Number.isSafeInteger(query.page) && (query.page ?? 0) > 0 ? query.page : 1;
412
+ const pageSize = Number.isSafeInteger(query.pageSize) && (query.pageSize ?? 0) > 0 ? Math.min(100, query.pageSize) : 20;
413
+ let candidates = bundle.evidence;
414
+ if (query.errorId) {
415
+ const anchor = candidates.find((item) => item.kind === "error" && item.errorId === query.errorId);
416
+ if (!anchor)
417
+ return { items: [], total: 0, page, pageSize };
418
+ const anchorSequence = anchor.sequence ?? anchor.timestamp;
419
+ const context = candidates.filter((item) => item.source === anchor.source && item.requestId === anchor.requestId && ["log", "error"].includes(item.kind));
420
+ const before = context.filter((item) => (item.sequence ?? item.timestamp) <= anchorSequence).sort((left, right) => (right.sequence ?? right.timestamp) - (left.sequence ?? left.timestamp)).slice(0, 101);
421
+ const after = context.filter((item) => (item.sequence ?? item.timestamp) > anchorSequence).sort((left, right) => (left.sequence ?? left.timestamp) - (right.sequence ?? right.timestamp)).slice(0, 100);
422
+ const window = /* @__PURE__ */ new Set([
423
+ ...before,
424
+ ...after
425
+ ]);
426
+ candidates = candidates.filter((item) => window.has(item));
427
+ }
428
+ const records = candidates.filter((item) => (!query.kind || item.kind === query.kind) && (!query.requestId || item.requestId === query.requestId) && (query.from === void 0 || item.timestamp >= query.from) && (query.to === void 0 || item.timestamp <= query.to)).sort((left, right) => left.timestamp - right.timestamp || left.source.localeCompare(right.source) || (left.sequence ?? 0) - (right.sequence ?? 0));
429
+ return {
430
+ items: records.slice((page - 1) * pageSize, page * pageSize),
431
+ total: records.length,
432
+ page,
433
+ pageSize
434
+ };
435
+ }
436
+ function getFeedbackBundleViewerFiles() {
437
+ return feedbackViewerFiles();
438
+ }
439
+
440
+ export { createFeedbackBundle, getFeedbackBundleViewerFiles, queryFeedbackBundle, readFeedbackBundle, summarizeFeedbackBundle };
441
+ //# sourceMappingURL=chunk-IFJHL5VK.js.map
442
+ //# sourceMappingURL=chunk-IFJHL5VK.js.map