@bworlds/launchkit 0.1.0 → 0.1.1

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.
@@ -1,4 +1,4 @@
1
- (function(ye,Ge){typeof exports=="object"&&typeof module<"u"?Ge(exports):typeof define=="function"&&define.amd?define(["exports"],Ge):(ye=typeof globalThis<"u"?globalThis:ye||self,Ge(ye.BWorldsLaunchKit={}))})(this,(function(ye){"use strict";var Ge=Object.defineProperty,ja=(s,e,t)=>e in s?Ge(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,S=(s,e,t)=>ja(s,typeof e!="symbol"?e+"":e,t),pi,Ga=Object.defineProperty,Va=(s,e,t)=>e in s?Ga(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,mi=(s,e,t)=>Va(s,typeof e!="symbol"?e+"":e,t),J=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(J||{});const gi={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},yi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},wt={},Ya=()=>!!globalThis.Zone;function Mr(s){if(wt[s])return wt[s];const e=globalThis[s],t=e.prototype,r=s in gi?gi[s]:void 0,i=!!(r&&r.every(l=>{var a,u;return!!((u=(a=Object.getOwnPropertyDescriptor(t,l))==null?void 0:a.get)!=null&&u.toString().includes("[native code]"))})),n=s in yi?yi[s]:void 0,o=!!(n&&n.every(l=>{var a;return typeof t[l]=="function"&&((a=t[l])==null?void 0:a.toString().includes("[native code]"))}));if(i&&o&&!Ya())return wt[s]=e.prototype,e.prototype;try{const l=document.createElement("iframe");document.body.appendChild(l);const a=l.contentWindow;if(!a)return e.prototype;const u=a[s].prototype;return document.body.removeChild(l),u?wt[s]=u:t}catch{return t}}const Ar={};function we(s,e,t){var r;const i=`${s}.${String(t)}`;if(Ar[i])return Ar[i].call(e);const n=Mr(s),o=(r=Object.getOwnPropertyDescriptor(n,t))==null?void 0:r.get;return o?(Ar[i]=o,o.call(e)):e[t]}const Or={};function wi(s,e,t){const r=`${s}.${String(t)}`;if(Or[r])return Or[r].bind(e);const n=Mr(s)[t];return typeof n!="function"?e[t]:(Or[r]=n,n.bind(e))}function Za(s){return we("Node",s,"childNodes")}function Ja(s){return we("Node",s,"parentNode")}function Xa(s){return we("Node",s,"parentElement")}function Ka(s){return we("Node",s,"textContent")}function Qa(s,e){return wi("Node",s,"contains")(e)}function qa(s){return wi("Node",s,"getRootNode")()}function el(s){return!s||!("host"in s)?null:we("ShadowRoot",s,"host")}function tl(s){return s.styleSheets}function rl(s){return!s||!("shadowRoot"in s)?null:we("Element",s,"shadowRoot")}function sl(s,e){return we("Element",s,"querySelector")(e)}function il(s,e){return we("Element",s,"querySelectorAll")(e)}function nl(){return Mr("MutationObserver").constructor}const q={childNodes:Za,parentNode:Ja,parentElement:Xa,textContent:Ka,contains:Qa,getRootNode:qa,host:el,styleSheets:tl,shadowRoot:rl,querySelector:sl,querySelectorAll:il,mutationObserver:nl};function bi(s){return s.nodeType===s.ELEMENT_NODE}function Ve(s){const e=s&&"host"in s&&"mode"in s&&q.host(s)||null;return!!(e&&"shadowRoot"in e&&q.shadowRoot(e)===s)}function Ye(s){return Object.prototype.toString.call(s)==="[object ShadowRoot]"}function ol(s){return s.includes(" background-clip: text;")&&!s.includes(" -webkit-background-clip: text;")&&(s=s.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),s}function al(s){const{cssText:e}=s;if(e.split('"').length<3)return e;const t=["@import",`url(${JSON.stringify(s.href)})`];return s.layerName===""?t.push("layer"):s.layerName&&t.push(`layer(${s.layerName})`),s.supportsText&&t.push(`supports(${s.supportsText})`),s.media.length&&t.push(s.media.mediaText),t.join(" ")+";"}function $r(s){try{const e=s.rules||s.cssRules;if(!e)return null;let t=s.href;!t&&s.ownerNode&&s.ownerNode.ownerDocument&&(t=s.ownerNode.ownerDocument.location.href);const r=Array.from(e,i=>vi(i,t)).join("");return ol(r)}catch{return null}}function vi(s,e){if(ul(s)){let t;try{t=$r(s.styleSheet)||al(s)}catch{t=s.cssText}return s.styleSheet.href?bt(t,s.styleSheet.href):t}else{let t=s.cssText;return cl(s)&&s.selectorText.includes(":")&&(t=ll(t)),e?bt(t,e):t}}function ll(s){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return s.replace(e,"$1\\$2")}function ul(s){return"styleSheet"in s}function cl(s){return"selectorText"in s}class Si{constructor(){mi(this,"idNodeMap",new Map),mi(this,"nodeMetaMap",new WeakMap)}getId(e){var t;return e?((t=this.getMeta(e))==null?void 0:t.id)??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const 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){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function hl(){return new Si}function Nr({element:s,maskInputOptions:e,tagName:t,type:r,value:i,maskInputFn:n}){let o=i||"";const l=r&&Se(r);return(e[t.toLowerCase()]||l&&e[l])&&(n?o=n(o,s):o="*".repeat(o.length)),o}function Se(s){return s.toLowerCase()}const Ci="__rrweb_original__";function fl(s){const e=s.getContext("2d");if(!e)return!0;const t=50;for(let r=0;r<s.width;r+=t)for(let i=0;i<s.height;i+=t){const n=e.getImageData,o=Ci in n?n[Ci]:n;if(new Uint32Array(o.call(e,r,i,Math.min(t,s.width-r),Math.min(t,s.height-i)).data.buffer).some(a=>a!==0))return!1}return!0}function Tr(s){const e=s.type;return s.hasAttribute("data-rr-is-password")?"password":e?Se(e):null}function _i(s,e){let t;try{t=new URL(s,e??window.location.href)}catch{return null}const r=/\.([0-9a-z]+)(?:$)/i,i=t.pathname.match(r);return(i==null?void 0:i[1])??null}function dl(s){let e="";return s.indexOf("//")>-1?e=s.split("/").slice(0,3).join("/"):e=s.split("/")[0],e=e.split("?")[0],e}const pl=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,ml=/^(?:[a-z+]+:)?\/\//i,gl=/^www\..*/i,yl=/^(data:)([^,]*),(.*)/i;function bt(s,e){return(s||"").replace(pl,(t,r,i,n,o,l)=>{const a=i||o||l,u=r||n||"";if(!a)return t;if(ml.test(a)||gl.test(a))return`url(${u}${a}${u})`;if(yl.test(a))return`url(${u}${a}${u})`;if(a[0]==="/")return`url(${u}${dl(e)+a}${u})`;const c=e.split("/"),h=a.split("/");c.pop();for(const p of h)p!=="."&&(p===".."?c.pop():c.push(p));return`url(${u}${c.join("/")}${u})`})}function Pr(s){return s.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function wl(s,e){const t=Array.from(e.childNodes),r=[];if(t.length>1&&s&&typeof s=="string"){const i=Pr(s);for(let n=1;n<t.length;n++)if(t[n].textContent&&typeof t[n].textContent=="string"){const o=Pr(t[n].textContent);for(let l=3;l<o.length;l++){const a=o.substring(0,l);if(i.split(a).length===2){const u=i.indexOf(a);for(let c=u;c<s.length;c++)if(Pr(s.substring(0,c)).length===u){r.push(s.substring(0,c)),s=s.substring(c);break}break}}}}return r.push(s),r}function bl(s,e){return wl(s,e).join("/* rr_split */")}let vl=1;const Sl=new RegExp("[^a-z0-9-_:]"),Ze=-2;function xi(){return vl++}function Cl(s){if(s instanceof HTMLFormElement)return"form";const e=Se(s.tagName);return Sl.test(e)?"div":e}let Me,Ii;const _l=/^[^ \t\n\r\u000c]+/,xl=/^[, \t\n\r\u000c]+/;function Il(s,e){if(e.trim()==="")return e;let t=0;function r(n){let o;const l=n.exec(e.substring(t));return l?(o=l[0],t+=o.length,o):""}const i=[];for(;r(xl),!(t>=e.length);){let n=r(_l);if(n.slice(-1)===",")n=Ae(s,n.substring(0,n.length-1)),i.push(n);else{let o="";n=Ae(s,n);let l=!1;for(;;){const a=e.charAt(t);if(a===""){i.push((n+o).trim());break}else if(l)a===")"&&(l=!1);else if(a===","){t+=1,i.push((n+o).trim());break}else a==="("&&(l=!0);o+=a,t+=1}}}return i.join(", ")}const Ri=new WeakMap;function Ae(s,e){return!e||e.trim()===""?e:Dr(s,e)}function Rl(s){return!!(s.tagName==="svg"||s.ownerSVGElement)}function Dr(s,e){let t=Ri.get(s);if(t||(t=s.createElement("a"),Ri.set(s,t)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return t.setAttribute("href",e),t.href}function ki(s,e,t,r){return r&&(t==="src"||t==="href"&&!(e==="use"&&r[0]==="#")||t==="xlink:href"&&r[0]!=="#"||t==="background"&&(e==="table"||e==="td"||e==="th")?Ae(s,r):t==="srcset"?Il(s,r):t==="style"?bt(r,Dr(s)):e==="object"&&t==="data"?Ae(s,r):r)}function Ei(s,e,t){return(s==="video"||s==="audio")&&e==="autoplay"}function kl(s,e,t){try{if(typeof e=="string"){if(s.classList.contains(e))return!0}else for(let r=s.classList.length;r--;){const i=s.classList[r];if(e.test(i))return!0}if(t)return s.matches(t)}catch{}return!1}function vt(s,e,t){if(!s)return!1;if(s.nodeType!==s.ELEMENT_NODE)return t?vt(q.parentNode(s),e,t):!1;for(let r=s.classList.length;r--;){const i=s.classList[r];if(e.test(i))return!0}return t?vt(q.parentNode(s),e,t):!1}function Mi(s,e,t,r){let i;if(bi(s)){if(i=s,!q.childNodes(i).length)return!1}else{if(q.parentElement(s)===null)return!1;i=q.parentElement(s)}try{if(typeof e=="string"){if(r){if(i.closest(`.${e}`))return!0}else if(i.classList.contains(e))return!0}else if(vt(i,e,r))return!0;if(t){if(r){if(i.closest(t))return!0}else if(i.matches(t))return!0}}catch{}return!1}function El(s,e,t){const r=s.contentWindow;if(!r)return;let i=!1,n;try{n=r.document.readyState}catch{return}if(n!=="complete"){const l=setTimeout(()=>{i||(e(),i=!0)},t);s.addEventListener("load",()=>{clearTimeout(l),i=!0,e()});return}const o="about:blank";if(r.location.href!==o||s.src===o||s.src==="")return setTimeout(e,0),s.addEventListener("load",e);s.addEventListener("load",e)}function Ml(s,e,t){let r=!1,i;try{i=s.sheet}catch{return}if(i)return;const n=setTimeout(()=>{r||(e(),r=!0)},t);s.addEventListener("load",()=>{clearTimeout(n),r=!0,e()})}function Al(s,e){const{doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:o,inlineStylesheet:l,maskInputOptions:a={},maskTextFn:u,maskInputFn:c,dataURLOptions:h={},inlineImages:p,recordCanvas:d,keepIframeSrcFn:g,newlyAddedElement:m=!1,cssCaptured:f=!1}=e,v=Ol(t,r);switch(s.nodeType){case s.DOCUMENT_NODE:return s.compatMode!=="CSS1Compat"?{type:J.Document,childNodes:[],compatMode:s.compatMode}:{type:J.Document,childNodes:[]};case s.DOCUMENT_TYPE_NODE:return{type:J.DocumentType,name:s.name,publicId:s.publicId,systemId:s.systemId,rootId:v};case s.ELEMENT_NODE:return Nl(s,{doc:t,blockClass:i,blockSelector:n,inlineStylesheet:l,maskInputOptions:a,maskInputFn:c,dataURLOptions:h,inlineImages:p,recordCanvas:d,keepIframeSrcFn:g,newlyAddedElement:m,rootId:v});case s.TEXT_NODE:return $l(s,{doc:t,needsMask:o,maskTextFn:u,rootId:v,cssCaptured:f});case s.CDATA_SECTION_NODE:return{type:J.CDATA,textContent:"",rootId:v};case s.COMMENT_NODE:return{type:J.Comment,textContent:q.textContent(s)||"",rootId:v};default:return!1}}function Ol(s,e){if(!e.hasNode(s))return;const t=e.getId(s);return t===1?void 0:t}function $l(s,e){const{needsMask:t,maskTextFn:r,rootId:i,cssCaptured:n}=e,o=q.parentNode(s),l=o&&o.tagName;let a="";const u=l==="STYLE"?!0:void 0,c=l==="SCRIPT"?!0:void 0;return c?a="SCRIPT_PLACEHOLDER":n||(a=q.textContent(s),u&&a&&(a=bt(a,Dr(e.doc)))),!u&&!c&&a&&t&&(a=r?r(a,q.parentElement(s)):a.replace(/[\S]/g,"*")),{type:J.Text,textContent:a||"",rootId:i}}function Nl(s,e){const{doc:t,blockClass:r,blockSelector:i,inlineStylesheet:n,maskInputOptions:o={},maskInputFn:l,dataURLOptions:a={},inlineImages:u,recordCanvas:c,keepIframeSrcFn:h,newlyAddedElement:p=!1,rootId:d}=e,g=kl(s,r,i),m=Cl(s);let f={};const v=s.attributes.length;for(let y=0;y<v;y++){const C=s.attributes[y];Ei(m,C.name,C.value)||(f[C.name]=ki(t,m,Se(C.name),C.value))}if(m==="link"&&n){const y=Array.from(t.styleSheets).find(k=>k.href===s.href);let C=null;y&&(C=$r(y)),C&&(delete f.rel,delete f.href,f._cssText=C)}if(m==="style"&&s.sheet){let y=$r(s.sheet);y&&(s.childNodes.length>1&&(y=bl(y,s)),f._cssText=y)}if(m==="input"||m==="textarea"||m==="select"){const y=s.value,C=s.checked;f.type!=="radio"&&f.type!=="checkbox"&&f.type!=="submit"&&f.type!=="button"&&y?f.value=Nr({element:s,type:Tr(s),tagName:m,value:y,maskInputOptions:o,maskInputFn:l}):C&&(f.checked=C)}if(m==="option"&&(s.selected&&!o.select?f.selected=!0:delete f.selected),m==="dialog"&&s.open&&(f.rr_open_mode=s.matches("dialog:modal")?"modal":"non-modal"),m==="canvas"&&c){if(s.__context==="2d")fl(s)||(f.rr_dataURL=s.toDataURL(a.type,a.quality));else if(!("__context"in s)){const y=s.toDataURL(a.type,a.quality),C=t.createElement("canvas");C.width=s.width,C.height=s.height;const k=C.toDataURL(a.type,a.quality);y!==k&&(f.rr_dataURL=y)}}if(m==="img"&&u){Me||(Me=t.createElement("canvas"),Ii=Me.getContext("2d"));const y=s,C=y.currentSrc||y.getAttribute("src")||"<unknown-src>",k=y.crossOrigin,M=()=>{y.removeEventListener("load",M);try{Me.width=y.naturalWidth,Me.height=y.naturalHeight,Ii.drawImage(y,0,0),f.rr_dataURL=Me.toDataURL(a.type,a.quality)}catch(V){if(y.crossOrigin!=="anonymous"){y.crossOrigin="anonymous",y.complete&&y.naturalWidth!==0?M():y.addEventListener("load",M);return}else console.warn(`Cannot inline img src=${C}! Error: ${V}`)}y.crossOrigin==="anonymous"&&(k?f.crossOrigin=k:y.removeAttribute("crossorigin"))};y.complete&&y.naturalWidth!==0?M():y.addEventListener("load",M)}if(m==="audio"||m==="video"){const y=f;y.rr_mediaState=s.paused?"paused":"played",y.rr_mediaCurrentTime=s.currentTime,y.rr_mediaPlaybackRate=s.playbackRate,y.rr_mediaMuted=s.muted,y.rr_mediaLoop=s.loop,y.rr_mediaVolume=s.volume}if(p||(s.scrollLeft&&(f.rr_scrollLeft=s.scrollLeft),s.scrollTop&&(f.rr_scrollTop=s.scrollTop)),g){const{width:y,height:C}=s.getBoundingClientRect();f={class:f.class,rr_width:`${y}px`,rr_height:`${C}px`}}m==="iframe"&&!h(f.src)&&(s.contentDocument||(f.rr_src=f.src),delete f.src);let b;try{customElements.get(m)&&(b=!0)}catch{}return{type:J.Element,tagName:m,attributes:f,childNodes:[],isSVG:Rl(s)||void 0,needBlock:g,rootId:d,isCustom:b}}function D(s){return s==null?"":s.toLowerCase()}function Tl(s,e){if(e.comment&&s.type===J.Comment)return!0;if(s.type===J.Element){if(e.script&&(s.tagName==="script"||s.tagName==="link"&&(s.attributes.rel==="preload"||s.attributes.rel==="modulepreload")&&s.attributes.as==="script"||s.tagName==="link"&&s.attributes.rel==="prefetch"&&typeof s.attributes.href=="string"&&_i(s.attributes.href)==="js"))return!0;if(e.headFavicon&&(s.tagName==="link"&&s.attributes.rel==="shortcut icon"||s.tagName==="meta"&&(D(s.attributes.name).match(/^msapplication-tile(image|color)$/)||D(s.attributes.name)==="application-name"||D(s.attributes.rel)==="icon"||D(s.attributes.rel)==="apple-touch-icon"||D(s.attributes.rel)==="shortcut icon")))return!0;if(s.tagName==="meta"){if(e.headMetaDescKeywords&&D(s.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(D(s.attributes.property).match(/^(og|twitter|fb):/)||D(s.attributes.name).match(/^(og|twitter):/)||D(s.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(D(s.attributes.name)==="robots"||D(s.attributes.name)==="googlebot"||D(s.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&s.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(D(s.attributes.name)==="author"||D(s.attributes.name)==="generator"||D(s.attributes.name)==="framework"||D(s.attributes.name)==="publisher"||D(s.attributes.name)==="progid"||D(s.attributes.property).match(/^article:/)||D(s.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(D(s.attributes.name)==="google-site-verification"||D(s.attributes.name)==="yandex-verification"||D(s.attributes.name)==="csrf-token"||D(s.attributes.name)==="p:domain_verify"||D(s.attributes.name)==="verify-v1"||D(s.attributes.name)==="verification"||D(s.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Oe(s,e){const{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:o,maskTextSelector:l,skipChild:a=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:h,maskInputFn:p,slimDOMOptions:d,dataURLOptions:g={},inlineImages:m=!1,recordCanvas:f=!1,onSerialize:v,onIframeLoad:b,iframeLoadTimeout:y=5e3,onStylesheetLoad:C,stylesheetLoadTimeout:k=5e3,keepIframeSrcFn:M=()=>!1,newlyAddedElement:V=!1,cssCaptured:N=!1}=e;let{needsMask:L}=e,{preserveWhiteSpace:Y=!0}=e;L||(L=Mi(s,o,l,L===void 0));const W=Al(s,{doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:L,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:p,dataURLOptions:g,inlineImages:m,recordCanvas:f,keepIframeSrcFn:M,newlyAddedElement:V,cssCaptured:N});if(!W)return console.warn(s,"not serialized"),null;let Q;r.hasNode(s)?Q=r.getId(s):Tl(W,d)||!Y&&W.type===J.Text&&!W.textContent.replace(/^\s+|\s+$/gm,"").length?Q=Ze:Q=xi();const E=Object.assign(W,{id:Q});if(r.add(s,E),Q===Ze)return null;v&&v(s);let gt=!a;if(E.type===J.Element){gt=gt&&!E.needBlock,delete E.needBlock;const K=q.shadowRoot(s);K&&Ye(K)&&(E.isShadowHost=!0)}if((E.type===J.Document||E.type===J.Element)&&gt){d.headWhitespace&&E.type===J.Element&&E.tagName==="head"&&(Y=!1);const K={doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:L,maskTextClass:o,maskTextSelector:l,skipChild:a,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:p,slimDOMOptions:d,dataURLOptions:g,inlineImages:m,recordCanvas:f,preserveWhiteSpace:Y,onSerialize:v,onIframeLoad:b,iframeLoadTimeout:y,onStylesheetLoad:C,stylesheetLoadTimeout:k,keepIframeSrcFn:M,cssCaptured:!1};if(!(E.type===J.Element&&E.tagName==="textarea"&&E.attributes.value!==void 0)){E.type===J.Element&&E.attributes._cssText!==void 0&&typeof E.attributes._cssText=="string"&&(K.cssCaptured=!0);for(const Re of Array.from(q.childNodes(s))){const he=Oe(Re,K);he&&E.childNodes.push(he)}}let ie=null;if(bi(s)&&(ie=q.shadowRoot(s)))for(const Re of Array.from(q.childNodes(ie))){const he=Oe(Re,K);he&&(Ye(ie)&&(he.isShadow=!0),E.childNodes.push(he))}}const yt=q.parentNode(s);return yt&&Ve(yt)&&Ye(yt)&&(E.isShadow=!0),E.type===J.Element&&E.tagName==="iframe"&&El(s,()=>{const K=s.contentDocument;if(K&&b){const ie=Oe(K,{doc:K,mirror:r,blockClass:i,blockSelector:n,needsMask:L,maskTextClass:o,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:p,slimDOMOptions:d,dataURLOptions:g,inlineImages:m,recordCanvas:f,preserveWhiteSpace:Y,onSerialize:v,onIframeLoad:b,iframeLoadTimeout:y,onStylesheetLoad:C,stylesheetLoadTimeout:k,keepIframeSrcFn:M});ie&&b(s,ie)}},y),E.type===J.Element&&E.tagName==="link"&&typeof E.attributes.rel=="string"&&(E.attributes.rel==="stylesheet"||E.attributes.rel==="preload"&&typeof E.attributes.href=="string"&&_i(E.attributes.href)==="css")&&Ml(s,()=>{if(C){const K=Oe(s,{doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:L,maskTextClass:o,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:p,slimDOMOptions:d,dataURLOptions:g,inlineImages:m,recordCanvas:f,preserveWhiteSpace:Y,onSerialize:v,onIframeLoad:b,iframeLoadTimeout:y,onStylesheetLoad:C,stylesheetLoadTimeout:k,keepIframeSrcFn:M});K&&C(s,K)}},k),E}function Pl(s,e){const{mirror:t=new Si,blockClass:r="rr-block",blockSelector:i=null,maskTextClass:n="rr-mask",maskTextSelector:o=null,inlineStylesheet:l=!0,inlineImages:a=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:h,maskInputFn:p,slimDOM:d=!1,dataURLOptions:g,preserveWhiteSpace:m,onSerialize:f,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:y,stylesheetLoadTimeout:C,keepIframeSrcFn:k=()=>!1}=e||{};return Oe(s,{doc:s,mirror:t,blockClass:r,blockSelector:i,maskTextClass:n,maskTextSelector:o,skipChild:!1,inlineStylesheet:l,maskInputOptions:c===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:c===!1?{password:!0}:c,maskTextFn:h,maskInputFn:p,slimDOMOptions:d===!0||d==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:d==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:d===!1?{}:d,dataURLOptions:g,inlineImages:a,recordCanvas:u,preserveWhiteSpace:m,onSerialize:f,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:y,stylesheetLoadTimeout:C,keepIframeSrcFn:k,newlyAddedElement:!1})}function Dl(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Ll(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var i=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return s[r]}})}),t}var Lr={exports:{}},F=String,Ai=function(){return{isColorSupported:!1,reset:F,bold:F,dim:F,italic:F,underline:F,inverse:F,hidden:F,strikethrough:F,black:F,red:F,green:F,yellow:F,blue:F,magenta:F,cyan:F,white:F,gray:F,bgBlack:F,bgRed:F,bgGreen:F,bgYellow:F,bgBlue:F,bgMagenta:F,bgCyan:F,bgWhite:F}};Lr.exports=Ai(),Lr.exports.createColors=Ai;var Fl=Lr.exports;const ne=Ll(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Oi=Fl,$i=ne,Fr=class Fa extends Error{constructor(e,t,r,i,n,o){super(e),this.name="CssSyntaxError",this.reason=e,n&&(this.file=n),i&&(this.source=i),o&&(this.plugin=o),typeof t<"u"&&typeof r<"u"&&(typeof t=="number"?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Fa)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=Oi.isColorSupported),$i&&e&&(t=$i(t));let r=t.split(/\r?\n/),i=Math.max(this.line-3,0),n=Math.min(this.line+2,r.length),o=String(n).length,l,a;if(e){let{bold:u,gray:c,red:h}=Oi.createColors(!0);l=p=>u(h(p)),a=p=>c(p)}else l=a=u=>u;return r.slice(i,n).map((u,c)=>{let h=i+1+c,p=" "+(" "+h).slice(-o)+" | ";if(h===this.line){let d=a(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+a(p)+u+`
1
+ (function(de,Ge){typeof exports=="object"&&typeof module<"u"?Ge(exports):typeof define=="function"&&define.amd?define(["exports"],Ge):(de=typeof globalThis<"u"?globalThis:de||self,Ge(de.BWorldsLaunchKit={}))})(this,(function(de){"use strict";var Ge=Object.defineProperty,Ha=(s,e,t)=>e in s?Ge(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,S=(s,e,t)=>Ha(s,typeof e!="symbol"?e+"":e,t),pi,ja=Object.defineProperty,Ga=(s,e,t)=>e in s?ja(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,mi=(s,e,t)=>Ga(s,typeof e!="symbol"?e+"":e,t),J=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(J||{});const gi={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},yi={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},wt={},Va=()=>!!globalThis.Zone;function Mr(s){if(wt[s])return wt[s];const e=globalThis[s],t=e.prototype,r=s in gi?gi[s]:void 0,i=!!(r&&r.every(l=>{var a,u;return!!((u=(a=Object.getOwnPropertyDescriptor(t,l))==null?void 0:a.get)!=null&&u.toString().includes("[native code]"))})),n=s in yi?yi[s]:void 0,o=!!(n&&n.every(l=>{var a;return typeof t[l]=="function"&&((a=t[l])==null?void 0:a.toString().includes("[native code]"))}));if(i&&o&&!Va())return wt[s]=e.prototype,e.prototype;try{const l=document.createElement("iframe");document.body.appendChild(l);const a=l.contentWindow;if(!a)return e.prototype;const u=a[s].prototype;return document.body.removeChild(l),u?wt[s]=u:t}catch{return t}}const Ar={};function we(s,e,t){var r;const i=`${s}.${String(t)}`;if(Ar[i])return Ar[i].call(e);const n=Mr(s),o=(r=Object.getOwnPropertyDescriptor(n,t))==null?void 0:r.get;return o?(Ar[i]=o,o.call(e)):e[t]}const Or={};function wi(s,e,t){const r=`${s}.${String(t)}`;if(Or[r])return Or[r].bind(e);const n=Mr(s)[t];return typeof n!="function"?e[t]:(Or[r]=n,n.bind(e))}function Ya(s){return we("Node",s,"childNodes")}function Za(s){return we("Node",s,"parentNode")}function Ja(s){return we("Node",s,"parentElement")}function Xa(s){return we("Node",s,"textContent")}function Ka(s,e){return wi("Node",s,"contains")(e)}function Qa(s){return wi("Node",s,"getRootNode")()}function qa(s){return!s||!("host"in s)?null:we("ShadowRoot",s,"host")}function el(s){return s.styleSheets}function tl(s){return!s||!("shadowRoot"in s)?null:we("Element",s,"shadowRoot")}function rl(s,e){return we("Element",s,"querySelector")(e)}function sl(s,e){return we("Element",s,"querySelectorAll")(e)}function il(){return Mr("MutationObserver").constructor}const q={childNodes:Ya,parentNode:Za,parentElement:Ja,textContent:Xa,contains:Ka,getRootNode:Qa,host:qa,styleSheets:el,shadowRoot:tl,querySelector:rl,querySelectorAll:sl,mutationObserver:il};function bi(s){return s.nodeType===s.ELEMENT_NODE}function Ve(s){const e=s&&"host"in s&&"mode"in s&&q.host(s)||null;return!!(e&&"shadowRoot"in e&&q.shadowRoot(e)===s)}function Ye(s){return Object.prototype.toString.call(s)==="[object ShadowRoot]"}function nl(s){return s.includes(" background-clip: text;")&&!s.includes(" -webkit-background-clip: text;")&&(s=s.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),s}function ol(s){const{cssText:e}=s;if(e.split('"').length<3)return e;const t=["@import",`url(${JSON.stringify(s.href)})`];return s.layerName===""?t.push("layer"):s.layerName&&t.push(`layer(${s.layerName})`),s.supportsText&&t.push(`supports(${s.supportsText})`),s.media.length&&t.push(s.media.mediaText),t.join(" ")+";"}function $r(s){try{const e=s.rules||s.cssRules;if(!e)return null;let t=s.href;!t&&s.ownerNode&&s.ownerNode.ownerDocument&&(t=s.ownerNode.ownerDocument.location.href);const r=Array.from(e,i=>vi(i,t)).join("");return nl(r)}catch{return null}}function vi(s,e){if(ll(s)){let t;try{t=$r(s.styleSheet)||ol(s)}catch{t=s.cssText}return s.styleSheet.href?bt(t,s.styleSheet.href):t}else{let t=s.cssText;return ul(s)&&s.selectorText.includes(":")&&(t=al(t)),e?bt(t,e):t}}function al(s){const e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return s.replace(e,"$1\\$2")}function ll(s){return"styleSheet"in s}function ul(s){return"selectorText"in s}class Si{constructor(){mi(this,"idNodeMap",new Map),mi(this,"nodeMetaMap",new WeakMap)}getId(e){var t;return e?((t=this.getMeta(e))==null?void 0:t.id)??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const 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){const r=t.id;this.idNodeMap.set(r,e),this.nodeMetaMap.set(e,t)}replace(e,t){const r=this.getNode(e);if(r){const i=this.nodeMetaMap.get(r);i&&this.nodeMetaMap.set(t,i)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function cl(){return new Si}function Nr({element:s,maskInputOptions:e,tagName:t,type:r,value:i,maskInputFn:n}){let o=i||"";const l=r&&Se(r);return(e[t.toLowerCase()]||l&&e[l])&&(n?o=n(o,s):o="*".repeat(o.length)),o}function Se(s){return s.toLowerCase()}const Ci="__rrweb_original__";function hl(s){const e=s.getContext("2d");if(!e)return!0;const t=50;for(let r=0;r<s.width;r+=t)for(let i=0;i<s.height;i+=t){const n=e.getImageData,o=Ci in n?n[Ci]:n;if(new Uint32Array(o.call(e,r,i,Math.min(t,s.width-r),Math.min(t,s.height-i)).data.buffer).some(a=>a!==0))return!1}return!0}function Tr(s){const e=s.type;return s.hasAttribute("data-rr-is-password")?"password":e?Se(e):null}function _i(s,e){let t;try{t=new URL(s,e??window.location.href)}catch{return null}const r=/\.([0-9a-z]+)(?:$)/i,i=t.pathname.match(r);return(i==null?void 0:i[1])??null}function fl(s){let e="";return s.indexOf("//")>-1?e=s.split("/").slice(0,3).join("/"):e=s.split("/")[0],e=e.split("?")[0],e}const dl=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,pl=/^(?:[a-z+]+:)?\/\//i,ml=/^www\..*/i,gl=/^(data:)([^,]*),(.*)/i;function bt(s,e){return(s||"").replace(dl,(t,r,i,n,o,l)=>{const a=i||o||l,u=r||n||"";if(!a)return t;if(pl.test(a)||ml.test(a))return`url(${u}${a}${u})`;if(gl.test(a))return`url(${u}${a}${u})`;if(a[0]==="/")return`url(${u}${fl(e)+a}${u})`;const c=e.split("/"),h=a.split("/");c.pop();for(const p of h)p!=="."&&(p===".."?c.pop():c.push(p));return`url(${u}${c.join("/")}${u})`})}function Pr(s){return s.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function yl(s,e){const t=Array.from(e.childNodes),r=[];if(t.length>1&&s&&typeof s=="string"){const i=Pr(s);for(let n=1;n<t.length;n++)if(t[n].textContent&&typeof t[n].textContent=="string"){const o=Pr(t[n].textContent);for(let l=3;l<o.length;l++){const a=o.substring(0,l);if(i.split(a).length===2){const u=i.indexOf(a);for(let c=u;c<s.length;c++)if(Pr(s.substring(0,c)).length===u){r.push(s.substring(0,c)),s=s.substring(c);break}break}}}}return r.push(s),r}function wl(s,e){return yl(s,e).join("/* rr_split */")}let bl=1;const vl=new RegExp("[^a-z0-9-_:]"),Ze=-2;function xi(){return bl++}function Sl(s){if(s instanceof HTMLFormElement)return"form";const e=Se(s.tagName);return vl.test(e)?"div":e}let Me,Ii;const Cl=/^[^ \t\n\r\u000c]+/,_l=/^[, \t\n\r\u000c]+/;function xl(s,e){if(e.trim()==="")return e;let t=0;function r(n){let o;const l=n.exec(e.substring(t));return l?(o=l[0],t+=o.length,o):""}const i=[];for(;r(_l),!(t>=e.length);){let n=r(Cl);if(n.slice(-1)===",")n=Ae(s,n.substring(0,n.length-1)),i.push(n);else{let o="";n=Ae(s,n);let l=!1;for(;;){const a=e.charAt(t);if(a===""){i.push((n+o).trim());break}else if(l)a===")"&&(l=!1);else if(a===","){t+=1,i.push((n+o).trim());break}else a==="("&&(l=!0);o+=a,t+=1}}}return i.join(", ")}const Ri=new WeakMap;function Ae(s,e){return!e||e.trim()===""?e:Dr(s,e)}function Il(s){return!!(s.tagName==="svg"||s.ownerSVGElement)}function Dr(s,e){let t=Ri.get(s);if(t||(t=s.createElement("a"),Ri.set(s,t)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return t.setAttribute("href",e),t.href}function ki(s,e,t,r){return r&&(t==="src"||t==="href"&&!(e==="use"&&r[0]==="#")||t==="xlink:href"&&r[0]!=="#"||t==="background"&&(e==="table"||e==="td"||e==="th")?Ae(s,r):t==="srcset"?xl(s,r):t==="style"?bt(r,Dr(s)):e==="object"&&t==="data"?Ae(s,r):r)}function Ei(s,e,t){return(s==="video"||s==="audio")&&e==="autoplay"}function Rl(s,e,t){try{if(typeof e=="string"){if(s.classList.contains(e))return!0}else for(let r=s.classList.length;r--;){const i=s.classList[r];if(e.test(i))return!0}if(t)return s.matches(t)}catch{}return!1}function vt(s,e,t){if(!s)return!1;if(s.nodeType!==s.ELEMENT_NODE)return t?vt(q.parentNode(s),e,t):!1;for(let r=s.classList.length;r--;){const i=s.classList[r];if(e.test(i))return!0}return t?vt(q.parentNode(s),e,t):!1}function Mi(s,e,t,r){let i;if(bi(s)){if(i=s,!q.childNodes(i).length)return!1}else{if(q.parentElement(s)===null)return!1;i=q.parentElement(s)}try{if(typeof e=="string"){if(r){if(i.closest(`.${e}`))return!0}else if(i.classList.contains(e))return!0}else if(vt(i,e,r))return!0;if(t){if(r){if(i.closest(t))return!0}else if(i.matches(t))return!0}}catch{}return!1}function kl(s,e,t){const r=s.contentWindow;if(!r)return;let i=!1,n;try{n=r.document.readyState}catch{return}if(n!=="complete"){const l=setTimeout(()=>{i||(e(),i=!0)},t);s.addEventListener("load",()=>{clearTimeout(l),i=!0,e()});return}const o="about:blank";if(r.location.href!==o||s.src===o||s.src==="")return setTimeout(e,0),s.addEventListener("load",e);s.addEventListener("load",e)}function El(s,e,t){let r=!1,i;try{i=s.sheet}catch{return}if(i)return;const n=setTimeout(()=>{r||(e(),r=!0)},t);s.addEventListener("load",()=>{clearTimeout(n),r=!0,e()})}function Ml(s,e){const{doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:o,inlineStylesheet:l,maskInputOptions:a={},maskTextFn:u,maskInputFn:c,dataURLOptions:h={},inlineImages:p,recordCanvas:d,keepIframeSrcFn:g,newlyAddedElement:m=!1,cssCaptured:f=!1}=e,v=Al(t,r);switch(s.nodeType){case s.DOCUMENT_NODE:return s.compatMode!=="CSS1Compat"?{type:J.Document,childNodes:[],compatMode:s.compatMode}:{type:J.Document,childNodes:[]};case s.DOCUMENT_TYPE_NODE:return{type:J.DocumentType,name:s.name,publicId:s.publicId,systemId:s.systemId,rootId:v};case s.ELEMENT_NODE:return $l(s,{doc:t,blockClass:i,blockSelector:n,inlineStylesheet:l,maskInputOptions:a,maskInputFn:c,dataURLOptions:h,inlineImages:p,recordCanvas:d,keepIframeSrcFn:g,newlyAddedElement:m,rootId:v});case s.TEXT_NODE:return Ol(s,{doc:t,needsMask:o,maskTextFn:u,rootId:v,cssCaptured:f});case s.CDATA_SECTION_NODE:return{type:J.CDATA,textContent:"",rootId:v};case s.COMMENT_NODE:return{type:J.Comment,textContent:q.textContent(s)||"",rootId:v};default:return!1}}function Al(s,e){if(!e.hasNode(s))return;const t=e.getId(s);return t===1?void 0:t}function Ol(s,e){const{needsMask:t,maskTextFn:r,rootId:i,cssCaptured:n}=e,o=q.parentNode(s),l=o&&o.tagName;let a="";const u=l==="STYLE"?!0:void 0,c=l==="SCRIPT"?!0:void 0;return c?a="SCRIPT_PLACEHOLDER":n||(a=q.textContent(s),u&&a&&(a=bt(a,Dr(e.doc)))),!u&&!c&&a&&t&&(a=r?r(a,q.parentElement(s)):a.replace(/[\S]/g,"*")),{type:J.Text,textContent:a||"",rootId:i}}function $l(s,e){const{doc:t,blockClass:r,blockSelector:i,inlineStylesheet:n,maskInputOptions:o={},maskInputFn:l,dataURLOptions:a={},inlineImages:u,recordCanvas:c,keepIframeSrcFn:h,newlyAddedElement:p=!1,rootId:d}=e,g=Rl(s,r,i),m=Sl(s);let f={};const v=s.attributes.length;for(let y=0;y<v;y++){const C=s.attributes[y];Ei(m,C.name,C.value)||(f[C.name]=ki(t,m,Se(C.name),C.value))}if(m==="link"&&n){const y=Array.from(t.styleSheets).find(k=>k.href===s.href);let C=null;y&&(C=$r(y)),C&&(delete f.rel,delete f.href,f._cssText=C)}if(m==="style"&&s.sheet){let y=$r(s.sheet);y&&(s.childNodes.length>1&&(y=wl(y,s)),f._cssText=y)}if(m==="input"||m==="textarea"||m==="select"){const y=s.value,C=s.checked;f.type!=="radio"&&f.type!=="checkbox"&&f.type!=="submit"&&f.type!=="button"&&y?f.value=Nr({element:s,type:Tr(s),tagName:m,value:y,maskInputOptions:o,maskInputFn:l}):C&&(f.checked=C)}if(m==="option"&&(s.selected&&!o.select?f.selected=!0:delete f.selected),m==="dialog"&&s.open&&(f.rr_open_mode=s.matches("dialog:modal")?"modal":"non-modal"),m==="canvas"&&c){if(s.__context==="2d")hl(s)||(f.rr_dataURL=s.toDataURL(a.type,a.quality));else if(!("__context"in s)){const y=s.toDataURL(a.type,a.quality),C=t.createElement("canvas");C.width=s.width,C.height=s.height;const k=C.toDataURL(a.type,a.quality);y!==k&&(f.rr_dataURL=y)}}if(m==="img"&&u){Me||(Me=t.createElement("canvas"),Ii=Me.getContext("2d"));const y=s,C=y.currentSrc||y.getAttribute("src")||"<unknown-src>",k=y.crossOrigin,M=()=>{y.removeEventListener("load",M);try{Me.width=y.naturalWidth,Me.height=y.naturalHeight,Ii.drawImage(y,0,0),f.rr_dataURL=Me.toDataURL(a.type,a.quality)}catch(V){if(y.crossOrigin!=="anonymous"){y.crossOrigin="anonymous",y.complete&&y.naturalWidth!==0?M():y.addEventListener("load",M);return}else console.warn(`Cannot inline img src=${C}! Error: ${V}`)}y.crossOrigin==="anonymous"&&(k?f.crossOrigin=k:y.removeAttribute("crossorigin"))};y.complete&&y.naturalWidth!==0?M():y.addEventListener("load",M)}if(m==="audio"||m==="video"){const y=f;y.rr_mediaState=s.paused?"paused":"played",y.rr_mediaCurrentTime=s.currentTime,y.rr_mediaPlaybackRate=s.playbackRate,y.rr_mediaMuted=s.muted,y.rr_mediaLoop=s.loop,y.rr_mediaVolume=s.volume}if(p||(s.scrollLeft&&(f.rr_scrollLeft=s.scrollLeft),s.scrollTop&&(f.rr_scrollTop=s.scrollTop)),g){const{width:y,height:C}=s.getBoundingClientRect();f={class:f.class,rr_width:`${y}px`,rr_height:`${C}px`}}m==="iframe"&&!h(f.src)&&(s.contentDocument||(f.rr_src=f.src),delete f.src);let b;try{customElements.get(m)&&(b=!0)}catch{}return{type:J.Element,tagName:m,attributes:f,childNodes:[],isSVG:Il(s)||void 0,needBlock:g,rootId:d,isCustom:b}}function D(s){return s==null?"":s.toLowerCase()}function Nl(s,e){if(e.comment&&s.type===J.Comment)return!0;if(s.type===J.Element){if(e.script&&(s.tagName==="script"||s.tagName==="link"&&(s.attributes.rel==="preload"||s.attributes.rel==="modulepreload")&&s.attributes.as==="script"||s.tagName==="link"&&s.attributes.rel==="prefetch"&&typeof s.attributes.href=="string"&&_i(s.attributes.href)==="js"))return!0;if(e.headFavicon&&(s.tagName==="link"&&s.attributes.rel==="shortcut icon"||s.tagName==="meta"&&(D(s.attributes.name).match(/^msapplication-tile(image|color)$/)||D(s.attributes.name)==="application-name"||D(s.attributes.rel)==="icon"||D(s.attributes.rel)==="apple-touch-icon"||D(s.attributes.rel)==="shortcut icon")))return!0;if(s.tagName==="meta"){if(e.headMetaDescKeywords&&D(s.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(D(s.attributes.property).match(/^(og|twitter|fb):/)||D(s.attributes.name).match(/^(og|twitter):/)||D(s.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(D(s.attributes.name)==="robots"||D(s.attributes.name)==="googlebot"||D(s.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&s.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(D(s.attributes.name)==="author"||D(s.attributes.name)==="generator"||D(s.attributes.name)==="framework"||D(s.attributes.name)==="publisher"||D(s.attributes.name)==="progid"||D(s.attributes.property).match(/^article:/)||D(s.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(D(s.attributes.name)==="google-site-verification"||D(s.attributes.name)==="yandex-verification"||D(s.attributes.name)==="csrf-token"||D(s.attributes.name)==="p:domain_verify"||D(s.attributes.name)==="verify-v1"||D(s.attributes.name)==="verification"||D(s.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function Oe(s,e){const{doc:t,mirror:r,blockClass:i,blockSelector:n,maskTextClass:o,maskTextSelector:l,skipChild:a=!1,inlineStylesheet:u=!0,maskInputOptions:c={},maskTextFn:h,maskInputFn:p,slimDOMOptions:d,dataURLOptions:g={},inlineImages:m=!1,recordCanvas:f=!1,onSerialize:v,onIframeLoad:b,iframeLoadTimeout:y=5e3,onStylesheetLoad:C,stylesheetLoadTimeout:k=5e3,keepIframeSrcFn:M=()=>!1,newlyAddedElement:V=!1,cssCaptured:N=!1}=e;let{needsMask:L}=e,{preserveWhiteSpace:Y=!0}=e;L||(L=Mi(s,o,l,L===void 0));const W=Ml(s,{doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:L,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:p,dataURLOptions:g,inlineImages:m,recordCanvas:f,keepIframeSrcFn:M,newlyAddedElement:V,cssCaptured:N});if(!W)return console.warn(s,"not serialized"),null;let Q;r.hasNode(s)?Q=r.getId(s):Nl(W,d)||!Y&&W.type===J.Text&&!W.textContent.replace(/^\s+|\s+$/gm,"").length?Q=Ze:Q=xi();const E=Object.assign(W,{id:Q});if(r.add(s,E),Q===Ze)return null;v&&v(s);let gt=!a;if(E.type===J.Element){gt=gt&&!E.needBlock,delete E.needBlock;const K=q.shadowRoot(s);K&&Ye(K)&&(E.isShadowHost=!0)}if((E.type===J.Document||E.type===J.Element)&&gt){d.headWhitespace&&E.type===J.Element&&E.tagName==="head"&&(Y=!1);const K={doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:L,maskTextClass:o,maskTextSelector:l,skipChild:a,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:p,slimDOMOptions:d,dataURLOptions:g,inlineImages:m,recordCanvas:f,preserveWhiteSpace:Y,onSerialize:v,onIframeLoad:b,iframeLoadTimeout:y,onStylesheetLoad:C,stylesheetLoadTimeout:k,keepIframeSrcFn:M,cssCaptured:!1};if(!(E.type===J.Element&&E.tagName==="textarea"&&E.attributes.value!==void 0)){E.type===J.Element&&E.attributes._cssText!==void 0&&typeof E.attributes._cssText=="string"&&(K.cssCaptured=!0);for(const Re of Array.from(q.childNodes(s))){const he=Oe(Re,K);he&&E.childNodes.push(he)}}let ie=null;if(bi(s)&&(ie=q.shadowRoot(s)))for(const Re of Array.from(q.childNodes(ie))){const he=Oe(Re,K);he&&(Ye(ie)&&(he.isShadow=!0),E.childNodes.push(he))}}const yt=q.parentNode(s);return yt&&Ve(yt)&&Ye(yt)&&(E.isShadow=!0),E.type===J.Element&&E.tagName==="iframe"&&kl(s,()=>{const K=s.contentDocument;if(K&&b){const ie=Oe(K,{doc:K,mirror:r,blockClass:i,blockSelector:n,needsMask:L,maskTextClass:o,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:p,slimDOMOptions:d,dataURLOptions:g,inlineImages:m,recordCanvas:f,preserveWhiteSpace:Y,onSerialize:v,onIframeLoad:b,iframeLoadTimeout:y,onStylesheetLoad:C,stylesheetLoadTimeout:k,keepIframeSrcFn:M});ie&&b(s,ie)}},y),E.type===J.Element&&E.tagName==="link"&&typeof E.attributes.rel=="string"&&(E.attributes.rel==="stylesheet"||E.attributes.rel==="preload"&&typeof E.attributes.href=="string"&&_i(E.attributes.href)==="css")&&El(s,()=>{if(C){const K=Oe(s,{doc:t,mirror:r,blockClass:i,blockSelector:n,needsMask:L,maskTextClass:o,maskTextSelector:l,skipChild:!1,inlineStylesheet:u,maskInputOptions:c,maskTextFn:h,maskInputFn:p,slimDOMOptions:d,dataURLOptions:g,inlineImages:m,recordCanvas:f,preserveWhiteSpace:Y,onSerialize:v,onIframeLoad:b,iframeLoadTimeout:y,onStylesheetLoad:C,stylesheetLoadTimeout:k,keepIframeSrcFn:M});K&&C(s,K)}},k),E}function Tl(s,e){const{mirror:t=new Si,blockClass:r="rr-block",blockSelector:i=null,maskTextClass:n="rr-mask",maskTextSelector:o=null,inlineStylesheet:l=!0,inlineImages:a=!1,recordCanvas:u=!1,maskAllInputs:c=!1,maskTextFn:h,maskInputFn:p,slimDOM:d=!1,dataURLOptions:g,preserveWhiteSpace:m,onSerialize:f,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:y,stylesheetLoadTimeout:C,keepIframeSrcFn:k=()=>!1}=e||{};return Oe(s,{doc:s,mirror:t,blockClass:r,blockSelector:i,maskTextClass:n,maskTextSelector:o,skipChild:!1,inlineStylesheet:l,maskInputOptions:c===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:c===!1?{password:!0}:c,maskTextFn:h,maskInputFn:p,slimDOMOptions:d===!0||d==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:d==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:d===!1?{}:d,dataURLOptions:g,inlineImages:a,recordCanvas:u,preserveWhiteSpace:m,onSerialize:f,onIframeLoad:v,iframeLoadTimeout:b,onStylesheetLoad:y,stylesheetLoadTimeout:C,keepIframeSrcFn:k,newlyAddedElement:!1})}function Pl(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function Dl(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var i=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return s[r]}})}),t}var Lr={exports:{}},F=String,Ai=function(){return{isColorSupported:!1,reset:F,bold:F,dim:F,italic:F,underline:F,inverse:F,hidden:F,strikethrough:F,black:F,red:F,green:F,yellow:F,blue:F,magenta:F,cyan:F,white:F,gray:F,bgBlack:F,bgRed:F,bgGreen:F,bgYellow:F,bgBlue:F,bgMagenta:F,bgCyan:F,bgWhite:F}};Lr.exports=Ai(),Lr.exports.createColors=Ai;var Ll=Lr.exports;const ne=Dl(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Oi=Ll,$i=ne,Fr=class La extends Error{constructor(e,t,r,i,n,o){super(e),this.name="CssSyntaxError",this.reason=e,n&&(this.file=n),i&&(this.source=i),o&&(this.plugin=o),typeof t<"u"&&typeof r<"u"&&(typeof t=="number"?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,La)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=Oi.isColorSupported),$i&&e&&(t=$i(t));let r=t.split(/\r?\n/),i=Math.max(this.line-3,0),n=Math.min(this.line+2,r.length),o=String(n).length,l,a;if(e){let{bold:u,gray:c,red:h}=Oi.createColors(!0);l=p=>u(h(p)),a=p=>c(p)}else l=a=u=>u;return r.slice(i,n).map((u,c)=>{let h=i+1+c,p=" "+(" "+h).slice(-o)+" | ";if(h===this.line){let d=a(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+a(p)+u+`
2
2
  `+d+l("^")}return" "+a(p)+u}).join(`
3
3
  `)}toString(){let e=this.showSourceCode();return e&&(e=`
4
4
 
@@ -8,25 +8,25 @@
8
8
  `,beforeComment:`
9
9
  `,beforeDecl:`
10
10
  `,beforeOpen:" ",beforeRule:`
11
- `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function Ul(s){return s[0].toUpperCase()+s.slice(1)}let Br=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,i=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?r+=e.raws.afterName:i&&(r+=" "),e.nodes)this.block(e,r+i);else{let n=(e.raws.between||"")+(t?";":"");this.builder(r+i+n,e)}}beforeAfter(e,t){let r;e.type==="decl"?r=this.raw(e,null,"beforeDecl"):e.type==="comment"?r=this.raw(e,null,"beforeComment"):t==="before"?r=this.raw(e,null,"beforeRule"):r=this.raw(e,null,"beforeClose");let i=e.parent,n=0;for(;i&&i.type!=="root";)n+=1,i=i.parent;if(r.includes(`
12
- `)){let o=this.raw(e,null,"indent");if(o.length)for(let l=0;l<n;l++)r+=o}return r}block(e,t){let r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start");let i;e.nodes&&e.nodes.length?(this.body(e),i=this.raw(e,"after")):i=this.raw(e,"after","emptyBody"),i&&this.builder(i),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let i=0;i<e.nodes.length;i++){let n=e.nodes[i],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==i||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),i=e.prop+r+this.rawValue(e,"value");e.important&&(i+=e.raws.important||" !important"),t&&(i+=";"),this.builder(i,e)}document(e){this.body(e)}raw(e,t,r){let i;if(r||(r=t),t&&(i=e.raws[t],typeof i<"u"))return i;let n=e.parent;if(r==="before"&&(!n||n.type==="root"&&n.first===e||n&&n.type==="document"))return"";if(!n)return Ni[r];let o=e.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[r]<"u")return o.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let l="raw"+Ul(r);this[l]?i=this[l](o,e):o.walk(a=>{if(i=a.raws[t],typeof i<"u")return!1})}return typeof i>"u"&&(i=Ni[r]),o.rawCache[r]=i,i}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return t=r.raws.after,t.includes(`
11
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function Fl(s){return s[0].toUpperCase()+s.slice(1)}let Br=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,i=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?r+=e.raws.afterName:i&&(r+=" "),e.nodes)this.block(e,r+i);else{let n=(e.raws.between||"")+(t?";":"");this.builder(r+i+n,e)}}beforeAfter(e,t){let r;e.type==="decl"?r=this.raw(e,null,"beforeDecl"):e.type==="comment"?r=this.raw(e,null,"beforeComment"):t==="before"?r=this.raw(e,null,"beforeRule"):r=this.raw(e,null,"beforeClose");let i=e.parent,n=0;for(;i&&i.type!=="root";)n+=1,i=i.parent;if(r.includes(`
12
+ `)){let o=this.raw(e,null,"indent");if(o.length)for(let l=0;l<n;l++)r+=o}return r}block(e,t){let r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start");let i;e.nodes&&e.nodes.length?(this.body(e),i=this.raw(e,"after")):i=this.raw(e,"after","emptyBody"),i&&this.builder(i),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let i=0;i<e.nodes.length;i++){let n=e.nodes[i],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==i||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),i=e.prop+r+this.rawValue(e,"value");e.important&&(i+=e.raws.important||" !important"),t&&(i+=";"),this.builder(i,e)}document(e){this.body(e)}raw(e,t,r){let i;if(r||(r=t),t&&(i=e.raws[t],typeof i<"u"))return i;let n=e.parent;if(r==="before"&&(!n||n.type==="root"&&n.first===e||n&&n.type==="document"))return"";if(!n)return Ni[r];let o=e.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[r]<"u")return o.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let l="raw"+Fl(r);this[l]?i=this[l](o,e):o.walk(a=>{if(i=a.raws[t],typeof i<"u")return!1})}return typeof i>"u"&&(i=Ni[r]),o.rawCache[r]=i,i}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return t=r.raws.after,t.includes(`
13
13
  `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
14
14
  `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
15
15
  `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(r=>{if(r.type!=="decl"&&(t=r.raws.between,typeof t<"u"))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&typeof r.raws.before<"u")return t=r.raws.before,t.includes(`
16
16
  `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(r=>{if(typeof r.raws.between<"u")return t=r.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length===0&&(t=r.raws.after,typeof t<"u"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let i=r.parent;if(i&&i!==e&&i.parent&&i.parent===e&&typeof r.raws.before<"u"){let n=r.raws.before.split(`
17
- `);return t=n[n.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(t=r.raws.semicolon,typeof t<"u"))return!1}),t}rawValue(e,t){let r=e[t],i=e.raws[t];return i&&i.value===r?i.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var Ti=Br;Br.default=Br;let Bl=Ti;function zr(s,e){new Bl(e).stringify(s)}var St=zr;zr.default=zr;let{isClean:Ct,my:zl}=Je,Wl=Ur,Hl=Ti,jl=St;function Wr(s,e){let t=new s.constructor;for(let r in s){if(!Object.prototype.hasOwnProperty.call(s,r)||r==="proxyCache")continue;let i=s[r],n=typeof i;r==="parent"&&n==="object"?e&&(t[r]=e):r==="source"?t[r]=i:Array.isArray(i)?t[r]=i.map(o=>Wr(o,t)):(n==="object"&&i!==null&&(i=Wr(i)),t[r]=i)}return t}let Hr=class{constructor(e={}){this.raws={},this[Ct]=!1,this[zl]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let r of e[t])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Wr(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:i}=this.rangeBy(t);return this.source.input.error(e,{column:i.column,line:i.line},{column:r.column,line:r.line},t)}return new Wl(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markDirty(){if(this[Ct]){this[Ct]=!1;let e=this;for(;e=e.parent;)e[Ct]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){t=this.toString();let i=t.indexOf(e.word);i!==-1&&(r=this.positionInside(i,t))}return r}positionInside(e,t){let r=t||this.toString(),i=this.source.start.column,n=this.source.start.line;for(let o=0;o<e;o++)r[o]===`
18
- `?(i=1,n+=1):i+=1;return{column:i,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let i=this.toString(),n=i.indexOf(e.word);n!==-1&&(t=this.positionInside(n,i),r=this.positionInside(n+e.word.length,i))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:typeof e.endIndex=="number"?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return new Hl().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let i of e)i===this?r=!0:r?(this.parent.insertAfter(t,i),t=i):this.parent.insertBefore(t,i);r||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let r={},i=t==null;t=t||new Map;let n=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let l=this[o];if(Array.isArray(l))r[o]=l.map(a=>typeof a=="object"&&a.toJSON?a.toJSON(null,t):a);else if(typeof l=="object"&&l.toJSON)r[o]=l.toJSON(null,t);else if(o==="source"){let a=t.get(l.input);a==null&&(a=n,t.set(l.input,n),n++),r[o]={end:l.end,inputId:a,start:l.start}}else r[o]=l}return i&&(r.inputs=[...t.keys()].map(o=>o.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=jl){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let i={node:this};for(let n in r)i[n]=r[n];return e.warn(t,i)}get proxyOf(){return this}};var _t=Hr;Hr.default=Hr;let Gl=_t,jr=class extends Gl{constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};var xt=jr;jr.default=jr;let Vl="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Yl={nanoid:(s=21)=>{let e="",t=s;for(;t--;)e+=Vl[Math.random()*64|0];return e}};let{SourceMapConsumer:Pi,SourceMapGenerator:Di}=ne,{existsSync:Zl,readFileSync:Jl}=ne,{dirname:Gr,join:Xl}=ne;function Kl(s){return Buffer?Buffer.from(s,"base64").toString():window.atob(s)}let Vr=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,i=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Gr(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Pi(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,n=/^data:application\/json,/;if(i.test(e)||n.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||r.test(e))return Kl(e.substr(RegExp.lastMatch.length));let o=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+o)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),i=e.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,i)))}loadFile(e){if(this.root=Gr(e),Zl(e))return this.mapFile=e,Jl(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let r=t(e);if(r){let i=this.loadFile(r);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(t instanceof Pi)return Di.fromSourceMap(t).toString();if(t instanceof Di)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=Xl(Gr(e),r)),this.loadFile(r)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Li=Vr;Vr.default=Vr;let{SourceMapConsumer:Ql,SourceMapGenerator:ql}=ne,{fileURLToPath:Fi,pathToFileURL:It}=ne,{isAbsolute:Yr,resolve:Zr}=ne,{nanoid:eu}=Yl,Jr=ne,Ui=Ur,tu=Li,Xr=Symbol("fromOffsetCache"),ru=!!(Ql&&ql),Bi=!!(Zr&&Yr),Rt=class{constructor(e,t={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Bi||/^\w+:\/\//.test(t.from)||Yr(t.from)?this.file=t.from:this.file=Zr(t.from)),Bi&&ru){let r=new tu(this.css,t);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+eu(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let n,o,l;if(t&&typeof t=="object"){let u=t,c=r;if(typeof u.offset=="number"){let h=this.fromOffset(u.offset);t=h.line,r=h.col}else t=u.line,r=u.column;if(typeof c.offset=="number"){let h=this.fromOffset(c.offset);o=h.line,l=h.col}else o=c.line,l=c.column}else if(!r){let u=this.fromOffset(t);t=u.line,r=u.col}let a=this.origin(t,r,o,l);return a?n=new Ui(e,a.endLine===void 0?a.line:{column:a.column,line:a.line},a.endLine===void 0?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,i.plugin):n=new Ui(e,o===void 0?t:{column:r,line:t},o===void 0?r:{column:l,line:o},this.css,this.file,i.plugin),n.input={column:r,endColumn:l,endLine:o,line:t,source:this.css},this.file&&(It&&(n.input.url=It(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[Xr])r=this[Xr];else{let n=this.css.split(`
19
- `);r=new Array(n.length);let o=0;for(let l=0,a=n.length;l<a;l++)r[l]=o,o+=n[l].length+1;this[Xr]=r}t=r[r.length-1];let i=0;if(e>=t)i=r.length-1;else{let n=r.length-2,o;for(;i<n;)if(o=i+(n-i>>1),e<r[o])n=o-1;else if(e>=r[o+1])i=o+1;else{i=o;break}}return{col:e-r[i]+1,line:i+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Zr(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,i){if(!this.map)return!1;let n=this.map.consumer(),o=n.originalPositionFor({column:t,line:e});if(!o.source)return!1;let l;typeof r=="number"&&(l=n.originalPositionFor({column:i,line:r}));let a;Yr(o.source)?a=It(o.source):a=new URL(o.source,this.map.consumer().sourceRoot||It(this.map.mapFile));let u={column:o.column,endColumn:l&&l.column,endLine:l&&l.line,line:o.line,url:a.toString()};if(a.protocol==="file:")if(Fi)u.file=Fi(a);else throw new Error("file: protocol is not available in this PostCSS build");let c=n.sourceContentFor(o.source);return c&&(u.source=c),u}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var kt=Rt;Rt.default=Rt,Jr&&Jr.registerInput&&Jr.registerInput(Rt);let{SourceMapConsumer:zi,SourceMapGenerator:Et}=ne,{dirname:Mt,relative:Wi,resolve:Hi,sep:ji}=ne,{pathToFileURL:Gi}=ne,su=kt,iu=!!(zi&&Et),nu=!!(Mt&&Hi&&Wi&&ji);var Vi=class{constructor(e,t,r,i){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=`
17
+ `);return t=n[n.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(t=r.raws.semicolon,typeof t<"u"))return!1}),t}rawValue(e,t){let r=e[t],i=e.raws[t];return i&&i.value===r?i.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var Ti=Br;Br.default=Br;let Ul=Ti;function zr(s,e){new Ul(e).stringify(s)}var St=zr;zr.default=zr;let{isClean:Ct,my:Bl}=Je,zl=Ur,Wl=Ti,Hl=St;function Wr(s,e){let t=new s.constructor;for(let r in s){if(!Object.prototype.hasOwnProperty.call(s,r)||r==="proxyCache")continue;let i=s[r],n=typeof i;r==="parent"&&n==="object"?e&&(t[r]=e):r==="source"?t[r]=i:Array.isArray(i)?t[r]=i.map(o=>Wr(o,t)):(n==="object"&&i!==null&&(i=Wr(i)),t[r]=i)}return t}let Hr=class{constructor(e={}){this.raws={},this[Ct]=!1,this[Bl]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let r of e[t])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=Wr(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:i}=this.rangeBy(t);return this.source.input.error(e,{column:i.column,line:i.line},{column:r.column,line:r.line},t)}return new zl(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markDirty(){if(this[Ct]){this[Ct]=!1;let e=this;for(;e=e.parent;)e[Ct]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){t=this.toString();let i=t.indexOf(e.word);i!==-1&&(r=this.positionInside(i,t))}return r}positionInside(e,t){let r=t||this.toString(),i=this.source.start.column,n=this.source.start.line;for(let o=0;o<e;o++)r[o]===`
18
+ `?(i=1,n+=1):i+=1;return{column:i,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let i=this.toString(),n=i.indexOf(e.word);n!==-1&&(t=this.positionInside(n,i),r=this.positionInside(n+e.word.length,i))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:typeof e.endIndex=="number"?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return new Wl().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let i of e)i===this?r=!0:r?(this.parent.insertAfter(t,i),t=i):this.parent.insertBefore(t,i);r||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let r={},i=t==null;t=t||new Map;let n=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let l=this[o];if(Array.isArray(l))r[o]=l.map(a=>typeof a=="object"&&a.toJSON?a.toJSON(null,t):a);else if(typeof l=="object"&&l.toJSON)r[o]=l.toJSON(null,t);else if(o==="source"){let a=t.get(l.input);a==null&&(a=n,t.set(l.input,n),n++),r[o]={end:l.end,inputId:a,start:l.start}}else r[o]=l}return i&&(r.inputs=[...t.keys()].map(o=>o.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Hl){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let i={node:this};for(let n in r)i[n]=r[n];return e.warn(t,i)}get proxyOf(){return this}};var _t=Hr;Hr.default=Hr;let jl=_t,jr=class extends jl{constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};var xt=jr;jr.default=jr;let Gl="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Vl={nanoid:(s=21)=>{let e="",t=s;for(;t--;)e+=Gl[Math.random()*64|0];return e}};let{SourceMapConsumer:Pi,SourceMapGenerator:Di}=ne,{existsSync:Yl,readFileSync:Zl}=ne,{dirname:Gr,join:Jl}=ne;function Xl(s){return Buffer?Buffer.from(s,"base64").toString():window.atob(s)}let Vr=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,i=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Gr(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Pi(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,n=/^data:application\/json,/;if(i.test(e)||n.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||r.test(e))return Xl(e.substr(RegExp.lastMatch.length));let o=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+o)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),i=e.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,i)))}loadFile(e){if(this.root=Gr(e),Yl(e))return this.mapFile=e,Zl(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let r=t(e);if(r){let i=this.loadFile(r);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(t instanceof Pi)return Di.fromSourceMap(t).toString();if(t instanceof Di)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=Jl(Gr(e),r)),this.loadFile(r)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Li=Vr;Vr.default=Vr;let{SourceMapConsumer:Kl,SourceMapGenerator:Ql}=ne,{fileURLToPath:Fi,pathToFileURL:It}=ne,{isAbsolute:Yr,resolve:Zr}=ne,{nanoid:ql}=Vl,Jr=ne,Ui=Ur,eu=Li,Xr=Symbol("fromOffsetCache"),tu=!!(Kl&&Ql),Bi=!!(Zr&&Yr),Rt=class{constructor(e,t={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Bi||/^\w+:\/\//.test(t.from)||Yr(t.from)?this.file=t.from:this.file=Zr(t.from)),Bi&&tu){let r=new eu(this.css,t);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+ql(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let n,o,l;if(t&&typeof t=="object"){let u=t,c=r;if(typeof u.offset=="number"){let h=this.fromOffset(u.offset);t=h.line,r=h.col}else t=u.line,r=u.column;if(typeof c.offset=="number"){let h=this.fromOffset(c.offset);o=h.line,l=h.col}else o=c.line,l=c.column}else if(!r){let u=this.fromOffset(t);t=u.line,r=u.col}let a=this.origin(t,r,o,l);return a?n=new Ui(e,a.endLine===void 0?a.line:{column:a.column,line:a.line},a.endLine===void 0?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,i.plugin):n=new Ui(e,o===void 0?t:{column:r,line:t},o===void 0?r:{column:l,line:o},this.css,this.file,i.plugin),n.input={column:r,endColumn:l,endLine:o,line:t,source:this.css},this.file&&(It&&(n.input.url=It(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[Xr])r=this[Xr];else{let n=this.css.split(`
19
+ `);r=new Array(n.length);let o=0;for(let l=0,a=n.length;l<a;l++)r[l]=o,o+=n[l].length+1;this[Xr]=r}t=r[r.length-1];let i=0;if(e>=t)i=r.length-1;else{let n=r.length-2,o;for(;i<n;)if(o=i+(n-i>>1),e<r[o])n=o-1;else if(e>=r[o+1])i=o+1;else{i=o;break}}return{col:e-r[i]+1,line:i+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Zr(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,i){if(!this.map)return!1;let n=this.map.consumer(),o=n.originalPositionFor({column:t,line:e});if(!o.source)return!1;let l;typeof r=="number"&&(l=n.originalPositionFor({column:i,line:r}));let a;Yr(o.source)?a=It(o.source):a=new URL(o.source,this.map.consumer().sourceRoot||It(this.map.mapFile));let u={column:o.column,endColumn:l&&l.column,endLine:l&&l.line,line:o.line,url:a.toString()};if(a.protocol==="file:")if(Fi)u.file=Fi(a);else throw new Error("file: protocol is not available in this PostCSS build");let c=n.sourceContentFor(o.source);return c&&(u.source=c),u}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var kt=Rt;Rt.default=Rt,Jr&&Jr.registerInput&&Jr.registerInput(Rt);let{SourceMapConsumer:zi,SourceMapGenerator:Et}=ne,{dirname:Mt,relative:Wi,resolve:Hi,sep:ji}=ne,{pathToFileURL:Gi}=ne,ru=kt,su=!!(zi&&Et),iu=!!(Mt&&Hi&&Wi&&ji);var Vi=class{constructor(e,t,r,i){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=`
20
20
  `;this.css.includes(`\r
21
21
  `)&&(t=`\r
22
- `),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||Mt(e.file),i;this.mapOpts.sourcesContent===!1?(i=new zi(e.text),i.sourcesContent&&(i.sourcesContent=null)):i=e.consumer(),this.map.applySourceMap(i,t,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),nu&&iu&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Et.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Et({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 Et({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},n,o;this.stringify(this.root,(l,a,u)=>{if(this.css+=l,a&&u!=="end"&&(i.generated.line=e,i.generated.column=t-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),n=l.match(/\n/g),n?(e+=n.length,o=l.lastIndexOf(`
23
- `),t=l.length-o):t+=l.length,a&&u!=="start"){let c=a.parent||{raws:{}};(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==c.last||c.raws.semicolon)&&(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=e,i.generated.column=t-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=t-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(e=>e.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Mt(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Mt(Hi(r,this.mapOpts.annotation)));let i=Wi(r,e);return this.memoizedPaths.set(e,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new su(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Gi){let r=Gi(e).toString();return this.memoizedFileURLs.set(e,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;ji==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let ou=_t,Kr=class extends ou{constructor(e){super(e),this.type="comment"}};var At=Kr;Kr.default=Kr;let{isClean:Yi,my:Zi}=Je,Ji=xt,Xi=At,au=_t,Ki,Qr,qr,Qi;function qi(s){return s.map(e=>(e.nodes&&(e.nodes=qi(e.nodes)),delete e.source,e))}function en(s){if(s[Yi]=!1,s.proxyOf.nodes)for(let e of s.proxyOf.nodes)en(e)}let de=class Ua extends au{append(...e){for(let t of e){let r=this.normalize(t,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),r,i;for(;this.indexes[t]<this.proxyOf.nodes.length&&(r=this.indexes[t],i=e(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[t]+=1;return delete this.indexes[t],i}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...r)=>e[t](...r.map(i=>typeof i=="function"?(n,o)=>i(n.toProxy(),o):i)):t==="every"||t==="some"?r=>e[t]((i,...n)=>r(i.toProxy(),...n)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(r=>r.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let o of i)this.proxyOf.nodes.splice(r+1,0,o);let n;for(let o in this.indexes)n=this.indexes[o],r<n&&(this.indexes[o]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),i=r===0?"prepend":!1,n=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let l of n)this.proxyOf.nodes.splice(r,0,l);let o;for(let l in this.indexes)o=this.indexes[l],r<=o&&(this.indexes[l]=o+n.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=qi(Ki(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Ji(e)]}else if(e.selector)e=[new Qr(e)];else if(e.name)e=[new qr(e)];else if(e.text)e=[new Xi(e)];else throw new Error("Unknown node type in node creation");return e.map(i=>(i[Zi]||Ua.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Yi]&&en(i),typeof i.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(i.raws.before=t.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(i=>{t.props&&!t.props.includes(i.prop)||t.fast&&!i.value.includes(t.fast)||(i.value=i.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let i;try{i=e(t,r)}catch(n){throw t.addToError(n)}return i!==!1&&t.walk&&(i=t.walk(e)),i})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="atrule")return t(r,i)}))}walkComments(e){return this.walk((t,r)=>{if(t.type==="comment")return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="decl")return t(r,i)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&e.test(r.selector))return t(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="rule")return t(r,i)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};de.registerParse=s=>{Ki=s},de.registerRule=s=>{Qr=s},de.registerAtRule=s=>{qr=s},de.registerRoot=s=>{Qi=s};var Ce=de;de.default=de,de.rebuild=s=>{s.type==="atrule"?Object.setPrototypeOf(s,qr.prototype):s.type==="rule"?Object.setPrototypeOf(s,Qr.prototype):s.type==="decl"?Object.setPrototypeOf(s,Ji.prototype):s.type==="comment"?Object.setPrototypeOf(s,Xi.prototype):s.type==="root"&&Object.setPrototypeOf(s,Qi.prototype),s[Zi]=!0,s.nodes&&s.nodes.forEach(e=>{de.rebuild(e)})};let lu=Ce,tn,rn,Xe=class extends lu{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new tn(new rn,this,e).stringify()}};Xe.registerLazyResult=s=>{tn=s},Xe.registerProcessor=s=>{rn=s};var es=Xe;Xe.default=Xe;let sn={};var nn=function(e){sn[e]||(sn[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))};let ts=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var on=ts;ts.default=ts;let uu=on,rs=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new uu(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}};var ss=rs;rs.default=rs;const is=39,an=34,Ot=92,ln=47,$t=10,Ke=32,Nt=12,Tt=9,Pt=13,cu=91,hu=93,fu=40,du=41,pu=123,mu=125,gu=59,yu=42,wu=58,bu=64,Dt=/[\t\n\f\r "#'()/;[\\\]{}]/g,Lt=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,vu=/.[\r\n"'(/\\]/,un=/[\da-f]/i;var Su=function(e,t={}){let r=e.css.valueOf(),i=t.ignoreErrors,n,o,l,a,u,c,h,p,d,g,m=r.length,f=0,v=[],b=[];function y(){return f}function C(N){throw e.error("Unclosed "+N,f)}function k(){return b.length===0&&f>=m}function M(N){if(b.length)return b.pop();if(f>=m)return;let L=N?N.ignoreUnclosed:!1;switch(n=r.charCodeAt(f),n){case $t:case Ke:case Tt:case Pt:case Nt:{o=f;do o+=1,n=r.charCodeAt(o);while(n===Ke||n===$t||n===Tt||n===Pt||n===Nt);g=["space",r.slice(f,o)],f=o-1;break}case cu:case hu:case pu:case mu:case wu:case gu:case du:{let Y=String.fromCharCode(n);g=[Y,Y,f];break}case fu:{if(p=v.length?v.pop()[1]:"",d=r.charCodeAt(f+1),p==="url"&&d!==is&&d!==an&&d!==Ke&&d!==$t&&d!==Tt&&d!==Nt&&d!==Pt){o=f;do{if(c=!1,o=r.indexOf(")",o+1),o===-1)if(i||L){o=f;break}else C("bracket");for(h=o;r.charCodeAt(h-1)===Ot;)h-=1,c=!c}while(c);g=["brackets",r.slice(f,o+1),f,o],f=o}else o=r.indexOf(")",f+1),a=r.slice(f,o+1),o===-1||vu.test(a)?g=["(","(",f]:(g=["brackets",a,f,o],f=o);break}case is:case an:{l=n===is?"'":'"',o=f;do{if(c=!1,o=r.indexOf(l,o+1),o===-1)if(i||L){o=f+1;break}else C("string");for(h=o;r.charCodeAt(h-1)===Ot;)h-=1,c=!c}while(c);g=["string",r.slice(f,o+1),f,o],f=o;break}case bu:{Dt.lastIndex=f+1,Dt.test(r),Dt.lastIndex===0?o=r.length-1:o=Dt.lastIndex-2,g=["at-word",r.slice(f,o+1),f,o],f=o;break}case Ot:{for(o=f,u=!0;r.charCodeAt(o+1)===Ot;)o+=1,u=!u;if(n=r.charCodeAt(o+1),u&&n!==ln&&n!==Ke&&n!==$t&&n!==Tt&&n!==Pt&&n!==Nt&&(o+=1,un.test(r.charAt(o)))){for(;un.test(r.charAt(o+1));)o+=1;r.charCodeAt(o+1)===Ke&&(o+=1)}g=["word",r.slice(f,o+1),f,o],f=o;break}default:{n===ln&&r.charCodeAt(f+1)===yu?(o=r.indexOf("*/",f+2)+1,o===0&&(i||L?o=r.length:C("comment")),g=["comment",r.slice(f,o+1),f,o],f=o):(Lt.lastIndex=f+1,Lt.test(r),Lt.lastIndex===0?o=r.length-1:o=Lt.lastIndex-2,g=["word",r.slice(f,o+1),f,o],v.push(g),f=o);break}}return f++,g}function V(N){b.push(N)}return{back:V,endOfFile:k,nextToken:M,position:y}};let cn=Ce,Ft=class extends cn{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var ns=Ft;Ft.default=Ft,cn.registerAtRule(Ft);let hn=Ce,fn,dn,$e=class extends hn{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let i=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let n of i)n.raws.before=t.raws.before}return i}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new fn(new dn,this,e).stringify()}};$e.registerLazyResult=s=>{fn=s},$e.registerProcessor=s=>{dn=s};var Qe=$e;$e.default=$e,hn.registerRoot($e);let qe={comma(s){return qe.split(s,[","],!0)},space(s){let e=[" ",`
24
- `," "];return qe.split(s,e)},split(s,e,t){let r=[],i="",n=!1,o=0,l=!1,a="",u=!1;for(let c of s)u?u=!1:c==="\\"?u=!0:l?c===a&&(l=!1):c==='"'||c==="'"?(l=!0,a=c):c==="("?o+=1:c===")"?o>0&&(o-=1):o===0&&e.includes(c)&&(n=!0),n?(i!==""&&r.push(i.trim()),i="",n=!1):i+=c;return(t||i!=="")&&r.push(i.trim()),r}};var pn=qe;qe.default=qe;let mn=Ce,Cu=pn,Ut=class extends mn{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Cu.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var os=Ut;Ut.default=Ut,mn.registerRule(Ut);let _u=xt,xu=Su,Iu=At,Ru=ns,ku=Qe,gn=os;const yn={empty:!0,space:!0};function Eu(s){for(let e=s.length-1;e>=0;e--){let t=s[e],r=t[3]||t[2];if(r)return r}}var Mu=class{constructor(e){this.input=e,this.root=new ku,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new Ru;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,i,n,o=!1,l=!1,a=[],u=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(a.length>0){for(n=a.length-1,i=a[n];i&&i[0]==="space";)i=a[--n];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(t.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(t,"params",a),o&&(e=a[a.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),l&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,i;for(let n=t-1;n>=0&&(i=e[n],!(i[0]!=="space"&&(r+=1,r===2)));n--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(e){let t=0,r,i,n;for(let[o,l]of e.entries()){if(r=l,i=r[0],i==="("&&(t+=1),i===")"&&(t-=1),t===0&&i===":")if(!n)this.doubleColon(r);else{if(n[0]==="word"&&n[1]==="progid")continue;return o}n=r}return!1}comment(e){let t=new Iu;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let i=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=i[2],t.raws.left=i[1],t.raws.right=i[3]}}createTokenizer(){this.tokenizer=xu(this.input)}decl(e,t){let r=new _u;this.init(r,e[0][2]);let i=e[e.length-1];for(i[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||Eu(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let u=e[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let n;for(;e.length;)if(n=e.shift(),n[0]===":"){r.raws.between+=n[1];break}else n[0]==="word"&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o=[],l;for(;e.length&&(l=e[0][0],!(l!=="space"&&l!=="comment"));)o.push(e.shift());this.precheckMissedSemicolon(e);for(let u=e.length-1;u>=0;u--){if(n=e[u],n[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(e,u);c=this.spacesFromEnd(e)+c,c!==" !important"&&(r.raws.important=c);break}else if(n[1].toLowerCase()==="important"){let c=e.slice(0),h="";for(let p=u;p>0;p--){let d=c[p][0];if(h.trim().indexOf("!")===0&&d!=="space")break;h=c.pop()[1]+h}h.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=h,e=c)}if(n[0]!=="space"&&n[0]!=="comment")break}e.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=o.map(u=>u[1]).join(""),o=[]),this.raw(r,"value",o.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new gn;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,i=!1,n=null,o=[],l=e[1].startsWith("--"),a=[],u=e;for(;u;){if(r=u[0],a.push(u),r==="("||r==="[")n||(n=u),o.push(r==="("?")":"]");else if(l&&i&&r==="{")n||(n=u),o.push("}");else if(o.length===0)if(r===";")if(i){this.decl(a,l);return}else break;else if(r==="{"){this.rule(a);return}else if(r==="}"){this.tokenizer.back(a.pop()),t=!0;break}else r===":"&&(i=!0);else r===o[o.length-1]&&(o.pop(),o.length===0&&(n=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&i){if(!l)for(;a.length&&(u=a[a.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,l)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,i){let n,o,l=r.length,a="",u=!0,c,h;for(let p=0;p<l;p+=1)n=r[p],o=n[0],o==="space"&&p===l-1&&!i?u=!1:o==="comment"?(h=r[p-1]?r[p-1][0]:"empty",c=r[p+1]?r[p+1][0]:"empty",!yn[h]&&!yn[c]?a.slice(-1)===","?u=!1:a+=n[1]:u=!1):a+=n[1];if(!u){let p=r.reduce((d,g)=>d+g[1],"");e.raws[t]={raw:p,value:a}}e[t]=a}rule(e){e.pop();let t=new gn;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let i=t;i<e.length;i++)r+=e[i][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let Au=Ce,Ou=Mu,$u=kt;function Bt(s,e){let t=new $u(s,e),r=new Ou(t);try{r.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&e&&e.from&&(/\.scss$/i.test(e.from)?i.message+=`
22
+ `),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||Mt(e.file),i;this.mapOpts.sourcesContent===!1?(i=new zi(e.text),i.sourcesContent&&(i.sourcesContent=null)):i=e.consumer(),this.map.applySourceMap(i,t,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),iu&&su&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Et.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Et({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 Et({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},n,o;this.stringify(this.root,(l,a,u)=>{if(this.css+=l,a&&u!=="end"&&(i.generated.line=e,i.generated.column=t-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),n=l.match(/\n/g),n?(e+=n.length,o=l.lastIndexOf(`
23
+ `),t=l.length-o):t+=l.length,a&&u!=="start"){let c=a.parent||{raws:{}};(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==c.last||c.raws.semicolon)&&(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=e,i.generated.column=t-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=t-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(e=>e.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Mt(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Mt(Hi(r,this.mapOpts.annotation)));let i=Wi(r,e);return this.memoizedPaths.set(e,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new ru(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Gi){let r=Gi(e).toString();return this.memoizedFileURLs.set(e,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;ji==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let nu=_t,Kr=class extends nu{constructor(e){super(e),this.type="comment"}};var At=Kr;Kr.default=Kr;let{isClean:Yi,my:Zi}=Je,Ji=xt,Xi=At,ou=_t,Ki,Qr,qr,Qi;function qi(s){return s.map(e=>(e.nodes&&(e.nodes=qi(e.nodes)),delete e.source,e))}function en(s){if(s[Yi]=!1,s.proxyOf.nodes)for(let e of s.proxyOf.nodes)en(e)}let pe=class Fa extends ou{append(...e){for(let t of e){let r=this.normalize(t,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),r,i;for(;this.indexes[t]<this.proxyOf.nodes.length&&(r=this.indexes[t],i=e(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[t]+=1;return delete this.indexes[t],i}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...r)=>e[t](...r.map(i=>typeof i=="function"?(n,o)=>i(n.toProxy(),o):i)):t==="every"||t==="some"?r=>e[t]((i,...n)=>r(i.toProxy(),...n)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(r=>r.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let o of i)this.proxyOf.nodes.splice(r+1,0,o);let n;for(let o in this.indexes)n=this.indexes[o],r<n&&(this.indexes[o]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),i=r===0?"prepend":!1,n=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let l of n)this.proxyOf.nodes.splice(r,0,l);let o;for(let l in this.indexes)o=this.indexes[l],r<=o&&(this.indexes[l]=o+n.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=qi(Ki(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Ji(e)]}else if(e.selector)e=[new Qr(e)];else if(e.name)e=[new qr(e)];else if(e.text)e=[new Xi(e)];else throw new Error("Unknown node type in node creation");return e.map(i=>(i[Zi]||Fa.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Yi]&&en(i),typeof i.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(i.raws.before=t.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(i=>{t.props&&!t.props.includes(i.prop)||t.fast&&!i.value.includes(t.fast)||(i.value=i.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let i;try{i=e(t,r)}catch(n){throw t.addToError(n)}return i!==!1&&t.walk&&(i=t.walk(e)),i})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="atrule")return t(r,i)}))}walkComments(e){return this.walk((t,r)=>{if(t.type==="comment")return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="decl")return t(r,i)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&e.test(r.selector))return t(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="rule")return t(r,i)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};pe.registerParse=s=>{Ki=s},pe.registerRule=s=>{Qr=s},pe.registerAtRule=s=>{qr=s},pe.registerRoot=s=>{Qi=s};var Ce=pe;pe.default=pe,pe.rebuild=s=>{s.type==="atrule"?Object.setPrototypeOf(s,qr.prototype):s.type==="rule"?Object.setPrototypeOf(s,Qr.prototype):s.type==="decl"?Object.setPrototypeOf(s,Ji.prototype):s.type==="comment"?Object.setPrototypeOf(s,Xi.prototype):s.type==="root"&&Object.setPrototypeOf(s,Qi.prototype),s[Zi]=!0,s.nodes&&s.nodes.forEach(e=>{pe.rebuild(e)})};let au=Ce,tn,rn,Xe=class extends au{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new tn(new rn,this,e).stringify()}};Xe.registerLazyResult=s=>{tn=s},Xe.registerProcessor=s=>{rn=s};var es=Xe;Xe.default=Xe;let sn={};var nn=function(e){sn[e]||(sn[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))};let ts=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var on=ts;ts.default=ts;let lu=on,rs=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new lu(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}};var ss=rs;rs.default=rs;const is=39,an=34,Ot=92,ln=47,$t=10,Ke=32,Nt=12,Tt=9,Pt=13,uu=91,cu=93,hu=40,fu=41,du=123,pu=125,mu=59,gu=42,yu=58,wu=64,Dt=/[\t\n\f\r "#'()/;[\\\]{}]/g,Lt=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,bu=/.[\r\n"'(/\\]/,un=/[\da-f]/i;var vu=function(e,t={}){let r=e.css.valueOf(),i=t.ignoreErrors,n,o,l,a,u,c,h,p,d,g,m=r.length,f=0,v=[],b=[];function y(){return f}function C(N){throw e.error("Unclosed "+N,f)}function k(){return b.length===0&&f>=m}function M(N){if(b.length)return b.pop();if(f>=m)return;let L=N?N.ignoreUnclosed:!1;switch(n=r.charCodeAt(f),n){case $t:case Ke:case Tt:case Pt:case Nt:{o=f;do o+=1,n=r.charCodeAt(o);while(n===Ke||n===$t||n===Tt||n===Pt||n===Nt);g=["space",r.slice(f,o)],f=o-1;break}case uu:case cu:case du:case pu:case yu:case mu:case fu:{let Y=String.fromCharCode(n);g=[Y,Y,f];break}case hu:{if(p=v.length?v.pop()[1]:"",d=r.charCodeAt(f+1),p==="url"&&d!==is&&d!==an&&d!==Ke&&d!==$t&&d!==Tt&&d!==Nt&&d!==Pt){o=f;do{if(c=!1,o=r.indexOf(")",o+1),o===-1)if(i||L){o=f;break}else C("bracket");for(h=o;r.charCodeAt(h-1)===Ot;)h-=1,c=!c}while(c);g=["brackets",r.slice(f,o+1),f,o],f=o}else o=r.indexOf(")",f+1),a=r.slice(f,o+1),o===-1||bu.test(a)?g=["(","(",f]:(g=["brackets",a,f,o],f=o);break}case is:case an:{l=n===is?"'":'"',o=f;do{if(c=!1,o=r.indexOf(l,o+1),o===-1)if(i||L){o=f+1;break}else C("string");for(h=o;r.charCodeAt(h-1)===Ot;)h-=1,c=!c}while(c);g=["string",r.slice(f,o+1),f,o],f=o;break}case wu:{Dt.lastIndex=f+1,Dt.test(r),Dt.lastIndex===0?o=r.length-1:o=Dt.lastIndex-2,g=["at-word",r.slice(f,o+1),f,o],f=o;break}case Ot:{for(o=f,u=!0;r.charCodeAt(o+1)===Ot;)o+=1,u=!u;if(n=r.charCodeAt(o+1),u&&n!==ln&&n!==Ke&&n!==$t&&n!==Tt&&n!==Pt&&n!==Nt&&(o+=1,un.test(r.charAt(o)))){for(;un.test(r.charAt(o+1));)o+=1;r.charCodeAt(o+1)===Ke&&(o+=1)}g=["word",r.slice(f,o+1),f,o],f=o;break}default:{n===ln&&r.charCodeAt(f+1)===gu?(o=r.indexOf("*/",f+2)+1,o===0&&(i||L?o=r.length:C("comment")),g=["comment",r.slice(f,o+1),f,o],f=o):(Lt.lastIndex=f+1,Lt.test(r),Lt.lastIndex===0?o=r.length-1:o=Lt.lastIndex-2,g=["word",r.slice(f,o+1),f,o],v.push(g),f=o);break}}return f++,g}function V(N){b.push(N)}return{back:V,endOfFile:k,nextToken:M,position:y}};let cn=Ce,Ft=class extends cn{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var ns=Ft;Ft.default=Ft,cn.registerAtRule(Ft);let hn=Ce,fn,dn,$e=class extends hn{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let i=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let n of i)n.raws.before=t.raws.before}return i}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new fn(new dn,this,e).stringify()}};$e.registerLazyResult=s=>{fn=s},$e.registerProcessor=s=>{dn=s};var Qe=$e;$e.default=$e,hn.registerRoot($e);let qe={comma(s){return qe.split(s,[","],!0)},space(s){let e=[" ",`
24
+ `," "];return qe.split(s,e)},split(s,e,t){let r=[],i="",n=!1,o=0,l=!1,a="",u=!1;for(let c of s)u?u=!1:c==="\\"?u=!0:l?c===a&&(l=!1):c==='"'||c==="'"?(l=!0,a=c):c==="("?o+=1:c===")"?o>0&&(o-=1):o===0&&e.includes(c)&&(n=!0),n?(i!==""&&r.push(i.trim()),i="",n=!1):i+=c;return(t||i!=="")&&r.push(i.trim()),r}};var pn=qe;qe.default=qe;let mn=Ce,Su=pn,Ut=class extends mn{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Su.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var os=Ut;Ut.default=Ut,mn.registerRule(Ut);let Cu=xt,_u=vu,xu=At,Iu=ns,Ru=Qe,gn=os;const yn={empty:!0,space:!0};function ku(s){for(let e=s.length-1;e>=0;e--){let t=s[e],r=t[3]||t[2];if(r)return r}}var Eu=class{constructor(e){this.input=e,this.root=new Ru,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new Iu;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,i,n,o=!1,l=!1,a=[],u=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(a.length>0){for(n=a.length-1,i=a[n];i&&i[0]==="space";)i=a[--n];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(t.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(t,"params",a),o&&(e=a[a.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),l&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,i;for(let n=t-1;n>=0&&(i=e[n],!(i[0]!=="space"&&(r+=1,r===2)));n--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(e){let t=0,r,i,n;for(let[o,l]of e.entries()){if(r=l,i=r[0],i==="("&&(t+=1),i===")"&&(t-=1),t===0&&i===":")if(!n)this.doubleColon(r);else{if(n[0]==="word"&&n[1]==="progid")continue;return o}n=r}return!1}comment(e){let t=new xu;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let i=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=i[2],t.raws.left=i[1],t.raws.right=i[3]}}createTokenizer(){this.tokenizer=_u(this.input)}decl(e,t){let r=new Cu;this.init(r,e[0][2]);let i=e[e.length-1];for(i[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||ku(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let u=e[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let n;for(;e.length;)if(n=e.shift(),n[0]===":"){r.raws.between+=n[1];break}else n[0]==="word"&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o=[],l;for(;e.length&&(l=e[0][0],!(l!=="space"&&l!=="comment"));)o.push(e.shift());this.precheckMissedSemicolon(e);for(let u=e.length-1;u>=0;u--){if(n=e[u],n[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(e,u);c=this.spacesFromEnd(e)+c,c!==" !important"&&(r.raws.important=c);break}else if(n[1].toLowerCase()==="important"){let c=e.slice(0),h="";for(let p=u;p>0;p--){let d=c[p][0];if(h.trim().indexOf("!")===0&&d!=="space")break;h=c.pop()[1]+h}h.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=h,e=c)}if(n[0]!=="space"&&n[0]!=="comment")break}e.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=o.map(u=>u[1]).join(""),o=[]),this.raw(r,"value",o.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new gn;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,i=!1,n=null,o=[],l=e[1].startsWith("--"),a=[],u=e;for(;u;){if(r=u[0],a.push(u),r==="("||r==="[")n||(n=u),o.push(r==="("?")":"]");else if(l&&i&&r==="{")n||(n=u),o.push("}");else if(o.length===0)if(r===";")if(i){this.decl(a,l);return}else break;else if(r==="{"){this.rule(a);return}else if(r==="}"){this.tokenizer.back(a.pop()),t=!0;break}else r===":"&&(i=!0);else r===o[o.length-1]&&(o.pop(),o.length===0&&(n=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&i){if(!l)for(;a.length&&(u=a[a.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,l)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,i){let n,o,l=r.length,a="",u=!0,c,h;for(let p=0;p<l;p+=1)n=r[p],o=n[0],o==="space"&&p===l-1&&!i?u=!1:o==="comment"?(h=r[p-1]?r[p-1][0]:"empty",c=r[p+1]?r[p+1][0]:"empty",!yn[h]&&!yn[c]?a.slice(-1)===","?u=!1:a+=n[1]:u=!1):a+=n[1];if(!u){let p=r.reduce((d,g)=>d+g[1],"");e.raws[t]={raw:p,value:a}}e[t]=a}rule(e){e.pop();let t=new gn;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let i=t;i<e.length;i++)r+=e[i][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let Mu=Ce,Au=Eu,Ou=kt;function Bt(s,e){let t=new Ou(s,e),r=new Au(t);try{r.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&e&&e.from&&(/\.scss$/i.test(e.from)?i.message+=`
25
25
  You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(e.from)?i.message+=`
26
26
  You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(e.from)&&(i.message+=`
27
- You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var as=Bt;Bt.default=Bt,Au.registerParse(Bt);let{isClean:ue,my:Nu}=Je,Tu=Vi,Pu=St,Du=Ce,Lu=es,Fu=nn,wn=ss,Uu=as,Bu=Qe;const zu={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Wu={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},Hu={Once:!0,postcssPlugin:!0,prepare:!0},Ne=0;function et(s){return typeof s=="object"&&typeof s.then=="function"}function bn(s){let e=!1,t=zu[s.type];return s.type==="decl"?e=s.prop.toLowerCase():s.type==="atrule"&&(e=s.name.toLowerCase()),e&&s.append?[t,t+"-"+e,Ne,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:s.append?[t,Ne,t+"Exit"]:[t,t+"Exit"]}function vn(s){let e;return s.type==="document"?e=["Document",Ne,"DocumentExit"]:s.type==="root"?e=["Root",Ne,"RootExit"]:e=bn(s),{eventIndex:0,events:e,iterator:0,node:s,visitorIndex:0,visitors:[]}}function ls(s){return s[ue]=!1,s.nodes&&s.nodes.forEach(e=>ls(e)),s}let us={},Te=class Ba{constructor(e,t,r){this.stringified=!1,this.processed=!1;let i;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))i=ls(t);else if(t instanceof Ba||t instanceof wn)i=ls(t.root),t.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let n=Uu;r.syntax&&(n=r.syntax.parse),r.parser&&(n=r.parser),n.parse&&(n=n.parse);try{i=n(t,r)}catch(o){this.processed=!0,this.error=o}i&&!i[Nu]&&Du.rebuild(i)}this.result=new wn(e,i,r),this.helpers={...us,postcss:us,result:this.result},this.plugins=this.processor.plugins.map(n=>typeof n=="object"&&n.prepare?{...n,...n.prepare(this.result)}:n)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin)e.plugin=r.postcssPlugin,e.setMessage();else if(r.postcssVersion&&process.env.NODE_ENV!=="production"){let i=r.postcssPlugin,n=r.postcssVersion,o=this.result.processor.version,l=n.split("."),a=o.split(".");(l[0]!==a[0]||parseInt(l[1])>parseInt(a[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+o+", but "+i+" uses "+n+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return e}prepareVisitors(){this.listeners={};let e=(t,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([t,i])};for(let t of this.plugins)if(typeof t=="object")for(let r in t){if(!Wu[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Hu[r])if(typeof t[r]=="object")for(let i in t[r])i==="*"?e(t,r,t[r][i]):e(t,r+"-"+i.toLowerCase(),t[r][i]);else typeof t[r]=="function"&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(et(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ue];){e[ue]=!0;let t=[vn(e)];for(;t.length>0;){let r=this.visitTick(t);if(et(r))try{await r}catch(i){let n=t[t.length-1].node;throw this.handleError(i,n)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let i=e.nodes.map(n=>r(n,this.helpers));await Promise.all(i)}else await r(e,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return et(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Pu;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new Tu(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){let t=this.runOnRoot(e);if(et(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ue];)e[ue]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return process.env.NODE_ENV!=="production"&&("from"in this.opts||Fu("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,i]of e){this.result.lastPlugin=r;let n;try{n=i(t,this.helpers)}catch(o){throw this.handleError(o,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(et(n))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:i}=t;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(i.length>0&&t.visitorIndex<i.length){let[o,l]=i[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===i.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return l(r.toProxy(),this.helpers)}catch(a){throw this.handleError(a,r)}}if(t.iterator!==0){let o=t.iterator,l;for(;l=r.nodes[r.indexes[o]];)if(r.indexes[o]+=1,!l[ue]){l[ue]=!0,e.push(vn(l));return}t.iterator=0,delete r.indexes[o]}let n=t.events;for(;t.eventIndex<n.length;){let o=n[t.eventIndex];if(t.eventIndex+=1,o===Ne){r.nodes&&r.nodes.length&&(r[ue]=!0,t.iterator=r.getIterator());return}else if(this.listeners[o]){t.visitors=this.listeners[o];return}}e.pop()}walkSync(e){e[ue]=!0;let t=bn(e);for(let r of t)if(r===Ne)e.nodes&&e.each(i=>{i[ue]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Te.registerPostcss=s=>{us=s};var Sn=Te;Te.default=Te,Bu.registerLazyResult(Te),Lu.registerLazyResult(Te);let ju=Vi,Gu=St,Vu=nn,Yu=as;const Zu=ss;let cs=class{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let i,n=Gu;this.result=new Zu(this._processor,i,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let l=new ju(n,i,this._opts,t);if(l.isMap()){let[a,u]=l.generate();a&&(this.result.css=a),u&&(this.result.map=u)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return process.env.NODE_ENV!=="production"&&("from"in this._opts||Vu("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Yu;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Ju=cs;cs.default=cs;let Xu=Ju,Ku=Sn,Qu=es,qu=Qe,tt=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(typeof r=="object"&&(r.parse||r.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new Xu(this,e,t):new Ku(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var ec=tt;tt.default=tt,qu.registerProcessor(tt),Qu.registerProcessor(tt);let tc=xt,rc=Li,sc=At,ic=ns,nc=kt,oc=Qe,ac=os;function rt(s,e){if(Array.isArray(s))return s.map(i=>rt(i));let{inputs:t,...r}=s;if(t){e=[];for(let i of t){let n={...i,__proto__:nc.prototype};n.map&&(n.map={...n.map,__proto__:rc.prototype}),e.push(n)}}if(r.nodes&&(r.nodes=s.nodes.map(i=>rt(i,e))),r.source){let{inputId:i,...n}=r.source;r.source=n,i!=null&&(r.source.input=e[i])}if(r.type==="root")return new oc(r);if(r.type==="decl")return new tc(r);if(r.type==="rule")return new ac(r);if(r.type==="comment")return new sc(r);if(r.type==="atrule")return new ic(r);throw new Error("Unknown node type: "+s.type)}var lc=rt;rt.default=rt;let uc=Ur,Cn=xt,cc=Sn,hc=Ce,hs=ec,fc=St,dc=lc,_n=es,pc=on,xn=At,In=ns,mc=ss,gc=kt,yc=as,wc=pn,Rn=os,kn=Qe,bc=_t;function O(...s){return s.length===1&&Array.isArray(s[0])&&(s=s[0]),new hs(s)}O.plugin=function(e,t){let r=!1;function i(...o){console&&console.warn&&!r&&(r=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
27
+ You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var as=Bt;Bt.default=Bt,Mu.registerParse(Bt);let{isClean:ue,my:$u}=Je,Nu=Vi,Tu=St,Pu=Ce,Du=es,Lu=nn,wn=ss,Fu=as,Uu=Qe;const Bu={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},zu={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},Wu={Once:!0,postcssPlugin:!0,prepare:!0},Ne=0;function et(s){return typeof s=="object"&&typeof s.then=="function"}function bn(s){let e=!1,t=Bu[s.type];return s.type==="decl"?e=s.prop.toLowerCase():s.type==="atrule"&&(e=s.name.toLowerCase()),e&&s.append?[t,t+"-"+e,Ne,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:s.append?[t,Ne,t+"Exit"]:[t,t+"Exit"]}function vn(s){let e;return s.type==="document"?e=["Document",Ne,"DocumentExit"]:s.type==="root"?e=["Root",Ne,"RootExit"]:e=bn(s),{eventIndex:0,events:e,iterator:0,node:s,visitorIndex:0,visitors:[]}}function ls(s){return s[ue]=!1,s.nodes&&s.nodes.forEach(e=>ls(e)),s}let us={},Te=class Ua{constructor(e,t,r){this.stringified=!1,this.processed=!1;let i;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))i=ls(t);else if(t instanceof Ua||t instanceof wn)i=ls(t.root),t.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let n=Fu;r.syntax&&(n=r.syntax.parse),r.parser&&(n=r.parser),n.parse&&(n=n.parse);try{i=n(t,r)}catch(o){this.processed=!0,this.error=o}i&&!i[$u]&&Pu.rebuild(i)}this.result=new wn(e,i,r),this.helpers={...us,postcss:us,result:this.result},this.plugins=this.processor.plugins.map(n=>typeof n=="object"&&n.prepare?{...n,...n.prepare(this.result)}:n)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin)e.plugin=r.postcssPlugin,e.setMessage();else if(r.postcssVersion&&process.env.NODE_ENV!=="production"){let i=r.postcssPlugin,n=r.postcssVersion,o=this.result.processor.version,l=n.split("."),a=o.split(".");(l[0]!==a[0]||parseInt(l[1])>parseInt(a[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+o+", but "+i+" uses "+n+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return e}prepareVisitors(){this.listeners={};let e=(t,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([t,i])};for(let t of this.plugins)if(typeof t=="object")for(let r in t){if(!zu[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Wu[r])if(typeof t[r]=="object")for(let i in t[r])i==="*"?e(t,r,t[r][i]):e(t,r+"-"+i.toLowerCase(),t[r][i]);else typeof t[r]=="function"&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(et(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ue];){e[ue]=!0;let t=[vn(e)];for(;t.length>0;){let r=this.visitTick(t);if(et(r))try{await r}catch(i){let n=t[t.length-1].node;throw this.handleError(i,n)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let i=e.nodes.map(n=>r(n,this.helpers));await Promise.all(i)}else await r(e,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return et(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Tu;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new Nu(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){let t=this.runOnRoot(e);if(et(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ue];)e[ue]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return process.env.NODE_ENV!=="production"&&("from"in this.opts||Lu("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,i]of e){this.result.lastPlugin=r;let n;try{n=i(t,this.helpers)}catch(o){throw this.handleError(o,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(et(n))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:i}=t;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(i.length>0&&t.visitorIndex<i.length){let[o,l]=i[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===i.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return l(r.toProxy(),this.helpers)}catch(a){throw this.handleError(a,r)}}if(t.iterator!==0){let o=t.iterator,l;for(;l=r.nodes[r.indexes[o]];)if(r.indexes[o]+=1,!l[ue]){l[ue]=!0,e.push(vn(l));return}t.iterator=0,delete r.indexes[o]}let n=t.events;for(;t.eventIndex<n.length;){let o=n[t.eventIndex];if(t.eventIndex+=1,o===Ne){r.nodes&&r.nodes.length&&(r[ue]=!0,t.iterator=r.getIterator());return}else if(this.listeners[o]){t.visitors=this.listeners[o];return}}e.pop()}walkSync(e){e[ue]=!0;let t=bn(e);for(let r of t)if(r===Ne)e.nodes&&e.each(i=>{i[ue]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Te.registerPostcss=s=>{us=s};var Sn=Te;Te.default=Te,Uu.registerLazyResult(Te),Du.registerLazyResult(Te);let Hu=Vi,ju=St,Gu=nn,Vu=as;const Yu=ss;let cs=class{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let i,n=ju;this.result=new Yu(this._processor,i,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let l=new Hu(n,i,this._opts,t);if(l.isMap()){let[a,u]=l.generate();a&&(this.result.css=a),u&&(this.result.map=u)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return process.env.NODE_ENV!=="production"&&("from"in this._opts||Gu("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Vu;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Zu=cs;cs.default=cs;let Ju=Zu,Xu=Sn,Ku=es,Qu=Qe,tt=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(typeof r=="object"&&(r.parse||r.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new Ju(this,e,t):new Xu(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var qu=tt;tt.default=tt,Qu.registerProcessor(tt),Ku.registerProcessor(tt);let ec=xt,tc=Li,rc=At,sc=ns,ic=kt,nc=Qe,oc=os;function rt(s,e){if(Array.isArray(s))return s.map(i=>rt(i));let{inputs:t,...r}=s;if(t){e=[];for(let i of t){let n={...i,__proto__:ic.prototype};n.map&&(n.map={...n.map,__proto__:tc.prototype}),e.push(n)}}if(r.nodes&&(r.nodes=s.nodes.map(i=>rt(i,e))),r.source){let{inputId:i,...n}=r.source;r.source=n,i!=null&&(r.source.input=e[i])}if(r.type==="root")return new nc(r);if(r.type==="decl")return new ec(r);if(r.type==="rule")return new oc(r);if(r.type==="comment")return new rc(r);if(r.type==="atrule")return new sc(r);throw new Error("Unknown node type: "+s.type)}var ac=rt;rt.default=rt;let lc=Ur,Cn=xt,uc=Sn,cc=Ce,hs=qu,hc=St,fc=ac,_n=es,dc=on,xn=At,In=ns,pc=ss,mc=kt,gc=as,yc=pn,Rn=os,kn=Qe,wc=_t;function O(...s){return s.length===1&&Array.isArray(s[0])&&(s=s[0]),new hs(s)}O.plugin=function(e,t){let r=!1;function i(...o){console&&console.warn&&!r&&(r=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
28
28
  https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
29
- https://www.w3ctech.com/topic/2226`));let l=t(...o);return l.postcssPlugin=e,l.postcssVersion=new hs().version,l}let n;return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(o,l,a){return O([i(a)]).process(o,l)},i},O.stringify=fc,O.parse=yc,O.fromJSON=dc,O.list=wc,O.comment=s=>new xn(s),O.atRule=s=>new In(s),O.decl=s=>new Cn(s),O.rule=s=>new Rn(s),O.root=s=>new kn(s),O.document=s=>new _n(s),O.CssSyntaxError=uc,O.Declaration=Cn,O.Container=hc,O.Processor=hs,O.Document=_n,O.Comment=xn,O.Warning=pc,O.AtRule=In,O.Result=mc,O.Input=gc,O.Rule=Rn,O.Root=kn,O.Node=bc,cc.registerPostcss(O);var vc=O;O.default=O;const B=Dl(vc);B.stringify,B.fromJSON,B.plugin,B.parse,B.list,B.document,B.comment,B.atRule,B.rule,B.decl,B.root,B.CssSyntaxError,B.Declaration,B.Container,B.Processor,B.Document,B.Comment,B.Warning,B.AtRule,B.Result,B.Input,B.Rule,B.Root,B.Node;var Sc=Object.defineProperty,Cc=(s,e,t)=>e in s?Sc(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,se=(s,e,t)=>Cc(s,typeof e!="symbol"?e+"":e,t);function _c(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function xc(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var i=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return s[r]}})}),t}var fs={exports:{}},U=String,En=function(){return{isColorSupported:!1,reset:U,bold:U,dim:U,italic:U,underline:U,inverse:U,hidden:U,strikethrough:U,black:U,red:U,green:U,yellow:U,blue:U,magenta:U,cyan:U,white:U,gray:U,bgBlack:U,bgRed:U,bgGreen:U,bgYellow:U,bgBlue:U,bgMagenta:U,bgCyan:U,bgWhite:U}};fs.exports=En(),fs.exports.createColors=En;var Ic=fs.exports;const oe=xc(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Mn=Ic,An=oe,ds=class za extends Error{constructor(e,t,r,i,n,o){super(e),this.name="CssSyntaxError",this.reason=e,n&&(this.file=n),i&&(this.source=i),o&&(this.plugin=o),typeof t<"u"&&typeof r<"u"&&(typeof t=="number"?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,za)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=Mn.isColorSupported),An&&e&&(t=An(t));let r=t.split(/\r?\n/),i=Math.max(this.line-3,0),n=Math.min(this.line+2,r.length),o=String(n).length,l,a;if(e){let{bold:u,gray:c,red:h}=Mn.createColors(!0);l=p=>u(h(p)),a=p=>c(p)}else l=a=u=>u;return r.slice(i,n).map((u,c)=>{let h=i+1+c,p=" "+(" "+h).slice(-o)+" | ";if(h===this.line){let d=a(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+a(p)+u+`
29
+ https://www.w3ctech.com/topic/2226`));let l=t(...o);return l.postcssPlugin=e,l.postcssVersion=new hs().version,l}let n;return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(o,l,a){return O([i(a)]).process(o,l)},i},O.stringify=hc,O.parse=gc,O.fromJSON=fc,O.list=yc,O.comment=s=>new xn(s),O.atRule=s=>new In(s),O.decl=s=>new Cn(s),O.rule=s=>new Rn(s),O.root=s=>new kn(s),O.document=s=>new _n(s),O.CssSyntaxError=lc,O.Declaration=Cn,O.Container=cc,O.Processor=hs,O.Document=_n,O.Comment=xn,O.Warning=dc,O.AtRule=In,O.Result=pc,O.Input=mc,O.Rule=Rn,O.Root=kn,O.Node=wc,uc.registerPostcss(O);var bc=O;O.default=O;const B=Pl(bc);B.stringify,B.fromJSON,B.plugin,B.parse,B.list,B.document,B.comment,B.atRule,B.rule,B.decl,B.root,B.CssSyntaxError,B.Declaration,B.Container,B.Processor,B.Document,B.Comment,B.Warning,B.AtRule,B.Result,B.Input,B.Rule,B.Root,B.Node;var vc=Object.defineProperty,Sc=(s,e,t)=>e in s?vc(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,se=(s,e,t)=>Sc(s,typeof e!="symbol"?e+"":e,t);function Cc(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}function _c(s){if(s.__esModule)return s;var e=s.default;if(typeof e=="function"){var t=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(s).forEach(function(r){var i=Object.getOwnPropertyDescriptor(s,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return s[r]}})}),t}var fs={exports:{}},U=String,En=function(){return{isColorSupported:!1,reset:U,bold:U,dim:U,italic:U,underline:U,inverse:U,hidden:U,strikethrough:U,black:U,red:U,green:U,yellow:U,blue:U,magenta:U,cyan:U,white:U,gray:U,bgBlack:U,bgRed:U,bgGreen:U,bgYellow:U,bgBlue:U,bgMagenta:U,bgCyan:U,bgWhite:U}};fs.exports=En(),fs.exports.createColors=En;var xc=fs.exports;const oe=_c(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Mn=xc,An=oe,ds=class Ba extends Error{constructor(e,t,r,i,n,o){super(e),this.name="CssSyntaxError",this.reason=e,n&&(this.file=n),i&&(this.source=i),o&&(this.plugin=o),typeof t<"u"&&typeof r<"u"&&(typeof t=="number"?(this.line=t,this.column=r):(this.line=t.line,this.column=t.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,Ba)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=Mn.isColorSupported),An&&e&&(t=An(t));let r=t.split(/\r?\n/),i=Math.max(this.line-3,0),n=Math.min(this.line+2,r.length),o=String(n).length,l,a;if(e){let{bold:u,gray:c,red:h}=Mn.createColors(!0);l=p=>u(h(p)),a=p=>c(p)}else l=a=u=>u;return r.slice(i,n).map((u,c)=>{let h=i+1+c,p=" "+(" "+h).slice(-o)+" | ";if(h===this.line){let d=a(p.replace(/\d/g," "))+u.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+a(p)+u+`
30
30
  `+d+l("^")}return" "+a(p)+u}).join(`
31
31
  `)}toString(){let e=this.showSourceCode();return e&&(e=`
32
32
 
@@ -36,27 +36,27 @@ https://www.w3ctech.com/topic/2226`));let l=t(...o);return l.postcssPlugin=e,l.p
36
36
  `,beforeComment:`
37
37
  `,beforeDecl:`
38
38
  `,beforeOpen:" ",beforeRule:`
39
- `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function Rc(s){return s[0].toUpperCase()+s.slice(1)}let ms=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,i=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?r+=e.raws.afterName:i&&(r+=" "),e.nodes)this.block(e,r+i);else{let n=(e.raws.between||"")+(t?";":"");this.builder(r+i+n,e)}}beforeAfter(e,t){let r;e.type==="decl"?r=this.raw(e,null,"beforeDecl"):e.type==="comment"?r=this.raw(e,null,"beforeComment"):t==="before"?r=this.raw(e,null,"beforeRule"):r=this.raw(e,null,"beforeClose");let i=e.parent,n=0;for(;i&&i.type!=="root";)n+=1,i=i.parent;if(r.includes(`
40
- `)){let o=this.raw(e,null,"indent");if(o.length)for(let l=0;l<n;l++)r+=o}return r}block(e,t){let r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start");let i;e.nodes&&e.nodes.length?(this.body(e),i=this.raw(e,"after")):i=this.raw(e,"after","emptyBody"),i&&this.builder(i),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let i=0;i<e.nodes.length;i++){let n=e.nodes[i],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==i||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),i=e.prop+r+this.rawValue(e,"value");e.important&&(i+=e.raws.important||" !important"),t&&(i+=";"),this.builder(i,e)}document(e){this.body(e)}raw(e,t,r){let i;if(r||(r=t),t&&(i=e.raws[t],typeof i<"u"))return i;let n=e.parent;if(r==="before"&&(!n||n.type==="root"&&n.first===e||n&&n.type==="document"))return"";if(!n)return On[r];let o=e.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[r]<"u")return o.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let l="raw"+Rc(r);this[l]?i=this[l](o,e):o.walk(a=>{if(i=a.raws[t],typeof i<"u")return!1})}return typeof i>"u"&&(i=On[r]),o.rawCache[r]=i,i}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return t=r.raws.after,t.includes(`
39
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};function Ic(s){return s[0].toUpperCase()+s.slice(1)}let ms=class{constructor(e){this.builder=e}atrule(e,t){let r="@"+e.name,i=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName<"u"?r+=e.raws.afterName:i&&(r+=" "),e.nodes)this.block(e,r+i);else{let n=(e.raws.between||"")+(t?";":"");this.builder(r+i+n,e)}}beforeAfter(e,t){let r;e.type==="decl"?r=this.raw(e,null,"beforeDecl"):e.type==="comment"?r=this.raw(e,null,"beforeComment"):t==="before"?r=this.raw(e,null,"beforeRule"):r=this.raw(e,null,"beforeClose");let i=e.parent,n=0;for(;i&&i.type!=="root";)n+=1,i=i.parent;if(r.includes(`
40
+ `)){let o=this.raw(e,null,"indent");if(o.length)for(let l=0;l<n;l++)r+=o}return r}block(e,t){let r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start");let i;e.nodes&&e.nodes.length?(this.body(e),i=this.raw(e,"after")):i=this.raw(e,"after","emptyBody"),i&&this.builder(i),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let r=this.raw(e,"semicolon");for(let i=0;i<e.nodes.length;i++){let n=e.nodes[i],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==i||r)}}comment(e){let t=this.raw(e,"left","commentLeft"),r=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+r+"*/",e)}decl(e,t){let r=this.raw(e,"between","colon"),i=e.prop+r+this.rawValue(e,"value");e.important&&(i+=e.raws.important||" !important"),t&&(i+=";"),this.builder(i,e)}document(e){this.body(e)}raw(e,t,r){let i;if(r||(r=t),t&&(i=e.raws[t],typeof i<"u"))return i;let n=e.parent;if(r==="before"&&(!n||n.type==="root"&&n.first===e||n&&n.type==="document"))return"";if(!n)return On[r];let o=e.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[r]<"u")return o.rawCache[r];if(r==="before"||r==="after")return this.beforeAfter(e,r);{let l="raw"+Ic(r);this[l]?i=this[l](o,e):o.walk(a=>{if(i=a.raws[t],typeof i<"u")return!1})}return typeof i>"u"&&(i=On[r]),o.rawCache[r]=i,i}rawBeforeClose(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length>0&&typeof r.raws.after<"u")return t=r.raws.after,t.includes(`
41
41
  `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let r;return e.walkComments(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
42
42
  `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeDecl"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeDecl(e,t){let r;return e.walkDecls(i=>{if(typeof i.raws.before<"u")return r=i.raws.before,r.includes(`
43
43
  `)&&(r=r.replace(/[^\n]+$/,"")),!1}),typeof r>"u"?r=this.raw(t,null,"beforeRule"):r&&(r=r.replace(/\S/g,"")),r}rawBeforeOpen(e){let t;return e.walk(r=>{if(r.type!=="decl"&&(t=r.raws.between,typeof t<"u"))return!1}),t}rawBeforeRule(e){let t;return e.walk(r=>{if(r.nodes&&(r.parent!==e||e.first!==r)&&typeof r.raws.before<"u")return t=r.raws.before,t.includes(`
44
44
  `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(r=>{if(typeof r.raws.between<"u")return t=r.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length===0&&(t=r.raws.after,typeof t<"u"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(r=>{let i=r.parent;if(i&&i!==e&&i.parent&&i.parent===e&&typeof r.raws.before<"u"){let n=r.raws.before.split(`
45
- `);return t=n[n.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(t=r.raws.semicolon,typeof t<"u"))return!1}),t}rawValue(e,t){let r=e[t],i=e.raws[t];return i&&i.value===r?i.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var $n=ms;ms.default=ms;let kc=$n;function gs(s,e){new kc(e).stringify(s)}var zt=gs;gs.default=gs;let{isClean:Wt,my:Ec}=st,Mc=ps,Ac=$n,Oc=zt;function ys(s,e){let t=new s.constructor;for(let r in s){if(!Object.prototype.hasOwnProperty.call(s,r)||r==="proxyCache")continue;let i=s[r],n=typeof i;r==="parent"&&n==="object"?e&&(t[r]=e):r==="source"?t[r]=i:Array.isArray(i)?t[r]=i.map(o=>ys(o,t)):(n==="object"&&i!==null&&(i=ys(i)),t[r]=i)}return t}let ws=class{constructor(e={}){this.raws={},this[Wt]=!1,this[Ec]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let r of e[t])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=ys(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:i}=this.rangeBy(t);return this.source.input.error(e,{column:i.column,line:i.line},{column:r.column,line:r.line},t)}return new Mc(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markDirty(){if(this[Wt]){this[Wt]=!1;let e=this;for(;e=e.parent;)e[Wt]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){t=this.toString();let i=t.indexOf(e.word);i!==-1&&(r=this.positionInside(i,t))}return r}positionInside(e,t){let r=t||this.toString(),i=this.source.start.column,n=this.source.start.line;for(let o=0;o<e;o++)r[o]===`
46
- `?(i=1,n+=1):i+=1;return{column:i,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let i=this.toString(),n=i.indexOf(e.word);n!==-1&&(t=this.positionInside(n,i),r=this.positionInside(n+e.word.length,i))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:typeof e.endIndex=="number"?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return new Ac().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let i of e)i===this?r=!0:r?(this.parent.insertAfter(t,i),t=i):this.parent.insertBefore(t,i);r||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let r={},i=t==null;t=t||new Map;let n=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let l=this[o];if(Array.isArray(l))r[o]=l.map(a=>typeof a=="object"&&a.toJSON?a.toJSON(null,t):a);else if(typeof l=="object"&&l.toJSON)r[o]=l.toJSON(null,t);else if(o==="source"){let a=t.get(l.input);a==null&&(a=n,t.set(l.input,n),n++),r[o]={end:l.end,inputId:a,start:l.start}}else r[o]=l}return i&&(r.inputs=[...t.keys()].map(o=>o.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Oc){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let i={node:this};for(let n in r)i[n]=r[n];return e.warn(t,i)}get proxyOf(){return this}};var Ht=ws;ws.default=ws;let $c=Ht,bs=class extends $c{constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};var jt=bs;bs.default=bs;let Nc="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Tc={nanoid:(s=21)=>{let e="",t=s;for(;t--;)e+=Nc[Math.random()*64|0];return e}};let{SourceMapConsumer:Nn,SourceMapGenerator:Tn}=oe,{existsSync:Pc,readFileSync:Dc}=oe,{dirname:vs,join:Lc}=oe;function Fc(s){return Buffer?Buffer.from(s,"base64").toString():window.atob(s)}let Ss=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,i=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=vs(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Nn(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,n=/^data:application\/json,/;if(i.test(e)||n.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||r.test(e))return Fc(e.substr(RegExp.lastMatch.length));let o=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+o)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),i=e.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,i)))}loadFile(e){if(this.root=vs(e),Pc(e))return this.mapFile=e,Dc(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let r=t(e);if(r){let i=this.loadFile(r);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(t instanceof Nn)return Tn.fromSourceMap(t).toString();if(t instanceof Tn)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=Lc(vs(e),r)),this.loadFile(r)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Pn=Ss;Ss.default=Ss;let{SourceMapConsumer:Uc,SourceMapGenerator:Bc}=oe,{fileURLToPath:Dn,pathToFileURL:Gt}=oe,{isAbsolute:Cs,resolve:_s}=oe,{nanoid:zc}=Tc,xs=oe,Ln=ps,Wc=Pn,Is=Symbol("fromOffsetCache"),Hc=!!(Uc&&Bc),Fn=!!(_s&&Cs),Vt=class{constructor(e,t={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Fn||/^\w+:\/\//.test(t.from)||Cs(t.from)?this.file=t.from:this.file=_s(t.from)),Fn&&Hc){let r=new Wc(this.css,t);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+zc(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let n,o,l;if(t&&typeof t=="object"){let u=t,c=r;if(typeof u.offset=="number"){let h=this.fromOffset(u.offset);t=h.line,r=h.col}else t=u.line,r=u.column;if(typeof c.offset=="number"){let h=this.fromOffset(c.offset);o=h.line,l=h.col}else o=c.line,l=c.column}else if(!r){let u=this.fromOffset(t);t=u.line,r=u.col}let a=this.origin(t,r,o,l);return a?n=new Ln(e,a.endLine===void 0?a.line:{column:a.column,line:a.line},a.endLine===void 0?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,i.plugin):n=new Ln(e,o===void 0?t:{column:r,line:t},o===void 0?r:{column:l,line:o},this.css,this.file,i.plugin),n.input={column:r,endColumn:l,endLine:o,line:t,source:this.css},this.file&&(Gt&&(n.input.url=Gt(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[Is])r=this[Is];else{let n=this.css.split(`
47
- `);r=new Array(n.length);let o=0;for(let l=0,a=n.length;l<a;l++)r[l]=o,o+=n[l].length+1;this[Is]=r}t=r[r.length-1];let i=0;if(e>=t)i=r.length-1;else{let n=r.length-2,o;for(;i<n;)if(o=i+(n-i>>1),e<r[o])n=o-1;else if(e>=r[o+1])i=o+1;else{i=o;break}}return{col:e-r[i]+1,line:i+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:_s(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,i){if(!this.map)return!1;let n=this.map.consumer(),o=n.originalPositionFor({column:t,line:e});if(!o.source)return!1;let l;typeof r=="number"&&(l=n.originalPositionFor({column:i,line:r}));let a;Cs(o.source)?a=Gt(o.source):a=new URL(o.source,this.map.consumer().sourceRoot||Gt(this.map.mapFile));let u={column:o.column,endColumn:l&&l.column,endLine:l&&l.line,line:o.line,url:a.toString()};if(a.protocol==="file:")if(Dn)u.file=Dn(a);else throw new Error("file: protocol is not available in this PostCSS build");let c=n.sourceContentFor(o.source);return c&&(u.source=c),u}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Yt=Vt;Vt.default=Vt,xs&&xs.registerInput&&xs.registerInput(Vt);let{SourceMapConsumer:Un,SourceMapGenerator:Zt}=oe,{dirname:Jt,relative:Bn,resolve:zn,sep:Wn}=oe,{pathToFileURL:Hn}=oe,jc=Yt,Gc=!!(Un&&Zt),Vc=!!(Jt&&zn&&Bn&&Wn);var jn=class{constructor(e,t,r,i){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=`
45
+ `);return t=n[n.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(r=>{if(r.nodes&&r.nodes.length&&r.last.type==="decl"&&(t=r.raws.semicolon,typeof t<"u"))return!1}),t}rawValue(e,t){let r=e[t],i=e.raws[t];return i&&i.value===r?i.raw:r}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var $n=ms;ms.default=ms;let Rc=$n;function gs(s,e){new Rc(e).stringify(s)}var zt=gs;gs.default=gs;let{isClean:Wt,my:kc}=st,Ec=ps,Mc=$n,Ac=zt;function ys(s,e){let t=new s.constructor;for(let r in s){if(!Object.prototype.hasOwnProperty.call(s,r)||r==="proxyCache")continue;let i=s[r],n=typeof i;r==="parent"&&n==="object"?e&&(t[r]=e):r==="source"?t[r]=i:Array.isArray(i)?t[r]=i.map(o=>ys(o,t)):(n==="object"&&i!==null&&(i=ys(i)),t[r]=i)}return t}let ws=class{constructor(e={}){this.raws={},this[Wt]=!1,this[kc]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let r of e[t])typeof r.clone=="function"?this.append(r.clone()):this.append(r)}else this[t]=e[t]}addToError(e){if(e.postcssNode=this,e.stack&&this.source&&/\n\s{4}at /.test(e.stack)){let t=this.source;e.stack=e.stack.replace(/\n\s{4}at /,`$&${t.input.from}:${t.start.line}:${t.start.column}$&`)}return e}after(e){return this.parent.insertAfter(this,e),this}assign(e={}){for(let t in e)this[t]=e[t];return this}before(e){return this.parent.insertBefore(this,e),this}cleanRaws(e){delete this.raws.before,delete this.raws.after,e||delete this.raws.between}clone(e={}){let t=ys(this);for(let r in e)t[r]=e[r];return t}cloneAfter(e={}){let t=this.clone(e);return this.parent.insertAfter(this,t),t}cloneBefore(e={}){let t=this.clone(e);return this.parent.insertBefore(this,t),t}error(e,t={}){if(this.source){let{end:r,start:i}=this.rangeBy(t);return this.source.input.error(e,{column:i.column,line:i.line},{column:r.column,line:r.line},t)}return new Ec(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markDirty(){if(this[Wt]){this[Wt]=!1;let e=this;for(;e=e.parent;)e[Wt]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let r=this.source.start;if(e.index)r=this.positionInside(e.index,t);else if(e.word){t=this.toString();let i=t.indexOf(e.word);i!==-1&&(r=this.positionInside(i,t))}return r}positionInside(e,t){let r=t||this.toString(),i=this.source.start.column,n=this.source.start.line;for(let o=0;o<e;o++)r[o]===`
46
+ `?(i=1,n+=1):i+=1;return{column:i,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},r=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let i=this.toString(),n=i.indexOf(e.word);n!==-1&&(t=this.positionInside(n,i),r=this.positionInside(n+e.word.length,i))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?r={column:e.end.column,line:e.end.line}:typeof e.endIndex=="number"?r=this.positionInside(e.endIndex):e.index&&(r=this.positionInside(e.index+1));return(r.line<t.line||r.line===t.line&&r.column<=t.column)&&(r={column:t.column+1,line:t.line}),{end:r,start:t}}raw(e,t){return new Mc().raw(this,e,t)}remove(){return this.parent&&this.parent.removeChild(this),this.parent=void 0,this}replaceWith(...e){if(this.parent){let t=this,r=!1;for(let i of e)i===this?r=!0:r?(this.parent.insertAfter(t,i),t=i):this.parent.insertBefore(t,i);r||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let r={},i=t==null;t=t||new Map;let n=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let l=this[o];if(Array.isArray(l))r[o]=l.map(a=>typeof a=="object"&&a.toJSON?a.toJSON(null,t):a);else if(typeof l=="object"&&l.toJSON)r[o]=l.toJSON(null,t);else if(o==="source"){let a=t.get(l.input);a==null&&(a=n,t.set(l.input,n),n++),r[o]={end:l.end,inputId:a,start:l.start}}else r[o]=l}return i&&(r.inputs=[...t.keys()].map(o=>o.toJSON())),r}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Ac){e.stringify&&(e=e.stringify);let t="";return e(this,r=>{t+=r}),t}warn(e,t,r){let i={node:this};for(let n in r)i[n]=r[n];return e.warn(t,i)}get proxyOf(){return this}};var Ht=ws;ws.default=ws;let Oc=Ht,bs=class extends Oc{constructor(e){e&&typeof e.value<"u"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}};var jt=bs;bs.default=bs;let $c="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Nc={nanoid:(s=21)=>{let e="",t=s;for(;t--;)e+=$c[Math.random()*64|0];return e}};let{SourceMapConsumer:Nn,SourceMapGenerator:Tn}=oe,{existsSync:Tc,readFileSync:Pc}=oe,{dirname:vs,join:Dc}=oe;function Lc(s){return Buffer?Buffer.from(s,"base64").toString():window.atob(s)}let Ss=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let r=t.map?t.map.prev:void 0,i=this.loadMap(t.from,r);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=vs(this.mapFile)),i&&(this.text=i)}consumer(){return this.consumerCache||(this.consumerCache=new Nn(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,r=/^data:application\/json;base64,/,i=/^data:application\/json;charset=utf-?8,/,n=/^data:application\/json,/;if(i.test(e)||n.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||r.test(e))return Lc(e.substr(RegExp.lastMatch.length));let o=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+o)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return typeof e!="object"?!1:typeof e.mappings=="string"||typeof e._mappings=="string"||Array.isArray(e.sections)}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let r=e.lastIndexOf(t.pop()),i=e.indexOf("*/",r);r>-1&&i>-1&&(this.annotation=this.getAnnotationURL(e.substring(r,i)))}loadFile(e){if(this.root=vs(e),Tc(e))return this.mapFile=e,Pc(e,"utf-8").toString().trim()}loadMap(e,t){if(t===!1)return!1;if(t){if(typeof t=="string")return t;if(typeof t=="function"){let r=t(e);if(r){let i=this.loadFile(r);if(!i)throw new Error("Unable to load previous source map: "+r.toString());return i}}else{if(t instanceof Nn)return Tn.fromSourceMap(t).toString();if(t instanceof Tn)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let r=this.annotation;return e&&(r=Dc(vs(e),r)),this.loadFile(r)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Pn=Ss;Ss.default=Ss;let{SourceMapConsumer:Fc,SourceMapGenerator:Uc}=oe,{fileURLToPath:Dn,pathToFileURL:Gt}=oe,{isAbsolute:Cs,resolve:_s}=oe,{nanoid:Bc}=Nc,xs=oe,Ln=ps,zc=Pn,Is=Symbol("fromOffsetCache"),Wc=!!(Fc&&Uc),Fn=!!(_s&&Cs),Vt=class{constructor(e,t={}){if(e===null||typeof e>"u"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="￾"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Fn||/^\w+:\/\//.test(t.from)||Cs(t.from)?this.file=t.from:this.file=_s(t.from)),Fn&&Wc){let r=new zc(this.css,t);if(r.text){this.map=r;let i=r.consumer().file;!this.file&&i&&(this.file=this.mapResolve(i))}}this.file||(this.id="<input css "+Bc(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,r,i={}){let n,o,l;if(t&&typeof t=="object"){let u=t,c=r;if(typeof u.offset=="number"){let h=this.fromOffset(u.offset);t=h.line,r=h.col}else t=u.line,r=u.column;if(typeof c.offset=="number"){let h=this.fromOffset(c.offset);o=h.line,l=h.col}else o=c.line,l=c.column}else if(!r){let u=this.fromOffset(t);t=u.line,r=u.col}let a=this.origin(t,r,o,l);return a?n=new Ln(e,a.endLine===void 0?a.line:{column:a.column,line:a.line},a.endLine===void 0?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,i.plugin):n=new Ln(e,o===void 0?t:{column:r,line:t},o===void 0?r:{column:l,line:o},this.css,this.file,i.plugin),n.input={column:r,endColumn:l,endLine:o,line:t,source:this.css},this.file&&(Gt&&(n.input.url=Gt(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,r;if(this[Is])r=this[Is];else{let n=this.css.split(`
47
+ `);r=new Array(n.length);let o=0;for(let l=0,a=n.length;l<a;l++)r[l]=o,o+=n[l].length+1;this[Is]=r}t=r[r.length-1];let i=0;if(e>=t)i=r.length-1;else{let n=r.length-2,o;for(;i<n;)if(o=i+(n-i>>1),e<r[o])n=o-1;else if(e>=r[o+1])i=o+1;else{i=o;break}}return{col:e-r[i]+1,line:i+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:_s(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,r,i){if(!this.map)return!1;let n=this.map.consumer(),o=n.originalPositionFor({column:t,line:e});if(!o.source)return!1;let l;typeof r=="number"&&(l=n.originalPositionFor({column:i,line:r}));let a;Cs(o.source)?a=Gt(o.source):a=new URL(o.source,this.map.consumer().sourceRoot||Gt(this.map.mapFile));let u={column:o.column,endColumn:l&&l.column,endLine:l&&l.line,line:o.line,url:a.toString()};if(a.protocol==="file:")if(Dn)u.file=Dn(a);else throw new Error("file: protocol is not available in this PostCSS build");let c=n.sourceContentFor(o.source);return c&&(u.source=c),u}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])this[t]!=null&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Yt=Vt;Vt.default=Vt,xs&&xs.registerInput&&xs.registerInput(Vt);let{SourceMapConsumer:Un,SourceMapGenerator:Zt}=oe,{dirname:Jt,relative:Bn,resolve:zn,sep:Wn}=oe,{pathToFileURL:Hn}=oe,Hc=Yt,jc=!!(Un&&Zt),Gc=!!(Jt&&zn&&Bn&&Wn);var jn=class{constructor(e,t,r,i){this.stringify=e,this.mapOpts=r.map||{},this.root=t,this.opts=r,this.css=i,this.originalCSS=i,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=`
48
48
  `;this.css.includes(`\r
49
49
  `)&&(t=`\r
50
- `),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||Jt(e.file),i;this.mapOpts.sourcesContent===!1?(i=new Un(e.text),i.sourcesContent&&(i.sourcesContent=null)):i=e.consumer(),this.map.applySourceMap(i,t,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Vc&&Gc&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Zt.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Zt({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 Zt({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},n,o;this.stringify(this.root,(l,a,u)=>{if(this.css+=l,a&&u!=="end"&&(i.generated.line=e,i.generated.column=t-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),n=l.match(/\n/g),n?(e+=n.length,o=l.lastIndexOf(`
51
- `),t=l.length-o):t+=l.length,a&&u!=="start"){let c=a.parent||{raws:{}};(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==c.last||c.raws.semicolon)&&(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=e,i.generated.column=t-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=t-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(e=>e.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Jt(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Jt(zn(r,this.mapOpts.annotation)));let i=Bn(r,e);return this.memoizedPaths.set(e,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new jc(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Hn){let r=Hn(e).toString();return this.memoizedFileURLs.set(e,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;Wn==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Yc=Ht,Rs=class extends Yc{constructor(e){super(e),this.type="comment"}};var Xt=Rs;Rs.default=Rs;let{isClean:Gn,my:Vn}=st,Yn=jt,Zn=Xt,Zc=Ht,Jn,ks,Es,Xn;function Kn(s){return s.map(e=>(e.nodes&&(e.nodes=Kn(e.nodes)),delete e.source,e))}function Qn(s){if(s[Gn]=!1,s.proxyOf.nodes)for(let e of s.proxyOf.nodes)Qn(e)}let pe=class Wa extends Zc{append(...e){for(let t of e){let r=this.normalize(t,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),r,i;for(;this.indexes[t]<this.proxyOf.nodes.length&&(r=this.indexes[t],i=e(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[t]+=1;return delete this.indexes[t],i}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...r)=>e[t](...r.map(i=>typeof i=="function"?(n,o)=>i(n.toProxy(),o):i)):t==="every"||t==="some"?r=>e[t]((i,...n)=>r(i.toProxy(),...n)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(r=>r.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let o of i)this.proxyOf.nodes.splice(r+1,0,o);let n;for(let o in this.indexes)n=this.indexes[o],r<n&&(this.indexes[o]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),i=r===0?"prepend":!1,n=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let l of n)this.proxyOf.nodes.splice(r,0,l);let o;for(let l in this.indexes)o=this.indexes[l],r<=o&&(this.indexes[l]=o+n.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=Kn(Jn(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Yn(e)]}else if(e.selector)e=[new ks(e)];else if(e.name)e=[new Es(e)];else if(e.text)e=[new Zn(e)];else throw new Error("Unknown node type in node creation");return e.map(i=>(i[Vn]||Wa.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Gn]&&Qn(i),typeof i.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(i.raws.before=t.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(i=>{t.props&&!t.props.includes(i.prop)||t.fast&&!i.value.includes(t.fast)||(i.value=i.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let i;try{i=e(t,r)}catch(n){throw t.addToError(n)}return i!==!1&&t.walk&&(i=t.walk(e)),i})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="atrule")return t(r,i)}))}walkComments(e){return this.walk((t,r)=>{if(t.type==="comment")return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="decl")return t(r,i)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&e.test(r.selector))return t(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="rule")return t(r,i)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};pe.registerParse=s=>{Jn=s},pe.registerRule=s=>{ks=s},pe.registerAtRule=s=>{Es=s},pe.registerRoot=s=>{Xn=s};var _e=pe;pe.default=pe,pe.rebuild=s=>{s.type==="atrule"?Object.setPrototypeOf(s,Es.prototype):s.type==="rule"?Object.setPrototypeOf(s,ks.prototype):s.type==="decl"?Object.setPrototypeOf(s,Yn.prototype):s.type==="comment"?Object.setPrototypeOf(s,Zn.prototype):s.type==="root"&&Object.setPrototypeOf(s,Xn.prototype),s[Vn]=!0,s.nodes&&s.nodes.forEach(e=>{pe.rebuild(e)})};let Jc=_e,qn,eo,it=class extends Jc{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new qn(new eo,this,e).stringify()}};it.registerLazyResult=s=>{qn=s},it.registerProcessor=s=>{eo=s};var Ms=it;it.default=it;let to={};var ro=function(e){to[e]||(to[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))};let As=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var so=As;As.default=As;let Xc=so,Os=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new Xc(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}};var $s=Os;Os.default=Os;const Ns=39,io=34,Kt=92,no=47,Qt=10,nt=32,qt=12,er=9,tr=13,Kc=91,Qc=93,qc=40,eh=41,th=123,rh=125,sh=59,ih=42,nh=58,oh=64,rr=/[\t\n\f\r "#'()/;[\\\]{}]/g,sr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,ah=/.[\r\n"'(/\\]/,oo=/[\da-f]/i;var lh=function(e,t={}){let r=e.css.valueOf(),i=t.ignoreErrors,n,o,l,a,u,c,h,p,d,g,m=r.length,f=0,v=[],b=[];function y(){return f}function C(N){throw e.error("Unclosed "+N,f)}function k(){return b.length===0&&f>=m}function M(N){if(b.length)return b.pop();if(f>=m)return;let L=N?N.ignoreUnclosed:!1;switch(n=r.charCodeAt(f),n){case Qt:case nt:case er:case tr:case qt:{o=f;do o+=1,n=r.charCodeAt(o);while(n===nt||n===Qt||n===er||n===tr||n===qt);g=["space",r.slice(f,o)],f=o-1;break}case Kc:case Qc:case th:case rh:case nh:case sh:case eh:{let Y=String.fromCharCode(n);g=[Y,Y,f];break}case qc:{if(p=v.length?v.pop()[1]:"",d=r.charCodeAt(f+1),p==="url"&&d!==Ns&&d!==io&&d!==nt&&d!==Qt&&d!==er&&d!==qt&&d!==tr){o=f;do{if(c=!1,o=r.indexOf(")",o+1),o===-1)if(i||L){o=f;break}else C("bracket");for(h=o;r.charCodeAt(h-1)===Kt;)h-=1,c=!c}while(c);g=["brackets",r.slice(f,o+1),f,o],f=o}else o=r.indexOf(")",f+1),a=r.slice(f,o+1),o===-1||ah.test(a)?g=["(","(",f]:(g=["brackets",a,f,o],f=o);break}case Ns:case io:{l=n===Ns?"'":'"',o=f;do{if(c=!1,o=r.indexOf(l,o+1),o===-1)if(i||L){o=f+1;break}else C("string");for(h=o;r.charCodeAt(h-1)===Kt;)h-=1,c=!c}while(c);g=["string",r.slice(f,o+1),f,o],f=o;break}case oh:{rr.lastIndex=f+1,rr.test(r),rr.lastIndex===0?o=r.length-1:o=rr.lastIndex-2,g=["at-word",r.slice(f,o+1),f,o],f=o;break}case Kt:{for(o=f,u=!0;r.charCodeAt(o+1)===Kt;)o+=1,u=!u;if(n=r.charCodeAt(o+1),u&&n!==no&&n!==nt&&n!==Qt&&n!==er&&n!==tr&&n!==qt&&(o+=1,oo.test(r.charAt(o)))){for(;oo.test(r.charAt(o+1));)o+=1;r.charCodeAt(o+1)===nt&&(o+=1)}g=["word",r.slice(f,o+1),f,o],f=o;break}default:{n===no&&r.charCodeAt(f+1)===ih?(o=r.indexOf("*/",f+2)+1,o===0&&(i||L?o=r.length:C("comment")),g=["comment",r.slice(f,o+1),f,o],f=o):(sr.lastIndex=f+1,sr.test(r),sr.lastIndex===0?o=r.length-1:o=sr.lastIndex-2,g=["word",r.slice(f,o+1),f,o],v.push(g),f=o);break}}return f++,g}function V(N){b.push(N)}return{back:V,endOfFile:k,nextToken:M,position:y}};let ao=_e,ir=class extends ao{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var Ts=ir;ir.default=ir,ao.registerAtRule(ir);let lo=_e,uo,co,Pe=class extends lo{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let i=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let n of i)n.raws.before=t.raws.before}return i}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new uo(new co,this,e).stringify()}};Pe.registerLazyResult=s=>{uo=s},Pe.registerProcessor=s=>{co=s};var ot=Pe;Pe.default=Pe,lo.registerRoot(Pe);let at={comma(s){return at.split(s,[","],!0)},space(s){let e=[" ",`
52
- `," "];return at.split(s,e)},split(s,e,t){let r=[],i="",n=!1,o=0,l=!1,a="",u=!1;for(let c of s)u?u=!1:c==="\\"?u=!0:l?c===a&&(l=!1):c==='"'||c==="'"?(l=!0,a=c):c==="("?o+=1:c===")"?o>0&&(o-=1):o===0&&e.includes(c)&&(n=!0),n?(i!==""&&r.push(i.trim()),i="",n=!1):i+=c;return(t||i!=="")&&r.push(i.trim()),r}};var ho=at;at.default=at;let fo=_e,uh=ho,nr=class extends fo{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return uh.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Ps=nr;nr.default=nr,fo.registerRule(nr);let ch=jt,hh=lh,fh=Xt,dh=Ts,ph=ot,po=Ps;const mo={empty:!0,space:!0};function mh(s){for(let e=s.length-1;e>=0;e--){let t=s[e],r=t[3]||t[2];if(r)return r}}var gh=class{constructor(e){this.input=e,this.root=new ph,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new dh;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,i,n,o=!1,l=!1,a=[],u=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(a.length>0){for(n=a.length-1,i=a[n];i&&i[0]==="space";)i=a[--n];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(t.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(t,"params",a),o&&(e=a[a.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),l&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,i;for(let n=t-1;n>=0&&(i=e[n],!(i[0]!=="space"&&(r+=1,r===2)));n--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(e){let t=0,r,i,n;for(let[o,l]of e.entries()){if(r=l,i=r[0],i==="("&&(t+=1),i===")"&&(t-=1),t===0&&i===":")if(!n)this.doubleColon(r);else{if(n[0]==="word"&&n[1]==="progid")continue;return o}n=r}return!1}comment(e){let t=new fh;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let i=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=i[2],t.raws.left=i[1],t.raws.right=i[3]}}createTokenizer(){this.tokenizer=hh(this.input)}decl(e,t){let r=new ch;this.init(r,e[0][2]);let i=e[e.length-1];for(i[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||mh(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let u=e[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let n;for(;e.length;)if(n=e.shift(),n[0]===":"){r.raws.between+=n[1];break}else n[0]==="word"&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o=[],l;for(;e.length&&(l=e[0][0],!(l!=="space"&&l!=="comment"));)o.push(e.shift());this.precheckMissedSemicolon(e);for(let u=e.length-1;u>=0;u--){if(n=e[u],n[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(e,u);c=this.spacesFromEnd(e)+c,c!==" !important"&&(r.raws.important=c);break}else if(n[1].toLowerCase()==="important"){let c=e.slice(0),h="";for(let p=u;p>0;p--){let d=c[p][0];if(h.trim().indexOf("!")===0&&d!=="space")break;h=c.pop()[1]+h}h.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=h,e=c)}if(n[0]!=="space"&&n[0]!=="comment")break}e.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=o.map(u=>u[1]).join(""),o=[]),this.raw(r,"value",o.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new po;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,i=!1,n=null,o=[],l=e[1].startsWith("--"),a=[],u=e;for(;u;){if(r=u[0],a.push(u),r==="("||r==="[")n||(n=u),o.push(r==="("?")":"]");else if(l&&i&&r==="{")n||(n=u),o.push("}");else if(o.length===0)if(r===";")if(i){this.decl(a,l);return}else break;else if(r==="{"){this.rule(a);return}else if(r==="}"){this.tokenizer.back(a.pop()),t=!0;break}else r===":"&&(i=!0);else r===o[o.length-1]&&(o.pop(),o.length===0&&(n=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&i){if(!l)for(;a.length&&(u=a[a.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,l)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,i){let n,o,l=r.length,a="",u=!0,c,h;for(let p=0;p<l;p+=1)n=r[p],o=n[0],o==="space"&&p===l-1&&!i?u=!1:o==="comment"?(h=r[p-1]?r[p-1][0]:"empty",c=r[p+1]?r[p+1][0]:"empty",!mo[h]&&!mo[c]?a.slice(-1)===","?u=!1:a+=n[1]:u=!1):a+=n[1];if(!u){let p=r.reduce((d,g)=>d+g[1],"");e.raws[t]={raw:p,value:a}}e[t]=a}rule(e){e.pop();let t=new po;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let i=t;i<e.length;i++)r+=e[i][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let yh=_e,wh=gh,bh=Yt;function or(s,e){let t=new bh(s,e),r=new wh(t);try{r.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&e&&e.from&&(/\.scss$/i.test(e.from)?i.message+=`
50
+ `),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),r=e.root||Jt(e.file),i;this.mapOpts.sourcesContent===!1?(i=new Un(e.text),i.sourcesContent&&(i.sourcesContent=null)):i=e.consumer(),this.map.applySourceMap(i,t,this.toUrl(this.path(r)))}}clearAnnotation(){if(this.mapOpts.annotation!==!1)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],e.type==="comment"&&e.text.indexOf("# sourceMappingURL=")===0&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),Gc&&jc&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(this.previous().length===1){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Zt.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Zt({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 Zt({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,r="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""},n,o;this.stringify(this.root,(l,a,u)=>{if(this.css+=l,a&&u!=="end"&&(i.generated.line=e,i.generated.column=t-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,this.map.addMapping(i))),n=l.match(/\n/g),n?(e+=n.length,o=l.lastIndexOf(`
51
+ `),t=l.length-o):t+=l.length,a&&u!=="start"){let c=a.parent||{raws:{}};(!(a.type==="decl"||a.type==="atrule"&&!a.nodes)||a!==c.last||c.raws.semicolon)&&(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=e,i.generated.column=t-2,this.map.addMapping(i)):(i.source=r,i.original.line=1,i.original.column=0,i.generated.line=e,i.generated.column=t-1,this.map.addMapping(i)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation<"u"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline<"u")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e<"u"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map<"u"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent<"u"?this.mapOpts.sourcesContent:this.previous().length?this.previous().some(e=>e.withContent()):!0}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute||e.charCodeAt(0)===60||/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let r=this.opts.to?Jt(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(r=Jt(zn(r,this.mapOpts.annotation)));let i=Bn(r,e);return this.memoizedPaths.set(e,i),i}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Hc(this.originalCSS,this.opts);e.map&&this.previousMaps.push(e.map)}return this.previousMaps}setSourcesContent(){let e={};if(this.root)this.root.walk(t=>{if(t.source){let r=t.source.input.from;if(r&&!e[r]){e[r]=!0;let i=this.usesFileUrls?this.toFileUrl(r):this.toUrl(this.path(r));this.map.setSourceContent(i,t.source.input.css)}}});else if(this.css){let t=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(t,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Hn){let r=Hn(e).toString();return this.memoizedFileURLs.set(e,r),r}else throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;Wn==="\\"&&(e=e.replace(/\\/g,"/"));let r=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,r),r}};let Vc=Ht,Rs=class extends Vc{constructor(e){super(e),this.type="comment"}};var Xt=Rs;Rs.default=Rs;let{isClean:Gn,my:Vn}=st,Yn=jt,Zn=Xt,Yc=Ht,Jn,ks,Es,Xn;function Kn(s){return s.map(e=>(e.nodes&&(e.nodes=Kn(e.nodes)),delete e.source,e))}function Qn(s){if(s[Gn]=!1,s.proxyOf.nodes)for(let e of s.proxyOf.nodes)Qn(e)}let me=class za extends Yc{append(...e){for(let t of e){let r=this.normalize(t,this.last);for(let i of r)this.proxyOf.nodes.push(i)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t=this.getIterator(),r,i;for(;this.indexes[t]<this.proxyOf.nodes.length&&(r=this.indexes[t],i=e(this.proxyOf.nodes[r],r),i!==!1);)this.indexes[t]+=1;return delete this.indexes[t],i}every(e){return this.nodes.every(e)}getIterator(){this.lastEach||(this.lastEach=0),this.indexes||(this.indexes={}),this.lastEach+=1;let e=this.lastEach;return this.indexes[e]=0,e}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:e[t]?t==="each"||typeof t=="string"&&t.startsWith("walk")?(...r)=>e[t](...r.map(i=>typeof i=="function"?(n,o)=>i(n.toProxy(),o):i)):t==="every"||t==="some"?r=>e[t]((i,...n)=>r(i.toProxy(),...n)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(r=>r.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,r){return e[t]===r||(e[t]=r,(t==="name"||t==="params"||t==="selector")&&e.markDirty()),!0}}}index(e){return typeof e=="number"?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let r=this.index(e),i=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let o of i)this.proxyOf.nodes.splice(r+1,0,o);let n;for(let o in this.indexes)n=this.indexes[o],r<n&&(this.indexes[o]=n+i.length);return this.markDirty(),this}insertBefore(e,t){let r=this.index(e),i=r===0?"prepend":!1,n=this.normalize(t,this.proxyOf.nodes[r],i).reverse();r=this.index(e);for(let l of n)this.proxyOf.nodes.splice(r,0,l);let o;for(let l in this.indexes)o=this.indexes[l],r<=o&&(this.indexes[l]=o+n.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=Kn(Jn(e).nodes);else if(typeof e>"u")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let i of e)i.parent&&i.parent.removeChild(i,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value>"u")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Yn(e)]}else if(e.selector)e=[new ks(e)];else if(e.name)e=[new Es(e)];else if(e.text)e=[new Zn(e)];else throw new Error("Unknown node type in node creation");return e.map(i=>(i[Vn]||za.rebuild(i),i=i.proxyOf,i.parent&&i.parent.removeChild(i),i[Gn]&&Qn(i),typeof i.raws.before>"u"&&t&&typeof t.raws.before<"u"&&(i.raws.before=t.raws.before.replace(/\S/g,"")),i.parent=this.proxyOf,i))}prepend(...e){e=e.reverse();for(let t of e){let r=this.normalize(t,this.first,"prepend").reverse();for(let i of r)this.proxyOf.nodes.unshift(i);for(let i in this.indexes)this.indexes[i]=this.indexes[i]+r.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);let t;for(let r in this.indexes)t=this.indexes[r],t>=e&&(this.indexes[r]=t-1);return this.markDirty(),this}replaceValues(e,t,r){return r||(r=t,t={}),this.walkDecls(i=>{t.props&&!t.props.includes(i.prop)||t.fast&&!i.value.includes(t.fast)||(i.value=i.value.replace(e,r))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,r)=>{let i;try{i=e(t,r)}catch(n){throw t.addToError(n)}return i!==!1&&t.walk&&(i=t.walk(e)),i})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="atrule"&&e.test(r.name))return t(r,i)}):this.walk((r,i)=>{if(r.type==="atrule"&&r.name===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="atrule")return t(r,i)}))}walkComments(e){return this.walk((t,r)=>{if(t.type==="comment")return e(t,r)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="decl"&&e.test(r.prop))return t(r,i)}):this.walk((r,i)=>{if(r.type==="decl"&&r.prop===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="decl")return t(r,i)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((r,i)=>{if(r.type==="rule"&&e.test(r.selector))return t(r,i)}):this.walk((r,i)=>{if(r.type==="rule"&&r.selector===e)return t(r,i)}):(t=e,this.walk((r,i)=>{if(r.type==="rule")return t(r,i)}))}get first(){if(this.proxyOf.nodes)return this.proxyOf.nodes[0]}get last(){if(this.proxyOf.nodes)return this.proxyOf.nodes[this.proxyOf.nodes.length-1]}};me.registerParse=s=>{Jn=s},me.registerRule=s=>{ks=s},me.registerAtRule=s=>{Es=s},me.registerRoot=s=>{Xn=s};var _e=me;me.default=me,me.rebuild=s=>{s.type==="atrule"?Object.setPrototypeOf(s,Es.prototype):s.type==="rule"?Object.setPrototypeOf(s,ks.prototype):s.type==="decl"?Object.setPrototypeOf(s,Yn.prototype):s.type==="comment"?Object.setPrototypeOf(s,Zn.prototype):s.type==="root"&&Object.setPrototypeOf(s,Xn.prototype),s[Vn]=!0,s.nodes&&s.nodes.forEach(e=>{me.rebuild(e)})};let Zc=_e,qn,eo,it=class extends Zc{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new qn(new eo,this,e).stringify()}};it.registerLazyResult=s=>{qn=s},it.registerProcessor=s=>{eo=s};var Ms=it;it.default=it;let to={};var ro=function(e){to[e]||(to[e]=!0,typeof console<"u"&&console.warn&&console.warn(e))};let As=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let r=t.node.rangeBy(t);this.line=r.start.line,this.column=r.start.column,this.endLine=r.end.line,this.endColumn=r.end.column}for(let r in t)this[r]=t[r]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var so=As;As.default=As;let Jc=so,Os=class{constructor(e,t,r){this.processor=e,this.messages=[],this.root=t,this.opts=r,this.css=void 0,this.map=void 0}toString(){return this.css}warn(e,t={}){t.plugin||this.lastPlugin&&this.lastPlugin.postcssPlugin&&(t.plugin=this.lastPlugin.postcssPlugin);let r=new Jc(e,t);return this.messages.push(r),r}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}};var $s=Os;Os.default=Os;const Ns=39,io=34,Kt=92,no=47,Qt=10,nt=32,qt=12,er=9,tr=13,Xc=91,Kc=93,Qc=40,qc=41,eh=123,th=125,rh=59,sh=42,ih=58,nh=64,rr=/[\t\n\f\r "#'()/;[\\\]{}]/g,sr=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,oh=/.[\r\n"'(/\\]/,oo=/[\da-f]/i;var ah=function(e,t={}){let r=e.css.valueOf(),i=t.ignoreErrors,n,o,l,a,u,c,h,p,d,g,m=r.length,f=0,v=[],b=[];function y(){return f}function C(N){throw e.error("Unclosed "+N,f)}function k(){return b.length===0&&f>=m}function M(N){if(b.length)return b.pop();if(f>=m)return;let L=N?N.ignoreUnclosed:!1;switch(n=r.charCodeAt(f),n){case Qt:case nt:case er:case tr:case qt:{o=f;do o+=1,n=r.charCodeAt(o);while(n===nt||n===Qt||n===er||n===tr||n===qt);g=["space",r.slice(f,o)],f=o-1;break}case Xc:case Kc:case eh:case th:case ih:case rh:case qc:{let Y=String.fromCharCode(n);g=[Y,Y,f];break}case Qc:{if(p=v.length?v.pop()[1]:"",d=r.charCodeAt(f+1),p==="url"&&d!==Ns&&d!==io&&d!==nt&&d!==Qt&&d!==er&&d!==qt&&d!==tr){o=f;do{if(c=!1,o=r.indexOf(")",o+1),o===-1)if(i||L){o=f;break}else C("bracket");for(h=o;r.charCodeAt(h-1)===Kt;)h-=1,c=!c}while(c);g=["brackets",r.slice(f,o+1),f,o],f=o}else o=r.indexOf(")",f+1),a=r.slice(f,o+1),o===-1||oh.test(a)?g=["(","(",f]:(g=["brackets",a,f,o],f=o);break}case Ns:case io:{l=n===Ns?"'":'"',o=f;do{if(c=!1,o=r.indexOf(l,o+1),o===-1)if(i||L){o=f+1;break}else C("string");for(h=o;r.charCodeAt(h-1)===Kt;)h-=1,c=!c}while(c);g=["string",r.slice(f,o+1),f,o],f=o;break}case nh:{rr.lastIndex=f+1,rr.test(r),rr.lastIndex===0?o=r.length-1:o=rr.lastIndex-2,g=["at-word",r.slice(f,o+1),f,o],f=o;break}case Kt:{for(o=f,u=!0;r.charCodeAt(o+1)===Kt;)o+=1,u=!u;if(n=r.charCodeAt(o+1),u&&n!==no&&n!==nt&&n!==Qt&&n!==er&&n!==tr&&n!==qt&&(o+=1,oo.test(r.charAt(o)))){for(;oo.test(r.charAt(o+1));)o+=1;r.charCodeAt(o+1)===nt&&(o+=1)}g=["word",r.slice(f,o+1),f,o],f=o;break}default:{n===no&&r.charCodeAt(f+1)===sh?(o=r.indexOf("*/",f+2)+1,o===0&&(i||L?o=r.length:C("comment")),g=["comment",r.slice(f,o+1),f,o],f=o):(sr.lastIndex=f+1,sr.test(r),sr.lastIndex===0?o=r.length-1:o=sr.lastIndex-2,g=["word",r.slice(f,o+1),f,o],v.push(g),f=o);break}}return f++,g}function V(N){b.push(N)}return{back:V,endOfFile:k,nextToken:M,position:y}};let ao=_e,ir=class extends ao{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var Ts=ir;ir.default=ir,ao.registerAtRule(ir);let lo=_e,uo,co,Pe=class extends lo{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,r){let i=super.normalize(e);if(t){if(r==="prepend")this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let n of i)n.raws.before=t.raws.before}return i}removeChild(e,t){let r=this.index(e);return!t&&r===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[r].raws.before),super.removeChild(e)}toResult(e={}){return new uo(new co,this,e).stringify()}};Pe.registerLazyResult=s=>{uo=s},Pe.registerProcessor=s=>{co=s};var ot=Pe;Pe.default=Pe,lo.registerRoot(Pe);let at={comma(s){return at.split(s,[","],!0)},space(s){let e=[" ",`
52
+ `," "];return at.split(s,e)},split(s,e,t){let r=[],i="",n=!1,o=0,l=!1,a="",u=!1;for(let c of s)u?u=!1:c==="\\"?u=!0:l?c===a&&(l=!1):c==='"'||c==="'"?(l=!0,a=c):c==="("?o+=1:c===")"?o>0&&(o-=1):o===0&&e.includes(c)&&(n=!0),n?(i!==""&&r.push(i.trim()),i="",n=!1):i+=c;return(t||i!=="")&&r.push(i.trim()),r}};var ho=at;at.default=at;let fo=_e,lh=ho,nr=class extends fo{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return lh.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,r=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(r)}};var Ps=nr;nr.default=nr,fo.registerRule(nr);let uh=jt,ch=ah,hh=Xt,fh=Ts,dh=ot,po=Ps;const mo={empty:!0,space:!0};function ph(s){for(let e=s.length-1;e>=0;e--){let t=s[e],r=t[3]||t[2];if(r)return r}}var mh=class{constructor(e){this.input=e,this.root=new dh,this.current=this.root,this.spaces="",this.semicolon=!1,this.createTokenizer(),this.root.source={input:e,start:{column:1,line:1,offset:0}}}atrule(e){let t=new fh;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let r,i,n,o=!1,l=!1,a=[],u=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),r=e[0],r==="("||r==="["?u.push(r==="("?")":"]"):r==="{"&&u.length>0?u.push("}"):r===u[u.length-1]&&u.pop(),u.length===0)if(r===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(r==="{"){l=!0;break}else if(r==="}"){if(a.length>0){for(n=a.length-1,i=a[n];i&&i[0]==="space";)i=a[--n];i&&(t.source.end=this.getPosition(i[3]||i[2]),t.source.end.offset++)}this.end(e);break}else a.push(e);else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(t.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(t,"params",a),o&&(e=a[a.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),l&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let r=0,i;for(let n=t-1;n>=0&&(i=e[n],!(i[0]!=="space"&&(r+=1,r===2)));n--);throw this.input.error("Missed semicolon",i[0]==="word"?i[3]+1:i[2])}colon(e){let t=0,r,i,n;for(let[o,l]of e.entries()){if(r=l,i=r[0],i==="("&&(t+=1),i===")"&&(t-=1),t===0&&i===":")if(!n)this.doubleColon(r);else{if(n[0]==="word"&&n[1]==="progid")continue;return o}n=r}return!1}comment(e){let t=new hh;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let r=e[1].slice(2,-2);if(/^\s*$/.test(r))t.text="",t.raws.left=r,t.raws.right="";else{let i=r.match(/^(\s*)([^]*\S)(\s*)$/);t.text=i[2],t.raws.left=i[1],t.raws.right=i[3]}}createTokenizer(){this.tokenizer=ch(this.input)}decl(e,t){let r=new uh;this.init(r,e[0][2]);let i=e[e.length-1];for(i[0]===";"&&(this.semicolon=!0,e.pop()),r.source.end=this.getPosition(i[3]||i[2]||ph(e)),r.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),r.raws.before+=e.shift()[1];for(r.source.start=this.getPosition(e[0][2]),r.prop="";e.length;){let u=e[0][0];if(u===":"||u==="space"||u==="comment")break;r.prop+=e.shift()[1]}r.raws.between="";let n;for(;e.length;)if(n=e.shift(),n[0]===":"){r.raws.between+=n[1];break}else n[0]==="word"&&/\w/.test(n[1])&&this.unknownWord([n]),r.raws.between+=n[1];(r.prop[0]==="_"||r.prop[0]==="*")&&(r.raws.before+=r.prop[0],r.prop=r.prop.slice(1));let o=[],l;for(;e.length&&(l=e[0][0],!(l!=="space"&&l!=="comment"));)o.push(e.shift());this.precheckMissedSemicolon(e);for(let u=e.length-1;u>=0;u--){if(n=e[u],n[1].toLowerCase()==="!important"){r.important=!0;let c=this.stringFrom(e,u);c=this.spacesFromEnd(e)+c,c!==" !important"&&(r.raws.important=c);break}else if(n[1].toLowerCase()==="important"){let c=e.slice(0),h="";for(let p=u;p>0;p--){let d=c[p][0];if(h.trim().indexOf("!")===0&&d!=="space")break;h=c.pop()[1]+h}h.trim().indexOf("!")===0&&(r.important=!0,r.raws.important=h,e=c)}if(n[0]!=="space"&&n[0]!=="comment")break}e.some(u=>u[0]!=="space"&&u[0]!=="comment")&&(r.raws.between+=o.map(u=>u[1]).join(""),o=[]),this.raw(r,"value",o.concat(e),t),r.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new po;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let t=this.current.nodes[this.current.nodes.length-1];t&&t.type==="rule"&&!t.raws.ownSemicolon&&(t.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="",e.type!=="comment"&&(this.semicolon=!1)}other(e){let t=!1,r=null,i=!1,n=null,o=[],l=e[1].startsWith("--"),a=[],u=e;for(;u;){if(r=u[0],a.push(u),r==="("||r==="[")n||(n=u),o.push(r==="("?")":"]");else if(l&&i&&r==="{")n||(n=u),o.push("}");else if(o.length===0)if(r===";")if(i){this.decl(a,l);return}else break;else if(r==="{"){this.rule(a);return}else if(r==="}"){this.tokenizer.back(a.pop()),t=!0;break}else r===":"&&(i=!0);else r===o[o.length-1]&&(o.pop(),o.length===0&&(n=null));u=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&i){if(!l)for(;a.length&&(u=a[a.length-1][0],!(u!=="space"&&u!=="comment"));)this.tokenizer.back(a.pop());this.decl(a,l)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,r,i){let n,o,l=r.length,a="",u=!0,c,h;for(let p=0;p<l;p+=1)n=r[p],o=n[0],o==="space"&&p===l-1&&!i?u=!1:o==="comment"?(h=r[p-1]?r[p-1][0]:"empty",c=r[p+1]?r[p+1][0]:"empty",!mo[h]&&!mo[c]?a.slice(-1)===","?u=!1:a+=n[1]:u=!1):a+=n[1];if(!u){let p=r.reduce((d,g)=>d+g[1],"");e.raws[t]={raw:p,value:a}}e[t]=a}rule(e){e.pop();let t=new po;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)r=e.pop()[1]+r;return r}spacesAndCommentsFromStart(e){let t,r="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)r+=e.shift()[1];return r}spacesFromEnd(e){let t,r="";for(;e.length&&(t=e[e.length-1][0],t==="space");)r=e.pop()[1]+r;return r}stringFrom(e,t){let r="";for(let i=t;i<e.length;i++)r+=e[i][1];return e.splice(t,e.length-t),r}unclosedBlock(){let e=this.current.source.start;throw this.input.error("Unclosed block",e.line,e.column)}unclosedBracket(e){throw this.input.error("Unclosed bracket",{offset:e[2]},{offset:e[2]+1})}unexpectedClose(e){throw this.input.error("Unexpected }",{offset:e[2]},{offset:e[2]+1})}unknownWord(e){throw this.input.error("Unknown word",{offset:e[0][2]},{offset:e[0][2]+e[0][1].length})}unnamedAtrule(e,t){throw this.input.error("At-rule without name",{offset:t[2]},{offset:t[2]+t[1].length})}};let gh=_e,yh=mh,wh=Yt;function or(s,e){let t=new wh(s,e),r=new yh(t);try{r.parse()}catch(i){throw process.env.NODE_ENV!=="production"&&i.name==="CssSyntaxError"&&e&&e.from&&(/\.scss$/i.test(e.from)?i.message+=`
53
53
  You tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser`:/\.sass/i.test(e.from)?i.message+=`
54
54
  You tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser`:/\.less$/i.test(e.from)&&(i.message+=`
55
- You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var Ds=or;or.default=or,yh.registerParse(or);let{isClean:ce,my:vh}=st,Sh=jn,Ch=zt,_h=_e,xh=Ms,Ih=ro,go=$s,Rh=Ds,kh=ot;const Eh={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Mh={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},Ah={Once:!0,postcssPlugin:!0,prepare:!0},De=0;function lt(s){return typeof s=="object"&&typeof s.then=="function"}function yo(s){let e=!1,t=Eh[s.type];return s.type==="decl"?e=s.prop.toLowerCase():s.type==="atrule"&&(e=s.name.toLowerCase()),e&&s.append?[t,t+"-"+e,De,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:s.append?[t,De,t+"Exit"]:[t,t+"Exit"]}function wo(s){let e;return s.type==="document"?e=["Document",De,"DocumentExit"]:s.type==="root"?e=["Root",De,"RootExit"]:e=yo(s),{eventIndex:0,events:e,iterator:0,node:s,visitorIndex:0,visitors:[]}}function Ls(s){return s[ce]=!1,s.nodes&&s.nodes.forEach(e=>Ls(e)),s}let Fs={},Le=class Ha{constructor(e,t,r){this.stringified=!1,this.processed=!1;let i;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))i=Ls(t);else if(t instanceof Ha||t instanceof go)i=Ls(t.root),t.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let n=Rh;r.syntax&&(n=r.syntax.parse),r.parser&&(n=r.parser),n.parse&&(n=n.parse);try{i=n(t,r)}catch(o){this.processed=!0,this.error=o}i&&!i[vh]&&_h.rebuild(i)}this.result=new go(e,i,r),this.helpers={...Fs,postcss:Fs,result:this.result},this.plugins=this.processor.plugins.map(n=>typeof n=="object"&&n.prepare?{...n,...n.prepare(this.result)}:n)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin)e.plugin=r.postcssPlugin,e.setMessage();else if(r.postcssVersion&&process.env.NODE_ENV!=="production"){let i=r.postcssPlugin,n=r.postcssVersion,o=this.result.processor.version,l=n.split("."),a=o.split(".");(l[0]!==a[0]||parseInt(l[1])>parseInt(a[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+o+", but "+i+" uses "+n+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return e}prepareVisitors(){this.listeners={};let e=(t,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([t,i])};for(let t of this.plugins)if(typeof t=="object")for(let r in t){if(!Mh[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Ah[r])if(typeof t[r]=="object")for(let i in t[r])i==="*"?e(t,r,t[r][i]):e(t,r+"-"+i.toLowerCase(),t[r][i]);else typeof t[r]=="function"&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(lt(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ce];){e[ce]=!0;let t=[wo(e)];for(;t.length>0;){let r=this.visitTick(t);if(lt(r))try{await r}catch(i){let n=t[t.length-1].node;throw this.handleError(i,n)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let i=e.nodes.map(n=>r(n,this.helpers));await Promise.all(i)}else await r(e,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return lt(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Ch;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new Sh(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){let t=this.runOnRoot(e);if(lt(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ce];)e[ce]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return process.env.NODE_ENV!=="production"&&("from"in this.opts||Ih("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,i]of e){this.result.lastPlugin=r;let n;try{n=i(t,this.helpers)}catch(o){throw this.handleError(o,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(lt(n))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:i}=t;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(i.length>0&&t.visitorIndex<i.length){let[o,l]=i[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===i.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return l(r.toProxy(),this.helpers)}catch(a){throw this.handleError(a,r)}}if(t.iterator!==0){let o=t.iterator,l;for(;l=r.nodes[r.indexes[o]];)if(r.indexes[o]+=1,!l[ce]){l[ce]=!0,e.push(wo(l));return}t.iterator=0,delete r.indexes[o]}let n=t.events;for(;t.eventIndex<n.length;){let o=n[t.eventIndex];if(t.eventIndex+=1,o===De){r.nodes&&r.nodes.length&&(r[ce]=!0,t.iterator=r.getIterator());return}else if(this.listeners[o]){t.visitors=this.listeners[o];return}}e.pop()}walkSync(e){e[ce]=!0;let t=yo(e);for(let r of t)if(r===De)e.nodes&&e.each(i=>{i[ce]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Le.registerPostcss=s=>{Fs=s};var bo=Le;Le.default=Le,kh.registerLazyResult(Le),xh.registerLazyResult(Le);let Oh=jn,$h=zt,Nh=ro,Th=Ds;const Ph=$s;let Us=class{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let i,n=$h;this.result=new Ph(this._processor,i,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let l=new Oh(n,i,this._opts,t);if(l.isMap()){let[a,u]=l.generate();a&&(this.result.css=a),u&&(this.result.map=u)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return process.env.NODE_ENV!=="production"&&("from"in this._opts||Nh("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Th;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Dh=Us;Us.default=Us;let Lh=Dh,Fh=bo,Uh=Ms,Bh=ot,ut=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(typeof r=="object"&&(r.parse||r.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new Lh(this,e,t):new Fh(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var zh=ut;ut.default=ut,Bh.registerProcessor(ut),Uh.registerProcessor(ut);let Wh=jt,Hh=Pn,jh=Xt,Gh=Ts,Vh=Yt,Yh=ot,Zh=Ps;function ct(s,e){if(Array.isArray(s))return s.map(i=>ct(i));let{inputs:t,...r}=s;if(t){e=[];for(let i of t){let n={...i,__proto__:Vh.prototype};n.map&&(n.map={...n.map,__proto__:Hh.prototype}),e.push(n)}}if(r.nodes&&(r.nodes=s.nodes.map(i=>ct(i,e))),r.source){let{inputId:i,...n}=r.source;r.source=n,i!=null&&(r.source.input=e[i])}if(r.type==="root")return new Yh(r);if(r.type==="decl")return new Wh(r);if(r.type==="rule")return new Zh(r);if(r.type==="comment")return new jh(r);if(r.type==="atrule")return new Gh(r);throw new Error("Unknown node type: "+s.type)}var Jh=ct;ct.default=ct;let Xh=ps,vo=jt,Kh=bo,Qh=_e,Bs=zh,qh=zt,ef=Jh,So=Ms,tf=so,Co=Xt,_o=Ts,rf=$s,sf=Yt,nf=Ds,of=ho,xo=Ps,Io=ot,af=Ht;function $(...s){return s.length===1&&Array.isArray(s[0])&&(s=s[0]),new Bs(s)}$.plugin=function(e,t){let r=!1;function i(...o){console&&console.warn&&!r&&(r=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
55
+ You tried to parse Less with the standard CSS parser; try again with the postcss-less parser`)),i}return r.root}var Ds=or;or.default=or,gh.registerParse(or);let{isClean:ce,my:bh}=st,vh=jn,Sh=zt,Ch=_e,_h=Ms,xh=ro,go=$s,Ih=Ds,Rh=ot;const kh={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Eh={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},Mh={Once:!0,postcssPlugin:!0,prepare:!0},De=0;function lt(s){return typeof s=="object"&&typeof s.then=="function"}function yo(s){let e=!1,t=kh[s.type];return s.type==="decl"?e=s.prop.toLowerCase():s.type==="atrule"&&(e=s.name.toLowerCase()),e&&s.append?[t,t+"-"+e,De,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:s.append?[t,De,t+"Exit"]:[t,t+"Exit"]}function wo(s){let e;return s.type==="document"?e=["Document",De,"DocumentExit"]:s.type==="root"?e=["Root",De,"RootExit"]:e=yo(s),{eventIndex:0,events:e,iterator:0,node:s,visitorIndex:0,visitors:[]}}function Ls(s){return s[ce]=!1,s.nodes&&s.nodes.forEach(e=>Ls(e)),s}let Fs={},Le=class Wa{constructor(e,t,r){this.stringified=!1,this.processed=!1;let i;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))i=Ls(t);else if(t instanceof Wa||t instanceof go)i=Ls(t.root),t.map&&(typeof r.map>"u"&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=t.map);else{let n=Ih;r.syntax&&(n=r.syntax.parse),r.parser&&(n=r.parser),n.parse&&(n=n.parse);try{i=n(t,r)}catch(o){this.processed=!0,this.error=o}i&&!i[bh]&&Ch.rebuild(i)}this.result=new go(e,i,r),this.helpers={...Fs,postcss:Fs,result:this.result},this.plugins=this.processor.plugins.map(n=>typeof n=="object"&&n.prepare?{...n,...n.prepare(this.result)}:n)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let r=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin)e.plugin=r.postcssPlugin,e.setMessage();else if(r.postcssVersion&&process.env.NODE_ENV!=="production"){let i=r.postcssPlugin,n=r.postcssVersion,o=this.result.processor.version,l=n.split("."),a=o.split(".");(l[0]!==a[0]||parseInt(l[1])>parseInt(a[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+o+", but "+i+" uses "+n+". Perhaps this is the source of the error below.")}}catch(i){console&&console.error&&console.error(i)}return e}prepareVisitors(){this.listeners={};let e=(t,r,i)=>{this.listeners[r]||(this.listeners[r]=[]),this.listeners[r].push([t,i])};for(let t of this.plugins)if(typeof t=="object")for(let r in t){if(!Eh[r]&&/^[A-Z]/.test(r))throw new Error(`Unknown event ${r} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Mh[r])if(typeof t[r]=="object")for(let i in t[r])i==="*"?e(t,r,t[r][i]):e(t,r+"-"+i.toLowerCase(),t[r][i]);else typeof t[r]=="function"&&e(t,r,t[r])}this.hasListener=Object.keys(this.listeners).length>0}async runAsync(){this.plugin=0;for(let e=0;e<this.plugins.length;e++){let t=this.plugins[e],r=this.runOnRoot(t);if(lt(r))try{await r}catch(i){throw this.handleError(i)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ce];){e[ce]=!0;let t=[wo(e)];for(;t.length>0;){let r=this.visitTick(t);if(lt(r))try{await r}catch(i){let n=t[t.length-1].node;throw this.handleError(i,n)}}}if(this.listeners.OnceExit)for(let[t,r]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let i=e.nodes.map(n=>r(n,this.helpers));await Promise.all(i)}else await r(e,this.helpers)}catch(i){throw this.handleError(i)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if(typeof e=="object"&&e.Once){if(this.result.root.type==="document"){let t=this.result.root.nodes.map(r=>e.Once(r,this.helpers));return lt(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}else if(typeof e=="function")return e(this.result.root,this.result)}catch(t){throw this.handleError(t)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Sh;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let i=new vh(t,this.result.root,this.result.opts).generate();return this.result.css=i[0],this.result.map=i[1],this.result}sync(){if(this.error)throw this.error;if(this.processed)return this.result;if(this.processed=!0,this.processing)throw this.getAsyncError();for(let e of this.plugins){let t=this.runOnRoot(e);if(lt(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ce];)e[ce]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return process.env.NODE_ENV!=="production"&&("from"in this.opts||xh("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[r,i]of e){this.result.lastPlugin=r;let n;try{n=i(t,this.helpers)}catch(o){throw this.handleError(o,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(lt(n))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:r,visitors:i}=t;if(r.type!=="root"&&r.type!=="document"&&!r.parent){e.pop();return}if(i.length>0&&t.visitorIndex<i.length){let[o,l]=i[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===i.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return l(r.toProxy(),this.helpers)}catch(a){throw this.handleError(a,r)}}if(t.iterator!==0){let o=t.iterator,l;for(;l=r.nodes[r.indexes[o]];)if(r.indexes[o]+=1,!l[ce]){l[ce]=!0,e.push(wo(l));return}t.iterator=0,delete r.indexes[o]}let n=t.events;for(;t.eventIndex<n.length;){let o=n[t.eventIndex];if(t.eventIndex+=1,o===De){r.nodes&&r.nodes.length&&(r[ce]=!0,t.iterator=r.getIterator());return}else if(this.listeners[o]){t.visitors=this.listeners[o];return}}e.pop()}walkSync(e){e[ce]=!0;let t=yo(e);for(let r of t)if(r===De)e.nodes&&e.each(i=>{i[ce]||this.walkSync(i)});else{let i=this.listeners[r];if(i&&this.visitSync(i,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Le.registerPostcss=s=>{Fs=s};var bo=Le;Le.default=Le,Rh.registerLazyResult(Le),_h.registerLazyResult(Le);let Ah=jn,Oh=zt,$h=ro,Nh=Ds;const Th=$s;let Us=class{constructor(e,t,r){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=r,this._map=void 0;let i,n=Oh;this.result=new Th(this._processor,i,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let l=new Ah(n,i,this._opts,t);if(l.isMap()){let[a,u]=l.generate();a&&(this.result.css=a),u&&(this.result.map=u)}else l.clearAnnotation(),this.result.css=l.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return process.env.NODE_ENV!=="production"&&("from"in this._opts||$h("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Nh;try{e=t(this._css,this._opts)}catch(r){this.error=r}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Ph=Us;Us.default=Us;let Dh=Ph,Lh=bo,Fh=Ms,Uh=ot,ut=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let r of e)if(r.postcss===!0?r=r():r.postcss&&(r=r.postcss),typeof r=="object"&&Array.isArray(r.plugins))t=t.concat(r.plugins);else if(typeof r=="object"&&r.postcssPlugin)t.push(r);else if(typeof r=="function")t.push(r);else if(typeof r=="object"&&(r.parse||r.stringify)){if(process.env.NODE_ENV!=="production")throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}else throw new Error(r+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new Dh(this,e,t):new Lh(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Bh=ut;ut.default=ut,Uh.registerProcessor(ut),Fh.registerProcessor(ut);let zh=jt,Wh=Pn,Hh=Xt,jh=Ts,Gh=Yt,Vh=ot,Yh=Ps;function ct(s,e){if(Array.isArray(s))return s.map(i=>ct(i));let{inputs:t,...r}=s;if(t){e=[];for(let i of t){let n={...i,__proto__:Gh.prototype};n.map&&(n.map={...n.map,__proto__:Wh.prototype}),e.push(n)}}if(r.nodes&&(r.nodes=s.nodes.map(i=>ct(i,e))),r.source){let{inputId:i,...n}=r.source;r.source=n,i!=null&&(r.source.input=e[i])}if(r.type==="root")return new Vh(r);if(r.type==="decl")return new zh(r);if(r.type==="rule")return new Yh(r);if(r.type==="comment")return new Hh(r);if(r.type==="atrule")return new jh(r);throw new Error("Unknown node type: "+s.type)}var Zh=ct;ct.default=ct;let Jh=ps,vo=jt,Xh=bo,Kh=_e,Bs=Bh,Qh=zt,qh=Zh,So=Ms,ef=so,Co=Xt,_o=Ts,tf=$s,rf=Yt,sf=Ds,nf=ho,xo=Ps,Io=ot,of=Ht;function $(...s){return s.length===1&&Array.isArray(s[0])&&(s=s[0]),new Bs(s)}$.plugin=function(e,t){let r=!1;function i(...o){console&&console.warn&&!r&&(r=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
56
56
  https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: 里面 postcss.plugin 被弃用. 迁移指南:
57
- https://www.w3ctech.com/topic/2226`));let l=t(...o);return l.postcssPlugin=e,l.postcssVersion=new Bs().version,l}let n;return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(o,l,a){return $([i(a)]).process(o,l)},i},$.stringify=qh,$.parse=nf,$.fromJSON=ef,$.list=of,$.comment=s=>new Co(s),$.atRule=s=>new _o(s),$.decl=s=>new vo(s),$.rule=s=>new xo(s),$.root=s=>new Io(s),$.document=s=>new So(s),$.CssSyntaxError=Xh,$.Declaration=vo,$.Container=Qh,$.Processor=Bs,$.Document=So,$.Comment=Co,$.Warning=tf,$.AtRule=_o,$.Result=rf,$.Input=sf,$.Rule=xo,$.Root=Io,$.Node=af,Kh.registerPostcss($);var lf=$;$.default=$;const z=_c(lf);z.stringify,z.fromJSON,z.plugin,z.parse,z.list,z.document,z.comment,z.atRule,z.rule,z.decl,z.root,z.CssSyntaxError,z.Declaration,z.Container,z.Processor,z.Document,z.Comment,z.Warning,z.AtRule,z.Result,z.Input,z.Rule,z.Root,z.Node;class zs{constructor(...e){se(this,"parentElement",null),se(this,"parentNode",null),se(this,"ownerDocument"),se(this,"firstChild",null),se(this,"lastChild",null),se(this,"previousSibling",null),se(this,"nextSibling",null),se(this,"ELEMENT_NODE",1),se(this,"TEXT_NODE",3),se(this,"nodeType"),se(this,"nodeName"),se(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(e instanceof zs){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const Ro={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ko={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ar={},uf=()=>!!globalThis.Zone;function Ws(s){if(ar[s])return ar[s];const e=globalThis[s],t=e.prototype,r=s in Ro?Ro[s]:void 0,i=!!(r&&r.every(l=>{var a,u;return!!((u=(a=Object.getOwnPropertyDescriptor(t,l))==null?void 0:a.get)!=null&&u.toString().includes("[native code]"))})),n=s in ko?ko[s]:void 0,o=!!(n&&n.every(l=>{var a;return typeof t[l]=="function"&&((a=t[l])==null?void 0:a.toString().includes("[native code]"))}));if(i&&o&&!uf())return ar[s]=e.prototype,e.prototype;try{const l=document.createElement("iframe");document.body.appendChild(l);const a=l.contentWindow;if(!a)return e.prototype;const u=a[s].prototype;return document.body.removeChild(l),u?ar[s]=u:t}catch{return t}}const Hs={};function be(s,e,t){var r;const i=`${s}.${String(t)}`;if(Hs[i])return Hs[i].call(e);const n=Ws(s),o=(r=Object.getOwnPropertyDescriptor(n,t))==null?void 0:r.get;return o?(Hs[i]=o,o.call(e)):e[t]}const js={};function Eo(s,e,t){const r=`${s}.${String(t)}`;if(js[r])return js[r].bind(e);const n=Ws(s)[t];return typeof n!="function"?e[t]:(js[r]=n,n.bind(e))}function cf(s){return be("Node",s,"childNodes")}function hf(s){return be("Node",s,"parentNode")}function ff(s){return be("Node",s,"parentElement")}function df(s){return be("Node",s,"textContent")}function pf(s,e){return Eo("Node",s,"contains")(e)}function mf(s){return Eo("Node",s,"getRootNode")()}function gf(s){return!s||!("host"in s)?null:be("ShadowRoot",s,"host")}function yf(s){return s.styleSheets}function wf(s){return!s||!("shadowRoot"in s)?null:be("Element",s,"shadowRoot")}function bf(s,e){return be("Element",s,"querySelector")(e)}function vf(s,e){return be("Element",s,"querySelectorAll")(e)}function Mo(){return Ws("MutationObserver").constructor}const _={childNodes:cf,parentNode:hf,parentElement:ff,textContent:df,contains:pf,getRootNode:mf,host:gf,styleSheets:yf,shadowRoot:wf,querySelector:bf,querySelectorAll:vf,mutationObserver:Mo};function ee(s,e,t=document){const r={capture:!0,passive:!0};return t.addEventListener(s,e,r),()=>t.removeEventListener(s,e,r)}const Fe=`Please stop import mirror directly. Instead of that,\r
57
+ https://www.w3ctech.com/topic/2226`));let l=t(...o);return l.postcssPlugin=e,l.postcssVersion=new Bs().version,l}let n;return Object.defineProperty(i,"postcss",{get(){return n||(n=i()),n}}),i.process=function(o,l,a){return $([i(a)]).process(o,l)},i},$.stringify=Qh,$.parse=sf,$.fromJSON=qh,$.list=nf,$.comment=s=>new Co(s),$.atRule=s=>new _o(s),$.decl=s=>new vo(s),$.rule=s=>new xo(s),$.root=s=>new Io(s),$.document=s=>new So(s),$.CssSyntaxError=Jh,$.Declaration=vo,$.Container=Kh,$.Processor=Bs,$.Document=So,$.Comment=Co,$.Warning=ef,$.AtRule=_o,$.Result=tf,$.Input=rf,$.Rule=xo,$.Root=Io,$.Node=of,Xh.registerPostcss($);var af=$;$.default=$;const z=Cc(af);z.stringify,z.fromJSON,z.plugin,z.parse,z.list,z.document,z.comment,z.atRule,z.rule,z.decl,z.root,z.CssSyntaxError,z.Declaration,z.Container,z.Processor,z.Document,z.Comment,z.Warning,z.AtRule,z.Result,z.Input,z.Rule,z.Root,z.Node;class zs{constructor(...e){se(this,"parentElement",null),se(this,"parentNode",null),se(this,"ownerDocument"),se(this,"firstChild",null),se(this,"lastChild",null),se(this,"previousSibling",null),se(this,"nextSibling",null),se(this,"ELEMENT_NODE",1),se(this,"TEXT_NODE",3),se(this,"nodeType"),se(this,"nodeName"),se(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(e instanceof zs){if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0}else return!1;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const Ro={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},ko={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ar={},lf=()=>!!globalThis.Zone;function Ws(s){if(ar[s])return ar[s];const e=globalThis[s],t=e.prototype,r=s in Ro?Ro[s]:void 0,i=!!(r&&r.every(l=>{var a,u;return!!((u=(a=Object.getOwnPropertyDescriptor(t,l))==null?void 0:a.get)!=null&&u.toString().includes("[native code]"))})),n=s in ko?ko[s]:void 0,o=!!(n&&n.every(l=>{var a;return typeof t[l]=="function"&&((a=t[l])==null?void 0:a.toString().includes("[native code]"))}));if(i&&o&&!lf())return ar[s]=e.prototype,e.prototype;try{const l=document.createElement("iframe");document.body.appendChild(l);const a=l.contentWindow;if(!a)return e.prototype;const u=a[s].prototype;return document.body.removeChild(l),u?ar[s]=u:t}catch{return t}}const Hs={};function be(s,e,t){var r;const i=`${s}.${String(t)}`;if(Hs[i])return Hs[i].call(e);const n=Ws(s),o=(r=Object.getOwnPropertyDescriptor(n,t))==null?void 0:r.get;return o?(Hs[i]=o,o.call(e)):e[t]}const js={};function Eo(s,e,t){const r=`${s}.${String(t)}`;if(js[r])return js[r].bind(e);const n=Ws(s)[t];return typeof n!="function"?e[t]:(js[r]=n,n.bind(e))}function uf(s){return be("Node",s,"childNodes")}function cf(s){return be("Node",s,"parentNode")}function hf(s){return be("Node",s,"parentElement")}function ff(s){return be("Node",s,"textContent")}function df(s,e){return Eo("Node",s,"contains")(e)}function pf(s){return Eo("Node",s,"getRootNode")()}function mf(s){return!s||!("host"in s)?null:be("ShadowRoot",s,"host")}function gf(s){return s.styleSheets}function yf(s){return!s||!("shadowRoot"in s)?null:be("Element",s,"shadowRoot")}function wf(s,e){return be("Element",s,"querySelector")(e)}function bf(s,e){return be("Element",s,"querySelectorAll")(e)}function Mo(){return Ws("MutationObserver").constructor}const _={childNodes:uf,parentNode:cf,parentElement:hf,textContent:ff,contains:df,getRootNode:pf,host:mf,styleSheets:gf,shadowRoot:yf,querySelector:wf,querySelectorAll:bf,mutationObserver:Mo};function ee(s,e,t=document){const r={capture:!0,passive:!0};return t.addEventListener(s,e,r),()=>t.removeEventListener(s,e,r)}const Fe=`Please stop import mirror directly. Instead of that,\r
58
58
  now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
59
- or you can use record.mirror to access the mirror instance during recording.`;let Ao={map:{},getId(){return console.error(Fe),-1},getNode(){return console.error(Fe),null},removeNodeFromMap(){console.error(Fe)},has(){return console.error(Fe),!1},reset(){console.error(Fe)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Ao=new Proxy(Ao,{get(s,e,t){return e==="map"&&console.error(Fe),Reflect.get(s,e,t)}}));function ht(s,e,t={}){let r=null,i=0;return function(...n){const o=Date.now();!i&&t.leading===!1&&(i=o);const l=e-(o-i),a=this;l<=0||l>e?(r&&(clearTimeout(r),r=null),i=o,s.apply(a,n)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,s.apply(a,n)},l))}}function lr(s,e,t,r,i=window){const n=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(o){setTimeout(()=>{t.set.call(this,o)},0),n&&n.set&&n.set.call(this,o)}}),()=>lr(s,e,n||{},!0)}function Ue(s,e,t){try{if(!(e in s))return()=>{};const r=s[e],i=t(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),s[e]=i,()=>{s[e]=r}}catch{return()=>{}}}let ur=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(ur=()=>new Date().getTime());function Oo(s){var e,t,r,i;const n=s.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:n.documentElement.scrollLeft||(n==null?void 0:n.body)&&((e=_.parentElement(n.body))==null?void 0:e.scrollLeft)||((t=n==null?void 0:n.body)==null?void 0:t.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:(n==null?void 0:n.documentElement.scrollTop)||(n==null?void 0:n.body)&&((r=_.parentElement(n.body))==null?void 0:r.scrollTop)||((i=n==null?void 0:n.body)==null?void 0:i.scrollTop)||0}}function $o(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function No(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function To(s){return s?s.nodeType===s.ELEMENT_NODE?s:_.parentElement(s):null}function te(s,e,t,r){if(!s)return!1;const i=To(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(vt(i,e,r))return!0}catch{}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function Sf(s,e){return e.getId(s)!==-1}function Gs(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===Ze}function Po(s,e){if(Ve(s))return!1;const t=e.getId(s);if(!e.has(t))return!0;const r=_.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?Po(r,e):!0}function Vs(s){return!!s.changedTouches}function Cf(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Do(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function Lo(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function Ys(s){return s?s instanceof zs&&"shadowRoot"in s?!!s.shadowRoot:!!_.shadowRoot(s):!1}class _f{constructor(){S(this,"id",1),S(this,"styleIDMap",new WeakMap),S(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Fo(s){var e;let t=null;return"getRootNode"in s&&((e=_.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&_.host(_.getRootNode(s))&&(t=_.host(_.getRootNode(s))),t}function xf(s){let e=s,t;for(;t=Fo(e);)e=t;return e}function If(s){const e=s.ownerDocument;if(!e)return!1;const t=xf(s);return _.contains(e,t)}function Uo(s){const e=s.ownerDocument;return e?_.contains(e,s)||If(s):!1}var I=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(I||{}),x=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(x||{}),re=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(re||{}),me=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(me||{}),Be=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(Be||{}),ze=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(ze||{}),Bo=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(Bo||{});function zo(s){return"__ln"in s}class Rf{constructor(){S(this,"length",0),S(this,"head",null),S(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(t==null?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&zo(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&zo(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Wo=(s,e)=>`${s}@${e}`;class kf{constructor(){S(this,"frozen",!1),S(this,"locked",!1),S(this,"texts",[]),S(this,"attributes",[]),S(this,"attributeMap",new WeakMap),S(this,"removes",[]),S(this,"mapRemoves",[]),S(this,"movedMap",{}),S(this,"addedSet",new Set),S(this,"movedSet",new Set),S(this,"droppedSet",new Set),S(this,"removesSubTreeCache",new Set),S(this,"mutationCb"),S(this,"blockClass"),S(this,"blockSelector"),S(this,"maskTextClass"),S(this,"maskTextSelector"),S(this,"inlineStylesheet"),S(this,"maskInputOptions"),S(this,"maskTextFn"),S(this,"maskInputFn"),S(this,"keepIframeSrcFn"),S(this,"recordCanvas"),S(this,"inlineImages"),S(this,"slimDOMOptions"),S(this,"dataURLOptions"),S(this,"doc"),S(this,"mirror"),S(this,"iframeManager"),S(this,"stylesheetManager"),S(this,"shadowDomManager"),S(this,"canvasManager"),S(this,"processedNodeManager"),S(this,"unattachedDoc"),S(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),S(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new Rf,i=a=>{let u=a,c=Ze;for(;c===Ze;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},n=a=>{const u=_.parentNode(a);if(!u||!Uo(a))return;let c=!1;if(a.nodeType===Node.TEXT_NODE){const g=u.tagName;if(g==="TEXTAREA")return;g==="STYLE"&&this.addedSet.has(u)&&(c=!0)}const h=Ve(u)?this.mirror.getId(Fo(a)):this.mirror.getId(u),p=i(a);if(h===-1||p===-1)return r.addNode(a);const d=Oe(a,{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:g=>{Do(g,this.mirror)&&this.iframeManager.addIframe(g),Lo(g,this.mirror)&&this.stylesheetManager.trackLinkElement(g),Ys(a)&&this.shadowDomManager.addShadowRoot(_.shadowRoot(a),this.doc)},onIframeLoad:(g,m)=>{this.iframeManager.attachIframe(g,m),this.shadowDomManager.observeAttachShadow(g)},onStylesheetLoad:(g,m)=>{this.stylesheetManager.attachLinkElement(g,m)},cssCaptured:c});d&&(e.push({parentId:h,nextId:p,node:d}),t.add(d.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)Ho(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(_.parentNode(a))||n(a);for(const a of this.addedSet)!jo(this.droppedSet,a)&&!Ho(this.removesSubTreeCache,a,this.mirror)||jo(this.movedSet,a)?n(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){const u=this.mirror.getId(_.parentNode(o.value)),c=i(o.value);u!==-1&&c!==-1&&(a=o)}if(!a){let u=r.tail;for(;u;){const c=u;if(u=u.previous,c){const h=this.mirror.getId(_.parentNode(c.value));if(i(c.value)===-1)continue;if(h!==-1){a=c;break}else{const d=c.value,g=_.parentNode(d);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const m=_.host(g);if(this.mirror.getId(m)!==-1){a=c;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),n(a.value)}const l={texts:this.texts.map(a=>{const u=a.node,c=_.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:a.value}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{const{attributes:u}=a;if(typeof u.style=="string"){const c=JSON.stringify(a.styleDiff),h=JSON.stringify(a._unchangedStyles);c.length<u.style.length&&(c+h).split("var(").length===u.style.split("var(").length&&(u.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:u}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.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(l))}),S(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(_.childNodes(e),r=>_.textContent(r)||"").join("")}),S(this,"processMutation",e=>{if(!Gs(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=_.textContent(e.target);!te(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:Mi(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,To(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){const o=Tr(t);i=Nr({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(te(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let n=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!Ei(t.tagName,r))if(n.attributes[r]=ki(this.doc,Se(t.tagName),Se(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(const l of Array.from(t.style)){const a=t.style.getPropertyValue(l),u=t.style.getPropertyPriority(l);a!==o.style.getPropertyValue(l)||u!==o.style.getPropertyPriority(l)?u===""?n.styleDiff[l]=a:n.styleDiff[l]=[a,u]:n._unchangedStyles[l]=[a,u]}for(const l of Array.from(o.style))t.style.getPropertyValue(l)===""&&(n.styleDiff[l]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal");break}case"childList":{if(te(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=>{const r=this.mirror.getId(t),i=Ve(e.target)?this.mirror.getId(_.host(e.target)):this.mirror.getId(e.target);te(e.target,this.blockClass,this.blockSelector,!1)||Gs(t,this.mirror,this.slimDOMOptions)||!Sf(t,this.mirror)||(this.addedSet.has(t)?(Zs(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||Po(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Wo(r,i)]?Zs(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:Ve(e.target)&&Ye(e.target)?!0:void 0}),Ef(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),S(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Gs(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[Wo(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);te(e,this.blockClass,this.blockSelector,!1)||(_.childNodes(e).forEach(r=>this.genAdds(r)),Ys(e)&&_.childNodes(_.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Zs(s,e){s.delete(e),_.childNodes(e).forEach(t=>Zs(s,t))}function Ef(s,e){const t=[s];for(;t.length;){const r=t.pop();e.has(r)||(e.add(r),_.childNodes(r).forEach(i=>t.push(i)))}}function Ho(s,e,t){return s.size===0?!1:Mf(s,e)}function Mf(s,e,t){const r=_.parentNode(e);return r?s.has(r):!1}function jo(s,e){return s.size===0?!1:Go(s,e)}function Go(s,e){const t=_.parentNode(e);return t?s.has(t)?!0:Go(s,t):!1}let ft;function Af(s){ft=s}function Of(){ft=void 0}const R=s=>ft?(...t)=>{try{return s(...t)}catch(r){if(ft&&ft(r)===!0)return;throw r}}:s,xe=[];function dt(s){try{if("composedPath"in s){const e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch{}return s&&s.target}function Vo(s,e){const t=new kf;xe.push(t),t.init(s);const r=new(Mo())(R(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function $f({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};const i=typeof e.mousemove=="number"?e.mousemove:50,n=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let o=[],l;const a=ht(R(h=>{const p=Date.now()-l;s(o.map(d=>(d.timeOffset-=p,d)),h),o=[],l=null}),n),u=R(ht(R(h=>{const p=dt(h),{clientX:d,clientY:g}=Vs(h)?h.changedTouches[0]:h;l||(l=ur()),o.push({x:d,y:g,id:r.getId(p),timeOffset:ur()-l}),a(typeof DragEvent<"u"&&h instanceof DragEvent?x.Drag:h instanceof MouseEvent?x.MouseMove:x.TouchMove)}),i,{trailing:!1})),c=[ee("mousemove",u,t),ee("touchmove",u,t),ee("drag",u,t)];return R(()=>{c.forEach(h=>h())})}function Nf({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){if(n.mouseInteraction===!1)return()=>{};const o=n.mouseInteraction===!0||n.mouseInteraction===void 0?{}:n.mouseInteraction,l=[];let a=null;const u=c=>h=>{const p=dt(h);if(te(p,r,i,!0))return;let d=null,g=c;if("pointerType"in h){switch(h.pointerType){case"mouse":d=me.Mouse;break;case"touch":d=me.Touch;break;case"pen":d=me.Pen;break}d===me.Touch?re[c]===re.MouseDown?g="TouchStart":re[c]===re.MouseUp&&(g="TouchEnd"):me.Pen}else Vs(h)&&(d=me.Touch);d!==null?(a=d,(g.startsWith("Touch")&&d===me.Touch||g.startsWith("Mouse")&&d===me.Mouse)&&(d=null)):re[c]===re.Click&&(d=a,a=null);const m=Vs(h)?h.changedTouches[0]:h;if(!m)return;const f=t.getId(p),{clientX:v,clientY:b}=m;R(s)({type:re[g],id:f,x:v,y:b,...d!==null&&{pointerType:d}})};return Object.keys(re).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&o[c]!==!1).forEach(c=>{let h=Se(c);const p=u(c);if(window.PointerEvent)switch(re[c]){case re.MouseDown:case re.MouseUp:h=h.replace("mouse","pointer");break;case re.TouchStart:case re.TouchEnd:return}l.push(ee(h,p,e))}),R(()=>{l.forEach(c=>c())})}function Yo({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){const o=R(ht(R(l=>{const a=dt(l);if(!a||te(a,r,i,!0))return;const u=t.getId(a);if(a===e&&e.defaultView){const c=Oo(e.defaultView);s({id:u,x:c.left,y:c.top})}else s({id:u,x:a.scrollLeft,y:a.scrollTop})}),n.scroll||100));return ee("scroll",o,e)}function Tf({viewportResizeCb:s},{win:e}){let t=-1,r=-1;const i=R(ht(R(()=>{const n=$o(),o=No();(t!==n||r!==o)&&(s({width:Number(o),height:Number(n)}),t=n,r=o)}),200));return ee("resize",i,e)}const Pf=["INPUT","TEXTAREA","SELECT"],Zo=new WeakMap;function Df({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:n,ignoreSelector:o,maskInputOptions:l,maskInputFn:a,sampling:u,userTriggeredOnInput:c}){function h(b){let y=dt(b);const C=b.isTrusted,k=y&&y.tagName;if(y&&k==="OPTION"&&(y=_.parentElement(y)),!y||!k||Pf.indexOf(k)<0||te(y,r,i,!0)||y.classList.contains(n)||o&&y.matches(o))return;let M=y.value,V=!1;const N=Tr(y)||"";N==="radio"||N==="checkbox"?V=y.checked:(l[k.toLowerCase()]||l[N])&&(M=Nr({element:y,maskInputOptions:l,tagName:k,type:N,value:M,maskInputFn:a})),p(y,c?{text:M,isChecked:V,userTriggered:C}:{text:M,isChecked:V});const L=y.name;N==="radio"&&L&&V&&e.querySelectorAll(`input[type="radio"][name="${L}"]`).forEach(Y=>{if(Y!==y){const W=Y.value;p(Y,c?{text:W,isChecked:!V,userTriggered:!1}:{text:W,isChecked:!V})}})}function p(b,y){const C=Zo.get(b);if(!C||C.text!==y.text||C.isChecked!==y.isChecked){Zo.set(b,y);const k=t.getId(b);R(s)({...y,id:k})}}const g=(u.input==="last"?["change"]:["input","change"]).map(b=>ee(b,R(h),e)),m=e.defaultView;if(!m)return()=>{g.forEach(b=>b())};const f=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),v=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&g.push(...v.map(b=>lr(b[0],b[1],{set(){R(h)({target:this,isTrusted:!1})}},!1,m))),R(()=>{g.forEach(b=>b())})}function cr(s){const e=[];function t(r,i){if(hr("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||hr("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||hr("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||hr("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const o=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(o)}else if(r.parentStyleSheet){const o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(o)}return i}return t(s,e)}function ve(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function Lf({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:R((c,h,p)=>{const[d,g]=p,{id:m,styleId:f}=ve(h,e,t.styleMirror);return(m&&m!==-1||f&&f!==-1)&&s({id:m,styleId:f,adds:[{rule:d,index:g}]}),c.apply(h,p)})}),r.CSSStyleSheet.prototype.addRule=function(c,h,p=this.cssRules.length){const d=`${c} { ${h} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[d,p])};const n=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:R((c,h,p)=>{const[d]=p,{id:g,styleId:m}=ve(h,e,t.styleMirror);return(g&&g!==-1||m&&m!==-1)&&s({id:g,styleId:m,removes:[{index:d}]}),c.apply(h,p)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:R((c,h,p)=>{const[d]=p,{id:g,styleId:m}=ve(h,e,t.styleMirror);return(g&&g!==-1||m&&m!==-1)&&s({id:g,styleId:m,replace:d}),c.apply(h,p)})}));let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:R((c,h,p)=>{const[d]=p,{id:g,styleId:m}=ve(h,e,t.styleMirror);return(g&&g!==-1||m&&m!==-1)&&s({id:g,styleId:m,replaceSync:d}),c.apply(h,p)})}));const a={};fr("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(fr("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),fr("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),fr("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(a).forEach(([c,h])=>{u[c]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(u[c].insertRule,{apply:R((p,d,g)=>{const[m,f]=g,{id:v,styleId:b}=ve(d.parentStyleSheet,e,t.styleMirror);return(v&&v!==-1||b&&b!==-1)&&s({id:v,styleId:b,adds:[{rule:m,index:[...cr(d),f||0]}]}),p.apply(d,g)})}),h.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:R((p,d,g)=>{const[m]=g,{id:f,styleId:v}=ve(d.parentStyleSheet,e,t.styleMirror);return(f&&f!==-1||v&&v!==-1)&&s({id:f,styleId:v,removes:[{index:[...cr(d),m]}]}),p.apply(d,g)})})}),R(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=n,o&&(r.CSSStyleSheet.prototype.replace=o),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([c,h])=>{h.prototype.insertRule=u[c].insertRule,h.prototype.deleteRule=u[c].deleteRule})})}function Jo({mirror:s,stylesheetManager:e},t){var r,i,n;let o=null;t.nodeName==="#document"?o=s.getId(t):o=s.getId(_.host(t));const l=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(n=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:n.ShadowRoot,a=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!l||!a?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var u;return(u=a.get)==null?void 0:u.call(this)},set(u){var c;const h=(c=a.set)==null?void 0:c.call(this,u);if(o!==null&&o!==-1)try{e.adoptStyleSheets(u,o)}catch{}return h}}),R(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function Ff({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){const n=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:R((l,a,u)=>{var c;const[h,p,d]=u;if(t.has(h))return n.apply(a,[h,p,d]);const{id:g,styleId:m}=ve((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(g&&g!==-1||m&&m!==-1)&&s({id:g,styleId:m,set:{property:h,value:p,priority:d},index:cr(a.parentRule)}),l.apply(a,u)})});const o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:R((l,a,u)=>{var c;const[h]=u;if(t.has(h))return o.apply(a,[h]);const{id:p,styleId:d}=ve((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||d&&d!==-1)&&s({id:p,styleId:d,remove:{property:h},index:cr(a.parentRule)}),l.apply(a,u)})}),R(()=>{i.CSSStyleDeclaration.prototype.setProperty=n,i.CSSStyleDeclaration.prototype.removeProperty=o})}function Uf({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:n}){const o=R(a=>ht(R(u=>{const c=dt(u);if(!c||te(c,e,t,!0))return;const{currentTime:h,volume:p,muted:d,playbackRate:g,loop:m}=c;s({type:a,id:r.getId(c),currentTime:h,volume:p,muted:d,playbackRate:g,loop:m})}),i.media||500)),l=[ee("play",o(ze.Play),n),ee("pause",o(ze.Pause),n),ee("seeked",o(ze.Seeked),n),ee("volumechange",o(ze.VolumeChange),n),ee("ratechange",o(ze.RateChange),n)];return R(()=>{l.forEach(a=>a())})}function Bf({fontCb:s,doc:e}){const t=e.defaultView;if(!t)return()=>{};const r=[],i=new WeakMap,n=t.FontFace;t.FontFace=function(a,u,c){const h=new n(a,u,c);return i.set(h,{family:a,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),h};const o=Ue(e.fonts,"add",function(l){return function(a){return setTimeout(R(()=>{const u=i.get(a);u&&(s(u),i.delete(a))}),0),l.apply(this,[a])}});return r.push(()=>{t.FontFace=n}),r.push(o),R(()=>{r.forEach(l=>l())})}function zf(s){const{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:n}=s;let o=!0;const l=R(()=>{const a=e.getSelection();if(!a||o&&(a!=null&&a.isCollapsed))return;o=a.isCollapsed||!1;const u=[],c=a.rangeCount||0;for(let h=0;h<c;h++){const p=a.getRangeAt(h),{startContainer:d,startOffset:g,endContainer:m,endOffset:f}=p;te(d,r,i,!0)||te(m,r,i,!0)||u.push({start:t.getId(d),startOffset:g,end:t.getId(m),endOffset:f})}n({ranges:u})});return l(),ee("selectionchange",l)}function Wf({doc:s,customElementCb:e}){const t=s.defaultView;return!t||!t.customElements?()=>{}:Ue(t.customElements,"define",function(i){return function(n,o,l){try{e({define:{name:n}})}catch{console.warn(`Custom element callback failed for ${n}`)}return i.apply(this,[n,o,l])}})}function Hf(s,e){const{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:n,viewportResizeCb:o,inputCb:l,mediaInteractionCb:a,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:p,selectionCb:d,customElementCb:g}=s;s.mutationCb=(...m)=>{e.mutation&&e.mutation(...m),t(...m)},s.mousemoveCb=(...m)=>{e.mousemove&&e.mousemove(...m),r(...m)},s.mouseInteractionCb=(...m)=>{e.mouseInteraction&&e.mouseInteraction(...m),i(...m)},s.scrollCb=(...m)=>{e.scroll&&e.scroll(...m),n(...m)},s.viewportResizeCb=(...m)=>{e.viewportResize&&e.viewportResize(...m),o(...m)},s.inputCb=(...m)=>{e.input&&e.input(...m),l(...m)},s.mediaInteractionCb=(...m)=>{e.mediaInteaction&&e.mediaInteaction(...m),a(...m)},s.styleSheetRuleCb=(...m)=>{e.styleSheetRule&&e.styleSheetRule(...m),u(...m)},s.styleDeclarationCb=(...m)=>{e.styleDeclaration&&e.styleDeclaration(...m),c(...m)},s.canvasMutationCb=(...m)=>{e.canvasMutation&&e.canvasMutation(...m),h(...m)},s.fontCb=(...m)=>{e.font&&e.font(...m),p(...m)},s.selectionCb=(...m)=>{e.selection&&e.selection(...m),d(...m)},s.customElementCb=(...m)=>{e.customElement&&e.customElement(...m),g(...m)}}function jf(s,e={}){const t=s.doc.defaultView;if(!t)return()=>{};Hf(s,e);let r;s.recordDOM&&(r=Vo(s,s.doc));const i=$f(s),n=Nf(s),o=Yo(s),l=Tf(s,{win:t}),a=Df(s),u=Uf(s);let c=()=>{},h=()=>{},p=()=>{},d=()=>{};s.recordDOM&&(c=Lf(s,{win:t}),h=Jo(s,s.doc),p=Ff(s,{win:t}),s.collectFonts&&(d=Bf(s)));const g=zf(s),m=Wf(s),f=[];for(const v of s.plugins)f.push(v.observer(v.callback,t,v.options));return R(()=>{xe.forEach(v=>v.reset()),r==null||r.disconnect(),i(),n(),o(),l(),a(),u(),c(),h(),p(),d(),g(),m(),f.forEach(v=>v())})}function hr(s){return typeof window[s]<"u"}function fr(s){return!!(typeof window[s]<"u"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}class Xo{constructor(e){S(this,"iframeIdToRemoteIdMap",new WeakMap),S(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){const n=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e);let l=n.get(t);return l||(l=this.generateIdFn(),n.set(t,l),o.set(l,t)),l}getIds(e,t){const r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(n=>this.getId(e,n,r,i))}getRemoteId(e,t,r){const i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;const n=i.get(t);return n||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Gf{constructor(e){S(this,"iframes",new WeakMap),S(this,"crossOriginIframeMap",new WeakMap),S(this,"crossOriginIframeMirror",new Xo(xi)),S(this,"crossOriginIframeStyleMirror"),S(this,"crossOriginIframeRootIdMap",new WeakMap),S(this,"mirror"),S(this,"mutationCb"),S(this,"wrappedEmit"),S(this,"loadListener"),S(this,"stylesheetManager"),S(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Xo(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;const i=this.crossOriginIframeMap.get(e.source);if(!i)return;const n=this.transformCrossOriginEvent(i,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case I.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:I.IncrementalSnapshot,data:{source:x.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case I.Meta:case I.Load:case I.DomContentLoaded:return!1;case I.Plugin:return t;case I.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case I.IncrementalSnapshot:switch(t.data.source){case x.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(i.node,n)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case x.Drag:case x.TouchMove:case x.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case x.ViewportResize:return!1;case x.MediaInteraction:case x.MouseInteraction:case x.Scroll:case x.CanvasMutation:case x.Input:return this.replaceIds(t.data,e,["id"]),t;case x.StyleSheetRule:case x.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case x.Font:return t;case x.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case x.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,r,i){for(const n of i)!Array.isArray(t[n])&&typeof t[n]!="number"||(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==Bo.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}}class Vf{constructor(e){S(this,"shadowDoms",new WeakSet),S(this,"mutationCb"),S(this,"scrollCb"),S(this,"bypassOptions"),S(this,"mirror"),S(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!Ye(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=Vo({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Yo({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(_.host(e))),this.restoreHandlers.push(Jo({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const r=this;this.restoreHandlers.push(Ue(e.prototype,"attachShadow",function(i){return function(n){const o=i.call(this,n),l=_.shadowRoot(this);return l&&Uo(this)&&r.addShadowRoot(l,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var We="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Yf=typeof Uint8Array>"u"?[]:new Uint8Array(256),dr=0;dr<We.length;dr++)Yf[We.charCodeAt(dr)]=dr;var Zf=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=We[e[t]>>2],i+=We[(e[t]&3)<<4|e[t+1]>>4],i+=We[(e[t+1]&15)<<2|e[t+2]>>6],i+=We[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};const Ko=new Map;function Jf(s,e){let t=Ko.get(s);return t||(t=new Map,Ko.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}const Qo=(s,e,t)=>{if(!s||!(ea(s,e)||typeof s=="object"))return;const r=s.constructor.name,i=Jf(t,r);let n=i.indexOf(s);return n===-1&&(n=i.length,i.push(s)),n};function pr(s,e,t){if(s instanceof Array)return s.map(r=>pr(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return{rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){const r=s.constructor.name,i=Zf(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[pr(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){const r=s.constructor.name,{src:i}=s;return{rr_type:r,src:i}}else if(s instanceof HTMLCanvasElement){const r="HTMLImageElement",i=s.toDataURL();return{rr_type:r,src:i}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[pr(s.data,e,t),s.width,s.height]};if(ea(s,e)||typeof s=="object"){const r=s.constructor.name,i=Qo(s,e,t);return{rr_type:r,index:i}}}}return s}const qo=(s,e,t)=>s.map(r=>pr(r,e,t)),ea=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>s instanceof e[i]);function Xf(s,e,t,r){const i=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const o of n)try{if(typeof e.CanvasRenderingContext2D.prototype[o]!="function")continue;const l=Ue(e.CanvasRenderingContext2D.prototype,o,function(a){return function(...u){return te(this.canvas,t,r,!0)||setTimeout(()=>{const c=qo(u,e,this);s(this.canvas,{type:Be["2D"],property:o,args:c})},0),a.apply(this,u)}});i.push(l)}catch{const l=lr(e.CanvasRenderingContext2D.prototype,o,{set(a){s(this.canvas,{type:Be["2D"],property:o,args:[a],setter:!0})}});i.push(l)}return()=>{i.forEach(o=>o())}}function Kf(s){return s==="experimental-webgl"?"webgl":s}function ta(s,e,t,r){const i=[];try{const n=Ue(s.HTMLCanvasElement.prototype,"getContext",function(o){return function(l,...a){if(!te(this,e,t,!0)){const u=Kf(l);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(a[0]&&typeof a[0]=="object"){const c=a[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[l,...a])}});i.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(n=>n())}}function ra(s,e,t,r,i,n){const o=[],l=Object.getOwnPropertyNames(s);for(const a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof s[a]!="function")continue;const u=Ue(s,a,function(c){return function(...h){const p=c.apply(this,h);if(Qo(p,n,this),"tagName"in this.canvas&&!te(this.canvas,r,i,!0)){const d=qo(h,n,this),g={type:e,property:a,args:d};t(this.canvas,g)}return p}});o.push(u)}catch{const u=lr(s,a,{set(c){t(this.canvas,{type:e,property:a,args:[c],setter:!0})}});o.push(u)}return o}function Qf(s,e,t,r){const i=[];return i.push(...ra(e.WebGLRenderingContext.prototype,Be.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext<"u"&&i.push(...ra(e.WebGL2RenderingContext.prototype,Be.WebGL2,s,t,r,e)),()=>{i.forEach(n=>n())}}const sa="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",qf=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),ia=typeof window<"u"&&window.Blob&&new Blob([qf(sa)],{type:"text/javascript;charset=utf-8"});function ed(s){let e;try{if(e=ia&&(window.URL||window.webkitURL).createObjectURL(ia),!e)throw"";const t=new Worker(e,{name:s==null?void 0:s.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;base64,"+sa,{name:s==null?void 0:s.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class td{constructor(e){S(this,"pendingCanvasMutations",new Map),S(this,"rafStamps",{latestId:0,invokeId:null}),S(this,"mirror"),S(this,"mutationCb"),S(this,"resetObservers"),S(this,"frozen",!1),S(this,"locked",!1),S(this,"processMutation",(a,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(u)});const{sampling:t="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t==="all"&&this.initCanvasMutationObserver(r,i,n),o&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:l})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,i,n){const o=ta(t,r,i,!0),l=new Map,a=new ed;a.onmessage=g=>{const{id:m}=g.data;if(l.set(m,!1),!("base64"in g.data))return;const{base64:f,type:v,width:b,height:y}=g.data;this.mutationCb({id:m,type:Be["2D"],commands:[{property:"clearRect",args:[0,0,b,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:f}],type:v}]},0,0]}]})};const u=1e3/e;let c=0,h;const p=()=>{const g=[];return t.document.querySelectorAll("canvas").forEach(m=>{te(m,r,i,!0)||g.push(m)}),g},d=g=>{if(c&&g-c<u){h=requestAnimationFrame(d);return}c=g,p().forEach(async m=>{var f;const v=this.mirror.getId(m);if(l.get(v)||m.width===0||m.height===0)return;if(l.set(v,!0),["webgl","webgl2"].includes(m.__context)){const y=m.getContext(m.__context);((f=y==null?void 0:y.getContextAttributes())==null?void 0:f.preserveDrawingBuffer)===!1&&y.clear(y.COLOR_BUFFER_BIT)}const b=await createImageBitmap(m);a.postMessage({id:v,bitmap:b,width:m.width,height:m.height,dataURLOptions:n.dataURLOptions},[b])}),h=requestAnimationFrame(d)};h=requestAnimationFrame(d),this.resetObservers=()=>{o(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=ta(e,t,r,!1),n=Xf(this.processMutation.bind(this),e,t,r),o=Qf(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;const i=r.map(o=>{const{type:l,...a}=o;return a}),{type:n}=r[0];this.mutationCb({id:t,type:n,commands:i}),this.pendingCanvasMutations.delete(e)}}class rd{constructor(e){S(this,"trackedLinkElements",new WeakSet),S(this,"mutationCb"),S(this,"adoptedStyleSheetCb"),S(this,"styleMirror",new _f),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;const r={id:t,styleIds:[]},i=[];for(const n of e){let o;this.styleMirror.has(n)?o=this.styleMirror.getId(n):(o=this.styleMirror.add(n),i.push({styleId:o,rules:Array.from(n.rules||CSSRule,(l,a)=>({rule:vi(l,n.href),index:a}))})),r.styleIds.push(o)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class sd{constructor(){S(this,"nodeMap",new WeakMap),S(this,"active",!1)}inOtherBuffer(e,t){const r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let H,mr,Js,gr=!1;try{if(Array.from([1],s=>s*2)[0]!==2){const s=document.createElement("iframe");document.body.appendChild(s),Array.from=((pi=s.contentWindow)==null?void 0:pi.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}const ae=hl();function pt(s={}){const{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:n=null,ignoreClass:o="rr-ignore",ignoreSelector:l=null,maskTextClass:a="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:d,maskInputFn:g,maskTextFn:m,hooks:f,packFn:v,sampling:b={},dataURLOptions:y={},mousemoveWait:C,recordDOM:k=!0,recordCanvas:M=!1,recordCrossOriginIframes:V=!1,recordAfter:N=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:L=!1,collectFonts:Y=!1,inlineImages:W=!1,plugins:Q,keepIframeSrcFn:E=()=>!1,ignoreCSSAttributes:gt=new Set([]),errorHandler:yt}=s;Af(yt);const K=V?window.parent===window:!0;let ie=!1;if(!K)try{window.parent.document&&(ie=!1)}catch{ie=!0}if(K&&!e)throw new Error("emit function is required");if(!K&&!ie)return()=>{};C!==void 0&&b.mousemove===void 0&&(b.mousemove=C),ae.reset();const Re=h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p!==void 0?p:{password:!0},he=d===!0||d==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:d==="all",headMetaDescKeywords:d==="all",headTitleMutations:d==="all"}:d||{};Cf();let Ta,hi=0;const Pa=A=>{for(const le of Q||[])le.eventProcessor&&(A=le.eventProcessor(A));return v&&!ie&&(A=v(A)),A};H=(A,le)=>{var j;const G=A;if(G.timestamp=ur(),(j=xe[0])!=null&&j.isFrozen()&&G.type!==I.FullSnapshot&&!(G.type===I.IncrementalSnapshot&&G.data.source===x.Mutation)&&xe.forEach(fe=>fe.unfreeze()),K)e==null||e(Pa(G),le);else if(ie){const fe={type:"rrweb",event:Pa(G),origin:window.location.origin,isCheckout:le};window.parent.postMessage(fe,"*")}if(G.type===I.FullSnapshot)Ta=G,hi=0;else if(G.type===I.IncrementalSnapshot){if(G.data.source===x.Mutation&&G.data.isAttachIframe)return;hi++;const fe=r&&hi>=r,P=t&&G.timestamp-Ta.timestamp>t;(fe||P)&&mr(!0)}};const kr=A=>{H({type:I.IncrementalSnapshot,data:{source:x.Mutation,...A}})},Da=A=>H({type:I.IncrementalSnapshot,data:{source:x.Scroll,...A}}),La=A=>H({type:I.IncrementalSnapshot,data:{source:x.CanvasMutation,...A}}),Xd=A=>H({type:I.IncrementalSnapshot,data:{source:x.AdoptedStyleSheet,...A}}),ke=new rd({mutationCb:kr,adoptedStyleSheetCb:Xd}),Ee=new Gf({mirror:ae,mutationCb:kr,stylesheetManager:ke,recordCrossOriginIframes:V,wrappedEmit:H});for(const A of Q||[])A.getMirror&&A.getMirror({nodeMirror:ae,crossOriginIframeMirror:Ee.crossOriginIframeMirror,crossOriginIframeStyleMirror:Ee.crossOriginIframeStyleMirror});const fi=new sd;Js=new td({recordCanvas:M,mutationCb:La,win:window,blockClass:i,blockSelector:n,mirror:ae,sampling:b.canvas,dataURLOptions:y});const Er=new Vf({mutationCb:kr,scrollCb:Da,bypassOptions:{blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:Re,dataURLOptions:y,maskTextFn:m,maskInputFn:g,recordCanvas:M,inlineImages:W,sampling:b,slimDOMOptions:he,iframeManager:Ee,stylesheetManager:ke,canvasManager:Js,keepIframeSrcFn:E,processedNodeManager:fi},mirror:ae});mr=(A=!1)=>{if(!k)return;H({type:I.Meta,data:{href:window.location.href,width:No(),height:$o()}},A),ke.reset(),Er.init(),xe.forEach(j=>j.lock());const le=Pl(document,{mirror:ae,blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:Re,maskTextFn:m,maskInputFn:g,slimDOM:he,dataURLOptions:y,recordCanvas:M,inlineImages:W,onSerialize:j=>{Do(j,ae)&&Ee.addIframe(j),Lo(j,ae)&&ke.trackLinkElement(j),Ys(j)&&Er.addShadowRoot(_.shadowRoot(j),document)},onIframeLoad:(j,G)=>{Ee.attachIframe(j,G),Er.observeAttachShadow(j)},onStylesheetLoad:(j,G)=>{ke.attachLinkElement(j,G)},keepIframeSrcFn:E});if(!le)return console.warn("Failed to snapshot the document");H({type:I.FullSnapshot,data:{node:le,initialOffset:Oo(window)}},A),xe.forEach(j=>j.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ke.adoptStyleSheets(document.adoptedStyleSheets,ae.getId(document))};try{const A=[],le=G=>{var fe;return R(jf)({mutationCb:kr,mousemoveCb:(P,di)=>H({type:I.IncrementalSnapshot,data:{source:di,positions:P}}),mouseInteractionCb:P=>H({type:I.IncrementalSnapshot,data:{source:x.MouseInteraction,...P}}),scrollCb:Da,viewportResizeCb:P=>H({type:I.IncrementalSnapshot,data:{source:x.ViewportResize,...P}}),inputCb:P=>H({type:I.IncrementalSnapshot,data:{source:x.Input,...P}}),mediaInteractionCb:P=>H({type:I.IncrementalSnapshot,data:{source:x.MediaInteraction,...P}}),styleSheetRuleCb:P=>H({type:I.IncrementalSnapshot,data:{source:x.StyleSheetRule,...P}}),styleDeclarationCb:P=>H({type:I.IncrementalSnapshot,data:{source:x.StyleDeclaration,...P}}),canvasMutationCb:La,fontCb:P=>H({type:I.IncrementalSnapshot,data:{source:x.Font,...P}}),selectionCb:P=>{H({type:I.IncrementalSnapshot,data:{source:x.Selection,...P}})},customElementCb:P=>{H({type:I.IncrementalSnapshot,data:{source:x.CustomElement,...P}})},blockClass:i,ignoreClass:o,ignoreSelector:l,maskTextClass:a,maskTextSelector:u,maskInputOptions:Re,inlineStylesheet:c,sampling:b,recordDOM:k,recordCanvas:M,inlineImages:W,userTriggeredOnInput:L,collectFonts:Y,doc:G,maskInputFn:g,maskTextFn:m,keepIframeSrcFn:E,blockSelector:n,slimDOMOptions:he,dataURLOptions:y,mirror:ae,iframeManager:Ee,stylesheetManager:ke,shadowDomManager:Er,processedNodeManager:fi,canvasManager:Js,ignoreCSSAttributes:gt,plugins:((fe=Q==null?void 0:Q.filter(P=>P.observer))==null?void 0:fe.map(P=>({observer:P.observer,options:P.options,callback:di=>H({type:I.Plugin,data:{plugin:P.name,payload:di}})})))||[]},f)};Ee.addLoadListener(G=>{try{A.push(le(G.contentDocument))}catch(fe){console.warn(fe)}});const j=()=>{mr(),A.push(le(document)),gr=!0};return document.readyState==="interactive"||document.readyState==="complete"?j():(A.push(ee("DOMContentLoaded",()=>{H({type:I.DomContentLoaded,data:{}}),N==="DOMContentLoaded"&&j()})),A.push(ee("load",()=>{H({type:I.Load,data:{}}),N==="load"&&j()},window))),()=>{A.forEach(G=>G()),fi.destroy(),gr=!1,Of()}}catch(A){console.warn(A)}}pt.addCustomEvent=(s,e)=>{if(!gr)throw new Error("please add custom event after start recording");H({type:I.Custom,data:{tag:s,payload:e}})},pt.freezePage=()=>{xe.forEach(s=>s.freeze())},pt.takeFullSnapshot=s=>{if(!gr)throw new Error("please take full snapshot after start recording");mr(s)},pt.mirror=ae;var na;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(na||(na={}));const id=['input[type="password"]','input[type="credit-card"]','input[autocomplete="cc-number"]','input[autocomplete="cc-csc"]','input[autocomplete="cc-exp"]','input[autocomplete="cc-exp-month"]','input[autocomplete="cc-exp-year"]','input[autocomplete="new-password"]','input[autocomplete="current-password"]','input[name*="password"]','input[name*="passwd"]','input[name*="secret"]','input[name*="token"]','input[name*="apikey"]','input[name*="api_key"]','input[name*="api-key"]','input[name*="credit"]','input[name*="card"]','input[name*="cvv"]','input[name*="cvc"]','input[name*="ssn"]','input[id*="password"]','input[id*="secret"]','input[id*="token"]',"[data-private]","[data-mask]","[data-sensitive]"];function nd(){return id.join(", ")}function od(){return"[data-private-text], [data-mask-text]"}function ad(s){return s.matches(nd())}function ld(s){return s?{maskAllInputs:!1,maskTextSelector:od(),maskInputOptions:{password:!0},maskInputFn:(e,t)=>ad(t)?"*".repeat(Math.min(e.length,20)):e,blockSelector:"[data-recorder-block], [data-bw-recorder-ui], #bw-recorder-root",ignoreSelector:"[data-recorder-ignore]"}:{maskAllInputs:!1,maskTextSelector:null,maskInputOptions:{}}}const ud=900*1e3,cd=30*1e3,hd=100;class fd{constructor(e){this.state="idle",this.events=[],this.stopFn=null,this.startTime=0,this.pauseTime=0,this.totalPausedDuration=0,this.chunkIndex=0,this.maxDurationTimer=null,this.chunkTimer=null,this.uploader=null,this.metadata=null,this.onEventCallback=null,this.config={...e,maxDuration:e.maxDuration??ud,maskInputs:e.maskInputs??!0}}setUploader(e){this.uploader=e}onEvent(e){this.onEventCallback=e}getState(){return this.state}getElapsedTime(){return this.state==="idle"||this.startTime===0?0:this.state==="paused"?this.pauseTime-this.startTime-this.totalPausedDuration:Date.now()-this.startTime-this.totalPausedDuration}getEvents(){return[...this.events]}async start(){var r,i;if(this.state!=="idle")throw new Error(`Cannot start recording: state is ${this.state}`);if(this.setState("recording"),this.startTime=Date.now(),this.events=[],this.chunkIndex=0,this.totalPausedDuration=0,this.metadata={url:window.location.href,userAgent:navigator.userAgent,viewport:{width:window.innerWidth,height:window.innerHeight},startedAt:this.startTime},this.uploader)try{await this.uploader.start(this.metadata)}catch(n){throw(i=(r=this.config).onError)==null||i.call(r,n),this.setState("idle"),n}const e=ld(this.config.maskInputs),t=pt({emit:n=>this.handleEvent(n),maskAllInputs:e.maskAllInputs,maskTextSelector:e.maskTextSelector??void 0,maskInputFn:e.maskInputFn,blockSelector:e.blockSelector,recordCanvas:!0,collectFonts:!0,inlineStylesheet:!0,sampling:{mousemove:!0,mouseInteraction:!0,scroll:150,input:"last"}});this.stopFn=t??null,this.maxDurationTimer=setTimeout(()=>{this.stop()},this.config.maxDuration),this.chunkTimer=setInterval(()=>{this.flushChunk()},cd)}pause(){if(this.state!=="recording")throw new Error(`Cannot pause: state is ${this.state}`);this.setState("paused"),this.pauseTime=Date.now()}resume(){if(this.state!=="paused")throw new Error(`Cannot resume: state is ${this.state}`);this.totalPausedDuration+=Date.now()-this.pauseTime,this.setState("recording")}async stop(e=[]){var t,r,i,n;if(this.state==="idle"||this.state==="stopped")return null;if(this.maxDurationTimer&&(clearTimeout(this.maxDurationTimer),this.maxDurationTimer=null),this.chunkTimer&&(clearInterval(this.chunkTimer),this.chunkTimer=null),this.stopFn&&(this.stopFn(),this.stopFn=null),this.setState("stopped"),await this.flushChunk(),this.uploader)try{const o=await this.uploader.complete(this.getElapsedTime(),this.events.length,e);return(r=(t=this.config).onComplete)==null||r.call(t,o),o}catch(o){return(n=(i=this.config).onError)==null||n.call(i,o),null}return null}handleEvent(e){var t;this.state!=="paused"&&(this.events.push(e),(t=this.onEventCallback)==null||t.call(this,e),this.events.length>=hd&&this.flushChunk())}async flushChunk(){var t,r;if(this.events.length===0||!this.uploader)return;const e={index:this.chunkIndex++,events:[...this.events],timestamp:Date.now()};this.events=[];try{await this.uploader.uploadChunk(e)}catch(i){this.events=[...e.events,...this.events],this.chunkIndex--,(r=(t=this.config).onError)==null||r.call(t,i)}}setState(e){var t,r;this.state=e,(r=(t=this.config).onStateChange)==null||r.call(t,e)}reset(){this.stop(),this.state="idle",this.events=[],this.startTime=0,this.pauseTime=0,this.totalPausedDuration=0,this.chunkIndex=0,this.metadata=null}}class dd{constructor(){this.markers=[],this.recordingStartTime=0,this.isRecording=!1,this.captureDebounceTimer=null}setStartTime(e){this.recordingStartTime=e,this.isRecording=!0}getMarkers(){return[...this.markers]}getCount(){return this.markers.length}capture(e){if(!this.isRecording||this.recordingStartTime===0)return null;const t={timestamp:Date.now()-this.recordingStartTime,eventType:e};return this.markers.push(t),console.log("[BWorlds Recorder] Screenshot marker added",{timestamp:t.timestamp,eventType:t.eventType,totalMarkers:this.markers.length}),t}captureDebounced(e,t=500){this.captureDebounceTimer&&clearTimeout(this.captureDebounceTimer),this.captureDebounceTimer=setTimeout(()=>{this.capture(e),this.captureDebounceTimer=null},t)}stop(){this.isRecording=!1,this.captureDebounceTimer&&(clearTimeout(this.captureDebounceTimer),this.captureDebounceTimer=null)}reset(){this.markers=[],this.recordingStartTime=0,this.isRecording=!1,this.captureDebounceTimer&&(clearTimeout(this.captureDebounceTimer),this.captureDebounceTimer=null)}}class pd{constructor(e){this.lastScrollY=0,this.viewportHeight=0,this.observers=[],this.isRecording=!1,this.hasInitialScreenshot=!1,this.handleScroll=()=>{if(!this.isRecording)return;const t=window.scrollY;Math.abs(t-this.lastScrollY)>this.viewportHeight*.5&&(this.lastScrollY=t,this.screenshotCapture.captureDebounced("scroll",500))},this.handleFormSubmit=t=>{this.isRecording&&this.triggerScreenshot("form_submit")},this.handleNavigation=()=>{this.isRecording&&setTimeout(()=>{this.triggerScreenshot("navigation")},500)},this.screenshotCapture=e,this.viewportHeight=window.innerHeight}start(){this.isRecording||(this.isRecording=!0,this.lastScrollY=window.scrollY,this.viewportHeight=window.innerHeight,this.hasInitialScreenshot=!1,this.setupModalDetection(),this.setupScrollDetection(),this.setupFormDetection(),this.setupNavigationDetection(),setTimeout(()=>{this.isRecording&&!this.hasInitialScreenshot&&(this.hasInitialScreenshot=!0,this.triggerScreenshot("load"))},500))}stop(){this.isRecording=!1,this.observers.forEach(e=>e.disconnect()),this.observers=[],window.removeEventListener("scroll",this.handleScroll),window.removeEventListener("popstate",this.handleNavigation)}handleRrwebEvent(e){this.isRecording&&e.type===I.IncrementalSnapshot&&e.data.source}triggerScreenshot(e){this.isRecording&&this.screenshotCapture.capture(e)}setupModalDetection(){const e=new MutationObserver(t=>{for(const r of t){if(r.type==="childList"){for(const i of r.addedNodes)if(i instanceof HTMLElement&&this.isModal(i)){setTimeout(()=>{this.triggerScreenshot("modal_open")},300);return}}if(r.type==="attributes"){const i=r.target;if(r.attributeName==="open"&&i.tagName==="DIALOG"&&i.hasAttribute("open")){setTimeout(()=>{this.triggerScreenshot("modal_open")},300);return}}}});e.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["open","aria-hidden","aria-modal"]}),this.observers.push(e)}isModal(e){if(e.tagName.toLowerCase()==="dialog"||e.getAttribute("role")==="dialog"||e.getAttribute("role")==="alertdialog"||e.getAttribute("aria-modal")==="true")return!0;const r=e.className.toLowerCase(),i=["modal","dialog","overlay","popup","lightbox"];for(const o of i)if(r.includes(o))return!0;const n=window.getComputedStyle(e);if((n.position==="fixed"||n.position==="absolute")&&parseInt(n.zIndex)>100){const o=e.getBoundingClientRect(),l=window.innerWidth*window.innerHeight;if(o.width*o.height>l*.3)return!0}return!1}setupScrollDetection(){window.addEventListener("scroll",this.handleScroll,{passive:!0})}setupFormDetection(){document.addEventListener("submit",this.handleFormSubmit,!0)}setupNavigationDetection(){window.addEventListener("popstate",this.handleNavigation);const e=history.pushState.bind(history),t=history.replaceState.bind(history);history.pushState=(...r)=>{e(...r),this.handleNavigation()},history.replaceState=(...r)=>{t(...r),this.handleNavigation()}}destroy(){this.stop(),document.removeEventListener("submit",this.handleFormSubmit,!0)}}class md{constructor(){this.recordingId="",this.sessionToken="",this.metadata=null,this.chunks=[],this.screenshotMarkers=[]}async start(e){return this.recordingId=`rec_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,this.sessionToken=`tok_${Math.random().toString(36).substr(2,16)}`,this.metadata=e,this.chunks=[],this.screenshotMarkers=[],console.log("[BWorlds Recorder] Recording started",{recordingId:this.recordingId,metadata:{url:e.url,viewport:e.viewport,startedAt:new Date(e.startedAt).toISOString()}}),{token:this.sessionToken,recordingId:this.recordingId,expiresAt:Date.now()+3600*1e3}}async uploadChunk(e){this.chunks.push(e),console.log("[BWorlds Recorder] Chunk uploaded",{recordingId:this.recordingId,chunkIndex:e.index,eventCount:e.events.length,totalEvents:this.chunks.reduce((t,r)=>t+r.events.length,0)})}async complete(e,t,r){this.screenshotMarkers=r;const i={recordingId:this.recordingId,playbackUrl:`https://app.bworlds.com/recordings/${this.recordingId}`,duration:e,eventCount:this.chunks.reduce((n,o)=>n+o.events.length,0),screenshotCount:r.length};return console.log("[BWorlds Recorder] Recording completed",{...i,metadata:this.metadata,screenshotMarkers:r.map(n=>({timestamp:n.timestamp,eventType:n.eventType}))}),console.log("[BWorlds Recorder] Recording data summary:",{chunks:this.chunks.length,screenshotMarkers:r.length,totalEvents:i.eventCount,duration:`${Math.round(e/1e3)}s`}),i}getData(){return{metadata:this.metadata,chunks:this.chunks,screenshotMarkers:this.screenshotMarkers}}}class gd{constructor(e,t){this.sessionToken="",this.recordingId="",this.apiEndpoint=e,this.apiKey=t}async start(e){const t=await fetch(`${this.apiEndpoint}/api/recordings/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({api_key:this.apiKey,metadata:{url:e.url,user_agent:e.userAgent,viewport:e.viewport}})});if(!t.ok)throw new Error(`Failed to start recording: ${t.statusText}`);const r=await t.json();return this.sessionToken=r.session_token,this.recordingId=r.recording_id,{token:r.session_token,recordingId:r.recording_id,expiresAt:r.expires_at}}async uploadChunk(e){const t=await fetch(`${this.apiEndpoint}/api/recordings/${this.recordingId}/chunk`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.sessionToken}`},body:JSON.stringify({events:e.events,chunk_index:e.index})});if(!t.ok)throw new Error(`Failed to upload chunk: ${t.statusText}`)}async complete(e,t,r){const i=await fetch(`${this.apiEndpoint}/api/recordings/${this.recordingId}/complete`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.sessionToken}`},body:JSON.stringify({duration_ms:e,event_count:t,screenshot_markers:r.map(o=>({timestamp_ms:o.timestamp,event_type:o.eventType}))})});if(!i.ok)throw new Error(`Failed to complete recording: ${i.statusText}`);const n=await i.json();return{recordingId:this.recordingId,playbackUrl:n.playback_url,duration:e,eventCount:t,screenshotCount:r.length}}}var yr,T,oa,Ie,aa,la,ua,ca,Xs,Ks,Qs,mt={},ha=[],yd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,wr=Array.isArray;function ge(s,e){for(var t in e)s[t]=e[t];return s}function qs(s){s&&s.parentNode&&s.parentNode.removeChild(s)}function wd(s,e,t){var r,i,n,o={};for(n in e)n=="key"?r=e[n]:n=="ref"?i=e[n]:o[n]=e[n];if(arguments.length>2&&(o.children=arguments.length>3?yr.call(arguments,2):t),typeof s=="function"&&s.defaultProps!=null)for(n in s.defaultProps)o[n]===void 0&&(o[n]=s.defaultProps[n]);return br(s,o,r,i,null)}function br(s,e,t,r,i){var n={type:s,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++oa,__i:-1,__u:0};return i==null&&T.vnode!=null&&T.vnode(n),n}function He(s){return s.children}function vr(s,e){this.props=s,this.context=e}function je(s,e){if(e==null)return s.__?je(s.__,s.__i+1):null;for(var t;e<s.__k.length;e++)if((t=s.__k[e])!=null&&t.__e!=null)return t.__e;return typeof s.type=="function"?je(s):null}function fa(s){var e,t;if((s=s.__)!=null&&s.__c!=null){for(s.__e=s.__c.base=null,e=0;e<s.__k.length;e++)if((t=s.__k[e])!=null&&t.__e!=null){s.__e=s.__c.base=t.__e;break}return fa(s)}}function da(s){(!s.__d&&(s.__d=!0)&&Ie.push(s)&&!Sr.__r++||aa!=T.debounceRendering)&&((aa=T.debounceRendering)||la)(Sr)}function Sr(){for(var s,e,t,r,i,n,o,l=1;Ie.length;)Ie.length>l&&Ie.sort(ua),s=Ie.shift(),l=Ie.length,s.__d&&(t=void 0,r=void 0,i=(r=(e=s).__v).__e,n=[],o=[],e.__P&&((t=ge({},r)).__v=r.__v+1,T.vnode&&T.vnode(t),ei(e.__P,t,r,e.__n,e.__P.namespaceURI,32&r.__u?[i]:null,n,i??je(r),!!(32&r.__u),o),t.__v=r.__v,t.__.__k[t.__i]=t,wa(n,t,o),r.__e=r.__=null,t.__e!=i&&fa(t)));Sr.__r=0}function pa(s,e,t,r,i,n,o,l,a,u,c){var h,p,d,g,m,f,v,b=r&&r.__k||ha,y=e.length;for(a=bd(t,e,b,a,y),h=0;h<y;h++)(d=t.__k[h])!=null&&(p=d.__i==-1?mt:b[d.__i]||mt,d.__i=h,f=ei(s,d,p,i,n,o,l,a,u,c),g=d.__e,d.ref&&p.ref!=d.ref&&(p.ref&&ri(p.ref,null,d),c.push(d.ref,d.__c||g,d)),m==null&&g!=null&&(m=g),(v=!!(4&d.__u))||p.__k===d.__k?a=ma(d,a,s,v):typeof d.type=="function"&&f!==void 0?a=f:g&&(a=g.nextSibling),d.__u&=-7);return t.__e=m,a}function bd(s,e,t,r,i){var n,o,l,a,u,c=t.length,h=c,p=0;for(s.__k=new Array(i),n=0;n<i;n++)(o=e[n])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=s.__k[n]=br(null,o,null,null,null):wr(o)?o=s.__k[n]=br(He,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=s.__k[n]=br(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):s.__k[n]=o,a=n+p,o.__=s,o.__b=s.__b+1,l=null,(u=o.__i=vd(o,t,a,h))!=-1&&(h--,(l=t[u])&&(l.__u|=2)),l==null||l.__v==null?(u==-1&&(i>c?p--:i<c&&p++),typeof o.type!="function"&&(o.__u|=4)):u!=a&&(u==a-1?p--:u==a+1?p++:(u>a?p--:p++,o.__u|=4))):s.__k[n]=null;if(h)for(n=0;n<c;n++)(l=t[n])!=null&&(2&l.__u)==0&&(l.__e==r&&(r=je(l)),va(l,l));return r}function ma(s,e,t,r){var i,n;if(typeof s.type=="function"){for(i=s.__k,n=0;i&&n<i.length;n++)i[n]&&(i[n].__=s,e=ma(i[n],e,t,r));return e}s.__e!=e&&(r&&(e&&s.type&&!e.parentNode&&(e=je(s)),t.insertBefore(s.__e,e||null)),e=s.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function vd(s,e,t,r){var i,n,o,l=s.key,a=s.type,u=e[t],c=u!=null&&(2&u.__u)==0;if(u===null&&l==null||c&&l==u.key&&a==u.type)return t;if(r>(c?1:0)){for(i=t-1,n=t+1;i>=0||n<e.length;)if((u=e[o=i>=0?i--:n++])!=null&&(2&u.__u)==0&&l==u.key&&a==u.type)return o}return-1}function ga(s,e,t){e[0]=="-"?s.setProperty(e,t??""):s[e]=t==null?"":typeof t!="number"||yd.test(e)?t:t+"px"}function Cr(s,e,t,r,i){var n,o;e:if(e=="style")if(typeof t=="string")s.style.cssText=t;else{if(typeof r=="string"&&(s.style.cssText=r=""),r)for(e in r)t&&e in t||ga(s.style,e,"");if(t)for(e in t)r&&t[e]==r[e]||ga(s.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")n=e!=(e=e.replace(ca,"$1")),o=e.toLowerCase(),e=o in s||e=="onFocusOut"||e=="onFocusIn"?o.slice(2):e.slice(2),s.l||(s.l={}),s.l[e+n]=t,t?r?t.u=r.u:(t.u=Xs,s.addEventListener(e,n?Qs:Ks,n)):s.removeEventListener(e,n?Qs:Ks,n);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in s)try{s[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?s.removeAttribute(e):s.setAttribute(e,e=="popover"&&t==1?"":t))}}function ya(s){return function(e){if(this.l){var t=this.l[e.type+s];if(e.t==null)e.t=Xs++;else if(e.t<t.u)return;return t(T.event?T.event(e):e)}}}function ei(s,e,t,r,i,n,o,l,a,u){var c,h,p,d,g,m,f,v,b,y,C,k,M,V,N,L,Y,W=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(a=!!(32&t.__u),n=[l=e.__e=t.__e]),(c=T.__b)&&c(e);e:if(typeof W=="function")try{if(v=e.props,b="prototype"in W&&W.prototype.render,y=(c=W.contextType)&&r[c.__c],C=c?y?y.props.value:c.__:r,t.__c?f=(h=e.__c=t.__c).__=h.__E:(b?e.__c=h=new W(v,C):(e.__c=h=new vr(v,C),h.constructor=W,h.render=Cd),y&&y.sub(h),h.state||(h.state={}),h.__n=r,p=h.__d=!0,h.__h=[],h._sb=[]),b&&h.__s==null&&(h.__s=h.state),b&&W.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=ge({},h.__s)),ge(h.__s,W.getDerivedStateFromProps(v,h.__s))),d=h.props,g=h.state,h.__v=e,p)b&&W.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),b&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(b&&W.getDerivedStateFromProps==null&&v!==d&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(v,C),e.__v==t.__v||!h.__e&&h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(v,h.__s,C)===!1){for(e.__v!=t.__v&&(h.props=v,h.state=h.__s,h.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(Q){Q&&(Q.__=e)}),k=0;k<h._sb.length;k++)h.__h.push(h._sb[k]);h._sb=[],h.__h.length&&o.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(v,h.__s,C),b&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(d,g,m)})}if(h.context=C,h.props=v,h.__P=s,h.__e=!1,M=T.__r,V=0,b){for(h.state=h.__s,h.__d=!1,M&&M(e),c=h.render(h.props,h.state,h.context),N=0;N<h._sb.length;N++)h.__h.push(h._sb[N]);h._sb=[]}else do h.__d=!1,M&&M(e),c=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++V<25);h.state=h.__s,h.getChildContext!=null&&(r=ge(ge({},r),h.getChildContext())),b&&!p&&h.getSnapshotBeforeUpdate!=null&&(m=h.getSnapshotBeforeUpdate(d,g)),L=c,c!=null&&c.type===He&&c.key==null&&(L=ba(c.props.children)),l=pa(s,wr(L)?L:[L],e,t,r,i,n,o,l,a,u),h.base=e.__e,e.__u&=-161,h.__h.length&&o.push(h),f&&(h.__E=h.__=null)}catch(Q){if(e.__v=null,a||n!=null)if(Q.then){for(e.__u|=a?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;n[n.indexOf(l)]=null,e.__e=l}else{for(Y=n.length;Y--;)qs(n[Y]);ti(e)}else e.__e=t.__e,e.__k=t.__k,Q.then||ti(e);T.__e(Q,e,t)}else n==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):l=e.__e=Sd(t.__e,e,t,r,i,n,o,a,u);return(c=T.diffed)&&c(e),128&e.__u?void 0:l}function ti(s){s&&s.__c&&(s.__c.__e=!0),s&&s.__k&&s.__k.forEach(ti)}function wa(s,e,t){for(var r=0;r<t.length;r++)ri(t[r],t[++r],t[++r]);T.__c&&T.__c(e,s),s.some(function(i){try{s=i.__h,i.__h=[],s.some(function(n){n.call(i)})}catch(n){T.__e(n,i.__v)}})}function ba(s){return typeof s!="object"||s==null||s.__b&&s.__b>0?s:wr(s)?s.map(ba):ge({},s)}function Sd(s,e,t,r,i,n,o,l,a){var u,c,h,p,d,g,m,f=t.props||mt,v=e.props,b=e.type;if(b=="svg"?i="http://www.w3.org/2000/svg":b=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),n!=null){for(u=0;u<n.length;u++)if((d=n[u])&&"setAttribute"in d==!!b&&(b?d.localName==b:d.nodeType==3)){s=d,n[u]=null;break}}if(s==null){if(b==null)return document.createTextNode(v);s=document.createElementNS(i,b,v.is&&v),l&&(T.__m&&T.__m(e,n),l=!1),n=null}if(b==null)f===v||l&&s.data==v||(s.data=v);else{if(n=n&&yr.call(s.childNodes),!l&&n!=null)for(f={},u=0;u<s.attributes.length;u++)f[(d=s.attributes[u]).name]=d.value;for(u in f)if(d=f[u],u!="children"){if(u=="dangerouslySetInnerHTML")h=d;else if(!(u in v)){if(u=="value"&&"defaultValue"in v||u=="checked"&&"defaultChecked"in v)continue;Cr(s,u,null,d,i)}}for(u in v)d=v[u],u=="children"?p=d:u=="dangerouslySetInnerHTML"?c=d:u=="value"?g=d:u=="checked"?m=d:l&&typeof d!="function"||f[u]===d||Cr(s,u,d,f[u],i);if(c)l||h&&(c.__html==h.__html||c.__html==s.innerHTML)||(s.innerHTML=c.__html),e.__k=[];else if(h&&(s.innerHTML=""),pa(e.type=="template"?s.content:s,wr(p)?p:[p],e,t,r,b=="foreignObject"?"http://www.w3.org/1999/xhtml":i,n,o,n?n[0]:t.__k&&je(t,0),l,a),n!=null)for(u=n.length;u--;)qs(n[u]);l||(u="value",b=="progress"&&g==null?s.removeAttribute("value"):g!=null&&(g!==s[u]||b=="progress"&&!g||b=="option"&&g!=f[u])&&Cr(s,u,g,f[u],i),u="checked",m!=null&&m!=s[u]&&Cr(s,u,m,f[u],i))}return s}function ri(s,e,t){try{if(typeof s=="function"){var r=typeof s.__u=="function";r&&s.__u(),r&&e==null||(s.__u=s(e))}else s.current=e}catch(i){T.__e(i,t)}}function va(s,e,t){var r,i;if(T.unmount&&T.unmount(s),(r=s.ref)&&(r.current&&r.current!=s.__e||ri(r,null,e)),(r=s.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(n){T.__e(n,e)}r.base=r.__P=null}if(r=s.__k)for(i=0;i<r.length;i++)r[i]&&va(r[i],e,t||typeof s.type!="function");t||qs(s.__e),s.__c=s.__=s.__e=void 0}function Cd(s,e,t){return this.constructor(s,t)}function _r(s,e,t){var r,i,n,o;e==document&&(e=document.documentElement),T.__&&T.__(s,e),i=(r=!1)?null:e.__k,n=[],o=[],ei(e,s=e.__k=wd(He,null,[s]),i||mt,mt,e.namespaceURI,i?null:e.firstChild?yr.call(e.childNodes):null,n,i?i.__e:e.firstChild,r,o),wa(n,s,o)}yr=ha.slice,T={__e:function(s,e,t,r){for(var i,n,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((n=i.constructor)&&n.getDerivedStateFromError!=null&&(i.setState(n.getDerivedStateFromError(s)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(s,r||{}),o=i.__d),o)return i.__E=i}catch(l){s=l}throw s}},oa=0,vr.prototype.setState=function(s,e){var t;t=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ge({},this.state),typeof s=="function"&&(s=s(ge({},t),this.props)),s&&ge(t,s),s!=null&&this.__v&&(e&&this._sb.push(e),da(this))},vr.prototype.forceUpdate=function(s){this.__v&&(this.__e=!0,s&&this.__h.push(s),da(this))},vr.prototype.render=He,Ie=[],la=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ua=function(s,e){return s.__v.__b-e.__v.__b},Sr.__r=0,ca=/(PointerCapture)$|Capture$/i,Xs=0,Ks=ya(!1),Qs=ya(!0);var _d=0;function w(s,e,t,r,i,n){e||(e={});var o,l,a=e;if("ref"in a)for(l in a={},e)l=="ref"?o=e[l]:a[l]=e[l];var u={type:s,props:a,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--_d,__i:-1,__u:0,__source:i,__self:n};if(typeof s=="function"&&(o=s.defaultProps))for(l in o)a[l]===void 0&&(a[l]=o[l]);return T.vnode&&T.vnode(u),u}const si="bw-recorder-styles",xd=`
59
+ or you can use record.mirror to access the mirror instance during recording.`;let Ao={map:{},getId(){return console.error(Fe),-1},getNode(){return console.error(Fe),null},removeNodeFromMap(){console.error(Fe)},has(){return console.error(Fe),!1},reset(){console.error(Fe)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Ao=new Proxy(Ao,{get(s,e,t){return e==="map"&&console.error(Fe),Reflect.get(s,e,t)}}));function ht(s,e,t={}){let r=null,i=0;return function(...n){const o=Date.now();!i&&t.leading===!1&&(i=o);const l=e-(o-i),a=this;l<=0||l>e?(r&&(clearTimeout(r),r=null),i=o,s.apply(a,n)):!r&&t.trailing!==!1&&(r=setTimeout(()=>{i=t.leading===!1?0:Date.now(),r=null,s.apply(a,n)},l))}}function lr(s,e,t,r,i=window){const n=i.Object.getOwnPropertyDescriptor(s,e);return i.Object.defineProperty(s,e,r?t:{set(o){setTimeout(()=>{t.set.call(this,o)},0),n&&n.set&&n.set.call(this,o)}}),()=>lr(s,e,n||{},!0)}function Ue(s,e,t){try{if(!(e in s))return()=>{};const r=s[e],i=t(r);return typeof i=="function"&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__rrweb_original__:{enumerable:!1,value:r}})),s[e]=i,()=>{s[e]=r}}catch{return()=>{}}}let ur=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(ur=()=>new Date().getTime());function Oo(s){var e,t,r,i;const n=s.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:s.pageXOffset!==void 0?s.pageXOffset:n.documentElement.scrollLeft||(n==null?void 0:n.body)&&((e=_.parentElement(n.body))==null?void 0:e.scrollLeft)||((t=n==null?void 0:n.body)==null?void 0:t.scrollLeft)||0,top:n.scrollingElement?n.scrollingElement.scrollTop:s.pageYOffset!==void 0?s.pageYOffset:(n==null?void 0:n.documentElement.scrollTop)||(n==null?void 0:n.body)&&((r=_.parentElement(n.body))==null?void 0:r.scrollTop)||((i=n==null?void 0:n.body)==null?void 0:i.scrollTop)||0}}function $o(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function No(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function To(s){return s?s.nodeType===s.ELEMENT_NODE?s:_.parentElement(s):null}function te(s,e,t,r){if(!s)return!1;const i=To(s);if(!i)return!1;try{if(typeof e=="string"){if(i.classList.contains(e)||r&&i.closest("."+e)!==null)return!0}else if(vt(i,e,r))return!0}catch{}return!!(t&&(i.matches(t)||r&&i.closest(t)!==null))}function vf(s,e){return e.getId(s)!==-1}function Gs(s,e,t){return s.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(s)===Ze}function Po(s,e){if(Ve(s))return!1;const t=e.getId(s);if(!e.has(t))return!0;const r=_.parentNode(s);return r&&r.nodeType===s.DOCUMENT_NODE?!1:r?Po(r,e):!0}function Vs(s){return!!s.changedTouches}function Sf(s=window){"NodeList"in s&&!s.NodeList.prototype.forEach&&(s.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in s&&!s.DOMTokenList.prototype.forEach&&(s.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function Do(s,e){return!!(s.nodeName==="IFRAME"&&e.getMeta(s))}function Lo(s,e){return!!(s.nodeName==="LINK"&&s.nodeType===s.ELEMENT_NODE&&s.getAttribute&&s.getAttribute("rel")==="stylesheet"&&e.getMeta(s))}function Ys(s){return s?s instanceof zs&&"shadowRoot"in s?!!s.shadowRoot:!!_.shadowRoot(s):!1}class Cf{constructor(){S(this,"id",1),S(this,"styleIDMap",new WeakMap),S(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let r;return t===void 0?r=this.id++:r=t,this.styleIDMap.set(e,r),this.idStyleMap.set(r,e),r}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function Fo(s){var e;let t=null;return"getRootNode"in s&&((e=_.getRootNode(s))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&_.host(_.getRootNode(s))&&(t=_.host(_.getRootNode(s))),t}function _f(s){let e=s,t;for(;t=Fo(e);)e=t;return e}function xf(s){const e=s.ownerDocument;if(!e)return!1;const t=_f(s);return _.contains(e,t)}function Uo(s){const e=s.ownerDocument;return e?_.contains(e,s)||xf(s):!1}var I=(s=>(s[s.DomContentLoaded=0]="DomContentLoaded",s[s.Load=1]="Load",s[s.FullSnapshot=2]="FullSnapshot",s[s.IncrementalSnapshot=3]="IncrementalSnapshot",s[s.Meta=4]="Meta",s[s.Custom=5]="Custom",s[s.Plugin=6]="Plugin",s))(I||{}),x=(s=>(s[s.Mutation=0]="Mutation",s[s.MouseMove=1]="MouseMove",s[s.MouseInteraction=2]="MouseInteraction",s[s.Scroll=3]="Scroll",s[s.ViewportResize=4]="ViewportResize",s[s.Input=5]="Input",s[s.TouchMove=6]="TouchMove",s[s.MediaInteraction=7]="MediaInteraction",s[s.StyleSheetRule=8]="StyleSheetRule",s[s.CanvasMutation=9]="CanvasMutation",s[s.Font=10]="Font",s[s.Log=11]="Log",s[s.Drag=12]="Drag",s[s.StyleDeclaration=13]="StyleDeclaration",s[s.Selection=14]="Selection",s[s.AdoptedStyleSheet=15]="AdoptedStyleSheet",s[s.CustomElement=16]="CustomElement",s))(x||{}),re=(s=>(s[s.MouseUp=0]="MouseUp",s[s.MouseDown=1]="MouseDown",s[s.Click=2]="Click",s[s.ContextMenu=3]="ContextMenu",s[s.DblClick=4]="DblClick",s[s.Focus=5]="Focus",s[s.Blur=6]="Blur",s[s.TouchStart=7]="TouchStart",s[s.TouchMove_Departed=8]="TouchMove_Departed",s[s.TouchEnd=9]="TouchEnd",s[s.TouchCancel=10]="TouchCancel",s))(re||{}),ge=(s=>(s[s.Mouse=0]="Mouse",s[s.Pen=1]="Pen",s[s.Touch=2]="Touch",s))(ge||{}),Be=(s=>(s[s["2D"]=0]="2D",s[s.WebGL=1]="WebGL",s[s.WebGL2=2]="WebGL2",s))(Be||{}),ze=(s=>(s[s.Play=0]="Play",s[s.Pause=1]="Pause",s[s.Seeked=2]="Seeked",s[s.VolumeChange=3]="VolumeChange",s[s.RateChange=4]="RateChange",s))(ze||{}),Bo=(s=>(s[s.Document=0]="Document",s[s.DocumentType=1]="DocumentType",s[s.Element=2]="Element",s[s.Text=3]="Text",s[s.CDATA=4]="CDATA",s[s.Comment=5]="Comment",s))(Bo||{});function zo(s){return"__ln"in s}class If{constructor(){S(this,"length",0),S(this,"head",null),S(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let r=0;r<e;r++)t=(t==null?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&zo(e.previousSibling)){const r=e.previousSibling.__ln.next;t.next=r,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,r&&(r.previous=t)}else if(e.nextSibling&&zo(e.nextSibling)&&e.nextSibling.__ln.previous){const r=e.nextSibling.__ln.previous;t.previous=r,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,r&&(r.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Wo=(s,e)=>`${s}@${e}`;class Rf{constructor(){S(this,"frozen",!1),S(this,"locked",!1),S(this,"texts",[]),S(this,"attributes",[]),S(this,"attributeMap",new WeakMap),S(this,"removes",[]),S(this,"mapRemoves",[]),S(this,"movedMap",{}),S(this,"addedSet",new Set),S(this,"movedSet",new Set),S(this,"droppedSet",new Set),S(this,"removesSubTreeCache",new Set),S(this,"mutationCb"),S(this,"blockClass"),S(this,"blockSelector"),S(this,"maskTextClass"),S(this,"maskTextSelector"),S(this,"inlineStylesheet"),S(this,"maskInputOptions"),S(this,"maskTextFn"),S(this,"maskInputFn"),S(this,"keepIframeSrcFn"),S(this,"recordCanvas"),S(this,"inlineImages"),S(this,"slimDOMOptions"),S(this,"dataURLOptions"),S(this,"doc"),S(this,"mirror"),S(this,"iframeManager"),S(this,"stylesheetManager"),S(this,"shadowDomManager"),S(this,"canvasManager"),S(this,"processedNodeManager"),S(this,"unattachedDoc"),S(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),S(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,r=new If,i=a=>{let u=a,c=Ze;for(;c===Ze;)u=u&&u.nextSibling,c=u&&this.mirror.getId(u);return c},n=a=>{const u=_.parentNode(a);if(!u||!Uo(a))return;let c=!1;if(a.nodeType===Node.TEXT_NODE){const g=u.tagName;if(g==="TEXTAREA")return;g==="STYLE"&&this.addedSet.has(u)&&(c=!0)}const h=Ve(u)?this.mirror.getId(Fo(a)):this.mirror.getId(u),p=i(a);if(h===-1||p===-1)return r.addNode(a);const d=Oe(a,{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:g=>{Do(g,this.mirror)&&this.iframeManager.addIframe(g),Lo(g,this.mirror)&&this.stylesheetManager.trackLinkElement(g),Ys(a)&&this.shadowDomManager.addShadowRoot(_.shadowRoot(a),this.doc)},onIframeLoad:(g,m)=>{this.iframeManager.attachIframe(g,m),this.shadowDomManager.observeAttachShadow(g)},onStylesheetLoad:(g,m)=>{this.stylesheetManager.attachLinkElement(g,m)},cssCaptured:c});d&&(e.push({parentId:h,nextId:p,node:d}),t.add(d.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)Ho(this.removesSubTreeCache,a,this.mirror)&&!this.movedSet.has(_.parentNode(a))||n(a);for(const a of this.addedSet)!jo(this.droppedSet,a)&&!Ho(this.removesSubTreeCache,a,this.mirror)||jo(this.movedSet,a)?n(a):this.droppedSet.add(a);let o=null;for(;r.length;){let a=null;if(o){const u=this.mirror.getId(_.parentNode(o.value)),c=i(o.value);u!==-1&&c!==-1&&(a=o)}if(!a){let u=r.tail;for(;u;){const c=u;if(u=u.previous,c){const h=this.mirror.getId(_.parentNode(c.value));if(i(c.value)===-1)continue;if(h!==-1){a=c;break}else{const d=c.value,g=_.parentNode(d);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const m=_.host(g);if(this.mirror.getId(m)!==-1){a=c;break}}}}}}if(!a){for(;r.head;)r.removeNode(r.head.value);break}o=a.previous,r.removeNode(a.value),n(a.value)}const l={texts:this.texts.map(a=>{const u=a.node,c=_.parentNode(u);return c&&c.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(c),{id:this.mirror.getId(u),value:a.value}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),attributes:this.attributes.map(a=>{const{attributes:u}=a;if(typeof u.style=="string"){const c=JSON.stringify(a.styleDiff),h=JSON.stringify(a._unchangedStyles);c.length<u.style.length&&(c+h).split("var(").length===u.style.split("var(").length&&(u.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:u}}).filter(a=>!t.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:e};!l.texts.length&&!l.attributes.length&&!l.removes.length&&!l.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(l))}),S(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(_.childNodes(e),r=>_.textContent(r)||"").join("")}),S(this,"processMutation",e=>{if(!Gs(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=_.textContent(e.target);!te(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:Mi(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,To(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let r=e.attributeName,i=e.target.getAttribute(r);if(r==="value"){const o=Tr(t);i=Nr({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:o,value:i,maskInputFn:this.maskInputFn})}if(te(e.target,this.blockClass,this.blockSelector,!1)||i===e.oldValue)return;let n=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(i))if(!t.contentDocument)r="rr_src";else return;if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),r==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!Ei(t.tagName,r))if(n.attributes[r]=ki(this.doc,Se(t.tagName),Se(r),i),r==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(const l of Array.from(t.style)){const a=t.style.getPropertyValue(l),u=t.style.getPropertyPriority(l);a!==o.style.getPropertyValue(l)||u!==o.style.getPropertyPriority(l)?u===""?n.styleDiff[l]=a:n.styleDiff[l]=[a,u]:n._unchangedStyles[l]=[a,u]}for(const l of Array.from(o.style))t.style.getPropertyValue(l)===""&&(n.styleDiff[l]=!1)}else r==="open"&&t.tagName==="DIALOG"&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal");break}case"childList":{if(te(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=>{const r=this.mirror.getId(t),i=Ve(e.target)?this.mirror.getId(_.host(e.target)):this.mirror.getId(e.target);te(e.target,this.blockClass,this.blockSelector,!1)||Gs(t,this.mirror,this.slimDOMOptions)||!vf(t,this.mirror)||(this.addedSet.has(t)?(Zs(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&r===-1||Po(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Wo(r,i)]?Zs(this.movedSet,t):(this.removes.push({parentId:i,id:r,isShadow:Ve(e.target)&&Ye(e.target)?!0:void 0}),kf(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),S(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(Gs(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[Wo(this.mirror.getId(e),r)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);te(e,this.blockClass,this.blockSelector,!1)||(_.childNodes(e).forEach(r=>this.genAdds(r)),Ys(e)&&_.childNodes(_.shadowRoot(e)).forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Zs(s,e){s.delete(e),_.childNodes(e).forEach(t=>Zs(s,t))}function kf(s,e){const t=[s];for(;t.length;){const r=t.pop();e.has(r)||(e.add(r),_.childNodes(r).forEach(i=>t.push(i)))}}function Ho(s,e,t){return s.size===0?!1:Ef(s,e)}function Ef(s,e,t){const r=_.parentNode(e);return r?s.has(r):!1}function jo(s,e){return s.size===0?!1:Go(s,e)}function Go(s,e){const t=_.parentNode(e);return t?s.has(t)?!0:Go(s,t):!1}let ft;function Mf(s){ft=s}function Af(){ft=void 0}const R=s=>ft?(...t)=>{try{return s(...t)}catch(r){if(ft&&ft(r)===!0)return;throw r}}:s,xe=[];function dt(s){try{if("composedPath"in s){const e=s.composedPath();if(e.length)return e[0]}else if("path"in s&&s.path.length)return s.path[0]}catch{}return s&&s.target}function Vo(s,e){const t=new Rf;xe.push(t),t.init(s);const r=new(Mo())(R(t.processMutations.bind(t)));return r.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function Of({mousemoveCb:s,sampling:e,doc:t,mirror:r}){if(e.mousemove===!1)return()=>{};const i=typeof e.mousemove=="number"?e.mousemove:50,n=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500;let o=[],l;const a=ht(R(h=>{const p=Date.now()-l;s(o.map(d=>(d.timeOffset-=p,d)),h),o=[],l=null}),n),u=R(ht(R(h=>{const p=dt(h),{clientX:d,clientY:g}=Vs(h)?h.changedTouches[0]:h;l||(l=ur()),o.push({x:d,y:g,id:r.getId(p),timeOffset:ur()-l}),a(typeof DragEvent<"u"&&h instanceof DragEvent?x.Drag:h instanceof MouseEvent?x.MouseMove:x.TouchMove)}),i,{trailing:!1})),c=[ee("mousemove",u,t),ee("touchmove",u,t),ee("drag",u,t)];return R(()=>{c.forEach(h=>h())})}function $f({mouseInteractionCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){if(n.mouseInteraction===!1)return()=>{};const o=n.mouseInteraction===!0||n.mouseInteraction===void 0?{}:n.mouseInteraction,l=[];let a=null;const u=c=>h=>{const p=dt(h);if(te(p,r,i,!0))return;let d=null,g=c;if("pointerType"in h){switch(h.pointerType){case"mouse":d=ge.Mouse;break;case"touch":d=ge.Touch;break;case"pen":d=ge.Pen;break}d===ge.Touch?re[c]===re.MouseDown?g="TouchStart":re[c]===re.MouseUp&&(g="TouchEnd"):ge.Pen}else Vs(h)&&(d=ge.Touch);d!==null?(a=d,(g.startsWith("Touch")&&d===ge.Touch||g.startsWith("Mouse")&&d===ge.Mouse)&&(d=null)):re[c]===re.Click&&(d=a,a=null);const m=Vs(h)?h.changedTouches[0]:h;if(!m)return;const f=t.getId(p),{clientX:v,clientY:b}=m;R(s)({type:re[g],id:f,x:v,y:b,...d!==null&&{pointerType:d}})};return Object.keys(re).filter(c=>Number.isNaN(Number(c))&&!c.endsWith("_Departed")&&o[c]!==!1).forEach(c=>{let h=Se(c);const p=u(c);if(window.PointerEvent)switch(re[c]){case re.MouseDown:case re.MouseUp:h=h.replace("mouse","pointer");break;case re.TouchStart:case re.TouchEnd:return}l.push(ee(h,p,e))}),R(()=>{l.forEach(c=>c())})}function Yo({scrollCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,sampling:n}){const o=R(ht(R(l=>{const a=dt(l);if(!a||te(a,r,i,!0))return;const u=t.getId(a);if(a===e&&e.defaultView){const c=Oo(e.defaultView);s({id:u,x:c.left,y:c.top})}else s({id:u,x:a.scrollLeft,y:a.scrollTop})}),n.scroll||100));return ee("scroll",o,e)}function Nf({viewportResizeCb:s},{win:e}){let t=-1,r=-1;const i=R(ht(R(()=>{const n=$o(),o=No();(t!==n||r!==o)&&(s({width:Number(o),height:Number(n)}),t=n,r=o)}),200));return ee("resize",i,e)}const Tf=["INPUT","TEXTAREA","SELECT"],Zo=new WeakMap;function Pf({inputCb:s,doc:e,mirror:t,blockClass:r,blockSelector:i,ignoreClass:n,ignoreSelector:o,maskInputOptions:l,maskInputFn:a,sampling:u,userTriggeredOnInput:c}){function h(b){let y=dt(b);const C=b.isTrusted,k=y&&y.tagName;if(y&&k==="OPTION"&&(y=_.parentElement(y)),!y||!k||Tf.indexOf(k)<0||te(y,r,i,!0)||y.classList.contains(n)||o&&y.matches(o))return;let M=y.value,V=!1;const N=Tr(y)||"";N==="radio"||N==="checkbox"?V=y.checked:(l[k.toLowerCase()]||l[N])&&(M=Nr({element:y,maskInputOptions:l,tagName:k,type:N,value:M,maskInputFn:a})),p(y,c?{text:M,isChecked:V,userTriggered:C}:{text:M,isChecked:V});const L=y.name;N==="radio"&&L&&V&&e.querySelectorAll(`input[type="radio"][name="${L}"]`).forEach(Y=>{if(Y!==y){const W=Y.value;p(Y,c?{text:W,isChecked:!V,userTriggered:!1}:{text:W,isChecked:!V})}})}function p(b,y){const C=Zo.get(b);if(!C||C.text!==y.text||C.isChecked!==y.isChecked){Zo.set(b,y);const k=t.getId(b);R(s)({...y,id:k})}}const g=(u.input==="last"?["change"]:["input","change"]).map(b=>ee(b,R(h),e)),m=e.defaultView;if(!m)return()=>{g.forEach(b=>b())};const f=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),v=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&g.push(...v.map(b=>lr(b[0],b[1],{set(){R(h)({target:this,isTrusted:!1})}},!1,m))),R(()=>{g.forEach(b=>b())})}function cr(s){const e=[];function t(r,i){if(hr("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||hr("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||hr("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||hr("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const o=Array.from(r.parentRule.cssRules).indexOf(r);i.unshift(o)}else if(r.parentStyleSheet){const o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);i.unshift(o)}return i}return t(s,e)}function ve(s,e,t){let r,i;return s?(s.ownerNode?r=e.getId(s.ownerNode):i=t.getId(s),{styleId:i,id:r}):{}}function Df({styleSheetRuleCb:s,mirror:e,stylesheetManager:t},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const i=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(i,{apply:R((c,h,p)=>{const[d,g]=p,{id:m,styleId:f}=ve(h,e,t.styleMirror);return(m&&m!==-1||f&&f!==-1)&&s({id:m,styleId:f,adds:[{rule:d,index:g}]}),c.apply(h,p)})}),r.CSSStyleSheet.prototype.addRule=function(c,h,p=this.cssRules.length){const d=`${c} { ${h} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[d,p])};const n=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:R((c,h,p)=>{const[d]=p,{id:g,styleId:m}=ve(h,e,t.styleMirror);return(g&&g!==-1||m&&m!==-1)&&s({id:g,styleId:m,removes:[{index:d}]}),c.apply(h,p)})}),r.CSSStyleSheet.prototype.removeRule=function(c){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[c])};let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:R((c,h,p)=>{const[d]=p,{id:g,styleId:m}=ve(h,e,t.styleMirror);return(g&&g!==-1||m&&m!==-1)&&s({id:g,styleId:m,replace:d}),c.apply(h,p)})}));let l;r.CSSStyleSheet.prototype.replaceSync&&(l=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(l,{apply:R((c,h,p)=>{const[d]=p,{id:g,styleId:m}=ve(h,e,t.styleMirror);return(g&&g!==-1||m&&m!==-1)&&s({id:g,styleId:m,replaceSync:d}),c.apply(h,p)})}));const a={};fr("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(fr("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),fr("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),fr("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(a).forEach(([c,h])=>{u[c]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(u[c].insertRule,{apply:R((p,d,g)=>{const[m,f]=g,{id:v,styleId:b}=ve(d.parentStyleSheet,e,t.styleMirror);return(v&&v!==-1||b&&b!==-1)&&s({id:v,styleId:b,adds:[{rule:m,index:[...cr(d),f||0]}]}),p.apply(d,g)})}),h.prototype.deleteRule=new Proxy(u[c].deleteRule,{apply:R((p,d,g)=>{const[m]=g,{id:f,styleId:v}=ve(d.parentStyleSheet,e,t.styleMirror);return(f&&f!==-1||v&&v!==-1)&&s({id:f,styleId:v,removes:[{index:[...cr(d),m]}]}),p.apply(d,g)})})}),R(()=>{r.CSSStyleSheet.prototype.insertRule=i,r.CSSStyleSheet.prototype.deleteRule=n,o&&(r.CSSStyleSheet.prototype.replace=o),l&&(r.CSSStyleSheet.prototype.replaceSync=l),Object.entries(a).forEach(([c,h])=>{h.prototype.insertRule=u[c].insertRule,h.prototype.deleteRule=u[c].deleteRule})})}function Jo({mirror:s,stylesheetManager:e},t){var r,i,n;let o=null;t.nodeName==="#document"?o=s.getId(t):o=s.getId(_.host(t));const l=t.nodeName==="#document"?(r=t.defaultView)==null?void 0:r.Document:(n=(i=t.ownerDocument)==null?void 0:i.defaultView)==null?void 0:n.ShadowRoot,a=l!=null&&l.prototype?Object.getOwnPropertyDescriptor(l==null?void 0:l.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!l||!a?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get(){var u;return(u=a.get)==null?void 0:u.call(this)},set(u){var c;const h=(c=a.set)==null?void 0:c.call(this,u);if(o!==null&&o!==-1)try{e.adoptStyleSheets(u,o)}catch{}return h}}),R(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:a.configurable,enumerable:a.enumerable,get:a.get,set:a.set})}))}function Lf({styleDeclarationCb:s,mirror:e,ignoreCSSAttributes:t,stylesheetManager:r},{win:i}){const n=i.CSSStyleDeclaration.prototype.setProperty;i.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:R((l,a,u)=>{var c;const[h,p,d]=u;if(t.has(h))return n.apply(a,[h,p,d]);const{id:g,styleId:m}=ve((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(g&&g!==-1||m&&m!==-1)&&s({id:g,styleId:m,set:{property:h,value:p,priority:d},index:cr(a.parentRule)}),l.apply(a,u)})});const o=i.CSSStyleDeclaration.prototype.removeProperty;return i.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:R((l,a,u)=>{var c;const[h]=u;if(t.has(h))return o.apply(a,[h]);const{id:p,styleId:d}=ve((c=a.parentRule)==null?void 0:c.parentStyleSheet,e,r.styleMirror);return(p&&p!==-1||d&&d!==-1)&&s({id:p,styleId:d,remove:{property:h},index:cr(a.parentRule)}),l.apply(a,u)})}),R(()=>{i.CSSStyleDeclaration.prototype.setProperty=n,i.CSSStyleDeclaration.prototype.removeProperty=o})}function Ff({mediaInteractionCb:s,blockClass:e,blockSelector:t,mirror:r,sampling:i,doc:n}){const o=R(a=>ht(R(u=>{const c=dt(u);if(!c||te(c,e,t,!0))return;const{currentTime:h,volume:p,muted:d,playbackRate:g,loop:m}=c;s({type:a,id:r.getId(c),currentTime:h,volume:p,muted:d,playbackRate:g,loop:m})}),i.media||500)),l=[ee("play",o(ze.Play),n),ee("pause",o(ze.Pause),n),ee("seeked",o(ze.Seeked),n),ee("volumechange",o(ze.VolumeChange),n),ee("ratechange",o(ze.RateChange),n)];return R(()=>{l.forEach(a=>a())})}function Uf({fontCb:s,doc:e}){const t=e.defaultView;if(!t)return()=>{};const r=[],i=new WeakMap,n=t.FontFace;t.FontFace=function(a,u,c){const h=new n(a,u,c);return i.set(h,{family:a,buffer:typeof u!="string",descriptors:c,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),h};const o=Ue(e.fonts,"add",function(l){return function(a){return setTimeout(R(()=>{const u=i.get(a);u&&(s(u),i.delete(a))}),0),l.apply(this,[a])}});return r.push(()=>{t.FontFace=n}),r.push(o),R(()=>{r.forEach(l=>l())})}function Bf(s){const{doc:e,mirror:t,blockClass:r,blockSelector:i,selectionCb:n}=s;let o=!0;const l=R(()=>{const a=e.getSelection();if(!a||o&&(a!=null&&a.isCollapsed))return;o=a.isCollapsed||!1;const u=[],c=a.rangeCount||0;for(let h=0;h<c;h++){const p=a.getRangeAt(h),{startContainer:d,startOffset:g,endContainer:m,endOffset:f}=p;te(d,r,i,!0)||te(m,r,i,!0)||u.push({start:t.getId(d),startOffset:g,end:t.getId(m),endOffset:f})}n({ranges:u})});return l(),ee("selectionchange",l)}function zf({doc:s,customElementCb:e}){const t=s.defaultView;return!t||!t.customElements?()=>{}:Ue(t.customElements,"define",function(i){return function(n,o,l){try{e({define:{name:n}})}catch{console.warn(`Custom element callback failed for ${n}`)}return i.apply(this,[n,o,l])}})}function Wf(s,e){const{mutationCb:t,mousemoveCb:r,mouseInteractionCb:i,scrollCb:n,viewportResizeCb:o,inputCb:l,mediaInteractionCb:a,styleSheetRuleCb:u,styleDeclarationCb:c,canvasMutationCb:h,fontCb:p,selectionCb:d,customElementCb:g}=s;s.mutationCb=(...m)=>{e.mutation&&e.mutation(...m),t(...m)},s.mousemoveCb=(...m)=>{e.mousemove&&e.mousemove(...m),r(...m)},s.mouseInteractionCb=(...m)=>{e.mouseInteraction&&e.mouseInteraction(...m),i(...m)},s.scrollCb=(...m)=>{e.scroll&&e.scroll(...m),n(...m)},s.viewportResizeCb=(...m)=>{e.viewportResize&&e.viewportResize(...m),o(...m)},s.inputCb=(...m)=>{e.input&&e.input(...m),l(...m)},s.mediaInteractionCb=(...m)=>{e.mediaInteaction&&e.mediaInteaction(...m),a(...m)},s.styleSheetRuleCb=(...m)=>{e.styleSheetRule&&e.styleSheetRule(...m),u(...m)},s.styleDeclarationCb=(...m)=>{e.styleDeclaration&&e.styleDeclaration(...m),c(...m)},s.canvasMutationCb=(...m)=>{e.canvasMutation&&e.canvasMutation(...m),h(...m)},s.fontCb=(...m)=>{e.font&&e.font(...m),p(...m)},s.selectionCb=(...m)=>{e.selection&&e.selection(...m),d(...m)},s.customElementCb=(...m)=>{e.customElement&&e.customElement(...m),g(...m)}}function Hf(s,e={}){const t=s.doc.defaultView;if(!t)return()=>{};Wf(s,e);let r;s.recordDOM&&(r=Vo(s,s.doc));const i=Of(s),n=$f(s),o=Yo(s),l=Nf(s,{win:t}),a=Pf(s),u=Ff(s);let c=()=>{},h=()=>{},p=()=>{},d=()=>{};s.recordDOM&&(c=Df(s,{win:t}),h=Jo(s,s.doc),p=Lf(s,{win:t}),s.collectFonts&&(d=Uf(s)));const g=Bf(s),m=zf(s),f=[];for(const v of s.plugins)f.push(v.observer(v.callback,t,v.options));return R(()=>{xe.forEach(v=>v.reset()),r==null||r.disconnect(),i(),n(),o(),l(),a(),u(),c(),h(),p(),d(),g(),m(),f.forEach(v=>v())})}function hr(s){return typeof window[s]<"u"}function fr(s){return!!(typeof window[s]<"u"&&window[s].prototype&&"insertRule"in window[s].prototype&&"deleteRule"in window[s].prototype)}class Xo{constructor(e){S(this,"iframeIdToRemoteIdMap",new WeakMap),S(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,r,i){const n=r||this.getIdToRemoteIdMap(e),o=i||this.getRemoteIdToIdMap(e);let l=n.get(t);return l||(l=this.generateIdFn(),n.set(t,l),o.set(l,t)),l}getIds(e,t){const r=this.getIdToRemoteIdMap(e),i=this.getRemoteIdToIdMap(e);return t.map(n=>this.getId(e,n,r,i))}getRemoteId(e,t,r){const i=r||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;const n=i.get(t);return n||-1}getRemoteIds(e,t){const r=this.getRemoteIdToIdMap(e);return t.map(i=>this.getRemoteId(e,i,r))}reset(e){if(!e){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class jf{constructor(e){S(this,"iframes",new WeakMap),S(this,"crossOriginIframeMap",new WeakMap),S(this,"crossOriginIframeMirror",new Xo(xi)),S(this,"crossOriginIframeStyleMirror"),S(this,"crossOriginIframeRootIdMap",new WeakMap),S(this,"mirror"),S(this,"mutationCb"),S(this,"wrappedEmit"),S(this,"loadListener"),S(this,"stylesheetManager"),S(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Xo(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){var r,i;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((r=e.contentWindow)==null||r.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;const i=this.crossOriginIframeMap.get(e.source);if(!i)return;const n=this.transformCrossOriginEvent(i,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var r;switch(t.type){case I.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const i=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,i),this.patchRootIdOnNode(t.data.node,i),{timestamp:t.timestamp,type:I.IncrementalSnapshot,data:{source:x.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case I.Meta:case I.Load:case I.DomContentLoaded:return!1;case I.Plugin:return t;case I.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case I.IncrementalSnapshot:switch(t.data.source){case x.Mutation:return t.data.adds.forEach(i=>{this.replaceIds(i,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(i.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(i.node,n)}),t.data.removes.forEach(i=>{this.replaceIds(i,e,["parentId","id"])}),t.data.attributes.forEach(i=>{this.replaceIds(i,e,["id"])}),t.data.texts.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case x.Drag:case x.TouchMove:case x.MouseMove:return t.data.positions.forEach(i=>{this.replaceIds(i,e,["id"])}),t;case x.ViewportResize:return!1;case x.MediaInteraction:case x.MouseInteraction:case x.Scroll:case x.CanvasMutation:case x.Input:return this.replaceIds(t.data,e,["id"]),t;case x.StyleSheetRule:case x.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case x.Font:return t;case x.Selection:return t.data.ranges.forEach(i=>{this.replaceIds(i,e,["start","end"])}),t;case x.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(r=t.data.styles)==null||r.forEach(i=>{this.replaceStyleIds(i,e,["styleId"])}),t}}return!1}replace(e,t,r,i){for(const n of i)!Array.isArray(t[n])&&typeof t[n]!="number"||(Array.isArray(t[n])?t[n]=e.getIds(r,t[n]):t[n]=e.getId(r,t[n]));return t}replaceIds(e,t,r){return this.replace(this.crossOriginIframeMirror,e,t,r)}replaceStyleIds(e,t,r){return this.replace(this.crossOriginIframeStyleMirror,e,t,r)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(r=>{this.replaceIdOnNode(r,t)})}patchRootIdOnNode(e,t){e.type!==Bo.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(r=>{this.patchRootIdOnNode(r,t)})}}class Gf{constructor(e){S(this,"shadowDoms",new WeakSet),S(this,"mutationCb"),S(this,"scrollCb"),S(this,"bypassOptions"),S(this,"mirror"),S(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!Ye(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);const r=Vo({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Yo({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),setTimeout(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(_.host(e))),this.restoreHandlers.push(Jo({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const r=this;this.restoreHandlers.push(Ue(e.prototype,"attachShadow",function(i){return function(n){const o=i.call(this,n),l=_.shadowRoot(this);return l&&Uo(this)&&r.addShadowRoot(l,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var We="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Vf=typeof Uint8Array>"u"?[]:new Uint8Array(256),dr=0;dr<We.length;dr++)Vf[We.charCodeAt(dr)]=dr;var Yf=function(s){var e=new Uint8Array(s),t,r=e.length,i="";for(t=0;t<r;t+=3)i+=We[e[t]>>2],i+=We[(e[t]&3)<<4|e[t+1]>>4],i+=We[(e[t+1]&15)<<2|e[t+2]>>6],i+=We[e[t+2]&63];return r%3===2?i=i.substring(0,i.length-1)+"=":r%3===1&&(i=i.substring(0,i.length-2)+"=="),i};const Ko=new Map;function Zf(s,e){let t=Ko.get(s);return t||(t=new Map,Ko.set(s,t)),t.has(e)||t.set(e,[]),t.get(e)}const Qo=(s,e,t)=>{if(!s||!(ea(s,e)||typeof s=="object"))return;const r=s.constructor.name,i=Zf(t,r);let n=i.indexOf(s);return n===-1&&(n=i.length,i.push(s)),n};function pr(s,e,t){if(s instanceof Array)return s.map(r=>pr(r,e,t));if(s===null)return s;if(s instanceof Float32Array||s instanceof Float64Array||s instanceof Int32Array||s instanceof Uint32Array||s instanceof Uint8Array||s instanceof Uint16Array||s instanceof Int16Array||s instanceof Int8Array||s instanceof Uint8ClampedArray)return{rr_type:s.constructor.name,args:[Object.values(s)]};if(s instanceof ArrayBuffer){const r=s.constructor.name,i=Yf(s);return{rr_type:r,base64:i}}else{if(s instanceof DataView)return{rr_type:s.constructor.name,args:[pr(s.buffer,e,t),s.byteOffset,s.byteLength]};if(s instanceof HTMLImageElement){const r=s.constructor.name,{src:i}=s;return{rr_type:r,src:i}}else if(s instanceof HTMLCanvasElement){const r="HTMLImageElement",i=s.toDataURL();return{rr_type:r,src:i}}else{if(s instanceof ImageData)return{rr_type:s.constructor.name,args:[pr(s.data,e,t),s.width,s.height]};if(ea(s,e)||typeof s=="object"){const r=s.constructor.name,i=Qo(s,e,t);return{rr_type:r,index:i}}}}return s}const qo=(s,e,t)=>s.map(r=>pr(r,e,t)),ea=(s,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(i=>typeof e[i]=="function").find(i=>s instanceof e[i]);function Jf(s,e,t,r){const i=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(const o of n)try{if(typeof e.CanvasRenderingContext2D.prototype[o]!="function")continue;const l=Ue(e.CanvasRenderingContext2D.prototype,o,function(a){return function(...u){return te(this.canvas,t,r,!0)||setTimeout(()=>{const c=qo(u,e,this);s(this.canvas,{type:Be["2D"],property:o,args:c})},0),a.apply(this,u)}});i.push(l)}catch{const l=lr(e.CanvasRenderingContext2D.prototype,o,{set(a){s(this.canvas,{type:Be["2D"],property:o,args:[a],setter:!0})}});i.push(l)}return()=>{i.forEach(o=>o())}}function Xf(s){return s==="experimental-webgl"?"webgl":s}function ta(s,e,t,r){const i=[];try{const n=Ue(s.HTMLCanvasElement.prototype,"getContext",function(o){return function(l,...a){if(!te(this,e,t,!0)){const u=Xf(l);if("__context"in this||(this.__context=u),r&&["webgl","webgl2"].includes(u))if(a[0]&&typeof a[0]=="object"){const c=a[0];c.preserveDrawingBuffer||(c.preserveDrawingBuffer=!0)}else a.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[l,...a])}});i.push(n)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(n=>n())}}function ra(s,e,t,r,i,n){const o=[],l=Object.getOwnPropertyNames(s);for(const a of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(a))try{if(typeof s[a]!="function")continue;const u=Ue(s,a,function(c){return function(...h){const p=c.apply(this,h);if(Qo(p,n,this),"tagName"in this.canvas&&!te(this.canvas,r,i,!0)){const d=qo(h,n,this),g={type:e,property:a,args:d};t(this.canvas,g)}return p}});o.push(u)}catch{const u=lr(s,a,{set(c){t(this.canvas,{type:e,property:a,args:[c],setter:!0})}});o.push(u)}return o}function Kf(s,e,t,r){const i=[];return i.push(...ra(e.WebGLRenderingContext.prototype,Be.WebGL,s,t,r,e)),typeof e.WebGL2RenderingContext<"u"&&i.push(...ra(e.WebGL2RenderingContext.prototype,Be.WebGL2,s,t,r,e)),()=>{i.forEach(n=>n())}}const sa="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",Qf=s=>Uint8Array.from(atob(s),e=>e.charCodeAt(0)),ia=typeof window<"u"&&window.Blob&&new Blob([Qf(sa)],{type:"text/javascript;charset=utf-8"});function qf(s){let e;try{if(e=ia&&(window.URL||window.webkitURL).createObjectURL(ia),!e)throw"";const t=new Worker(e,{name:s==null?void 0:s.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch{return new Worker("data:text/javascript;base64,"+sa,{name:s==null?void 0:s.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}class ed{constructor(e){S(this,"pendingCanvasMutations",new Map),S(this,"rafStamps",{latestId:0,invokeId:null}),S(this,"mirror"),S(this,"mutationCb"),S(this,"resetObservers"),S(this,"frozen",!1),S(this,"locked",!1),S(this,"processMutation",(a,u)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(a)||this.pendingCanvasMutations.set(a,[]),this.pendingCanvasMutations.get(a).push(u)});const{sampling:t="all",win:r,blockClass:i,blockSelector:n,recordCanvas:o,dataURLOptions:l}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t==="all"&&this.initCanvasMutationObserver(r,i,n),o&&typeof t=="number"&&this.initCanvasFPSObserver(t,r,i,n,{dataURLOptions:l})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,r,i,n){const o=ta(t,r,i,!0),l=new Map,a=new qf;a.onmessage=g=>{const{id:m}=g.data;if(l.set(m,!1),!("base64"in g.data))return;const{base64:f,type:v,width:b,height:y}=g.data;this.mutationCb({id:m,type:Be["2D"],commands:[{property:"clearRect",args:[0,0,b,y]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:f}],type:v}]},0,0]}]})};const u=1e3/e;let c=0,h;const p=()=>{const g=[];return t.document.querySelectorAll("canvas").forEach(m=>{te(m,r,i,!0)||g.push(m)}),g},d=g=>{if(c&&g-c<u){h=requestAnimationFrame(d);return}c=g,p().forEach(async m=>{var f;const v=this.mirror.getId(m);if(l.get(v)||m.width===0||m.height===0)return;if(l.set(v,!0),["webgl","webgl2"].includes(m.__context)){const y=m.getContext(m.__context);((f=y==null?void 0:y.getContextAttributes())==null?void 0:f.preserveDrawingBuffer)===!1&&y.clear(y.COLOR_BUFFER_BIT)}const b=await createImageBitmap(m);a.postMessage({id:v,bitmap:b,width:m.width,height:m.height,dataURLOptions:n.dataURLOptions},[b])}),h=requestAnimationFrame(d)};h=requestAnimationFrame(d),this.resetObservers=()=>{o(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,r){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const i=ta(e,t,r,!1),n=Jf(this.processMutation.bind(this),e,t,r),o=Kf(this.processMutation.bind(this),e,t,r);this.resetObservers=()=>{i(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const r=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,r)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const r=this.pendingCanvasMutations.get(e);if(!r||t===-1)return;const i=r.map(o=>{const{type:l,...a}=o;return a}),{type:n}=r[0];this.mutationCb({id:t,type:n,commands:i}),this.pendingCanvasMutations.delete(e)}}class td{constructor(e){S(this,"trackedLinkElements",new WeakSet),S(this,"mutationCb"),S(this,"adoptedStyleSheetCb"),S(this,"styleMirror",new Cf),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;const r={id:t,styleIds:[]},i=[];for(const n of e){let o;this.styleMirror.has(n)?o=this.styleMirror.getId(n):(o=this.styleMirror.add(n),i.push({styleId:o,rules:Array.from(n.rules||CSSRule,(l,a)=>({rule:vi(l,n.href),index:a}))})),r.styleIds.push(o)}i.length>0&&(r.styles=i),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class rd{constructor(){S(this,"nodeMap",new WeakMap),S(this,"active",!1)}inOtherBuffer(e,t){const r=this.nodeMap.get(e);return r&&Array.from(r).some(i=>i!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let H,mr,Js,gr=!1;try{if(Array.from([1],s=>s*2)[0]!==2){const s=document.createElement("iframe");document.body.appendChild(s),Array.from=((pi=s.contentWindow)==null?void 0:pi.Array.from)||Array.from,document.body.removeChild(s)}}catch(s){console.debug("Unable to override Array.from",s)}const ae=cl();function pt(s={}){const{emit:e,checkoutEveryNms:t,checkoutEveryNth:r,blockClass:i="rr-block",blockSelector:n=null,ignoreClass:o="rr-ignore",ignoreSelector:l=null,maskTextClass:a="rr-mask",maskTextSelector:u=null,inlineStylesheet:c=!0,maskAllInputs:h,maskInputOptions:p,slimDOMOptions:d,maskInputFn:g,maskTextFn:m,hooks:f,packFn:v,sampling:b={},dataURLOptions:y={},mousemoveWait:C,recordDOM:k=!0,recordCanvas:M=!1,recordCrossOriginIframes:V=!1,recordAfter:N=s.recordAfter==="DOMContentLoaded"?s.recordAfter:"load",userTriggeredOnInput:L=!1,collectFonts:Y=!1,inlineImages:W=!1,plugins:Q,keepIframeSrcFn:E=()=>!1,ignoreCSSAttributes:gt=new Set([]),errorHandler:yt}=s;Mf(yt);const K=V?window.parent===window:!0;let ie=!1;if(!K)try{window.parent.document&&(ie=!1)}catch{ie=!0}if(K&&!e)throw new Error("emit function is required");if(!K&&!ie)return()=>{};C!==void 0&&b.mousemove===void 0&&(b.mousemove=C),ae.reset();const Re=h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:p!==void 0?p:{password:!0},he=d===!0||d==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:d==="all",headMetaDescKeywords:d==="all",headTitleMutations:d==="all"}:d||{};Sf();let Na,hi=0;const Ta=A=>{for(const le of Q||[])le.eventProcessor&&(A=le.eventProcessor(A));return v&&!ie&&(A=v(A)),A};H=(A,le)=>{var j;const G=A;if(G.timestamp=ur(),(j=xe[0])!=null&&j.isFrozen()&&G.type!==I.FullSnapshot&&!(G.type===I.IncrementalSnapshot&&G.data.source===x.Mutation)&&xe.forEach(fe=>fe.unfreeze()),K)e==null||e(Ta(G),le);else if(ie){const fe={type:"rrweb",event:Ta(G),origin:window.location.origin,isCheckout:le};window.parent.postMessage(fe,"*")}if(G.type===I.FullSnapshot)Na=G,hi=0;else if(G.type===I.IncrementalSnapshot){if(G.data.source===x.Mutation&&G.data.isAttachIframe)return;hi++;const fe=r&&hi>=r,P=t&&G.timestamp-Na.timestamp>t;(fe||P)&&mr(!0)}};const kr=A=>{H({type:I.IncrementalSnapshot,data:{source:x.Mutation,...A}})},Pa=A=>H({type:I.IncrementalSnapshot,data:{source:x.Scroll,...A}}),Da=A=>H({type:I.IncrementalSnapshot,data:{source:x.CanvasMutation,...A}}),Kd=A=>H({type:I.IncrementalSnapshot,data:{source:x.AdoptedStyleSheet,...A}}),ke=new td({mutationCb:kr,adoptedStyleSheetCb:Kd}),Ee=new jf({mirror:ae,mutationCb:kr,stylesheetManager:ke,recordCrossOriginIframes:V,wrappedEmit:H});for(const A of Q||[])A.getMirror&&A.getMirror({nodeMirror:ae,crossOriginIframeMirror:Ee.crossOriginIframeMirror,crossOriginIframeStyleMirror:Ee.crossOriginIframeStyleMirror});const fi=new rd;Js=new ed({recordCanvas:M,mutationCb:Da,win:window,blockClass:i,blockSelector:n,mirror:ae,sampling:b.canvas,dataURLOptions:y});const Er=new Gf({mutationCb:kr,scrollCb:Pa,bypassOptions:{blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskInputOptions:Re,dataURLOptions:y,maskTextFn:m,maskInputFn:g,recordCanvas:M,inlineImages:W,sampling:b,slimDOMOptions:he,iframeManager:Ee,stylesheetManager:ke,canvasManager:Js,keepIframeSrcFn:E,processedNodeManager:fi},mirror:ae});mr=(A=!1)=>{if(!k)return;H({type:I.Meta,data:{href:window.location.href,width:No(),height:$o()}},A),ke.reset(),Er.init(),xe.forEach(j=>j.lock());const le=Tl(document,{mirror:ae,blockClass:i,blockSelector:n,maskTextClass:a,maskTextSelector:u,inlineStylesheet:c,maskAllInputs:Re,maskTextFn:m,maskInputFn:g,slimDOM:he,dataURLOptions:y,recordCanvas:M,inlineImages:W,onSerialize:j=>{Do(j,ae)&&Ee.addIframe(j),Lo(j,ae)&&ke.trackLinkElement(j),Ys(j)&&Er.addShadowRoot(_.shadowRoot(j),document)},onIframeLoad:(j,G)=>{Ee.attachIframe(j,G),Er.observeAttachShadow(j)},onStylesheetLoad:(j,G)=>{ke.attachLinkElement(j,G)},keepIframeSrcFn:E});if(!le)return console.warn("Failed to snapshot the document");H({type:I.FullSnapshot,data:{node:le,initialOffset:Oo(window)}},A),xe.forEach(j=>j.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ke.adoptStyleSheets(document.adoptedStyleSheets,ae.getId(document))};try{const A=[],le=G=>{var fe;return R(Hf)({mutationCb:kr,mousemoveCb:(P,di)=>H({type:I.IncrementalSnapshot,data:{source:di,positions:P}}),mouseInteractionCb:P=>H({type:I.IncrementalSnapshot,data:{source:x.MouseInteraction,...P}}),scrollCb:Pa,viewportResizeCb:P=>H({type:I.IncrementalSnapshot,data:{source:x.ViewportResize,...P}}),inputCb:P=>H({type:I.IncrementalSnapshot,data:{source:x.Input,...P}}),mediaInteractionCb:P=>H({type:I.IncrementalSnapshot,data:{source:x.MediaInteraction,...P}}),styleSheetRuleCb:P=>H({type:I.IncrementalSnapshot,data:{source:x.StyleSheetRule,...P}}),styleDeclarationCb:P=>H({type:I.IncrementalSnapshot,data:{source:x.StyleDeclaration,...P}}),canvasMutationCb:Da,fontCb:P=>H({type:I.IncrementalSnapshot,data:{source:x.Font,...P}}),selectionCb:P=>{H({type:I.IncrementalSnapshot,data:{source:x.Selection,...P}})},customElementCb:P=>{H({type:I.IncrementalSnapshot,data:{source:x.CustomElement,...P}})},blockClass:i,ignoreClass:o,ignoreSelector:l,maskTextClass:a,maskTextSelector:u,maskInputOptions:Re,inlineStylesheet:c,sampling:b,recordDOM:k,recordCanvas:M,inlineImages:W,userTriggeredOnInput:L,collectFonts:Y,doc:G,maskInputFn:g,maskTextFn:m,keepIframeSrcFn:E,blockSelector:n,slimDOMOptions:he,dataURLOptions:y,mirror:ae,iframeManager:Ee,stylesheetManager:ke,shadowDomManager:Er,processedNodeManager:fi,canvasManager:Js,ignoreCSSAttributes:gt,plugins:((fe=Q==null?void 0:Q.filter(P=>P.observer))==null?void 0:fe.map(P=>({observer:P.observer,options:P.options,callback:di=>H({type:I.Plugin,data:{plugin:P.name,payload:di}})})))||[]},f)};Ee.addLoadListener(G=>{try{A.push(le(G.contentDocument))}catch(fe){console.warn(fe)}});const j=()=>{mr(),A.push(le(document)),gr=!0};return document.readyState==="interactive"||document.readyState==="complete"?j():(A.push(ee("DOMContentLoaded",()=>{H({type:I.DomContentLoaded,data:{}}),N==="DOMContentLoaded"&&j()})),A.push(ee("load",()=>{H({type:I.Load,data:{}}),N==="load"&&j()},window))),()=>{A.forEach(G=>G()),fi.destroy(),gr=!1,Af()}}catch(A){console.warn(A)}}pt.addCustomEvent=(s,e)=>{if(!gr)throw new Error("please add custom event after start recording");H({type:I.Custom,data:{tag:s,payload:e}})},pt.freezePage=()=>{xe.forEach(s=>s.freeze())},pt.takeFullSnapshot=s=>{if(!gr)throw new Error("please take full snapshot after start recording");mr(s)},pt.mirror=ae;var na;(function(s){s[s.NotStarted=0]="NotStarted",s[s.Running=1]="Running",s[s.Stopped=2]="Stopped"})(na||(na={}));const sd=['input[type="password"]','input[type="credit-card"]','input[autocomplete="cc-number"]','input[autocomplete="cc-csc"]','input[autocomplete="cc-exp"]','input[autocomplete="cc-exp-month"]','input[autocomplete="cc-exp-year"]','input[autocomplete="new-password"]','input[autocomplete="current-password"]','input[name*="password"]','input[name*="passwd"]','input[name*="secret"]','input[name*="token"]','input[name*="apikey"]','input[name*="api_key"]','input[name*="api-key"]','input[name*="credit"]','input[name*="card"]','input[name*="cvv"]','input[name*="cvc"]','input[name*="ssn"]','input[id*="password"]','input[id*="secret"]','input[id*="token"]',"[data-private]","[data-mask]","[data-sensitive]"];function id(){return sd.join(", ")}function nd(){return"[data-private-text], [data-mask-text]"}function od(s){return s.matches(id())}function ad(s){return s?{maskAllInputs:!1,maskTextSelector:nd(),maskInputOptions:{password:!0},maskInputFn:(e,t)=>od(t)?"*".repeat(Math.min(e.length,20)):e,blockSelector:"[data-recorder-block], [data-bw-recorder-ui], #bw-recorder-root",ignoreSelector:"[data-recorder-ignore]"}:{maskAllInputs:!1,maskTextSelector:null,maskInputOptions:{}}}const ld=900*1e3,ud=30*1e3,cd=100;class hd{constructor(e){this.state="idle",this.events=[],this.stopFn=null,this.startTime=0,this.pauseTime=0,this.totalPausedDuration=0,this.chunkIndex=0,this.maxDurationTimer=null,this.chunkTimer=null,this.uploader=null,this.metadata=null,this.onEventCallback=null,this.config={...e,maxDuration:e.maxDuration??ld,maskInputs:e.maskInputs??!0}}setUploader(e){this.uploader=e}onEvent(e){this.onEventCallback=e}getState(){return this.state}getElapsedTime(){return this.state==="idle"||this.startTime===0?0:this.state==="paused"?this.pauseTime-this.startTime-this.totalPausedDuration:Date.now()-this.startTime-this.totalPausedDuration}getEvents(){return[...this.events]}async start(){var r,i;if(this.state!=="idle")throw new Error(`Cannot start recording: state is ${this.state}`);if(this.setState("recording"),this.startTime=Date.now(),this.events=[],this.chunkIndex=0,this.totalPausedDuration=0,this.metadata={url:window.location.href,userAgent:navigator.userAgent,viewport:{width:window.innerWidth,height:window.innerHeight},startedAt:this.startTime},this.uploader)try{await this.uploader.start(this.metadata)}catch(n){throw(i=(r=this.config).onError)==null||i.call(r,n),this.setState("idle"),n}const e=ad(this.config.maskInputs),t=pt({emit:n=>this.handleEvent(n),maskAllInputs:e.maskAllInputs,maskTextSelector:e.maskTextSelector??void 0,maskInputFn:e.maskInputFn,blockSelector:e.blockSelector,recordCanvas:!0,collectFonts:!0,inlineStylesheet:!0,sampling:{mousemove:!0,mouseInteraction:!0,scroll:150,input:"last"}});this.stopFn=t??null,this.maxDurationTimer=setTimeout(()=>{this.stop()},this.config.maxDuration),this.chunkTimer=setInterval(()=>{this.flushChunk()},ud)}pause(){if(this.state!=="recording")throw new Error(`Cannot pause: state is ${this.state}`);this.setState("paused"),this.pauseTime=Date.now()}resume(){if(this.state!=="paused")throw new Error(`Cannot resume: state is ${this.state}`);this.totalPausedDuration+=Date.now()-this.pauseTime,this.setState("recording")}async stop(e=[]){var t,r,i,n;if(this.state==="idle"||this.state==="stopped")return null;if(this.maxDurationTimer&&(clearTimeout(this.maxDurationTimer),this.maxDurationTimer=null),this.chunkTimer&&(clearInterval(this.chunkTimer),this.chunkTimer=null),this.stopFn&&(this.stopFn(),this.stopFn=null),this.setState("stopped"),await this.flushChunk(),this.uploader)try{const o=await this.uploader.complete(this.getElapsedTime(),this.events.length,e);return(r=(t=this.config).onComplete)==null||r.call(t,o),o}catch(o){return(n=(i=this.config).onError)==null||n.call(i,o),null}return null}handleEvent(e){var t;this.state!=="paused"&&(this.events.push(e),(t=this.onEventCallback)==null||t.call(this,e),this.events.length>=cd&&this.flushChunk())}async flushChunk(){var t,r;if(this.events.length===0||!this.uploader)return;const e={index:this.chunkIndex++,events:[...this.events],timestamp:Date.now()};this.events=[];try{await this.uploader.uploadChunk(e)}catch(i){this.events=[...e.events,...this.events],this.chunkIndex--,(r=(t=this.config).onError)==null||r.call(t,i)}}setState(e){var t,r;this.state=e,(r=(t=this.config).onStateChange)==null||r.call(t,e)}reset(){this.stop(),this.state="idle",this.events=[],this.startTime=0,this.pauseTime=0,this.totalPausedDuration=0,this.chunkIndex=0,this.metadata=null}}class fd{constructor(){this.markers=[],this.recordingStartTime=0,this.isRecording=!1,this.captureDebounceTimer=null}setStartTime(e){this.recordingStartTime=e,this.isRecording=!0}getMarkers(){return[...this.markers]}getCount(){return this.markers.length}capture(e){if(!this.isRecording||this.recordingStartTime===0)return null;const t={timestamp:Date.now()-this.recordingStartTime,eventType:e};return this.markers.push(t),console.log("[BWorlds Recorder] Screenshot marker added",{timestamp:t.timestamp,eventType:t.eventType,totalMarkers:this.markers.length}),t}captureDebounced(e,t=500){this.captureDebounceTimer&&clearTimeout(this.captureDebounceTimer),this.captureDebounceTimer=setTimeout(()=>{this.capture(e),this.captureDebounceTimer=null},t)}stop(){this.isRecording=!1,this.captureDebounceTimer&&(clearTimeout(this.captureDebounceTimer),this.captureDebounceTimer=null)}reset(){this.markers=[],this.recordingStartTime=0,this.isRecording=!1,this.captureDebounceTimer&&(clearTimeout(this.captureDebounceTimer),this.captureDebounceTimer=null)}}class dd{constructor(e){this.lastScrollY=0,this.viewportHeight=0,this.observers=[],this.isRecording=!1,this.hasInitialScreenshot=!1,this.handleScroll=()=>{if(!this.isRecording)return;const t=window.scrollY;Math.abs(t-this.lastScrollY)>this.viewportHeight*.5&&(this.lastScrollY=t,this.screenshotCapture.captureDebounced("scroll",500))},this.handleFormSubmit=t=>{this.isRecording&&this.triggerScreenshot("form_submit")},this.handleNavigation=()=>{this.isRecording&&setTimeout(()=>{this.triggerScreenshot("navigation")},500)},this.screenshotCapture=e,this.viewportHeight=window.innerHeight}start(){this.isRecording||(this.isRecording=!0,this.lastScrollY=window.scrollY,this.viewportHeight=window.innerHeight,this.hasInitialScreenshot=!1,this.setupModalDetection(),this.setupScrollDetection(),this.setupFormDetection(),this.setupNavigationDetection(),setTimeout(()=>{this.isRecording&&!this.hasInitialScreenshot&&(this.hasInitialScreenshot=!0,this.triggerScreenshot("load"))},500))}stop(){this.isRecording=!1,this.observers.forEach(e=>e.disconnect()),this.observers=[],window.removeEventListener("scroll",this.handleScroll),window.removeEventListener("popstate",this.handleNavigation)}handleRrwebEvent(e){this.isRecording&&e.type===I.IncrementalSnapshot&&e.data.source}triggerScreenshot(e){this.isRecording&&this.screenshotCapture.capture(e)}setupModalDetection(){const e=new MutationObserver(t=>{for(const r of t){if(r.type==="childList"){for(const i of r.addedNodes)if(i instanceof HTMLElement&&this.isModal(i)){setTimeout(()=>{this.triggerScreenshot("modal_open")},300);return}}if(r.type==="attributes"){const i=r.target;if(r.attributeName==="open"&&i.tagName==="DIALOG"&&i.hasAttribute("open")){setTimeout(()=>{this.triggerScreenshot("modal_open")},300);return}}}});e.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["open","aria-hidden","aria-modal"]}),this.observers.push(e)}isModal(e){if(e.tagName.toLowerCase()==="dialog"||e.getAttribute("role")==="dialog"||e.getAttribute("role")==="alertdialog"||e.getAttribute("aria-modal")==="true")return!0;const r=e.className.toLowerCase(),i=["modal","dialog","overlay","popup","lightbox"];for(const o of i)if(r.includes(o))return!0;const n=window.getComputedStyle(e);if((n.position==="fixed"||n.position==="absolute")&&parseInt(n.zIndex)>100){const o=e.getBoundingClientRect(),l=window.innerWidth*window.innerHeight;if(o.width*o.height>l*.3)return!0}return!1}setupScrollDetection(){window.addEventListener("scroll",this.handleScroll,{passive:!0})}setupFormDetection(){document.addEventListener("submit",this.handleFormSubmit,!0)}setupNavigationDetection(){window.addEventListener("popstate",this.handleNavigation);const e=history.pushState.bind(history),t=history.replaceState.bind(history);history.pushState=(...r)=>{e(...r),this.handleNavigation()},history.replaceState=(...r)=>{t(...r),this.handleNavigation()}}destroy(){this.stop(),document.removeEventListener("submit",this.handleFormSubmit,!0)}}class pd{constructor(){this.recordingId="",this.sessionToken="",this.metadata=null,this.chunks=[],this.screenshotMarkers=[]}async start(e){return this.recordingId=`rec_${Date.now()}_${Math.random().toString(36).substr(2,9)}`,this.sessionToken=`tok_${Math.random().toString(36).substr(2,16)}`,this.metadata=e,this.chunks=[],this.screenshotMarkers=[],console.log("[BWorlds Recorder] Recording started",{recordingId:this.recordingId,metadata:{url:e.url,viewport:e.viewport,startedAt:new Date(e.startedAt).toISOString()}}),{token:this.sessionToken,recordingId:this.recordingId,expiresAt:Date.now()+3600*1e3}}async uploadChunk(e){this.chunks.push(e),console.log("[BWorlds Recorder] Chunk uploaded",{recordingId:this.recordingId,chunkIndex:e.index,eventCount:e.events.length,totalEvents:this.chunks.reduce((t,r)=>t+r.events.length,0)})}async complete(e,t,r){this.screenshotMarkers=r;const i={recordingId:this.recordingId,playbackUrl:`https://app.bworlds.com/recordings/${this.recordingId}`,duration:e,eventCount:this.chunks.reduce((n,o)=>n+o.events.length,0),screenshotCount:r.length};return console.log("[BWorlds Recorder] Recording completed",{...i,metadata:this.metadata,screenshotMarkers:r.map(n=>({timestamp:n.timestamp,eventType:n.eventType}))}),console.log("[BWorlds Recorder] Recording data summary:",{chunks:this.chunks.length,screenshotMarkers:r.length,totalEvents:i.eventCount,duration:`${Math.round(e/1e3)}s`}),i}getData(){return{metadata:this.metadata,chunks:this.chunks,screenshotMarkers:this.screenshotMarkers}}}class md{constructor(e,t){this.sessionToken="",this.recordingId="",this.apiEndpoint=e,this.apiKey=t}async start(e){const t=await fetch(`${this.apiEndpoint}/api/recordings/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({api_key:this.apiKey,metadata:{url:e.url,user_agent:e.userAgent,viewport:e.viewport}})});if(!t.ok)throw new Error(`Failed to start recording: ${t.statusText}`);const r=await t.json();return this.sessionToken=r.session_token,this.recordingId=r.recording_id,{token:r.session_token,recordingId:r.recording_id,expiresAt:r.expires_at}}async uploadChunk(e){const t=await fetch(`${this.apiEndpoint}/api/recordings/${this.recordingId}/chunk`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.sessionToken}`},body:JSON.stringify({events:e.events,chunk_index:e.index})});if(!t.ok)throw new Error(`Failed to upload chunk: ${t.statusText}`)}async complete(e,t,r){const i=await fetch(`${this.apiEndpoint}/api/recordings/${this.recordingId}/complete`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.sessionToken}`},body:JSON.stringify({duration_ms:e,event_count:t,screenshot_markers:r.map(o=>({timestamp_ms:o.timestamp,event_type:o.eventType}))})});if(!i.ok)throw new Error(`Failed to complete recording: ${i.statusText}`);const n=await i.json();return{recordingId:this.recordingId,playbackUrl:n.playback_url,duration:e,eventCount:t,screenshotCount:r.length}}}var yr,T,oa,Ie,aa,la,ua,ca,Xs,Ks,Qs,mt={},ha=[],gd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,wr=Array.isArray;function ye(s,e){for(var t in e)s[t]=e[t];return s}function qs(s){s&&s.parentNode&&s.parentNode.removeChild(s)}function yd(s,e,t){var r,i,n,o={};for(n in e)n=="key"?r=e[n]:n=="ref"?i=e[n]:o[n]=e[n];if(arguments.length>2&&(o.children=arguments.length>3?yr.call(arguments,2):t),typeof s=="function"&&s.defaultProps!=null)for(n in s.defaultProps)o[n]===void 0&&(o[n]=s.defaultProps[n]);return br(s,o,r,i,null)}function br(s,e,t,r,i){var n={type:s,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++oa,__i:-1,__u:0};return i==null&&T.vnode!=null&&T.vnode(n),n}function He(s){return s.children}function vr(s,e){this.props=s,this.context=e}function je(s,e){if(e==null)return s.__?je(s.__,s.__i+1):null;for(var t;e<s.__k.length;e++)if((t=s.__k[e])!=null&&t.__e!=null)return t.__e;return typeof s.type=="function"?je(s):null}function fa(s){var e,t;if((s=s.__)!=null&&s.__c!=null){for(s.__e=s.__c.base=null,e=0;e<s.__k.length;e++)if((t=s.__k[e])!=null&&t.__e!=null){s.__e=s.__c.base=t.__e;break}return fa(s)}}function da(s){(!s.__d&&(s.__d=!0)&&Ie.push(s)&&!Sr.__r++||aa!=T.debounceRendering)&&((aa=T.debounceRendering)||la)(Sr)}function Sr(){for(var s,e,t,r,i,n,o,l=1;Ie.length;)Ie.length>l&&Ie.sort(ua),s=Ie.shift(),l=Ie.length,s.__d&&(t=void 0,r=void 0,i=(r=(e=s).__v).__e,n=[],o=[],e.__P&&((t=ye({},r)).__v=r.__v+1,T.vnode&&T.vnode(t),ei(e.__P,t,r,e.__n,e.__P.namespaceURI,32&r.__u?[i]:null,n,i??je(r),!!(32&r.__u),o),t.__v=r.__v,t.__.__k[t.__i]=t,wa(n,t,o),r.__e=r.__=null,t.__e!=i&&fa(t)));Sr.__r=0}function pa(s,e,t,r,i,n,o,l,a,u,c){var h,p,d,g,m,f,v,b=r&&r.__k||ha,y=e.length;for(a=wd(t,e,b,a,y),h=0;h<y;h++)(d=t.__k[h])!=null&&(p=d.__i==-1?mt:b[d.__i]||mt,d.__i=h,f=ei(s,d,p,i,n,o,l,a,u,c),g=d.__e,d.ref&&p.ref!=d.ref&&(p.ref&&ri(p.ref,null,d),c.push(d.ref,d.__c||g,d)),m==null&&g!=null&&(m=g),(v=!!(4&d.__u))||p.__k===d.__k?a=ma(d,a,s,v):typeof d.type=="function"&&f!==void 0?a=f:g&&(a=g.nextSibling),d.__u&=-7);return t.__e=m,a}function wd(s,e,t,r,i){var n,o,l,a,u,c=t.length,h=c,p=0;for(s.__k=new Array(i),n=0;n<i;n++)(o=e[n])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=s.__k[n]=br(null,o,null,null,null):wr(o)?o=s.__k[n]=br(He,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=s.__k[n]=br(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):s.__k[n]=o,a=n+p,o.__=s,o.__b=s.__b+1,l=null,(u=o.__i=bd(o,t,a,h))!=-1&&(h--,(l=t[u])&&(l.__u|=2)),l==null||l.__v==null?(u==-1&&(i>c?p--:i<c&&p++),typeof o.type!="function"&&(o.__u|=4)):u!=a&&(u==a-1?p--:u==a+1?p++:(u>a?p--:p++,o.__u|=4))):s.__k[n]=null;if(h)for(n=0;n<c;n++)(l=t[n])!=null&&(2&l.__u)==0&&(l.__e==r&&(r=je(l)),va(l,l));return r}function ma(s,e,t,r){var i,n;if(typeof s.type=="function"){for(i=s.__k,n=0;i&&n<i.length;n++)i[n]&&(i[n].__=s,e=ma(i[n],e,t,r));return e}s.__e!=e&&(r&&(e&&s.type&&!e.parentNode&&(e=je(s)),t.insertBefore(s.__e,e||null)),e=s.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function bd(s,e,t,r){var i,n,o,l=s.key,a=s.type,u=e[t],c=u!=null&&(2&u.__u)==0;if(u===null&&l==null||c&&l==u.key&&a==u.type)return t;if(r>(c?1:0)){for(i=t-1,n=t+1;i>=0||n<e.length;)if((u=e[o=i>=0?i--:n++])!=null&&(2&u.__u)==0&&l==u.key&&a==u.type)return o}return-1}function ga(s,e,t){e[0]=="-"?s.setProperty(e,t??""):s[e]=t==null?"":typeof t!="number"||gd.test(e)?t:t+"px"}function Cr(s,e,t,r,i){var n,o;e:if(e=="style")if(typeof t=="string")s.style.cssText=t;else{if(typeof r=="string"&&(s.style.cssText=r=""),r)for(e in r)t&&e in t||ga(s.style,e,"");if(t)for(e in t)r&&t[e]==r[e]||ga(s.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")n=e!=(e=e.replace(ca,"$1")),o=e.toLowerCase(),e=o in s||e=="onFocusOut"||e=="onFocusIn"?o.slice(2):e.slice(2),s.l||(s.l={}),s.l[e+n]=t,t?r?t.u=r.u:(t.u=Xs,s.addEventListener(e,n?Qs:Ks,n)):s.removeEventListener(e,n?Qs:Ks,n);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in s)try{s[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?s.removeAttribute(e):s.setAttribute(e,e=="popover"&&t==1?"":t))}}function ya(s){return function(e){if(this.l){var t=this.l[e.type+s];if(e.t==null)e.t=Xs++;else if(e.t<t.u)return;return t(T.event?T.event(e):e)}}}function ei(s,e,t,r,i,n,o,l,a,u){var c,h,p,d,g,m,f,v,b,y,C,k,M,V,N,L,Y,W=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(a=!!(32&t.__u),n=[l=e.__e=t.__e]),(c=T.__b)&&c(e);e:if(typeof W=="function")try{if(v=e.props,b="prototype"in W&&W.prototype.render,y=(c=W.contextType)&&r[c.__c],C=c?y?y.props.value:c.__:r,t.__c?f=(h=e.__c=t.__c).__=h.__E:(b?e.__c=h=new W(v,C):(e.__c=h=new vr(v,C),h.constructor=W,h.render=Sd),y&&y.sub(h),h.state||(h.state={}),h.__n=r,p=h.__d=!0,h.__h=[],h._sb=[]),b&&h.__s==null&&(h.__s=h.state),b&&W.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=ye({},h.__s)),ye(h.__s,W.getDerivedStateFromProps(v,h.__s))),d=h.props,g=h.state,h.__v=e,p)b&&W.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),b&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(b&&W.getDerivedStateFromProps==null&&v!==d&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(v,C),e.__v==t.__v||!h.__e&&h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(v,h.__s,C)===!1){for(e.__v!=t.__v&&(h.props=v,h.state=h.__s,h.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(Q){Q&&(Q.__=e)}),k=0;k<h._sb.length;k++)h.__h.push(h._sb[k]);h._sb=[],h.__h.length&&o.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(v,h.__s,C),b&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(d,g,m)})}if(h.context=C,h.props=v,h.__P=s,h.__e=!1,M=T.__r,V=0,b){for(h.state=h.__s,h.__d=!1,M&&M(e),c=h.render(h.props,h.state,h.context),N=0;N<h._sb.length;N++)h.__h.push(h._sb[N]);h._sb=[]}else do h.__d=!1,M&&M(e),c=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++V<25);h.state=h.__s,h.getChildContext!=null&&(r=ye(ye({},r),h.getChildContext())),b&&!p&&h.getSnapshotBeforeUpdate!=null&&(m=h.getSnapshotBeforeUpdate(d,g)),L=c,c!=null&&c.type===He&&c.key==null&&(L=ba(c.props.children)),l=pa(s,wr(L)?L:[L],e,t,r,i,n,o,l,a,u),h.base=e.__e,e.__u&=-161,h.__h.length&&o.push(h),f&&(h.__E=h.__=null)}catch(Q){if(e.__v=null,a||n!=null)if(Q.then){for(e.__u|=a?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;n[n.indexOf(l)]=null,e.__e=l}else{for(Y=n.length;Y--;)qs(n[Y]);ti(e)}else e.__e=t.__e,e.__k=t.__k,Q.then||ti(e);T.__e(Q,e,t)}else n==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):l=e.__e=vd(t.__e,e,t,r,i,n,o,a,u);return(c=T.diffed)&&c(e),128&e.__u?void 0:l}function ti(s){s&&s.__c&&(s.__c.__e=!0),s&&s.__k&&s.__k.forEach(ti)}function wa(s,e,t){for(var r=0;r<t.length;r++)ri(t[r],t[++r],t[++r]);T.__c&&T.__c(e,s),s.some(function(i){try{s=i.__h,i.__h=[],s.some(function(n){n.call(i)})}catch(n){T.__e(n,i.__v)}})}function ba(s){return typeof s!="object"||s==null||s.__b&&s.__b>0?s:wr(s)?s.map(ba):ye({},s)}function vd(s,e,t,r,i,n,o,l,a){var u,c,h,p,d,g,m,f=t.props||mt,v=e.props,b=e.type;if(b=="svg"?i="http://www.w3.org/2000/svg":b=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),n!=null){for(u=0;u<n.length;u++)if((d=n[u])&&"setAttribute"in d==!!b&&(b?d.localName==b:d.nodeType==3)){s=d,n[u]=null;break}}if(s==null){if(b==null)return document.createTextNode(v);s=document.createElementNS(i,b,v.is&&v),l&&(T.__m&&T.__m(e,n),l=!1),n=null}if(b==null)f===v||l&&s.data==v||(s.data=v);else{if(n=n&&yr.call(s.childNodes),!l&&n!=null)for(f={},u=0;u<s.attributes.length;u++)f[(d=s.attributes[u]).name]=d.value;for(u in f)if(d=f[u],u!="children"){if(u=="dangerouslySetInnerHTML")h=d;else if(!(u in v)){if(u=="value"&&"defaultValue"in v||u=="checked"&&"defaultChecked"in v)continue;Cr(s,u,null,d,i)}}for(u in v)d=v[u],u=="children"?p=d:u=="dangerouslySetInnerHTML"?c=d:u=="value"?g=d:u=="checked"?m=d:l&&typeof d!="function"||f[u]===d||Cr(s,u,d,f[u],i);if(c)l||h&&(c.__html==h.__html||c.__html==s.innerHTML)||(s.innerHTML=c.__html),e.__k=[];else if(h&&(s.innerHTML=""),pa(e.type=="template"?s.content:s,wr(p)?p:[p],e,t,r,b=="foreignObject"?"http://www.w3.org/1999/xhtml":i,n,o,n?n[0]:t.__k&&je(t,0),l,a),n!=null)for(u=n.length;u--;)qs(n[u]);l||(u="value",b=="progress"&&g==null?s.removeAttribute("value"):g!=null&&(g!==s[u]||b=="progress"&&!g||b=="option"&&g!=f[u])&&Cr(s,u,g,f[u],i),u="checked",m!=null&&m!=s[u]&&Cr(s,u,m,f[u],i))}return s}function ri(s,e,t){try{if(typeof s=="function"){var r=typeof s.__u=="function";r&&s.__u(),r&&e==null||(s.__u=s(e))}else s.current=e}catch(i){T.__e(i,t)}}function va(s,e,t){var r,i;if(T.unmount&&T.unmount(s),(r=s.ref)&&(r.current&&r.current!=s.__e||ri(r,null,e)),(r=s.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(n){T.__e(n,e)}r.base=r.__P=null}if(r=s.__k)for(i=0;i<r.length;i++)r[i]&&va(r[i],e,t||typeof s.type!="function");t||qs(s.__e),s.__c=s.__=s.__e=void 0}function Sd(s,e,t){return this.constructor(s,t)}function _r(s,e,t){var r,i,n,o;e==document&&(e=document.documentElement),T.__&&T.__(s,e),i=(r=!1)?null:e.__k,n=[],o=[],ei(e,s=e.__k=yd(He,null,[s]),i||mt,mt,e.namespaceURI,i?null:e.firstChild?yr.call(e.childNodes):null,n,i?i.__e:e.firstChild,r,o),wa(n,s,o)}yr=ha.slice,T={__e:function(s,e,t,r){for(var i,n,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((n=i.constructor)&&n.getDerivedStateFromError!=null&&(i.setState(n.getDerivedStateFromError(s)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(s,r||{}),o=i.__d),o)return i.__E=i}catch(l){s=l}throw s}},oa=0,vr.prototype.setState=function(s,e){var t;t=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ye({},this.state),typeof s=="function"&&(s=s(ye({},t),this.props)),s&&ye(t,s),s!=null&&this.__v&&(e&&this._sb.push(e),da(this))},vr.prototype.forceUpdate=function(s){this.__v&&(this.__e=!0,s&&this.__h.push(s),da(this))},vr.prototype.render=He,Ie=[],la=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ua=function(s,e){return s.__v.__b-e.__v.__b},Sr.__r=0,ca=/(PointerCapture)$|Capture$/i,Xs=0,Ks=ya(!1),Qs=ya(!0);var Cd=0;function w(s,e,t,r,i,n){e||(e={});var o,l,a=e;if("ref"in a)for(l in a={},e)l=="ref"?o=e[l]:a[l]=e[l];var u={type:s,props:a,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Cd,__i:-1,__u:0,__source:i,__self:n};if(typeof s=="function"&&(o=s.defaultProps))for(l in o)a[l]===void 0&&(a[l]=o[l]);return T.vnode&&T.vnode(u),u}const si="bw-recorder-styles",_d=`
60
60
  .bw-recorder-toolbar {
61
61
  --bw-cream: #FAF7F2;
62
62
  --bw-cream-dim: #F0EBE0;
@@ -437,5 +437,5 @@ or you can use record.mirror to access the mirror instance during recording.`;le
437
437
  color: #6b7280;
438
438
  margin: 0;
439
439
  }
440
- `;let xr=!1;function Sa(){if(xr||typeof document>"u")return;if(document.getElementById(si)){xr=!0;return}const s=document.createElement("style");s.id=si,s.textContent=xd,document.head.appendChild(s),xr=!0}function Id(){const s=document.getElementById(si);s&&(s.remove(),xr=!1)}const Rd=()=>w("svg",{viewBox:"0 0 24 24",fill:"currentColor",stroke:"none",children:w("path",{d:"M8 5v14l11-7z"})}),kd=()=>w("svg",{viewBox:"0 0 24 24",fill:"currentColor",stroke:"none",children:w("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"})}),Ed=()=>w("svg",{viewBox:"0 0 24 24",fill:"currentColor",stroke:"none",children:w("path",{d:"M6 6h12v12H6z"})}),Md=()=>w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:[w("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),w("circle",{cx:"12",cy:"13",r:"4"})]}),Ad=()=>w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:w("path",{d:"M20 6L9 17l-5-5"})}),Od=()=>w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",class:"bw-spin",children:w("path",{d:"M12 2v4m0 12v4m10-10h-4M6 12H2m15.07-5.07l-2.83 2.83M9.76 14.24l-2.83 2.83m11.14 0l-2.83-2.83M9.76 9.76L6.93 6.93"})});function $d(s){const e=Math.floor(s/1e3),t=Math.floor(e/60),r=e%60;return`${t.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`}function Nd({position:s,state:e,elapsedTime:t,result:r,onStart:i,onPause:n,onResume:o,onStop:l,onScreenshot:a,onRestart:u}){if(e==="idle")return w("div",{class:`bw-recorder-toolbar ${s}`,"data-bw-recorder-ui":!0,children:w("button",{class:"bw-toolbar-idle",onClick:i,type:"button",children:[w("span",{class:"bw-idle-icon"}),w("span",{class:"bw-idle-text",children:"Start Recording"}),w("span",{class:"bw-idle-logo",children:"bw"})]})});if(e==="stopped"&&r)return w("div",{class:`bw-recorder-toolbar ${s}`,"data-bw-recorder-ui":!0,children:w("div",{class:"bw-toolbar-complete",children:[w("span",{class:"bw-complete-icon",children:w(Ad,{})}),w("span",{class:"bw-complete-text",children:["Recording saved!"," ",w("a",{href:r.playbackUrl,target:"_blank",rel:"noopener noreferrer",children:"View"})]}),w("button",{class:"bw-restart-btn",onClick:u,type:"button",title:"Start new recording",children:"New"})]})});if(e==="stopped")return w("div",{class:`bw-recorder-toolbar ${s}`,"data-bw-recorder-ui":!0,children:w("div",{class:"bw-toolbar-complete",children:[w("span",{class:"bw-complete-icon bw-saving",children:w(Od,{})}),w("span",{class:"bw-complete-text",children:"Saving..."})]})});const c=e==="recording",h=e==="paused";return w("div",{class:`bw-recorder-toolbar ${s}`,"data-bw-recorder-ui":!0,children:w("div",{class:"bw-toolbar-container",children:[w("div",{class:"bw-toolbar-status",children:[w("span",{class:`bw-status-indicator ${c?"recording":""} ${h?"paused":""}`}),w("span",{class:"bw-status-text",children:c?"Recording":"Paused"}),w("span",{class:"bw-status-time",children:$d(t)})]}),w("button",{class:"bw-toolbar-btn",onClick:c?n:o,title:c?"Pause":"Resume",type:"button",children:c?w(kd,{}):w(Rd,{})}),w("button",{class:"bw-toolbar-btn stop",onClick:l,title:"Stop Recording",type:"button",children:w(Ed,{})}),w("div",{class:"bw-toolbar-divider"}),w("button",{class:"bw-toolbar-btn",onClick:a,title:"Take Screenshot",disabled:!c,type:"button",children:w(Md,{})}),w("div",{class:"bw-toolbar-divider"}),w("span",{class:"bw-toolbar-logo",children:"bw"})]})})}class Td{constructor(e="bottom-right"){this.container=null,this.state="idle",this.elapsedTime=0,this.result=null,this.updateInterval=null,this.getElapsedTime=null,this.onStartCallback=null,this.onPauseCallback=null,this.onResumeCallback=null,this.onStopCallback=null,this.onScreenshotCallback=null,this.onRestartCallback=null,this.position=e}mount(){this.container||(Sa(),this.container=document.createElement("div"),this.container.id="bw-recorder-root",this.container.setAttribute("data-bw-recorder-ui",""),document.body.appendChild(this.container),this.render())}unmount(){this.updateInterval&&(clearInterval(this.updateInterval),this.updateInterval=null),this.container&&(_r(null,this.container),this.container.remove(),this.container=null),Id()}setCallbacks(e){this.onStartCallback=e.onStart??null,this.onPauseCallback=e.onPause??null,this.onResumeCallback=e.onResume??null,this.onStopCallback=e.onStop??null,this.onScreenshotCallback=e.onScreenshot??null,this.onRestartCallback=e.onRestart??null,this.getElapsedTime=e.getElapsedTime??null}setState(e){this.state=e,e==="recording"?this.startTimeUpdates():(e==="stopped"||e==="idle")&&this.stopTimeUpdates(),this.render()}setResult(e){this.result=e,this.render()}reset(){this.state="idle",this.result=null,this.elapsedTime=0,this.render()}startTimeUpdates(){this.updateInterval||(this.updateInterval=setInterval(()=>{this.getElapsedTime&&(this.elapsedTime=this.getElapsedTime(),this.render())},100))}stopTimeUpdates(){this.updateInterval&&(clearInterval(this.updateInterval),this.updateInterval=null)}render(){this.container&&_r(w(Nd,{position:this.position,state:this.state,elapsedTime:this.elapsedTime,result:this.result,onStart:()=>{var e;return(e=this.onStartCallback)==null?void 0:e.call(this)},onPause:()=>{var e;return(e=this.onPauseCallback)==null?void 0:e.call(this)},onResume:()=>{var e;return(e=this.onResumeCallback)==null?void 0:e.call(this)},onStop:()=>{var e;return(e=this.onStopCallback)==null?void 0:e.call(this)},onScreenshot:()=>{var e;return(e=this.onScreenshotCallback)==null?void 0:e.call(this)},onRestart:()=>{var e;return(e=this.onRestartCallback)==null?void 0:e.call(this)}}),this.container)}}var ii,Z,ni,Ca,oi=0,_a=[],X=T,xa=X.__b,Ia=X.__r,Ra=X.diffed,ka=X.__c,Ea=X.unmount,Ma=X.__;function Pd(s,e){X.__h&&X.__h(Z,s,oi||e),oi=0;var t=Z.__H||(Z.__H={__:[],__h:[]});return s>=t.__.length&&t.__.push({}),t.__[s]}function ai(s){return oi=1,Dd(Oa,s)}function Dd(s,e,t){var r=Pd(ii++,2);if(r.t=s,!r.__c&&(r.__=[Oa(void 0,e),function(l){var a=r.__N?r.__N[0]:r.__[0],u=r.t(a,l);a!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=Z,!Z.__f)){var i=function(l,a,u){if(!r.__c.__H)return!0;var c=r.__c.__H.__.filter(function(p){return!!p.__c});if(c.every(function(p){return!p.__N}))return!n||n.call(this,l,a,u);var h=r.__c.props!==l;return c.forEach(function(p){if(p.__N){var d=p.__[0];p.__=p.__N,p.__N=void 0,d!==p.__[0]&&(h=!0)}}),n&&n.call(this,l,a,u)||h};Z.__f=!0;var n=Z.shouldComponentUpdate,o=Z.componentWillUpdate;Z.componentWillUpdate=function(l,a,u){if(this.__e){var c=n;n=void 0,i(l,a,u),n=c}o&&o.call(this,l,a,u)},Z.shouldComponentUpdate=i}return r.__N||r.__}function Ld(){for(var s;s=_a.shift();)if(s.__P&&s.__H)try{s.__H.__h.forEach(Ir),s.__H.__h.forEach(li),s.__H.__h=[]}catch(e){s.__H.__h=[],X.__e(e,s.__v)}}X.__b=function(s){Z=null,xa&&xa(s)},X.__=function(s,e){s&&e.__k&&e.__k.__m&&(s.__m=e.__k.__m),Ma&&Ma(s,e)},X.__r=function(s){Ia&&Ia(s),ii=0;var e=(Z=s.__c).__H;e&&(ni===Z?(e.__h=[],Z.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.forEach(Ir),e.__h.forEach(li),e.__h=[],ii=0)),ni=Z},X.diffed=function(s){Ra&&Ra(s);var e=s.__c;e&&e.__H&&(e.__H.__h.length&&(_a.push(e)!==1&&Ca===X.requestAnimationFrame||((Ca=X.requestAnimationFrame)||Fd)(Ld)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.u=void 0})),ni=Z=null},X.__c=function(s,e){e.some(function(t){try{t.__h.forEach(Ir),t.__h=t.__h.filter(function(r){return!r.__||li(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],X.__e(r,t.__v)}}),ka&&ka(s,e)},X.unmount=function(s){Ea&&Ea(s);var e,t=s.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{Ir(r)}catch(i){e=i}}),t.__H=void 0,e&&X.__e(e,t.__v))};var Aa=typeof requestAnimationFrame=="function";function Fd(s){var e,t=function(){clearTimeout(r),Aa&&cancelAnimationFrame(e),setTimeout(s)},r=setTimeout(t,35);Aa&&(e=requestAnimationFrame(t))}function Ir(s){var e=Z,t=s.__c;typeof t=="function"&&(s.__c=void 0,t()),Z=e}function li(s){var e=Z;s.__c=s.__(),Z=e}function Oa(s,e){return typeof e=="function"?e(s):e}const Rr="bw_invite_completed",Ud=()=>w("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[w("path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9"}),w("path",{d:"m18 15 4-4"}),w("path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5"})]}),Bd=()=>w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[w("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),w("circle",{cx:"12",cy:"12",r:"3"})]}),zd=()=>w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[w("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),w("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}),Wd=()=>w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[w("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),w("polyline",{points:"22 4 12 14.01 9 11.01"})]}),Hd=()=>w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",class:"bw-invite-spin",children:w("path",{d:"M12 2v4m0 12v4m10-10h-4M6 12H2m15.07-5.07l-2.83 2.83M9.76 14.24l-2.83 2.83m11.14 0l-2.83-2.83M9.76 9.76L6.93 6.93"})});function jd({email:s,onComplete:e,onLogin:t}){const[r,i]=ai("form"),[n,o]=ai(""),[l,a]=ai(!1),u=h=>{h.preventDefault(),n.trim()&&(i("loading"),setTimeout(()=>{i("success"),localStorage.setItem(Rr,JSON.stringify({email:s,timestamp:Date.now()})),setTimeout(()=>{e()},1500)},1200))},c=h=>{h.preventDefault(),localStorage.setItem(Rr,JSON.stringify({email:s,timestamp:Date.now()})),t()};return w("div",{class:"bw-invite-overlay","data-bw-launchkit-ui":!0,children:w("div",{class:"bw-invite-dialog",children:r==="success"?w("div",{class:"bw-invite-success",children:[w("div",{class:"bw-invite-success-icon",children:w(Wd,{})}),w("h2",{class:"bw-invite-success-title",children:"You're in!"}),w("p",{class:"bw-invite-success-text",children:"Welcome aboard."})]}):w(He,{children:[w("div",{class:"bw-invite-logo",children:w(Ud,{})}),w("h2",{class:"bw-invite-title",children:"Welcome"}),w("p",{class:"bw-invite-subtitle",children:"You've been invited. Set a password to continue."}),w("form",{class:"bw-invite-form",onSubmit:u,children:[w("div",{class:"bw-invite-field",children:w("input",{type:"email",value:s,readonly:!0,class:"bw-invite-input",placeholder:"Email address"})}),w("div",{class:"bw-invite-field",children:[w("input",{type:l?"text":"password",value:n,onInput:h=>o(h.target.value),class:"bw-invite-input",placeholder:"Password",disabled:r==="loading",autoFocus:!0}),w("button",{type:"button",class:"bw-invite-eye-btn",onClick:()=>a(!l),tabIndex:-1,children:l?w(zd,{}):w(Bd,{})})]}),w("button",{type:"submit",class:"bw-invite-submit",disabled:r==="loading"||!n.trim(),children:r==="loading"?w(He,{children:[w(Hd,{}),w("span",{children:"Setting up..."})]}):"Continue"})]}),w("p",{class:"bw-invite-login-text",children:["Already have an account?"," ",w("a",{href:"#",onClick:c,class:"bw-invite-login-link",children:"Log in"})]})]})})})}class ui{constructor(e){this.container=null,this.onCompleteCallback=null,this.handleComplete=()=>{var t;this.unmount(),(t=this.onCompleteCallback)==null||t.call(this)},this.handleLogin=()=>{var t;this.unmount(),(t=this.onCompleteCallback)==null||t.call(this)},this.email=e}static isCompleted(){return typeof localStorage>"u"?!1:localStorage.getItem(Rr)!==null}static clearCompletion(){typeof localStorage>"u"||localStorage.removeItem(Rr)}mount(){this.container||(Sa(),this.container=document.createElement("div"),this.container.id="bw-invite-root",this.container.setAttribute("data-bw-launchkit-ui",""),document.body.appendChild(this.container),this.render())}unmount(){this.container&&(_r(null,this.container),this.container.remove(),this.container=null)}onComplete(e){this.onCompleteCallback=e}render(){this.container&&_r(w(jd,{email:this.email,onComplete:this.handleComplete,onLogin:this.handleLogin}),this.container)}}class ci{constructor(e){this.toolbar=null,this.isInitialized=!1;const t=e.onStateChange;this.config={apiEndpoint:"https://api.bworlds.com",maxDuration:900*1e3,maskInputs:!0,autoOpenPlayback:!0,toolbar:{enabled:!0,position:"bottom-right"},...e,onStateChange:n=>{this.handleStateChange(n),t==null||t(n)}},this.recorder=new fd(this.config),this.screenshotMarker=new dd,this.eventDetector=new pd(this.screenshotMarker);const i=this.config.apiEndpoint&&this.config.apiEndpoint!=="https://api.bworlds.com"?new gd(this.config.apiEndpoint,this.config.apiKey):new md;this.recorder.setUploader(i),this.recorder.onEvent(n=>{this.eventDetector.handleRrwebEvent(n)})}init(){var e,t;if(!this.isInitialized&&(this.isInitialized=!0,((e=this.config.toolbar)==null?void 0:e.enabled)!==!1)){const r=((t=this.config.toolbar)==null?void 0:t.position)??"bottom-right";this.toolbar=new Td(r),this.toolbar.setCallbacks({onStart:()=>this.start(),onPause:()=>this.pause(),onResume:()=>this.resume(),onStop:()=>this.stop(),onScreenshot:()=>this.screenshot(),onRestart:()=>this.restart(),getElapsedTime:()=>this.recorder.getElapsedTime()}),this.toolbar.mount()}}async start(){var e;await this.recorder.start(),this.screenshotMarker.setStartTime(Date.now()),this.eventDetector.start(),(e=this.toolbar)==null||e.setState("recording")}pause(){var e;this.recorder.pause(),(e=this.toolbar)==null||e.setState("paused")}resume(){var e;this.recorder.resume(),(e=this.toolbar)==null||e.setState("recording")}async stop(){var n,o,l;this.eventDetector.stop(),this.screenshotMarker.stop();const e=this.screenshotMarker.getMarkers(),t=await this.recorder.stop(e);if((n=this.toolbar)==null||n.setState("stopped"),t)return(o=this.toolbar)==null||o.setResult(t),this.config.autoOpenPlayback!==!1&&t.playbackUrl&&window.open(t.playbackUrl,"_blank"),t;const r=this.recorder.getEvents(),i={recordingId:`rec_${Date.now()}`,playbackUrl:"",duration:this.recorder.getElapsedTime(),eventCount:r.length,screenshotCount:e.length};return(l=this.toolbar)==null||l.setResult(i),i}screenshot(){this.screenshotMarker.capture("manual")}restart(){var e;this.eventDetector.destroy(),this.recorder.reset(),this.screenshotMarker.reset(),(e=this.toolbar)==null||e.reset()}getState(){return this.recorder.getState()}getElapsedTime(){return this.recorder.getElapsedTime()}destroy(){var e;this.eventDetector.destroy(),this.recorder.reset(),this.screenshotMarker.reset(),(e=this.toolbar)==null||e.unmount(),this.isInitialized=!1}handleStateChange(e){var t;(t=this.toolbar)==null||t.setState(e)}}const Gd="_bw_record",Vd="_bw_invite";function Yd(){return typeof window>"u"?null:new URLSearchParams(window.location.search).get(Gd)}function Zd(){return typeof window>"u"?null:new URLSearchParams(window.location.search).get(Vd)}function Jd(){const s=Yd(),e=Zd();document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{e&&$a(e),s&&Na(s)}):(e&&$a(e),s&&Na(s))}function $a(s){if(ui.isCompleted()){console.log("[BWorlds LaunchKit] Invite already completed");return}console.log("[BWorlds LaunchKit] Showing invite dialog for:",s);const e=new ui(s);e.onComplete(()=>{console.log("[BWorlds LaunchKit] Invite flow completed")}),e.mount(),typeof window<"u"&&(window.__bwInviteDialog=e)}function Na(s){const t=new URLSearchParams(window.location.search).get("_bw_api")||"http://localhost:3941";console.log("[BWorlds Recorder] Initializing with endpoint:",t);const r=new ci({apiKey:s,apiEndpoint:t,onComplete:i=>{console.log("[BWorlds Recorder] Recording complete:",i.playbackUrl)},onError:i=>{console.error("[BWorlds Recorder] Error:",i)}});r.init(),typeof window<"u"&&(window.__bwRecorder=r)}Jd(),ye.DemoRecorder=ci,ye.InviteDialogController=ui,ye.default=ci,Object.defineProperties(ye,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
440
+ `;let xr=!1;function Sa(){if(xr||typeof document>"u")return;if(document.getElementById(si)){xr=!0;return}const s=document.createElement("style");s.id=si,s.textContent=_d,document.head.appendChild(s),xr=!0}function xd(){const s=document.getElementById(si);s&&(s.remove(),xr=!1)}const Id=()=>w("svg",{viewBox:"0 0 24 24",fill:"currentColor",stroke:"none",children:w("path",{d:"M8 5v14l11-7z"})}),Rd=()=>w("svg",{viewBox:"0 0 24 24",fill:"currentColor",stroke:"none",children:w("path",{d:"M6 4h4v16H6V4zm8 0h4v16h-4V4z"})}),kd=()=>w("svg",{viewBox:"0 0 24 24",fill:"currentColor",stroke:"none",children:w("path",{d:"M6 6h12v12H6z"})}),Ed=()=>w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:[w("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),w("circle",{cx:"12",cy:"13",r:"4"})]}),Md=()=>w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",children:w("path",{d:"M20 6L9 17l-5-5"})}),Ad=()=>w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",class:"bw-spin",children:w("path",{d:"M12 2v4m0 12v4m10-10h-4M6 12H2m15.07-5.07l-2.83 2.83M9.76 14.24l-2.83 2.83m11.14 0l-2.83-2.83M9.76 9.76L6.93 6.93"})});function Od(s){const e=Math.floor(s/1e3),t=Math.floor(e/60),r=e%60;return`${t.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`}function $d({position:s,state:e,elapsedTime:t,result:r,onStart:i,onPause:n,onResume:o,onStop:l,onScreenshot:a,onRestart:u}){if(e==="idle")return w("div",{class:`bw-recorder-toolbar ${s}`,"data-bw-recorder-ui":!0,children:w("button",{class:"bw-toolbar-idle",onClick:i,type:"button",children:[w("span",{class:"bw-idle-icon"}),w("span",{class:"bw-idle-text",children:"Start Recording"}),w("span",{class:"bw-idle-logo",children:"bw"})]})});if(e==="stopped"&&r)return w("div",{class:`bw-recorder-toolbar ${s}`,"data-bw-recorder-ui":!0,children:w("div",{class:"bw-toolbar-complete",children:[w("span",{class:"bw-complete-icon",children:w(Md,{})}),w("span",{class:"bw-complete-text",children:["Recording saved!"," ",w("a",{href:r.playbackUrl,target:"_blank",rel:"noopener noreferrer",children:"View"})]}),w("button",{class:"bw-restart-btn",onClick:u,type:"button",title:"Start new recording",children:"New"})]})});if(e==="stopped")return w("div",{class:`bw-recorder-toolbar ${s}`,"data-bw-recorder-ui":!0,children:w("div",{class:"bw-toolbar-complete",children:[w("span",{class:"bw-complete-icon bw-saving",children:w(Ad,{})}),w("span",{class:"bw-complete-text",children:"Saving..."})]})});const c=e==="recording",h=e==="paused";return w("div",{class:`bw-recorder-toolbar ${s}`,"data-bw-recorder-ui":!0,children:w("div",{class:"bw-toolbar-container",children:[w("div",{class:"bw-toolbar-status",children:[w("span",{class:`bw-status-indicator ${c?"recording":""} ${h?"paused":""}`}),w("span",{class:"bw-status-text",children:c?"Recording":"Paused"}),w("span",{class:"bw-status-time",children:Od(t)})]}),w("button",{class:"bw-toolbar-btn",onClick:c?n:o,title:c?"Pause":"Resume",type:"button",children:c?w(Rd,{}):w(Id,{})}),w("button",{class:"bw-toolbar-btn stop",onClick:l,title:"Stop Recording",type:"button",children:w(kd,{})}),w("div",{class:"bw-toolbar-divider"}),w("button",{class:"bw-toolbar-btn",onClick:a,title:"Take Screenshot",disabled:!c,type:"button",children:w(Ed,{})}),w("div",{class:"bw-toolbar-divider"}),w("span",{class:"bw-toolbar-logo",children:"bw"})]})})}class Nd{constructor(e="bottom-right"){this.container=null,this.state="idle",this.elapsedTime=0,this.result=null,this.updateInterval=null,this.getElapsedTime=null,this.onStartCallback=null,this.onPauseCallback=null,this.onResumeCallback=null,this.onStopCallback=null,this.onScreenshotCallback=null,this.onRestartCallback=null,this.position=e}mount(){this.container||(Sa(),this.container=document.createElement("div"),this.container.id="bw-recorder-root",this.container.setAttribute("data-bw-recorder-ui",""),document.body.appendChild(this.container),this.render())}unmount(){this.updateInterval&&(clearInterval(this.updateInterval),this.updateInterval=null),this.container&&(_r(null,this.container),this.container.remove(),this.container=null),xd()}setCallbacks(e){this.onStartCallback=e.onStart??null,this.onPauseCallback=e.onPause??null,this.onResumeCallback=e.onResume??null,this.onStopCallback=e.onStop??null,this.onScreenshotCallback=e.onScreenshot??null,this.onRestartCallback=e.onRestart??null,this.getElapsedTime=e.getElapsedTime??null}setState(e){this.state=e,e==="recording"?this.startTimeUpdates():(e==="stopped"||e==="idle")&&this.stopTimeUpdates(),this.render()}setResult(e){this.result=e,this.render()}reset(){this.state="idle",this.result=null,this.elapsedTime=0,this.render()}startTimeUpdates(){this.updateInterval||(this.updateInterval=setInterval(()=>{this.getElapsedTime&&(this.elapsedTime=this.getElapsedTime(),this.render())},100))}stopTimeUpdates(){this.updateInterval&&(clearInterval(this.updateInterval),this.updateInterval=null)}render(){this.container&&_r(w($d,{position:this.position,state:this.state,elapsedTime:this.elapsedTime,result:this.result,onStart:()=>{var e;return(e=this.onStartCallback)==null?void 0:e.call(this)},onPause:()=>{var e;return(e=this.onPauseCallback)==null?void 0:e.call(this)},onResume:()=>{var e;return(e=this.onResumeCallback)==null?void 0:e.call(this)},onStop:()=>{var e;return(e=this.onStopCallback)==null?void 0:e.call(this)},onScreenshot:()=>{var e;return(e=this.onScreenshotCallback)==null?void 0:e.call(this)},onRestart:()=>{var e;return(e=this.onRestartCallback)==null?void 0:e.call(this)}}),this.container)}}var ii,Z,ni,Ca,oi=0,_a=[],X=T,xa=X.__b,Ia=X.__r,Ra=X.diffed,ka=X.__c,Ea=X.unmount,Ma=X.__;function Td(s,e){X.__h&&X.__h(Z,s,oi||e),oi=0;var t=Z.__H||(Z.__H={__:[],__h:[]});return s>=t.__.length&&t.__.push({}),t.__[s]}function ai(s){return oi=1,Pd(Oa,s)}function Pd(s,e,t){var r=Td(ii++,2);if(r.t=s,!r.__c&&(r.__=[Oa(void 0,e),function(l){var a=r.__N?r.__N[0]:r.__[0],u=r.t(a,l);a!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=Z,!Z.__f)){var i=function(l,a,u){if(!r.__c.__H)return!0;var c=r.__c.__H.__.filter(function(p){return!!p.__c});if(c.every(function(p){return!p.__N}))return!n||n.call(this,l,a,u);var h=r.__c.props!==l;return c.forEach(function(p){if(p.__N){var d=p.__[0];p.__=p.__N,p.__N=void 0,d!==p.__[0]&&(h=!0)}}),n&&n.call(this,l,a,u)||h};Z.__f=!0;var n=Z.shouldComponentUpdate,o=Z.componentWillUpdate;Z.componentWillUpdate=function(l,a,u){if(this.__e){var c=n;n=void 0,i(l,a,u),n=c}o&&o.call(this,l,a,u)},Z.shouldComponentUpdate=i}return r.__N||r.__}function Dd(){for(var s;s=_a.shift();)if(s.__P&&s.__H)try{s.__H.__h.forEach(Ir),s.__H.__h.forEach(li),s.__H.__h=[]}catch(e){s.__H.__h=[],X.__e(e,s.__v)}}X.__b=function(s){Z=null,xa&&xa(s)},X.__=function(s,e){s&&e.__k&&e.__k.__m&&(s.__m=e.__k.__m),Ma&&Ma(s,e)},X.__r=function(s){Ia&&Ia(s),ii=0;var e=(Z=s.__c).__H;e&&(ni===Z?(e.__h=[],Z.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.forEach(Ir),e.__h.forEach(li),e.__h=[],ii=0)),ni=Z},X.diffed=function(s){Ra&&Ra(s);var e=s.__c;e&&e.__H&&(e.__H.__h.length&&(_a.push(e)!==1&&Ca===X.requestAnimationFrame||((Ca=X.requestAnimationFrame)||Ld)(Dd)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.u=void 0})),ni=Z=null},X.__c=function(s,e){e.some(function(t){try{t.__h.forEach(Ir),t.__h=t.__h.filter(function(r){return!r.__||li(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],X.__e(r,t.__v)}}),ka&&ka(s,e)},X.unmount=function(s){Ea&&Ea(s);var e,t=s.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{Ir(r)}catch(i){e=i}}),t.__H=void 0,e&&X.__e(e,t.__v))};var Aa=typeof requestAnimationFrame=="function";function Ld(s){var e,t=function(){clearTimeout(r),Aa&&cancelAnimationFrame(e),setTimeout(s)},r=setTimeout(t,35);Aa&&(e=requestAnimationFrame(t))}function Ir(s){var e=Z,t=s.__c;typeof t=="function"&&(s.__c=void 0,t()),Z=e}function li(s){var e=Z;s.__c=s.__(),Z=e}function Oa(s,e){return typeof e=="function"?e(s):e}const Rr="bw_invite_completed",Fd=()=>w("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[w("path",{d:"m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9"}),w("path",{d:"m18 15 4-4"}),w("path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172V7l-2.26-2.26a6 6 0 0 0-4.202-1.756L9 2.96l.92.82A6.18 6.18 0 0 1 12 8.4V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5"})]}),Ud=()=>w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[w("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),w("circle",{cx:"12",cy:"12",r:"3"})]}),Bd=()=>w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[w("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),w("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}),zd=()=>w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[w("path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14"}),w("polyline",{points:"22 4 12 14.01 9 11.01"})]}),Wd=()=>w("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",class:"bw-invite-spin",children:w("path",{d:"M12 2v4m0 12v4m10-10h-4M6 12H2m15.07-5.07l-2.83 2.83M9.76 14.24l-2.83 2.83m11.14 0l-2.83-2.83M9.76 9.76L6.93 6.93"})});function Hd({email:s,onComplete:e,onLogin:t}){const[r,i]=ai("form"),[n,o]=ai(""),[l,a]=ai(!1),u=h=>{h.preventDefault(),n.trim()&&(i("loading"),setTimeout(()=>{i("success"),localStorage.setItem(Rr,JSON.stringify({email:s,timestamp:Date.now()})),setTimeout(()=>{e()},1500)},1200))},c=h=>{h.preventDefault(),localStorage.setItem(Rr,JSON.stringify({email:s,timestamp:Date.now()})),t()};return w("div",{class:"bw-invite-overlay","data-bw-launchkit-ui":!0,children:w("div",{class:"bw-invite-dialog",children:r==="success"?w("div",{class:"bw-invite-success",children:[w("div",{class:"bw-invite-success-icon",children:w(zd,{})}),w("h2",{class:"bw-invite-success-title",children:"You're in!"}),w("p",{class:"bw-invite-success-text",children:"Welcome aboard."})]}):w(He,{children:[w("div",{class:"bw-invite-logo",children:w(Fd,{})}),w("h2",{class:"bw-invite-title",children:"Welcome"}),w("p",{class:"bw-invite-subtitle",children:"You've been invited. Set a password to continue."}),w("form",{class:"bw-invite-form",onSubmit:u,children:[w("div",{class:"bw-invite-field",children:w("input",{type:"email",value:s,readonly:!0,class:"bw-invite-input",placeholder:"Email address"})}),w("div",{class:"bw-invite-field",children:[w("input",{type:l?"text":"password",value:n,onInput:h=>o(h.target.value),class:"bw-invite-input",placeholder:"Password",disabled:r==="loading",autoFocus:!0}),w("button",{type:"button",class:"bw-invite-eye-btn",onClick:()=>a(!l),tabIndex:-1,children:l?w(Bd,{}):w(Ud,{})})]}),w("button",{type:"submit",class:"bw-invite-submit",disabled:r==="loading"||!n.trim(),children:r==="loading"?w(He,{children:[w(Wd,{}),w("span",{children:"Setting up..."})]}):"Continue"})]}),w("p",{class:"bw-invite-login-text",children:["Already have an account?"," ",w("a",{href:"#",onClick:c,class:"bw-invite-login-link",children:"Log in"})]})]})})})}class ui{constructor(e){this.container=null,this.onCompleteCallback=null,this.handleComplete=()=>{var t;this.unmount(),(t=this.onCompleteCallback)==null||t.call(this)},this.handleLogin=()=>{var t;this.unmount(),(t=this.onCompleteCallback)==null||t.call(this)},this.email=e}static isCompleted(){return typeof localStorage>"u"?!1:localStorage.getItem(Rr)!==null}static clearCompletion(){typeof localStorage>"u"||localStorage.removeItem(Rr)}mount(){this.container||(Sa(),this.container=document.createElement("div"),this.container.id="bw-invite-root",this.container.setAttribute("data-bw-launchkit-ui",""),document.body.appendChild(this.container),this.render())}unmount(){this.container&&(_r(null,this.container),this.container.remove(),this.container=null)}onComplete(e){this.onCompleteCallback=e}render(){this.container&&_r(w(Hd,{email:this.email,onComplete:this.handleComplete,onLogin:this.handleLogin}),this.container)}}class ci{constructor(e){this.toolbar=null,this.isInitialized=!1;const t=e.onStateChange;this.config={apiEndpoint:"https://api.bworlds.com",maxDuration:900*1e3,maskInputs:!0,autoOpenPlayback:!0,toolbar:{enabled:!0,position:"bottom-right"},...e,onStateChange:n=>{this.handleStateChange(n),t==null||t(n)}},this.recorder=new hd(this.config),this.screenshotMarker=new fd,this.eventDetector=new dd(this.screenshotMarker);const i=this.config.apiEndpoint&&this.config.apiEndpoint!=="https://api.bworlds.com"?new md(this.config.apiEndpoint,this.config.apiKey):new pd;this.recorder.setUploader(i),this.recorder.onEvent(n=>{this.eventDetector.handleRrwebEvent(n)})}init(){var e,t;if(!this.isInitialized&&(this.isInitialized=!0,((e=this.config.toolbar)==null?void 0:e.enabled)!==!1)){const r=((t=this.config.toolbar)==null?void 0:t.position)??"bottom-right";this.toolbar=new Nd(r),this.toolbar.setCallbacks({onStart:()=>this.start(),onPause:()=>this.pause(),onResume:()=>this.resume(),onStop:()=>this.stop(),onScreenshot:()=>this.screenshot(),onRestart:()=>this.restart(),getElapsedTime:()=>this.recorder.getElapsedTime()}),this.toolbar.mount()}}async start(){var e;await this.recorder.start(),this.screenshotMarker.setStartTime(Date.now()),this.eventDetector.start(),(e=this.toolbar)==null||e.setState("recording")}pause(){var e;this.recorder.pause(),(e=this.toolbar)==null||e.setState("paused")}resume(){var e;this.recorder.resume(),(e=this.toolbar)==null||e.setState("recording")}async stop(){var n,o,l;this.eventDetector.stop(),this.screenshotMarker.stop();const e=this.screenshotMarker.getMarkers(),t=await this.recorder.stop(e);if((n=this.toolbar)==null||n.setState("stopped"),t)return(o=this.toolbar)==null||o.setResult(t),this.config.autoOpenPlayback!==!1&&t.playbackUrl&&window.open(t.playbackUrl,"_blank"),t;const r=this.recorder.getEvents(),i={recordingId:`rec_${Date.now()}`,playbackUrl:"",duration:this.recorder.getElapsedTime(),eventCount:r.length,screenshotCount:e.length};return(l=this.toolbar)==null||l.setResult(i),i}screenshot(){this.screenshotMarker.capture("manual")}restart(){var e;this.eventDetector.destroy(),this.recorder.reset(),this.screenshotMarker.reset(),(e=this.toolbar)==null||e.reset()}getState(){return this.recorder.getState()}getElapsedTime(){return this.recorder.getElapsedTime()}destroy(){var e;this.eventDetector.destroy(),this.recorder.reset(),this.screenshotMarker.reset(),(e=this.toolbar)==null||e.unmount(),this.isInitialized=!1}handleStateChange(e){var t;(t=this.toolbar)==null||t.setState(e)}}const jd="_bw_record",Gd="_bw_invite";function Vd(){return typeof window>"u"?null:new URLSearchParams(window.location.search).get(jd)}function Yd(){return typeof window>"u"?null:new URLSearchParams(window.location.search).get(Gd)}function Zd(s){if(ui.isCompleted()){console.log("[BWorlds LaunchKit] Invite already completed");return}console.log("[BWorlds LaunchKit] Showing invite dialog for:",s);const e=new ui(s);e.onComplete(()=>{console.log("[BWorlds LaunchKit] Invite flow completed")}),e.mount(),typeof window<"u"&&(window.__bwInviteDialog=e)}function Jd(s){const t=new URLSearchParams(window.location.search).get("_bw_api")||"http://localhost:3941";console.log("[BWorlds Recorder] Initializing with endpoint:",t);const r=new ci({apiKey:s,apiEndpoint:t,onComplete:i=>{console.log("[BWorlds Recorder] Recording complete:",i.playbackUrl)},onError:i=>{console.error("[BWorlds Recorder] Error:",i)}});r.init(),typeof window<"u"&&(window.__bwRecorder=r)}function Xd(){typeof window>"u"||(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>$a()):$a())}function $a(){const s=Vd(),e=Yd();e&&Zd(e),s&&Jd(s)}de.DemoRecorder=ci,de.InviteDialogController=ui,de.default=ci,de.init=Xd,Object.defineProperties(de,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
441
441
  //# sourceMappingURL=launchkit.umd.js.map