@prodact.ai/sdk 0.0.2 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,367 @@
1
+ "use strict";var Produck=(()=>{var Vl=Object.create;var zt=Object.defineProperty;var Gl=Object.getOwnPropertyDescriptor;var jl=Object.getOwnPropertyNames;var Kl=Object.getPrototypeOf,Yl=Object.prototype.hasOwnProperty;var Xl=(r=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(r,{get:(e,t)=>(typeof require!="undefined"?require:e)[t]}):r)(function(r){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var Jl=(r,e)=>()=>(r&&(e=r(r=0)),e);var En=(r,e)=>{for(var t in e)zt(r,t,{get:e[t],enumerable:!0})},xn=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of jl(e))!Yl.call(r,s)&&s!==t&&zt(r,s,{get:()=>e[s],enumerable:!(i=Gl(e,s))||i.enumerable});return r};var Zl=(r,e,t)=>(t=r!=null?Vl(Kl(r)):{},xn(e||!r||!r.__esModule?zt(t,"default",{value:r,enumerable:!0}):t,r)),ql=r=>xn(zt({},"__esModule",{value:!0}),r);var $l={};En($l,{EventType:()=>x,IncrementalSource:()=>E,MouseInteractions:()=>D,Replayer:()=>ks,ReplayerEvents:()=>O,addCustomEvent:()=>sm,canvasMutation:()=>Ts,freezePage:()=>nm,mirror:()=>Li,record:()=>Re,takeFullSnapshot:()=>om,utils:()=>wp});function Rs(r){if(Vt[r])return Vt[r];let e=globalThis[r],t=e.prototype,i=r in kn?kn[r]:void 0,s=!!(i&&i.every(a=>{var l,c;return!!((c=(l=Object.getOwnPropertyDescriptor(t,a))==null?void 0:l.get)!=null&&c.toString().includes("[native code]"))})),n=r in Rn?Rn[r]:void 0,o=!!(n&&n.every(a=>{var l;return typeof t[a]=="function"&&((l=t[a])==null?void 0:l.toString().includes("[native code]"))}));if(s&&o&&!oc())return Vt[r]=e.prototype,e.prototype;try{let a=document.createElement("iframe");document.body.appendChild(a);let l=a.contentWindow;if(!l)return e.prototype;let c=l[r].prototype;return document.body.removeChild(a),c?Vt[r]=c:t}catch(a){return t}}function Me(r,e,t){var i;let s=`${r}.${String(t)}`;if(hr[s])return hr[s].call(e);let n=Rs(r),o=(i=Object.getOwnPropertyDescriptor(n,t))==null?void 0:i.get;return o?(hr[s]=o,o.call(e)):e[t]}function _o(r,e,t){let i=`${r}.${String(t)}`;if(dr[i])return dr[i].bind(e);let n=Rs(r)[t];return typeof n!="function"?e[t]:(dr[i]=n,n.bind(e))}function ac(r){return Me("Node",r,"childNodes")}function lc(r){return Me("Node",r,"parentNode")}function cc(r){return Me("Node",r,"parentElement")}function uc(r){return Me("Node",r,"textContent")}function hc(r,e){return _o("Node",r,"contains")(e)}function dc(r){return _o("Node",r,"getRootNode")()}function fc(r){return!r||!("host"in r)?null:Me("ShadowRoot",r,"host")}function pc(r){return r.styleSheets}function mc(r){return!r||!("shadowRoot"in r)?null:Me("Element",r,"shadowRoot")}function gc(r,e){return Me("Element",r,"querySelector")(e)}function yc(r,e){return Me("Element",r,"querySelectorAll")(e)}function wc(){return Rs("MutationObserver").constructor}function Ns(r){return r.nodeType===r.ELEMENT_NODE}function gt(r){let e=r&&"host"in r&&"mode"in r&&Q.host(r)||null;return!!(e&&"shadowRoot"in e&&Q.shadowRoot(e)===r)}function yt(r){return Object.prototype.toString.call(r)==="[object ShadowRoot]"}function vc(r){return r.includes(" background-clip: text;")&&!r.includes(" -webkit-background-clip: text;")&&(r=r.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),r}function bc(r){let{cssText:e}=r;if(e.split('"').length<3)return e;let t=["@import",`url(${JSON.stringify(r.href)})`];return r.layerName===""?t.push("layer"):r.layerName&&t.push(`layer(${r.layerName})`),r.supportsText&&t.push(`supports(${r.supportsText})`),r.media.length&&t.push(r.media.mediaText),t.join(" ")+";"}function Mr(r){try{let e=r.rules||r.cssRules;if(!e)return null;let t=r.href;!t&&r.ownerNode&&r.ownerNode.ownerDocument&&(t=r.ownerNode.ownerDocument.location.href);let i=Array.from(e,s=>Fo(s,t)).join("");return vc(i)}catch(e){return null}}function Fo(r,e){if(Cc(r)){let t;try{t=Mr(r.styleSheet)||bc(r)}catch(i){t=r.cssText}return r.styleSheet.href?bi(t,r.styleSheet.href):t}else{let t=r.cssText;return Ec(r)&&r.selectorText.includes(":")&&(t=Sc(t)),e?bi(t,e):t}}function Sc(r){let e=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return r.replace(e,"$1\\$2")}function Cc(r){return"styleSheet"in r}function Ec(r){return"selectorText"in r}function Uo(){return new bt}function As({element:r,maskInputOptions:e,tagName:t,type:i,value:s,maskInputFn:n}){let o=s||"",a=i&&Te(i);return(e[t.toLowerCase()]||a&&e[a])&&(n?o=n(o,r):o="*".repeat(o.length)),o}function Te(r){return r.toLowerCase()}function xc(r){let e=r.getContext("2d");if(!e)return!0;let t=50;for(let i=0;i<r.width;i+=t)for(let s=0;s<r.height;s+=t){let n=e.getImageData,o=Nn in n?n[Nn]:n;if(new Uint32Array(o.call(e,i,s,Math.min(t,r.width-i),Math.min(t,r.height-s)).data.buffer).some(l=>l!==0))return!1}return!0}function Ic(r,e){return!r||!e||r.type!==e.type?!1:r.type===T.Document?r.compatMode===e.compatMode:r.type===T.DocumentType?r.name===e.name&&r.publicId===e.publicId&&r.systemId===e.systemId:r.type===T.Comment||r.type===T.Text||r.type===T.CDATA?r.textContent===e.textContent:r.type===T.Element?r.tagName===e.tagName&&JSON.stringify(r.attributes)===JSON.stringify(e.attributes)&&r.isSVG===e.isSVG&&r.needBlock===e.needBlock:!1}function Os(r){let e=r.type;return r.hasAttribute("data-rr-is-password")?"password":e?Te(e):null}function Bo(r,e){var n;let t;try{t=new URL(r,e!=null?e:window.location.href)}catch(o){return null}let i=/\.([0-9a-z]+)(?:$)/i,s=t.pathname.match(i);return(n=s==null?void 0:s[1])!=null?n:null}function Tc(r){let e="";return r.indexOf("//")>-1?e=r.split("/").slice(0,3).join("/"):e=r.split("/")[0],e=e.split("?")[0],e}function bi(r,e){return(r||"").replace(Mc,(t,i,s,n,o,a)=>{let l=s||o||a,c=i||n||"";if(!l)return t;if(kc.test(l)||Rc.test(l))return`url(${c}${l}${c})`;if(Nc.test(l))return`url(${c}${l}${c})`;if(l[0]==="/")return`url(${c}${Tc(e)+l}${c})`;let u=e.split("/"),h=l.split("/");u.pop();for(let d of h)d!=="."&&(d===".."?u.pop():u.push(d));return`url(${c}${u.join("/")}${c})`})}function fr(r){return r.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function Ac(r,e){let t=Array.from(e.childNodes),i=[];if(t.length>1&&r&&typeof r=="string"){let s=fr(r);for(let n=1;n<t.length;n++)if(t[n].textContent&&typeof t[n].textContent=="string"){let o=fr(t[n].textContent);for(let a=3;a<o.length;a++){let l=o.substring(0,a);if(s.split(l).length===2){let c=s.indexOf(l);for(let u=c;u<r.length;u++)if(fr(r.substring(0,u)).length===c){i.push(r.substring(0,u)),r=r.substring(u);break}break}}}}return i.push(r),i}function Oc(r,e){return Ac(r,e).join("/* rr_split */")}function Wo(){return Dc++}function $c(r){if(r instanceof HTMLFormElement)return"form";let e=Te(r.tagName);return Pc.test(e)?"div":e}function Fc(r,e){if(e.trim()==="")return e;let t=0;function i(n){let o,a=n.exec(e.substring(t));return a?(o=a[0],t+=o.length,o):""}let s=[];for(;i(_c),!(t>=e.length);){let n=i(Lc);if(n.slice(-1)===",")n=Ge(r,n.substring(0,n.length-1)),s.push(n);else{let o="";n=Ge(r,n);let a=!1;for(;;){let l=e.charAt(t);if(l===""){s.push((n+o).trim());break}else if(a)l===")"&&(a=!1);else if(l===","){t+=1,s.push((n+o).trim());break}else l==="("&&(a=!0);o+=l,t+=1}}}return s.join(", ")}function Ge(r,e){return!e||e.trim()===""?e:Ds(r,e)}function Uc(r){return!!(r.tagName==="svg"||r.ownerSVGElement)}function Ds(r,e){let t=On.get(r);if(t||(t=r.createElement("a"),On.set(r,t)),!e)e="";else if(e.startsWith("blob:")||e.startsWith("data:"))return e;return t.setAttribute("href",e),t.href}function zo(r,e,t,i){return i&&(t==="src"||t==="href"&&!(e==="use"&&i[0]==="#")||t==="xlink:href"&&i[0]!=="#"||t==="background"&&(e==="table"||e==="td"||e==="th")?Ge(r,i):t==="srcset"?Fc(r,i):t==="style"?bi(i,Ds(r)):e==="object"&&t==="data"?Ge(r,i):i)}function Ho(r,e,t){return(r==="video"||r==="audio")&&e==="autoplay"}function Bc(r,e,t){try{if(typeof e=="string"){if(r.classList.contains(e))return!0}else for(let i=r.classList.length;i--;){let s=r.classList[i];if(e.test(s))return!0}if(t)return r.matches(t)}catch(i){}return!1}function Si(r,e,t){if(!r)return!1;if(r.nodeType!==r.ELEMENT_NODE)return t?Si(Q.parentNode(r),e,t):!1;for(let i=r.classList.length;i--;){let s=r.classList[i];if(e.test(s))return!0}return t?Si(Q.parentNode(r),e,t):!1}function Vo(r,e,t,i){let s;if(Ns(r)){if(s=r,!Q.childNodes(s).length)return!1}else{if(Q.parentElement(r)===null)return!1;s=Q.parentElement(r)}try{if(typeof e=="string"){if(i){if(s.closest(`.${e}`))return!0}else if(s.classList.contains(e))return!0}else if(Si(s,e,i))return!0;if(t){if(i){if(s.closest(t))return!0}else if(s.matches(t))return!0}}catch(n){}return!1}function Wc(r,e,t){let i=r.contentWindow;if(!i)return;let s=!1,n;try{n=i.document.readyState}catch(a){return}if(n!=="complete"){let a=setTimeout(()=>{s||(e(),s=!0)},t);r.addEventListener("load",()=>{clearTimeout(a),s=!0,e()});return}let o="about:blank";if(i.location.href!==o||r.src===o||r.src==="")return setTimeout(e,0),r.addEventListener("load",e);r.addEventListener("load",e)}function zc(r,e,t){let i=!1,s;try{s=r.sheet}catch(o){return}if(s)return;let n=setTimeout(()=>{i||(e(),i=!0)},t);r.addEventListener("load",()=>{clearTimeout(n),i=!0,e()})}function Hc(r,e){let{doc:t,mirror:i,blockClass:s,blockSelector:n,needsMask:o,inlineStylesheet:a,maskInputOptions:l={},maskTextFn:c,maskInputFn:u,dataURLOptions:h={},inlineImages:d,recordCanvas:p,keepIframeSrcFn:g,newlyAddedElement:m=!1,cssCaptured:f=!1}=e,y=Vc(t,i);switch(r.nodeType){case r.DOCUMENT_NODE:return r.compatMode!=="CSS1Compat"?{type:T.Document,childNodes:[],compatMode:r.compatMode}:{type:T.Document,childNodes:[]};case r.DOCUMENT_TYPE_NODE:return{type:T.DocumentType,name:r.name,publicId:r.publicId,systemId:r.systemId,rootId:y};case r.ELEMENT_NODE:return jc(r,{doc:t,blockClass:s,blockSelector:n,inlineStylesheet:a,maskInputOptions:l,maskInputFn:u,dataURLOptions:h,inlineImages:d,recordCanvas:p,keepIframeSrcFn:g,newlyAddedElement:m,rootId:y});case r.TEXT_NODE:return Gc(r,{doc:t,needsMask:o,maskTextFn:c,rootId:y,cssCaptured:f});case r.CDATA_SECTION_NODE:return{type:T.CDATA,textContent:"",rootId:y};case r.COMMENT_NODE:return{type:T.Comment,textContent:Q.textContent(r)||"",rootId:y};default:return!1}}function Vc(r,e){if(!e.hasNode(r))return;let t=e.getId(r);return t===1?void 0:t}function Gc(r,e){let{needsMask:t,maskTextFn:i,rootId:s,cssCaptured:n}=e,o=Q.parentNode(r),a=o&&o.tagName,l="",c=a==="STYLE"?!0:void 0,u=a==="SCRIPT"?!0:void 0;return u?l="SCRIPT_PLACEHOLDER":n||(l=Q.textContent(r),c&&l&&(l=bi(l,Ds(e.doc)))),!c&&!u&&l&&t&&(l=i?i(l,Q.parentElement(r)):l.replace(/[\S]/g,"*")),{type:T.Text,textContent:l||"",rootId:s}}function jc(r,e){let{doc:t,blockClass:i,blockSelector:s,inlineStylesheet:n,maskInputOptions:o={},maskInputFn:a,dataURLOptions:l={},inlineImages:c,recordCanvas:u,keepIframeSrcFn:h,newlyAddedElement:d=!1,rootId:p}=e,g=Bc(r,i,s),m=$c(r),f={},y=r.attributes.length;for(let w=0;w<y;w++){let S=r.attributes[w];Ho(m,S.name,S.value)||(f[S.name]=zo(t,m,Te(S.name),S.value))}if(m==="link"&&n){let w=Array.from(t.styleSheets).find(I=>I.href===r.href),S=null;w&&(S=Mr(w)),S&&(delete f.rel,delete f.href,f._cssText=S)}if(m==="style"&&r.sheet){let w=Mr(r.sheet);w&&(r.childNodes.length>1&&(w=Oc(w,r)),f._cssText=w)}if(m==="input"||m==="textarea"||m==="select"){let w=r.value,S=r.checked;f.type!=="radio"&&f.type!=="checkbox"&&f.type!=="submit"&&f.type!=="button"&&w?f.value=As({element:r,type:Os(r),tagName:m,value:w,maskInputOptions:o,maskInputFn:a}):S&&(f.checked=S)}if(m==="option"&&(r.selected&&!o.select?f.selected=!0:delete f.selected),m==="dialog"&&r.open&&(f.rr_open_mode=r.matches("dialog:modal")?"modal":"non-modal"),m==="canvas"&&u){if(r.__context==="2d")xc(r)||(f.rr_dataURL=r.toDataURL(l.type,l.quality));else if(!("__context"in r)){let w=r.toDataURL(l.type,l.quality),S=t.createElement("canvas");S.width=r.width,S.height=r.height;let I=S.toDataURL(l.type,l.quality);w!==I&&(f.rr_dataURL=w)}}if(m==="img"&&c){We||(We=t.createElement("canvas"),An=We.getContext("2d"));let w=r,S=w.currentSrc||w.getAttribute("src")||"<unknown-src>",I=w.crossOrigin,M=()=>{w.removeEventListener("load",M);try{We.width=w.naturalWidth,We.height=w.naturalHeight,An.drawImage(w,0,0),f.rr_dataURL=We.toDataURL(l.type,l.quality)}catch(z){if(w.crossOrigin!=="anonymous"){w.crossOrigin="anonymous",w.complete&&w.naturalWidth!==0?M():w.addEventListener("load",M);return}else console.warn(`Cannot inline img src=${S}! Error: ${z}`)}w.crossOrigin==="anonymous"&&(I?f.crossOrigin=I:w.removeAttribute("crossorigin"))};w.complete&&w.naturalWidth!==0?M():w.addEventListener("load",M)}if(m==="audio"||m==="video"){let w=f;w.rr_mediaState=r.paused?"paused":"played",w.rr_mediaCurrentTime=r.currentTime,w.rr_mediaPlaybackRate=r.playbackRate,w.rr_mediaMuted=r.muted,w.rr_mediaLoop=r.loop,w.rr_mediaVolume=r.volume}if(d||(r.scrollLeft&&(f.rr_scrollLeft=r.scrollLeft),r.scrollTop&&(f.rr_scrollTop=r.scrollTop)),g){let{width:w,height:S}=r.getBoundingClientRect();f={class:f.class,rr_width:`${w}px`,rr_height:`${S}px`}}m==="iframe"&&!h(f.src)&&(r.contentDocument||(f.rr_src=f.src),delete f.src);let b;try{customElements.get(m)&&(b=!0)}catch(w){}return{type:T.Element,tagName:m,attributes:f,childNodes:[],isSVG:Uc(r)||void 0,needBlock:g,rootId:p,isCustom:b}}function W(r){return r==null?"":r.toLowerCase()}function Kc(r,e){if(e.comment&&r.type===T.Comment)return!0;if(r.type===T.Element){if(e.script&&(r.tagName==="script"||r.tagName==="link"&&(r.attributes.rel==="preload"||r.attributes.rel==="modulepreload")&&r.attributes.as==="script"||r.tagName==="link"&&r.attributes.rel==="prefetch"&&typeof r.attributes.href=="string"&&Bo(r.attributes.href)==="js"))return!0;if(e.headFavicon&&(r.tagName==="link"&&r.attributes.rel==="shortcut icon"||r.tagName==="meta"&&(W(r.attributes.name).match(/^msapplication-tile(image|color)$/)||W(r.attributes.name)==="application-name"||W(r.attributes.rel)==="icon"||W(r.attributes.rel)==="apple-touch-icon"||W(r.attributes.rel)==="shortcut icon")))return!0;if(r.tagName==="meta"){if(e.headMetaDescKeywords&&W(r.attributes.name).match(/^description|keywords$/))return!0;if(e.headMetaSocial&&(W(r.attributes.property).match(/^(og|twitter|fb):/)||W(r.attributes.name).match(/^(og|twitter):/)||W(r.attributes.name)==="pinterest"))return!0;if(e.headMetaRobots&&(W(r.attributes.name)==="robots"||W(r.attributes.name)==="googlebot"||W(r.attributes.name)==="bingbot"))return!0;if(e.headMetaHttpEquiv&&r.attributes["http-equiv"]!==void 0)return!0;if(e.headMetaAuthorship&&(W(r.attributes.name)==="author"||W(r.attributes.name)==="generator"||W(r.attributes.name)==="framework"||W(r.attributes.name)==="publisher"||W(r.attributes.name)==="progid"||W(r.attributes.property).match(/^article:/)||W(r.attributes.property).match(/^product:/)))return!0;if(e.headMetaVerification&&(W(r.attributes.name)==="google-site-verification"||W(r.attributes.name)==="yandex-verification"||W(r.attributes.name)==="csrf-token"||W(r.attributes.name)==="p:domain_verify"||W(r.attributes.name)==="verify-v1"||W(r.attributes.name)==="verification"||W(r.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function je(r,e){let{doc:t,mirror:i,blockClass:s,blockSelector:n,maskTextClass:o,maskTextSelector:a,skipChild:l=!1,inlineStylesheet:c=!0,maskInputOptions:u={},maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:g={},inlineImages:m=!1,recordCanvas:f=!1,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:w=5e3,onStylesheetLoad:S,stylesheetLoadTimeout:I=5e3,keepIframeSrcFn:M=()=>!1,newlyAddedElement:z=!1,cssCaptured:U=!1}=e,{needsMask:K}=e,{preserveWhiteSpace:q=!0}=e;K||(K=Vo(r,o,a,K===void 0));let ie=Hc(r,{doc:t,mirror:i,blockClass:s,blockSelector:n,needsMask:K,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,dataURLOptions:g,inlineImages:m,recordCanvas:f,keepIframeSrcFn:M,newlyAddedElement:z,cssCaptured:U});if(!ie)return console.warn(r,"not serialized"),null;let re;i.hasNode(r)?re=i.getId(r):Kc(ie,p)||!q&&ie.type===T.Text&&!ie.textContent.replace(/^\s+|\s+$/gm,"").length?re=St:re=Wo();let R=Object.assign(ie,{id:re});if(i.add(r,R),re===St)return null;y&&y(r);let Ae=!l;if(R.type===T.Element){Ae=Ae&&!R.needBlock,delete R.needBlock;let Y=Q.shadowRoot(r);Y&&yt(Y)&&(R.isShadowHost=!0)}if((R.type===T.Document||R.type===T.Element)&&Ae){p.headWhitespace&&R.type===T.Element&&R.tagName==="head"&&(q=!1);let Y={doc:t,mirror:i,blockClass:s,blockSelector:n,needsMask:K,maskTextClass:o,maskTextSelector:a,skipChild:l,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:g,inlineImages:m,recordCanvas:f,preserveWhiteSpace:q,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:S,stylesheetLoadTimeout:I,keepIframeSrcFn:M,cssCaptured:!1};if(!(R.type===T.Element&&R.tagName==="textarea"&&R.attributes.value!==void 0)){R.type===T.Element&&R.attributes._cssText!==void 0&&typeof R.attributes._cssText=="string"&&(Y.cssCaptured=!0);for(let oe of Array.from(Q.childNodes(r))){let se=je(oe,Y);se&&R.childNodes.push(se)}}let $=null;if(Ns(r)&&($=Q.shadowRoot(r)))for(let oe of Array.from(Q.childNodes($))){let se=je(oe,Y);se&&(yt($)&&(se.isShadow=!0),R.childNodes.push(se))}}let Oe=Q.parentNode(r);return Oe&&gt(Oe)&&yt(Oe)&&(R.isShadow=!0),R.type===T.Element&&R.tagName==="iframe"&&Wc(r,()=>{let Y=r.contentDocument;if(Y&&b){let $=je(Y,{doc:Y,mirror:i,blockClass:s,blockSelector:n,needsMask:K,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:g,inlineImages:m,recordCanvas:f,preserveWhiteSpace:q,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:S,stylesheetLoadTimeout:I,keepIframeSrcFn:M});$&&b(r,$)}},w),R.type===T.Element&&R.tagName==="link"&&typeof R.attributes.rel=="string"&&(R.attributes.rel==="stylesheet"||R.attributes.rel==="preload"&&typeof R.attributes.href=="string"&&Bo(R.attributes.href)==="css")&&zc(r,()=>{if(S){let Y=je(r,{doc:t,mirror:i,blockClass:s,blockSelector:n,needsMask:K,maskTextClass:o,maskTextSelector:a,skipChild:!1,inlineStylesheet:c,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:g,inlineImages:m,recordCanvas:f,preserveWhiteSpace:q,onSerialize:y,onIframeLoad:b,iframeLoadTimeout:w,onStylesheetLoad:S,stylesheetLoadTimeout:I,keepIframeSrcFn:M});Y&&S(r,Y)}},I),R}function Yc(r,e){let{mirror:t=new bt,blockClass:i="rr-block",blockSelector:s=null,maskTextClass:n="rr-mask",maskTextSelector:o=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:u=!1,maskTextFn:h,maskInputFn:d,slimDOM:p=!1,dataURLOptions:g,preserveWhiteSpace:m,onSerialize:f,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:S,keepIframeSrcFn:I=()=>!1}=e||{};return je(r,{doc:r,mirror:t,blockClass:i,blockSelector:s,maskTextClass:n,maskTextSelector:o,skipChild:!1,inlineStylesheet:a,maskInputOptions:u===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:u===!1?{password:!0}:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p===!0||p==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:p==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:p===!1?{}:p,dataURLOptions:g,inlineImages:l,recordCanvas:c,preserveWhiteSpace:m,onSerialize:f,onIframeLoad:y,iframeLoadTimeout:b,onStylesheetLoad:w,stylesheetLoadTimeout:S,keepIframeSrcFn:I,newlyAddedElement:!1})}function qc(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Qc(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function i(){return this instanceof i?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(r).forEach(function(i){var s=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return r[i]}})}),t}function ru(r){return r[0].toUpperCase()+r.slice(1)}function Nr(r,e){new su(e).stringify(r)}function Ar(r,e){let t=new r.constructor;for(let i in r){if(!Object.prototype.hasOwnProperty.call(r,i)||i==="proxyCache")continue;let s=r[i],n=typeof s;i==="parent"&&n==="object"?e&&(t[i]=e):i==="source"?t[i]=s:Array.isArray(s)?t[i]=s.map(o=>Ar(o,t)):(n==="object"&&s!==null&&(s=Ar(s)),t[i]=s)}return t}function yu(r){return Buffer?Buffer.from(r,"base64").toString():window.atob(r)}function oa(r){return r.map(e=>(e.nodes&&(e.nodes=oa(e.nodes)),delete e.source,e))}function aa(r){if(r[ea]=!1,r.proxyOf.nodes)for(let e of r.proxyOf.nodes)aa(e)}function Xu(r){for(let e=r.length-1;e>=0;e--){let t=r[e],i=t[3]||t[2];if(i)return i}}function Ii(r,e){let t=new eh(r,e),i=new Qu(t);try{i.parse()}catch(s){throw s}return i.root}function ht(r){return typeof r=="object"&&typeof r.then=="function"}function wa(r){let e=!1,t=lh[r.type];return r.type==="decl"?e=r.prop.toLowerCase():r.type==="atrule"&&(e=r.name.toLowerCase()),e&&r.append?[t,t+"-"+e,qe,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:r.append?[t,qe,t+"Exit"]:[t,t+"Exit"]}function Xn(r){let e;return r.type==="document"?e=["Document",qe,"DocumentExit"]:r.type==="root"?e=["Root",qe,"RootExit"]:e=wa(r),{eventIndex:0,events:e,iterator:0,node:r,visitorIndex:0,visitors:[]}}function Br(r){return r[fe]=!1,r.nodes&&r.nodes.forEach(e=>Br(e)),r}function It(r,e){if(Array.isArray(r))return r.map(s=>It(s));let{inputs:t,...i}=r;if(t){e=[];for(let s of t){let n={...s,__proto__:Ih.prototype};n.map&&(n.map={...n.map,__proto__:Ch.prototype}),e.push(n)}}if(i.nodes&&(i.nodes=r.nodes.map(s=>It(s,e))),i.source){let{inputId:s,...n}=i.source;i.source=n,s!=null&&(i.source.input=e[s])}if(i.type==="root")return new Th(i);if(i.type==="decl")return new Sh(i);if(i.type==="rule")return new Mh(i);if(i.type==="comment")return new Eh(i);if(i.type==="atrule")return new xh(i);throw new Error("Unknown node type: "+r.type)}function L(...r){return r.length===1&&Array.isArray(r[0])&&(r=r[0]),new Hs(r)}function Wh(r){let e=Jn[r.tagName]?Jn[r.tagName]:r.tagName;return e==="link"&&r.attributes._cssText&&(e="style"),e}function Ki(r,e){let t=e==null?void 0:e.stylesWithHoverClass.get(r);if(t)return t;let s=G([Jc,Zc]).process(r).css;return e==null||e.stylesWithHoverClass.set(r,s),s}function Zn(){return{stylesWithHoverClass:new Map}}function zh(r,e,t,i){let s=[];for(let o of r.childNodes)o.type===T.Text&&s.push(o);let n=e.split("/* rr_split */");for(;n.length>1&&n.length>s.length;)n.splice(-2,2,n.slice(-2).join(""));for(let o=0;o<s.length;o++){let a=s[o],l=n[o];a&&l&&(a.textContent=t?Ki(l,i):l)}}function Hh(r,e,t,i){let{doc:s,hackCss:n,cache:o}=i;r.childNodes.length?zh(r,t,n,o):(n&&(t=Ki(t,o)),e.appendChild(s.createTextNode(t)))}function Vh(r,e){var t;let{doc:i,hackCss:s,cache:n}=e;switch(r.type){case T.Document:return i.implementation.createDocument(null,"",null);case T.DocumentType:return i.implementation.createDocumentType(r.name||"html",r.publicId,r.systemId);case T.Element:{let o=Wh(r),a;r.isSVG?a=i.createElementNS("http://www.w3.org/2000/svg",o):(r.isCustom&&((t=i.defaultView)!=null&&t.customElements)&&!i.defaultView.customElements.get(r.tagName)&&i.defaultView.customElements.define(r.tagName,class extends i.defaultView.HTMLElement{}),a=i.createElement(o));let l={};for(let c in r.attributes){if(!Object.prototype.hasOwnProperty.call(r.attributes,c))continue;let u=r.attributes[c];if(!(o==="option"&&c==="selected"&&u===!1)&&u!==null){if(u===!0&&(u=""),c.startsWith("rr_")){l[c]=u;continue}if(typeof u=="string"){if(o==="style"&&c==="_cssText"){Hh(r,a,u,e);continue}else if(o==="textarea"&&c==="value"){a.appendChild(i.createTextNode(u)),r.childNodes=[];continue}}try{if(r.isSVG&&c==="xlink:href")a.setAttributeNS("http://www.w3.org/1999/xlink",c,u.toString());else if(c==="onload"||c==="onclick"||c.substring(0,7)==="onmouse")a.setAttribute("_"+c,u.toString());else if(o==="meta"&&r.attributes["http-equiv"]==="Content-Security-Policy"&&c==="content"){a.setAttribute("csp-content",u.toString());continue}else o==="link"&&(r.attributes.rel==="preload"||r.attributes.rel==="modulepreload")&&r.attributes.as==="script"||o==="link"&&r.attributes.rel==="prefetch"&&typeof r.attributes.href=="string"&&r.attributes.href.endsWith(".js")||(o==="img"&&r.attributes.srcset&&r.attributes.rr_dataURL?a.setAttribute("rrweb-original-srcset",r.attributes.srcset):a.setAttribute(c,u.toString()))}catch(h){}}}for(let c in l){let u=l[c];if(o==="canvas"&&c==="rr_dataURL"){let h=i.createElement("img");h.onload=()=>{let d=a.getContext("2d");d&&d.drawImage(h,0,0,h.width,h.height)},h.src=u.toString(),a.RRNodeType&&(a.rr_dataURL=u.toString())}else if(o==="img"&&c==="rr_dataURL"){let h=a;h.currentSrc.startsWith("data:")||(h.setAttribute("rrweb-original-src",r.attributes.src),h.src=u.toString())}if(c==="rr_width")a.style.setProperty("width",u.toString());else if(c==="rr_height")a.style.setProperty("height",u.toString());else if(c==="rr_mediaCurrentTime"&&typeof u=="number")a.currentTime=u;else if(c==="rr_mediaState")switch(u){case"played":a.play().catch(h=>console.warn("media playback error",h));break;case"paused":a.pause();break}else c==="rr_mediaPlaybackRate"&&typeof u=="number"?a.playbackRate=u:c==="rr_mediaMuted"&&typeof u=="boolean"?a.muted=u:c==="rr_mediaLoop"&&typeof u=="boolean"?a.loop=u:c==="rr_mediaVolume"&&typeof u=="number"?a.volume=u:c==="rr_open_mode"&&a.setAttribute("rr_open_mode",u)}if(r.isShadowHost)if(!a.shadowRoot)a.attachShadow({mode:"open"});else for(;a.shadowRoot.firstChild;)a.shadowRoot.removeChild(a.shadowRoot.firstChild);return a}case T.Text:return r.isStyle&&s?i.createTextNode(Ki(r.textContent,n)):i.createTextNode(r.textContent);case T.CDATA:return i.createCDATASection(r.textContent);case T.Comment:return i.createComment(r.textContent);default:return null}}function wt(r,e){let{doc:t,mirror:i,skipChild:s=!1,hackCss:n=!0,afterAppend:o,cache:a}=e;if(i.has(r.id)){let c=i.getNode(r.id),u=i.getMeta(c);if(Ic(u,r))return i.getNode(r.id)}let l=Vh(r,{doc:t,hackCss:n,cache:a});if(!l)return null;if(r.rootId&&i.getNode(r.rootId)!==t&&i.replace(r.rootId,t),r.type===T.Document&&(t.close(),t.open(),r.compatMode==="BackCompat"&&r.childNodes&&r.childNodes[0].type!==T.DocumentType&&(r.childNodes[0].type===T.Element&&"xmlns"in r.childNodes[0].attributes&&r.childNodes[0].attributes.xmlns==="http://www.w3.org/1999/xhtml"?t.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'):t.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">')),l=t),i.add(l,r),(r.type===T.Document||r.type===T.Element)&&!s)for(let c of r.childNodes){let u=wt(c,{doc:t,mirror:i,skipChild:!1,hackCss:n,afterAppend:o,cache:a});if(!u){console.warn("Failed to rebuild",c);continue}if(c.isShadow&&Ns(l)&&l.shadowRoot)l.shadowRoot.appendChild(u);else if(r.type===T.Document&&c.type==T.Element){let h=u,d=null;h.childNodes.forEach(p=>{p.nodeName==="BODY"&&(d=p)}),d?(h.removeChild(d),l.appendChild(u),h.appendChild(d)):l.appendChild(u)}else l.appendChild(u);o&&o(u,c.id)}return l}function Gh(r,e){function t(i){e(i)}for(let i of r.getIds())r.has(i)&&t(r.getNode(i))}function jh(r,e){let t=e.getMeta(r);if((t==null?void 0:t.type)!==T.Element)return;let i=r;for(let s in t.attributes){if(!(Object.prototype.hasOwnProperty.call(t.attributes,s)&&s.startsWith("rr_")))continue;let n=t.attributes[s];s==="rr_scrollLeft"&&(i.scrollLeft=n),s==="rr_scrollTop"&&(i.scrollTop=n)}}function Kh(r,e){let{doc:t,onVisit:i,hackCss:s=!0,afterAppend:n,cache:o,mirror:a=new bt}=e,l=wt(r,{doc:t,mirror:a,skipChild:!1,hackCss:s,afterAppend:n,cache:o});return Gh(a,c=>{i&&i(c),jh(c,a)}),l}function Qh(){return new qh}function ed(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function td(r){if(r.__esModule)return r;var e=r.default;if(typeof e=="function"){var t=function i(){return this instanceof i?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(r).forEach(function(i){var s=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return r[i]}})}),t}function nd(r){return r[0].toUpperCase()+r.slice(1)}function Gr(r,e){new od(e).stringify(r)}function jr(r,e){let t=new r.constructor;for(let i in r){if(!Object.prototype.hasOwnProperty.call(r,i)||i==="proxyCache")continue;let s=r[i],n=typeof s;i==="parent"&&n==="object"?e&&(t[i]=e):i==="source"?t[i]=s:Array.isArray(s)?t[i]=s.map(o=>jr(o,t)):(n==="object"&&s!==null&&(s=jr(s)),t[i]=s)}return t}function vd(r){return Buffer?Buffer.from(r,"base64").toString():window.atob(r)}function za(r){return r.map(e=>(e.nodes&&(e.nodes=za(e.nodes)),delete e.source,e))}function Ha(r){if(r[La]=!1,r.proxyOf.nodes)for(let e of r.proxyOf.nodes)Ha(e)}function Zd(r){for(let e=r.length-1;e>=0;e--){let t=r[e],i=t[3]||t[2];if(i)return i}}function Ri(r,e){let t=new rf(r,e),i=new tf(t);try{i.parse()}catch(s){throw s}return i.root}function ft(r){return typeof r=="object"&&typeof r.then=="function"}function el(r){let e=!1,t=hf[r.type];return r.type==="decl"?e=r.prop.toLowerCase():r.type==="atrule"&&(e=r.name.toLowerCase()),e&&r.append?[t,t+"-"+e,tt,t+"Exit",t+"Exit-"+e]:e?[t,t+"-"+e,t+"Exit",t+"Exit-"+e]:r.append?[t,tt,t+"Exit"]:[t,t+"Exit"]}function mo(r){let e;return r.type==="document"?e=["Document",tt,"DocumentExit"]:r.type==="root"?e=["Root",tt,"RootExit"]:e=el(r),{eventIndex:0,events:e,iterator:0,node:r,visitorIndex:0,visitors:[]}}function ts(r){return r[pe]=!1,r.nodes&&r.nodes.forEach(e=>ts(e)),r}function Rt(r,e){if(Array.isArray(r))return r.map(s=>Rt(s));let{inputs:t,...i}=r;if(t){e=[];for(let s of t){let n={...s,__proto__:kf.prototype};n.map&&(n.map={...n.map,__proto__:If.prototype}),e.push(n)}}if(i.nodes&&(i.nodes=r.nodes.map(s=>Rt(s,e))),i.source){let{inputId:s,...n}=i.source;i.source=n,s!=null&&(i.source.input=e[s])}if(i.type==="root")return new Rf(i);if(i.type==="decl")return new xf(i);if(i.type==="rule")return new Nf(i);if(i.type==="comment")return new Tf(i);if(i.type==="atrule")return new Mf(i);throw new Error("Unknown node type: "+r.type)}function _(...r){return r.length===1&&Array.isArray(r[0])&&(r=r[0]),new Qs(r)}function Vf(r){let e={},t=/;(?![^(]*\))/g,i=/:(.+)/,s=/\/\*.*?\*\//g;return r.replace(s,"").split(t).forEach(function(n){if(n){let o=n.split(i);o.length>1&&(e[ss(o[0].trim())]=o[1].trim())}}),e}function go(r){let e=[];for(let t in r){let i=r[t];if(typeof i!="string")continue;let s=Yf(t);e.push(`${s}: ${i};`)}return e.join(" ")}function en(r,e){return e.parentNode&&e.parentNode.removeChild(e),r.lastChild?(r.lastChild.nextSibling=e,e.previousSibling=r.lastChild):(r.firstChild=e,e.previousSibling=null),r.lastChild=e,e.nextSibling=null,e.parentNode=r,e.parentElement=r,e.ownerDocument=r.ownerDocument,e}function cl(r,e,t){if(!t)return en(r,e);if(t.parentNode!==r)throw new Error("Failed to execute 'insertBefore' on 'RRNode': The RRNode before which the new node is to be inserted is not a child of this RRNode.");return e===t||(e.parentNode&&e.parentNode.removeChild(e),e.previousSibling=t.previousSibling,t.previousSibling=e,e.nextSibling=t,e.previousSibling?e.previousSibling.nextSibling=e:r.firstChild=e,e.parentElement=r,e.parentNode=r,e.ownerDocument=r.ownerDocument),e}function ul(r,e){if(e.parentNode!==r)throw new Error("Failed to execute 'removeChild' on 'RRNode': The RRNode to be removed is not a child of this RRNode.");return e.previousSibling?e.previousSibling.nextSibling=e.nextSibling:r.firstChild=e.nextSibling,e.nextSibling?e.nextSibling.previousSibling=e.previousSibling:r.lastChild=e.previousSibling,e.previousSibling=null,e.nextSibling=null,e.parentElement=null,e.parentNode=null,e}function Pi(r,e,t,i=e.mirror||e.ownerDocument.mirror){r=Jf(r,e,t,i),hl(r,e,t,i),Zf(r,e,t)}function Jf(r,e,t,i){var s;if(t.afterAppend&&!me&&(me=new WeakSet,setTimeout(()=>{me=null},0)),!tn(r,e)){let n=$i(e,t.mirror,i);(s=r.parentNode)==null||s.replaceChild(n,r),r=n}switch(e.RRNodeType){case N.Document:{if(!ze(r,e,t.mirror,i)){let n=i.getMeta(e);n&&(t.mirror.removeNodeFromMap(r),r.close(),r.open(),t.mirror.add(r,n),me==null||me.add(r))}break}case N.Element:{let n=r,o=e;switch(o.tagName){case"IFRAME":{let a=r.contentDocument;if(!a)break;Pi(a,e.contentDocument,t,i);break}}o.shadowRoot&&(n.shadowRoot||n.attachShadow({mode:"open"}),hl(n.shadowRoot,o.shadowRoot,t,i)),qf(n,o,i);break}}return r}function Zf(r,e,t){var i;switch(e.RRNodeType){case N.Document:{let s=e.scrollData;s&&t.applyScroll(s,!0);break}case N.Element:{let s=r,n=e;switch(n.scrollData&&t.applyScroll(n.scrollData,!0),n.inputData&&t.applyInput(n.inputData),n.tagName){case"AUDIO":case"VIDEO":{let o=r,a=n;a.paused!==void 0&&(a.paused?o.pause():o.play()),a.muted!==void 0&&(o.muted=a.muted),a.volume!==void 0&&(o.volume=a.volume),a.currentTime!==void 0&&(o.currentTime=a.currentTime),a.playbackRate!==void 0&&(o.playbackRate=a.playbackRate),a.loop!==void 0&&(o.loop=a.loop);break}case"CANVAS":{let o=e;if(o.rr_dataURL!==null){let a=document.createElement("img");a.onload=()=>{let l=s.getContext("2d");l&&l.drawImage(a,0,0,a.width,a.height)},a.src=o.rr_dataURL}o.canvasMutations.forEach(a=>t.applyCanvas(a.event,a.mutation,r));break}case"STYLE":{let o=s.sheet;o&&e.rules.forEach(a=>t.applyStyleSheetMutation(a,o));break}case"DIALOG":{let o=s,a=n,l=o.open,c=o.matches("dialog:modal"),u=a.open,h=a.isModal,d=c!==h,p=l!==u;if((d||l&&p)&&o.close(),u&&(p||d))try{h?o.showModal():o.show()}catch(g){console.warn(g)}break}}break}case N.Text:case N.Comment:case N.CDATA:{r.textContent!==e.data&&(r.textContent=e.data);break}}me!=null&&me.has(r)&&(me.delete(r),(i=t.afterAppend)==null||i.call(t,r,t.mirror.getId(r)))}function qf(r,e,t){let i=r.attributes,s=e.attributes;for(let n in s){let o=s[n],a=t.getMeta(e);if(a!=null&&a.isSVG&&cs[n])r.setAttributeNS(cs[n],n,o);else if(e.tagName==="CANVAS"&&n==="rr_dataURL"){let l=document.createElement("img");l.src=o,l.onload=()=>{let c=r.getContext("2d");c&&c.drawImage(l,0,0,l.width,l.height)}}else{if(e.tagName==="IFRAME"&&n==="srcdoc")continue;try{r.setAttribute(n,o)}catch(l){console.warn(l)}}}for(let{name:n}of Array.from(i))n in s||r.removeAttribute(n);e.scrollLeft&&(r.scrollLeft=e.scrollLeft),e.scrollTop&&(r.scrollTop=e.scrollTop)}function hl(r,e,t,i){let s=Array.from(r.childNodes),n=e.childNodes;if(s.length===0&&n.length===0)return;let o=0,a=s.length-1,l=0,c=n.length-1,u=s[o],h=s[a],d=n[l],p=n[c],g,m;for(;o<=a&&l<=c;)if(u===void 0)u=s[++o];else if(h===void 0)h=s[--a];else if(ze(u,d,t.mirror,i))u=s[++o],d=n[++l];else if(ze(h,p,t.mirror,i))h=s[--a],p=n[--c];else if(ze(u,p,t.mirror,i)){try{r.insertBefore(u,h.nextSibling)}catch(b){console.warn(b)}u=s[++o],p=n[--c]}else if(ze(h,d,t.mirror,i)){try{r.insertBefore(h,u)}catch(b){console.warn(b)}h=s[--a],d=n[++l]}else{if(!g){g={};for(let w=o;w<=a;w++){let S=s[w];S&&t.mirror.hasNode(S)&&(g[t.mirror.getId(S)]=w)}}m=g[i.getId(d)];let b=s[m];if(m!==void 0&&b&&ze(b,d,t.mirror,i)){try{r.insertBefore(b,u)}catch(w){console.warn(w)}s[m]=void 0}else{let w=$i(d,t.mirror,i);r.nodeName==="#document"&&u&&(w.nodeType===w.DOCUMENT_TYPE_NODE&&u.nodeType===u.DOCUMENT_TYPE_NODE||w.nodeType===w.ELEMENT_NODE&&u.nodeType===u.ELEMENT_NODE)&&(r.removeChild(u),t.mirror.removeNodeFromMap(u),u=s[++o]);try{r.insertBefore(w,u||null)}catch(S){console.warn(S)}}d=n[++l]}if(o>a){let b=n[c+1],w=null;for(b&&(w=t.mirror.getNode(i.getId(b)));l<=c;++l){let S=$i(n[l],t.mirror,i);try{r.insertBefore(S,w)}catch(I){console.warn(I)}}}else if(l>c)for(;o<=a;o++){let b=s[o];if(!(!b||b.parentNode!==r))try{r.removeChild(b),t.mirror.removeNodeFromMap(b)}catch(w){console.warn(w)}}let f=r.firstChild,y=e.firstChild;for(;f!==null&&y!==null;)Pi(f,y,t,i),f=f.nextSibling,y=y.nextSibling}function $i(r,e,t){let i=t.getId(r),s=t.getMeta(r),n=null;if(i>-1&&(n=e.getNode(i)),n!==null&&tn(n,r))return n;switch(r.RRNodeType){case N.Document:n=new Document;break;case N.DocumentType:n=document.implementation.createDocumentType(r.name,r.publicId,r.systemId);break;case N.Element:{let o=r.tagName.toLowerCase();o=Xf[o]||o,s&&"isSVG"in s&&(s!=null&&s.isSVG)?n=document.createElementNS(cs.svg,o):n=document.createElement(r.tagName);break}case N.Text:n=document.createTextNode(r.data);break;case N.Comment:n=document.createComment(r.data);break;case N.CDATA:n=document.createCDATASection(r.data);break}s&&e.add(n,{...s});try{me==null||me.add(n)}catch(o){}return n}function tn(r,e){return r.nodeType!==e.nodeType?!1:r.nodeType!==r.ELEMENT_NODE||r.tagName.toUpperCase()===e.tagName}function ze(r,e,t,i){let s=t.getId(r),n=i.getId(e);return s===-1||s!==n?!1:tn(r,e)}function rp(r){return r instanceof HTMLFormElement?"FORM":r.tagName.toUpperCase()}function dl(r,e,t,i){let s;switch(r.nodeType){case ne.DOCUMENT_NODE:i&&i.nodeName==="IFRAME"?s=i.contentDocument:(s=e,s.compatMode=r.compatMode);break;case ne.DOCUMENT_TYPE_NODE:{let o=r;s=e.createDocumentType(o.name,o.publicId,o.systemId);break}case ne.ELEMENT_NODE:{let o=r,a=rp(o);s=e.createElement(a);let l=s;for(let{name:c,value:u}of Array.from(o.attributes))l.attributes[c]=u;o.scrollLeft&&(l.scrollLeft=o.scrollLeft),o.scrollTop&&(l.scrollTop=o.scrollTop);break}case ne.TEXT_NODE:s=e.createTextNode(r.textContent||"");break;case ne.CDATA_SECTION_NODE:s=e.createCDATASection(r.data);break;case ne.COMMENT_NODE:s=e.createComment(r.textContent||"");break;case ne.DOCUMENT_FRAGMENT_NODE:s=i.attachShadow({mode:"open"});break;default:return null}let n=t.getMeta(r);return e instanceof st&&(n||(n=fl(s,e.unserializedId),t.add(r,n)),e.mirror.add(s,{...n})),s}function sp(r,e=Qh(),t=new st){function i(s,n){let o=dl(s,t,e,n);if(o!==null)if((n==null?void 0:n.nodeName)!=="IFRAME"&&s.nodeType!==ne.DOCUMENT_FRAGMENT_NODE&&(n==null||n.appendChild(o),o.parentNode=n,o.parentElement=n),s.nodeName==="IFRAME"){let a=s.contentDocument;a&&i(a,o)}else(s.nodeType===ne.DOCUMENT_NODE||s.nodeType===ne.ELEMENT_NODE||s.nodeType===ne.DOCUMENT_FRAGMENT_NODE)&&(s.nodeType===ne.ELEMENT_NODE&&s.shadowRoot&&i(s.shadowRoot,o),s.childNodes.forEach(a=>i(a,o)))}return i(r,null),t}function np(){return new ms}function fl(r,e){switch(r.RRNodeType){case N.Document:return{id:e,type:r.RRNodeType,childNodes:[]};case N.DocumentType:{let t=r;return{id:e,type:r.RRNodeType,name:t.name,publicId:t.publicId,systemId:t.systemId}}case N.Element:return{id:e,type:r.RRNodeType,tagName:r.tagName.toLowerCase(),attributes:{},childNodes:[]};case N.Text:return{id:e,type:r.RRNodeType,textContent:r.textContent||""};case N.Comment:return{id:e,type:r.RRNodeType,textContent:r.textContent||""};case N.CDATA:return{id:e,type:r.RRNodeType,textContent:""}}}function rn(r){if(ci[r])return ci[r];let e=globalThis[r],t=e.prototype,i=r in yo?yo[r]:void 0,s=!!(i&&i.every(a=>{var l,c;return!!((c=(l=Object.getOwnPropertyDescriptor(t,a))==null?void 0:l.get)!=null&&c.toString().includes("[native code]"))})),n=r in wo?wo[r]:void 0,o=!!(n&&n.every(a=>{var l;return typeof t[a]=="function"&&((l=t[a])==null?void 0:l.toString().includes("[native code]"))}));if(s&&o&&!op())return ci[r]=e.prototype,e.prototype;try{let a=document.createElement("iframe");document.body.appendChild(a);let l=a.contentWindow;if(!l)return e.prototype;let c=l[r].prototype;return document.body.removeChild(a),c?ci[r]=c:t}catch(a){return t}}function ke(r,e,t){var i;let s=`${r}.${String(t)}`;if(Cr[s])return Cr[s].call(e);let n=rn(r),o=(i=Object.getOwnPropertyDescriptor(n,t))==null?void 0:i.get;return o?(Cr[s]=o,o.call(e)):e[t]}function pl(r,e,t){let i=`${r}.${String(t)}`;if(Er[i])return Er[i].bind(e);let n=rn(r)[t];return typeof n!="function"?e[t]:(Er[i]=n,n.bind(e))}function ap(r){return ke("Node",r,"childNodes")}function lp(r){return ke("Node",r,"parentNode")}function cp(r){return ke("Node",r,"parentElement")}function up(r){return ke("Node",r,"textContent")}function hp(r,e){return pl("Node",r,"contains")(e)}function dp(r){return pl("Node",r,"getRootNode")()}function fp(r){return!r||!("host"in r)?null:ke("ShadowRoot",r,"host")}function pp(r){return r.styleSheets}function mp(r){return!r||!("shadowRoot"in r)?null:ke("Element",r,"shadowRoot")}function gp(r,e){return ke("Element",r,"querySelector")(e)}function yp(r,e){return ke("Element",r,"querySelectorAll")(e)}function ml(){return rn("MutationObserver").constructor}function ee(r,e,t=document){let i={capture:!0,passive:!0};return t.addEventListener(r,e,i),()=>t.removeEventListener(r,e,i)}function ot(r,e,t={}){let i=null,s=0;return function(...n){let o=Date.now();!s&&t.leading===!1&&(s=o);let a=e-(o-s),l=this;a<=0||a>e?(i&&(clearTimeout(i),i=null),s=o,r.apply(l,n)):!i&&t.trailing!==!1&&(i=setTimeout(()=>{s=t.leading===!1?0:Date.now(),i=null,r.apply(l,n)},a))}}function Lt(r,e,t,i,s=window){let n=s.Object.getOwnPropertyDescriptor(r,e);return s.Object.defineProperty(r,e,i?t:{set(o){setTimeout(()=>{t.set.call(this,o)},0),n&&n.set&&n.set.call(this,o)}}),()=>Lt(r,e,n||{},!0)}function Fe(r,e,t){try{if(!(e in r))return()=>{};let i=r[e],s=t(i);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:i}})),r[e]=s,()=>{r[e]=i}}catch(i){return()=>{}}}function sn(r){var e,t,i,s;let n=r.document;return{left:n.scrollingElement?n.scrollingElement.scrollLeft:r.pageXOffset!==void 0?r.pageXOffset:n.documentElement.scrollLeft||(n==null?void 0:n.body)&&((e=k.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:r.pageYOffset!==void 0?r.pageYOffset:(n==null?void 0:n.documentElement.scrollTop)||(n==null?void 0:n.body)&&((i=k.parentElement(n.body))==null?void 0:i.scrollTop)||((s=n==null?void 0:n.body)==null?void 0:s.scrollTop)||0}}function nn(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function on(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function an(r){return r?r.nodeType===r.ELEMENT_NODE?r:k.parentElement(r):null}function te(r,e,t,i){if(!r)return!1;let s=an(r);if(!s)return!1;try{if(typeof e=="string"){if(s.classList.contains(e)||i&&s.closest("."+e)!==null)return!0}else if(Si(s,e,i))return!0}catch(n){}return!!(t&&(s.matches(t)||i&&s.closest(t)!==null))}function gl(r,e){return e.getId(r)!==-1}function yi(r,e,t){return r.tagName==="TITLE"&&t.headTitleMutations?!0:e.getId(r)===St}function ln(r,e){if(gt(r))return!1;let t=e.getId(r);if(!e.has(t))return!0;let i=k.parentNode(r);return i&&i.nodeType===r.DOCUMENT_NODE?!1:i?ln(i,e):!0}function _i(r){return!!r.changedTouches}function cn(r=window){"NodeList"in r&&!r.NodeList.prototype.forEach&&(r.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in r&&!r.DOMTokenList.prototype.forEach&&(r.DOMTokenList.prototype.forEach=Array.prototype.forEach)}function yl(r){let e={},t=(s,n)=>{let o={value:s,parent:n,children:[]};return e[s.node.id]=o,o},i=[];for(let s of r){let{nextId:n,parentId:o}=s;if(n&&n in e){let a=e[n];if(a.parent){let l=a.parent.children.indexOf(a);a.parent.children.splice(l,0,t(s,a.parent))}else{let l=i.indexOf(a);i.splice(l,0,t(s,null))}continue}if(o in e){let a=e[o];a.children.push(t(s,a));continue}i.push(t(s,null))}return i}function un(r,e){e(r.value);for(let t=r.children.length-1;t>=0;t--)un(r.children[t],e)}function Je(r,e){return!!(r.nodeName==="IFRAME"&&e.getMeta(r))}function hn(r,e){return!!(r.nodeName==="LINK"&&r.nodeType===r.ELEMENT_NODE&&r.getAttribute&&r.getAttribute("rel")==="stylesheet"&&e.getMeta(r))}function dn(r,e){var t,i;let s=(i=(t=r.ownerDocument)==null?void 0:t.defaultView)==null?void 0:i.frameElement;if(!s||s===e)return{x:0,y:0,relativeScale:1,absoluteScale:1};let n=s.getBoundingClientRect(),o=dn(s,e),a=n.height/s.clientHeight;return{x:n.x*o.relativeScale+o.x,y:n.y*o.relativeScale+o.y,relativeScale:a,absoluteScale:o.absoluteScale*a}}function xe(r){return r?r instanceof ce&&"shadowRoot"in r?!!r.shadowRoot:!!k.shadowRoot(r):!1}function Ke(r,e){let t=r[e[0]];return e.length===1?t:Ke(t.cssRules[e[1]].cssRules,e.slice(2))}function gs(r){let e=[...r],t=e.pop();return{positions:e,index:t}}function wl(r){let e=new Set,t=[];for(let i=r.length;i--;){let s=r[i];e.has(s.id)||(t.push(s),e.add(s.id))}return t}function fn(r){var e;let t=null;return"getRootNode"in r&&((e=k.getRootNode(r))==null?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&k.host(k.getRootNode(r))&&(t=k.host(k.getRootNode(r))),t}function vl(r){let e=r,t;for(;t=fn(e);)e=t;return e}function bl(r){let e=r.ownerDocument;if(!e)return!1;let t=vl(r);return k.contains(e,t)}function pn(r){let e=r.ownerDocument;return e?k.contains(e,r)||bl(r):!1}function vo(r){return"__ln"in r}function vs(r,e){r.delete(e),k.childNodes(e).forEach(t=>vs(r,t))}function vp(r,e){let t=[r];for(;t.length;){let i=t.pop();e.has(i)||(e.add(i),k.childNodes(i).forEach(s=>t.push(s)))}}function So(r,e,t){return r.size===0?!1:bp(r,e)}function bp(r,e,t){let i=k.parentNode(e);return i?r.has(i):!1}function Co(r,e){return r.size===0?!1:Sl(r,e)}function Sl(r,e){let t=k.parentNode(e);return t?r.has(t)?!0:Sl(r,t):!1}function Sp(r){vt=r}function Cp(){vt=void 0}function _t(r){try{if("composedPath"in r){let e=r.composedPath();if(e.length)return e[0]}else if("path"in r&&r.path.length)return r.path[0]}catch(e){}return r&&r.target}function Cl(r,e){let t=new ws;$e.push(t),t.init(r);let i=new(ml())(A(t.processMutations.bind(t)));return i.observe(e,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Ep({mousemoveCb:r,sampling:e,doc:t,mirror:i}){if(e.mousemove===!1)return()=>{};let s=typeof e.mousemove=="number"?e.mousemove:50,n=typeof e.mousemoveCallback=="number"?e.mousemoveCallback:500,o=[],a,l=ot(A(h=>{let d=Date.now()-a;r(o.map(p=>(p.timeOffset-=d,p)),h),o=[],a=null}),n),c=A(ot(A(h=>{let d=_t(h),{clientX:p,clientY:g}=_i(h)?h.changedTouches[0]:h;a||(a=Nt()),o.push({x:p,y:g,id:i.getId(d),timeOffset:Nt()-a}),l(typeof DragEvent!="undefined"&&h instanceof DragEvent?E.Drag:h instanceof MouseEvent?E.MouseMove:E.TouchMove)}),s,{trailing:!1})),u=[ee("mousemove",c,t),ee("touchmove",c,t),ee("drag",c,t)];return A(()=>{u.forEach(h=>h())})}function xp({mouseInteractionCb:r,doc:e,mirror:t,blockClass:i,blockSelector:s,sampling:n}){if(n.mouseInteraction===!1)return()=>{};let o=n.mouseInteraction===!0||n.mouseInteraction===void 0?{}:n.mouseInteraction,a=[],l=null,c=u=>h=>{let d=_t(h);if(te(d,i,s,!0))return;let p=null,g=u;if("pointerType"in h){switch(h.pointerType){case"mouse":p=ge.Mouse;break;case"touch":p=ge.Touch;break;case"pen":p=ge.Pen;break}p===ge.Touch?D[u]===D.MouseDown?g="TouchStart":D[u]===D.MouseUp&&(g="TouchEnd"):ge.Pen}else _i(h)&&(p=ge.Touch);p!==null?(l=p,(g.startsWith("Touch")&&p===ge.Touch||g.startsWith("Mouse")&&p===ge.Mouse)&&(p=null)):D[u]===D.Click&&(p=l,l=null);let m=_i(h)?h.changedTouches[0]:h;if(!m)return;let f=t.getId(d),{clientX:y,clientY:b}=m;A(r)({type:D[g],id:f,x:y,y:b,...p!==null&&{pointerType:p}})};return Object.keys(D).filter(u=>Number.isNaN(Number(u))&&!u.endsWith("_Departed")&&o[u]!==!1).forEach(u=>{let h=Te(u),d=c(u);if(window.PointerEvent)switch(D[u]){case D.MouseDown:case D.MouseUp:h=h.replace("mouse","pointer");break;case D.TouchStart:case D.TouchEnd:return}a.push(ee(h,d,e))}),A(()=>{a.forEach(u=>u())})}function El({scrollCb:r,doc:e,mirror:t,blockClass:i,blockSelector:s,sampling:n}){let o=A(ot(A(a=>{let l=_t(a);if(!l||te(l,i,s,!0))return;let c=t.getId(l);if(l===e&&e.defaultView){let u=sn(e.defaultView);r({id:c,x:u.left,y:u.top})}else r({id:c,x:l.scrollLeft,y:l.scrollTop})}),n.scroll||100));return ee("scroll",o,e)}function Ip({viewportResizeCb:r},{win:e}){let t=-1,i=-1,s=A(ot(A(()=>{let n=nn(),o=on();(t!==n||i!==o)&&(r({width:Number(o),height:Number(n)}),t=n,i=o)}),200));return ee("resize",s,e)}function Mp({inputCb:r,doc:e,mirror:t,blockClass:i,blockSelector:s,ignoreClass:n,ignoreSelector:o,maskInputOptions:a,maskInputFn:l,sampling:c,userTriggeredOnInput:u}){function h(b){let w=_t(b),S=b.isTrusted,I=w&&w.tagName;if(w&&I==="OPTION"&&(w=k.parentElement(w)),!w||!I||Tp.indexOf(I)<0||te(w,i,s,!0)||w.classList.contains(n)||o&&w.matches(o))return;let M=w.value,z=!1,U=Os(w)||"";U==="radio"||U==="checkbox"?z=w.checked:(a[I.toLowerCase()]||a[U])&&(M=As({element:w,maskInputOptions:a,tagName:I,type:U,value:M,maskInputFn:l})),d(w,u?{text:M,isChecked:z,userTriggered:S}:{text:M,isChecked:z});let K=w.name;U==="radio"&&K&&z&&e.querySelectorAll(`input[type="radio"][name="${K}"]`).forEach(q=>{if(q!==w){let ie=q.value;d(q,u?{text:ie,isChecked:!z,userTriggered:!1}:{text:ie,isChecked:!z})}})}function d(b,w){let S=Eo.get(b);if(!S||S.text!==w.text||S.isChecked!==w.isChecked){Eo.set(b,w);let I=t.getId(b);A(r)({...w,id:I})}}let g=(c.input==="last"?["change"]:["input","change"]).map(b=>ee(b,A(h),e)),m=e.defaultView;if(!m)return()=>{g.forEach(b=>b())};let f=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),y=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&g.push(...y.map(b=>Lt(b[0],b[1],{set(){A(h)({target:this,isTrusted:!1})}},!1,m))),A(()=>{g.forEach(b=>b())})}function Fi(r){let e=[];function t(i,s){if(ui("CSSGroupingRule")&&i.parentRule instanceof CSSGroupingRule||ui("CSSMediaRule")&&i.parentRule instanceof CSSMediaRule||ui("CSSSupportsRule")&&i.parentRule instanceof CSSSupportsRule||ui("CSSConditionRule")&&i.parentRule instanceof CSSConditionRule){let o=Array.from(i.parentRule.cssRules).indexOf(i);s.unshift(o)}else if(i.parentStyleSheet){let o=Array.from(i.parentStyleSheet.cssRules).indexOf(i);s.unshift(o)}return s}return t(r,e)}function Ce(r,e,t){let i,s;return r?(r.ownerNode?i=e.getId(r.ownerNode):s=t.getId(r),{styleId:s,id:i}):{}}function kp({styleSheetRuleCb:r,mirror:e,stylesheetManager:t},{win:i}){if(!i.CSSStyleSheet||!i.CSSStyleSheet.prototype)return()=>{};let s=i.CSSStyleSheet.prototype.insertRule;i.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:A((u,h,d)=>{let[p,g]=d,{id:m,styleId:f}=Ce(h,e,t.styleMirror);return(m&&m!==-1||f&&f!==-1)&&r({id:m,styleId:f,adds:[{rule:p,index:g}]}),u.apply(h,d)})}),i.CSSStyleSheet.prototype.addRule=function(u,h,d=this.cssRules.length){let p=`${u} { ${h} }`;return i.CSSStyleSheet.prototype.insertRule.apply(this,[p,d])};let n=i.CSSStyleSheet.prototype.deleteRule;i.CSSStyleSheet.prototype.deleteRule=new Proxy(n,{apply:A((u,h,d)=>{let[p]=d,{id:g,styleId:m}=Ce(h,e,t.styleMirror);return(g&&g!==-1||m&&m!==-1)&&r({id:g,styleId:m,removes:[{index:p}]}),u.apply(h,d)})}),i.CSSStyleSheet.prototype.removeRule=function(u){return i.CSSStyleSheet.prototype.deleteRule.apply(this,[u])};let o;i.CSSStyleSheet.prototype.replace&&(o=i.CSSStyleSheet.prototype.replace,i.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:A((u,h,d)=>{let[p]=d,{id:g,styleId:m}=Ce(h,e,t.styleMirror);return(g&&g!==-1||m&&m!==-1)&&r({id:g,styleId:m,replace:p}),u.apply(h,d)})}));let a;i.CSSStyleSheet.prototype.replaceSync&&(a=i.CSSStyleSheet.prototype.replaceSync,i.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:A((u,h,d)=>{let[p]=d,{id:g,styleId:m}=Ce(h,e,t.styleMirror);return(g&&g!==-1||m&&m!==-1)&&r({id:g,styleId:m,replaceSync:p}),u.apply(h,d)})}));let l={};hi("CSSGroupingRule")?l.CSSGroupingRule=i.CSSGroupingRule:(hi("CSSMediaRule")&&(l.CSSMediaRule=i.CSSMediaRule),hi("CSSConditionRule")&&(l.CSSConditionRule=i.CSSConditionRule),hi("CSSSupportsRule")&&(l.CSSSupportsRule=i.CSSSupportsRule));let c={};return Object.entries(l).forEach(([u,h])=>{c[u]={insertRule:h.prototype.insertRule,deleteRule:h.prototype.deleteRule},h.prototype.insertRule=new Proxy(c[u].insertRule,{apply:A((d,p,g)=>{let[m,f]=g,{id:y,styleId:b}=Ce(p.parentStyleSheet,e,t.styleMirror);return(y&&y!==-1||b&&b!==-1)&&r({id:y,styleId:b,adds:[{rule:m,index:[...Fi(p),f||0]}]}),d.apply(p,g)})}),h.prototype.deleteRule=new Proxy(c[u].deleteRule,{apply:A((d,p,g)=>{let[m]=g,{id:f,styleId:y}=Ce(p.parentStyleSheet,e,t.styleMirror);return(f&&f!==-1||y&&y!==-1)&&r({id:f,styleId:y,removes:[{index:[...Fi(p),m]}]}),d.apply(p,g)})})}),A(()=>{i.CSSStyleSheet.prototype.insertRule=s,i.CSSStyleSheet.prototype.deleteRule=n,o&&(i.CSSStyleSheet.prototype.replace=o),a&&(i.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([u,h])=>{h.prototype.insertRule=c[u].insertRule,h.prototype.deleteRule=c[u].deleteRule})})}function xl({mirror:r,stylesheetManager:e},t){var i,s,n;let o=null;t.nodeName==="#document"?o=r.getId(t):o=r.getId(k.host(t));let a=t.nodeName==="#document"?(i=t.defaultView)==null?void 0:i.Document:(n=(s=t.ownerDocument)==null?void 0:s.defaultView)==null?void 0:n.ShadowRoot,l=a!=null&&a.prototype?Object.getOwnPropertyDescriptor(a==null?void 0:a.prototype,"adoptedStyleSheets"):void 0;return o===null||o===-1||!a||!l?()=>{}:(Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var c;return(c=l.get)==null?void 0:c.call(this)},set(c){var u;let h=(u=l.set)==null?void 0:u.call(this,c);if(o!==null&&o!==-1)try{e.adoptStyleSheets(c,o)}catch(d){}return h}}),A(()=>{Object.defineProperty(t,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})}))}function Rp({styleDeclarationCb:r,mirror:e,ignoreCSSAttributes:t,stylesheetManager:i},{win:s}){let n=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(n,{apply:A((a,l,c)=>{var u;let[h,d,p]=c;if(t.has(h))return n.apply(l,[h,d,p]);let{id:g,styleId:m}=Ce((u=l.parentRule)==null?void 0:u.parentStyleSheet,e,i.styleMirror);return(g&&g!==-1||m&&m!==-1)&&r({id:g,styleId:m,set:{property:h,value:d,priority:p},index:Fi(l.parentRule)}),a.apply(l,c)})});let o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:A((a,l,c)=>{var u;let[h]=c;if(t.has(h))return o.apply(l,[h]);let{id:d,styleId:p}=Ce((u=l.parentRule)==null?void 0:u.parentStyleSheet,e,i.styleMirror);return(d&&d!==-1||p&&p!==-1)&&r({id:d,styleId:p,remove:{property:h},index:Fi(l.parentRule)}),a.apply(l,c)})}),A(()=>{s.CSSStyleDeclaration.prototype.setProperty=n,s.CSSStyleDeclaration.prototype.removeProperty=o})}function Np({mediaInteractionCb:r,blockClass:e,blockSelector:t,mirror:i,sampling:s,doc:n}){let o=A(l=>ot(A(c=>{let u=_t(c);if(!u||te(u,e,t,!0))return;let{currentTime:h,volume:d,muted:p,playbackRate:g,loop:m}=u;r({type:l,id:i.getId(u),currentTime:h,volume:d,muted:p,playbackRate:g,loop:m})}),s.media||500)),a=[ee("play",o(Ee.Play),n),ee("pause",o(Ee.Pause),n),ee("seeked",o(Ee.Seeked),n),ee("volumechange",o(Ee.VolumeChange),n),ee("ratechange",o(Ee.RateChange),n)];return A(()=>{a.forEach(l=>l())})}function Ap({fontCb:r,doc:e}){let t=e.defaultView;if(!t)return()=>{};let i=[],s=new WeakMap,n=t.FontFace;t.FontFace=function(l,c,u){let h=new n(l,c,u);return s.set(h,{family:l,buffer:typeof c!="string",descriptors:u,fontSource:typeof c=="string"?c:JSON.stringify(Array.from(new Uint8Array(c)))}),h};let o=Fe(e.fonts,"add",function(a){return function(l){return setTimeout(A(()=>{let c=s.get(l);c&&(r(c),s.delete(l))}),0),a.apply(this,[l])}});return i.push(()=>{t.FontFace=n}),i.push(o),A(()=>{i.forEach(a=>a())})}function Op(r){let{doc:e,mirror:t,blockClass:i,blockSelector:s,selectionCb:n}=r,o=!0,a=A(()=>{let l=e.getSelection();if(!l||o&&(l!=null&&l.isCollapsed))return;o=l.isCollapsed||!1;let c=[],u=l.rangeCount||0;for(let h=0;h<u;h++){let d=l.getRangeAt(h),{startContainer:p,startOffset:g,endContainer:m,endOffset:f}=d;te(p,i,s,!0)||te(m,i,s,!0)||c.push({start:t.getId(p),startOffset:g,end:t.getId(m),endOffset:f})}n({ranges:c})});return a(),ee("selectionchange",a)}function Dp({doc:r,customElementCb:e}){let t=r.defaultView;return!t||!t.customElements?()=>{}:Fe(t.customElements,"define",function(s){return function(n,o,a){try{e({define:{name:n}})}catch(l){console.warn(`Custom element callback failed for ${n}`)}return s.apply(this,[n,o,a])}})}function Pp(r,e){let{mutationCb:t,mousemoveCb:i,mouseInteractionCb:s,scrollCb:n,viewportResizeCb:o,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:u,canvasMutationCb:h,fontCb:d,selectionCb:p,customElementCb:g}=r;r.mutationCb=(...m)=>{e.mutation&&e.mutation(...m),t(...m)},r.mousemoveCb=(...m)=>{e.mousemove&&e.mousemove(...m),i(...m)},r.mouseInteractionCb=(...m)=>{e.mouseInteraction&&e.mouseInteraction(...m),s(...m)},r.scrollCb=(...m)=>{e.scroll&&e.scroll(...m),n(...m)},r.viewportResizeCb=(...m)=>{e.viewportResize&&e.viewportResize(...m),o(...m)},r.inputCb=(...m)=>{e.input&&e.input(...m),a(...m)},r.mediaInteractionCb=(...m)=>{e.mediaInteaction&&e.mediaInteaction(...m),l(...m)},r.styleSheetRuleCb=(...m)=>{e.styleSheetRule&&e.styleSheetRule(...m),c(...m)},r.styleDeclarationCb=(...m)=>{e.styleDeclaration&&e.styleDeclaration(...m),u(...m)},r.canvasMutationCb=(...m)=>{e.canvasMutation&&e.canvasMutation(...m),h(...m)},r.fontCb=(...m)=>{e.font&&e.font(...m),d(...m)},r.selectionCb=(...m)=>{e.selection&&e.selection(...m),p(...m)},r.customElementCb=(...m)=>{e.customElement&&e.customElement(...m),g(...m)}}function $p(r,e={}){let t=r.doc.defaultView;if(!t)return()=>{};Pp(r,e);let i;r.recordDOM&&(i=Cl(r,r.doc));let s=Ep(r),n=xp(r),o=El(r),a=Ip(r,{win:t}),l=Mp(r),c=Np(r),u=()=>{},h=()=>{},d=()=>{},p=()=>{};r.recordDOM&&(u=kp(r,{win:t}),h=xl(r,r.doc),d=Rp(r,{win:t}),r.collectFonts&&(p=Ap(r)));let g=Op(r),m=Dp(r),f=[];for(let y of r.plugins)f.push(y.observer(y.callback,t,y.options));return A(()=>{$e.forEach(y=>y.reset()),i==null||i.disconnect(),s(),n(),o(),a(),l(),c(),u(),h(),d(),p(),g(),m(),f.forEach(y=>y())})}function ui(r){return typeof window[r]!="undefined"}function hi(r){return!!(typeof window[r]!="undefined"&&window[r].prototype&&"insertRule"in window[r].prototype&&"deleteRule"in window[r].prototype)}function Fp(r,e){let t=xo.get(r);return t||(t=new Map,xo.set(r,t)),t.has(e)||t.set(e,[]),t.get(e)}function wi(r,e,t){if(r instanceof Array)return r.map(i=>wi(i,e,t));if(r===null)return r;if(r instanceof Float32Array||r instanceof Float64Array||r instanceof Int32Array||r instanceof Uint32Array||r instanceof Uint8Array||r instanceof Uint16Array||r instanceof Int16Array||r instanceof Int8Array||r instanceof Uint8ClampedArray)return{rr_type:r.constructor.name,args:[Object.values(r)]};if(r instanceof ArrayBuffer){let i=r.constructor.name,s=Lp(r);return{rr_type:i,base64:s}}else{if(r instanceof DataView)return{rr_type:r.constructor.name,args:[wi(r.buffer,e,t),r.byteOffset,r.byteLength]};if(r instanceof HTMLImageElement){let i=r.constructor.name,{src:s}=r;return{rr_type:i,src:s}}else if(r instanceof HTMLCanvasElement){let i="HTMLImageElement",s=r.toDataURL();return{rr_type:i,src:s}}else{if(r instanceof ImageData)return{rr_type:r.constructor.name,args:[wi(r.data,e,t),r.width,r.height]};if(Ml(r,e)||typeof r=="object"){let i=r.constructor.name,s=Il(r,e,t);return{rr_type:i,index:s}}}}return r}function Up(r,e,t,i){let s=[],n=Object.getOwnPropertyNames(e.CanvasRenderingContext2D.prototype);for(let o of n)try{if(typeof e.CanvasRenderingContext2D.prototype[o]!="function")continue;let a=Fe(e.CanvasRenderingContext2D.prototype,o,function(l){return function(...c){return te(this.canvas,t,i,!0)||setTimeout(()=>{let u=Tl(c,e,this);r(this.canvas,{type:be["2D"],property:o,args:u})},0),l.apply(this,c)}});s.push(a)}catch(a){let l=Lt(e.CanvasRenderingContext2D.prototype,o,{set(c){r(this.canvas,{type:be["2D"],property:o,args:[c],setter:!0})}});s.push(l)}return()=>{s.forEach(o=>o())}}function Bp(r){return r==="experimental-webgl"?"webgl":r}function Io(r,e,t,i){let s=[];try{let n=Fe(r.HTMLCanvasElement.prototype,"getContext",function(o){return function(a,...l){if(!te(this,e,t,!0)){let c=Bp(a);if("__context"in this||(this.__context=c),i&&["webgl","webgl2"].includes(c))if(l[0]&&typeof l[0]=="object"){let u=l[0];u.preserveDrawingBuffer||(u.preserveDrawingBuffer=!0)}else l.splice(0,1,{preserveDrawingBuffer:!0})}return o.apply(this,[a,...l])}});s.push(n)}catch(n){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{s.forEach(n=>n())}}function To(r,e,t,i,s,n){let o=[],a=Object.getOwnPropertyNames(r);for(let l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if(typeof r[l]!="function")continue;let c=Fe(r,l,function(u){return function(...h){let d=u.apply(this,h);if(Il(d,n,this),"tagName"in this.canvas&&!te(this.canvas,i,s,!0)){let p=Tl(h,n,this),g={type:e,property:l,args:p};t(this.canvas,g)}return d}});o.push(c)}catch(c){let u=Lt(r,l,{set(h){t(this.canvas,{type:e,property:l,args:[h],setter:!0})}});o.push(u)}return o}function Wp(r,e,t,i){let s=[];return s.push(...To(e.WebGLRenderingContext.prototype,be.WebGL,r,t,i,e)),typeof e.WebGL2RenderingContext!="undefined"&&s.push(...To(e.WebGL2RenderingContext.prototype,be.WebGL2,r,t,i,e)),()=>{s.forEach(n=>n())}}function Hp(r){let e;try{if(e=Mo&&(window.URL||window.webkitURL).createObjectURL(Mo),!e)throw"";let t=new Worker(e,{name:r==null?void 0:r.name});return t.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(e)}),t}catch(t){return new Worker("data:text/javascript;base64,"+kl,{name:r==null?void 0:r.name})}finally{e&&(window.URL||window.webkitURL).revokeObjectURL(e)}}function Re(r={}){let{emit:e,checkoutEveryNms:t,checkoutEveryNth:i,blockClass:s="rr-block",blockSelector:n=null,ignoreClass:o="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:u=!0,maskAllInputs:h,maskInputOptions:d,slimDOMOptions:p,maskInputFn:g,maskTextFn:m,hooks:f,packFn:y,sampling:b={},dataURLOptions:w={},mousemoveWait:S,recordDOM:I=!0,recordCanvas:M=!1,recordCrossOriginIframes:z=!1,recordAfter:U=r.recordAfter==="DOMContentLoaded"?r.recordAfter:"load",userTriggeredOnInput:K=!1,collectFonts:q=!1,inlineImages:ie=!1,plugins:re,keepIframeSrcFn:R=()=>!1,ignoreCSSAttributes:Ae=new Set([]),errorHandler:Oe}=r;Sp(Oe);let Y=z?window.parent===window:!0,$=!1;if(!Y)try{window.parent.document&&($=!1)}catch(P){$=!0}if(Y&&!e)throw new Error("emit function is required");if(!Y&&!$)return()=>{};S!==void 0&&b.mousemove===void 0&&(b.mousemove=S),le.reset();let oe=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}:d!==void 0?d:{password:!0},se=p===!0||p==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:p==="all",headMetaDescKeywords:p==="all",headTitleMutations:p==="all"}:p||{};cn();let ct,rr=0,bn=P=>{for(let ae of re||[])ae.eventProcessor&&(P=ae.eventProcessor(P));return y&&!$&&(P=y(P)),P};Z=(P,ae)=>{var X;let J=P;if(J.timestamp=Nt(),(X=$e[0])!=null&&X.isFrozen()&&J.type!==x.FullSnapshot&&!(J.type===x.IncrementalSnapshot&&J.data.source===E.Mutation)&&$e.forEach(de=>de.unfreeze()),Y)e==null||e(bn(J),ae);else if($){let de={type:"rrweb",event:bn(J),origin:window.location.origin,isCheckout:ae};window.parent.postMessage(de,"*")}if(J.type===x.FullSnapshot)ct=J,rr=0;else if(J.type===x.IncrementalSnapshot){if(J.data.source===E.Mutation&&J.data.isAttachIframe)return;rr++;let de=i&&rr>=i,B=t&&J.timestamp-ct.timestamp>t;(de||B)&&vi(!0)}};let Bt=P=>{Z({type:x.IncrementalSnapshot,data:{source:E.Mutation,...P}})},Sn=P=>Z({type:x.IncrementalSnapshot,data:{source:E.Scroll,...P}}),Cn=P=>Z({type:x.IncrementalSnapshot,data:{source:E.CanvasMutation,...P}}),Hl=P=>Z({type:x.IncrementalSnapshot,data:{source:E.AdoptedStyleSheet,...P}}),De=new Es({mutationCb:Bt,adoptedStyleSheetCb:Hl}),Pe=new bs({mirror:le,mutationCb:Bt,stylesheetManager:De,recordCrossOriginIframes:z,wrappedEmit:Z});for(let P of re||[])P.getMirror&&P.getMirror({nodeMirror:le,crossOriginIframeMirror:Pe.crossOriginIframeMirror,crossOriginIframeStyleMirror:Pe.crossOriginIframeStyleMirror});let sr=new xs;xr=new Cs({recordCanvas:M,mutationCb:Cn,win:window,blockClass:s,blockSelector:n,mirror:le,sampling:b.canvas,dataURLOptions:w});let Wt=new Ss({mutationCb:Bt,scrollCb:Sn,bypassOptions:{blockClass:s,blockSelector:n,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskInputOptions:oe,dataURLOptions:w,maskTextFn:m,maskInputFn:g,recordCanvas:M,inlineImages:ie,sampling:b,slimDOMOptions:se,iframeManager:Pe,stylesheetManager:De,canvasManager:xr,keepIframeSrcFn:R,processedNodeManager:sr},mirror:le});vi=(P=!1)=>{if(!I)return;Z({type:x.Meta,data:{href:window.location.href,width:on(),height:nn()}},P),De.reset(),Wt.init(),$e.forEach(X=>X.lock());let ae=Yc(document,{mirror:le,blockClass:s,blockSelector:n,maskTextClass:l,maskTextSelector:c,inlineStylesheet:u,maskAllInputs:oe,maskTextFn:m,maskInputFn:g,slimDOM:se,dataURLOptions:w,recordCanvas:M,inlineImages:ie,onSerialize:X=>{Je(X,le)&&Pe.addIframe(X),hn(X,le)&&De.trackLinkElement(X),xe(X)&&Wt.addShadowRoot(k.shadowRoot(X),document)},onIframeLoad:(X,J)=>{Pe.attachIframe(X,J),Wt.observeAttachShadow(X)},onStylesheetLoad:(X,J)=>{De.attachLinkElement(X,J)},keepIframeSrcFn:R});if(!ae)return console.warn("Failed to snapshot the document");Z({type:x.FullSnapshot,data:{node:ae,initialOffset:sn(window)}},P),$e.forEach(X=>X.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&De.adoptStyleSheets(document.adoptedStyleSheets,le.getId(document))};try{let P=[],ae=J=>{var de;return A($p)({mutationCb:Bt,mousemoveCb:(B,nr)=>Z({type:x.IncrementalSnapshot,data:{source:nr,positions:B}}),mouseInteractionCb:B=>Z({type:x.IncrementalSnapshot,data:{source:E.MouseInteraction,...B}}),scrollCb:Sn,viewportResizeCb:B=>Z({type:x.IncrementalSnapshot,data:{source:E.ViewportResize,...B}}),inputCb:B=>Z({type:x.IncrementalSnapshot,data:{source:E.Input,...B}}),mediaInteractionCb:B=>Z({type:x.IncrementalSnapshot,data:{source:E.MediaInteraction,...B}}),styleSheetRuleCb:B=>Z({type:x.IncrementalSnapshot,data:{source:E.StyleSheetRule,...B}}),styleDeclarationCb:B=>Z({type:x.IncrementalSnapshot,data:{source:E.StyleDeclaration,...B}}),canvasMutationCb:Cn,fontCb:B=>Z({type:x.IncrementalSnapshot,data:{source:E.Font,...B}}),selectionCb:B=>{Z({type:x.IncrementalSnapshot,data:{source:E.Selection,...B}})},customElementCb:B=>{Z({type:x.IncrementalSnapshot,data:{source:E.CustomElement,...B}})},blockClass:s,ignoreClass:o,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:oe,inlineStylesheet:u,sampling:b,recordDOM:I,recordCanvas:M,inlineImages:ie,userTriggeredOnInput:K,collectFonts:q,doc:J,maskInputFn:g,maskTextFn:m,keepIframeSrcFn:R,blockSelector:n,slimDOMOptions:se,dataURLOptions:w,mirror:le,iframeManager:Pe,stylesheetManager:De,shadowDomManager:Wt,processedNodeManager:sr,canvasManager:xr,ignoreCSSAttributes:Ae,plugins:((de=re==null?void 0:re.filter(B=>B.observer))==null?void 0:de.map(B=>({observer:B.observer,options:B.options,callback:nr=>Z({type:x.Plugin,data:{plugin:B.name,payload:nr}})})))||[]},f)};Pe.addLoadListener(J=>{try{P.push(ae(J.contentDocument))}catch(de){console.warn(de)}});let X=()=>{vi(),P.push(ae(document)),Bi=!0};return document.readyState==="interactive"||document.readyState==="complete"?X():(P.push(ee("DOMContentLoaded",()=>{Z({type:x.DomContentLoaded,data:{}}),U==="DOMContentLoaded"&&X()})),P.push(ee("load",()=>{Z({type:x.Load,data:{}}),U==="load"&&X()},window))),()=>{P.forEach(J=>J()),sr.destroy(),Bi=!1,Cp()}}catch(P){console.warn(P)}}function Rl(r){return{all:r=r||new Map,on:function(e,t){var i=r.get(e);i?i.push(t):r.set(e,[t])},off:function(e,t){var i=r.get(e);i&&(t?i.splice(i.indexOf(t)>>>0,1):r.set(e,[]))},emit:function(e,t){var i=r.get(e);i&&i.slice().map(function(s){s(t)}),(i=r.get("*"))&&i.slice().map(function(s){s(e,t)})}}}function Gp(r=window,e=document){if("scrollBehavior"in e.documentElement.style&&r.__forceSmoothScrollPolyfill__!==!0)return;let t=r.HTMLElement||r.Element,i=468,s={scroll:r.scroll||r.scrollTo,scrollBy:r.scrollBy,elementScroll:t.prototype.scroll||l,scrollIntoView:t.prototype.scrollIntoView},n=r.performance&&r.performance.now?r.performance.now.bind(r.performance):Date.now;function o(y){let b=["MSIE ","Trident/","Edge/"];return new RegExp(b.join("|")).test(y)}let a=o(r.navigator.userAgent)?1:0;function l(y,b){this.scrollLeft=y,this.scrollTop=b}function c(y){return .5*(1-Math.cos(Math.PI*y))}function u(y){if(y===null||typeof y!="object"||y.behavior===void 0||y.behavior==="auto"||y.behavior==="instant")return!0;if(typeof y=="object"&&y.behavior==="smooth")return!1;throw new TypeError("behavior member of ScrollOptions "+y.behavior+" is not a valid value for enumeration ScrollBehavior.")}function h(y,b){if(b==="Y")return y.clientHeight+a<y.scrollHeight;if(b==="X")return y.clientWidth+a<y.scrollWidth}function d(y,b){let w=r.getComputedStyle(y,null)["overflow"+b];return w==="auto"||w==="scroll"}function p(y){let b=h(y,"Y")&&d(y,"Y"),w=h(y,"X")&&d(y,"X");return b||w}function g(y){for(;y!==e.body&&p(y)===!1;)y=y.parentNode||y.host;return y}function m(y){let b=n(),w,S,I,M=(b-y.startTime)/i;M=M>1?1:M,w=c(M),S=y.startX+(y.x-y.startX)*w,I=y.startY+(y.y-y.startY)*w,y.method.call(y.scrollable,S,I),(S!==y.x||I!==y.y)&&r.requestAnimationFrame(m.bind(r,y))}function f(y,b,w){let S,I,M,z,U=n();y===e.body?(S=r,I=r.scrollX||r.pageXOffset,M=r.scrollY||r.pageYOffset,z=s.scroll):(S=y,I=y.scrollLeft,M=y.scrollTop,z=l),m({scrollable:S,method:z,startTime:U,startX:I,startY:M,x:b,y:w})}r.scroll=r.scrollTo=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){s.scroll.call(r,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:r.scrollX||r.pageXOffset,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:r.scrollY||r.pageYOffset);return}f.call(r,e.body,arguments[0].left!==void 0?~~arguments[0].left:r.scrollX||r.pageXOffset,arguments[0].top!==void 0?~~arguments[0].top:r.scrollY||r.pageYOffset)}},r.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])){s.scrollBy.call(r,arguments[0].left!==void 0?arguments[0].left:typeof arguments[0]!="object"?arguments[0]:0,arguments[0].top!==void 0?arguments[0].top:arguments[1]!==void 0?arguments[1]:0);return}f.call(r,e.body,~~arguments[0].left+(r.scrollX||r.pageXOffset),~~arguments[0].top+(r.scrollY||r.pageYOffset))}},t.prototype.scroll=t.prototype.scrollTo=function(){if(arguments[0]===void 0)return;if(u(arguments[0])===!0){if(typeof arguments[0]=="number"&&arguments[1]===void 0)throw new SyntaxError("Value could not be converted");s.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left:typeof arguments[0]!="object"?~~arguments[0]:this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top:arguments[1]!==void 0?~~arguments[1]:this.scrollTop);return}let y=arguments[0].left,b=arguments[0].top;f.call(this,this,typeof y=="undefined"?this.scrollLeft:~~y,typeof b=="undefined"?this.scrollTop:~~b)},t.prototype.scrollBy=function(){if(arguments[0]!==void 0){if(u(arguments[0])===!0){s.elementScroll.call(this,arguments[0].left!==void 0?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,arguments[0].top!==void 0?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop);return}this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior})}},t.prototype.scrollIntoView=function(){if(u(arguments[0])===!0){s.scrollIntoView.call(this,arguments[0]===void 0?!0:arguments[0]);return}let y=g(this),b=y.getBoundingClientRect(),w=this.getBoundingClientRect();y!==e.body?(f.call(this,y,y.scrollLeft+w.left-b.left,y.scrollTop+w.top-b.top),r.getComputedStyle(y).position!=="fixed"&&r.scrollBy({left:b.left,top:b.top,behavior:"smooth"})):r.scrollBy({left:w.left,top:w.top,behavior:"smooth"})}}function ko(r,e){if(r.type===x.IncrementalSnapshot&&r.data.source===E.MouseMove&&r.data.positions&&r.data.positions.length){let t=r.data.positions[0].timeOffset,i=r.timestamp+t;return r.delay=i-e,i-e}return r.delay=r.timestamp-e,r.delay}function Ro(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i,s,n=t.call(r),o=[];try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(s)throw s.error}}return o}function Ir(r){return r===void 0?[]:[].concat(r)}function Ve(r){return{type:"xstate.assign",assignment:r}}function No(r,e){return typeof(r=typeof r=="string"&&e&&e[r]?e[r]:r)=="string"?{type:r}:typeof r=="function"?{type:r.name,exec:r}:r}function Wi(r){return function(e){return r===e}}function Al(r){return typeof r=="string"?{type:r}:r}function Ao(r,e){return{value:r,context:e,actions:[],changed:!1,matches:Wi(r)}}function Oo(r,e,t){var i=e,s=!1;return[r.filter(function(n){if(n.type==="xstate.assign"){s=!0;var o=Object.assign({},i);return typeof n.assignment=="function"?o=n.assignment(i,t):Object.keys(n.assignment).forEach(function(a){o[a]=typeof n.assignment[a]=="function"?n.assignment[a](i,t):n.assignment[a]}),i=o,!1}return!0}),i,s]}function Ol(r,e){e===void 0&&(e={});var t=Ro(Oo(Ir(r.states[r.initial].entry).map(function(o){return No(o,e.actions)}),r.context,Nl),2),i=t[0],s=t[1],n={config:r,_options:e,initialState:{value:r.initial,actions:i,context:s,matches:Wi(r.initial)},transition:function(o,a){var l,c,u=typeof o=="string"?{value:o,context:r.context}:o,h=u.value,d=u.context,p=Al(a),g=r.states[h];if(g.on){var m=Ir(g.on[p.type]);try{for(var f=(function($){var oe=typeof Symbol=="function"&&Symbol.iterator,se=oe&&$[oe],ct=0;if(se)return se.call($);if($&&typeof $.length=="number")return{next:function(){return $&&ct>=$.length&&($=void 0),{value:$&&$[ct++],done:!$}}};throw new TypeError(oe?"Object is not iterable.":"Symbol.iterator is not defined.")})(m),y=f.next();!y.done;y=f.next()){var b=y.value;if(b===void 0)return Ao(h,d);var w=typeof b=="string"?{target:b}:b,S=w.target,I=w.actions,M=I===void 0?[]:I,z=w.cond,U=z===void 0?function(){return!0}:z,K=S===void 0,q=S!=null?S:h,ie=r.states[q];if(U(d,p)){var re=Ro(Oo((K?Ir(M):[].concat(g.exit,M,ie.entry).filter(function($){return $})).map(function($){return No($,n._options.actions)}),d,p),3),R=re[0],Ae=re[1],Oe=re[2],Y=S!=null?S:h;return{value:Y,context:Ae,actions:R,changed:S!==h||R.length>0||Oe,matches:Wi(Y)}}}}catch($){l={error:$}}finally{try{y&&!y.done&&(c=f.return)&&c.call(f)}finally{if(l)throw l.error}}}return Ao(h,d)}};return n}function Dl(r){var e=r.initialState,t=Xe.NotStarted,i=new Set,s={_machine:r,send:function(n){t===Xe.Running&&(e=r.transition(e,n),Do(e,Al(n)),i.forEach(function(o){return o(e)}))},subscribe:function(n){return i.add(n),n(e),{unsubscribe:function(){return i.delete(n)}}},start:function(n){if(n){var o=typeof n=="object"?n:{context:r.config.context,value:n};e={value:o.value,actions:[],context:o.context,matches:Wi(o.value)}}return t=Xe.Running,Do(e,Nl),s},stop:function(){return t=Xe.Stopped,i.clear(),s},get state(){return e},get status(){return t}};return s}function jp(r,e){for(let t=r.length-1;t>=0;t--){let i=r[t];if(i.type===x.Meta&&i.timestamp<=e)return r.slice(t)}return r}function Kp(r,{getCastFn:e,applyEventsSynchronously:t,emitter:i}){let s=Ol({id:"player",context:r,initial:"paused",states:{playing:{on:{PAUSE:{target:"paused",actions:["pause"]},CAST_EVENT:{target:"playing",actions:"castEvent"},END:{target:"paused",actions:["resetLastPlayedEvent","pause"]},ADD_EVENT:{target:"playing",actions:["addEvent"]}}},paused:{on:{PLAY:{target:"playing",actions:["recordTimeOffset","play"]},CAST_EVENT:{target:"paused",actions:"castEvent"},TO_LIVE:{target:"live",actions:["startLive"]},ADD_EVENT:{target:"paused",actions:["addEvent"]}}},live:{on:{ADD_EVENT:{target:"live",actions:["addEvent"]},CAST_EVENT:{target:"live",actions:["castEvent"]}}}}},{actions:{castEvent:Ve({lastPlayedEvent:(n,o)=>o.type==="CAST_EVENT"?o.payload.event:n.lastPlayedEvent}),recordTimeOffset:Ve((n,o)=>{let a=n.timeOffset;return"payload"in o&&"timeOffset"in o.payload&&(a=o.payload.timeOffset),{...n,timeOffset:a,baselineTime:n.events[0].timestamp+a}}),play(n){var o;let{timer:a,events:l,baselineTime:c,lastPlayedEvent:u}=n;a.clear();for(let g of l)ko(g,c);let h=jp(l,c),d=u==null?void 0:u.timestamp;(u==null?void 0:u.type)===x.IncrementalSnapshot&&u.data.source===E.MouseMove&&(d=u.timestamp+((o=u.data.positions[0])==null?void 0:o.timeOffset)),c<(d||0)&&i.emit(O.PlayBack);let p=new Array;for(let g of h)if(!(d&&d<c&&(g.timestamp<=d||g===u)))if(g.timestamp<c)p.push(g);else{let m=e(g,!1);a.addAction({doAction:()=>{m()},delay:g.delay})}t(p),i.emit(O.Flush),a.start()},pause(n){n.timer.clear()},resetLastPlayedEvent:Ve(n=>({...n,lastPlayedEvent:null})),startLive:Ve({baselineTime:(n,o)=>(n.timer.start(),o.type==="TO_LIVE"&&o.payload.baselineTime?o.payload.baselineTime:Date.now())}),addEvent:Ve((n,o)=>{let{baselineTime:a,timer:l,events:c}=n;if(o.type==="ADD_EVENT"){let{event:u}=o.payload;ko(u,a);let h=c.length-1;if(!c[h]||c[h].timestamp<=u.timestamp)c.push(u);else{let g=-1,m=0;for(;m<=h;){let f=Math.floor((m+h)/2);c[f].timestamp<=u.timestamp?m=f+1:h=f-1}g===-1&&(g=m),c.splice(g,0,u)}let d=u.timestamp<a,p=e(u,d);d?p():l.isActive()&&l.addAction({doAction:()=>{p()},delay:u.delay})}return{...n,events:c}})}});return Dl(s)}function Yp(r){let e=Ol({id:"speed",context:r,initial:"normal",states:{normal:{on:{FAST_FORWARD:{target:"skipping",actions:["recordSpeed","setSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}},skipping:{on:{BACK_TO_NORMAL:{target:"normal",actions:["restoreSpeed"]},SET_SPEED:{target:"normal",actions:["setSpeed"]}}}}},{actions:{setSpeed:(t,i)=>{"payload"in i&&t.timer.setSpeed(i.payload.speed)},recordSpeed:Ve({normalSpeed:t=>t.timer.speed}),restoreSpeed:t=>{t.timer.setSpeed(t.normalSpeed)}}});return Dl(e)}function Pl(r,e){let t=Po.get(r);return t||(t=new Map,Po.set(r,t)),t.has(e)||t.set(e,[]),t.get(e)}function Ie(r,e,t){return async i=>{if(i&&typeof i=="object"&&"rr_type"in i)if(t&&(t.isUnchanged=!1),i.rr_type==="ImageBitmap"&&"args"in i){let s=await Ie(r,e,t)(i.args);return await createImageBitmap.apply(null,s)}else if("index"in i){if(t||e===null)return i;let{rr_type:s,index:n}=i;return Pl(e,s)[n]}else if("args"in i){let{rr_type:s,args:n}=i,o=window[s];return new o(...await Promise.all(n.map(Ie(r,e,t))))}else{if("base64"in i)return _p(i.base64);if("src"in i){let s=r.get(i.src);if(s)return s;{let n=new Image;return n.src=i.src,r.set(i.src,n),n}}else if("data"in i&&i.rr_type==="Blob"){let s=await Promise.all(i.data.map(Ie(r,e,t)));return new Blob(s,{type:i.type})}}else if(Array.isArray(i))return await Promise.all(i.map(Ie(r,e,t)));return i}}function Jp(r,e){try{return e===be.WebGL?r.getContext("webgl")||r.getContext("experimental-webgl"):r.getContext("webgl2")}catch(t){return null}}function qp(r,e){if(!(e!=null&&e.constructor))return;let{name:t}=e.constructor;if(!Zp.includes(t))return;let i=Pl(r,t);i.includes(e)||i.push(e)}async function Qp({mutation:r,target:e,type:t,imageMap:i,errorHandler:s}){try{let n=Jp(e,t);if(!n)return;if(r.setter){n[r.property]=r.args[0];return}let o=n[r.property],a=await Promise.all(r.args.map(Ie(i,n))),l=o.apply(n,a);qp(n,l);let c=!1}catch(n){s(r,n)}}async function em({event:r,mutations:e,target:t,imageMap:i,errorHandler:s}){let n=t.getContext("2d");if(!n){s(e[0],new Error("Canvas context is null"));return}let o=e.map(async l=>Promise.all(l.args.map(Ie(i,n))));(await Promise.all(o)).forEach((l,c)=>{let u=e[c];try{if(u.setter){n[u.property]=u.args[0];return}let h=n[u.property];u.property==="drawImage"&&typeof u.args[0]=="string"?(i.get(r),h.apply(n,u.args)):h.apply(n,l)}catch(h){s(u,h)}})}async function Ts({event:r,mutation:e,target:t,imageMap:i,canvasEventMap:s,errorHandler:n}){try{let o=s.get(r)||e,a="commands"in o?o.commands:[o];if([be.WebGL,be.WebGL2].includes(e.type)){for(let l=0;l<a.length;l++){let c=a[l];await Qp({mutation:c,type:e.type,target:t,imageMap:i,errorHandler:n})}return}await em({event:r,mutations:a,target:t,imageMap:i,errorHandler:n})}catch(o){n(e,o)}}function di(r,e){if(r.nodeName!=="DIALOG"||r instanceof ce)return;let t=r,i=t.open,s=i&&t.matches("dialog:modal"),n=t.getAttribute("rr_open_mode"),o=typeof(e==null?void 0:e.attributes.open)=="string"||typeof t.getAttribute("open")=="string",a=n==="modal";if(!(i&&!(s&&n==="non-modal"||!s&&a))){if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}i&&t.close(),o&&(a?t.showModal():t.show())}}function tm(r,e){if(r.nodeName!=="DIALOG"||r instanceof ce)return;let t=r;if(!t.isConnected){console.warn("dialog is not attached to the dom",t);return}e.attributes.open===null&&(t.removeAttribute("open"),t.removeAttribute("rr_open_mode"))}function Lo(r){return r.type==x.IncrementalSnapshot&&(r.data.source==E.TouchMove||r.data.source==E.MouseInteraction&&r.data.type==D.TouchStart)}var ic,rc,v,Tn,sc,nc,Mn,T,kn,Rn,Vt,oc,hr,dr,Q,bt,Nn,Mc,kc,Rc,Nc,Dc,Pc,St,We,An,Lc,_c,On,Xc,Dn,Jc,Zc,Ps,H,Go,eu,tu,iu,ue,Pn,$n,kr,$s,Ot,Ln,Rr,Ko,su,zi,Gt,nu,ou,au,lu,Or,Hi,cu,Dr,Vi,uu,hu,du,fu,_n,Fn,pu,mu,pr,gu,Pr,Yo,wu,vu,Un,jt,$r,Lr,bu,mr,Bn,Su,gr,Cu,Wn,Ci,Gi,Xo,fi,pi,Jo,Zo,qo,zn,Eu,xu,Iu,Tu,Qo,Mu,_r,ji,ea,ta,ia,ra,ku,sa,Ls,_s,na,we,Le,Ru,ca,ua,Ct,Fs,Fr,ha,Nu,Ur,Us,yr,Hn,Kt,Vn,Yt,ut,Xt,Jt,Zt,Au,Ou,Du,Pu,$u,Lu,_u,Fu,Uu,Bu,qt,Qt,Wu,Gn,zu,da,Ei,Bs,fa,pa,ma,Ze,Dt,Et,ga,ya,Hu,xi,Ws,Vu,Gu,ju,Ku,Yu,jn,Kn,Ju,Zu,qu,Qu,eh,zs,fe,th,ih,rh,sh,nh,Yn,oh,ah,lh,ch,uh,qe,Wr,Qe,ba,hh,dh,fh,ph,zr,mh,gh,yh,wh,vh,xt,bh,Sh,Ch,Eh,xh,Ih,Th,Mh,kh,Rh,Sa,Nh,Ah,Hs,Oh,Dh,Ca,Ph,Ea,xa,$h,Lh,_h,Fh,Ia,Ta,Uh,Bh,G,Jn,Yh,Xh,C,Jh,Zh,qn,qh,Vs,V,Ma,id,rd,sd,he,Qn,eo,Hr,Gs,Pt,to,Vr,Ra,od,Yi,ei,ad,ld,cd,ud,Kr,Xi,hd,Yr,Ji,dd,fd,pd,md,io,ro,gd,yd,wr,wd,Xr,Na,bd,Sd,so,ti,Jr,Zr,Cd,vr,no,Ed,br,xd,oo,Ti,Zi,Aa,mi,gi,Oa,Da,Pa,ao,Id,Td,Md,kd,$a,Rd,qr,qi,La,_a,Fa,Ua,Nd,Ba,js,Ks,Wa,ve,_e,Ad,Ga,ja,Tt,Ys,Qr,Ka,Od,es,Xs,Sr,lo,ii,co,ri,dt,si,ni,oi,Dd,Pd,$d,Ld,_d,Fd,Ud,Bd,Wd,zd,ai,li,Hd,uo,Vd,Ya,Mi,Js,Xa,Ja,Za,et,$t,Mt,qa,Qa,Gd,ki,Zs,jd,Kd,Yd,Xd,Jd,ho,fo,qd,Qd,ef,tf,rf,qs,pe,sf,nf,of,af,lf,po,cf,uf,hf,df,ff,tt,is,it,il,pf,mf,gf,yf,rs,wf,vf,bf,Sf,Cf,kt,Ef,xf,If,Tf,Mf,kf,Rf,Nf,Af,Of,rl,Df,Pf,Qs,$f,Lf,sl,_f,nl,ol,Ff,Uf,Bf,Wf,al,ll,zf,Hf,j,N,Gf,jf,ss,Kf,Yf,ce,ns,Ni,rt,os,as,Ai,Oi,Di,ls,ne,cs,Xf,me,st,Qf,nt,us,hs,ds,fs,ps,ep,tp,ip,ms,yo,wo,ci,op,Cr,Er,k,He,Li,Nt,At,wp,x,E,D,ge,be,Ee,O,ye,ys,bo,ws,vt,A,$e,Tp,Eo,Ui,bs,Ss,Ye,mt,pt,Lp,_p,xo,Il,Tl,Ml,kl,zp,Mo,Cs,Es,xs,Z,vi,xr,Bi,le,Vp,Is,Xe,Nl,Do,Xp,Po,Zp,Ms,im,rm,$o,Tr,ks,sm,nm,om,Ll=Jl(()=>{"use strict";ic=Object.defineProperty,rc=(r,e,t)=>e in r?ic(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,v=(r,e,t)=>rc(r,typeof e!="symbol"?e+"":e,t),sc=Object.defineProperty,nc=(r,e,t)=>e in r?sc(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Mn=(r,e,t)=>nc(r,typeof e!="symbol"?e+"":e,t),T=(r=>(r[r.Document=0]="Document",r[r.DocumentType=1]="DocumentType",r[r.Element=2]="Element",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.Comment=5]="Comment",r))(T||{}),kn={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Rn={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Vt={},oc=()=>!!globalThis.Zone;hr={};dr={};Q={childNodes:ac,parentNode:lc,parentElement:cc,textContent:uc,contains:hc,getRootNode:dc,host:fc,styleSheets:pc,shadowRoot:mc,querySelector:gc,querySelectorAll:yc,mutationObserver:wc};bt=class{constructor(){Mn(this,"idNodeMap",new Map),Mn(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;let i=(t=this.getMeta(e))==null?void 0:t.id;return i!=null?i:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(i=>this.removeNodeFromMap(i))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let i=t.id;this.idNodeMap.set(i,e),this.nodeMetaMap.set(e,t)}replace(e,t){let i=this.getNode(e);if(i){let s=this.nodeMetaMap.get(i);s&&this.nodeMetaMap.set(t,s)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};Nn="__rrweb_original__";Mc=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,kc=/^(?:[a-z+]+:)?\/\//i,Rc=/^www\..*/i,Nc=/^(data:)([^,]*),(.*)/i;Dc=1,Pc=new RegExp("[^a-z0-9-_:]"),St=-2;Lc=/^[^ \t\n\r\u000c]+/,_c=/^[, \t\n\r\u000c]+/;On=new WeakMap;Xc=/(max|min)-device-(width|height)/,Dn=new RegExp(Xc.source,"g"),Jc={postcssPlugin:"postcss-custom-selectors",prepare(){return{postcssPlugin:"postcss-custom-selectors",AtRule:function(r){r.params.match(Dn)&&(r.params=r.params.replace(Dn,"$1-$2"))}}}},Zc={postcssPlugin:"postcss-hover-classes",prepare:function(){let r=[];return{Rule:function(e){r.indexOf(e)===-1&&(r.push(e),e.selectors.forEach(function(t){t.includes(":hover")&&(e.selector+=`,
2
+ `+t.replace(/:hover/g,".\\:hover"))}))}}}};Ps={exports:{}},H=String,Go=function(){return{isColorSupported:!1,reset:H,bold:H,dim:H,italic:H,underline:H,inverse:H,hidden:H,strikethrough:H,black:H,red:H,green:H,yellow:H,blue:H,magenta:H,cyan:H,white:H,gray:H,bgBlack:H,bgRed:H,bgGreen:H,bgYellow:H,bgBlue:H,bgMagenta:H,bgCyan:H,bgWhite:H}};Ps.exports=Go();Ps.exports.createColors=Go;eu=Ps.exports,tu={},iu=Object.freeze(Object.defineProperty({__proto__:null,default:tu},Symbol.toStringTag,{value:"Module"})),ue=Qc(iu),Pn=eu,$n=ue,kr=class jo extends Error{constructor(e,t,i,s,n,o){super(e),this.name="CssSyntaxError",this.reason=e,n&&(this.file=n),s&&(this.source=s),o&&(this.plugin=o),typeof t!="undefined"&&typeof i!="undefined"&&(typeof t=="number"?(this.line=t,this.column=i):(this.line=t.line,this.column=t.column,this.endLine=i.line,this.endColumn=i.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,jo)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line!="undefined"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=Pn.isColorSupported),$n&&e&&(t=$n(t));let i=t.split(/\r?\n/),s=Math.max(this.line-3,0),n=Math.min(this.line+2,i.length),o=String(n).length,a,l;if(e){let{bold:c,gray:u,red:h}=Pn.createColors(!0);a=d=>c(h(d)),l=d=>u(d)}else a=l=c=>c;return i.slice(s,n).map((c,u)=>{let h=s+1+u,d=" "+(" "+h).slice(-o)+" | ";if(h===this.line){let p=l(d.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(d)+c+`
3
+ `+p+a("^")}return" "+l(d)+c}).join(`
4
+ `)}toString(){let e=this.showSourceCode();return e&&(e=`
5
+
6
+ `+e+`
7
+ `),this.name+": "+this.message+e}},$s=kr;kr.default=kr;Ot={};Ot.isClean=Symbol("isClean");Ot.my=Symbol("my");Ln={after:`
8
+ `,beforeClose:`
9
+ `,beforeComment:`
10
+ `,beforeDecl:`
11
+ `,beforeOpen:" ",beforeRule:`
12
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};Rr=class{constructor(e){this.builder=e}atrule(e,t){let i="@"+e.name,s=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName!="undefined"?i+=e.raws.afterName:s&&(i+=" "),e.nodes)this.block(e,i+s);else{let n=(e.raws.between||"")+(t?";":"");this.builder(i+s+n,e)}}beforeAfter(e,t){let i;e.type==="decl"?i=this.raw(e,null,"beforeDecl"):e.type==="comment"?i=this.raw(e,null,"beforeComment"):t==="before"?i=this.raw(e,null,"beforeRule"):i=this.raw(e,null,"beforeClose");let s=e.parent,n=0;for(;s&&s.type!=="root";)n+=1,s=s.parent;if(i.includes(`
13
+ `)){let o=this.raw(e,null,"indent");if(o.length)for(let a=0;a<n;a++)i+=o}return i}block(e,t){let i=this.raw(e,"between","beforeOpen");this.builder(t+i+"{",e,"start");let s;e.nodes&&e.nodes.length?(this.body(e),s=this.raw(e,"after")):s=this.raw(e,"after","emptyBody"),s&&this.builder(s),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let i=this.raw(e,"semicolon");for(let s=0;s<e.nodes.length;s++){let n=e.nodes[s],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==s||i)}}comment(e){let t=this.raw(e,"left","commentLeft"),i=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+i+"*/",e)}decl(e,t){let i=this.raw(e,"between","colon"),s=e.prop+i+this.rawValue(e,"value");e.important&&(s+=e.raws.important||" !important"),t&&(s+=";"),this.builder(s,e)}document(e){this.body(e)}raw(e,t,i){let s;if(i||(i=t),t&&(s=e.raws[t],typeof s!="undefined"))return s;let n=e.parent;if(i==="before"&&(!n||n.type==="root"&&n.first===e||n&&n.type==="document"))return"";if(!n)return Ln[i];let o=e.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[i]!="undefined")return o.rawCache[i];if(i==="before"||i==="after")return this.beforeAfter(e,i);{let a="raw"+ru(i);this[a]?s=this[a](o,e):o.walk(l=>{if(s=l.raws[t],typeof s!="undefined")return!1})}return typeof s=="undefined"&&(s=Ln[i]),o.rawCache[i]=s,s}rawBeforeClose(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length>0&&typeof i.raws.after!="undefined")return t=i.raws.after,t.includes(`
14
+ `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let i;return e.walkComments(s=>{if(typeof s.raws.before!="undefined")return i=s.raws.before,i.includes(`
15
+ `)&&(i=i.replace(/[^\n]+$/,"")),!1}),typeof i=="undefined"?i=this.raw(t,null,"beforeDecl"):i&&(i=i.replace(/\S/g,"")),i}rawBeforeDecl(e,t){let i;return e.walkDecls(s=>{if(typeof s.raws.before!="undefined")return i=s.raws.before,i.includes(`
16
+ `)&&(i=i.replace(/[^\n]+$/,"")),!1}),typeof i=="undefined"?i=this.raw(t,null,"beforeRule"):i&&(i=i.replace(/\S/g,"")),i}rawBeforeOpen(e){let t;return e.walk(i=>{if(i.type!=="decl"&&(t=i.raws.between,typeof t!="undefined"))return!1}),t}rawBeforeRule(e){let t;return e.walk(i=>{if(i.nodes&&(i.parent!==e||e.first!==i)&&typeof i.raws.before!="undefined")return t=i.raws.before,t.includes(`
17
+ `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(i=>{if(typeof i.raws.between!="undefined")return t=i.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length===0&&(t=i.raws.after,typeof t!="undefined"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(i=>{let s=i.parent;if(s&&s!==e&&s.parent&&s.parent===e&&typeof i.raws.before!="undefined"){let n=i.raws.before.split(`
18
+ `);return t=n[n.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length&&i.last.type==="decl"&&(t=i.raws.semicolon,typeof t!="undefined"))return!1}),t}rawValue(e,t){let i=e[t],s=e.raws[t];return s&&s.value===i?s.raw:i}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)}},Ko=Rr;Rr.default=Rr;su=Ko;zi=Nr;Nr.default=Nr;({isClean:Gt,my:nu}=Ot),ou=$s,au=Ko,lu=zi;Or=class{constructor(e={}){this.raws={},this[Gt]=!1,this[nu]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let i of e[t])typeof i.clone=="function"?this.append(i.clone()):this.append(i)}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=Ar(this);for(let i in e)t[i]=e[i];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:i,start:s}=this.rangeBy(t);return this.source.input.error(e,{column:s.column,line:s.line},{column:i.column,line:i.line},t)}return new ou(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,i){return e[t]===i||(e[t]=i,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markDirty(){if(this[Gt]){this[Gt]=!1;let e=this;for(;e=e.parent;)e[Gt]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let i=this.source.start;if(e.index)i=this.positionInside(e.index,t);else if(e.word){t=this.toString();let s=t.indexOf(e.word);s!==-1&&(i=this.positionInside(s,t))}return i}positionInside(e,t){let i=t||this.toString(),s=this.source.start.column,n=this.source.start.line;for(let o=0;o<e;o++)i[o]===`
19
+ `?(s=1,n+=1):s+=1;return{column:s,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let s=this.toString(),n=s.indexOf(e.word);n!==-1&&(t=this.positionInside(n,s),i=this.positionInside(n+e.word.length,s))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?i={column:e.end.column,line:e.end.line}:typeof e.endIndex=="number"?i=this.positionInside(e.endIndex):e.index&&(i=this.positionInside(e.index+1));return(i.line<t.line||i.line===t.line&&i.column<=t.column)&&(i={column:t.column+1,line:t.line}),{end:i,start:t}}raw(e,t){return new au().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,i=!1;for(let s of e)s===this?i=!0:i?(this.parent.insertAfter(t,s),t=s):this.parent.insertBefore(t,s);i||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let i={},s=t==null;t=t||new Map;let n=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let a=this[o];if(Array.isArray(a))i[o]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,t):l);else if(typeof a=="object"&&a.toJSON)i[o]=a.toJSON(null,t);else if(o==="source"){let l=t.get(a.input);l==null&&(l=n,t.set(a.input,n),n++),i[o]={end:a.end,inputId:l,start:a.start}}else i[o]=a}return s&&(i.inputs=[...t.keys()].map(o=>o.toJSON())),i}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=lu){e.stringify&&(e=e.stringify);let t="";return e(this,i=>{t+=i}),t}warn(e,t,i){let s={node:this};for(let n in i)s[n]=i[n];return e.warn(t,s)}get proxyOf(){return this}},Hi=Or;Or.default=Or;cu=Hi,Dr=class extends cu{constructor(e){e&&typeof e.value!="undefined"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}},Vi=Dr;Dr.default=Dr;uu="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",hu=(r,e=21)=>(t=e)=>{let i="",s=t;for(;s--;)i+=r[Math.random()*r.length|0];return i},du=(r=21)=>{let e="",t=r;for(;t--;)e+=uu[Math.random()*64|0];return e},fu={nanoid:du,customAlphabet:hu},{SourceMapConsumer:_n,SourceMapGenerator:Fn}=ue,{existsSync:pu,readFileSync:mu}=ue,{dirname:pr,join:gu}=ue;Pr=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let i=t.map?t.map.prev:void 0,s=this.loadMap(t.from,i);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=pr(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new _n(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,i=/^data:application\/json;base64,/,s=/^data:application\/json;charset=utf-?8,/,n=/^data:application\/json,/;if(s.test(e)||n.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||i.test(e))return yu(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 i=e.lastIndexOf(t.pop()),s=e.indexOf("*/",i);i>-1&&s>-1&&(this.annotation=this.getAnnotationURL(e.substring(i,s)))}loadFile(e){if(this.root=pr(e),pu(e))return this.mapFile=e,mu(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 i=t(e);if(i){let s=this.loadFile(i);if(!s)throw new Error("Unable to load previous source map: "+i.toString());return s}}else{if(t instanceof _n)return Fn.fromSourceMap(t).toString();if(t instanceof Fn)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 i=this.annotation;return e&&(i=gu(pr(e),i)),this.loadFile(i)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},Yo=Pr;Pr.default=Pr;({SourceMapConsumer:wu,SourceMapGenerator:vu}=ue),{fileURLToPath:Un,pathToFileURL:jt}=ue,{isAbsolute:$r,resolve:Lr}=ue,{nanoid:bu}=fu,mr=ue,Bn=$s,Su=Yo,gr=Symbol("fromOffsetCache"),Cu=!!(wu&&vu),Wn=!!(Lr&&$r),Ci=class{constructor(e,t={}){if(e===null||typeof e=="undefined"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Wn||/^\w+:\/\//.test(t.from)||$r(t.from)?this.file=t.from:this.file=Lr(t.from)),Wn&&Cu){let i=new Su(this.css,t);if(i.text){this.map=i;let s=i.consumer().file;!this.file&&s&&(this.file=this.mapResolve(s))}}this.file||(this.id="<input css "+bu(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,i,s={}){let n,o,a;if(t&&typeof t=="object"){let c=t,u=i;if(typeof c.offset=="number"){let h=this.fromOffset(c.offset);t=h.line,i=h.col}else t=c.line,i=c.column;if(typeof u.offset=="number"){let h=this.fromOffset(u.offset);o=h.line,a=h.col}else o=u.line,a=u.column}else if(!i){let c=this.fromOffset(t);t=c.line,i=c.col}let l=this.origin(t,i,o,a);return l?n=new Bn(e,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,s.plugin):n=new Bn(e,o===void 0?t:{column:i,line:t},o===void 0?i:{column:a,line:o},this.css,this.file,s.plugin),n.input={column:i,endColumn:a,endLine:o,line:t,source:this.css},this.file&&(jt&&(n.input.url=jt(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,i;if(this[gr])i=this[gr];else{let n=this.css.split(`
20
+ `);i=new Array(n.length);let o=0;for(let a=0,l=n.length;a<l;a++)i[a]=o,o+=n[a].length+1;this[gr]=i}t=i[i.length-1];let s=0;if(e>=t)s=i.length-1;else{let n=i.length-2,o;for(;s<n;)if(o=s+(n-s>>1),e<i[o])n=o-1;else if(e>=i[o+1])s=o+1;else{s=o;break}}return{col:e-i[s]+1,line:s+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Lr(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,i,s){if(!this.map)return!1;let n=this.map.consumer(),o=n.originalPositionFor({column:t,line:e});if(!o.source)return!1;let a;typeof i=="number"&&(a=n.originalPositionFor({column:s,line:i}));let l;$r(o.source)?l=jt(o.source):l=new URL(o.source,this.map.consumer().sourceRoot||jt(this.map.mapFile));let c={column:o.column,endColumn:a&&a.column,endLine:a&&a.line,line:o.line,url:l.toString()};if(l.protocol==="file:")if(Un)c.file=Un(l);else throw new Error("file: protocol is not available in this PostCSS build");let u=n.sourceContentFor(o.source);return u&&(c.source=u),c}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}},Gi=Ci;Ci.default=Ci;mr&&mr.registerInput&&mr.registerInput(Ci);({SourceMapConsumer:Xo,SourceMapGenerator:fi}=ue),{dirname:pi,relative:Jo,resolve:Zo,sep:qo}=ue,{pathToFileURL:zn}=ue,Eu=Gi,xu=!!(Xo&&fi),Iu=!!(pi&&Zo&&Jo&&qo),Tu=class{constructor(e,t,i,s){this.stringify=e,this.mapOpts=i.map||{},this.root=t,this.opts=i,this.css=s,this.originalCSS=s,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=`
21
+ `;this.css.includes(`\r
22
+ `)&&(t=`\r
23
+ `),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),i=e.root||pi(e.file),s;this.mapOpts.sourcesContent===!1?(s=new Xo(e.text),s.sourcesContent&&(s.sourcesContent=null)):s=e.consumer(),this.map.applySourceMap(s,t,this.toUrl(this.path(i)))}}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&&xu&&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=fi.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new fi({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 fi({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,i="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""},n,o;this.stringify(this.root,(a,l,c)=>{if(this.css+=a,l&&c!=="end"&&(s.generated.line=e,s.generated.column=t-1,l.source&&l.source.start?(s.source=this.sourcePath(l),s.original.line=l.source.start.line,s.original.column=l.source.start.column-1,this.map.addMapping(s)):(s.source=i,s.original.line=1,s.original.column=0,this.map.addMapping(s))),n=a.match(/\n/g),n?(e+=n.length,o=a.lastIndexOf(`
24
+ `),t=a.length-o):t+=a.length,l&&c!=="start"){let u=l.parent||{raws:{}};(!(l.type==="decl"||l.type==="atrule"&&!l.nodes)||l!==u.last||u.raws.semicolon)&&(l.source&&l.source.end?(s.source=this.sourcePath(l),s.original.line=l.source.end.line,s.original.column=l.source.end.column-1,s.generated.line=e,s.generated.column=t-2,this.map.addMapping(s)):(s.source=i,s.original.line=1,s.original.column=0,s.generated.line=e,s.generated.column=t-1,this.map.addMapping(s)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation!="undefined"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline!="undefined")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e!="undefined"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map!="undefined"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent!="undefined"?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 i=this.opts.to?pi(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(i=pi(Zo(i,this.mapOpts.annotation)));let s=Jo(i,e);return this.memoizedPaths.set(e,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Eu(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 i=t.source.input.from;if(i&&!e[i]){e[i]=!0;let s=this.usesFileUrls?this.toFileUrl(i):this.toUrl(this.path(i));this.map.setSourceContent(s,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(zn){let i=zn(e).toString();return this.memoizedFileURLs.set(e,i),i}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;qo==="\\"&&(e=e.replace(/\\/g,"/"));let i=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,i),i}},Qo=Tu,Mu=Hi,_r=class extends Mu{constructor(e){super(e),this.type="comment"}},ji=_r;_r.default=_r;({isClean:ea,my:ta}=Ot),ia=Vi,ra=ji,ku=Hi;we=class la extends ku{append(...e){for(let t of e){let i=this.normalize(t,this.last);for(let s of i)this.proxyOf.nodes.push(s)}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(),i,s;for(;this.indexes[t]<this.proxyOf.nodes.length&&(i=this.indexes[t],s=e(this.proxyOf.nodes[i],i),s!==!1);)this.indexes[t]+=1;return delete this.indexes[t],s}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")?(...i)=>e[t](...i.map(s=>typeof s=="function"?(n,o)=>s(n.toProxy(),o):s)):t==="every"||t==="some"?i=>e[t]((s,...n)=>i(s.toProxy(),...n)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(i=>i.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,i){return e[t]===i||(e[t]=i,(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 i=this.index(e),s=this.normalize(t,this.proxyOf.nodes[i]).reverse();i=this.index(e);for(let o of s)this.proxyOf.nodes.splice(i+1,0,o);let n;for(let o in this.indexes)n=this.indexes[o],i<n&&(this.indexes[o]=n+s.length);return this.markDirty(),this}insertBefore(e,t){let i=this.index(e),s=i===0?"prepend":!1,n=this.normalize(t,this.proxyOf.nodes[i],s).reverse();i=this.index(e);for(let a of n)this.proxyOf.nodes.splice(i,0,a);let o;for(let a in this.indexes)o=this.indexes[a],i<=o&&(this.indexes[a]=o+n.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=oa(sa(e).nodes);else if(typeof e=="undefined")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let s of e)s.parent&&s.parent.removeChild(s,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let s of e)s.parent&&s.parent.removeChild(s,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value=="undefined")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new ia(e)]}else if(e.selector)e=[new Ls(e)];else if(e.name)e=[new _s(e)];else if(e.text)e=[new ra(e)];else throw new Error("Unknown node type in node creation");return e.map(s=>(s[ta]||la.rebuild(s),s=s.proxyOf,s.parent&&s.parent.removeChild(s),s[ea]&&aa(s),typeof s.raws.before=="undefined"&&t&&typeof t.raws.before!="undefined"&&(s.raws.before=t.raws.before.replace(/\S/g,"")),s.parent=this.proxyOf,s))}prepend(...e){e=e.reverse();for(let t of e){let i=this.normalize(t,this.first,"prepend").reverse();for(let s of i)this.proxyOf.nodes.unshift(s);for(let s in this.indexes)this.indexes[s]=this.indexes[s]+i.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 i in this.indexes)t=this.indexes[i],t>=e&&(this.indexes[i]=t-1);return this.markDirty(),this}replaceValues(e,t,i){return i||(i=t,t={}),this.walkDecls(s=>{t.props&&!t.props.includes(s.prop)||t.fast&&!s.value.includes(t.fast)||(s.value=s.value.replace(e,i))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,i)=>{let s;try{s=e(t,i)}catch(n){throw t.addToError(n)}return s!==!1&&t.walk&&(s=t.walk(e)),s})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((i,s)=>{if(i.type==="atrule"&&e.test(i.name))return t(i,s)}):this.walk((i,s)=>{if(i.type==="atrule"&&i.name===e)return t(i,s)}):(t=e,this.walk((i,s)=>{if(i.type==="atrule")return t(i,s)}))}walkComments(e){return this.walk((t,i)=>{if(t.type==="comment")return e(t,i)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((i,s)=>{if(i.type==="decl"&&e.test(i.prop))return t(i,s)}):this.walk((i,s)=>{if(i.type==="decl"&&i.prop===e)return t(i,s)}):(t=e,this.walk((i,s)=>{if(i.type==="decl")return t(i,s)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((i,s)=>{if(i.type==="rule"&&e.test(i.selector))return t(i,s)}):this.walk((i,s)=>{if(i.type==="rule"&&i.selector===e)return t(i,s)}):(t=e,this.walk((i,s)=>{if(i.type==="rule")return t(i,s)}))}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]}};we.registerParse=r=>{sa=r};we.registerRule=r=>{Ls=r};we.registerAtRule=r=>{_s=r};we.registerRoot=r=>{na=r};Le=we;we.default=we;we.rebuild=r=>{r.type==="atrule"?Object.setPrototypeOf(r,_s.prototype):r.type==="rule"?Object.setPrototypeOf(r,Ls.prototype):r.type==="decl"?Object.setPrototypeOf(r,ia.prototype):r.type==="comment"?Object.setPrototypeOf(r,ra.prototype):r.type==="root"&&Object.setPrototypeOf(r,na.prototype),r[ta]=!0,r.nodes&&r.nodes.forEach(e=>{we.rebuild(e)})};Ru=Le,Ct=class extends Ru{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new ca(new ua,this,e).stringify()}};Ct.registerLazyResult=r=>{ca=r};Ct.registerProcessor=r=>{ua=r};Fs=Ct;Ct.default=Ct;Fr=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let i=t.node.rangeBy(t);this.line=i.start.line,this.column=i.start.column,this.endLine=i.end.line,this.endColumn=i.end.column}for(let i in t)this[i]=t[i]}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}},ha=Fr;Fr.default=Fr;Nu=ha,Ur=class{constructor(e,t,i){this.processor=e,this.messages=[],this.root=t,this.opts=i,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 i=new Nu(e,t);return this.messages.push(i),i}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}},Us=Ur;Ur.default=Ur;yr=39,Hn=34,Kt=92,Vn=47,Yt=10,ut=32,Xt=12,Jt=9,Zt=13,Au=91,Ou=93,Du=40,Pu=41,$u=123,Lu=125,_u=59,Fu=42,Uu=58,Bu=64,qt=/[\t\n\f\r "#'()/;[\\\]{}]/g,Qt=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Wu=/.[\r\n"'(/\\]/,Gn=/[\da-f]/i,zu=function(e,t={}){let i=e.css.valueOf(),s=t.ignoreErrors,n,o,a,l,c,u,h,d,p,g,m=i.length,f=0,y=[],b=[];function w(){return f}function S(U){throw e.error("Unclosed "+U,f)}function I(){return b.length===0&&f>=m}function M(U){if(b.length)return b.pop();if(f>=m)return;let K=U?U.ignoreUnclosed:!1;switch(n=i.charCodeAt(f),n){case Yt:case ut:case Jt:case Zt:case Xt:{o=f;do o+=1,n=i.charCodeAt(o);while(n===ut||n===Yt||n===Jt||n===Zt||n===Xt);g=["space",i.slice(f,o)],f=o-1;break}case Au:case Ou:case $u:case Lu:case Uu:case _u:case Pu:{let q=String.fromCharCode(n);g=[q,q,f];break}case Du:{if(d=y.length?y.pop()[1]:"",p=i.charCodeAt(f+1),d==="url"&&p!==yr&&p!==Hn&&p!==ut&&p!==Yt&&p!==Jt&&p!==Xt&&p!==Zt){o=f;do{if(u=!1,o=i.indexOf(")",o+1),o===-1)if(s||K){o=f;break}else S("bracket");for(h=o;i.charCodeAt(h-1)===Kt;)h-=1,u=!u}while(u);g=["brackets",i.slice(f,o+1),f,o],f=o}else o=i.indexOf(")",f+1),l=i.slice(f,o+1),o===-1||Wu.test(l)?g=["(","(",f]:(g=["brackets",l,f,o],f=o);break}case yr:case Hn:{a=n===yr?"'":'"',o=f;do{if(u=!1,o=i.indexOf(a,o+1),o===-1)if(s||K){o=f+1;break}else S("string");for(h=o;i.charCodeAt(h-1)===Kt;)h-=1,u=!u}while(u);g=["string",i.slice(f,o+1),f,o],f=o;break}case Bu:{qt.lastIndex=f+1,qt.test(i),qt.lastIndex===0?o=i.length-1:o=qt.lastIndex-2,g=["at-word",i.slice(f,o+1),f,o],f=o;break}case Kt:{for(o=f,c=!0;i.charCodeAt(o+1)===Kt;)o+=1,c=!c;if(n=i.charCodeAt(o+1),c&&n!==Vn&&n!==ut&&n!==Yt&&n!==Jt&&n!==Zt&&n!==Xt&&(o+=1,Gn.test(i.charAt(o)))){for(;Gn.test(i.charAt(o+1));)o+=1;i.charCodeAt(o+1)===ut&&(o+=1)}g=["word",i.slice(f,o+1),f,o],f=o;break}default:{n===Vn&&i.charCodeAt(f+1)===Fu?(o=i.indexOf("*/",f+2)+1,o===0&&(s||K?o=i.length:S("comment")),g=["comment",i.slice(f,o+1),f,o],f=o):(Qt.lastIndex=f+1,Qt.test(i),Qt.lastIndex===0?o=i.length-1:o=Qt.lastIndex-2,g=["word",i.slice(f,o+1),f,o],y.push(g),f=o);break}}return f++,g}function z(U){b.push(U)}return{back:z,endOfFile:I,nextToken:M,position:w}},da=Le,Ei=class extends da{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)}},Bs=Ei;Ei.default=Ei;da.registerAtRule(Ei);fa=Le,Ze=class extends fa{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,i){let s=super.normalize(e);if(t){if(i==="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 s)n.raws.before=t.raws.before}return s}removeChild(e,t){let i=this.index(e);return!t&&i===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[i].raws.before),super.removeChild(e)}toResult(e={}){return new pa(new ma,this,e).stringify()}};Ze.registerLazyResult=r=>{pa=r};Ze.registerProcessor=r=>{ma=r};Dt=Ze;Ze.default=Ze;fa.registerRoot(Ze);Et={comma(r){return Et.split(r,[","],!0)},space(r){let e=[" ",`
25
+ `," "];return Et.split(r,e)},split(r,e,t){let i=[],s="",n=!1,o=0,a=!1,l="",c=!1;for(let u of r)c?c=!1:u==="\\"?c=!0:a?u===l&&(a=!1):u==='"'||u==="'"?(a=!0,l=u):u==="("?o+=1:u===")"?o>0&&(o-=1):o===0&&e.includes(u)&&(n=!0),n?(s!==""&&i.push(s.trim()),s="",n=!1):s+=u;return(t||s!=="")&&i.push(s.trim()),i}},ga=Et;Et.default=Et;ya=Le,Hu=ga,xi=class extends ya{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Hu.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,i=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(i)}},Ws=xi;xi.default=xi;ya.registerRule(xi);Vu=Vi,Gu=zu,ju=ji,Ku=Bs,Yu=Dt,jn=Ws,Kn={empty:!0,space:!0};Ju=class{constructor(e){this.input=e,this.root=new Yu,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 Ku;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let i,s,n,o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),i=e[0],i==="("||i==="["?c.push(i==="("?")":"]"):i==="{"&&c.length>0?c.push("}"):i===c[c.length-1]&&c.pop(),c.length===0)if(i===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(i==="{"){a=!0;break}else if(i==="}"){if(l.length>0){for(n=l.length-1,s=l[n];s&&s[0]==="space";)s=l[--n];s&&(t.source.end=this.getPosition(s[3]||s[2]),t.source.end.offset++)}this.end(e);break}else l.push(e);else l.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(t.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(t,"params",l),o&&(e=l[l.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),a&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let i=0,s;for(let n=t-1;n>=0&&(s=e[n],!(s[0]!=="space"&&(i+=1,i===2)));n--);throw this.input.error("Missed semicolon",s[0]==="word"?s[3]+1:s[2])}colon(e){let t=0,i,s,n;for(let[o,a]of e.entries()){if(i=a,s=i[0],s==="("&&(t+=1),s===")"&&(t-=1),t===0&&s===":")if(!n)this.doubleColon(i);else{if(n[0]==="word"&&n[1]==="progid")continue;return o}n=i}return!1}comment(e){let t=new ju;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let i=e[1].slice(2,-2);if(/^\s*$/.test(i))t.text="",t.raws.left=i,t.raws.right="";else{let s=i.match(/^(\s*)([^]*\S)(\s*)$/);t.text=s[2],t.raws.left=s[1],t.raws.right=s[3]}}createTokenizer(){this.tokenizer=Gu(this.input)}decl(e,t){let i=new Vu;this.init(i,e[0][2]);let s=e[e.length-1];for(s[0]===";"&&(this.semicolon=!0,e.pop()),i.source.end=this.getPosition(s[3]||s[2]||Xu(e)),i.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),i.raws.before+=e.shift()[1];for(i.source.start=this.getPosition(e[0][2]),i.prop="";e.length;){let c=e[0][0];if(c===":"||c==="space"||c==="comment")break;i.prop+=e.shift()[1]}i.raws.between="";let n;for(;e.length;)if(n=e.shift(),n[0]===":"){i.raws.between+=n[1];break}else n[0]==="word"&&/\w/.test(n[1])&&this.unknownWord([n]),i.raws.between+=n[1];(i.prop[0]==="_"||i.prop[0]==="*")&&(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1));let o=[],a;for(;e.length&&(a=e[0][0],!(a!=="space"&&a!=="comment"));)o.push(e.shift());this.precheckMissedSemicolon(e);for(let c=e.length-1;c>=0;c--){if(n=e[c],n[1].toLowerCase()==="!important"){i.important=!0;let u=this.stringFrom(e,c);u=this.spacesFromEnd(e)+u,u!==" !important"&&(i.raws.important=u);break}else if(n[1].toLowerCase()==="important"){let u=e.slice(0),h="";for(let d=c;d>0;d--){let p=u[d][0];if(h.trim().indexOf("!")===0&&p!=="space")break;h=u.pop()[1]+h}h.trim().indexOf("!")===0&&(i.important=!0,i.raws.important=h,e=u)}if(n[0]!=="space"&&n[0]!=="comment")break}e.some(c=>c[0]!=="space"&&c[0]!=="comment")&&(i.raws.between+=o.map(c=>c[1]).join(""),o=[]),this.raw(i,"value",o.concat(e),t),i.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 jn;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,i=null,s=!1,n=null,o=[],a=e[1].startsWith("--"),l=[],c=e;for(;c;){if(i=c[0],l.push(c),i==="("||i==="[")n||(n=c),o.push(i==="("?")":"]");else if(a&&s&&i==="{")n||(n=c),o.push("}");else if(o.length===0)if(i===";")if(s){this.decl(l,a);return}else break;else if(i==="{"){this.rule(l);return}else if(i==="}"){this.tokenizer.back(l.pop()),t=!0;break}else i===":"&&(s=!0);else i===o[o.length-1]&&(o.pop(),o.length===0&&(n=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&s){if(!a)for(;l.length&&(c=l[l.length-1][0],!(c!=="space"&&c!=="comment"));)this.tokenizer.back(l.pop());this.decl(l,a)}else this.unknownWord(l)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,i,s){let n,o,a=i.length,l="",c=!0,u,h;for(let d=0;d<a;d+=1)n=i[d],o=n[0],o==="space"&&d===a-1&&!s?c=!1:o==="comment"?(h=i[d-1]?i[d-1][0]:"empty",u=i[d+1]?i[d+1][0]:"empty",!Kn[h]&&!Kn[u]?l.slice(-1)===","?c=!1:l+=n[1]:c=!1):l+=n[1];if(!c){let d=i.reduce((p,g)=>p+g[1],"");e.raws[t]={raw:d,value:l}}e[t]=l}rule(e){e.pop();let t=new jn;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,i="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)i=e.pop()[1]+i;return i}spacesAndCommentsFromStart(e){let t,i="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)i+=e.shift()[1];return i}spacesFromEnd(e){let t,i="";for(;e.length&&(t=e[e.length-1][0],t==="space");)i=e.pop()[1]+i;return i}stringFrom(e,t){let i="";for(let s=t;s<e.length;s++)i+=e[s][1];return e.splice(t,e.length-t),i}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})}},Zu=Ju,qu=Le,Qu=Zu,eh=Gi;zs=Ii;Ii.default=Ii;qu.registerParse(Ii);({isClean:fe,my:th}=Ot),ih=Qo,rh=zi,sh=Le,nh=Fs,Yn=Us,oh=zs,ah=Dt,lh={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ch={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},uh={Once:!0,postcssPlugin:!0,prepare:!0},qe=0;Wr={},Qe=class va{constructor(e,t,i){this.stringified=!1,this.processed=!1;let s;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))s=Br(t);else if(t instanceof va||t instanceof Yn)s=Br(t.root),t.map&&(typeof i.map=="undefined"&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=t.map);else{let n=oh;i.syntax&&(n=i.syntax.parse),i.parser&&(n=i.parser),n.parse&&(n=n.parse);try{s=n(t,i)}catch(o){this.processed=!0,this.error=o}s&&!s[th]&&sh.rebuild(s)}this.result=new Yn(e,s,i),this.helpers={...Wr,postcss:Wr,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 i=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=i.postcssPlugin,e.setMessage()):i.postcssVersion}catch(s){console&&console.error&&console.error(s)}return e}prepareVisitors(){this.listeners={};let e=(t,i,s)=>{this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push([t,s])};for(let t of this.plugins)if(typeof t=="object")for(let i in t){if(!ch[i]&&/^[A-Z]/.test(i))throw new Error(`Unknown event ${i} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!uh[i])if(typeof t[i]=="object")for(let s in t[i])s==="*"?e(t,i,t[i][s]):e(t,i+"-"+s.toLowerCase(),t[i][s]);else typeof t[i]=="function"&&e(t,i,t[i])}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],i=this.runOnRoot(t);if(ht(i))try{await i}catch(s){throw this.handleError(s)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[fe];){e[fe]=!0;let t=[Xn(e)];for(;t.length>0;){let i=this.visitTick(t);if(ht(i))try{await i}catch(s){let n=t[t.length-1].node;throw this.handleError(s,n)}}}if(this.listeners.OnceExit)for(let[t,i]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let s=e.nodes.map(n=>i(n,this.helpers));await Promise.all(s)}else await i(e,this.helpers)}catch(s){throw this.handleError(s)}}}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(i=>e.Once(i,this.helpers));return ht(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=rh;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new ih(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[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(ht(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[fe];)e[fe]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[i,s]of e){this.result.lastPlugin=i;let n;try{n=s(t,this.helpers)}catch(o){throw this.handleError(o,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(ht(n))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:i,visitors:s}=t;if(i.type!=="root"&&i.type!=="document"&&!i.parent){e.pop();return}if(s.length>0&&t.visitorIndex<s.length){let[o,a]=s[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===s.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return a(i.toProxy(),this.helpers)}catch(l){throw this.handleError(l,i)}}if(t.iterator!==0){let o=t.iterator,a;for(;a=i.nodes[i.indexes[o]];)if(i.indexes[o]+=1,!a[fe]){a[fe]=!0,e.push(Xn(a));return}t.iterator=0,delete i.indexes[o]}let n=t.events;for(;t.eventIndex<n.length;){let o=n[t.eventIndex];if(t.eventIndex+=1,o===qe){i.nodes&&i.nodes.length&&(i[fe]=!0,t.iterator=i.getIterator());return}else if(this.listeners[o]){t.visitors=this.listeners[o];return}}e.pop()}walkSync(e){e[fe]=!0;let t=wa(e);for(let i of t)if(i===qe)e.nodes&&e.each(s=>{s[fe]||this.walkSync(s)});else{let s=this.listeners[i];if(s&&this.visitSync(s,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"}};Qe.registerPostcss=r=>{Wr=r};ba=Qe;Qe.default=Qe;ah.registerLazyResult(Qe);nh.registerLazyResult(Qe);hh=Qo,dh=zi,fh=zs,ph=Us,zr=class{constructor(e,t,i){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=i,this._map=void 0;let s,n=dh;this.result=new ph(this._processor,s,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let a=new hh(n,s,this._opts,t);if(a.isMap()){let[l,c]=a.generate();l&&(this.result.css=l),c&&(this.result.map=c)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=fh;try{e=t(this._css,this._opts)}catch(i){this.error=i}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}},mh=zr;zr.default=zr;gh=mh,yh=ba,wh=Fs,vh=Dt,xt=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let i of e)if(i.postcss===!0?i=i():i.postcss&&(i=i.postcss),typeof i=="object"&&Array.isArray(i.plugins))t=t.concat(i.plugins);else if(typeof i=="object"&&i.postcssPlugin)t.push(i);else if(typeof i=="function")t.push(i);else if(!(typeof i=="object"&&(i.parse||i.stringify)))throw new Error(i+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new gh(this,e,t):new yh(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}},bh=xt;xt.default=xt;vh.registerProcessor(xt);wh.registerProcessor(xt);Sh=Vi,Ch=Yo,Eh=ji,xh=Bs,Ih=Gi,Th=Dt,Mh=Ws;kh=It;It.default=It;Rh=$s,Sa=Vi,Nh=ba,Ah=Le,Hs=bh,Oh=zi,Dh=kh,Ca=Fs,Ph=ha,Ea=ji,xa=Bs,$h=Us,Lh=Gi,_h=zs,Fh=ga,Ia=Ws,Ta=Dt,Uh=Hi;L.plugin=function(e,t){let i=!1;function s(...o){console&&console.warn&&!i&&(i=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
26
+ https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
27
+ https://www.w3ctech.com/topic/2226`));let a=t(...o);return a.postcssPlugin=e,a.postcssVersion=new Hs().version,a}let n;return Object.defineProperty(s,"postcss",{get(){return n||(n=s()),n}}),s.process=function(o,a,l){return L([s(l)]).process(o,a)},s};L.stringify=Oh;L.parse=_h;L.fromJSON=Dh;L.list=Fh;L.comment=r=>new Ea(r);L.atRule=r=>new xa(r);L.decl=r=>new Sa(r);L.rule=r=>new Ia(r);L.root=r=>new Ta(r);L.document=r=>new Ca(r);L.CssSyntaxError=Rh;L.Declaration=Sa;L.Container=Ah;L.Processor=Hs;L.Document=Ca;L.Comment=Ea;L.Warning=Ph;L.AtRule=xa;L.Result=$h;L.Input=Lh;L.Rule=Ia;L.Root=Ta;L.Node=Uh;Nh.registerPostcss(L);Bh=L;L.default=L;G=qc(Bh);G.stringify;G.fromJSON;G.plugin;G.parse;G.list;G.document;G.comment;G.atRule;G.rule;G.decl;G.root;G.CssSyntaxError;G.Declaration;G.Container;G.Processor;G.Document;G.Comment;G.Warning;G.AtRule;G.Result;G.Input;G.Rule;G.Root;G.Node;Jn={script:"noscript",altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"};Yh=Object.defineProperty,Xh=(r,e,t)=>e in r?Yh(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,C=(r,e,t)=>Xh(r,typeof e!="symbol"?e+"":e,t),Jh=Object.defineProperty,Zh=(r,e,t)=>e in r?Jh(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,qn=(r,e,t)=>Zh(r,typeof e!="symbol"?e+"":e,t),qh=class{constructor(){qn(this,"idNodeMap",new Map),qn(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;let i=(t=this.getMeta(e))==null?void 0:t.id;return i!=null?i:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(i=>this.removeNodeFromMap(i))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let i=t.id;this.idNodeMap.set(i,e),this.nodeMetaMap.set(e,t)}replace(e,t){let i=this.getNode(e);if(i){let s=this.nodeMetaMap.get(i);s&&this.nodeMetaMap.set(t,s)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};Vs={exports:{}},V=String,Ma=function(){return{isColorSupported:!1,reset:V,bold:V,dim:V,italic:V,underline:V,inverse:V,hidden:V,strikethrough:V,black:V,red:V,green:V,yellow:V,blue:V,magenta:V,cyan:V,white:V,gray:V,bgBlack:V,bgRed:V,bgGreen:V,bgYellow:V,bgBlue:V,bgMagenta:V,bgCyan:V,bgWhite:V}};Vs.exports=Ma();Vs.exports.createColors=Ma;id=Vs.exports,rd={},sd=Object.freeze(Object.defineProperty({__proto__:null,default:rd},Symbol.toStringTag,{value:"Module"})),he=td(sd),Qn=id,eo=he,Hr=class ka extends Error{constructor(e,t,i,s,n,o){super(e),this.name="CssSyntaxError",this.reason=e,n&&(this.file=n),s&&(this.source=s),o&&(this.plugin=o),typeof t!="undefined"&&typeof i!="undefined"&&(typeof t=="number"?(this.line=t,this.column=i):(this.line=t.line,this.column=t.column,this.endLine=i.line,this.endColumn=i.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,ka)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line!="undefined"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=Qn.isColorSupported),eo&&e&&(t=eo(t));let i=t.split(/\r?\n/),s=Math.max(this.line-3,0),n=Math.min(this.line+2,i.length),o=String(n).length,a,l;if(e){let{bold:c,gray:u,red:h}=Qn.createColors(!0);a=d=>c(h(d)),l=d=>u(d)}else a=l=c=>c;return i.slice(s,n).map((c,u)=>{let h=s+1+u,d=" "+(" "+h).slice(-o)+" | ";if(h===this.line){let p=l(d.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return a(">")+l(d)+c+`
28
+ `+p+a("^")}return" "+l(d)+c}).join(`
29
+ `)}toString(){let e=this.showSourceCode();return e&&(e=`
30
+
31
+ `+e+`
32
+ `),this.name+": "+this.message+e}},Gs=Hr;Hr.default=Hr;Pt={};Pt.isClean=Symbol("isClean");Pt.my=Symbol("my");to={after:`
33
+ `,beforeClose:`
34
+ `,beforeComment:`
35
+ `,beforeDecl:`
36
+ `,beforeOpen:" ",beforeRule:`
37
+ `,colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};Vr=class{constructor(e){this.builder=e}atrule(e,t){let i="@"+e.name,s=e.params?this.rawValue(e,"params"):"";if(typeof e.raws.afterName!="undefined"?i+=e.raws.afterName:s&&(i+=" "),e.nodes)this.block(e,i+s);else{let n=(e.raws.between||"")+(t?";":"");this.builder(i+s+n,e)}}beforeAfter(e,t){let i;e.type==="decl"?i=this.raw(e,null,"beforeDecl"):e.type==="comment"?i=this.raw(e,null,"beforeComment"):t==="before"?i=this.raw(e,null,"beforeRule"):i=this.raw(e,null,"beforeClose");let s=e.parent,n=0;for(;s&&s.type!=="root";)n+=1,s=s.parent;if(i.includes(`
38
+ `)){let o=this.raw(e,null,"indent");if(o.length)for(let a=0;a<n;a++)i+=o}return i}block(e,t){let i=this.raw(e,"between","beforeOpen");this.builder(t+i+"{",e,"start");let s;e.nodes&&e.nodes.length?(this.body(e),s=this.raw(e,"after")):s=this.raw(e,"after","emptyBody"),s&&this.builder(s),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&e.nodes[t].type==="comment";)t-=1;let i=this.raw(e,"semicolon");for(let s=0;s<e.nodes.length;s++){let n=e.nodes[s],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==s||i)}}comment(e){let t=this.raw(e,"left","commentLeft"),i=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+i+"*/",e)}decl(e,t){let i=this.raw(e,"between","colon"),s=e.prop+i+this.rawValue(e,"value");e.important&&(s+=e.raws.important||" !important"),t&&(s+=";"),this.builder(s,e)}document(e){this.body(e)}raw(e,t,i){let s;if(i||(i=t),t&&(s=e.raws[t],typeof s!="undefined"))return s;let n=e.parent;if(i==="before"&&(!n||n.type==="root"&&n.first===e||n&&n.type==="document"))return"";if(!n)return to[i];let o=e.root();if(o.rawCache||(o.rawCache={}),typeof o.rawCache[i]!="undefined")return o.rawCache[i];if(i==="before"||i==="after")return this.beforeAfter(e,i);{let a="raw"+nd(i);this[a]?s=this[a](o,e):o.walk(l=>{if(s=l.raws[t],typeof s!="undefined")return!1})}return typeof s=="undefined"&&(s=to[i]),o.rawCache[i]=s,s}rawBeforeClose(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length>0&&typeof i.raws.after!="undefined")return t=i.raws.after,t.includes(`
39
+ `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let i;return e.walkComments(s=>{if(typeof s.raws.before!="undefined")return i=s.raws.before,i.includes(`
40
+ `)&&(i=i.replace(/[^\n]+$/,"")),!1}),typeof i=="undefined"?i=this.raw(t,null,"beforeDecl"):i&&(i=i.replace(/\S/g,"")),i}rawBeforeDecl(e,t){let i;return e.walkDecls(s=>{if(typeof s.raws.before!="undefined")return i=s.raws.before,i.includes(`
41
+ `)&&(i=i.replace(/[^\n]+$/,"")),!1}),typeof i=="undefined"?i=this.raw(t,null,"beforeRule"):i&&(i=i.replace(/\S/g,"")),i}rawBeforeOpen(e){let t;return e.walk(i=>{if(i.type!=="decl"&&(t=i.raws.between,typeof t!="undefined"))return!1}),t}rawBeforeRule(e){let t;return e.walk(i=>{if(i.nodes&&(i.parent!==e||e.first!==i)&&typeof i.raws.before!="undefined")return t=i.raws.before,t.includes(`
42
+ `)&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(i=>{if(typeof i.raws.between!="undefined")return t=i.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length===0&&(t=i.raws.after,typeof t!="undefined"))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(i=>{let s=i.parent;if(s&&s!==e&&s.parent&&s.parent===e&&typeof i.raws.before!="undefined"){let n=i.raws.before.split(`
43
+ `);return t=n[n.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(i=>{if(i.nodes&&i.nodes.length&&i.last.type==="decl"&&(t=i.raws.semicolon,typeof t!="undefined"))return!1}),t}rawValue(e,t){let i=e[t],s=e.raws[t];return s&&s.value===i?s.raw:i}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)}},Ra=Vr;Vr.default=Vr;od=Ra;Yi=Gr;Gr.default=Gr;({isClean:ei,my:ad}=Pt),ld=Gs,cd=Ra,ud=Yi;Kr=class{constructor(e={}){this.raws={},this[ei]=!1,this[ad]=!0;for(let t in e)if(t==="nodes"){this.nodes=[];for(let i of e[t])typeof i.clone=="function"?this.append(i.clone()):this.append(i)}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=jr(this);for(let i in e)t[i]=e[i];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:i,start:s}=this.rangeBy(t);return this.source.input.error(e,{column:s.column,line:s.line},{column:i.column,line:i.line},t)}return new ld(e)}getProxyProcessor(){return{get(e,t){return t==="proxyOf"?e:t==="root"?()=>e.root().toProxy():e[t]},set(e,t,i){return e[t]===i||(e[t]=i,(t==="prop"||t==="value"||t==="name"||t==="params"||t==="important"||t==="text")&&e.markDirty()),!0}}}markDirty(){if(this[ei]){this[ei]=!1;let e=this;for(;e=e.parent;)e[ei]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let i=this.source.start;if(e.index)i=this.positionInside(e.index,t);else if(e.word){t=this.toString();let s=t.indexOf(e.word);s!==-1&&(i=this.positionInside(s,t))}return i}positionInside(e,t){let i=t||this.toString(),s=this.source.start.column,n=this.source.start.line;for(let o=0;o<e;o++)i[o]===`
44
+ `?(s=1,n+=1):s+=1;return{column:s,line:n}}prev(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e-1]}rangeBy(e){let t={column:this.source.start.column,line:this.source.start.line},i=this.source.end?{column:this.source.end.column+1,line:this.source.end.line}:{column:t.column+1,line:t.line};if(e.word){let s=this.toString(),n=s.indexOf(e.word);n!==-1&&(t=this.positionInside(n,s),i=this.positionInside(n+e.word.length,s))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?i={column:e.end.column,line:e.end.line}:typeof e.endIndex=="number"?i=this.positionInside(e.endIndex):e.index&&(i=this.positionInside(e.index+1));return(i.line<t.line||i.line===t.line&&i.column<=t.column)&&(i={column:t.column+1,line:t.line}),{end:i,start:t}}raw(e,t){return new cd().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,i=!1;for(let s of e)s===this?i=!0:i?(this.parent.insertAfter(t,s),t=s):this.parent.insertBefore(t,s);i||this.remove()}return this}root(){let e=this;for(;e.parent&&e.parent.type!=="document";)e=e.parent;return e}toJSON(e,t){let i={},s=t==null;t=t||new Map;let n=0;for(let o in this){if(!Object.prototype.hasOwnProperty.call(this,o)||o==="parent"||o==="proxyCache")continue;let a=this[o];if(Array.isArray(a))i[o]=a.map(l=>typeof l=="object"&&l.toJSON?l.toJSON(null,t):l);else if(typeof a=="object"&&a.toJSON)i[o]=a.toJSON(null,t);else if(o==="source"){let l=t.get(a.input);l==null&&(l=n,t.set(a.input,n),n++),i[o]={end:a.end,inputId:l,start:a.start}}else i[o]=a}return s&&(i.inputs=[...t.keys()].map(o=>o.toJSON())),i}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=ud){e.stringify&&(e=e.stringify);let t="";return e(this,i=>{t+=i}),t}warn(e,t,i){let s={node:this};for(let n in i)s[n]=i[n];return e.warn(t,s)}get proxyOf(){return this}},Xi=Kr;Kr.default=Kr;hd=Xi,Yr=class extends hd{constructor(e){e&&typeof e.value!="undefined"&&typeof e.value!="string"&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||this.prop[0]==="$"}},Ji=Yr;Yr.default=Yr;dd="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",fd=(r,e=21)=>(t=e)=>{let i="",s=t;for(;s--;)i+=r[Math.random()*r.length|0];return i},pd=(r=21)=>{let e="",t=r;for(;t--;)e+=dd[Math.random()*64|0];return e},md={nanoid:pd,customAlphabet:fd},{SourceMapConsumer:io,SourceMapGenerator:ro}=he,{existsSync:gd,readFileSync:yd}=he,{dirname:wr,join:wd}=he;Xr=class{constructor(e,t){if(t.map===!1)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let i=t.map?t.map.prev:void 0,s=this.loadMap(t.from,i);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=wr(this.mapFile)),s&&(this.text=s)}consumer(){return this.consumerCache||(this.consumerCache=new io(this.text)),this.consumerCache}decodeInline(e){let t=/^data:application\/json;charset=utf-?8;base64,/,i=/^data:application\/json;base64,/,s=/^data:application\/json;charset=utf-?8,/,n=/^data:application\/json,/;if(s.test(e)||n.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(t.test(e)||i.test(e))return vd(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 i=e.lastIndexOf(t.pop()),s=e.indexOf("*/",i);i>-1&&s>-1&&(this.annotation=this.getAnnotationURL(e.substring(i,s)))}loadFile(e){if(this.root=wr(e),gd(e))return this.mapFile=e,yd(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 i=t(e);if(i){let s=this.loadFile(i);if(!s)throw new Error("Unable to load previous source map: "+i.toString());return s}}else{if(t instanceof io)return ro.fromSourceMap(t).toString();if(t instanceof ro)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 i=this.annotation;return e&&(i=wd(wr(e),i)),this.loadFile(i)}}}startWith(e,t){return e?e.substr(0,t.length)===t:!1}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}},Na=Xr;Xr.default=Xr;({SourceMapConsumer:bd,SourceMapGenerator:Sd}=he),{fileURLToPath:so,pathToFileURL:ti}=he,{isAbsolute:Jr,resolve:Zr}=he,{nanoid:Cd}=md,vr=he,no=Gs,Ed=Na,br=Symbol("fromOffsetCache"),xd=!!(bd&&Sd),oo=!!(Zr&&Jr),Ti=class{constructor(e,t={}){if(e===null||typeof e=="undefined"||typeof e=="object"&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),this.css[0]==="\uFEFF"||this.css[0]==="\uFFFE"?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!oo||/^\w+:\/\//.test(t.from)||Jr(t.from)?this.file=t.from:this.file=Zr(t.from)),oo&&xd){let i=new Ed(this.css,t);if(i.text){this.map=i;let s=i.consumer().file;!this.file&&s&&(this.file=this.mapResolve(s))}}this.file||(this.id="<input css "+Cd(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,i,s={}){let n,o,a;if(t&&typeof t=="object"){let c=t,u=i;if(typeof c.offset=="number"){let h=this.fromOffset(c.offset);t=h.line,i=h.col}else t=c.line,i=c.column;if(typeof u.offset=="number"){let h=this.fromOffset(u.offset);o=h.line,a=h.col}else o=u.line,a=u.column}else if(!i){let c=this.fromOffset(t);t=c.line,i=c.col}let l=this.origin(t,i,o,a);return l?n=new no(e,l.endLine===void 0?l.line:{column:l.column,line:l.line},l.endLine===void 0?l.column:{column:l.endColumn,line:l.endLine},l.source,l.file,s.plugin):n=new no(e,o===void 0?t:{column:i,line:t},o===void 0?i:{column:a,line:o},this.css,this.file,s.plugin),n.input={column:i,endColumn:a,endLine:o,line:t,source:this.css},this.file&&(ti&&(n.input.url=ti(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,i;if(this[br])i=this[br];else{let n=this.css.split(`
45
+ `);i=new Array(n.length);let o=0;for(let a=0,l=n.length;a<l;a++)i[a]=o,o+=n[a].length+1;this[br]=i}t=i[i.length-1];let s=0;if(e>=t)s=i.length-1;else{let n=i.length-2,o;for(;s<n;)if(o=s+(n-s>>1),e<i[o])n=o-1;else if(e>=i[o+1])s=o+1;else{s=o;break}}return{col:e-i[s]+1,line:s+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Zr(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,i,s){if(!this.map)return!1;let n=this.map.consumer(),o=n.originalPositionFor({column:t,line:e});if(!o.source)return!1;let a;typeof i=="number"&&(a=n.originalPositionFor({column:s,line:i}));let l;Jr(o.source)?l=ti(o.source):l=new URL(o.source,this.map.consumer().sourceRoot||ti(this.map.mapFile));let c={column:o.column,endColumn:a&&a.column,endLine:a&&a.line,line:o.line,url:l.toString()};if(l.protocol==="file:")if(so)c.file=so(l);else throw new Error("file: protocol is not available in this PostCSS build");let u=n.sourceContentFor(o.source);return u&&(c.source=u),c}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}},Zi=Ti;Ti.default=Ti;vr&&vr.registerInput&&vr.registerInput(Ti);({SourceMapConsumer:Aa,SourceMapGenerator:mi}=he),{dirname:gi,relative:Oa,resolve:Da,sep:Pa}=he,{pathToFileURL:ao}=he,Id=Zi,Td=!!(Aa&&mi),Md=!!(gi&&Da&&Oa&&Pa),kd=class{constructor(e,t,i,s){this.stringify=e,this.mapOpts=i.map||{},this.root=t,this.opts=i,this.css=s,this.originalCSS=s,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;this.isInline()?e="data:application/json;base64,"+this.toBase64(this.map.toString()):typeof this.mapOpts.annotation=="string"?e=this.mapOpts.annotation:typeof this.mapOpts.annotation=="function"?e=this.mapOpts.annotation(this.opts.to,this.root):e=this.outputFile()+".map";let t=`
46
+ `;this.css.includes(`\r
47
+ `)&&(t=`\r
48
+ `),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t=this.toUrl(this.path(e.file)),i=e.root||gi(e.file),s;this.mapOpts.sourcesContent===!1?(s=new Aa(e.text),s.sourcesContent&&(s.sourcesContent=null)):s=e.consumer(),this.map.applySourceMap(s,t,this.toUrl(this.path(i)))}}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(),Md&&Td&&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=mi.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new mi({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 mi({file:this.outputFile(),ignoreInvalidMapping:!0});let e=1,t=1,i="<no source>",s={generated:{column:0,line:0},original:{column:0,line:0},source:""},n,o;this.stringify(this.root,(a,l,c)=>{if(this.css+=a,l&&c!=="end"&&(s.generated.line=e,s.generated.column=t-1,l.source&&l.source.start?(s.source=this.sourcePath(l),s.original.line=l.source.start.line,s.original.column=l.source.start.column-1,this.map.addMapping(s)):(s.source=i,s.original.line=1,s.original.column=0,this.map.addMapping(s))),n=a.match(/\n/g),n?(e+=n.length,o=a.lastIndexOf(`
49
+ `),t=a.length-o):t+=a.length,l&&c!=="start"){let u=l.parent||{raws:{}};(!(l.type==="decl"||l.type==="atrule"&&!l.nodes)||l!==u.last||u.raws.semicolon)&&(l.source&&l.source.end?(s.source=this.sourcePath(l),s.original.line=l.source.end.line,s.original.column=l.source.end.column-1,s.generated.line=e,s.generated.column=t-2,this.map.addMapping(s)):(s.source=i,s.original.line=1,s.original.column=0,s.generated.line=e,s.generated.column=t-1,this.map.addMapping(s)))}})}isAnnotation(){return this.isInline()?!0:typeof this.mapOpts.annotation!="undefined"?this.mapOpts.annotation:this.previous().length?this.previous().some(e=>e.annotation):!0}isInline(){if(typeof this.mapOpts.inline!="undefined")return this.mapOpts.inline;let e=this.mapOpts.annotation;return typeof e!="undefined"&&e!==!0?!1:this.previous().length?this.previous().some(t=>t.inline):!0}isMap(){return typeof this.opts.map!="undefined"?!!this.opts.map:this.previous().length>0}isSourcesContent(){return typeof this.mapOpts.sourcesContent!="undefined"?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 i=this.opts.to?gi(this.opts.to):".";typeof this.mapOpts.annotation=="string"&&(i=gi(Da(i,this.mapOpts.annotation)));let s=Oa(i,e);return this.memoizedPaths.set(e,s),s}previous(){if(!this.previousMaps)if(this.previousMaps=[],this.root)this.root.walk(e=>{if(e.source&&e.source.input.map){let t=e.source.input.map;this.previousMaps.includes(t)||this.previousMaps.push(t)}});else{let e=new Id(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 i=t.source.input.from;if(i&&!e[i]){e[i]=!0;let s=this.usesFileUrls?this.toFileUrl(i):this.toUrl(this.path(i));this.map.setSourceContent(s,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(ao){let i=ao(e).toString();return this.memoizedFileURLs.set(e,i),i}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;Pa==="\\"&&(e=e.replace(/\\/g,"/"));let i=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,i),i}},$a=kd,Rd=Xi,qr=class extends Rd{constructor(e){super(e),this.type="comment"}},qi=qr;qr.default=qr;({isClean:La,my:_a}=Pt),Fa=Ji,Ua=qi,Nd=Xi;ve=class Va extends Nd{append(...e){for(let t of e){let i=this.normalize(t,this.last);for(let s of i)this.proxyOf.nodes.push(s)}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(),i,s;for(;this.indexes[t]<this.proxyOf.nodes.length&&(i=this.indexes[t],s=e(this.proxyOf.nodes[i],i),s!==!1);)this.indexes[t]+=1;return delete this.indexes[t],s}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")?(...i)=>e[t](...i.map(s=>typeof s=="function"?(n,o)=>s(n.toProxy(),o):s)):t==="every"||t==="some"?i=>e[t]((s,...n)=>i(s.toProxy(),...n)):t==="root"?()=>e.root().toProxy():t==="nodes"?e.nodes.map(i=>i.toProxy()):t==="first"||t==="last"?e[t].toProxy():e[t]:e[t]},set(e,t,i){return e[t]===i||(e[t]=i,(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 i=this.index(e),s=this.normalize(t,this.proxyOf.nodes[i]).reverse();i=this.index(e);for(let o of s)this.proxyOf.nodes.splice(i+1,0,o);let n;for(let o in this.indexes)n=this.indexes[o],i<n&&(this.indexes[o]=n+s.length);return this.markDirty(),this}insertBefore(e,t){let i=this.index(e),s=i===0?"prepend":!1,n=this.normalize(t,this.proxyOf.nodes[i],s).reverse();i=this.index(e);for(let a of n)this.proxyOf.nodes.splice(i,0,a);let o;for(let a in this.indexes)o=this.indexes[a],i<=o&&(this.indexes[a]=o+n.length);return this.markDirty(),this}normalize(e,t){if(typeof e=="string")e=za(Ba(e).nodes);else if(typeof e=="undefined")e=[];else if(Array.isArray(e)){e=e.slice(0);for(let s of e)s.parent&&s.parent.removeChild(s,"ignore")}else if(e.type==="root"&&this.type!=="document"){e=e.nodes.slice(0);for(let s of e)s.parent&&s.parent.removeChild(s,"ignore")}else if(e.type)e=[e];else if(e.prop){if(typeof e.value=="undefined")throw new Error("Value field is missed in node creation");typeof e.value!="string"&&(e.value=String(e.value)),e=[new Fa(e)]}else if(e.selector)e=[new js(e)];else if(e.name)e=[new Ks(e)];else if(e.text)e=[new Ua(e)];else throw new Error("Unknown node type in node creation");return e.map(s=>(s[_a]||Va.rebuild(s),s=s.proxyOf,s.parent&&s.parent.removeChild(s),s[La]&&Ha(s),typeof s.raws.before=="undefined"&&t&&typeof t.raws.before!="undefined"&&(s.raws.before=t.raws.before.replace(/\S/g,"")),s.parent=this.proxyOf,s))}prepend(...e){e=e.reverse();for(let t of e){let i=this.normalize(t,this.first,"prepend").reverse();for(let s of i)this.proxyOf.nodes.unshift(s);for(let s in this.indexes)this.indexes[s]=this.indexes[s]+i.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 i in this.indexes)t=this.indexes[i],t>=e&&(this.indexes[i]=t-1);return this.markDirty(),this}replaceValues(e,t,i){return i||(i=t,t={}),this.walkDecls(s=>{t.props&&!t.props.includes(s.prop)||t.fast&&!s.value.includes(t.fast)||(s.value=s.value.replace(e,i))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,i)=>{let s;try{s=e(t,i)}catch(n){throw t.addToError(n)}return s!==!1&&t.walk&&(s=t.walk(e)),s})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((i,s)=>{if(i.type==="atrule"&&e.test(i.name))return t(i,s)}):this.walk((i,s)=>{if(i.type==="atrule"&&i.name===e)return t(i,s)}):(t=e,this.walk((i,s)=>{if(i.type==="atrule")return t(i,s)}))}walkComments(e){return this.walk((t,i)=>{if(t.type==="comment")return e(t,i)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((i,s)=>{if(i.type==="decl"&&e.test(i.prop))return t(i,s)}):this.walk((i,s)=>{if(i.type==="decl"&&i.prop===e)return t(i,s)}):(t=e,this.walk((i,s)=>{if(i.type==="decl")return t(i,s)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((i,s)=>{if(i.type==="rule"&&e.test(i.selector))return t(i,s)}):this.walk((i,s)=>{if(i.type==="rule"&&i.selector===e)return t(i,s)}):(t=e,this.walk((i,s)=>{if(i.type==="rule")return t(i,s)}))}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]}};ve.registerParse=r=>{Ba=r};ve.registerRule=r=>{js=r};ve.registerAtRule=r=>{Ks=r};ve.registerRoot=r=>{Wa=r};_e=ve;ve.default=ve;ve.rebuild=r=>{r.type==="atrule"?Object.setPrototypeOf(r,Ks.prototype):r.type==="rule"?Object.setPrototypeOf(r,js.prototype):r.type==="decl"?Object.setPrototypeOf(r,Fa.prototype):r.type==="comment"?Object.setPrototypeOf(r,Ua.prototype):r.type==="root"&&Object.setPrototypeOf(r,Wa.prototype),r[_a]=!0,r.nodes&&r.nodes.forEach(e=>{ve.rebuild(e)})};Ad=_e,Tt=class extends Ad{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Ga(new ja,this,e).stringify()}};Tt.registerLazyResult=r=>{Ga=r};Tt.registerProcessor=r=>{ja=r};Ys=Tt;Tt.default=Tt;Qr=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let i=t.node.rangeBy(t);this.line=i.start.line,this.column=i.start.column,this.endLine=i.end.line,this.endColumn=i.end.column}for(let i in t)this[i]=t[i]}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}},Ka=Qr;Qr.default=Qr;Od=Ka,es=class{constructor(e,t,i){this.processor=e,this.messages=[],this.root=t,this.opts=i,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 i=new Od(e,t);return this.messages.push(i),i}warnings(){return this.messages.filter(e=>e.type==="warning")}get content(){return this.css}},Xs=es;es.default=es;Sr=39,lo=34,ii=92,co=47,ri=10,dt=32,si=12,ni=9,oi=13,Dd=91,Pd=93,$d=40,Ld=41,_d=123,Fd=125,Ud=59,Bd=42,Wd=58,zd=64,ai=/[\t\n\f\r "#'()/;[\\\]{}]/g,li=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Hd=/.[\r\n"'(/\\]/,uo=/[\da-f]/i,Vd=function(e,t={}){let i=e.css.valueOf(),s=t.ignoreErrors,n,o,a,l,c,u,h,d,p,g,m=i.length,f=0,y=[],b=[];function w(){return f}function S(U){throw e.error("Unclosed "+U,f)}function I(){return b.length===0&&f>=m}function M(U){if(b.length)return b.pop();if(f>=m)return;let K=U?U.ignoreUnclosed:!1;switch(n=i.charCodeAt(f),n){case ri:case dt:case ni:case oi:case si:{o=f;do o+=1,n=i.charCodeAt(o);while(n===dt||n===ri||n===ni||n===oi||n===si);g=["space",i.slice(f,o)],f=o-1;break}case Dd:case Pd:case _d:case Fd:case Wd:case Ud:case Ld:{let q=String.fromCharCode(n);g=[q,q,f];break}case $d:{if(d=y.length?y.pop()[1]:"",p=i.charCodeAt(f+1),d==="url"&&p!==Sr&&p!==lo&&p!==dt&&p!==ri&&p!==ni&&p!==si&&p!==oi){o=f;do{if(u=!1,o=i.indexOf(")",o+1),o===-1)if(s||K){o=f;break}else S("bracket");for(h=o;i.charCodeAt(h-1)===ii;)h-=1,u=!u}while(u);g=["brackets",i.slice(f,o+1),f,o],f=o}else o=i.indexOf(")",f+1),l=i.slice(f,o+1),o===-1||Hd.test(l)?g=["(","(",f]:(g=["brackets",l,f,o],f=o);break}case Sr:case lo:{a=n===Sr?"'":'"',o=f;do{if(u=!1,o=i.indexOf(a,o+1),o===-1)if(s||K){o=f+1;break}else S("string");for(h=o;i.charCodeAt(h-1)===ii;)h-=1,u=!u}while(u);g=["string",i.slice(f,o+1),f,o],f=o;break}case zd:{ai.lastIndex=f+1,ai.test(i),ai.lastIndex===0?o=i.length-1:o=ai.lastIndex-2,g=["at-word",i.slice(f,o+1),f,o],f=o;break}case ii:{for(o=f,c=!0;i.charCodeAt(o+1)===ii;)o+=1,c=!c;if(n=i.charCodeAt(o+1),c&&n!==co&&n!==dt&&n!==ri&&n!==ni&&n!==oi&&n!==si&&(o+=1,uo.test(i.charAt(o)))){for(;uo.test(i.charAt(o+1));)o+=1;i.charCodeAt(o+1)===dt&&(o+=1)}g=["word",i.slice(f,o+1),f,o],f=o;break}default:{n===co&&i.charCodeAt(f+1)===Bd?(o=i.indexOf("*/",f+2)+1,o===0&&(s||K?o=i.length:S("comment")),g=["comment",i.slice(f,o+1),f,o],f=o):(li.lastIndex=f+1,li.test(i),li.lastIndex===0?o=i.length-1:o=li.lastIndex-2,g=["word",i.slice(f,o+1),f,o],y.push(g),f=o);break}}return f++,g}function z(U){b.push(U)}return{back:z,endOfFile:I,nextToken:M,position:w}},Ya=_e,Mi=class extends Ya{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)}},Js=Mi;Mi.default=Mi;Ya.registerAtRule(Mi);Xa=_e,et=class extends Xa{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,i){let s=super.normalize(e);if(t){if(i==="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 s)n.raws.before=t.raws.before}return s}removeChild(e,t){let i=this.index(e);return!t&&i===0&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[i].raws.before),super.removeChild(e)}toResult(e={}){return new Ja(new Za,this,e).stringify()}};et.registerLazyResult=r=>{Ja=r};et.registerProcessor=r=>{Za=r};$t=et;et.default=et;Xa.registerRoot(et);Mt={comma(r){return Mt.split(r,[","],!0)},space(r){let e=[" ",`
50
+ `," "];return Mt.split(r,e)},split(r,e,t){let i=[],s="",n=!1,o=0,a=!1,l="",c=!1;for(let u of r)c?c=!1:u==="\\"?c=!0:a?u===l&&(a=!1):u==='"'||u==="'"?(a=!0,l=u):u==="("?o+=1:u===")"?o>0&&(o-=1):o===0&&e.includes(u)&&(n=!0),n?(s!==""&&i.push(s.trim()),s="",n=!1):s+=u;return(t||s!=="")&&i.push(s.trim()),i}},qa=Mt;Mt.default=Mt;Qa=_e,Gd=qa,ki=class extends Qa{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Gd.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,i=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(i)}},Zs=ki;ki.default=ki;Qa.registerRule(ki);jd=Ji,Kd=Vd,Yd=qi,Xd=Js,Jd=$t,ho=Zs,fo={empty:!0,space:!0};qd=class{constructor(e){this.input=e,this.root=new Jd,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 Xd;t.name=e[1].slice(1),t.name===""&&this.unnamedAtrule(t,e),this.init(t,e[2]);let i,s,n,o=!1,a=!1,l=[],c=[];for(;!this.tokenizer.endOfFile();){if(e=this.tokenizer.nextToken(),i=e[0],i==="("||i==="["?c.push(i==="("?")":"]"):i==="{"&&c.length>0?c.push("}"):i===c[c.length-1]&&c.pop(),c.length===0)if(i===";"){t.source.end=this.getPosition(e[2]),t.source.end.offset++,this.semicolon=!0;break}else if(i==="{"){a=!0;break}else if(i==="}"){if(l.length>0){for(n=l.length-1,s=l[n];s&&s[0]==="space";)s=l[--n];s&&(t.source.end=this.getPosition(s[3]||s[2]),t.source.end.offset++)}this.end(e);break}else l.push(e);else l.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}t.raws.between=this.spacesAndCommentsFromEnd(l),l.length?(t.raws.afterName=this.spacesAndCommentsFromStart(l),this.raw(t,"params",l),o&&(e=l[l.length-1],t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++,this.spaces=t.raws.between,t.raws.between="")):(t.raws.afterName="",t.params=""),a&&(t.nodes=[],this.current=t)}checkMissedSemicolon(e){let t=this.colon(e);if(t===!1)return;let i=0,s;for(let n=t-1;n>=0&&(s=e[n],!(s[0]!=="space"&&(i+=1,i===2)));n--);throw this.input.error("Missed semicolon",s[0]==="word"?s[3]+1:s[2])}colon(e){let t=0,i,s,n;for(let[o,a]of e.entries()){if(i=a,s=i[0],s==="("&&(t+=1),s===")"&&(t-=1),t===0&&s===":")if(!n)this.doubleColon(i);else{if(n[0]==="word"&&n[1]==="progid")continue;return o}n=i}return!1}comment(e){let t=new Yd;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let i=e[1].slice(2,-2);if(/^\s*$/.test(i))t.text="",t.raws.left=i,t.raws.right="";else{let s=i.match(/^(\s*)([^]*\S)(\s*)$/);t.text=s[2],t.raws.left=s[1],t.raws.right=s[3]}}createTokenizer(){this.tokenizer=Kd(this.input)}decl(e,t){let i=new jd;this.init(i,e[0][2]);let s=e[e.length-1];for(s[0]===";"&&(this.semicolon=!0,e.pop()),i.source.end=this.getPosition(s[3]||s[2]||Zd(e)),i.source.end.offset++;e[0][0]!=="word";)e.length===1&&this.unknownWord(e),i.raws.before+=e.shift()[1];for(i.source.start=this.getPosition(e[0][2]),i.prop="";e.length;){let c=e[0][0];if(c===":"||c==="space"||c==="comment")break;i.prop+=e.shift()[1]}i.raws.between="";let n;for(;e.length;)if(n=e.shift(),n[0]===":"){i.raws.between+=n[1];break}else n[0]==="word"&&/\w/.test(n[1])&&this.unknownWord([n]),i.raws.between+=n[1];(i.prop[0]==="_"||i.prop[0]==="*")&&(i.raws.before+=i.prop[0],i.prop=i.prop.slice(1));let o=[],a;for(;e.length&&(a=e[0][0],!(a!=="space"&&a!=="comment"));)o.push(e.shift());this.precheckMissedSemicolon(e);for(let c=e.length-1;c>=0;c--){if(n=e[c],n[1].toLowerCase()==="!important"){i.important=!0;let u=this.stringFrom(e,c);u=this.spacesFromEnd(e)+u,u!==" !important"&&(i.raws.important=u);break}else if(n[1].toLowerCase()==="important"){let u=e.slice(0),h="";for(let d=c;d>0;d--){let p=u[d][0];if(h.trim().indexOf("!")===0&&p!=="space")break;h=u.pop()[1]+h}h.trim().indexOf("!")===0&&(i.important=!0,i.raws.important=h,e=u)}if(n[0]!=="space"&&n[0]!=="comment")break}e.some(c=>c[0]!=="space"&&c[0]!=="comment")&&(i.raws.between+=o.map(c=>c[1]).join(""),o=[]),this.raw(i,"value",o.concat(e),t),i.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 ho;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,i=null,s=!1,n=null,o=[],a=e[1].startsWith("--"),l=[],c=e;for(;c;){if(i=c[0],l.push(c),i==="("||i==="[")n||(n=c),o.push(i==="("?")":"]");else if(a&&s&&i==="{")n||(n=c),o.push("}");else if(o.length===0)if(i===";")if(s){this.decl(l,a);return}else break;else if(i==="{"){this.rule(l);return}else if(i==="}"){this.tokenizer.back(l.pop()),t=!0;break}else i===":"&&(s=!0);else i===o[o.length-1]&&(o.pop(),o.length===0&&(n=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&s){if(!a)for(;l.length&&(c=l[l.length-1][0],!(c!=="space"&&c!=="comment"));)this.tokenizer.back(l.pop());this.decl(l,a)}else this.unknownWord(l)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e);break}this.endFile()}precheckMissedSemicolon(){}raw(e,t,i,s){let n,o,a=i.length,l="",c=!0,u,h;for(let d=0;d<a;d+=1)n=i[d],o=n[0],o==="space"&&d===a-1&&!s?c=!1:o==="comment"?(h=i[d-1]?i[d-1][0]:"empty",u=i[d+1]?i[d+1][0]:"empty",!fo[h]&&!fo[u]?l.slice(-1)===","?c=!1:l+=n[1]:c=!1):l+=n[1];if(!c){let d=i.reduce((p,g)=>p+g[1],"");e.raws[t]={raw:d,value:l}}e[t]=l}rule(e){e.pop();let t=new ho;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,i="";for(;e.length&&(t=e[e.length-1][0],!(t!=="space"&&t!=="comment"));)i=e.pop()[1]+i;return i}spacesAndCommentsFromStart(e){let t,i="";for(;e.length&&(t=e[0][0],!(t!=="space"&&t!=="comment"));)i+=e.shift()[1];return i}spacesFromEnd(e){let t,i="";for(;e.length&&(t=e[e.length-1][0],t==="space");)i=e.pop()[1]+i;return i}stringFrom(e,t){let i="";for(let s=t;s<e.length;s++)i+=e[s][1];return e.splice(t,e.length-t),i}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})}},Qd=qd,ef=_e,tf=Qd,rf=Zi;qs=Ri;Ri.default=Ri;ef.registerParse(Ri);({isClean:pe,my:sf}=Pt),nf=$a,of=Yi,af=_e,lf=Ys,po=Xs,cf=qs,uf=$t,hf={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},df={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},ff={Once:!0,postcssPlugin:!0,prepare:!0},tt=0;is={},it=class tl{constructor(e,t,i){this.stringified=!1,this.processed=!1;let s;if(typeof t=="object"&&t!==null&&(t.type==="root"||t.type==="document"))s=ts(t);else if(t instanceof tl||t instanceof po)s=ts(t.root),t.map&&(typeof i.map=="undefined"&&(i.map={}),i.map.inline||(i.map.inline=!1),i.map.prev=t.map);else{let n=cf;i.syntax&&(n=i.syntax.parse),i.parser&&(n=i.parser),n.parse&&(n=n.parse);try{s=n(t,i)}catch(o){this.processed=!0,this.error=o}s&&!s[sf]&&af.rebuild(s)}this.result=new po(e,s,i),this.helpers={...is,postcss:is,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 i=this.result.lastPlugin;try{t&&t.addToError(e),this.error=e,e.name==="CssSyntaxError"&&!e.plugin?(e.plugin=i.postcssPlugin,e.setMessage()):i.postcssVersion}catch(s){console&&console.error&&console.error(s)}return e}prepareVisitors(){this.listeners={};let e=(t,i,s)=>{this.listeners[i]||(this.listeners[i]=[]),this.listeners[i].push([t,s])};for(let t of this.plugins)if(typeof t=="object")for(let i in t){if(!df[i]&&/^[A-Z]/.test(i))throw new Error(`Unknown event ${i} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!ff[i])if(typeof t[i]=="object")for(let s in t[i])s==="*"?e(t,i,t[i][s]):e(t,i+"-"+s.toLowerCase(),t[i][s]);else typeof t[i]=="function"&&e(t,i,t[i])}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],i=this.runOnRoot(t);if(ft(i))try{await i}catch(s){throw this.handleError(s)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[pe];){e[pe]=!0;let t=[mo(e)];for(;t.length>0;){let i=this.visitTick(t);if(ft(i))try{await i}catch(s){let n=t[t.length-1].node;throw this.handleError(s,n)}}}if(this.listeners.OnceExit)for(let[t,i]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if(e.type==="document"){let s=e.nodes.map(n=>i(n,this.helpers));await Promise.all(s)}else await i(e,this.helpers)}catch(s){throw this.handleError(s)}}}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(i=>e.Once(i,this.helpers));return ft(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=of;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new nf(t,this.result.root,this.result.opts).generate();return this.result.css=s[0],this.result.map=s[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(ft(t))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[pe];)e[pe]=!0,this.walkSync(e);if(this.listeners.OnceExit)if(e.type==="document")for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[i,s]of e){this.result.lastPlugin=i;let n;try{n=s(t,this.helpers)}catch(o){throw this.handleError(o,t.proxyOf)}if(t.type!=="root"&&t.type!=="document"&&!t.parent)return!0;if(ft(n))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:i,visitors:s}=t;if(i.type!=="root"&&i.type!=="document"&&!i.parent){e.pop();return}if(s.length>0&&t.visitorIndex<s.length){let[o,a]=s[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===s.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=o;try{return a(i.toProxy(),this.helpers)}catch(l){throw this.handleError(l,i)}}if(t.iterator!==0){let o=t.iterator,a;for(;a=i.nodes[i.indexes[o]];)if(i.indexes[o]+=1,!a[pe]){a[pe]=!0,e.push(mo(a));return}t.iterator=0,delete i.indexes[o]}let n=t.events;for(;t.eventIndex<n.length;){let o=n[t.eventIndex];if(t.eventIndex+=1,o===tt){i.nodes&&i.nodes.length&&(i[pe]=!0,t.iterator=i.getIterator());return}else if(this.listeners[o]){t.visitors=this.listeners[o];return}}e.pop()}walkSync(e){e[pe]=!0;let t=el(e);for(let i of t)if(i===tt)e.nodes&&e.each(s=>{s[pe]||this.walkSync(s)});else{let s=this.listeners[i];if(s&&this.visitSync(s,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};it.registerPostcss=r=>{is=r};il=it;it.default=it;uf.registerLazyResult(it);lf.registerLazyResult(it);pf=$a,mf=Yi,gf=qs,yf=Xs,rs=class{constructor(e,t,i){t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=i,this._map=void 0;let s,n=mf;this.result=new yf(this._processor,s,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get(){return o.root}});let a=new pf(n,s,this._opts,t);if(a.isMap()){let[l,c]=a.generate();l&&(this.result.css=l),c&&(this.result.map=c)}else a.clearAnnotation(),this.result.css=a.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=gf;try{e=t(this._css,this._opts)}catch(i){this.error=i}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}},wf=rs;rs.default=rs;vf=wf,bf=il,Sf=Ys,Cf=$t,kt=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let i of e)if(i.postcss===!0?i=i():i.postcss&&(i=i.postcss),typeof i=="object"&&Array.isArray(i.plugins))t=t.concat(i.plugins);else if(typeof i=="object"&&i.postcssPlugin)t.push(i);else if(typeof i=="function")t.push(i);else if(!(typeof i=="object"&&(i.parse||i.stringify)))throw new Error(i+" is not a PostCSS plugin");return t}process(e,t={}){return!this.plugins.length&&!t.parser&&!t.stringifier&&!t.syntax?new vf(this,e,t):new bf(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}},Ef=kt;kt.default=kt;Cf.registerProcessor(kt);Sf.registerProcessor(kt);xf=Ji,If=Na,Tf=qi,Mf=Js,kf=Zi,Rf=$t,Nf=Zs;Af=Rt;Rt.default=Rt;Of=Gs,rl=Ji,Df=il,Pf=_e,Qs=Ef,$f=Yi,Lf=Af,sl=Ys,_f=Ka,nl=qi,ol=Js,Ff=Xs,Uf=Zi,Bf=qs,Wf=qa,al=Zs,ll=$t,zf=Xi;_.plugin=function(e,t){let i=!1;function s(...o){console&&console.warn&&!i&&(i=!0,console.warn(e+`: postcss.plugin was deprecated. Migration guide:
51
+ https://evilmartians.com/chronicles/postcss-8-plugin-migration`),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+`: \u91CC\u9762 postcss.plugin \u88AB\u5F03\u7528. \u8FC1\u79FB\u6307\u5357:
52
+ https://www.w3ctech.com/topic/2226`));let a=t(...o);return a.postcssPlugin=e,a.postcssVersion=new Qs().version,a}let n;return Object.defineProperty(s,"postcss",{get(){return n||(n=s()),n}}),s.process=function(o,a,l){return _([s(l)]).process(o,a)},s};_.stringify=$f;_.parse=Bf;_.fromJSON=Lf;_.list=Wf;_.comment=r=>new nl(r);_.atRule=r=>new ol(r);_.decl=r=>new rl(r);_.rule=r=>new al(r);_.root=r=>new ll(r);_.document=r=>new sl(r);_.CssSyntaxError=Of;_.Declaration=rl;_.Container=Pf;_.Processor=Qs;_.Document=sl;_.Comment=nl;_.Warning=_f;_.AtRule=ol;_.Result=Ff;_.Input=Uf;_.Rule=al;_.Root=ll;_.Node=zf;Df.registerPostcss(_);Hf=_;_.default=_;j=ed(Hf);j.stringify;j.fromJSON;j.plugin;j.parse;j.list;j.document;j.comment;j.atRule;j.rule;j.decl;j.root;j.CssSyntaxError;j.Declaration;j.Container;j.Processor;j.Document;j.Comment;j.Warning;j.AtRule;j.Result;j.Input;j.Rule;j.Root;j.Node;N=(r=>(r[r.Document=0]="Document",r[r.DocumentType=1]="DocumentType",r[r.Element=2]="Element",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.Comment=5]="Comment",r))(N||{});Gf=/-([a-z])/g,jf=/^--[a-zA-Z0-9-]+$/,ss=r=>jf.test(r)?r:r.replace(Gf,(e,t)=>t?t.toUpperCase():""),Kf=/\B([A-Z])/g,Yf=r=>r.replace(Kf,"-$1").toLowerCase(),ce=class r{constructor(...e){C(this,"parentElement",null),C(this,"parentNode",null),C(this,"ownerDocument"),C(this,"firstChild",null),C(this,"lastChild",null),C(this,"previousSibling",null),C(this,"nextSibling",null),C(this,"ELEMENT_NODE",1),C(this,"TEXT_NODE",3),C(this,"nodeType"),C(this,"nodeName"),C(this,"RRNodeType")}get childNodes(){let e=[],t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(e instanceof r){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"}},ns=class r extends ce{constructor(...e){super(e),C(this,"nodeType",9),C(this,"nodeName","#document"),C(this,"compatMode","CSS1Compat"),C(this,"RRNodeType",N.Document),C(this,"textContent",null),this.ownerDocument=this}get documentElement(){return this.childNodes.find(e=>e.RRNodeType===N.Element&&e.tagName==="HTML")||null}get body(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(t=>t.RRNodeType===N.Element&&t.tagName==="BODY"))||null}get head(){var e;return((e=this.documentElement)==null?void 0:e.childNodes.find(t=>t.RRNodeType===N.Element&&t.tagName==="HEAD"))||null}get implementation(){return this}get firstElementChild(){return this.documentElement}appendChild(e){let t=e.RRNodeType;if((t===N.Element||t===N.DocumentType)&&this.childNodes.some(s=>s.RRNodeType===t))throw new Error(`RRDomException: Failed to execute 'appendChild' on 'RRNode': Only one ${t===N.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);let i=en(this,e);return i.parentElement=null,i}insertBefore(e,t){let i=e.RRNodeType;if((i===N.Element||i===N.DocumentType)&&this.childNodes.some(n=>n.RRNodeType===i))throw new Error(`RRDomException: Failed to execute 'insertBefore' on 'RRNode': Only one ${i===N.Element?"RRElement":"RRDoctype"} on RRDocument allowed.`);let s=cl(this,e,t);return s.parentElement=null,s}removeChild(e){return ul(this,e)}open(){this.firstChild=null,this.lastChild=null}close(){}write(e){let t;if(e==='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">'?t="-//W3C//DTD XHTML 1.0 Transitional//EN":e==='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "">'&&(t="-//W3C//DTD HTML 4.0 Transitional//EN"),t){let i=this.createDocumentType("html",t,"");this.open(),this.appendChild(i)}}createDocument(e,t,i){return new r}createDocumentType(e,t,i){let s=new Ni(e,t,i);return s.ownerDocument=this,s}createElement(e){let t=new rt(e);return t.ownerDocument=this,t}createElementNS(e,t){return this.createElement(t)}createTextNode(e){let t=new Ai(e);return t.ownerDocument=this,t}createComment(e){let t=new Oi(e);return t.ownerDocument=this,t}createCDATASection(e){let t=new Di(e);return t.ownerDocument=this,t}toString(){return"RRDocument"}},Ni=class extends ce{constructor(e,t,i){super(),C(this,"nodeType",10),C(this,"RRNodeType",N.DocumentType),C(this,"name"),C(this,"publicId"),C(this,"systemId"),C(this,"textContent",null),this.name=e,this.publicId=t,this.systemId=i,this.nodeName=e}toString(){return"RRDocumentType"}},rt=class extends ce{constructor(e){super(),C(this,"nodeType",1),C(this,"RRNodeType",N.Element),C(this,"tagName"),C(this,"attributes",{}),C(this,"shadowRoot",null),C(this,"scrollLeft"),C(this,"scrollTop"),this.tagName=e.toUpperCase(),this.nodeName=e.toUpperCase()}get textContent(){let e="";return this.childNodes.forEach(t=>e+=t.textContent),e}set textContent(e){this.firstChild=null,this.lastChild=null,this.appendChild(this.ownerDocument.createTextNode(e))}get classList(){return new ls(this.attributes.class,e=>{this.attributes.class=e})}get id(){return this.attributes.id||""}get className(){return this.attributes.class||""}get style(){let e=this.attributes.style?Vf(this.attributes.style):{},t=/\B([A-Z])/g;return e.setProperty=(i,s,n)=>{if(t.test(i))return;let o=ss(i);s?e[o]=s:delete e[o],n==="important"&&(e[o]+=" !important"),this.attributes.style=go(e)},e.removeProperty=i=>{if(t.test(i))return"";let s=ss(i),n=e[s]||"";return delete e[s],this.attributes.style=go(e),n},e}getAttribute(e){return this.attributes[e]===void 0?null:this.attributes[e]}setAttribute(e,t){this.attributes[e]=t}setAttributeNS(e,t,i){this.setAttribute(t,i)}removeAttribute(e){delete this.attributes[e]}appendChild(e){return en(this,e)}insertBefore(e,t){return cl(this,e,t)}removeChild(e){return ul(this,e)}attachShadow(e){let t=this.ownerDocument.createElement("SHADOWROOT");return this.shadowRoot=t,t}dispatchEvent(e){return!0}toString(){let e="";for(let t in this.attributes)e+=`${t}="${this.attributes[t]}" `;return`${this.tagName} ${e}`}},os=class extends rt{constructor(){super(...arguments),C(this,"currentTime"),C(this,"volume"),C(this,"paused"),C(this,"muted"),C(this,"playbackRate"),C(this,"loop")}attachShadow(e){throw new Error("RRDomException: Failed to execute 'attachShadow' on 'RRElement': This RRElement does not support attachShadow")}play(){this.paused=!1}pause(){this.paused=!0}},as=class extends rt{constructor(){super(...arguments),C(this,"tagName","DIALOG"),C(this,"nodeName","DIALOG")}get isModal(){return this.getAttribute("rr_open_mode")==="modal"}get open(){return this.getAttribute("open")!==null}close(){this.removeAttribute("open"),this.removeAttribute("rr_open_mode")}show(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","non-modal")}showModal(){this.setAttribute("open",""),this.setAttribute("rr_open_mode","modal")}},Ai=class extends ce{constructor(e){super(),C(this,"nodeType",3),C(this,"nodeName","#text"),C(this,"RRNodeType",N.Text),C(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRText text=${JSON.stringify(this.data)}`}},Oi=class extends ce{constructor(e){super(),C(this,"nodeType",8),C(this,"nodeName","#comment"),C(this,"RRNodeType",N.Comment),C(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRComment text=${JSON.stringify(this.data)}`}},Di=class extends ce{constructor(e){super(),C(this,"nodeName","#cdata-section"),C(this,"nodeType",4),C(this,"RRNodeType",N.CDATA),C(this,"data"),this.data=e}get textContent(){return this.data}set textContent(e){this.data=e}toString(){return`RRCDATASection data=${JSON.stringify(this.data)}`}},ls=class{constructor(e,t){if(C(this,"onChange"),C(this,"classes",[]),C(this,"add",(...i)=>{for(let s of i){let n=String(s);this.classes.indexOf(n)>=0||this.classes.push(n)}this.onChange&&this.onChange(this.classes.join(" "))}),C(this,"remove",(...i)=>{this.classes=this.classes.filter(s=>i.indexOf(s)===-1),this.onChange&&this.onChange(this.classes.join(" "))}),e){let i=e.trim().split(/\s+/);this.classes.push(...i)}this.onChange=t}};ne=(r=>(r[r.PLACEHOLDER=0]="PLACEHOLDER",r[r.ELEMENT_NODE=1]="ELEMENT_NODE",r[r.ATTRIBUTE_NODE=2]="ATTRIBUTE_NODE",r[r.TEXT_NODE=3]="TEXT_NODE",r[r.CDATA_SECTION_NODE=4]="CDATA_SECTION_NODE",r[r.ENTITY_REFERENCE_NODE=5]="ENTITY_REFERENCE_NODE",r[r.ENTITY_NODE=6]="ENTITY_NODE",r[r.PROCESSING_INSTRUCTION_NODE=7]="PROCESSING_INSTRUCTION_NODE",r[r.COMMENT_NODE=8]="COMMENT_NODE",r[r.DOCUMENT_NODE=9]="DOCUMENT_NODE",r[r.DOCUMENT_TYPE_NODE=10]="DOCUMENT_TYPE_NODE",r[r.DOCUMENT_FRAGMENT_NODE=11]="DOCUMENT_FRAGMENT_NODE",r))(ne||{}),cs={svg:"http://www.w3.org/2000/svg","xlink:href":"http://www.w3.org/1999/xlink",xmlns:"http://www.w3.org/2000/xmlns/"},Xf={altglyph:"altGlyph",altglyphdef:"altGlyphDef",altglyphitem:"altGlyphItem",animatecolor:"animateColor",animatemotion:"animateMotion",animatetransform:"animateTransform",clippath:"clipPath",feblend:"feBlend",fecolormatrix:"feColorMatrix",fecomponenttransfer:"feComponentTransfer",fecomposite:"feComposite",feconvolvematrix:"feConvolveMatrix",fediffuselighting:"feDiffuseLighting",fedisplacementmap:"feDisplacementMap",fedistantlight:"feDistantLight",fedropshadow:"feDropShadow",feflood:"feFlood",fefunca:"feFuncA",fefuncb:"feFuncB",fefuncg:"feFuncG",fefuncr:"feFuncR",fegaussianblur:"feGaussianBlur",feimage:"feImage",femerge:"feMerge",femergenode:"feMergeNode",femorphology:"feMorphology",feoffset:"feOffset",fepointlight:"fePointLight",fespecularlighting:"feSpecularLighting",fespotlight:"feSpotLight",fetile:"feTile",feturbulence:"feTurbulence",foreignobject:"foreignObject",glyphref:"glyphRef",lineargradient:"linearGradient",radialgradient:"radialGradient"},me=null;st=class r extends ns{constructor(e){super(),C(this,"UNSERIALIZED_STARTING_ID",-2),C(this,"_unserializedId",this.UNSERIALIZED_STARTING_ID),C(this,"mirror",np()),C(this,"scrollData",null),e&&(this.mirror=e)}get unserializedId(){return this._unserializedId--}createDocument(e,t,i){return new r}createDocumentType(e,t,i){let s=new Qf(e,t,i);return s.ownerDocument=this,s}createElement(e){let t=e.toUpperCase(),i;switch(t){case"AUDIO":case"VIDEO":i=new us(t);break;case"IFRAME":i=new ps(t,this.mirror);break;case"CANVAS":i=new ds(t);break;case"STYLE":i=new fs(t);break;case"DIALOG":i=new hs(t);break;default:i=new nt(t);break}return i.ownerDocument=this,i}createComment(e){let t=new tp(e);return t.ownerDocument=this,t}createCDATASection(e){let t=new ip(e);return t.ownerDocument=this,t}createTextNode(e){let t=new ep(e);return t.ownerDocument=this,t}destroyTree(){this.firstChild=null,this.lastChild=null,this.mirror.reset()}open(){super.open(),this._unserializedId=this.UNSERIALIZED_STARTING_ID}},Qf=Ni,nt=class extends rt{constructor(){super(...arguments),C(this,"inputData",null),C(this,"scrollData",null)}},us=class extends os{},hs=class extends as{},ds=class extends nt{constructor(){super(...arguments),C(this,"rr_dataURL",null),C(this,"canvasMutations",[])}getContext(){return null}},fs=class extends nt{constructor(){super(...arguments),C(this,"rules",[])}},ps=class extends nt{constructor(e,t){super(e),C(this,"contentDocument",new st),this.contentDocument.mirror=t}},ep=Ai,tp=Oi,ip=Di;ms=class{constructor(){C(this,"idNodeMap",new Map),C(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;let i=(t=this.getMeta(e))==null?void 0:t.id;return i!=null?i:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){let t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(i=>this.removeNodeFromMap(i))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){let i=t.id;this.idNodeMap.set(i,e),this.nodeMetaMap.set(e,t)}replace(e,t){let i=this.getNode(e);if(i){let s=this.nodeMetaMap.get(i);s&&this.nodeMetaMap.set(t,s)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}};yo={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},wo={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},ci={},op=()=>!!globalThis.Zone;Cr={};Er={};k={childNodes:ap,parentNode:lp,parentElement:cp,textContent:up,contains:hp,getRootNode:dp,host:fp,styleSheets:pp,shadowRoot:mp,querySelector:gp,querySelectorAll:yp,mutationObserver:ml};He=`Please stop import mirror directly. Instead of that,\r
53
+ now you can use replayer.getMirror() to access the mirror instance of a replayer,\r
54
+ or you can use record.mirror to access the mirror instance during recording.`,Li={map:{},getId(){return console.error(He),-1},getNode(){return console.error(He),null},removeNodeFromMap(){console.error(He)},has(){return console.error(He),!1},reset(){console.error(He)}};typeof window!="undefined"&&window.Proxy&&window.Reflect&&(Li=new Proxy(Li,{get(r,e,t){return e==="map"&&console.error(He),Reflect.get(r,e,t)}}));Nt=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(Nt=()=>new Date().getTime());At=class{constructor(){v(this,"id",1),v(this,"styleIDMap",new WeakMap),v(this,"idStyleMap",new Map)}getId(e){var t;return(t=this.styleIDMap.get(e))!=null?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let i;return t===void 0?i=this.id++:i=t,this.styleIDMap.set(e,i),this.idStyleMap.set(i,e),i}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}};wp=Object.freeze(Object.defineProperty({__proto__:null,StyleSheetMirror:At,get _mirror(){return Li},closestElementOfNode:an,getBaseDimension:dn,getNestedRule:Ke,getPositionsAndIndex:gs,getRootShadowHost:vl,getShadowHost:fn,getWindowHeight:nn,getWindowScroll:sn,getWindowWidth:on,hasShadowRoot:xe,hookSetter:Lt,inDom:pn,isAncestorRemoved:ln,isBlocked:te,isIgnored:yi,isSerialized:gl,isSerializedIframe:Je,isSerializedStylesheet:hn,iterateResolveTree:un,legacy_isTouchEvent:_i,get nowTimestamp(){return Nt},on:ee,patch:Fe,polyfill:cn,queueToResolveTrees:yl,shadowHostInDom:bl,throttle:ot,uniqueTextMutations:wl},Symbol.toStringTag,{value:"Module"})),x=(r=>(r[r.DomContentLoaded=0]="DomContentLoaded",r[r.Load=1]="Load",r[r.FullSnapshot=2]="FullSnapshot",r[r.IncrementalSnapshot=3]="IncrementalSnapshot",r[r.Meta=4]="Meta",r[r.Custom=5]="Custom",r[r.Plugin=6]="Plugin",r))(x||{}),E=(r=>(r[r.Mutation=0]="Mutation",r[r.MouseMove=1]="MouseMove",r[r.MouseInteraction=2]="MouseInteraction",r[r.Scroll=3]="Scroll",r[r.ViewportResize=4]="ViewportResize",r[r.Input=5]="Input",r[r.TouchMove=6]="TouchMove",r[r.MediaInteraction=7]="MediaInteraction",r[r.StyleSheetRule=8]="StyleSheetRule",r[r.CanvasMutation=9]="CanvasMutation",r[r.Font=10]="Font",r[r.Log=11]="Log",r[r.Drag=12]="Drag",r[r.StyleDeclaration=13]="StyleDeclaration",r[r.Selection=14]="Selection",r[r.AdoptedStyleSheet=15]="AdoptedStyleSheet",r[r.CustomElement=16]="CustomElement",r))(E||{}),D=(r=>(r[r.MouseUp=0]="MouseUp",r[r.MouseDown=1]="MouseDown",r[r.Click=2]="Click",r[r.ContextMenu=3]="ContextMenu",r[r.DblClick=4]="DblClick",r[r.Focus=5]="Focus",r[r.Blur=6]="Blur",r[r.TouchStart=7]="TouchStart",r[r.TouchMove_Departed=8]="TouchMove_Departed",r[r.TouchEnd=9]="TouchEnd",r[r.TouchCancel=10]="TouchCancel",r))(D||{}),ge=(r=>(r[r.Mouse=0]="Mouse",r[r.Pen=1]="Pen",r[r.Touch=2]="Touch",r))(ge||{}),be=(r=>(r[r["2D"]=0]="2D",r[r.WebGL=1]="WebGL",r[r.WebGL2=2]="WebGL2",r))(be||{}),Ee=(r=>(r[r.Play=0]="Play",r[r.Pause=1]="Pause",r[r.Seeked=2]="Seeked",r[r.VolumeChange=3]="VolumeChange",r[r.RateChange=4]="RateChange",r))(Ee||{}),O=(r=>(r.Start="start",r.Pause="pause",r.Resume="resume",r.Resize="resize",r.Finish="finish",r.FullsnapshotRebuilded="fullsnapshot-rebuilded",r.LoadStylesheetStart="load-stylesheet-start",r.LoadStylesheetEnd="load-stylesheet-end",r.SkipStart="skip-start",r.SkipEnd="skip-end",r.MouseInteraction="mouse-interaction",r.EventCast="event-cast",r.CustomEvent="custom-event",r.Flush="flush",r.StateChange="state-change",r.PlayBack="play-back",r.Destroy="destroy",r))(O||{}),ye=(r=>(r[r.Document=0]="Document",r[r.DocumentType=1]="DocumentType",r[r.Element=2]="Element",r[r.Text=3]="Text",r[r.CDATA=4]="CDATA",r[r.Comment=5]="Comment",r))(ye||{});ys=class{constructor(){v(this,"length",0),v(this,"head",null),v(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let i=0;i<e;i++)t=(t==null?void 0:t.next)||null;return t}addNode(e){let t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&vo(e.previousSibling)){let i=e.previousSibling.__ln.next;t.next=i,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,i&&(i.previous=t)}else if(e.nextSibling&&vo(e.nextSibling)&&e.nextSibling.__ln.previous){let i=e.nextSibling.__ln.previous;t.previous=i,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,i&&(i.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;t.next===null&&(this.tail=t),this.length++}removeNode(e){let t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}},bo=(r,e)=>`${r}@${e}`,ws=class{constructor(){v(this,"frozen",!1),v(this,"locked",!1),v(this,"texts",[]),v(this,"attributes",[]),v(this,"attributeMap",new WeakMap),v(this,"removes",[]),v(this,"mapRemoves",[]),v(this,"movedMap",{}),v(this,"addedSet",new Set),v(this,"movedSet",new Set),v(this,"droppedSet",new Set),v(this,"removesSubTreeCache",new Set),v(this,"mutationCb"),v(this,"blockClass"),v(this,"blockSelector"),v(this,"maskTextClass"),v(this,"maskTextSelector"),v(this,"inlineStylesheet"),v(this,"maskInputOptions"),v(this,"maskTextFn"),v(this,"maskInputFn"),v(this,"keepIframeSrcFn"),v(this,"recordCanvas"),v(this,"inlineImages"),v(this,"slimDOMOptions"),v(this,"dataURLOptions"),v(this,"doc"),v(this,"mirror"),v(this,"iframeManager"),v(this,"stylesheetManager"),v(this,"shadowDomManager"),v(this,"canvasManager"),v(this,"processedNodeManager"),v(this,"unattachedDoc"),v(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),v(this,"emit",()=>{if(this.frozen||this.locked)return;let e=[],t=new Set,i=new ys,s=l=>{let c=l,u=St;for(;u===St;)c=c&&c.nextSibling,u=c&&this.mirror.getId(c);return u},n=l=>{let c=k.parentNode(l);if(!c||!pn(l))return;let u=!1;if(l.nodeType===Node.TEXT_NODE){let g=c.tagName;if(g==="TEXTAREA")return;g==="STYLE"&&this.addedSet.has(c)&&(u=!0)}let h=gt(c)?this.mirror.getId(fn(l)):this.mirror.getId(c),d=s(l);if(h===-1||d===-1)return i.addNode(l);let p=je(l,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:g=>{Je(g,this.mirror)&&this.iframeManager.addIframe(g),hn(g,this.mirror)&&this.stylesheetManager.trackLinkElement(g),xe(l)&&this.shadowDomManager.addShadowRoot(k.shadowRoot(l),this.doc)},onIframeLoad:(g,m)=>{this.iframeManager.attachIframe(g,m),this.shadowDomManager.observeAttachShadow(g)},onStylesheetLoad:(g,m)=>{this.stylesheetManager.attachLinkElement(g,m)},cssCaptured:u});p&&(e.push({parentId:h,nextId:d,node:p}),t.add(p.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(let l of this.movedSet)So(this.removesSubTreeCache,l,this.mirror)&&!this.movedSet.has(k.parentNode(l))||n(l);for(let l of this.addedSet)!Co(this.droppedSet,l)&&!So(this.removesSubTreeCache,l,this.mirror)||Co(this.movedSet,l)?n(l):this.droppedSet.add(l);let o=null;for(;i.length;){let l=null;if(o){let c=this.mirror.getId(k.parentNode(o.value)),u=s(o.value);c!==-1&&u!==-1&&(l=o)}if(!l){let c=i.tail;for(;c;){let u=c;if(c=c.previous,u){let h=this.mirror.getId(k.parentNode(u.value));if(s(u.value)===-1)continue;if(h!==-1){l=u;break}else{let p=u.value,g=k.parentNode(p);if(g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE){let m=k.host(g);if(this.mirror.getId(m)!==-1){l=u;break}}}}}}if(!l){for(;i.head;)i.removeNode(i.head.value);break}o=l.previous,i.removeNode(l.value),n(l.value)}let a={texts:this.texts.map(l=>{let c=l.node,u=k.parentNode(c);return u&&u.tagName==="TEXTAREA"&&this.genTextAreaValueMutation(u),{id:this.mirror.getId(c),value:l.value}}).filter(l=>!t.has(l.id)).filter(l=>this.mirror.has(l.id)),attributes:this.attributes.map(l=>{let{attributes:c}=l;if(typeof c.style=="string"){let u=JSON.stringify(l.styleDiff),h=JSON.stringify(l._unchangedStyles);u.length<c.style.length&&(u+h).split("var(").length===c.style.split("var(").length&&(c.style=l.styleDiff)}return{id:this.mirror.getId(l.node),attributes:c}}).filter(l=>!t.has(l.id)).filter(l=>this.mirror.has(l.id)),removes:this.removes,adds:e};!a.texts.length&&!a.attributes.length&&!a.removes.length&&!a.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(a))}),v(this,"genTextAreaValueMutation",e=>{let t=this.attributeMap.get(e);t||(t={node:e,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(t),this.attributeMap.set(e,t)),t.attributes.value=Array.from(k.childNodes(e),i=>k.textContent(i)||"").join("")}),v(this,"processMutation",e=>{if(!yi(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{let t=k.textContent(e.target);!te(e.target,this.blockClass,this.blockSelector,!1)&&t!==e.oldValue&&this.texts.push({value:Vo(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,an(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{let t=e.target,i=e.attributeName,s=e.target.getAttribute(i);if(i==="value"){let o=Os(t);s=As({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:o,value:s,maskInputFn:this.maskInputFn})}if(te(e.target,this.blockClass,this.blockSelector,!1)||s===e.oldValue)return;let n=this.attributeMap.get(e.target);if(t.tagName==="IFRAME"&&i==="src"&&!this.keepIframeSrcFn(s))if(!t.contentDocument)i="rr_src";else return;if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),i==="type"&&t.tagName==="INPUT"&&(e.oldValue||"").toLowerCase()==="password"&&t.setAttribute("data-rr-is-password","true"),!Ho(t.tagName,i))if(n.attributes[i]=zo(this.doc,Te(t.tagName),Te(i),s),i==="style"){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(a){this.unattachedDoc=this.doc}let o=this.unattachedDoc.createElement("span");e.oldValue&&o.setAttribute("style",e.oldValue);for(let a of Array.from(t.style)){let l=t.style.getPropertyValue(a),c=t.style.getPropertyPriority(a);l!==o.style.getPropertyValue(a)||c!==o.style.getPropertyPriority(a)?c===""?n.styleDiff[a]=l:n.styleDiff[a]=[l,c]:n._unchangedStyles[a]=[l,c]}for(let a of Array.from(o.style))t.style.getPropertyValue(a)===""&&(n.styleDiff[a]=!1)}else i==="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=>{let i=this.mirror.getId(t),s=gt(e.target)?this.mirror.getId(k.host(e.target)):this.mirror.getId(e.target);te(e.target,this.blockClass,this.blockSelector,!1)||yi(t,this.mirror,this.slimDOMOptions)||!gl(t,this.mirror)||(this.addedSet.has(t)?(vs(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&i===-1||ln(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[bo(i,s)]?vs(this.movedSet,t):(this.removes.push({parentId:s,id:i,isShadow:gt(e.target)&&yt(e.target)?!0:void 0}),vp(t,this.removesSubTreeCache))),this.mapRemoves.push(t))});break}}}),v(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!(this.addedSet.has(e)||this.movedSet.has(e))){if(this.mirror.hasNode(e)){if(yi(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let i=null;t&&this.mirror.hasNode(t)&&(i=this.mirror.getId(t)),i&&i!==-1&&(this.movedMap[bo(this.mirror.getId(e),i)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);te(e,this.blockClass,this.blockSelector,!1)||(k.childNodes(e).forEach(i=>this.genAdds(i)),xe(e)&&k.childNodes(k.shadowRoot(e)).forEach(i=>{this.processedNodeManager.add(i,this),this.genAdds(i,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()}};A=r=>vt?(...t)=>{try{return r(...t)}catch(i){if(vt&&vt(i)===!0)return;throw i}}:r,$e=[];Tp=["INPUT","TEXTAREA","SELECT"],Eo=new WeakMap;Ui=class{constructor(e){v(this,"iframeIdToRemoteIdMap",new WeakMap),v(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,i,s){let n=i||this.getIdToRemoteIdMap(e),o=s||this.getRemoteIdToIdMap(e),a=n.get(t);return a||(a=this.generateIdFn(),n.set(t,a),o.set(a,t)),a}getIds(e,t){let i=this.getIdToRemoteIdMap(e),s=this.getRemoteIdToIdMap(e);return t.map(n=>this.getId(e,n,i,s))}getRemoteId(e,t,i){let s=i||this.getRemoteIdToIdMap(e);if(typeof t!="number")return t;let n=s.get(t);return n||-1}getRemoteIds(e,t){let i=this.getRemoteIdToIdMap(e);return t.map(s=>this.getRemoteId(e,s,i))}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}},bs=class{constructor(e){v(this,"iframes",new WeakMap),v(this,"crossOriginIframeMap",new WeakMap),v(this,"crossOriginIframeMirror",new Ui(Wo)),v(this,"crossOriginIframeStyleMirror"),v(this,"crossOriginIframeRootIdMap",new WeakMap),v(this,"mirror"),v(this,"mutationCb"),v(this,"wrappedEmit"),v(this,"loadListener"),v(this,"stylesheetManager"),v(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Ui(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 i,s;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((i=e.contentWindow)==null||i.addEventListener("message",this.handleMessage.bind(this))),(s=this.loadListener)==null||s.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){let t=e;if(t.data.type!=="rrweb"||t.origin!==t.data.origin||!e.source)return;let s=this.crossOriginIframeMap.get(e.source);if(!s)return;let n=this.transformCrossOriginEvent(s,t.data.event);n&&this.wrappedEmit(n,t.data.isCheckout)}transformCrossOriginEvent(e,t){var i;switch(t.type){case x.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);let s=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,s),this.patchRootIdOnNode(t.data.node,s),{timestamp:t.timestamp,type:x.IncrementalSnapshot,data:{source:E.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case x.Meta:case x.Load:case x.DomContentLoaded:return!1;case x.Plugin:return t;case x.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case x.IncrementalSnapshot:switch(t.data.source){case E.Mutation:return t.data.adds.forEach(s=>{this.replaceIds(s,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,e);let n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(s.node,n)}),t.data.removes.forEach(s=>{this.replaceIds(s,e,["parentId","id"])}),t.data.attributes.forEach(s=>{this.replaceIds(s,e,["id"])}),t.data.texts.forEach(s=>{this.replaceIds(s,e,["id"])}),t;case E.Drag:case E.TouchMove:case E.MouseMove:return t.data.positions.forEach(s=>{this.replaceIds(s,e,["id"])}),t;case E.ViewportResize:return!1;case E.MediaInteraction:case E.MouseInteraction:case E.Scroll:case E.CanvasMutation:case E.Input:return this.replaceIds(t.data,e,["id"]),t;case E.StyleSheetRule:case E.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case E.Font:return t;case E.Selection:return t.data.ranges.forEach(s=>{this.replaceIds(s,e,["start","end"])}),t;case E.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),(i=t.data.styles)==null||i.forEach(s=>{this.replaceStyleIds(s,e,["styleId"])}),t}}return!1}replace(e,t,i,s){for(let n of s)!Array.isArray(t[n])&&typeof t[n]!="number"||(Array.isArray(t[n])?t[n]=e.getIds(i,t[n]):t[n]=e.getId(i,t[n]));return t}replaceIds(e,t,i){return this.replace(this.crossOriginIframeMirror,e,t,i)}replaceStyleIds(e,t,i){return this.replace(this.crossOriginIframeStyleMirror,e,t,i)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(i=>{this.replaceIdOnNode(i,t)})}patchRootIdOnNode(e,t){e.type!==ye.Document&&!e.rootId&&(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(i=>{this.patchRootIdOnNode(i,t)})}},Ss=class{constructor(e){v(this,"shadowDoms",new WeakSet),v(this,"mutationCb"),v(this,"scrollCb"),v(this,"bypassOptions"),v(this,"mirror"),v(this,"restoreHandlers",[]),this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!yt(e)||this.shadowDoms.has(e))return;this.shadowDoms.add(e);let i=Cl({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>i.disconnect()),this.restoreHandlers.push(El({...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(k.host(e))),this.restoreHandlers.push(xl({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){!e.contentWindow||!e.contentDocument||this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){let i=this;this.restoreHandlers.push(Fe(e.prototype,"attachShadow",function(s){return function(n){let o=s.call(this,n),a=k.shadowRoot(this);return a&&pn(this)&&i.addShadowRoot(a,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(t){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}},Ye="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",mt=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(pt=0;pt<Ye.length;pt++)mt[Ye.charCodeAt(pt)]=pt;Lp=function(r){var e=new Uint8Array(r),t,i=e.length,s="";for(t=0;t<i;t+=3)s+=Ye[e[t]>>2],s+=Ye[(e[t]&3)<<4|e[t+1]>>4],s+=Ye[(e[t+1]&15)<<2|e[t+2]>>6],s+=Ye[e[t+2]&63];return i%3===2?s=s.substring(0,s.length-1)+"=":i%3===1&&(s=s.substring(0,s.length-2)+"=="),s},_p=function(r){var e=r.length*.75,t=r.length,i,s=0,n,o,a,l;r[r.length-1]==="="&&(e--,r[r.length-2]==="="&&e--);var c=new ArrayBuffer(e),u=new Uint8Array(c);for(i=0;i<t;i+=4)n=mt[r.charCodeAt(i)],o=mt[r.charCodeAt(i+1)],a=mt[r.charCodeAt(i+2)],l=mt[r.charCodeAt(i+3)],u[s++]=n<<2|o>>4,u[s++]=(o&15)<<4|a>>2,u[s++]=(a&3)<<6|l&63;return c},xo=new Map;Il=(r,e,t)=>{if(!r||!(Ml(r,e)||typeof r=="object"))return;let i=r.constructor.name,s=Fp(t,i),n=s.indexOf(r);return n===-1&&(n=s.length,s.push(r)),n};Tl=(r,e,t)=>r.map(i=>wi(i,e,t)),Ml=(r,e)=>!!["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(s=>typeof e[s]=="function").find(s=>r instanceof e[s]);kl="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",zp=r=>Uint8Array.from(atob(r),e=>e.charCodeAt(0)),Mo=typeof window!="undefined"&&window.Blob&&new Blob([zp(kl)],{type:"text/javascript;charset=utf-8"});Cs=class{constructor(e){v(this,"pendingCanvasMutations",new Map),v(this,"rafStamps",{latestId:0,invokeId:null}),v(this,"mirror"),v(this,"mutationCb"),v(this,"resetObservers"),v(this,"frozen",!1),v(this,"locked",!1),v(this,"processMutation",(l,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(l)||this.pendingCanvasMutations.set(l,[]),this.pendingCanvasMutations.get(l).push(c)});let{sampling:t="all",win:i,blockClass:s,blockSelector:n,recordCanvas:o,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,o&&t==="all"&&this.initCanvasMutationObserver(i,s,n),o&&typeof t=="number"&&this.initCanvasFPSObserver(t,i,s,n,{dataURLOptions:a})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(e,t,i,s,n){let o=Io(t,i,s,!0),a=new Map,l=new Hp;l.onmessage=g=>{let{id:m}=g.data;if(a.set(m,!1),!("base64"in g.data))return;let{base64:f,type:y,width:b,height:w}=g.data;this.mutationCb({id:m,type:be["2D"],commands:[{property:"clearRect",args:[0,0,b,w]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:f}],type:y}]},0,0]}]})};let c=1e3/e,u=0,h,d=()=>{let g=[];return t.document.querySelectorAll("canvas").forEach(m=>{te(m,i,s,!0)||g.push(m)}),g},p=g=>{if(u&&g-u<c){h=requestAnimationFrame(p);return}u=g,d().forEach(async m=>{var f;let y=this.mirror.getId(m);if(a.get(y)||m.width===0||m.height===0)return;if(a.set(y,!0),["webgl","webgl2"].includes(m.__context)){let w=m.getContext(m.__context);((f=w==null?void 0:w.getContextAttributes())==null?void 0:f.preserveDrawingBuffer)===!1&&w.clear(w.COLOR_BUFFER_BIT)}let b=await createImageBitmap(m);l.postMessage({id:y,bitmap:b,width:m.width,height:m.height,dataURLOptions:n.dataURLOptions},[b])}),h=requestAnimationFrame(p)};h=requestAnimationFrame(p),this.resetObservers=()=>{o(),cancelAnimationFrame(h)}}initCanvasMutationObserver(e,t,i){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();let s=Io(e,t,i,!1),n=Up(this.processMutation.bind(this),e,t,i),o=Wp(this.processMutation.bind(this),e,t,i);this.resetObservers=()=>{s(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){let e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{let i=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,i)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;let i=this.pendingCanvasMutations.get(e);if(!i||t===-1)return;let s=i.map(o=>{let{type:a,...l}=o;return l}),{type:n}=i[0];this.mutationCb({id:t,type:n,commands:s}),this.pendingCanvasMutations.delete(e)}},Es=class{constructor(e){v(this,"trackedLinkElements",new WeakSet),v(this,"mutationCb"),v(this,"adoptedStyleSheetCb"),v(this,"styleMirror",new At),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(e.length===0)return;let i={id:t,styleIds:[]},s=[];for(let n of e){let o;this.styleMirror.has(n)?o=this.styleMirror.getId(n):(o=this.styleMirror.add(n),s.push({styleId:o,rules:Array.from(n.rules||CSSRule,(a,l)=>({rule:Fo(a,n.href),index:l}))})),i.styleIds.push(o)}s.length>0&&(i.styles=s),this.adoptedStyleSheetCb(i)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}},xs=class{constructor(){v(this,"nodeMap",new WeakMap),v(this,"active",!1)}inOtherBuffer(e,t){let i=this.nodeMap.get(e);return i&&Array.from(i).some(s=>s!==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(){}},Bi=!1;try{if(Array.from([1],r=>r*2)[0]!==2){let r=document.createElement("iframe");document.body.appendChild(r),Array.from=((Tn=r.contentWindow)==null?void 0:Tn.Array.from)||Array.from,document.body.removeChild(r)}}catch(r){console.debug("Unable to override Array.from",r)}le=Uo();Re.addCustomEvent=(r,e)=>{if(!Bi)throw new Error("please add custom event after start recording");Z({type:x.Custom,data:{tag:r,payload:e}})};Re.freezePage=()=>{$e.forEach(r=>r.freeze())};Re.takeFullSnapshot=r=>{if(!Bi)throw new Error("please take full snapshot after start recording");vi(r)};Re.mirror=le;Vp=Object.freeze(Object.defineProperty({__proto__:null,default:Rl},Symbol.toStringTag,{value:"Module"}));Is=class{constructor(e=[],t){v(this,"timeOffset",0),v(this,"speed"),v(this,"actions"),v(this,"raf",null),v(this,"lastTimestamp"),this.actions=e,this.speed=t.speed}addAction(e){let t=this.raf===!0;if(!this.actions.length||this.actions[this.actions.length-1].delay<=e.delay)this.actions.push(e);else{let i=this.findActionIndex(e);this.actions.splice(i,0,e)}t&&(this.raf=requestAnimationFrame(this.rafCheck.bind(this)))}start(){this.timeOffset=0,this.lastTimestamp=performance.now(),this.raf=requestAnimationFrame(this.rafCheck.bind(this))}rafCheck(){let e=performance.now();for(this.timeOffset+=(e-this.lastTimestamp)*this.speed,this.lastTimestamp=e;this.actions.length;){let t=this.actions[0];if(this.timeOffset>=t.delay)this.actions.shift(),t.doAction();else break}this.actions.length>0?this.raf=requestAnimationFrame(this.rafCheck.bind(this)):this.raf=!0}clear(){this.raf&&(this.raf!==!0&&cancelAnimationFrame(this.raf),this.raf=null),this.actions.length=0}setSpeed(e){this.speed=e}isActive(){return this.raf!==null}findActionIndex(e){let t=0,i=this.actions.length-1;for(;t<=i;){let s=Math.floor((t+i)/2);if(this.actions[s].delay<e.delay)t=s+1;else if(this.actions[s].delay>e.delay)i=s-1;else return s+1}return t}};(function(r){r[r.NotStarted=0]="NotStarted",r[r.Running=1]="Running",r[r.Stopped=2]="Stopped"})(Xe||(Xe={}));Nl={type:"xstate.init"};Do=function(r,e){return r.actions.forEach(function(t){var i=t.exec;return i&&i(r.context,e)})};Xp=r=>[`.${r} { background: currentColor }`,"noscript { display: none !important; }"],Po=new Map;Zp=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject"];Ms=class{constructor(e){v(this,"mediaMap",new Map),v(this,"warn"),v(this,"service"),v(this,"speedService"),v(this,"emitter"),v(this,"getCurrentTime"),v(this,"metadataCallbackMap",new Map),this.warn=e.warn,this.service=e.service,this.speedService=e.speedService,this.emitter=e.emitter,this.getCurrentTime=e.getCurrentTime,this.emitter.on(O.Start,this.start.bind(this)),this.emitter.on(O.SkipStart,this.start.bind(this)),this.emitter.on(O.Pause,this.pause.bind(this)),this.emitter.on(O.Finish,this.pause.bind(this)),this.speedService.subscribe(()=>{this.syncAllMediaElements()})}syncAllMediaElements(e={pause:!1}){this.mediaMap.forEach((t,i)=>{this.syncTargetWithState(i),e.pause&&i.pause()})}start(){this.syncAllMediaElements()}pause(){this.syncAllMediaElements({pause:!0})}seekTo({time:e,target:t,mediaState:i}){if(i.isPlaying){let n=(e-i.lastInteractionTimeOffset)/1e3*i.playbackRate,o="duration"in t&&t.duration;if(Number.isNaN(o)){this.waitForMetadata(t);return}let a=i.currentTimeAtLastInteraction+n;t.loop&&o!==!1&&(a=a%o),t.currentTime=a}else t.pause(),t.currentTime=i.currentTimeAtLastInteraction}waitForMetadata(e){if(this.metadataCallbackMap.has(e)||!("addEventListener"in e))return;let t=()=>{this.metadataCallbackMap.delete(e);let i=this.mediaMap.get(e);i&&this.seekTo({time:this.getCurrentTime(),target:e,mediaState:i})};this.metadataCallbackMap.set(e,t),e.addEventListener("loadedmetadata",t,{once:!0})}getMediaStateFromMutation({target:e,timeOffset:t,mutation:i}){var p,g,m,f,y;let s=this.mediaMap.get(e),{type:n,playbackRate:o,currentTime:a,muted:l,volume:c,loop:u}=i;return{isPlaying:n===Ee.Play||n!==Ee.Pause&&((s==null?void 0:s.isPlaying)||e.getAttribute("autoplay")!==null),currentTimeAtLastInteraction:(p=a!=null?a:s==null?void 0:s.currentTimeAtLastInteraction)!=null?p:0,lastInteractionTimeOffset:t,playbackRate:(g=o!=null?o:s==null?void 0:s.playbackRate)!=null?g:1,volume:(m=c!=null?c:s==null?void 0:s.volume)!=null?m:1,muted:(f=l!=null?l:s==null?void 0:s.muted)!=null?f:e.getAttribute("muted")===null,loop:(y=u!=null?u:s==null?void 0:s.loop)!=null?y:e.getAttribute("loop")===null}}syncTargetWithState(e){let t=this.mediaMap.get(e);if(!t)return;let{muted:i,loop:s,volume:n,isPlaying:o}=t,a=this.service.state.matches("paused"),l=t.playbackRate*this.speedService.state.context.timer.speed;try{this.seekTo({time:this.getCurrentTime(),target:e,mediaState:t}),e.volume!==n&&(e.volume=n),e.muted=i,e.loop=s,e.playbackRate!==l&&(e.playbackRate=l),o&&!a?e.play():e.pause()}catch(c){this.warn(`Failed to replay media interactions: ${c.message||c}`)}}addMediaElements(e,t,i){if(!["AUDIO","VIDEO"].includes(e.nodeName))return;let s=e,n=i.getMeta(s);if(!n||!("attributes"in n))return;let o=this.service.state.matches("paused"),a=n.attributes,l=!1;a.rr_mediaState?l=a.rr_mediaState==="played":l=s.getAttribute("autoplay")!==null,l&&o&&s.pause();let c=1;typeof a.rr_mediaPlaybackRate=="number"&&(c=a.rr_mediaPlaybackRate);let u=!1;typeof a.rr_mediaMuted=="boolean"?u=a.rr_mediaMuted:u=s.getAttribute("muted")!==null;let h=!1;typeof a.rr_mediaLoop=="boolean"?h=a.rr_mediaLoop:h=s.getAttribute("loop")!==null;let d=1;typeof a.rr_mediaVolume=="number"&&(d=a.rr_mediaVolume);let p=0;typeof a.rr_mediaCurrentTime=="number"&&(p=a.rr_mediaCurrentTime),this.mediaMap.set(s,{isPlaying:l,currentTimeAtLastInteraction:p,lastInteractionTimeOffset:t,playbackRate:c,volume:d,muted:u,loop:h}),this.syncTargetWithState(s)}mediaMutation({target:e,timeOffset:t,mutation:i}){this.mediaMap.set(e,this.getMediaStateFromMutation({target:e,timeOffset:t,mutation:i})),this.syncTargetWithState(e)}isSupportedMediaElement(e){return["AUDIO","VIDEO"].includes(e.nodeName)}reset(){this.mediaMap.clear()}};im=5*1e3,rm=Rl||Vp,$o="[replayer]",Tr={duration:500,lineCap:"round",lineWidth:3,strokeStyle:"red"};ks=class{constructor(e,t){if(v(this,"wrapper"),v(this,"iframe"),v(this,"service"),v(this,"speedService"),v(this,"config"),v(this,"usingVirtualDom",!1),v(this,"virtualDom",new st),v(this,"mouse"),v(this,"mouseTail",null),v(this,"tailPositions",[]),v(this,"emitter",rm()),v(this,"nextUserInteractionEvent"),v(this,"legacy_missingNodeRetryMap",{}),v(this,"cache",Zn()),v(this,"imageMap",new Map),v(this,"canvasEventMap",new Map),v(this,"mirror",Uo()),v(this,"styleMirror",new At),v(this,"mediaManager"),v(this,"firstFullSnapshot",null),v(this,"newDocumentQueue",[]),v(this,"mousePos",null),v(this,"touchActive",null),v(this,"lastMouseDownEvent",null),v(this,"lastHoveredRootNode"),v(this,"lastSelectionData",null),v(this,"constructedStyleMutations",[]),v(this,"adoptedStyleSheets",[]),v(this,"handleResize",a=>{this.iframe.style.display="inherit";for(let l of[this.mouseTail,this.iframe])l&&(l.setAttribute("width",String(a.width)),l.setAttribute("height",String(a.height)))}),v(this,"applyEventsSynchronously",a=>{for(let l of a){switch(l.type){case x.DomContentLoaded:case x.Load:case x.Custom:continue;case x.FullSnapshot:case x.Meta:case x.Plugin:case x.IncrementalSnapshot:break}this.getCastFn(l,!0)()}}),v(this,"getCastFn",(a,l=!1)=>{let c;switch(a.type){case x.DomContentLoaded:case x.Load:break;case x.Custom:c=()=>{this.emitter.emit(O.CustomEvent,a)};break;case x.Meta:c=()=>this.emitter.emit(O.Resize,{width:a.data.width,height:a.data.height});break;case x.FullSnapshot:c=()=>{var h;if(this.firstFullSnapshot){if(this.firstFullSnapshot===a){this.firstFullSnapshot=!0;return}}else this.firstFullSnapshot=!0;this.mediaManager.reset(),this.styleMirror.reset(),this.rebuildFullSnapshot(a,l),(h=this.iframe.contentWindow)==null||h.scrollTo(a.data.initialOffset)};break;case x.IncrementalSnapshot:c=()=>{if(this.applyIncremental(a,l),!l&&(a===this.nextUserInteractionEvent&&(this.nextUserInteractionEvent=null,this.backToNormal()),this.config.skipInactive&&!this.nextUserInteractionEvent)){for(let h of this.service.state.context.events)if(!(h.timestamp<=a.timestamp)&&this.isUserInteraction(h)){h.delay-a.delay>this.config.inactivePeriodThreshold*this.speedService.state.context.timer.speed&&(this.nextUserInteractionEvent=h);break}if(this.nextUserInteractionEvent){let h=this.nextUserInteractionEvent.delay-a.delay,d={speed:Math.min(Math.round(h/im),this.config.maxSpeed)};this.speedService.send({type:"FAST_FORWARD",payload:d}),this.emitter.emit(O.SkipStart,d)}}};break}return()=>{c&&c();for(let d of this.config.plugins||[])d.handler&&d.handler(a,l,{replayer:this});this.service.send({type:"CAST_EVENT",payload:{event:a}});let h=this.service.state.context.events.length-1;if(!this.config.liveMode&&a===this.service.state.context.events[h]){let d=()=>{h<this.service.state.context.events.length-1||(this.backToNormal(),this.service.send("END"),this.emitter.emit(O.Finish))},p=50;a.type===x.IncrementalSnapshot&&a.data.source===E.MouseMove&&a.data.positions.length&&(p+=Math.max(0,-a.data.positions[0].timeOffset)),setTimeout(d,p)}this.emitter.emit(O.EventCast,a)}}),!(t!=null&&t.liveMode)&&e.length<2)throw new Error("Replayer need at least 2 events.");let i={speed:1,maxSpeed:360,root:document.body,loadTimeout:0,skipInactive:!1,inactivePeriodThreshold:10*1e3,showWarning:!0,showDebug:!1,blockClass:"rr-block",liveMode:!1,insertStyleRules:[],triggerFocus:!0,UNSAFE_replayCanvas:!1,pauseAnimation:!0,mouseTail:Tr,useVirtualDom:!0,logger:console};this.config=Object.assign({},i,t),this.handleResize=this.handleResize.bind(this),this.getCastFn=this.getCastFn.bind(this),this.applyEventsSynchronously=this.applyEventsSynchronously.bind(this),this.emitter.on(O.Resize,this.handleResize),this.setupDom();for(let a of this.config.plugins||[])a.getMirror&&a.getMirror({nodeMirror:this.mirror});this.emitter.on(O.Flush,()=>{if(this.usingVirtualDom){let a={mirror:this.mirror,applyCanvas:(l,c,u)=>{Ts({event:l,mutation:c,target:u,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})},applyInput:this.applyInput.bind(this),applyScroll:this.applyScroll.bind(this),applyStyleSheetMutation:(l,c)=>{l.source===E.StyleSheetRule?this.applyStyleSheetRule(l,c):l.source===E.StyleDeclaration&&this.applyStyleDeclaration(l,c)},afterAppend:(l,c)=>{for(let u of this.config.plugins||[])u.onBuild&&u.onBuild(l,{id:c,replayer:this})}};if(this.iframe.contentDocument)try{Pi(this.iframe.contentDocument,this.virtualDom,a,this.virtualDom.mirror)}catch(l){console.warn(l)}if(this.virtualDom.destroyTree(),this.usingVirtualDom=!1,Object.keys(this.legacy_missingNodeRetryMap).length)for(let l in this.legacy_missingNodeRetryMap)try{let c=this.legacy_missingNodeRetryMap[l],u=$i(c.node,this.mirror,this.virtualDom.mirror);Pi(u,c.node,a,this.virtualDom.mirror),c.node=u}catch(c){this.warn(c)}this.constructedStyleMutations.forEach(l=>{this.applyStyleSheetMutation(l)}),this.constructedStyleMutations=[],this.adoptedStyleSheets.forEach(l=>{this.applyAdoptedStyleSheet(l)}),this.adoptedStyleSheets=[]}if(this.mousePos&&(this.moveAndHover(this.mousePos.x,this.mousePos.y,this.mousePos.id,!0,this.mousePos.debugData),this.mousePos=null),this.touchActive===!0?this.mouse.classList.add("touch-active"):this.touchActive===!1&&this.mouse.classList.remove("touch-active"),this.touchActive=null,this.lastMouseDownEvent){let[a,l]=this.lastMouseDownEvent;a.dispatchEvent(l)}this.lastMouseDownEvent=null,this.lastSelectionData&&(this.applySelection(this.lastSelectionData),this.lastSelectionData=null)}),this.emitter.on(O.PlayBack,()=>{this.firstFullSnapshot=null,this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset()});let s=new Is([],{speed:this.config.speed});this.service=Kp({events:e.map(a=>t&&t.unpackFn?t.unpackFn(a):a).sort((a,l)=>a.timestamp-l.timestamp),timer:s,timeOffset:0,baselineTime:0,lastPlayedEvent:null},{getCastFn:this.getCastFn,applyEventsSynchronously:this.applyEventsSynchronously,emitter:this.emitter}),this.service.start(),this.service.subscribe(a=>{this.emitter.emit(O.StateChange,{player:a})}),this.speedService=Yp({normalSpeed:-1,timer:s}),this.speedService.start(),this.speedService.subscribe(a=>{this.emitter.emit(O.StateChange,{speed:a})}),this.mediaManager=new Ms({warn:this.warn.bind(this),service:this.service,speedService:this.speedService,emitter:this.emitter,getCurrentTime:this.getCurrentTime.bind(this)});let n=this.service.state.context.events.find(a=>a.type===x.Meta),o=this.service.state.context.events.find(a=>a.type===x.FullSnapshot);if(n){let{width:a,height:l}=n.data;setTimeout(()=>{this.emitter.emit(O.Resize,{width:a,height:l})},0)}o&&setTimeout(()=>{var a;this.firstFullSnapshot||(this.firstFullSnapshot=o,this.rebuildFullSnapshot(o),(a=this.iframe.contentWindow)==null||a.scrollTo(o.data.initialOffset))},1),this.service.state.context.events.find(Lo)&&this.mouse.classList.add("touch-device")}get timer(){return this.service.state.context.timer}on(e,t){return this.emitter.on(e,t),this}off(e,t){return this.emitter.off(e,t),this}setConfig(e){Object.keys(e).forEach(t=>{e[t],this.config[t]=e[t]}),this.config.skipInactive||this.backToNormal(),typeof e.speed!="undefined"&&this.speedService.send({type:"SET_SPEED",payload:{speed:e.speed}}),typeof e.mouseTail!="undefined"&&(e.mouseTail===!1?this.mouseTail&&(this.mouseTail.style.display="none"):(this.mouseTail||(this.mouseTail=document.createElement("canvas"),this.mouseTail.width=Number.parseFloat(this.iframe.width),this.mouseTail.height=Number.parseFloat(this.iframe.height),this.mouseTail.classList.add("replayer-mouse-tail"),this.wrapper.insertBefore(this.mouseTail,this.iframe)),this.mouseTail.style.display="inherit"))}getMetaData(){let e=this.service.state.context.events[0],t=this.service.state.context.events[this.service.state.context.events.length-1];return{startTime:e.timestamp,endTime:t.timestamp,totalTime:t.timestamp-e.timestamp}}getCurrentTime(){return this.timer.timeOffset+this.getTimeOffset()}getTimeOffset(){let{baselineTime:e,events:t}=this.service.state.context;return e-t[0].timestamp}getMirror(){return this.mirror}play(e=0){var t,i;this.service.state.matches("paused")?this.service.send({type:"PLAY",payload:{timeOffset:e}}):(this.service.send({type:"PAUSE"}),this.service.send({type:"PLAY",payload:{timeOffset:e}})),(i=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||i.classList.remove("rrweb-paused"),this.emitter.emit(O.Start)}pause(e){var t,i;e===void 0&&this.service.state.matches("playing")&&this.service.send({type:"PAUSE"}),typeof e=="number"&&(this.play(e),this.service.send({type:"PAUSE"})),(i=(t=this.iframe.contentDocument)==null?void 0:t.getElementsByTagName("html")[0])==null||i.classList.add("rrweb-paused"),this.emitter.emit(O.Pause)}resume(e=0){this.warn("The 'resume' was deprecated in 1.0. Please use 'play' method which has the same interface."),this.play(e),this.emitter.emit(O.Resume)}destroy(){this.pause(),this.mirror.reset(),this.styleMirror.reset(),this.mediaManager.reset(),this.config.root.removeChild(this.wrapper),this.emitter.emit(O.Destroy)}startLive(e){this.service.send({type:"TO_LIVE",payload:{baselineTime:e}})}addEvent(e){let t=this.config.unpackFn?this.config.unpackFn(e):e;Lo(t)&&this.mouse.classList.add("touch-device"),Promise.resolve().then(()=>this.service.send({type:"ADD_EVENT",payload:{event:t}}))}enableInteract(){this.iframe.setAttribute("scrolling","auto"),this.iframe.style.pointerEvents="auto"}disableInteract(){this.iframe.setAttribute("scrolling","no"),this.iframe.style.pointerEvents="none"}resetCache(){this.cache=Zn()}setupDom(){this.wrapper=document.createElement("div"),this.wrapper.classList.add("replayer-wrapper"),this.config.root.appendChild(this.wrapper),this.mouse=document.createElement("div"),this.mouse.classList.add("replayer-mouse"),this.wrapper.appendChild(this.mouse),this.config.mouseTail!==!1&&(this.mouseTail=document.createElement("canvas"),this.mouseTail.classList.add("replayer-mouse-tail"),this.mouseTail.style.display="inherit",this.wrapper.appendChild(this.mouseTail)),this.iframe=document.createElement("iframe");let e=["allow-same-origin"];this.config.UNSAFE_replayCanvas&&e.push("allow-scripts"),this.iframe.style.display="none",this.iframe.setAttribute("sandbox",e.join(" ")),this.disableInteract(),this.wrapper.appendChild(this.iframe),this.iframe.contentWindow&&this.iframe.contentDocument&&(Gp(this.iframe.contentWindow,this.iframe.contentDocument),cn(this.iframe.contentWindow))}rebuildFullSnapshot(e,t=!1){if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");Object.keys(this.legacy_missingNodeRetryMap).length&&this.warn("Found unresolved missing node map",this.legacy_missingNodeRetryMap),this.legacy_missingNodeRetryMap={};let i=[],s=new Set,n=(l,c)=>{if(l.nodeName==="DIALOG"&&s.add(l),this.collectIframeAndAttachDocument(i,l),this.mediaManager.isSupportedMediaElement(l)){let{events:u}=this.service.state.context;this.mediaManager.addMediaElements(l,e.timestamp-u[0].timestamp,this.mirror)}for(let u of this.config.plugins||[])u.onBuild&&u.onBuild(l,{id:c,replayer:this})};this.usingVirtualDom&&(this.virtualDom.destroyTree(),this.usingVirtualDom=!1),this.mirror.reset(),Kh(e.data.node,{doc:this.iframe.contentDocument,afterAppend:n,cache:this.cache,mirror:this.mirror}),n(this.iframe.contentDocument,e.data.node.id);for(let{mutationInQueue:l,builtNode:c}of i)this.attachDocumentToIframe(l,c),this.newDocumentQueue=this.newDocumentQueue.filter(u=>u!==l);let{documentElement:o,head:a}=this.iframe.contentDocument;this.insertStyleRules(o,a),s.forEach(l=>di(l)),this.service.state.matches("playing")||this.iframe.contentDocument.getElementsByTagName("html")[0].classList.add("rrweb-paused"),this.emitter.emit(O.FullsnapshotRebuilded,e),t||this.waitForStylesheetLoad(),this.config.UNSAFE_replayCanvas&&this.preloadAllImages()}insertStyleRules(e,t){var i;let s=Xp(this.config.blockClass).concat(this.config.insertStyleRules);if(this.config.pauseAnimation&&s.push("html.rrweb-paused *, html.rrweb-paused *:before, html.rrweb-paused *:after { animation-play-state: paused !important; }"),!!s.length)if(this.usingVirtualDom){let n=this.virtualDom.createElement("style");this.virtualDom.mirror.add(n,fl(n,this.virtualDom.unserializedId)),e.insertBefore(n,t),n.rules.push({source:E.StyleSheetRule,adds:s.map((o,a)=>({rule:o,index:a}))})}else{let n=document.createElement("style");e.insertBefore(n,t);for(let o=0;o<s.length;o++)(i=n.sheet)==null||i.insertRule(s[o],o)}}attachDocumentToIframe(e,t){let i=this.usingVirtualDom?this.virtualDom.mirror:this.mirror,s=[],n=new Set,o=(a,l)=>{a.nodeName==="DIALOG"&&n.add(a),this.collectIframeAndAttachDocument(s,a);let c=i.getMeta(a);if((c==null?void 0:c.type)===ye.Element&&(c==null?void 0:c.tagName.toUpperCase())==="HTML"){let{documentElement:u,head:h}=t.contentDocument;this.insertStyleRules(u,h)}if(!this.usingVirtualDom)for(let u of this.config.plugins||[])u.onBuild&&u.onBuild(a,{id:l,replayer:this})};wt(e.node,{doc:t.contentDocument,mirror:i,hackCss:!0,skipChild:!1,afterAppend:o,cache:this.cache}),o(t.contentDocument,e.node.id);for(let{mutationInQueue:a,builtNode:l}of s)this.attachDocumentToIframe(a,l),this.newDocumentQueue=this.newDocumentQueue.filter(c=>c!==a);n.forEach(a=>di(a))}collectIframeAndAttachDocument(e,t){if(Je(t,this.mirror)){let i=this.newDocumentQueue.find(s=>s.parentId===this.mirror.getId(t));i&&e.push({mutationInQueue:i,builtNode:t})}}waitForStylesheetLoad(){var e;let t=(e=this.iframe.contentDocument)==null?void 0:e.head;if(t){let i=new Set,s,n=this.service.state,o=()=>{n=this.service.state};this.emitter.on(O.Start,o),this.emitter.on(O.Pause,o);let a=()=>{this.emitter.off(O.Start,o),this.emitter.off(O.Pause,o)};t.querySelectorAll('link[rel="stylesheet"]').forEach(l=>{l.sheet||(i.add(l),l.addEventListener("load",()=>{i.delete(l),i.size===0&&s!==-1&&(n.matches("playing")&&this.play(this.getCurrentTime()),this.emitter.emit(O.LoadStylesheetEnd),s&&clearTimeout(s),a())}))}),i.size>0&&(this.service.send({type:"PAUSE"}),this.emitter.emit(O.LoadStylesheetStart),s=setTimeout(()=>{n.matches("playing")&&this.play(this.getCurrentTime()),s=-1,a()},this.config.loadTimeout))}}async preloadAllImages(){let e=[];for(let t of this.service.state.context.events)t.type===x.IncrementalSnapshot&&t.data.source===E.CanvasMutation&&(e.push(this.deserializeAndPreloadCanvasEvents(t.data,t)),("commands"in t.data?t.data.commands:[t.data]).forEach(s=>{this.preloadImages(s,t)}));return Promise.all(e)}preloadImages(e,t){if(e.property==="drawImage"&&typeof e.args[0]=="string"&&!this.imageMap.has(t)){let i=document.createElement("canvas"),s=i.getContext("2d"),n=s==null?void 0:s.createImageData(i.width,i.height);s==null||s.putImageData(n,0,0)}}async deserializeAndPreloadCanvasEvents(e,t){if(!this.canvasEventMap.has(t)){let i={isUnchanged:!0};if("commands"in e){let s=await Promise.all(e.commands.map(async n=>{let o=await Promise.all(n.args.map(Ie(this.imageMap,null,i)));return{...n,args:o}}));i.isUnchanged===!1&&this.canvasEventMap.set(t,{...e,commands:s})}else{let s=await Promise.all(e.args.map(Ie(this.imageMap,null,i)));i.isUnchanged===!1&&this.canvasEventMap.set(t,{...e,args:s})}}}applyIncremental(e,t){var i,s,n;let{data:o}=e;switch(o.source){case E.Mutation:{try{this.applyMutation(o,t)}catch(a){this.warn(`Exception in mutation ${a.message||a}`,o)}break}case E.Drag:case E.TouchMove:case E.MouseMove:if(t){let a=o.positions[o.positions.length-1];this.mousePos={x:a.x,y:a.y,id:a.id,debugData:o}}else o.positions.forEach(a=>{let l={doAction:()=>{this.moveAndHover(a.x,a.y,a.id,t,o)},delay:a.timeOffset+e.timestamp-this.service.state.context.baselineTime};this.timer.addAction(l)}),this.timer.addAction({doAction(){},delay:e.delay-((i=o.positions[0])==null?void 0:i.timeOffset)});break;case E.MouseInteraction:{if(o.id===-1)break;let a=new Event(Te(D[o.type])),l=this.mirror.getNode(o.id);if(!l)return this.debugNodeNotFound(o,o.id);this.emitter.emit(O.MouseInteraction,{type:o.type,target:l});let{triggerFocus:c}=this.config;switch(o.type){case D.Blur:"blur"in l&&l.blur();break;case D.Focus:c&&l.focus&&l.focus({preventScroll:!0});break;case D.Click:case D.TouchStart:case D.TouchEnd:case D.MouseDown:case D.MouseUp:t?(o.type===D.TouchStart?this.touchActive=!0:o.type===D.TouchEnd&&(this.touchActive=!1),o.type===D.MouseDown?this.lastMouseDownEvent=[l,a]:o.type===D.MouseUp&&(this.lastMouseDownEvent=null),this.mousePos={x:o.x||0,y:o.y||0,id:o.id,debugData:o}):(o.type===D.TouchStart&&(this.tailPositions.length=0),this.moveAndHover(o.x||0,o.y||0,o.id,t,o),o.type===D.Click?(this.mouse.classList.remove("active"),this.mouse.offsetWidth,this.mouse.classList.add("active")):o.type===D.TouchStart?(this.mouse.offsetWidth,this.mouse.classList.add("touch-active")):o.type===D.TouchEnd?this.mouse.classList.remove("touch-active"):l.dispatchEvent(a));break;case D.TouchCancel:t?this.touchActive=!1:this.mouse.classList.remove("touch-active");break;default:l.dispatchEvent(a)}break}case E.Scroll:{if(o.id===-1)break;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);a.scrollData=o;break}this.applyScroll(o,t);break}case E.ViewportResize:this.emitter.emit(O.Resize,{width:o.width,height:o.height});break;case E.Input:{if(o.id===-1)break;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);a.inputData=o;break}this.applyInput(o);break}case E.MediaInteraction:{let a=this.usingVirtualDom?this.virtualDom.mirror.getNode(o.id):this.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);let l=a,{events:c}=this.service.state.context;this.mediaManager.mediaMutation({target:l,timeOffset:e.timestamp-c[0].timestamp,mutation:o});break}case E.StyleSheetRule:case E.StyleDeclaration:{this.usingVirtualDom?o.styleId?this.constructedStyleMutations.push(o):o.id&&((s=this.virtualDom.mirror.getNode(o.id))==null||s.rules.push(o)):this.applyStyleSheetMutation(o);break}case E.CanvasMutation:{if(!this.config.UNSAFE_replayCanvas)return;if(this.usingVirtualDom){let a=this.virtualDom.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);a.canvasMutations.push({event:e,mutation:o})}else{let a=this.mirror.getNode(o.id);if(!a)return this.debugNodeNotFound(o,o.id);Ts({event:e,mutation:o,target:a,imageMap:this.imageMap,canvasEventMap:this.canvasEventMap,errorHandler:this.warnCanvasMutationFailed.bind(this)})}break}case E.Font:{try{let a=new FontFace(o.family,o.buffer?new Uint8Array(JSON.parse(o.fontSource)):o.fontSource,o.descriptors);(n=this.iframe.contentDocument)==null||n.fonts.add(a)}catch(a){this.warn(a)}break}case E.Selection:{if(t){this.lastSelectionData=o;break}this.applySelection(o);break}case E.AdoptedStyleSheet:{this.usingVirtualDom?this.adoptedStyleSheets.push(o):this.applyAdoptedStyleSheet(o);break}}}applyMutation(e,t){if(this.config.useVirtualDom&&!this.usingVirtualDom&&t&&(this.usingVirtualDom=!0,sp(this.iframe.contentDocument,this.mirror,this.virtualDom),Object.keys(this.legacy_missingNodeRetryMap).length))for(let c in this.legacy_missingNodeRetryMap)try{let u=this.legacy_missingNodeRetryMap[c],h=dl(u.node,this.virtualDom,this.mirror);h&&(u.node=h)}catch(u){this.warn(u)}let i=this.usingVirtualDom?this.virtualDom.mirror:this.mirror;e.removes=e.removes.filter(c=>i.getNode(c.id)?!0:(this.warnNodeNotFound(e,c.id),!1)),e.removes.forEach(c=>{var u;let h=i.getNode(c.id);if(!h)return;let d=i.getNode(c.parentId);if(!d)return this.warnNodeNotFound(e,c.parentId);if(c.isShadow&&xe(d)&&(d=d.shadowRoot),i.removeNodeFromMap(h),d)try{d.removeChild(h),this.usingVirtualDom&&h.nodeName==="#text"&&d.nodeName==="STYLE"&&((u=d.rules)==null?void 0:u.length)>0&&(d.rules=[])}catch(p){if(p instanceof DOMException)this.warn("parent could not remove child in mutation",d,h,e);else throw p}});let s={...this.legacy_missingNodeRetryMap},n=[],o=c=>{let u=null;return c.nextId&&(u=i.getNode(c.nextId)),c.nextId!==null&&c.nextId!==void 0&&c.nextId!==-1&&!u},a=c=>{var u,h;if(!this.iframe.contentDocument)return this.warn("Looks like your replayer has been destroyed.");let d=i.getNode(c.parentId);if(!d)return c.node.type===ye.Document?this.newDocumentQueue.push(c):n.push(c);c.node.isShadow&&(xe(d)||d.attachShadow({mode:"open"}),d=d.shadowRoot);let p=null,g=null;if(c.previousId&&(p=i.getNode(c.previousId)),c.nextId&&(g=i.getNode(c.nextId)),o(c))return n.push(c);if(c.node.rootId&&!i.getNode(c.node.rootId))return;let m=c.node.rootId?i.getNode(c.node.rootId):this.usingVirtualDom?this.virtualDom:this.iframe.contentDocument;if(Je(d,i)){this.attachDocumentToIframe(c,d);return}let f=(w,S)=>{if(!this.usingVirtualDom){di(w);for(let I of this.config.plugins||[])I.onBuild&&I.onBuild(w,{id:S,replayer:this})}},y=wt(c.node,{doc:m,mirror:i,skipChild:!0,hackCss:!0,cache:this.cache,afterAppend:f});if(c.previousId===-1||c.nextId===-1){s[c.node.id]={node:y,mutation:c};return}let b=i.getMeta(d);if(b&&b.type===ye.Element&&c.node.type===ye.Text){let w=Array.isArray(d.childNodes)?d.childNodes:Array.from(d.childNodes);if(b.tagName==="textarea")for(let S of w)S.nodeType===d.TEXT_NODE&&d.removeChild(S);else if(b.tagName==="style"&&w.length===1)for(let S of w)S.nodeType===d.TEXT_NODE&&!i.hasNode(S)&&(y.textContent=S.textContent,d.removeChild(S))}else if((b==null?void 0:b.type)===ye.Document){let w=d;c.node.type===ye.DocumentType&&((u=w.childNodes[0])==null?void 0:u.nodeType)===Node.DOCUMENT_TYPE_NODE&&w.removeChild(w.childNodes[0]),y.nodeName==="HTML"&&w.documentElement&&w.removeChild(w.documentElement)}if(p&&p.nextSibling&&p.nextSibling.parentNode?d.insertBefore(y,p.nextSibling):g&&g.parentNode?d.contains(g)?d.insertBefore(y,g):d.insertBefore(y,null):d.appendChild(y),f(y,c.node.id),this.usingVirtualDom&&y.nodeName==="#text"&&d.nodeName==="STYLE"&&((h=d.rules)==null?void 0:h.length)>0&&(d.rules=[]),Je(y,this.mirror)){let w=this.mirror.getId(y),S=this.newDocumentQueue.find(I=>I.parentId===w);S&&(this.attachDocumentToIframe(S,y),this.newDocumentQueue=this.newDocumentQueue.filter(I=>I!==S))}(c.previousId||c.nextId)&&this.legacy_resolveMissingNode(s,d,y,c)};e.adds.forEach(c=>{a(c)});let l=Date.now();for(;n.length;){let c=yl(n);if(n.length=0,Date.now()-l>500){this.warn("Timeout in the loop, please check the resolve tree data:",c);break}for(let u of c)i.getNode(u.value.parentId)?un(u,d=>{a(d)}):this.debug("Drop resolve tree since there is no parent for the root node.",u)}Object.keys(s).length&&Object.assign(this.legacy_missingNodeRetryMap,s),wl(e.texts).forEach(c=>{var u;let h=i.getNode(c.id);if(!h)return e.removes.find(p=>p.id===c.id)?void 0:this.warnNodeNotFound(e,c.id);let d=h.parentElement;if(c.value&&d&&d.tagName==="STYLE"?h.textContent=Ki(c.value,this.cache):h.textContent=c.value,this.usingVirtualDom){let p=h.parentNode;((u=p==null?void 0:p.rules)==null?void 0:u.length)>0&&(p.rules=[])}}),e.attributes.forEach(c=>{var u;let h=i.getNode(c.id);if(!h)return e.removes.find(d=>d.id===c.id)?void 0:this.warnNodeNotFound(e,c.id);for(let d in c.attributes)if(typeof d=="string"){let p=c.attributes[d];if(p===null)h.removeAttribute(d),d==="open"&&tm(h,c);else if(typeof p=="string")try{if(d==="_cssText"&&(h.nodeName==="LINK"||h.nodeName==="STYLE"))try{let g=i.getMeta(h);Object.assign(g.attributes,c.attributes);let m=wt(g,{doc:h.ownerDocument,mirror:i,skipChild:!0,hackCss:!0,cache:this.cache}),f=h.nextSibling,y=h.parentNode;if(m&&y){y.removeChild(h),y.insertBefore(m,f),i.replace(c.id,m);break}}catch(g){}if(d==="value"&&h.nodeName==="TEXTAREA"){let g=h;g.childNodes.forEach(f=>g.removeChild(f));let m=(u=h.ownerDocument)==null?void 0:u.createTextNode(p);m&&g.appendChild(m)}else h.setAttribute(d,p);d==="rr_open_mode"&&h.nodeName==="DIALOG"&&di(h,c)}catch(g){this.warn("An error occurred may due to the checkout feature.",g)}else if(d==="style"){let g=p,m=h;for(let f in g)if(g[f]===!1)m.style.removeProperty(f);else if(g[f]instanceof Array){let y=g[f];m.style.setProperty(f,y[0],y[1])}else{let y=g[f];m.style.setProperty(f,y)}}}})}applyScroll(e,t){var i,s;let n=this.mirror.getNode(e.id);if(!n)return this.debugNodeNotFound(e,e.id);let o=this.mirror.getMeta(n);if(n===this.iframe.contentDocument)(i=this.iframe.contentWindow)==null||i.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else if((o==null?void 0:o.type)===ye.Document)(s=n.defaultView)==null||s.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"});else try{n.scrollTo({top:e.y,left:e.x,behavior:t?"auto":"smooth"})}catch(a){}}applyInput(e){let t=this.mirror.getNode(e.id);if(!t)return this.debugNodeNotFound(e,e.id);try{t.checked=e.isChecked,t.value=e.text}catch(i){}}applySelection(e){try{let t=new Set,i=e.ranges.map(({start:s,startOffset:n,end:o,endOffset:a})=>{let l=this.mirror.getNode(s),c=this.mirror.getNode(o);if(!l||!c)return;let u=new Range;u.setStart(l,n),u.setEnd(c,a);let h=l.ownerDocument,d=h==null?void 0:h.getSelection();return d&&t.add(d),{range:u,selection:d}});t.forEach(s=>s.removeAllRanges()),i.forEach(s=>{var n;return s&&((n=s.selection)==null?void 0:n.addRange(s.range))})}catch(t){}}applyStyleSheetMutation(e){var t;let i=null;e.styleId?i=this.styleMirror.getStyle(e.styleId):e.id&&(i=((t=this.mirror.getNode(e.id))==null?void 0:t.sheet)||null),i&&(e.source===E.StyleSheetRule?this.applyStyleSheetRule(e,i):e.source===E.StyleDeclaration&&this.applyStyleDeclaration(e,i))}applyStyleSheetRule(e,t){var i,s,n,o;if((i=e.adds)==null||i.forEach(({rule:a,index:l})=>{try{if(Array.isArray(l)){let{positions:c,index:u}=gs(l);Ke(t.cssRules,c).insertRule(a,u)}else{let c=l===void 0?void 0:Math.min(l,t.cssRules.length);t==null||t.insertRule(a,c)}}catch(c){}}),(s=e.removes)==null||s.forEach(({index:a})=>{try{if(Array.isArray(a)){let{positions:l,index:c}=gs(a);Ke(t.cssRules,l).deleteRule(c||0)}else t==null||t.deleteRule(a)}catch(l){}}),e.replace)try{(n=t.replace)==null||n.call(t,e.replace)}catch(a){}if(e.replaceSync)try{(o=t.replaceSync)==null||o.call(t,e.replaceSync)}catch(a){}}applyStyleDeclaration(e,t){e.set&&Ke(t.rules,e.index).style.setProperty(e.set.property,e.set.value,e.set.priority),e.remove&&Ke(t.rules,e.index).style.removeProperty(e.remove.property)}applyAdoptedStyleSheet(e){var t;let i=this.mirror.getNode(e.id);if(!i)return;(t=e.styles)==null||t.forEach(a=>{var l;let c=null,u=null;if(xe(i)?u=((l=i.ownerDocument)==null?void 0:l.defaultView)||null:i.nodeName==="#document"&&(u=i.defaultView),!!u)try{c=new u.CSSStyleSheet,this.styleMirror.add(c,a.styleId),this.applyStyleSheetRule({source:E.StyleSheetRule,adds:a.rules},c)}catch(h){}});let s=10,n=0,o=(a,l)=>{let c=l.map(u=>this.styleMirror.getStyle(u)).filter(u=>u!==null);xe(a)?a.shadowRoot.adoptedStyleSheets=c:a.nodeName==="#document"&&(a.adoptedStyleSheets=c),c.length!==l.length&&n<s&&(setTimeout(()=>o(a,l),0+100*n),n++)};o(i,e.styleIds)}legacy_resolveMissingNode(e,t,i,s){let{previousId:n,nextId:o}=s,a=n&&e[n],l=o&&e[o];if(a){let{node:c,mutation:u}=a;t.insertBefore(c,i),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}if(l){let{node:c,mutation:u}=l;t.insertBefore(c,i.nextSibling),delete e[u.node.id],delete this.legacy_missingNodeRetryMap[u.node.id],(u.previousId||u.nextId)&&this.legacy_resolveMissingNode(e,t,c,u)}}moveAndHover(e,t,i,s,n){let o=this.mirror.getNode(i);if(!o)return this.debugNodeNotFound(n,i);let a=dn(o,this.iframe),l=e*a.absoluteScale+a.x,c=t*a.absoluteScale+a.y;this.mouse.style.left=`${l}px`,this.mouse.style.top=`${c}px`,s||this.drawMouseTail({x:l,y:c}),this.hoverElements(o)}drawMouseTail(e){if(!this.mouseTail)return;let{lineCap:t,lineWidth:i,strokeStyle:s,duration:n}=this.config.mouseTail===!0?Tr:Object.assign({},Tr,this.config.mouseTail),o=()=>{if(!this.mouseTail)return;let a=this.mouseTail.getContext("2d");!a||!this.tailPositions.length||(a.clearRect(0,0,this.mouseTail.width,this.mouseTail.height),a.beginPath(),a.lineWidth=i,a.lineCap=t,a.strokeStyle=s,a.moveTo(this.tailPositions[0].x,this.tailPositions[0].y),this.tailPositions.forEach(l=>a.lineTo(l.x,l.y)),a.stroke())};this.tailPositions.push(e),o(),setTimeout(()=>{this.tailPositions=this.tailPositions.filter(a=>a!==e),o()},n/this.speedService.state.context.timer.speed)}hoverElements(e){var t;(t=this.lastHoveredRootNode||this.iframe.contentDocument)==null||t.querySelectorAll(".\\:hover").forEach(s=>{s.classList.remove(":hover")}),this.lastHoveredRootNode=e.getRootNode();let i=e;for(;i;)i.classList&&i.classList.add(":hover"),i=i.parentElement}isUserInteraction(e){return e.type!==x.IncrementalSnapshot?!1:e.data.source>E.Mutation&&e.data.source<=E.Input}backToNormal(){this.nextUserInteractionEvent=null,!this.speedService.state.matches("normal")&&(this.speedService.send({type:"BACK_TO_NORMAL"}),this.emitter.emit(O.SkipEnd,{speed:this.speedService.state.context.normalSpeed}))}warnNodeNotFound(e,t){this.warn(`Node with id '${t}' not found. `,e)}warnCanvasMutationFailed(e,t){this.warn("Has error on canvas update",t,"canvas mutation:",e)}debugNodeNotFound(e,t){this.debug(`Node with id '${t}' not found. `,e)}warn(...e){this.config.showWarning&&this.config.logger.warn($o,...e)}debug(...e){this.config.showDebug&&this.config.logger.log($o,...e)}},{addCustomEvent:sm}=Re,{freezePage:nm}=Re,{takeFullSnapshot:om}=Re});var mm={};En(mm,{default:()=>pm});function or(){let r=Date.now().toString(36),e=Math.random().toString(36).substring(2,15);return`rec_${r}_${e}`}function ar(){return typeof window=="undefined"?{userAgent:"unknown",screenWidth:0,screenHeight:0,viewportWidth:0,viewportHeight:0,devicePixelRatio:1,language:"en",platform:"unknown"}:{userAgent:navigator.userAgent,screenWidth:screen.width,screenHeight:screen.height,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,devicePixelRatio:window.devicePixelRatio||1,language:navigator.language,platform:navigator.platform}}var Ql={maskAllInputs:!0,maskAllText:!1,maskSelectors:[".sensitive","[data-sensitive]",".pii","[data-pii]"],blockSelectors:[".no-record","[data-no-record]"],maskInputTypes:["password","email","tel","credit-card"],maskCharacter:"*"},ec={batchEvents:!0,batchSize:50,batchTimeout:5e3,compress:!0,mouseMoveThrottle:50,maxDuration:1800*1e3},tc={console:!0,network:!1,performance:!1,errors:!0,customEvents:!0};function lr(r){var e,t,i,s,n,o;return{enabled:(e=r==null?void 0:r.enabled)!=null?e:!1,samplingRate:(t=r==null?void 0:r.samplingRate)!=null?t:1,privacy:{...Ql,...r==null?void 0:r.privacy},performance:{...ec,...r==null?void 0:r.performance},capture:{...tc,...r==null?void 0:r.capture},endpoint:(i=r==null?void 0:r.endpoint)!=null?i:"",onStart:(s=r==null?void 0:r.onStart)!=null?s:(()=>{}),onStop:(n=r==null?void 0:r.onStop)!=null?n:(()=>{}),onError:(o=r==null?void 0:r.onError)!=null?o:(()=>{})}}function cr(r){return r>=1?!0:r<=0?!1:Math.random()<r}function ur(r){try{let e=JSON.stringify(r);return typeof btoa!="undefined"?btoa(encodeURIComponent(e)):e}catch(e){return console.warn("[Recording] Failed to compress events:",e),JSON.stringify(r)}}function Ht(){return typeof window!="undefined"&&typeof document!="undefined"}function In(){return Ht()?window.location.href:""}var at=class{constructor(e){this.state="idle";this.sessionId=null;this.sdkSessionToken=null;this.apiUrl="";this.sdkKey=null;this.stopRecording=null;this.events=[];this.eventCount=0;this.batchIndex=0;this.batchesSent=0;this.errorCount=0;this.startTime=null;this.batchTimeout=null;this.maxDurationTimeout=null;this.consoleCleanup=null;this.errorCleanup=null;this.config=lr(e)}initialize(e,t,i){this.sdkSessionToken=e,this.apiUrl=t,this.sdkKey=i||null}updateConfig(e){this.config=lr({...this.config,...e})}async start(){var e,t,i,s;if(!Ht())return console.warn("[Recording] Cannot record outside browser environment"),null;if(!this.config.enabled)return null;if(this.state==="recording")return console.warn("[Recording] Already recording"),this.sessionId;if(!cr(this.config.samplingRate))return console.log("[Recording] Session not sampled for recording"),null;try{let n=await Promise.resolve().then(()=>(Ll(),$l));this.sessionId=or(),this.events=[],this.eventCount=0,this.batchIndex=0,this.batchesSent=0,this.errorCount=0,this.startTime=new Date,this.state="recording";let o={emit:a=>this.handleEvent(a),maskAllInputs:this.config.privacy.maskAllInputs,maskTextSelector:((e=this.config.privacy.maskSelectors)==null?void 0:e.join(","))||void 0,blockSelector:((t=this.config.privacy.blockSelectors)==null?void 0:t.join(","))||void 0,maskInputOptions:{password:!0,email:(i=this.config.privacy.maskInputTypes)==null?void 0:i.includes("email"),tel:(s=this.config.privacy.maskInputTypes)==null?void 0:s.includes("tel")},sampling:{mousemove:!0,mouseInteraction:!0,scroll:150,media:800,input:"last"}};return this.stopRecording=n.record(o),this.config.capture.console&&this.setupConsoleCapture(),this.config.capture.errors&&this.setupErrorCapture(),this.config.performance.maxDuration&&(this.maxDurationTimeout=setTimeout(()=>{console.log("[Recording] Max duration reached, stopping"),this.stop()},this.config.performance.maxDuration)),await this.sendSessionStart(),this.config.onStart(this.sessionId),console.log("[Recording] Started session:",this.sessionId),this.sessionId}catch(n){return console.error("[Recording] Failed to start:",n),this.state="idle",this.config.onError(n instanceof Error?n:new Error(String(n))),null}}async stop(){if(!(this.state!=="recording"&&this.state!=="paused"))try{this.stopRecording&&(this.stopRecording(),this.stopRecording=null),this.consoleCleanup&&(this.consoleCleanup(),this.consoleCleanup=null),this.errorCleanup&&(this.errorCleanup(),this.errorCleanup=null),this.batchTimeout&&(clearTimeout(this.batchTimeout),this.batchTimeout=null),this.maxDurationTimeout&&(clearTimeout(this.maxDurationTimeout),this.maxDurationTimeout=null),this.events.length>0&&await this.sendBatch(!0),await this.sendSessionEnd();let e=this.sessionId,t=this.eventCount;this.state="stopped",this.config.onStop(e||"",t),console.log("[Recording] Stopped session:",e,"Events:",t)}catch(e){console.error("[Recording] Error stopping:",e),this.config.onError(e instanceof Error?e:new Error(String(e)))}}pause(){this.state==="recording"&&(this.state="paused",console.log("[Recording] Paused"))}resume(){this.state==="paused"&&(this.state="recording",console.log("[Recording] Resumed"))}addCustomEvent(e){if(this.state!=="recording"||!this.config.capture.customEvents)return;let t={type:5,data:{tag:"custom",payload:e},timestamp:e.timestamp||Date.now()};this.handleEvent(t)}getStats(){let e=this.startTime?Date.now()-this.startTime.getTime():0;return{state:this.state,sessionId:this.sessionId,eventCount:this.eventCount,startTime:this.startTime,duration:e,batchesSent:this.batchesSent,errors:this.errorCount}}isRecording(){return this.state==="recording"}getSessionId(){return this.sessionId}handleEvent(e){this.state==="recording"&&(this.events.push(e),this.eventCount++,this.config.performance.batchEvents?this.events.length>=this.config.performance.batchSize?this.sendBatch():this.batchTimeout||(this.batchTimeout=setTimeout(()=>{this.batchTimeout=null,this.events.length>0&&this.sendBatch()},this.config.performance.batchTimeout)):this.sendBatch())}async sendBatch(e=!1){if(this.events.length===0)return;let t=[...this.events];this.events=[];let i={sessionId:this.sessionId,sdkSessionToken:this.sdkSessionToken,events:t,timestamp:new Date().toISOString(),batchIndex:this.batchIndex++,isFinal:e};try{let s=this.config.endpoint||`${this.apiUrl}/session-recordings/events`,n={"Content-Type":"application/json"};this.sdkKey&&(n["X-SDK-Key"]=this.sdkKey);let o=this.config.performance.compress?JSON.stringify({...i,events:void 0,compressedEvents:ur(t)}):JSON.stringify(i);await fetch(s,{method:"POST",headers:n,body:o}),this.batchesSent++}catch(s){console.error("[Recording] Failed to send batch:",s),this.errorCount++,this.events=[...t,...this.events]}}async sendSessionStart(){let e={id:this.sessionId,sdkSessionToken:this.sdkSessionToken,startUrl:In(),startTime:this.startTime,deviceInfo:ar()};try{let t=`${this.apiUrl}/session-recordings/start`,i={"Content-Type":"application/json"};this.sdkKey&&(i["X-SDK-Key"]=this.sdkKey),await fetch(t,{method:"POST",headers:i,body:JSON.stringify(e)})}catch(t){console.error("[Recording] Failed to send session start:",t)}}async sendSessionEnd(){try{let e=`${this.apiUrl}/session-recordings/end`,t={"Content-Type":"application/json"};this.sdkKey&&(t["X-SDK-Key"]=this.sdkKey),await fetch(e,{method:"POST",headers:t,body:JSON.stringify({sessionId:this.sessionId,endTime:new Date().toISOString(),eventCount:this.eventCount})})}catch(e){console.error("[Recording] Failed to send session end:",e)}}setupConsoleCapture(){let e={log:console.log,info:console.info,warn:console.warn,error:console.error,debug:console.debug},t=i=>(...s)=>{var o;if(e[i](...s),(o=s[0])!=null&&o.toString().includes("[Recording]"))return;let n={level:i,message:s.map(a=>typeof a=="object"?JSON.stringify(a):String(a)).join(" "),timestamp:Date.now()};this.addCustomEvent({type:"console",data:n})};console.log=t("log"),console.info=t("info"),console.warn=t("warn"),console.error=t("error"),console.debug=t("debug"),this.consoleCleanup=()=>{console.log=e.log,console.info=e.info,console.warn=e.warn,console.error=e.error,console.debug=e.debug}}setupErrorCapture(){let e=i=>{let s={type:"error",message:i.message,filename:i.filename,lineno:i.lineno,colno:i.colno,timestamp:Date.now()};this.addCustomEvent({type:"error",data:s})},t=i=>{var n,o;let s={type:"unhandledrejection",message:((n=i.reason)==null?void 0:n.message)||String(i.reason),stack:(o=i.reason)==null?void 0:o.stack,timestamp:Date.now()};this.addCustomEvent({type:"error",data:s})};window.addEventListener("error",e),window.addEventListener("unhandledrejection",t),this.errorCleanup=()=>{window.removeEventListener("error",e),window.removeEventListener("unhandledrejection",t)}}destroy(){this.stop(),this.sessionId=null,this.sdkSessionToken=null,this.events=[]}};var Qi=class{constructor(e,t){this.isTracking=!1;this.scrollDepth=0;this.pageLoadTime=0;this.clickCount=0;this.lastActivityTime=0;this.currentUrl="";this.previousUrl="";this.triggeredSet=new Set;this.lastTriggerTime=0;this.proactiveMessageCount=0;this.scrollHandler=null;this.clickHandler=null;this.mouseMoveHandler=null;this.mouseLeaveHandler=null;this.visibilityHandler=null;this.timeCheckInterval=null;this.idleCheckInterval=null;this.config=e,this.callbacks=t}start(){!this.config.enabled||this.isTracking||typeof window!="undefined"&&(this.config.respectUserPreference&&localStorage.getItem("produck_proactive_optout")==="true"||(this.isTracking=!0,this.pageLoadTime=Date.now(),this.lastActivityTime=Date.now(),this.currentUrl=window.location.href,this.setupScrollTracking(),this.setupClickTracking(),this.setupIdleTracking(),this.setupExitIntentTracking(),this.setupTimeTracking(),this.setupPageChangeTracking(),console.log("[Produck] Proactive behavior tracking started")))}stop(){this.isTracking&&(this.isTracking=!1,this.scrollHandler&&window.removeEventListener("scroll",this.scrollHandler),this.clickHandler&&document.removeEventListener("click",this.clickHandler),this.mouseMoveHandler&&document.removeEventListener("mousemove",this.mouseMoveHandler),this.mouseLeaveHandler&&document.removeEventListener("mouseleave",this.mouseLeaveHandler),this.visibilityHandler&&document.removeEventListener("visibilitychange",this.visibilityHandler),this.timeCheckInterval&&clearInterval(this.timeCheckInterval),this.idleCheckInterval&&clearInterval(this.idleCheckInterval),console.log("[Produck] Proactive behavior tracking stopped"))}reset(){this.scrollDepth=0,this.clickCount=0,this.pageLoadTime=Date.now(),this.lastActivityTime=Date.now()}getStats(){return{scrollDepth:this.scrollDepth,timeOnPage:Date.now()-this.pageLoadTime,clickCount:this.clickCount,idleTime:Date.now()-this.lastActivityTime,proactiveMessageCount:this.proactiveMessageCount}}shouldTrigger(e){if(this.config.maxProactiveMessages&&this.proactiveMessageCount>=this.config.maxProactiveMessages||this.config.globalCooldown&&Date.now()-this.lastTriggerTime<this.config.globalCooldown)return!1;let t=`${e.type}-${e.threshold||"default"}`;if(e.onlyOnce&&this.triggeredSet.has(t))return!1;let i=`${t}-lastTime`,s=parseInt(sessionStorage.getItem(i)||"0",10);return!(e.cooldown&&Date.now()-s<e.cooldown)}fireTrigger(e,t){if(!this.shouldTrigger(e))return;let i=`${e.type}-${e.threshold||"default"}`,s=`${i}-lastTime`;this.triggeredSet.add(i),this.lastTriggerTime=Date.now(),this.proactiveMessageCount++,sessionStorage.setItem(s,Date.now().toString());let n=e.message||this.getDefaultMessage(e.type,t);this.callbacks.onTrigger(t,n),this.callbacks.onMessage&&this.callbacks.onMessage(n),console.log("[Produck] Proactive trigger fired:",e.type,t)}getDefaultMessage(e,t){switch(e){case"scroll":return"I see you're exploring the page! Is there something specific you're looking for?";case"time":return"You've been here a while. Would you like some help finding what you need?";case"clicks":return"Looks like you're navigating around. Can I help you find something?";case"idle":return"Still there? Let me know if you have any questions!";case"exit":return"Wait! Before you go, is there anything I can help you with?";case"pageChange":return"I see you're exploring different pages. Need any guidance?";default:return"How can I help you today?"}}setupScrollTracking(){let e=this.config.triggers.filter(t=>t.type==="scroll"&&t.enabled);e.length!==0&&(this.scrollHandler=()=>{let t=document.documentElement.scrollHeight-window.innerHeight,i=t>0?window.scrollY/t*100:0;this.scrollDepth=Math.max(this.scrollDepth,i),this.lastActivityTime=Date.now(),e.forEach(s=>{s.threshold&&this.scrollDepth>=s.threshold&&this.fireTrigger(s,{triggerType:"scroll",scrollDepth:this.scrollDepth,currentUrl:window.location.href,pageTitle:document.title})})},window.addEventListener("scroll",this.scrollHandler,{passive:!0}))}setupClickTracking(){let e=this.config.triggers.filter(t=>t.type==="clicks"&&t.enabled);e.length!==0&&(this.clickHandler=()=>{this.clickCount++,this.lastActivityTime=Date.now(),e.forEach(t=>{t.threshold&&this.clickCount>=t.threshold&&this.fireTrigger(t,{triggerType:"clicks",clickCount:this.clickCount,currentUrl:window.location.href,pageTitle:document.title})})},document.addEventListener("click",this.clickHandler))}setupIdleTracking(){let e=this.config.triggers.filter(t=>t.type==="idle"&&t.enabled);e.length!==0&&(this.mouseMoveHandler=()=>{this.lastActivityTime=Date.now()},document.addEventListener("mousemove",this.mouseMoveHandler,{passive:!0}),this.idleCheckInterval=setInterval(()=>{let t=Date.now()-this.lastActivityTime;e.forEach(i=>{i.threshold&&t>=i.threshold&&this.fireTrigger(i,{triggerType:"idle",idleTime:t,currentUrl:window.location.href,pageTitle:document.title})})},1e3))}setupExitIntentTracking(){let e=this.config.triggers.filter(t=>t.type==="exit"&&t.enabled);e.length!==0&&(this.mouseLeaveHandler=t=>{t.clientY<=0&&e.forEach(i=>{this.fireTrigger(i,{triggerType:"exit",currentUrl:window.location.href,pageTitle:document.title})})},document.addEventListener("mouseleave",this.mouseLeaveHandler))}setupTimeTracking(){let e=this.config.triggers.filter(t=>t.type==="time"&&t.enabled);e.length!==0&&(this.timeCheckInterval=setInterval(()=>{let t=Date.now()-this.pageLoadTime;e.forEach(i=>{i.threshold&&t>=i.threshold&&this.fireTrigger(i,{triggerType:"time",timeOnPage:t,currentUrl:window.location.href,pageTitle:document.title})})},1e3))}setupPageChangeTracking(){let e=this.config.triggers.filter(t=>t.type==="pageChange"&&t.enabled);e.length!==0&&(this.visibilityHandler=()=>{if(document.visibilityState==="visible"){let t=window.location.href;t!==this.currentUrl&&(this.previousUrl=this.currentUrl,this.currentUrl=t,this.scrollDepth=0,this.clickCount=0,this.pageLoadTime=Date.now(),e.forEach(i=>{this.fireTrigger(i,{triggerType:"pageChange",currentUrl:this.currentUrl,previousUrl:this.previousUrl,pageTitle:document.title})}))}},document.addEventListener("visibilitychange",this.visibilityHandler),window.addEventListener("popstate",()=>{let t=window.location.href;t!==this.currentUrl&&(this.previousUrl=this.currentUrl,this.currentUrl=t,e.forEach(i=>{this.fireTrigger(i,{triggerType:"pageChange",currentUrl:this.currentUrl,previousUrl:this.previousUrl,pageTitle:document.title})}))}))}triggerManual(e,t){this.proactiveMessageCount++,this.lastTriggerTime=Date.now();let i={triggerType:"time",currentUrl:window.location.href,pageTitle:document.title,...t};this.callbacks.onTrigger(i,e),this.callbacks.onMessage&&this.callbacks.onMessage(e)}optOut(){typeof localStorage!="undefined"&&localStorage.setItem("produck_proactive_optout","true"),this.stop()}optIn(){typeof localStorage!="undefined"&&localStorage.removeItem("produck_proactive_optout"),this.start()}};function Se(){return typeof window!="undefined"&&typeof document!="undefined"}function mn(){return"ufs_"+Date.now().toString(36)+"_"+Math.random().toString(36).substring(2,11)}function Ne(){return Se()?window.location.href:""}function Ue(){return Se()?window.location.pathname:""}function Be(){return Se()&&document.title||""}function gn(r=1){return Math.random()<r}function yn(){if(!Se())return{deviceType:"desktop",browser:"unknown",os:"unknown",viewportWidth:0,viewportHeight:0,userAgent:""};let r=navigator.userAgent,e="desktop";/Mobi|Android/i.test(r)&&(e=/Tablet|iPad/i.test(r)?"tablet":"mobile");let t="unknown";r.includes("Firefox")?t="Firefox":r.includes("Edg")?t="Edge":r.includes("Chrome")?t="Chrome":r.includes("Safari")?t="Safari":(r.includes("Opera")||r.includes("OPR"))&&(t="Opera");let i="unknown";return r.includes("Windows")?i="Windows":r.includes("Mac OS")?i="macOS":r.includes("Linux")?i="Linux":r.includes("Android")?i="Android":(r.includes("iOS")||r.includes("iPhone")||r.includes("iPad"))&&(i="iOS"),{deviceType:e,browser:t,os:i,viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,userAgent:r}}function _l(r,e=5){let t=[],i=r,s=0;for(;i&&i!==document.body&&s<e;){let n=i.tagName.toLowerCase();if(i.id){n+=`#${i.id}`,t.unshift(n);break}if(i.className&&typeof i.className=="string"){let a=i.className.trim().split(/\s+/);a.length>0&&a[0]&&(n+=`.${a[0]}`)}let o=i.parentElement;if(o){let a=Array.from(o.children).filter(l=>l.tagName===i.tagName);if(a.length>1){let l=a.indexOf(i)+1;n+=`:nth-child(${l})`}}t.unshift(n),i=i.parentElement,s++}return t.join(" > ")}function Fl(r){if(!r)return"";if(r.id)return`//*[@id="${r.id}"]`;let e=[],t=r;for(;t&&t.nodeType===Node.ELEMENT_NODE;){let i=0,s=t.previousElementSibling;for(;s;)s.tagName===t.tagName&&i++,s=s.previousElementSibling;let n=t.tagName.toLowerCase(),o=i>0?`${n}[${i+1}]`:n;e.unshift(o),t=t.parentElement}return"/"+e.join("/")}function er(r,e={}){let t=(e==null?void 0:e.maxTextLength)||100,i=(e==null?void 0:e.maxHtmlLength)||500,s=(e==null?void 0:e.selectorDepth)||5,n="";r instanceof HTMLElement&&(n=r.innerText||r.textContent||"",n=n.trim().substring(0,t),n.length===t&&(n+="..."));let o;(e==null?void 0:e.captureHtml)!==!1&&(o=r.outerHTML.substring(0,i),o.length===i&&(o+="..."));let a=r.getBoundingClientRect(),l={tag:r.tagName.toLowerCase(),selector:_l(r,s)};return r.id&&(l.id=r.id),r.className&&typeof r.className=="string"&&(l.className=r.className),n&&(l.text=n),r instanceof HTMLAnchorElement&&r.href&&(l.href=r.href),l.xpath=Fl(r),l.rect={x:Math.round(a.x),y:Math.round(a.y),width:Math.round(a.width),height:Math.round(a.height)},o&&(l.html=o),l}function Ft(r,e){return!e||e.length===0?!1:e.some(t=>{try{return r.matches(t)||r.closest(t)!==null}catch(i){return!1}})}function Ul(r){try{if(typeof window=="undefined")return;let e=r,t=window.getComputedStyle(e);return{backgroundColor:t.backgroundColor,color:t.color,fontSize:t.fontSize,fontWeight:t.fontWeight,borderRadius:t.borderRadius,border:t.border,boxShadow:t.boxShadow,padding:t.padding}}catch(e){return}}async function Bl(r,e=200){try{if(typeof window=="undefined")return;let t=window.html2canvas;if(!t)try{return(await(await import("html2canvas")).default(r,{scale:.5,width:e,height:e,useCORS:!0,logging:!1})).toDataURL("image/jpeg",.7)}catch(s){console.debug("[UserFlow] html2canvas not available for screenshots");return}return(await t(r,{scale:.5,width:e,height:e,useCORS:!0,logging:!1})).toDataURL("image/jpeg",.7)}catch(t){console.debug("[UserFlow] Failed to capture screenshot:",t);return}}function wn(r){var t,i,s,n,o,a;let e={enabled:!1,samplingRate:1,events:{clicks:!0,navigation:!0,formSubmit:!0,inputs:!1,scroll:!1,ignoreSelectors:[],trackOnlySelectors:[]},element:{captureVisualStyles:!0,captureScreenshot:!1,screenshotMaxSize:200,captureHtml:!0,maxHtmlLength:500,maxTextLength:100,selectorDepth:5},performance:{batchEvents:!0,batchSize:10,batchTimeout:5e3,clickDebounce:500},session:{endOnHidden:!0,inactivityTimeout:3e5,endOnExternalNavigation:!0,autoRestart:!0},endpoint:"",onStart:()=>{},onStop:()=>{},onError:()=>{}};return r?{enabled:(t=r.enabled)!=null?t:e.enabled,samplingRate:(i=r.samplingRate)!=null?i:e.samplingRate,events:{...e.events,...r.events},element:{...e.element,...r.element},performance:{...e.performance,...r.performance},session:{...e.session,...r.session},endpoint:(s=r.endpoint)!=null?s:e.endpoint,onStart:(n=r.onStart)!=null?n:e.onStart,onStop:(o=r.onStop)!=null?o:e.onStop,onError:(a=r.onError)!=null?a:e.onError}:e}var lt=class{constructor(e){this.state="idle";this.sessionId=null;this.sdkSessionToken=null;this.apiUrl="";this.sdkKey=null;this.user=null;this.events=[];this.eventCount=0;this.batchIndex=0;this.batchesSent=0;this.pageCount=0;this.startTime=null;this.batchTimeout=null;this.inactivityTimeout=null;this.lastActivityTime=Date.now();this.lastClickTime=0;this.lastClickElement=null;this.currentPath="";this.visitedPaths=new Set;this.clickHandler=null;this.navigationHandler=null;this.formSubmitHandler=null;this.beforeUnloadHandler=null;this.visibilityHandler=null;this.linkedRecordingSessionId=null;this.config=wn(e)}initialize(e,t,i){this.sdkSessionToken=e,this.apiUrl=t,this.sdkKey=i||null}updateConfig(e){this.config=wn({...this.config,...e})}identify(e){this.user=e,this.state==="tracking"&&this.sessionId&&this.sendIdentificationUpdate().catch(t=>{console.error("[UserFlow] Failed to send identification update:",t)})}async start(e){if(!Se())return console.warn("[UserFlow] Cannot track outside browser environment"),null;if(!this.config.enabled)return null;if(this.state==="tracking")return console.warn("[UserFlow] Already tracking"),this.sessionId;if(!gn(this.config.samplingRate))return console.log("[UserFlow] Session not sampled for tracking"),null;try{return this.sessionId=mn(),this.linkedRecordingSessionId=e||null,this.events=[],this.eventCount=0,this.batchIndex=0,this.batchesSent=0,this.pageCount=1,this.startTime=new Date,this.currentPath=Ue(),this.visitedPaths=new Set([this.currentPath]),this.state="tracking",this.setupEventListeners(),await this.sendSessionStart(),this.addEvent({eventType:"navigation",eventOrder:0,timestamp:new Date().toISOString(),pageUrl:Ne(),pageTitle:Be(),pagePath:this.currentPath}),this.config.onStart(this.sessionId),console.log("[UserFlow] Started tracking session:",this.sessionId),this.sessionId}catch(t){return console.error("[UserFlow] Failed to start tracking:",t),this.state="idle",this.config.onError(t instanceof Error?t:new Error(String(t))),null}}async stop(){if(!(this.state!=="tracking"&&this.state!=="paused"))try{this.removeEventListeners(),this.batchTimeout&&(clearTimeout(this.batchTimeout),this.batchTimeout=null),this.inactivityTimeout&&(clearTimeout(this.inactivityTimeout),this.inactivityTimeout=null),this.events.length>0&&await this.sendEventBatch(!0),await this.sendSessionEnd(),this.state="stopped";let e=this.eventCount,t=this.sessionId;this.sessionId=null,this.events=[],this.eventCount=0,this.startTime=null,this.config.onStop(t,e),console.log("[UserFlow] Stopped tracking session:",t)}catch(e){console.error("[UserFlow] Error stopping tracking:",e),this.state="stopped",this.config.onError(e instanceof Error?e:new Error(String(e)))}}pause(){this.state==="tracking"&&(this.state="paused",console.log("[UserFlow] Tracking paused"))}resume(){this.state==="paused"&&(this.state="tracking",console.log("[UserFlow] Tracking resumed"))}getStats(){return{sessionId:this.sessionId,state:this.state,eventCount:this.eventCount,pageCount:this.pageCount,batchesSent:this.batchesSent,duration:this.startTime?Date.now()-this.startTime.getTime():0,startTime:this.startTime}}getState(){return this.state}isTracking(){return this.state==="tracking"}addCustomEvent(e){this.state==="tracking"&&this.addEvent({eventType:"custom",eventOrder:this.eventCount,timestamp:new Date().toISOString(),pageUrl:Ne(),pageTitle:Be(),pagePath:Ue(),metadata:e})}setupEventListeners(){if(Se()){if(this.config.events.clicks&&(this.clickHandler=e=>this.handleClick(e),document.addEventListener("click",this.clickHandler,{capture:!0,passive:!0})),this.config.events.navigation){this.navigationHandler=()=>this.handleNavigation(),window.addEventListener("popstate",this.navigationHandler);let e=history.pushState,t=history.replaceState;history.pushState=(...i)=>{e.apply(history,i),this.handleNavigation()},history.replaceState=(...i)=>{t.apply(history,i),this.handleNavigation()}}this.config.events.formSubmit&&(this.formSubmitHandler=e=>this.handleFormSubmit(e),document.addEventListener("submit",this.formSubmitHandler,{capture:!0})),this.beforeUnloadHandler=()=>{this.events.length>0&&this.sendEventBatchSync(!0),this.sendSessionEndSync()},window.addEventListener("beforeunload",this.beforeUnloadHandler),this.visibilityHandler=()=>{document.visibilityState==="hidden"?(this.events.length>0&&this.sendEventBatch(!0).catch(console.error),this.config.session.endOnHidden&&this.stop().catch(console.error)):document.visibilityState==="visible"&&this.config.session.autoRestart&&this.state==="stopped"&&this.start().catch(console.error)},document.addEventListener("visibilitychange",this.visibilityHandler),this.resetInactivityTimeout()}}removeEventListeners(){Se()&&(this.clickHandler&&(document.removeEventListener("click",this.clickHandler,{capture:!0}),this.clickHandler=null),this.navigationHandler&&(window.removeEventListener("popstate",this.navigationHandler),this.navigationHandler=null),this.formSubmitHandler&&(document.removeEventListener("submit",this.formSubmitHandler,{capture:!0}),this.formSubmitHandler=null),this.beforeUnloadHandler&&(window.removeEventListener("beforeunload",this.beforeUnloadHandler),this.beforeUnloadHandler=null),this.visibilityHandler&&(document.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=null))}async handleClick(e){if(this.state!=="tracking")return;let t=e.target;if(!t||!(t instanceof Element)||this.config.events.ignoreSelectors&&this.config.events.ignoreSelectors.length>0&&Ft(t,this.config.events.ignoreSelectors)||this.config.events.trackOnlySelectors&&this.config.events.trackOnlySelectors.length>0&&!Ft(t,this.config.events.trackOnlySelectors))return;let i=Date.now();if(this.lastClickElement===t&&i-this.lastClickTime<this.config.performance.clickDebounce)return;this.lastClickTime=i,this.lastClickElement=t;let s=er(t,this.config.element);if(this.config.element.captureVisualStyles&&(s.visualStyles=Ul(t)),this.config.element.captureScreenshot)try{s.screenshot=await Bl(t,this.config.element.screenshotMaxSize)}catch(o){}let n={eventType:"click",eventOrder:this.eventCount,timestamp:new Date().toISOString(),pageUrl:Ne(),pageTitle:Be(),pagePath:Ue(),element:s,clickX:Math.round(e.pageX),clickY:Math.round(e.pageY),viewportX:Math.round(e.clientX),viewportY:Math.round(e.clientY)};this.addEvent(n)}handleNavigation(){if(this.state!=="tracking")return;let e=Ue();if(e===this.currentPath)return;this.currentPath=e,this.visitedPaths.has(e)||(this.visitedPaths.add(e),this.pageCount++);let t={eventType:"navigation",eventOrder:this.eventCount,timestamp:new Date().toISOString(),pageUrl:Ne(),pageTitle:Be(),pagePath:e};this.addEvent(t)}handleFormSubmit(e){if(this.state!=="tracking")return;let t=e.target;if(!t||!(t instanceof HTMLFormElement)||this.config.events.ignoreSelectors&&Ft(t,this.config.events.ignoreSelectors))return;let i=er(t,this.config.element),s={eventType:"form_submit",eventOrder:this.eventCount,timestamp:new Date().toISOString(),pageUrl:Ne(),pageTitle:Be(),pagePath:Ue(),element:i,metadata:{action:t.action,method:t.method,name:t.name}};this.addEvent(s)}addEvent(e){this.events.push(e),this.eventCount++,this.resetInactivityTimeout(),this.config.performance.batchEvents&&this.events.length>=this.config.performance.batchSize?this.sendEventBatch(!1).catch(console.error):this.batchTimeout||(this.batchTimeout=setTimeout(()=>{this.batchTimeout=null,this.events.length>0&&this.sendEventBatch(!1).catch(console.error)},this.config.performance.batchTimeout))}async sendSessionStart(){var n;let e=this.config.endpoint||`${this.apiUrl}/user-flows/session/start`,t=yn(),i={sessionId:this.sessionId,sdkSessionToken:this.sdkSessionToken,startUrl:Ne(),startTime:(n=this.startTime)==null?void 0:n.toISOString(),user:this.user,device:t,linkedRecordingSessionId:this.linkedRecordingSessionId},s=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...this.sdkKey?{"X-SDK-Key":this.sdkKey}:{}},body:JSON.stringify(i)});if(!s.ok)throw new Error(`Failed to start session: ${s.status}`)}async sendEventBatch(e){if(this.events.length===0)return;let t=[...this.events];this.events=[];let i=this.config.endpoint?`${this.config.endpoint}/events`:`${this.apiUrl}/user-flows/session/events`,s={sessionId:this.sessionId,events:t,batchIndex:this.batchIndex++,timestamp:new Date().toISOString(),isFinal:e};try{(await fetch(i,{method:"POST",headers:{"Content-Type":"application/json",...this.sdkKey?{"X-SDK-Key":this.sdkKey}:{}},body:JSON.stringify(s)})).ok&&this.batchesSent++}catch(n){console.error("[UserFlow] Failed to send event batch:",n),this.events=[...t,...this.events]}}sendEventBatchSync(e){if(this.events.length===0)return;let t=this.config.endpoint?`${this.config.endpoint}/events`:`${this.apiUrl}/user-flows/session/events`,i={sessionId:this.sessionId,events:this.events,batchIndex:this.batchIndex++,timestamp:new Date().toISOString(),isFinal:e};if(navigator.sendBeacon){let s=new Blob([JSON.stringify(i)],{type:"application/json"});navigator.sendBeacon(t,s),this.events=[]}}async sendSessionEnd(){let e=this.config.endpoint?`${this.config.endpoint}/end`:`${this.apiUrl}/user-flows/session/end`,t={sessionId:this.sessionId,endTime:new Date().toISOString(),eventCount:this.eventCount,status:"completed"};try{await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...this.sdkKey?{"X-SDK-Key":this.sdkKey}:{}},body:JSON.stringify(t)})}catch(i){console.error("[UserFlow] Failed to send session end:",i)}}sendSessionEndSync(){let e=this.config.endpoint?`${this.config.endpoint}/end`:`${this.apiUrl}/user-flows/session/end`,t={sessionId:this.sessionId,endTime:new Date().toISOString(),eventCount:this.eventCount,status:"completed"};if(navigator.sendBeacon){let i=new Blob([JSON.stringify(t)],{type:"application/json"});navigator.sendBeacon(e,i)}}resetInactivityTimeout(){this.inactivityTimeout&&(clearTimeout(this.inactivityTimeout),this.inactivityTimeout=null),this.lastActivityTime=Date.now();let e=this.config.session.inactivityTimeout;e&&e>0&&(this.inactivityTimeout=setTimeout(()=>{this.state==="tracking"&&(console.log("[UserFlow] Session ended due to inactivity"),this.stop().catch(console.error))},e))}async sendIdentificationUpdate(){if(!this.sessionId||!this.user)return;let e=this.config.endpoint?`${this.config.endpoint}/identify`:`${this.apiUrl}/user-flows/session/identify`,t={sessionId:this.sessionId,user:this.user};await fetch(e,{method:"PATCH",headers:{"Content-Type":"application/json",...this.sdkKey?{"X-SDK-Key":this.sdkKey}:{}},body:JSON.stringify(t)})}};var tr=class{constructor(e){this.actions=new Map;this.eventListeners=new Map;this.sessionToken=null;this.isReady=!1;this.recorder=null;this.proactiveTracker=null;this.userFlowTracker=null;let t=e.apiUrl;t||(typeof window!="undefined"?t=window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"?"http://localhost:4001/api/v1":`${window.location.protocol}//${window.location.host}/api/v1`:t="http://localhost:4001/api/v1"),this.config={apiUrl:t,...e}}async init(){var e,t,i;await this.log("info","SDK Initializing",{apiUrl:this.config.apiUrl,hasSDKKey:!!this.config.sdkKey,hasGuiderId:!!this.config.guiderId});try{let s;if(this.config.sdkKey)s=`${this.config.apiUrl}/sdk/session`,await this.log("info","Using SDK key authentication");else if(this.config.guiderId)s=`${this.config.apiUrl}/chat/${this.config.guiderId}/session`,await this.log("info","Using guider ID authentication");else throw new Error("Either sdkKey or guiderId must be provided");await this.log("info","Creating session",{endpoint:s});let n={"Content-Type":"application/json"};this.config.sdkKey&&(n["X-SDK-Key"]=this.config.sdkKey);let o=await fetch(s,{method:"POST",headers:n});if(!o.ok)throw await this.log("error","Failed to create session",{status:o.status}),new Error(`Failed to create session: ${o.status}`);let a=await o.json();this.sessionToken=a.session_token,this.isReady=!0,await this.log("info","SDK initialized successfully",{hasSessionToken:!!this.sessionToken}),(e=this.config.recording)!=null&&e.enabled&&await this.initRecording(),(t=this.config.proactive)!=null&&t.enabled&&this.initProactive(),(i=this.config.userFlows)!=null&&i.enabled&&await this.initUserFlowTracking(),this.emit("ready",{sessionToken:this.sessionToken}),this.config.initialMessage&&await this.sendInitialMessage()}catch(s){throw await this.log("error","SDK initialization failed",{error:s instanceof Error?s.message:String(s)}),this.emit("error",s),s}}register(e,t){this.actions.set(e,t),this.log("info","Action handler registered",{actionKey:e,totalActions:this.actions.size})}unregister(e){this.actions.delete(e),this.log("info","Action handler unregistered",{actionKey:e,remainingActions:this.actions.size})}async sendMessage(e){var i,s;if(!this.isReady||!this.sessionToken)throw new Error("SDK not initialized. Call init() first.");let t=Date.now();await this.log("info","sendMessage called",{message:e});try{let n,o={"Content-Type":"application/json"};this.config.sdkKey?(n=`${this.config.apiUrl}/sdk/match-intent`,o["X-SDK-Key"]=this.config.sdkKey):n=`${this.config.apiUrl}/sdk/public/${this.config.guiderId}/match-intent`;let a=await fetch(n,{method:"POST",headers:o,body:JSON.stringify({userMessage:e})});if(await this.log("info","Match-intent response received",{status:a.status}),a.ok){let h=await a.json();if(h.matched&&h.type==="flow"&&h.flow){await this.log("info","Flow matched",{flowId:h.flow.flowId,name:h.flow.name,stepCount:(i=h.flow.steps)==null?void 0:i.length}),await this.sendLogToBackend({userMessage:e,matched:!0,actionKey:`flow:${h.flow.flowId}`,responseMessage:h.responseMessage,executionTimeMs:Date.now()-t});let d=await this.executeFlow(h.flow),p={role:"assistant",content:h.responseMessage||`I've completed the "${h.flow.name}" flow for you.`,flow:h.flow,flowResult:d};return this.emit("message",p),p}if(h.matched&&(h.type==="operation"||h.action)){let d=h.action;await this.log("info","Action matched",{actionKey:d.actionKey,actionType:d.actionType,responseMessage:d.responseMessage}),await this.sendLogToBackend({userMessage:e,matched:!0,actionKey:d.actionKey,responseMessage:d.responseMessage,executionTimeMs:Date.now()-t}),await this.executeAction(d);let p={role:"assistant",content:d.responseMessage||`I've triggered the "${d.name}" action for you.`,action:d};return this.emit("message",p),p}else await this.sendLogToBackend({userMessage:e,matched:!1,executionTimeMs:Date.now()-t})}let l=await fetch(`${this.config.apiUrl}/chat/sessions/${this.sessionToken}/message`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})});if(!l.ok)throw new Error(`Failed to send message: ${l.status}`);let c=await l.json(),u={role:"assistant",content:((s=c.message)==null?void 0:s.content)||c.response||"",visualFlows:c.flows||[],images:c.images||[]};return await this.log("info","Chat response received",{hasFlows:(c.flows||[]).length>0,hasImages:(c.images||[]).length>0}),this.emit("message",u),u}catch(n){throw await this.log("error","Error in sendMessage",{error:n instanceof Error?n.message:String(n)}),this.emit("error",n),n}}async executeFlow(e){await this.log("info","executeFlow started",{flowId:e.flowId,name:e.name,stepCount:e.steps.length}),this.emit("flowStart",e),this.config.onFlowStart&&this.config.onFlowStart(e);let t=[],i={},s=[...e.steps].sort((o,a)=>o.order-a.order);for(let o of s){await this.log("info","Executing flow step",{flowId:e.flowId,operationId:o.operationId,order:o.order});let a={operationId:o.operationId,order:o.order,success:!1};try{let l=this.actions.get(o.operationId);if(l){let c={actionKey:o.operationId,name:o.operationId,actionType:"callback",actionConfig:{flowContext:i,inputMapping:o.inputMapping}},u=await l(c);a.success=!0,a.data=u,i={...i,[`step_${o.order}`]:u,previousResult:u},await this.log("info","Flow step completed successfully",{flowId:e.flowId,operationId:o.operationId,order:o.order})}else await this.log("warn","No handler registered for flow step",{flowId:e.flowId,operationId:o.operationId}),a.success=!0,a.data={skipped:!0,reason:"No handler registered"}}catch(l){a.success=!1,a.error=l instanceof Error?l.message:String(l),await this.log("error","Flow step failed",{flowId:e.flowId,operationId:o.operationId,error:a.error})}t.push(a),this.emit("flowStepComplete",{step:a,flow:e}),this.config.onFlowStepComplete&&this.config.onFlowStepComplete(a,e)}let n={flowId:e.flowId,name:e.name,steps:t,completed:!0,totalSteps:e.steps.length,successfulSteps:t.filter(o=>o.success).length};return await this.log("info","Flow execution completed",{flowId:e.flowId,totalSteps:n.totalSteps,successfulSteps:n.successfulSteps}),this.emit("flowComplete",n),this.config.onFlowComplete&&this.config.onFlowComplete(n),n}async sendLogToBackend(e){try{let t={"Content-Type":"application/json"};this.config.sdkKey&&(t["X-SDK-Key"]=this.config.sdkKey);let i=`${this.config.apiUrl}/sdk-logs/client`;await fetch(i,{method:"POST",headers:t,body:JSON.stringify({...e,timestamp:new Date().toISOString(),sessionToken:this.sessionToken})})}catch(t){}}async log(e,t,i){try{let s={"Content-Type":"application/json"};this.config.sdkKey&&(s["X-SDK-Key"]=this.config.sdkKey);let n=`${this.config.apiUrl}/sdk-logs/client`;await fetch(n,{method:"POST",headers:s,body:JSON.stringify({level:e,message:t,data:i,timestamp:new Date().toISOString(),sessionToken:this.sessionToken})})}catch(s){}}async executeAction(e){var s,n;let t=Array.from(this.actions.keys());typeof window!="undefined"&&console.log("%c\u{1F3AF} SDK executeAction","background: #ff0; color: #000; font-size: 20px; padding: 10px;",{actionKey:e.actionKey,totalRegistered:this.actions.size,registeredKeys:t}),await this.log("info","executeAction called",{actionKey:e.actionKey,actionType:typeof e.actionKey,totalRegistered:this.actions.size,registeredKeys:t,keyComparisons:t.map(o=>({key:o,matches:o===e.actionKey,keyLength:o.length,actionKeyLength:e.actionKey.length}))});let i=this.actions.get(e.actionKey);if(typeof window!="undefined"&&console.log("%c\u{1F50D} SDK Handler Lookup","background: #0ff; color: #000; font-size: 16px; padding: 5px;",{actionKey:e.actionKey,found:!!i,hasConfigOnAction:!!this.config.onAction,registeredKeys:Array.from(this.actions.keys())}),i)try{let o=Date.now();await i(e);let a=Date.now()-o;await this.log("info","Handler executed successfully",{actionKey:e.actionKey,executionTime:a}),await this.sendLogToBackend({userMessage:`Action executed: ${e.actionKey}`,matched:!0,actionKey:e.actionKey,responseMessage:e.responseMessage||`Executed ${e.name}`,executionTimeMs:a}),this.emit("action",e),(n=(s=this.config).onAction)==null||n.call(s,e.actionKey,e)}catch(o){await this.log("error","Handler execution failed",{actionKey:e.actionKey,error:o instanceof Error?o.message:String(o),stack:o instanceof Error?o.stack:void 0}),await this.sendLogToBackend({userMessage:`Action execution failed: ${e.actionKey}`,matched:!0,actionKey:e.actionKey,error:o instanceof Error?o.message:String(o)}),this.emit("error",o)}else{if(this.config.onAction){await this.log("info","No internal handler, trying config.onAction callback",{actionKey:e.actionKey});try{this.config.onAction(e.actionKey,e),this.emit("action",e),await this.log("info","Action dispatched via config.onAction",{actionKey:e.actionKey}),await this.sendLogToBackend({userMessage:`Action dispatched: ${e.actionKey}`,matched:!0,actionKey:e.actionKey,responseMessage:e.responseMessage||`Dispatched ${e.name}`});return}catch(o){await this.log("error","config.onAction callback failed",{actionKey:e.actionKey,error:o instanceof Error?o.message:String(o)})}}await this.log("warn","No handler registered for action",{actionKey:e.actionKey,registeredActions:Array.from(this.actions.keys())}),await this.sendLogToBackend({userMessage:`No handler for action: ${e.actionKey}`,matched:!1,actionKey:e.actionKey,error:`Handler not registered. Available: ${Array.from(this.actions.keys()).join(", ")}`})}}on(e,t){this.eventListeners.has(e)||this.eventListeners.set(e,new Set),this.eventListeners.get(e).add(t)}off(e,t){var i;(i=this.eventListeners.get(e))==null||i.delete(t)}emit(e,t){var i;(i=this.eventListeners.get(e))==null||i.forEach(s=>s(t))}getSessionToken(){return this.sessionToken}getIsReady(){return this.isReady}getRegisteredActions(){return Array.from(this.actions.keys())}getGuiderId(){return this.config.guiderId}async getVisualFlow(e){let t=this.config.guiderId;if(!t)return await this.log("warn","Cannot fetch visual flow without guiderId"),null;try{let i=await fetch(`${this.config.apiUrl}/visual-flows/chat/${t}/${e}`);if(!i.ok)return await this.log("warn","Visual flow not found",{flowId:e,status:i.status}),null;let s=await i.json();return!s.found||!s.flow?null:s.flow}catch(i){return await this.log("error","Error fetching visual flow",{flowId:e,error:i}),null}}async initRecording(){try{this.recorder=new at(this.config.recording),this.recorder.initialize(this.sessionToken,this.config.apiUrl,this.config.sdkKey);let e=await this.recorder.start();e&&await this.log("info","Session recording started",{recordingSessionId:e})}catch(e){await this.log("warn","Failed to initialize session recording",{error:e instanceof Error?e.message:String(e)})}}async startRecording(){return this.isReady?(this.recorder||(this.recorder=new at(this.config.recording),this.recorder.initialize(this.sessionToken,this.config.apiUrl,this.config.sdkKey)),this.recorder.start()):(console.warn("[SDK] Cannot start recording before SDK is initialized"),null)}async stopRecording(){this.recorder&&await this.recorder.stop()}pauseRecording(){var e;(e=this.recorder)==null||e.pause()}resumeRecording(){var e;(e=this.recorder)==null||e.resume()}addRecordingEvent(e){var t;(t=this.recorder)==null||t.addCustomEvent(e)}getRecordingStats(){var e,t;return(t=(e=this.recorder)==null?void 0:e.getStats())!=null?t:null}isRecordingActive(){var e,t;return(t=(e=this.recorder)==null?void 0:e.isRecording())!=null?t:!1}getRecordingSessionId(){var e,t;return(t=(e=this.recorder)==null?void 0:e.getSessionId())!=null?t:null}initProactive(){this.config.proactive&&(this.proactiveTracker=new Qi(this.config.proactive,{onTrigger:async(e,t)=>{this.emit("proactive",{context:e,message:t}),this.config.onProactiveMessage&&this.config.onProactiveMessage(t,e);try{await this.getProactiveAIMessage(e,t)}catch(i){await this.log("warn","Failed to get AI proactive message",{error:i})}}}),this.proactiveTracker.start(),this.log("info","Proactive behavior tracking initialized"))}async getProactiveAIMessage(e,t){try{let i={"Content-Type":"application/json"};this.config.sdkKey&&(i["X-SDK-Key"]=this.config.sdkKey);let s=await fetch(`${this.config.apiUrl}/sdk/proactive-message`,{method:"POST",headers:i,body:JSON.stringify({context:e,fallbackMessage:t,sessionToken:this.sessionToken})});if(!s.ok)return t;let o=(await s.json()).message||t,a={role:"assistant",content:o};return this.emit("message",a),o}catch(i){return t}}async sendInitialMessage(){let e=this.config.initialMessage;if(e)if(this.config.streamInitialMessage)await this.streamMessage(e);else{let t={role:"assistant",content:e};this.emit("message",t),this.config.onMessage&&this.config.onMessage(t)}}async streamMessage(e,t=30){let i="";for(let s=0;s<e.length;s++){i+=e[s];let n={role:"assistant",content:i};this.emit("message",n),await new Promise(o=>setTimeout(o,t))}}startProactiveTracking(){this.proactiveTracker&&this.proactiveTracker.start()}stopProactiveTracking(){this.proactiveTracker&&this.proactiveTracker.stop()}getProactiveStats(){var e,t;return(t=(e=this.proactiveTracker)==null?void 0:e.getStats())!=null?t:null}triggerProactiveMessage(e,t){if(this.proactiveTracker)this.proactiveTracker.triggerManual(e,t);else{let i={role:"assistant",content:e};this.emit("message",i),this.config.onMessage&&this.config.onMessage(i)}}optOutProactive(){var e;(e=this.proactiveTracker)==null||e.optOut()}optInProactive(){var e;(e=this.proactiveTracker)==null||e.optIn()}async initUserFlowTracking(){var e,t;try{this.userFlowTracker=new lt(this.config.userFlows),this.userFlowTracker.initialize(this.sessionToken,this.config.apiUrl,this.config.sdkKey);let i=((t=(e=this.recorder)==null?void 0:e.getSessionId)==null?void 0:t.call(e))||null,s=await this.userFlowTracker.start(i);s&&await this.log("info","User flow tracking started",{flowSessionId:s,linkedRecordingSession:i})}catch(i){await this.log("warn","Failed to initialize user flow tracking",{error:i instanceof Error?i.message:String(i)})}}identify(e){this.userFlowTracker&&this.userFlowTracker.identify(e),this.log("info","User identified",{hasEmail:!!e.email,hasName:!!e.name,hasTags:!!e.tags&&Object.keys(e.tags).length>0})}async startUserFlowTracking(){return this.isReady?(this.userFlowTracker||(this.userFlowTracker=new lt(this.config.userFlows),this.userFlowTracker.initialize(this.sessionToken,this.config.apiUrl,this.config.sdkKey)),this.userFlowTracker.start()):(console.warn("[SDK] Cannot start flow tracking before SDK is initialized"),null)}async stopUserFlowTracking(){this.userFlowTracker&&await this.userFlowTracker.stop()}pauseUserFlowTracking(){var e;(e=this.userFlowTracker)==null||e.pause()}resumeUserFlowTracking(){var e;(e=this.userFlowTracker)==null||e.resume()}trackEvent(e){var t;(t=this.userFlowTracker)==null||t.addCustomEvent(e)}getUserFlowStats(){var e,t;return(t=(e=this.userFlowTracker)==null?void 0:e.getStats())!=null?t:null}isUserFlowTrackingActive(){var e,t;return(t=(e=this.userFlowTracker)==null?void 0:e.isTracking())!=null?t:!1}destroy(){this.recorder&&(this.recorder.destroy(),this.recorder=null),this.proactiveTracker&&(this.proactiveTracker.stop(),this.proactiveTracker=null),this.userFlowTracker&&(this.userFlowTracker.stop(),this.userFlowTracker=null),this.actions.clear(),this.eventListeners.clear(),this.sessionToken=null,this.isReady=!1}};var F={instance:null,container:null,config:null,isOpen:!1};function am(r){var n,o,a,l,c,u,h,d;let e=document.createElement("div");e.id="produck-chat-widget";let i=(r.position||"bottom-right")==="bottom-right",s=document.createElement("style");return s.textContent=`
55
+ #produck-chat-widget {
56
+ position: fixed;
57
+ bottom: 20px;
58
+ ${i?"right: 20px;":"left: 20px;"}
59
+ z-index: 999999;
60
+ font-family: ${((n=r.appearance)==null?void 0:n.fontFamily)||'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'};
61
+ }
62
+
63
+ #produck-chat-widget * {
64
+ box-sizing: border-box;
65
+ }
66
+
67
+ .produck-launcher {
68
+ width: 60px;
69
+ height: 60px;
70
+ border-radius: 50%;
71
+ background: ${r.primaryColor||((o=r.appearance)==null?void 0:o.primaryColor)||"#6366f1"};
72
+ border: none;
73
+ cursor: pointer;
74
+ display: flex;
75
+ align-items: center;
76
+ justify-content: center;
77
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
78
+ transition: transform 0.2s, box-shadow 0.2s;
79
+ }
80
+
81
+ .produck-launcher:hover {
82
+ transform: scale(1.05);
83
+ box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
84
+ }
85
+
86
+ .produck-launcher svg {
87
+ width: 28px;
88
+ height: 28px;
89
+ fill: white;
90
+ }
91
+
92
+ .produck-window {
93
+ position: absolute;
94
+ bottom: 70px;
95
+ ${i?"right: 0;":"left: 0;"}
96
+ width: ${((a=r.appearance)==null?void 0:a.width)||"380px"};
97
+ height: ${((l=r.appearance)==null?void 0:l.height)||"520px"};
98
+ background: ${((c=r.appearance)==null?void 0:c.backgroundColor)||(r.theme==="dark"?"#1f2937":"#ffffff")};
99
+ border-radius: ${((u=r.appearance)==null?void 0:u.borderRadius)||"16px"};
100
+ box-shadow: ${((h=r.appearance)==null?void 0:h.boxShadow)||"0 10px 40px rgba(0, 0, 0, 0.15)"};
101
+ display: none;
102
+ flex-direction: column;
103
+ overflow: hidden;
104
+ border: 1px solid ${r.theme==="dark"?"#374151":"#e5e7eb"};
105
+ }
106
+
107
+ .produck-window.open {
108
+ display: flex;
109
+ animation: produck-slide-up 0.3s ease;
110
+ }
111
+
112
+ @keyframes produck-slide-up {
113
+ from {
114
+ opacity: 0;
115
+ transform: translateY(10px);
116
+ }
117
+ to {
118
+ opacity: 1;
119
+ transform: translateY(0);
120
+ }
121
+ }
122
+
123
+ .produck-header {
124
+ padding: 16px 20px;
125
+ background: ${((d=r.appearance)==null?void 0:d.headerBackgroundColor)||r.primaryColor||"#6366f1"};
126
+ color: white;
127
+ display: flex;
128
+ align-items: center;
129
+ justify-content: space-between;
130
+ }
131
+
132
+ .produck-header-title {
133
+ font-weight: 600;
134
+ font-size: 16px;
135
+ }
136
+
137
+ .produck-close {
138
+ background: none;
139
+ border: none;
140
+ color: white;
141
+ cursor: pointer;
142
+ padding: 4px;
143
+ display: flex;
144
+ opacity: 0.8;
145
+ transition: opacity 0.2s;
146
+ }
147
+
148
+ .produck-close:hover {
149
+ opacity: 1;
150
+ }
151
+
152
+ .produck-messages {
153
+ flex: 1;
154
+ overflow-y: auto;
155
+ padding: 16px;
156
+ display: flex;
157
+ flex-direction: column;
158
+ gap: 12px;
159
+ }
160
+
161
+ .produck-message {
162
+ max-width: 85%;
163
+ padding: 12px 16px;
164
+ border-radius: 12px;
165
+ font-size: 14px;
166
+ line-height: 1.5;
167
+ word-wrap: break-word;
168
+ }
169
+
170
+ .produck-message.user {
171
+ align-self: flex-end;
172
+ background: ${r.primaryColor||"#6366f1"};
173
+ color: white;
174
+ border-bottom-right-radius: 4px;
175
+ }
176
+
177
+ .produck-message.assistant {
178
+ align-self: flex-start;
179
+ background: ${r.theme==="dark"?"#374151":"#f3f4f6"};
180
+ color: ${r.theme==="dark"?"#f3f4f6":"#1f2937"};
181
+ border-bottom-left-radius: 4px;
182
+ }
183
+
184
+ .produck-message.streaming::after {
185
+ content: '\u258B';
186
+ animation: produck-blink 1s infinite;
187
+ }
188
+
189
+ @keyframes produck-blink {
190
+ 0%, 50% { opacity: 1; }
191
+ 51%, 100% { opacity: 0; }
192
+ }
193
+
194
+ .produck-typing {
195
+ display: flex;
196
+ align-items: center;
197
+ gap: 4px;
198
+ padding: 12px 16px;
199
+ align-self: flex-start;
200
+ }
201
+
202
+ .produck-typing-dot {
203
+ width: 8px;
204
+ height: 8px;
205
+ border-radius: 50%;
206
+ background: ${r.theme==="dark"?"#6b7280":"#9ca3af"};
207
+ animation: produck-bounce 1.4s infinite ease-in-out;
208
+ }
209
+
210
+ .produck-typing-dot:nth-child(1) { animation-delay: 0s; }
211
+ .produck-typing-dot:nth-child(2) { animation-delay: 0.2s; }
212
+ .produck-typing-dot:nth-child(3) { animation-delay: 0.4s; }
213
+
214
+ @keyframes produck-bounce {
215
+ 0%, 80%, 100% { transform: scale(0.8); }
216
+ 40% { transform: scale(1.2); }
217
+ }
218
+
219
+ .produck-input-container {
220
+ padding: 16px;
221
+ border-top: 1px solid ${r.theme==="dark"?"#374151":"#e5e7eb"};
222
+ display: flex;
223
+ gap: 8px;
224
+ }
225
+
226
+ .produck-input {
227
+ flex: 1;
228
+ padding: 12px 16px;
229
+ border: 1px solid ${r.theme==="dark"?"#4b5563":"#d1d5db"};
230
+ border-radius: 24px;
231
+ background: ${r.theme==="dark"?"#374151":"#f9fafb"};
232
+ color: ${r.theme==="dark"?"#f3f4f6":"#1f2937"};
233
+ font-size: 14px;
234
+ outline: none;
235
+ transition: border-color 0.2s;
236
+ }
237
+
238
+ .produck-input:focus {
239
+ border-color: ${r.primaryColor||"#6366f1"};
240
+ }
241
+
242
+ .produck-input::placeholder {
243
+ color: ${r.theme==="dark"?"#9ca3af":"#6b7280"};
244
+ }
245
+
246
+ .produck-send {
247
+ width: 44px;
248
+ height: 44px;
249
+ border-radius: 50%;
250
+ background: ${r.primaryColor||"#6366f1"};
251
+ border: none;
252
+ cursor: pointer;
253
+ display: flex;
254
+ align-items: center;
255
+ justify-content: center;
256
+ transition: background 0.2s;
257
+ }
258
+
259
+ .produck-send:hover {
260
+ filter: brightness(1.1);
261
+ }
262
+
263
+ .produck-send:disabled {
264
+ opacity: 0.5;
265
+ cursor: not-allowed;
266
+ }
267
+
268
+ .produck-send svg {
269
+ width: 20px;
270
+ height: 20px;
271
+ fill: white;
272
+ }
273
+
274
+ .produck-empty {
275
+ flex: 1;
276
+ display: flex;
277
+ flex-direction: column;
278
+ align-items: center;
279
+ justify-content: center;
280
+ text-align: center;
281
+ padding: 32px;
282
+ color: ${r.theme==="dark"?"#9ca3af":"#6b7280"};
283
+ }
284
+
285
+ .produck-empty-icon {
286
+ font-size: 48px;
287
+ margin-bottom: 16px;
288
+ }
289
+
290
+ .produck-empty-title {
291
+ font-weight: 600;
292
+ font-size: 16px;
293
+ margin-bottom: 8px;
294
+ color: ${r.theme==="dark"?"#f3f4f6":"#1f2937"};
295
+ }
296
+
297
+ .produck-powered {
298
+ padding: 8px;
299
+ text-align: center;
300
+ font-size: 11px;
301
+ color: ${r.theme==="dark"?"#6b7280":"#9ca3af"};
302
+ }
303
+
304
+ .produck-powered a {
305
+ color: inherit;
306
+ text-decoration: none;
307
+ }
308
+
309
+ .produck-powered a:hover {
310
+ text-decoration: underline;
311
+ }
312
+ `,e.innerHTML=`
313
+ <button class="produck-launcher" aria-label="Open chat">
314
+ <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
315
+ <path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17L4 17.17V4h16v12z"/>
316
+ <path d="M7 9h10v2H7zm0-3h10v2H7z"/>
317
+ </svg>
318
+ </button>
319
+ <div class="produck-window">
320
+ <div class="produck-header">
321
+ <span class="produck-header-title">${r.title||"Chat"}</span>
322
+ <button class="produck-close" aria-label="Close chat">
323
+ <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
324
+ <path d="M18 6L6 18M6 6l12 12"/>
325
+ </svg>
326
+ </button>
327
+ </div>
328
+ <div class="produck-messages"></div>
329
+ <div class="produck-input-container">
330
+ <input type="text" class="produck-input" placeholder="${r.placeholder||"Type a message..."}" />
331
+ <button class="produck-send" aria-label="Send message">
332
+ <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
333
+ <path d="M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"/>
334
+ </svg>
335
+ </button>
336
+ </div>
337
+ ${r.showPoweredBy!==!1?`
338
+ <div class="produck-powered">
339
+ <a href="${r.poweredByUrl||"https://prodact.ai"}" target="_blank">${r.poweredByText||"Powered by prodact.ai"}</a>
340
+ </div>
341
+ `:""}
342
+ </div>
343
+ `,document.head.appendChild(s),document.body.appendChild(e),e}function ir(r,e,t=!1){var n;let i=(n=F.container)==null?void 0:n.querySelector(".produck-messages");if(!i)throw new Error("Messages container not found");let s=document.createElement("div");return s.className=`produck-message ${r}${t?" streaming":""}`,s.textContent=e,i.appendChild(s),i.scrollTop=i.scrollHeight,s}function lm(){var t;let r=(t=F.container)==null?void 0:t.querySelector(".produck-messages");if(!r)throw new Error("Messages container not found");let e=document.createElement("div");return e.className="produck-typing",e.innerHTML=`
344
+ <div class="produck-typing-dot"></div>
345
+ <div class="produck-typing-dot"></div>
346
+ <div class="produck-typing-dot"></div>
347
+ `,r.appendChild(e),r.scrollTop=r.scrollHeight,e}async function Wl(r,e){r.classList.add("streaming"),r.textContent="";for(let t=0;t<e.length;t++){r.textContent+=e[t];let i=e[t]===" "?10:e[t].match(/[.,!?]/)?100:30+Math.random()*30;await new Promise(s=>setTimeout(s,i))}r.classList.remove("streaming")}async function vn(r){var s,n,o,a,l,c;if(!F.instance||!F.config)return;let e=(s=F.container)==null?void 0:s.querySelector(".produck-input"),t=(n=F.container)==null?void 0:n.querySelector(".produck-send");e&&(e.disabled=!0),t&&(t.disabled=!0),ir("user",r),(a=(o=F.config).onMessage)==null||a.call(o,r);let i=lm();try{let u=await F.instance.sendMessage(r);i.remove();let h=ir("assistant","");await Wl(h,u.content),u.action&&((c=(l=F.config).onOperation)==null||c.call(l,u.action.actionKey,u.action.actionConfig||{}))}catch(u){i.remove(),ir("assistant","Sorry, something went wrong. Please try again."),console.error("Produck SDK Error:",u)}finally{e&&(e.disabled=!1,e.value="",e.focus()),t&&(t.disabled=!1)}}function Ut(r){var t,i,s;let e=(t=F.container)==null?void 0:t.querySelector(".produck-window");e&&(F.isOpen=r!=null?r:!F.isOpen,F.isOpen?(e.classList.add("open"),(s=(i=F.container)==null?void 0:i.querySelector(".produck-input"))==null||s.focus()):e.classList.remove("open"))}async function cm(r){var n;if(F.instance){console.warn("Produck SDK already initialized");return}F.config=r,F.instance=new tr({sdkKey:r.sdkKey,apiUrl:r.apiUrl}),await F.instance.init(),F.container=am(r);let e=F.container.querySelector(".produck-launcher"),t=F.container.querySelector(".produck-close"),i=F.container.querySelector(".produck-input"),s=F.container.querySelector(".produck-send");e==null||e.addEventListener("click",()=>Ut()),t==null||t.addEventListener("click",()=>Ut(!1)),i==null||i.addEventListener("keypress",o=>{o.key==="Enter"&&i.value.trim()&&vn(i.value.trim())}),s==null||s.addEventListener("click",()=>{i!=null&&i.value.trim()&&vn(i.value.trim())}),r.defaultOpen&&Ut(!0),r.initialMessage&&setTimeout(async()=>{let o=ir("assistant","");await Wl(o,r.initialMessage)},r.initialMessageDelay||1e3),(n=r.onReady)==null||n.call(r),console.log("Produck SDK initialized")}function um(){Ut(!0)}function hm(){Ut(!1)}function dm(r){if(!F.instance){console.warn("Produck SDK not initialized");return}vn(r)}function fm(){var r;(r=F.container)==null||r.remove(),F.instance=null,F.container=null,F.config=null,F.isOpen=!1}var zl={init:cm,open:um,close:hm,send:dm,destroy:fm};typeof window!="undefined"&&(window.Produck=zl);var pm=zl;return ql(mm);})();
348
+ /*! Bundled license information:
349
+
350
+ rrweb/dist/rrweb.js:
351
+ (*! *****************************************************************************
352
+ Copyright (c) Microsoft Corporation.
353
+
354
+ Permission to use, copy, modify, and/or distribute this software for any
355
+ purpose with or without fee is hereby granted.
356
+
357
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
358
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
359
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
360
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
361
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
362
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
363
+ PERFORMANCE OF THIS SOFTWARE.
364
+ ***************************************************************************** *)
365
+ */
366
+ if(typeof window!=="undefined")window.Produck=Produck.default||Produck;
367
+ //# sourceMappingURL=sdk.global.js.map