humanbehavior-js 0.4.15 → 0.4.17

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.
Files changed (89) hide show
  1. package/dist/cjs/wizard/index.cjs +6 -8
  2. package/dist/cjs/wizard/index.cjs.map +1 -1
  3. package/dist/cli/ai-auto-install.js +6 -8
  4. package/dist/cli/ai-auto-install.js.map +1 -1
  5. package/dist/esm/wizard/index.js +6 -8
  6. package/dist/esm/wizard/index.js.map +1 -1
  7. package/package/WIZARD_USAGE_GUIDE.md +381 -0
  8. package/package/canvas-recording-demo.html +143 -0
  9. package/package/clean-console-demo.html +39 -0
  10. package/package/dist/cjs/angular/index.cjs +14354 -0
  11. package/package/dist/cjs/angular/index.cjs.map +1 -0
  12. package/package/dist/cjs/index.cjs +14323 -0
  13. package/package/dist/cjs/index.cjs.map +1 -0
  14. package/package/dist/cjs/install-wizard.cjs +1530 -0
  15. package/package/dist/cjs/install-wizard.cjs.map +1 -0
  16. package/package/dist/cjs/react/index.cjs +14478 -0
  17. package/package/dist/cjs/react/index.cjs.map +1 -0
  18. package/package/dist/cjs/remix/index.cjs +14452 -0
  19. package/package/dist/cjs/remix/index.cjs.map +1 -0
  20. package/package/dist/cjs/svelte/index.cjs +14308 -0
  21. package/package/dist/cjs/svelte/index.cjs.map +1 -0
  22. package/package/dist/cjs/vue/index.cjs +14317 -0
  23. package/package/dist/cjs/vue/index.cjs.map +1 -0
  24. package/package/dist/cjs/wizard/index.cjs +3446 -0
  25. package/package/dist/cjs/wizard/index.cjs.map +1 -0
  26. package/package/dist/cli/ai-auto-install.cjs +57161 -0
  27. package/package/dist/cli/ai-auto-install.cjs.map +1 -0
  28. package/package/dist/cli/ai-auto-install.js +1969 -0
  29. package/package/dist/cli/ai-auto-install.js.map +1 -0
  30. package/package/dist/cli/auto-install.cjs +56352 -0
  31. package/package/dist/cli/auto-install.cjs.map +1 -0
  32. package/package/dist/cli/auto-install.js +1957 -0
  33. package/package/dist/cli/auto-install.js.map +1 -0
  34. package/package/dist/esm/angular/index.js +14350 -0
  35. package/package/dist/esm/angular/index.js.map +1 -0
  36. package/package/dist/esm/index.js +14309 -0
  37. package/package/dist/esm/index.js.map +1 -0
  38. package/package/dist/esm/install-wizard.js +1507 -0
  39. package/package/dist/esm/install-wizard.js.map +1 -0
  40. package/package/dist/esm/react/index.js +14472 -0
  41. package/package/dist/esm/react/index.js.map +1 -0
  42. package/package/dist/esm/remix/index.js +14448 -0
  43. package/package/dist/esm/remix/index.js.map +1 -0
  44. package/package/dist/esm/svelte/index.js +14306 -0
  45. package/package/dist/esm/svelte/index.js.map +1 -0
  46. package/package/dist/esm/vue/index.js +14315 -0
  47. package/package/dist/esm/vue/index.js.map +1 -0
  48. package/package/dist/esm/wizard/index.js +3415 -0
  49. package/package/dist/esm/wizard/index.js.map +1 -0
  50. package/package/dist/index.min.js +2 -0
  51. package/package/dist/index.min.js.map +1 -0
  52. package/package/dist/types/angular/index.d.ts +267 -0
  53. package/package/dist/types/index.d.ts +373 -0
  54. package/package/dist/types/install-wizard.d.ts +156 -0
  55. package/package/dist/types/react/index.d.ts +255 -0
  56. package/package/dist/types/remix/index.d.ts +246 -0
  57. package/package/dist/types/svelte/index.d.ts +232 -0
  58. package/package/dist/types/vue/index.d.ts +15 -0
  59. package/package/dist/types/wizard/index.d.ts +523 -0
  60. package/package/package.json +105 -0
  61. package/package/readme.md +281 -0
  62. package/package/rollup.config.js +422 -0
  63. package/package/simple-demo.html +26 -0
  64. package/package/simple-spa.html +838 -0
  65. package/package/src/angular/index.ts +79 -0
  66. package/package/src/api.ts +376 -0
  67. package/package/src/index.ts +28 -0
  68. package/package/src/react/AutoInstallWizard.tsx +557 -0
  69. package/package/src/react/browser.ts +8 -0
  70. package/package/src/react/index.tsx +308 -0
  71. package/package/src/redact.ts +521 -0
  72. package/package/src/remix/index.ts +16 -0
  73. package/package/src/svelte/index.ts +14 -0
  74. package/package/src/tracker.ts +1319 -0
  75. package/package/src/types/clack.d.ts +31 -0
  76. package/package/src/utils/logger.ts +144 -0
  77. package/package/src/vue/index.ts +29 -0
  78. package/package/src/wizard/README.md +114 -0
  79. package/package/src/wizard/ai/ai-install-wizard.ts +897 -0
  80. package/package/src/wizard/ai/manual-framework-wizard.ts +238 -0
  81. package/package/src/wizard/cli/ai-auto-install.ts +243 -0
  82. package/package/src/wizard/cli/auto-install.ts +224 -0
  83. package/package/src/wizard/core/install-wizard.ts +1744 -0
  84. package/package/src/wizard/index.ts +23 -0
  85. package/package/src/wizard/services/centralized-ai-service.ts +668 -0
  86. package/package/src/wizard/services/remote-ai-service.ts +240 -0
  87. package/package/tsconfig.json +24 -0
  88. package/package.json +1 -1
  89. package/src/wizard/cli/ai-auto-install.ts +4 -6
@@ -0,0 +1,2 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).HumanBehaviorTracker={})}(this,function(e){"use strict";function t(e,t,s,r){return new(s||(s=Promise))(function(n,o){function i(e){try{l(r.next(e))}catch(e){o(e)}}function a(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s(function(e){e(t)})).then(i,a)}l((r=r.apply(e,t||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;var s,r=Object.defineProperty,n=(e,t,s)=>((e,t,s)=>t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s),o=Object.defineProperty,i=(e,t,s)=>((e,t,s)=>t in e?o(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s),a=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(a||{});const l={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},c={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},h={};function u(e){if(h[e])return h[e];const t=globalThis[e],s=t.prototype,r=e in l?l[e]:void 0,n=Boolean(r&&r.every(e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(s,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),o=e in c?c[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof s[e]&&(null==(t=s[e])?void 0:t.toString().includes("[native code]"))}));if(n&&i&&!globalThis.Zone)return h[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");document.body.appendChild(r);const n=r.contentWindow;if(!n)return t.prototype;const o=n[e].prototype;return document.body.removeChild(r),o?h[e]=o:s}catch{return s}}const d={};function p(e,t,s){var r;const n=`${e}.${String(s)}`;if(d[n])return d[n].call(t);const o=u(e),i=null==(r=Object.getOwnPropertyDescriptor(o,s))?void 0:r.get;return i?(d[n]=i,i.call(t)):t[s]}const f={};function m(e,t,s){const r=`${e}.${String(s)}`;if(f[r])return f[r].bind(t);const n=u(e)[s];return"function"!=typeof n?t[s]:(f[r]=n,n.bind(t))}const g={childNodes:function(e){return p("Node",e,"childNodes")},parentNode:function(e){return p("Node",e,"parentNode")},parentElement:function(e){return p("Node",e,"parentElement")},textContent:function(e){return p("Node",e,"textContent")},contains:function(e,t){return m("Node",e,"contains")(t)},getRootNode:function(e){return m("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?p("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?p("Element",e,"shadowRoot"):null},querySelector:function(e,t){return p("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return p("Element",e,"querySelectorAll")(t)},mutationObserver:function(){return u("MutationObserver").constructor}};function y(e){return e.nodeType===e.ELEMENT_NODE}function w(e){const t=e&&"host"in e&&"mode"in e&&g.host(e)||null;return Boolean(t&&"shadowRoot"in t&&g.shadowRoot(t)===e)}function v(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function b(e){try{const s=e.rules||e.cssRules;if(!s)return null;let r=e.href;!r&&e.ownerNode&&e.ownerNode.ownerDocument&&(r=e.ownerNode.ownerDocument.location.href);const n=Array.from(s,e=>S(e,r)).join("");return(t=n).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(e){return null}var t}function S(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=b(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const s=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?s.push("layer"):e.layerName&&s.push(`layer(${e.layerName})`),e.supportsText&&s.push(`supports(${e.supportsText})`),e.media.length&&s.push(e.media.mediaText),s.join(" ")+";"}(e)}catch(s){t=e.cssText}return e.styleSheet.href?N(t,e.styleSheet.href):t}{let s=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(s=function(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}(s)),t?N(s,t):s}}class C{constructor(){i(this,"idNodeMap",new Map),i(this,"nodeMetaMap",new WeakMap)}getId(e){var t;if(!e)return-1;return(null==(t=this.getMeta(e))?void 0:t.id)??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const s=t.id;this.idNodeMap.set(s,e),this.nodeMetaMap.set(e,t)}replace(e,t){const s=this.getNode(e);if(s){const e=this.nodeMetaMap.get(s);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function I({element:e,maskInputOptions:t,tagName:s,type:r,value:n,maskInputFn:o}){let i=n||"";const a=r&&k(r);return(t[s.toLowerCase()]||a&&t[a])&&(i=o?o(i,e):"*".repeat(i.length)),i}function k(e){return e.toLowerCase()}const x="__rrweb_original__";function O(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?k(t):null}function E(e,t){let s;try{s=new URL(e,t??window.location.href)}catch(e){return null}const r=s.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==r?void 0:r[1])??null}const M=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,R=/^(?:[a-z+]+:)?\/\//i,A=/^www\..*/i,T=/^(data:)([^,]*),(.*)/i;function N(e,t){return(e||"").replace(M,(e,s,r,n,o,i)=>{const a=r||o||i,l=s||n||"";if(!a)return e;if(R.test(a)||A.test(a))return`url(${l}${a}${l})`;if(T.test(a))return`url(${l}${a}${l})`;if("/"===a[0])return`url(${l}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${l})`;const c=t.split("/"),h=a.split("/");c.pop();for(const e of h)"."!==e&&(".."===e?c.pop():c.push(e));return`url(${l}${c.join("/")}${l})`})}function L(e){return e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}function F(e,t){return function(e,t){const s=Array.from(t.childNodes),r=[];if(s.length>1&&e&&"string"==typeof e){const t=L(e);for(let n=1;n<s.length;n++)if(s[n].textContent&&"string"==typeof s[n].textContent){const o=L(s[n].textContent);for(let s=3;s<o.length;s++){const n=o.substring(0,s);if(2===t.split(n).length){const s=t.indexOf(n);for(let t=s;t<e.length;t++)if(L(e.substring(0,t)).length===s){r.push(e.substring(0,t)),e=e.substring(t);break}break}}}}return r.push(e),r}(e,t).join("/* rr_split */")}let D=1;const P=new RegExp("[^a-z0-9-_:]");function _(){return D++}let U,B;const z=/^[^ \t\n\r\u000c]+/,j=/^[, \t\n\r\u000c]+/;const $=new WeakMap;function W(e,t){return t&&""!==t.trim()?G(e,t):t}function V(e){return Boolean("svg"===e.tagName||e.ownerSVGElement)}function G(e,t){let s=$.get(e);if(s||(s=e.createElement("a"),$.set(e,s)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return s.setAttribute("href",t),s.href}function Y(e,t,s,r){return r?"src"===s||"href"===s&&("use"!==t||"#"!==r[0])||"xlink:href"===s&&"#"!==r[0]?W(e,r):"background"!==s||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===s?function(e,t){if(""===t.trim())return t;let s=0;function r(e){let r;const n=e.exec(t.substring(s));return n?(r=n[0],s+=r.length,r):""}const n=[];for(;r(j),!(s>=t.length);){let o=r(z);if(","===o.slice(-1))o=W(e,o.substring(0,o.length-1)),n.push(o);else{let r="";o=W(e,o);let i=!1;for(;;){const e=t.charAt(s);if(""===e){n.push((o+r).trim());break}if(i)")"===e&&(i=!1);else{if(","===e){s+=1,n.push((o+r).trim());break}"("===e&&(i=!0)}r+=e,s+=1}}}return n.join(", ")}(e,r):"style"===s?N(r,G(e)):"object"===t&&"data"===s?W(e,r):r:W(e,r):r}function K(e,t,s){return("video"===e||"audio"===e)&&"autoplay"===t}function Z(e,t,s){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!s&&Z(g.parentNode(e),t,s);for(let s=e.classList.length;s--;){const r=e.classList[s];if(t.test(r))return!0}return!!s&&Z(g.parentNode(e),t,s)}function J(e,t,s,r){let n;if(y(e)){if(n=e,!g.childNodes(n).length)return!1}else{if(null===g.parentElement(e))return!1;n=g.parentElement(e)}try{if("string"==typeof t){if(r){if(n.closest(`.${t}`))return!0}else if(n.classList.contains(t))return!0}else if(Z(n,t,r))return!0;if(s)if(r){if(n.closest(s))return!0}else if(n.matches(s))return!0}catch(e){}return!1}function H(e,t){const{doc:s,mirror:r,blockClass:n,blockSelector:o,needsMask:i,inlineStylesheet:l,maskInputOptions:c={},maskTextFn:h,maskInputFn:u,dataURLOptions:d={},inlineImages:p,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:y=!1,cssCaptured:w=!1}=t,v=function(e,t){if(!t.hasNode(e))return;const s=t.getId(e);return 1===s?void 0:s}(s,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:a.Document,childNodes:[],compatMode:e.compatMode}:{type:a.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:a.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:v};case e.ELEMENT_NODE:return function(e,t){const{doc:s,blockClass:r,blockSelector:n,inlineStylesheet:o,maskInputOptions:i={},maskInputFn:l,dataURLOptions:c={},inlineImages:h,recordCanvas:u,keepIframeSrcFn:d,newlyAddedElement:p=!1,rootId:f}=t,m=function(e,t,s){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let s=e.classList.length;s--;){const r=e.classList[s];if(t.test(r))return!0}if(s)return e.matches(s)}catch(e){}return!1}(e,r,n),g=function(e){if(e instanceof HTMLFormElement)return"form";const t=k(e.tagName);return P.test(t)?"div":t}(e);let y={};const w=e.attributes.length;for(let t=0;t<w;t++){const r=e.attributes[t];K(g,r.name,r.value)||(y[r.name]=Y(s,g,k(r.name),r.value))}if("link"===g&&o){const t=Array.from(s.styleSheets).find(t=>t.href===e.href);let r=null;t&&(r=b(t)),r&&(delete y.rel,delete y.href,y._cssText=r)}if("style"===g&&e.sheet){let t=b(e.sheet);t&&(e.childNodes.length>1&&(t=F(t,e)),y._cssText=t)}if("input"===g||"textarea"===g||"select"===g){const t=e.value,s=e.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&t?y.value=I({element:e,type:O(e),tagName:g,value:t,maskInputOptions:i,maskInputFn:l}):s&&(y.checked=s)}"option"===g&&(e.selected&&!i.select?y.selected=!0:delete y.selected);"dialog"===g&&e.open&&(y.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal");if("canvas"===g&&u)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let s=0;s<e.width;s+=50)for(let r=0;r<e.height;r+=50){const n=t.getImageData,o=x in n?n[x]:n;if(new Uint32Array(o.call(t,s,r,Math.min(50,e.width-s),Math.min(50,e.height-r)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(y.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){const t=e.toDataURL(c.type,c.quality),r=s.createElement("canvas");r.width=e.width,r.height=e.height;t!==r.toDataURL(c.type,c.quality)&&(y.rr_dataURL=t)}if("img"===g&&h){U||(U=s.createElement("canvas"),B=U.getContext("2d"));const t=e,r=t.currentSrc||t.getAttribute("src")||"<unknown-src>",n=t.crossOrigin,o=()=>{t.removeEventListener("load",o);try{U.width=t.naturalWidth,U.height=t.naturalHeight,B.drawImage(t,0,0),y.rr_dataURL=U.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o));console.warn(`Cannot inline img src=${r}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(n?y.crossOrigin=n:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?o():t.addEventListener("load",o)}if("audio"===g||"video"===g){const t=y;t.rr_mediaState=e.paused?"paused":"played",t.rr_mediaCurrentTime=e.currentTime,t.rr_mediaPlaybackRate=e.playbackRate,t.rr_mediaMuted=e.muted,t.rr_mediaLoop=e.loop,t.rr_mediaVolume=e.volume}p||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop));if(m){const{width:t,height:s}=e.getBoundingClientRect();y={class:y.class,rr_width:`${t}px`,rr_height:`${s}px`}}"iframe"!==g||d(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src);let v;try{customElements.get(g)&&(v=!0)}catch(e){}return{type:a.Element,tagName:g,attributes:y,childNodes:[],isSVG:V(e)||void 0,needBlock:m,rootId:f,isCustom:v}}(e,{doc:s,blockClass:n,blockSelector:o,inlineStylesheet:l,maskInputOptions:c,maskInputFn:u,dataURLOptions:d,inlineImages:p,recordCanvas:f,keepIframeSrcFn:m,newlyAddedElement:y,rootId:v});case e.TEXT_NODE:return function(e,t){const{needsMask:s,maskTextFn:r,rootId:n,cssCaptured:o}=t,i=g.parentNode(e),l=i&&i.tagName;let c="";const h="STYLE"===l||void 0,u="SCRIPT"===l||void 0;u?c="SCRIPT_PLACEHOLDER":o||(c=g.textContent(e),h&&c&&(c=N(c,G(t.doc))));!h&&!u&&c&&s&&(c=r?r(c,g.parentElement(e)):c.replace(/[\S]/g,"*"));return{type:a.Text,textContent:c||"",rootId:n}}(e,{doc:s,needsMask:i,maskTextFn:h,rootId:v,cssCaptured:w});case e.CDATA_SECTION_NODE:return{type:a.CDATA,textContent:"",rootId:v};case e.COMMENT_NODE:return{type:a.Comment,textContent:g.textContent(e)||"",rootId:v};default:return!1}}function X(e){return null==e?"":e.toLowerCase()}function q(e,t){const{doc:s,mirror:r,blockClass:n,blockSelector:o,maskTextClass:i,maskTextSelector:l,skipChild:c=!1,inlineStylesheet:h=!0,maskInputOptions:u={},maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:m={},inlineImages:b=!1,recordCanvas:S=!1,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:k=5e3,onStylesheetLoad:x,stylesheetLoadTimeout:O=5e3,keepIframeSrcFn:M=()=>!1,newlyAddedElement:R=!1,cssCaptured:A=!1}=t;let{needsMask:T}=t,{preserveWhiteSpace:N=!0}=t;if(!T){T=J(e,i,l,void 0===T)}const L=H(e,{doc:s,mirror:r,blockClass:n,blockSelector:o,needsMask:T,inlineStylesheet:h,maskInputOptions:u,maskTextFn:d,maskInputFn:p,dataURLOptions:m,inlineImages:b,recordCanvas:S,keepIframeSrcFn:M,newlyAddedElement:R,cssCaptured:A});if(!L)return console.warn(e,"not serialized"),null;let F;F=r.hasNode(e)?r.getId(e):function(e,t){if(t.comment&&e.type===a.Comment)return!0;if(e.type===a.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===E(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(X(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===X(e.attributes.name)||"icon"===X(e.attributes.rel)||"apple-touch-icon"===X(e.attributes.rel)||"shortcut icon"===X(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&X(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(X(e.attributes.property).match(/^(og|twitter|fb):/)||X(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===X(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===X(e.attributes.name)||"googlebot"===X(e.attributes.name)||"bingbot"===X(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===X(e.attributes.name)||"generator"===X(e.attributes.name)||"framework"===X(e.attributes.name)||"publisher"===X(e.attributes.name)||"progid"===X(e.attributes.name)||X(e.attributes.property).match(/^article:/)||X(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===X(e.attributes.name)||"yandex-verification"===X(e.attributes.name)||"csrf-token"===X(e.attributes.name)||"p:domain_verify"===X(e.attributes.name)||"verify-v1"===X(e.attributes.name)||"verification"===X(e.attributes.name)||"shopify-checkout-api-token"===X(e.attributes.name)))return!0}}return!1}(L,f)||!N&&L.type===a.Text&&!L.textContent.replace(/^\s+|\s+$/gm,"").length?-2:_();const D=Object.assign(L,{id:F});if(r.add(e,D),-2===F)return null;C&&C(e);let P=!c;if(D.type===a.Element){P=P&&!D.needBlock,delete D.needBlock;const t=g.shadowRoot(e);t&&v(t)&&(D.isShadowHost=!0)}if((D.type===a.Document||D.type===a.Element)&&P){f.headWhitespace&&D.type===a.Element&&"head"===D.tagName&&(N=!1);const t={doc:s,mirror:r,blockClass:n,blockSelector:o,needsMask:T,maskTextClass:i,maskTextSelector:l,skipChild:c,inlineStylesheet:h,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:m,inlineImages:b,recordCanvas:S,preserveWhiteSpace:N,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:O,keepIframeSrcFn:M,cssCaptured:!1};if(D.type===a.Element&&"textarea"===D.tagName&&void 0!==D.attributes.value);else{D.type===a.Element&&void 0!==D.attributes._cssText&&"string"==typeof D.attributes._cssText&&(t.cssCaptured=!0);for(const s of Array.from(g.childNodes(e))){const e=q(s,t);e&&D.childNodes.push(e)}}let w=null;if(y(e)&&(w=g.shadowRoot(e)))for(const e of Array.from(g.childNodes(w))){const s=q(e,t);s&&(v(w)&&(s.isShadow=!0),D.childNodes.push(s))}}const U=g.parentNode(e);return U&&w(U)&&v(U)&&(D.isShadow=!0),D.type===a.Element&&"iframe"===D.tagName&&function(e,t,s){const r=e.contentWindow;if(!r)return;let n,o=!1;try{n=r.document.readyState}catch(e){return}if("complete"!==n){const r=setTimeout(()=>{o||(t(),o=!0)},s);return void e.addEventListener("load",()=>{clearTimeout(r),o=!0,t()})}const i="about:blank";if(r.location.href!==i||e.src===i||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.contentDocument;if(t&&I){const s=q(t,{doc:t,mirror:r,blockClass:n,blockSelector:o,needsMask:T,maskTextClass:i,maskTextSelector:l,skipChild:!1,inlineStylesheet:h,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:m,inlineImages:b,recordCanvas:S,preserveWhiteSpace:N,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:O,keepIframeSrcFn:M});s&&I(e,s)}},k),D.type===a.Element&&"link"===D.tagName&&"string"==typeof D.attributes.rel&&("stylesheet"===D.attributes.rel||"preload"===D.attributes.rel&&"string"==typeof D.attributes.href&&"css"===E(D.attributes.href))&&function(e,t,s){let r,n=!1;try{r=e.sheet}catch(e){return}if(r)return;const o=setTimeout(()=>{n||(t(),n=!0)},s);e.addEventListener("load",()=>{clearTimeout(o),n=!0,t()})}(e,()=>{if(x){const t=q(e,{doc:s,mirror:r,blockClass:n,blockSelector:o,needsMask:T,maskTextClass:i,maskTextSelector:l,skipChild:!1,inlineStylesheet:h,maskInputOptions:u,maskTextFn:d,maskInputFn:p,slimDOMOptions:f,dataURLOptions:m,inlineImages:b,recordCanvas:S,preserveWhiteSpace:N,onSerialize:C,onIframeLoad:I,iframeLoadTimeout:k,onStylesheetLoad:x,stylesheetLoadTimeout:O,keepIframeSrcFn:M});t&&x(e,t)}},O),D}function Q(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ee(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var s=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),s}var te={exports:{}},se=String,re=function(){return{isColorSupported:!1,reset:se,bold:se,dim:se,italic:se,underline:se,inverse:se,hidden:se,strikethrough:se,black:se,red:se,green:se,yellow:se,blue:se,magenta:se,cyan:se,white:se,gray:se,bgBlack:se,bgRed:se,bgGreen:se,bgYellow:se,bgBlue:se,bgMagenta:se,bgCyan:se,bgWhite:se}};te.exports=re(),te.exports.createColors=re;var ne=te.exports;const oe=ee(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let ie=ne,ae=oe,le=class e extends Error{constructor(t,s,r,n,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),n&&(this.source=n),i&&(this.plugin=i),void 0!==s&&void 0!==r&&("number"==typeof s?(this.line=s,this.column=r):(this.line=s.line,this.column=s.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=ie.isColorSupported),ae&&e&&(t=ae(t));let s,r,n=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,n.length),a=String(i).length;if(e){let{bold:e,gray:t,red:n}=ie.createColors(!0);s=t=>e(n(t)),r=e=>t(e)}else s=r=e=>e;return n.slice(o,i).map((e,t)=>{let n=o+1+t,i=" "+(" "+n).slice(-a)+" | ";if(n===this.line){let t=r(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+r(i)+e+"\n "+t+s("^")}return" "+r(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var ce=le;le.default=le;var he={};he.isClean=Symbol("isClean"),he.my=Symbol("my");const ue={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let de=class{constructor(e){this.builder=e}atrule(e,t){let s="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?s+=e.raws.afterName:r&&(s+=" "),e.nodes)this.block(e,s+r);else{let n=(e.raws.between||"")+(t?";":"");this.builder(s+r+n,e)}}beforeAfter(e,t){let s;s="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,n=0;for(;r&&"root"!==r.type;)n+=1,r=r.parent;if(s.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<n;e++)s+=t}return s}block(e,t){let s,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),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&&"comment"===e.nodes[t].type;)t-=1;let s=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let n=e.nodes[r],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==r||s)}}comment(e){let t=this.raw(e,"left","commentLeft"),s=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+s+"*/",e)}decl(e,t){let s=this.raw(e,"between","colon"),r=e.prop+s+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,t,s){let r;if(s||(s=t),t&&(r=e.raws[t],void 0!==r))return r;let n=e.parent;if("before"===s){if(!n||"root"===n.type&&n.first===e)return"";if(n&&"document"===n.type)return""}if(!n)return ue[s];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[s])return o.rawCache[s];if("before"===s||"after"===s)return this.beforeAfter(e,s);{let n="raw"+((i=s)[0].toUpperCase()+i.slice(1));this[n]?r=this[n](o,e):o.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var i;return void 0===r&&(r=ue[s]),o.rawCache[s]=r,r}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let s;return e.walkComments(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeDecl"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeDecl(e,t){let s;return e.walkDecls(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeRule"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(s=>{if(s.nodes&&(s.parent!==e||e.first!==s)&&void 0!==s.raws.before)return t=s.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(s=>{let r=s.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==s.raws.before){let e=s.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let s=e[t],r=e.raws[t];return r&&r.value===s?r.raw:s}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var pe=de;de.default=de;let fe=pe;function me(e,t){new fe(t).stringify(e)}var ge=me;me.default=me;let{isClean:ye,my:we}=he,ve=ce,be=pe,Se=ge;function Ce(e,t){let s=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let n=e[r],o=typeof n;"parent"===r&&"object"===o?t&&(s[r]=t):"source"===r?s[r]=n:Array.isArray(n)?s[r]=n.map(e=>Ce(e,s)):("object"===o&&null!==n&&(n=Ce(n)),s[r]=n)}return s}let Ie=class{constructor(e={}){this.raws={},this[ye]=!1,this[we]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let s of e[t])"function"==typeof s.clone?this.append(s.clone()):this.append(s)}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=Ce(this);for(let s in e)t[s]=e[s];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:s,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:s.column,line:s.line},t)}return new ve(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[ye]){this[ye]=!1;let e=this;for(;e=e.parent;)e[ye]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let s=this.source.start;if(e.index)s=this.positionInside(e.index,t);else if(e.word){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(s=this.positionInside(r,t))}return s}positionInside(e,t){let s=t||this.toString(),r=this.source.start.column,n=this.source.start.line;for(let t=0;t<e;t++)"\n"===s[t]?(r=1,n+=1):r+=1;return{column:r,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},s=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 r=this.toString(),n=r.indexOf(e.word);-1!==n&&(t=this.positionInside(n,r),s=this.positionInside(n+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?s={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?s=this.positionInside(e.endIndex):e.index&&(s=this.positionInside(e.index+1));return(s.line<t.line||s.line===t.line&&s.column<=t.column)&&(s={column:t.column+1,line:t.line}),{end:s,start:t}}raw(e,t){return(new be).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,s=!1;for(let r of e)r===this?s=!0:s?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);s||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let s={},r=null==t;t=t||new Map;let n=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let r=this[e];if(Array.isArray(r))s[e]=r.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof r&&r.toJSON)s[e]=r.toJSON(null,t);else if("source"===e){let o=t.get(r.input);null==o&&(o=n,t.set(r.input,n),n++),s[e]={end:r.end,inputId:o,start:r.start}}else s[e]=r}return r&&(s.inputs=[...t.keys()].map(e=>e.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Se){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,s){let r={node:this};for(let e in s)r[e]=s[e];return e.warn(t,r)}get proxyOf(){return this}};var ke=Ie;Ie.default=Ie;let xe=ke,Oe=class extends xe{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var Ee=Oe;Oe.default=Oe;var Me={nanoid:(e=21)=>{let t="",s=e;for(;s--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:Re,SourceMapGenerator:Ae}=oe,{existsSync:Te,readFileSync:Ne}=oe,{dirname:Le,join:Fe}=oe;let De=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let s=t.map?t.map.prev:void 0,r=this.loadMap(t.from,s);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Le(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new Re(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let s=e.lastIndexOf(t.pop()),r=e.indexOf("*/",s);s>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(s,r)))}loadFile(e){if(this.root=Le(e),Te(e))return this.mapFile=e,Ne(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof Re)return Ae.fromSourceMap(t).toString();if(t instanceof Ae)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let s=t(e);if(s){let e=this.loadFile(s);if(!e)throw new Error("Unable to load previous source map: "+s.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Fe(Le(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var Pe=De;De.default=De;let{SourceMapConsumer:_e,SourceMapGenerator:Ue}=oe,{fileURLToPath:Be,pathToFileURL:ze}=oe,{isAbsolute:je,resolve:$e}=oe,{nanoid:We}=Me,Ve=oe,Ge=ce,Ye=Pe,Ke=Symbol("fromOffsetCache"),Ze=Boolean(_e&&Ue),Je=Boolean($e&&je),He=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!Je||/^\w+:\/\//.test(t.from)||je(t.from)?this.file=t.from:this.file=$e(t.from)),Je&&Ze){let e=new Ye(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+We(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,s,r={}){let n,o,i;if(t&&"object"==typeof t){let e=t,r=s;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,s=r.col}else t=e.line,s=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);o=e.line,i=e.col}else o=r.line,i=r.column}else if(!s){let e=this.fromOffset(t);t=e.line,s=e.col}let a=this.origin(t,s,o,i);return n=a?new Ge(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,r.plugin):new Ge(e,void 0===o?t:{column:s,line:t},void 0===o?s:{column:i,line:o},this.css,this.file,r.plugin),n.input={column:s,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(ze&&(n.input.url=ze(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,s;if(this[Ke])s=this[Ke];else{let e=this.css.split("\n");s=new Array(e.length);let t=0;for(let r=0,n=e.length;r<n;r++)s[r]=t,t+=e[r].length+1;this[Ke]=s}t=s[s.length-1];let r=0;if(e>=t)r=s.length-1;else{let t,n=s.length-2;for(;r<n;)if(t=r+(n-r>>1),e<s[t])n=t-1;else{if(!(e>=s[t+1])){r=t;break}r=t+1}}return{col:e-s[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:$e(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,s,r){if(!this.map)return!1;let n,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof s&&(n=i.originalPositionFor({column:r,line:s})),o=je(a.source)?ze(a.source):new URL(a.source,this.map.consumer().sourceRoot||ze(this.map.mapFile));let l={column:a.column,endColumn:n&&n.column,endLine:n&&n.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!Be)throw new Error("file: protocol is not available in this PostCSS build");l.file=Be(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var Xe=He;He.default=He,Ve&&Ve.registerInput&&Ve.registerInput(He);let{SourceMapConsumer:qe,SourceMapGenerator:Qe}=oe,{dirname:et,relative:tt,resolve:st,sep:rt}=oe,{pathToFileURL:nt}=oe,ot=Xe,it=Boolean(qe&&Qe),at=Boolean(et&&st&&tt&&rt);var lt=class{constructor(e,t,s,r){this.stringify=e,this.mapOpts=s.map||{},this.root=t,this.opts=s,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,s=this.toUrl(this.path(e.file)),r=e.root||et(e.file);!1===this.mapOpts.sourcesContent?(t=new qe(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,s,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),at&&it&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Qe.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Qe({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 Qe({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,s=1,r=1,n="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=s,o.generated.column=r-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=i.match(/\n/g),e?(s+=e.length,t=i.lastIndexOf("\n"),r=i.length-t):r+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=s,o.generated.column=r-2,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,o.generated.line=s,o.generated.column=r-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let s=this.opts.to?et(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(s=et(st(s,this.mapOpts.annotation)));let r=tt(s,e);return this.memoizedPaths.set(e,r),r}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 ot(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 s=t.source.input.from;if(s&&!e[s]){e[s]=!0;let r=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(nt){let t=nt(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===rt&&(e=e.replace(/\\/g,"/"));let s=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,s),s}};let ct=ke,ht=class extends ct{constructor(e){super(e),this.type="comment"}};var ut=ht;ht.default=ht;let dt,pt,ft,mt,{isClean:gt,my:yt}=he,wt=Ee,vt=ut,bt=ke;function St(e){return e.map(e=>(e.nodes&&(e.nodes=St(e.nodes)),delete e.source,e))}function Ct(e){if(e[gt]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Ct(t)}let It=class e extends bt{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,s,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],s=e(this.proxyOf.nodes[t],t),!1!==s);)this.indexes[r]+=1;return delete this.indexes[r],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)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...s)=>e[t](...s.map(e=>"function"==typeof e?(t,s)=>e(t.toProxy(),s):e)):"every"===t||"some"===t?s=>e[t]((e,...t)=>s(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let s,r=this.index(e),n=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of n)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)s=this.indexes[e],r<s&&(this.indexes[e]=s+n.length);return this.markDirty(),this}insertBefore(e,t){let s,r=this.index(e),n=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],n).reverse();r=this.index(e);for(let e of o)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)s=this.indexes[e],r<=s&&(this.indexes[e]=s+o.length);return this.markDirty(),this}normalize(t,s){if("string"==typeof t)t=St(dt(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new wt(t)]}else if(t.selector)t=[new pt(t)];else if(t.name)t=[new ft(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new vt(t)]}return t.map(t=>(t[yt]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[gt]&&Ct(t),void 0===t.raws.before&&s&&void 0!==s.raws.before&&(t.raws.before=s.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let s in this.indexes)t=this.indexes[s],t>=e&&(this.indexes[s]=t-1);return this.markDirty(),this}replaceValues(e,t,s){return s||(s=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,s))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,s)=>{let r;try{r=e(t,s)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("atrule"===s.type&&e.test(s.name))return t(s,r)}):this.walk((s,r)=>{if("atrule"===s.type&&s.name===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("atrule"===e.type)return t(e,s)}))}walkComments(e){return this.walk((t,s)=>{if("comment"===t.type)return e(t,s)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("decl"===s.type&&e.test(s.prop))return t(s,r)}):this.walk((s,r)=>{if("decl"===s.type&&s.prop===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("decl"===e.type)return t(e,s)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("rule"===s.type&&e.test(s.selector))return t(s,r)}):this.walk((s,r)=>{if("rule"===s.type&&s.selector===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("rule"===e.type)return t(e,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]}};It.registerParse=e=>{dt=e},It.registerRule=e=>{pt=e},It.registerAtRule=e=>{ft=e},It.registerRoot=e=>{mt=e};var kt=It;It.default=It,It.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,ft.prototype):"rule"===e.type?Object.setPrototypeOf(e,pt.prototype):"decl"===e.type?Object.setPrototypeOf(e,wt.prototype):"comment"===e.type?Object.setPrototypeOf(e,vt.prototype):"root"===e.type&&Object.setPrototypeOf(e,mt.prototype),e[yt]=!0,e.nodes&&e.nodes.forEach(e=>{It.rebuild(e)})};let xt,Ot,Et=kt,Mt=class extends Et{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new xt(new Ot,this,e).stringify()}};Mt.registerLazyResult=e=>{xt=e},Mt.registerProcessor=e=>{Ot=e};var Rt=Mt;Mt.default=Mt;let At={};var Tt=function(e){At[e]||(At[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Nt=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var Lt=Nt;Nt.default=Nt;let Ft=Lt,Dt=class{constructor(e,t,s){this.processor=e,this.messages=[],this.root=t,this.opts=s,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 s=new Ft(e,t);return this.messages.push(s),s}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Pt=Dt;Dt.default=Dt;const _t="'".charCodeAt(0),Ut='"'.charCodeAt(0),Bt="\\".charCodeAt(0),zt="/".charCodeAt(0),jt="\n".charCodeAt(0),$t=" ".charCodeAt(0),Wt="\f".charCodeAt(0),Vt="\t".charCodeAt(0),Gt="\r".charCodeAt(0),Yt="[".charCodeAt(0),Kt="]".charCodeAt(0),Zt="(".charCodeAt(0),Jt=")".charCodeAt(0),Ht="{".charCodeAt(0),Xt="}".charCodeAt(0),qt=";".charCodeAt(0),Qt="*".charCodeAt(0),es=":".charCodeAt(0),ts="@".charCodeAt(0),ss=/[\t\n\f\r "#'()/;[\\\]{}]/g,rs=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,ns=/.[\r\n"'(/\\]/,os=/[\da-f]/i;let is=kt,as=class extends is{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var ls=as;as.default=as,is.registerAtRule(as);let cs,hs,us=kt,ds=class extends us{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,s){let r=super.normalize(e);if(t)if("prepend"===s)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before;return r}removeChild(e,t){let s=this.index(e);return!t&&0===s&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(e)}toResult(e={}){return new cs(new hs,this,e).stringify()}};ds.registerLazyResult=e=>{cs=e},ds.registerProcessor=e=>{hs=e};var ps=ds;ds.default=ds,us.registerRoot(ds);let fs={comma:e=>fs.split(e,[","],!0),space:e=>fs.split(e,[" ","\n","\t"]),split(e,t,s){let r=[],n="",o=!1,i=0,a=!1,l="",c=!1;for(let s of e)c?c=!1:"\\"===s?c=!0:a?s===l&&(a=!1):'"'===s||"'"===s?(a=!0,l=s):"("===s?i+=1:")"===s?i>0&&(i-=1):0===i&&t.includes(s)&&(o=!0),o?(""!==n&&r.push(n.trim()),n="",o=!1):n+=s;return(s||""!==n)&&r.push(n.trim()),r}};var ms=fs;fs.default=fs;let gs=kt,ys=ms,ws=class extends gs{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return ys.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,s=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(s)}};var vs=ws;ws.default=ws,gs.registerRule(ws);let bs=Ee,Ss=function(e,t={}){let s,r,n,o,i,a,l,c,h,u,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,m=0,g=[],y=[];function w(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(s=d.charCodeAt(m),s){case jt:case $t:case Vt:case Gt:case Wt:r=m;do{r+=1,s=d.charCodeAt(r)}while(s===$t||s===jt||s===Vt||s===Gt||s===Wt);u=["space",d.slice(m,r)],m=r-1;break;case Yt:case Kt:case Ht:case Xt:case es:case qt:case Jt:{let e=String.fromCharCode(s);u=[e,e,m];break}case Zt:if(c=g.length?g.pop()[1]:"",h=d.charCodeAt(m+1),"url"===c&&h!==_t&&h!==Ut&&h!==$t&&h!==jt&&h!==Vt&&h!==Wt&&h!==Gt){r=m;do{if(a=!1,r=d.indexOf(")",r+1),-1===r){if(p||t){r=m;break}w("bracket")}for(l=r;d.charCodeAt(l-1)===Bt;)l-=1,a=!a}while(a);u=["brackets",d.slice(m,r+1),m,r],m=r}else r=d.indexOf(")",m+1),o=d.slice(m,r+1),-1===r||ns.test(o)?u=["(","(",m]:(u=["brackets",o,m,r],m=r);break;case _t:case Ut:n=s===_t?"'":'"',r=m;do{if(a=!1,r=d.indexOf(n,r+1),-1===r){if(p||t){r=m+1;break}w("string")}for(l=r;d.charCodeAt(l-1)===Bt;)l-=1,a=!a}while(a);u=["string",d.slice(m,r+1),m,r],m=r;break;case ts:ss.lastIndex=m+1,ss.test(d),r=0===ss.lastIndex?d.length-1:ss.lastIndex-2,u=["at-word",d.slice(m,r+1),m,r],m=r;break;case Bt:for(r=m,i=!0;d.charCodeAt(r+1)===Bt;)r+=1,i=!i;if(s=d.charCodeAt(r+1),i&&s!==zt&&s!==$t&&s!==jt&&s!==Vt&&s!==Gt&&s!==Wt&&(r+=1,os.test(d.charAt(r)))){for(;os.test(d.charAt(r+1));)r+=1;d.charCodeAt(r+1)===$t&&(r+=1)}u=["word",d.slice(m,r+1),m,r],m=r;break;default:s===zt&&d.charCodeAt(m+1)===Qt?(r=d.indexOf("*/",m+2)+1,0===r&&(p||t?r=d.length:w("comment")),u=["comment",d.slice(m,r+1),m,r],m=r):(rs.lastIndex=m+1,rs.test(d),r=0===rs.lastIndex?d.length-1:rs.lastIndex-2,u=["word",d.slice(m,r+1),m,r],g.push(u),m=r)}return m++,u},position:function(){return m}}},Cs=ut,Is=ls,ks=ps,xs=vs;const Os={empty:!0,space:!0};let Es=kt,Ms=class{constructor(e){this.input=e,this.root=new ks,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,s,r,n=new Is;n.name=e[1].slice(1),""===n.name&&this.unnamedAtrule(n,e),this.init(n,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){n.source.end=this.getPosition(e[2]),n.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,s=a[r];s&&"space"===s[0];)s=a[--r];s&&(n.source.end=this.getPosition(s[3]||s[2]),n.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(n.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(n,"params",a),o&&(e=a[a.length-1],n.source.end=this.getPosition(e[3]||e[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),i&&(n.nodes=[],this.current=n)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let s,r=0;for(let n=t-1;n>=0&&(s=e[n],"space"===s[0]||(r+=1,2!==r));n--);throw this.input.error("Missed semicolon","word"===s[0]?s[3]+1:s[2])}colon(e){let t,s,r,n=0;for(let[o,i]of e.entries()){if(t=i,s=t[0],"("===s&&(n+=1),")"===s&&(n-=1),0===n&&":"===s){if(r){if("word"===r[0]&&"progid"===r[1])continue;return o}this.doubleColon(t)}r=t}return!1}comment(e){let t=new Cs;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let s=e[1].slice(2,-2);if(/^\s*$/.test(s))t.text="",t.raws.left=s,t.raws.right="";else{let e=s.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=Ss(this.input)}decl(e,t){let s=new bs;this.init(s,e[0][2]);let r,n=e[e.length-1];for(";"===n[0]&&(this.semicolon=!0,e.pop()),s.source.end=this.getPosition(n[3]||n[2]||function(e){for(let t=e.length-1;t>=0;t--){let s=e[t],r=s[3]||s[2];if(r)return r}}(e)),s.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),s.raws.before+=e.shift()[1];for(s.source.start=this.getPosition(e[0][2]),s.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;s.prop+=e.shift()[1]}for(s.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){s.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),s.raws.between+=r[1]}"_"!==s.prop[0]&&"*"!==s.prop[0]||(s.raws.before+=s.prop[0],s.prop=s.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){s.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(s.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),n="";for(let e=t;e>0;e--){let t=r[e][0];if(0===n.trim().indexOf("!")&&"space"!==t)break;n=r.pop()[1]+n}0===n.trim().indexOf("!")&&(s.important=!0,s.raws.important=n,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(s,"value",i.concat(e),t),s.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 xs;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,s=null,r=!1,n=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(s=l[0],a.push(l),"("===s||"["===s)n||(n=l),o.push("("===s?")":"]");else if(i&&r&&"{"===s)n||(n=l),o.push("}");else if(0===o.length){if(";"===s){if(r)return void this.decl(a,i);break}if("{"===s)return void this.rule(a);if("}"===s){this.tokenizer.back(a.pop()),t=!0;break}":"===s&&(r=!0)}else s===o[o.length-1]&&(o.pop(),0===o.length&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&r){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,s,r){let n,o,i,a,l=s.length,c="",h=!0;for(let e=0;e<l;e+=1)n=s[e],o=n[0],"space"!==o||e!==l-1||r?"comment"===o?(a=s[e-1]?s[e-1][0]:"empty",i=s[e+1]?s[e+1][0]:"empty",Os[a]||Os[i]||","===c.slice(-1)?h=!1:c+=n[1]):c+=n[1]:h=!1;if(!h){let r=s.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new xs;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)s=e.pop()[1]+s;return s}spacesAndCommentsFromStart(e){let t,s="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)s+=e.shift()[1];return s}spacesFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)s=e.pop()[1]+s;return s}stringFrom(e,t){let s="";for(let r=t;r<e.length;r++)s+=e[r][1];return e.splice(t,e.length-t),s}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})}},Rs=Xe;function As(e,t){let s=new Rs(e,t),r=new Ms(s);try{r.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return r.root}var Ts=As;As.default=As,Es.registerParse(As);let{isClean:Ns,my:Ls}=he,Fs=lt,Ds=ge,Ps=kt,_s=Rt,Us=Tt,Bs=Pt,zs=Ts,js=ps;const $s={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Ws={AtRule:!0,AtRuleExit:!0,Comment:!0,CommentExit:!0,Declaration:!0,DeclarationExit:!0,Document:!0,DocumentExit:!0,Once:!0,OnceExit:!0,postcssPlugin:!0,prepare:!0,Root:!0,RootExit:!0,Rule:!0,RuleExit:!0},Vs={Once:!0,postcssPlugin:!0,prepare:!0};function Gs(e){return"object"==typeof e&&"function"==typeof e.then}function Ys(e){let t=!1,s=$s[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[s,s+"-"+t,0,s+"Exit",s+"Exit-"+t]:t?[s,s+"-"+t,s+"Exit",s+"Exit-"+t]:e.append?[s,0,s+"Exit"]:[s,s+"Exit"]}function Ks(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Ys(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Zs(e){return e[Ns]=!1,e.nodes&&e.nodes.forEach(e=>Zs(e)),e}let Js={},Hs=class e{constructor(t,s,r){let n;if(this.stringified=!1,this.processed=!1,"object"!=typeof s||null===s||"root"!==s.type&&"document"!==s.type)if(s instanceof e||s instanceof Bs)n=Zs(s.root),s.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=s.map);else{let e=zs;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(s,r)}catch(e){this.processed=!0,this.error=e}n&&!n[Ls]&&Ps.rebuild(n)}else n=Zs(s);this.result=new Bs(t,n,r),this.helpers={...Js,postcss:Js,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let s=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(s.postcssVersion&&"production"!==process.env.NODE_ENV){let e=s.postcssPlugin,t=s.postcssVersion,r=this.result.processor.version,n=t.split("."),o=r.split(".");(n[0]!==o[0]||parseInt(n[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+r+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=s.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,s)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,s])};for(let t of this.plugins)if("object"==typeof t)for(let s in t){if(!Ws[s]&&/^[A-Z]/.test(s))throw new Error(`Unknown event ${s} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Vs[s])if("object"==typeof t[s])for(let r in t[s])e(t,"*"===r?s:s+"-"+r.toLowerCase(),t[s][r]);else"function"==typeof t[s]&&e(t,s,t[s])}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],s=this.runOnRoot(t);if(Gs(s))try{await s}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ns];){e[Ns]=!0;let t=[Ks(e)];for(;t.length>0;){let e=this.visitTick(t);if(Gs(e))try{await e}catch(e){let s=t[t.length-1].node;throw this.handleError(e,s)}}}if(this.listeners.OnceExit)for(let[t,s]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>s(e,this.helpers));await Promise.all(t)}else await s(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return Gs(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Ds;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new Fs(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){if(Gs(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ns];)e[Ns]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||Us("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[s,r]of e){let e;this.result.lastPlugin=s;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(Gs(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:s,visitors:r}=t;if("root"!==s.type&&"document"!==s.type&&!s.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,n]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return n(s.toProxy(),this.helpers)}catch(e){throw this.handleError(e,s)}}if(0!==t.iterator){let r,n=t.iterator;for(;r=s.nodes[s.indexes[n]];)if(s.indexes[n]+=1,!r[Ns])return r[Ns]=!0,void e.push(Ks(r));t.iterator=0,delete s.indexes[n]}let n=t.events;for(;t.eventIndex<n.length;){let e=n[t.eventIndex];if(t.eventIndex+=1,0===e)return void(s.nodes&&s.nodes.length&&(s[Ns]=!0,t.iterator=s.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Ns]=!0;let t=Ys(e);for(let s of t)if(0===s)e.nodes&&e.each(e=>{e[Ns]||this.walkSync(e)});else{let t=this.listeners[s];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};Hs.registerPostcss=e=>{Js=e};var Xs=Hs;Hs.default=Hs,js.registerLazyResult(Hs),_s.registerLazyResult(Hs);let qs=lt,Qs=ge,er=Tt,tr=Ts;const sr=Pt;let rr=class{constructor(e,t,s){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=s,this._map=void 0;let n=Qs;this.result=new sr(this._processor,r,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new qs(n,r,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||er("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=tr;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var nr=rr;rr.default=rr;let or=nr,ir=Xs,ar=Rt,lr=ps,cr=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let s of e)if(!0===s.postcss?s=s():s.postcss&&(s=s.postcss),"object"==typeof s&&Array.isArray(s.plugins))t=t.concat(s.plugins);else if("object"==typeof s&&s.postcssPlugin)t.push(s);else if("function"==typeof s)t.push(s);else{if("object"!=typeof s||!s.parse&&!s.stringify)throw new Error(s+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new ir(this,e,t):new or(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var hr=cr;cr.default=cr,lr.registerProcessor(cr),ar.registerProcessor(cr);let ur=Ee,dr=Pe,pr=ut,fr=ls,mr=Xe,gr=ps,yr=vs;function wr(e,t){if(Array.isArray(e))return e.map(e=>wr(e));let{inputs:s,...r}=e;if(s){t=[];for(let e of s){let s={...e,__proto__:mr.prototype};s.map&&(s.map={...s.map,__proto__:dr.prototype}),t.push(s)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>wr(e,t))),r.source){let{inputId:e,...s}=r.source;r.source=s,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new gr(r);if("decl"===r.type)return new ur(r);if("rule"===r.type)return new yr(r);if("comment"===r.type)return new pr(r);if("atrule"===r.type)return new fr(r);throw new Error("Unknown node type: "+e.type)}var vr=wr;wr.default=wr;let br=ce,Sr=Ee,Cr=Xs,Ir=kt,kr=hr,xr=ge,Or=vr,Er=Rt,Mr=Lt,Rr=ut,Ar=ls,Tr=Pt,Nr=Xe,Lr=Ts,Fr=ms,Dr=vs,Pr=ps,_r=ke;function Ur(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new kr(e)}Ur.plugin=function(e,t){let s,r=!1;function n(...s){console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let n=t(...s);return n.postcssPlugin=e,n.postcssVersion=(new kr).version,n}return Object.defineProperty(n,"postcss",{get:()=>(s||(s=n()),s)}),n.process=function(e,t,s){return Ur([n(s)]).process(e,t)},n},Ur.stringify=xr,Ur.parse=Lr,Ur.fromJSON=Or,Ur.list=Fr,Ur.comment=e=>new Rr(e),Ur.atRule=e=>new Ar(e),Ur.decl=e=>new Sr(e),Ur.rule=e=>new Dr(e),Ur.root=e=>new Pr(e),Ur.document=e=>new Er(e),Ur.CssSyntaxError=br,Ur.Declaration=Sr,Ur.Container=Ir,Ur.Processor=kr,Ur.Document=Er,Ur.Comment=Rr,Ur.Warning=Mr,Ur.AtRule=Ar,Ur.Result=Tr,Ur.Input=Nr,Ur.Rule=Dr,Ur.Root=Pr,Ur.Node=_r,Cr.registerPostcss(Ur);var Br=Ur;Ur.default=Ur;const zr=Q(Br);zr.stringify,zr.fromJSON,zr.plugin,zr.parse,zr.list,zr.document,zr.comment,zr.atRule,zr.rule,zr.decl,zr.root,zr.CssSyntaxError,zr.Declaration,zr.Container,zr.Processor,zr.Document,zr.Comment,zr.Warning,zr.AtRule,zr.Result,zr.Input,zr.Rule,zr.Root,zr.Node;var jr=Object.defineProperty,$r=(e,t,s)=>((e,t,s)=>t in e?jr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s)(e,"symbol"!=typeof t?t+"":t,s);function Wr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Vr(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var s=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(s,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),s}var Gr={exports:{}},Yr=String,Kr=function(){return{isColorSupported:!1,reset:Yr,bold:Yr,dim:Yr,italic:Yr,underline:Yr,inverse:Yr,hidden:Yr,strikethrough:Yr,black:Yr,red:Yr,green:Yr,yellow:Yr,blue:Yr,magenta:Yr,cyan:Yr,white:Yr,gray:Yr,bgBlack:Yr,bgRed:Yr,bgGreen:Yr,bgYellow:Yr,bgBlue:Yr,bgMagenta:Yr,bgCyan:Yr,bgWhite:Yr}};Gr.exports=Kr(),Gr.exports.createColors=Kr;var Zr=Gr.exports;const Jr=Vr(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let Hr=Zr,Xr=Jr,qr=class e extends Error{constructor(t,s,r,n,o,i){super(t),this.name="CssSyntaxError",this.reason=t,o&&(this.file=o),n&&(this.source=n),i&&(this.plugin=i),void 0!==s&&void 0!==r&&("number"==typeof s?(this.line=s,this.column=r):(this.line=s.line,this.column=s.column,this.endLine=r.line,this.endColumn=r.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,e)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",void 0!==this.line&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;null==e&&(e=Hr.isColorSupported),Xr&&e&&(t=Xr(t));let s,r,n=t.split(/\r?\n/),o=Math.max(this.line-3,0),i=Math.min(this.line+2,n.length),a=String(i).length;if(e){let{bold:e,gray:t,red:n}=Hr.createColors(!0);s=t=>e(n(t)),r=e=>t(e)}else s=r=e=>e;return n.slice(o,i).map((e,t)=>{let n=o+1+t,i=" "+(" "+n).slice(-a)+" | ";if(n===this.line){let t=r(i.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return s(">")+r(i)+e+"\n "+t+s("^")}return" "+r(i)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var Qr=qr;qr.default=qr;var en={};en.isClean=Symbol("isClean"),en.my=Symbol("my");const tn={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let sn=class{constructor(e){this.builder=e}atrule(e,t){let s="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?s+=e.raws.afterName:r&&(s+=" "),e.nodes)this.block(e,s+r);else{let n=(e.raws.between||"")+(t?";":"");this.builder(s+r+n,e)}}beforeAfter(e,t){let s;s="decl"===e.type?this.raw(e,null,"beforeDecl"):"comment"===e.type?this.raw(e,null,"beforeComment"):"before"===t?this.raw(e,null,"beforeRule"):this.raw(e,null,"beforeClose");let r=e.parent,n=0;for(;r&&"root"!==r.type;)n+=1,r=r.parent;if(s.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<n;e++)s+=t}return s}block(e,t){let s,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),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&&"comment"===e.nodes[t].type;)t-=1;let s=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let n=e.nodes[r],o=this.raw(n,"before");o&&this.builder(o),this.stringify(n,t!==r||s)}}comment(e){let t=this.raw(e,"left","commentLeft"),s=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+s+"*/",e)}decl(e,t){let s=this.raw(e,"between","colon"),r=e.prop+s+this.rawValue(e,"value");e.important&&(r+=e.raws.important||" !important"),t&&(r+=";"),this.builder(r,e)}document(e){this.body(e)}raw(e,t,s){let r;if(s||(s=t),t&&(r=e.raws[t],void 0!==r))return r;let n=e.parent;if("before"===s){if(!n||"root"===n.type&&n.first===e)return"";if(n&&"document"===n.type)return""}if(!n)return tn[s];let o=e.root();if(o.rawCache||(o.rawCache={}),void 0!==o.rawCache[s])return o.rawCache[s];if("before"===s||"after"===s)return this.beforeAfter(e,s);{let n="raw"+((i=s)[0].toUpperCase()+i.slice(1));this[n]?r=this[n](o,e):o.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var i;return void 0===r&&(r=tn[s]),o.rawCache[s]=r,r}rawBeforeClose(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length>0&&void 0!==e.raws.after)return t=e.raws.after,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawBeforeComment(e,t){let s;return e.walkComments(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeDecl"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeDecl(e,t){let s;return e.walkDecls(e=>{if(void 0!==e.raws.before)return s=e.raws.before,s.includes("\n")&&(s=s.replace(/[^\n]+$/,"")),!1}),void 0===s?s=this.raw(t,null,"beforeRule"):s&&(s=s.replace(/\S/g,"")),s}rawBeforeOpen(e){let t;return e.walk(e=>{if("decl"!==e.type&&(t=e.raws.between,void 0!==t))return!1}),t}rawBeforeRule(e){let t;return e.walk(s=>{if(s.nodes&&(s.parent!==e||e.first!==s)&&void 0!==s.raws.before)return t=s.raws.before,t.includes("\n")&&(t=t.replace(/[^\n]+$/,"")),!1}),t&&(t=t.replace(/\S/g,"")),t}rawColon(e){let t;return e.walkDecls(e=>{if(void 0!==e.raws.between)return t=e.raws.between.replace(/[^\s:]/g,""),!1}),t}rawEmptyBody(e){let t;return e.walk(e=>{if(e.nodes&&0===e.nodes.length&&(t=e.raws.after,void 0!==t))return!1}),t}rawIndent(e){if(e.raws.indent)return e.raws.indent;let t;return e.walk(s=>{let r=s.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==s.raws.before){let e=s.raws.before.split("\n");return t=e[e.length-1],t=t.replace(/\S/g,""),!1}}),t}rawSemicolon(e){let t;return e.walk(e=>{if(e.nodes&&e.nodes.length&&"decl"===e.last.type&&(t=e.raws.semicolon,void 0!==t))return!1}),t}rawValue(e,t){let s=e[t],r=e.raws[t];return r&&r.value===s?r.raw:s}root(e){this.body(e),e.raws.after&&this.builder(e.raws.after)}rule(e){this.block(e,this.rawValue(e,"selector")),e.raws.ownSemicolon&&this.builder(e.raws.ownSemicolon,e,"end")}stringify(e,t){if(!this[e.type])throw new Error("Unknown AST node type "+e.type+". Maybe you need to change PostCSS stringifier.");this[e.type](e,t)}};var rn=sn;sn.default=sn;let nn=rn;function on(e,t){new nn(t).stringify(e)}var an=on;on.default=on;let{isClean:ln,my:cn}=en,hn=Qr,un=rn,dn=an;function pn(e,t){let s=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let n=e[r],o=typeof n;"parent"===r&&"object"===o?t&&(s[r]=t):"source"===r?s[r]=n:Array.isArray(n)?s[r]=n.map(e=>pn(e,s)):("object"===o&&null!==n&&(n=pn(n)),s[r]=n)}return s}let fn=class{constructor(e={}){this.raws={},this[ln]=!1,this[cn]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let s of e[t])"function"==typeof s.clone?this.append(s.clone()):this.append(s)}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=pn(this);for(let s in e)t[s]=e[s];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:s,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:s.column,line:s.line},t)}return new hn(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[ln]){this[ln]=!1;let e=this;for(;e=e.parent;)e[ln]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let s=this.source.start;if(e.index)s=this.positionInside(e.index,t);else if(e.word){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(s=this.positionInside(r,t))}return s}positionInside(e,t){let s=t||this.toString(),r=this.source.start.column,n=this.source.start.line;for(let t=0;t<e;t++)"\n"===s[t]?(r=1,n+=1):r+=1;return{column:r,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},s=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 r=this.toString(),n=r.indexOf(e.word);-1!==n&&(t=this.positionInside(n,r),s=this.positionInside(n+e.word.length,r))}else e.start?t={column:e.start.column,line:e.start.line}:e.index&&(t=this.positionInside(e.index)),e.end?s={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?s=this.positionInside(e.endIndex):e.index&&(s=this.positionInside(e.index+1));return(s.line<t.line||s.line===t.line&&s.column<=t.column)&&(s={column:t.column+1,line:t.line}),{end:s,start:t}}raw(e,t){return(new un).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,s=!1;for(let r of e)r===this?s=!0:s?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);s||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let s={},r=null==t;t=t||new Map;let n=0;for(let e in this){if(!Object.prototype.hasOwnProperty.call(this,e))continue;if("parent"===e||"proxyCache"===e)continue;let r=this[e];if(Array.isArray(r))s[e]=r.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof r&&r.toJSON)s[e]=r.toJSON(null,t);else if("source"===e){let o=t.get(r.input);null==o&&(o=n,t.set(r.input,n),n++),s[e]={end:r.end,inputId:o,start:r.start}}else s[e]=r}return r&&(s.inputs=[...t.keys()].map(e=>e.toJSON())),s}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=dn){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,s){let r={node:this};for(let e in s)r[e]=s[e];return e.warn(t,r)}get proxyOf(){return this}};var mn=fn;fn.default=fn;let gn=mn,yn=class extends gn{constructor(e){e&&void 0!==e.value&&"string"!=typeof e.value&&(e={...e,value:String(e.value)}),super(e),this.type="decl"}get variable(){return this.prop.startsWith("--")||"$"===this.prop[0]}};var wn=yn;yn.default=yn;var vn={nanoid:(e=21)=>{let t="",s=e;for(;s--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:bn,SourceMapGenerator:Sn}=Jr,{existsSync:Cn,readFileSync:In}=Jr,{dirname:kn,join:xn}=Jr;let On=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let s=t.map?t.map.prev:void 0,r=this.loadMap(t.from,s);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=kn(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new bn(this.text)),this.consumerCache}decodeInline(e){if(/^data:application\/json;charset=utf-?8,/.test(e)||/^data:application\/json,/.test(e))return decodeURIComponent(e.substr(RegExp.lastMatch.length));if(/^data:application\/json;charset=utf-?8;base64,/.test(e)||/^data:application\/json;base64,/.test(e))return t=e.substr(RegExp.lastMatch.length),Buffer?Buffer.from(t,"base64").toString():window.atob(t);var t;let s=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+s)}getAnnotationURL(e){return e.replace(/^\/\*\s*# sourceMappingURL=/,"").trim()}isMap(e){return"object"==typeof e&&("string"==typeof e.mappings||"string"==typeof e._mappings||Array.isArray(e.sections))}loadAnnotation(e){let t=e.match(/\/\*\s*# sourceMappingURL=/gm);if(!t)return;let s=e.lastIndexOf(t.pop()),r=e.indexOf("*/",s);s>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(s,r)))}loadFile(e){if(this.root=kn(e),Cn(e))return this.mapFile=e,In(e,"utf-8").toString().trim()}loadMap(e,t){if(!1===t)return!1;if(t){if("string"==typeof t)return t;if("function"!=typeof t){if(t instanceof bn)return Sn.fromSourceMap(t).toString();if(t instanceof Sn)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let s=t(e);if(s){let e=this.loadFile(s);if(!e)throw new Error("Unable to load previous source map: "+s.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=xn(kn(e),t)),this.loadFile(t)}}}startWith(e,t){return!!e&&e.substr(0,t.length)===t}withContent(){return!!(this.consumer().sourcesContent&&this.consumer().sourcesContent.length>0)}};var En=On;On.default=On;let{SourceMapConsumer:Mn,SourceMapGenerator:Rn}=Jr,{fileURLToPath:An,pathToFileURL:Tn}=Jr,{isAbsolute:Nn,resolve:Ln}=Jr,{nanoid:Fn}=vn,Dn=Jr,Pn=Qr,_n=En,Un=Symbol("fromOffsetCache"),Bn=Boolean(Mn&&Rn),zn=Boolean(Ln&&Nn),jn=class{constructor(e,t={}){if(null==e||"object"==typeof e&&!e.toString)throw new Error(`PostCSS received ${e} instead of CSS string`);if(this.css=e.toString(),"\ufeff"===this.css[0]||"￾"===this.css[0]?(this.hasBOM=!0,this.css=this.css.slice(1)):this.hasBOM=!1,t.from&&(!zn||/^\w+:\/\//.test(t.from)||Nn(t.from)?this.file=t.from:this.file=Ln(t.from)),zn&&Bn){let e=new _n(this.css,t);if(e.text){this.map=e;let t=e.consumer().file;!this.file&&t&&(this.file=this.mapResolve(t))}}this.file||(this.id="<input css "+Fn(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,s,r={}){let n,o,i;if(t&&"object"==typeof t){let e=t,r=s;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,s=r.col}else t=e.line,s=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);o=e.line,i=e.col}else o=r.line,i=r.column}else if(!s){let e=this.fromOffset(t);t=e.line,s=e.col}let a=this.origin(t,s,o,i);return n=a?new Pn(e,void 0===a.endLine?a.line:{column:a.column,line:a.line},void 0===a.endLine?a.column:{column:a.endColumn,line:a.endLine},a.source,a.file,r.plugin):new Pn(e,void 0===o?t:{column:s,line:t},void 0===o?s:{column:i,line:o},this.css,this.file,r.plugin),n.input={column:s,endColumn:i,endLine:o,line:t,source:this.css},this.file&&(Tn&&(n.input.url=Tn(this.file).toString()),n.input.file=this.file),n}fromOffset(e){let t,s;if(this[Un])s=this[Un];else{let e=this.css.split("\n");s=new Array(e.length);let t=0;for(let r=0,n=e.length;r<n;r++)s[r]=t,t+=e[r].length+1;this[Un]=s}t=s[s.length-1];let r=0;if(e>=t)r=s.length-1;else{let t,n=s.length-2;for(;r<n;)if(t=r+(n-r>>1),e<s[t])n=t-1;else{if(!(e>=s[t+1])){r=t;break}r=t+1}}return{col:e-s[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Ln(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,s,r){if(!this.map)return!1;let n,o,i=this.map.consumer(),a=i.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof s&&(n=i.originalPositionFor({column:r,line:s})),o=Nn(a.source)?Tn(a.source):new URL(a.source,this.map.consumer().sourceRoot||Tn(this.map.mapFile));let l={column:a.column,endColumn:n&&n.column,endLine:n&&n.line,line:a.line,url:o.toString()};if("file:"===o.protocol){if(!An)throw new Error("file: protocol is not available in this PostCSS build");l.file=An(o)}let c=i.sourceContentFor(a.source);return c&&(l.source=c),l}toJSON(){let e={};for(let t of["hasBOM","css","file","id"])null!=this[t]&&(e[t]=this[t]);return this.map&&(e.map={...this.map},e.map.consumerCache&&(e.map.consumerCache=void 0)),e}get from(){return this.file||this.id}};var $n=jn;jn.default=jn,Dn&&Dn.registerInput&&Dn.registerInput(jn);let{SourceMapConsumer:Wn,SourceMapGenerator:Vn}=Jr,{dirname:Gn,relative:Yn,resolve:Kn,sep:Zn}=Jr,{pathToFileURL:Jn}=Jr,Hn=$n,Xn=Boolean(Wn&&Vn),qn=Boolean(Gn&&Kn&&Yn&&Zn);var Qn=class{constructor(e,t,s,r){this.stringify=e,this.mapOpts=s.map||{},this.root=t,this.opts=s,this.css=r,this.originalCSS=r,this.usesFileUrls=!this.mapOpts.from&&this.mapOpts.absolute,this.memoizedFileURLs=new Map,this.memoizedPaths=new Map,this.memoizedURLs=new Map}addAnnotation(){let e;e=this.isInline()?"data:application/json;base64,"+this.toBase64(this.map.toString()):"string"==typeof this.mapOpts.annotation?this.mapOpts.annotation:"function"==typeof this.mapOpts.annotation?this.mapOpts.annotation(this.opts.to,this.root):this.outputFile()+".map";let t="\n";this.css.includes("\r\n")&&(t="\r\n"),this.css+=t+"/*# sourceMappingURL="+e+" */"}applyPrevMaps(){for(let e of this.previous()){let t,s=this.toUrl(this.path(e.file)),r=e.root||Gn(e.file);!1===this.mapOpts.sourcesContent?(t=new Wn(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,s,this.toUrl(this.path(r)))}}clearAnnotation(){if(!1!==this.mapOpts.annotation)if(this.root){let e;for(let t=this.root.nodes.length-1;t>=0;t--)e=this.root.nodes[t],"comment"===e.type&&0===e.text.indexOf("# sourceMappingURL=")&&this.root.removeChild(t)}else this.css&&(this.css=this.css.replace(/\n*?\/\*#[\S\s]*?\*\/$/gm,""))}generate(){if(this.clearAnnotation(),qn&&Xn&&this.isMap())return this.generateMap();{let e="";return this.stringify(this.root,t=>{e+=t}),[e]}}generateMap(){if(this.root)this.generateString();else if(1===this.previous().length){let e=this.previous()[0].consumer();e.file=this.outputFile(),this.map=Vn.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new Vn({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 Vn({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,s=1,r=1,n="<no source>",o={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(i,a,l)=>{if(this.css+=i,a&&"end"!==l&&(o.generated.line=s,o.generated.column=r-1,a.source&&a.source.start?(o.source=this.sourcePath(a),o.original.line=a.source.start.line,o.original.column=a.source.start.column-1,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,this.map.addMapping(o))),e=i.match(/\n/g),e?(s+=e.length,t=i.lastIndexOf("\n"),r=i.length-t):r+=i.length,a&&"start"!==l){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(o.source=this.sourcePath(a),o.original.line=a.source.end.line,o.original.column=a.source.end.column-1,o.generated.line=s,o.generated.column=r-2,this.map.addMapping(o)):(o.source=n,o.original.line=1,o.original.column=0,o.generated.line=s,o.generated.column=r-1,this.map.addMapping(o)))}})}isAnnotation(){return!!this.isInline()||(void 0!==this.mapOpts.annotation?this.mapOpts.annotation:!this.previous().length||this.previous().some(e=>e.annotation))}isInline(){if(void 0!==this.mapOpts.inline)return this.mapOpts.inline;let e=this.mapOpts.annotation;return(void 0===e||!0===e)&&(!this.previous().length||this.previous().some(e=>e.inline))}isMap(){return void 0!==this.opts.map?!!this.opts.map:this.previous().length>0}isSourcesContent(){return void 0!==this.mapOpts.sourcesContent?this.mapOpts.sourcesContent:!this.previous().length||this.previous().some(e=>e.withContent())}outputFile(){return this.opts.to?this.path(this.opts.to):this.opts.from?this.path(this.opts.from):"to.css"}path(e){if(this.mapOpts.absolute)return e;if(60===e.charCodeAt(0))return e;if(/^\w+:\/\//.test(e))return e;let t=this.memoizedPaths.get(e);if(t)return t;let s=this.opts.to?Gn(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(s=Gn(Kn(s,this.mapOpts.annotation)));let r=Yn(s,e);return this.memoizedPaths.set(e,r),r}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 Hn(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 s=t.source.input.from;if(s&&!e[s]){e[s]=!0;let r=this.usesFileUrls?this.toFileUrl(s):this.toUrl(this.path(s));this.map.setSourceContent(r,t.source.input.css)}}});else if(this.css){let e=this.opts.from?this.toUrl(this.path(this.opts.from)):"<no source>";this.map.setSourceContent(e,this.css)}}sourcePath(e){return this.mapOpts.from?this.toUrl(this.mapOpts.from):this.usesFileUrls?this.toFileUrl(e.source.input.from):this.toUrl(this.path(e.source.input.from))}toBase64(e){return Buffer?Buffer.from(e).toString("base64"):window.btoa(unescape(encodeURIComponent(e)))}toFileUrl(e){let t=this.memoizedFileURLs.get(e);if(t)return t;if(Jn){let t=Jn(e).toString();return this.memoizedFileURLs.set(e,t),t}throw new Error("`map.absolute` option is not available in this PostCSS build")}toUrl(e){let t=this.memoizedURLs.get(e);if(t)return t;"\\"===Zn&&(e=e.replace(/\\/g,"/"));let s=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,s),s}};let eo=mn,to=class extends eo{constructor(e){super(e),this.type="comment"}};var so=to;to.default=to;let ro,no,oo,io,{isClean:ao,my:lo}=en,co=wn,ho=so,uo=mn;function po(e){return e.map(e=>(e.nodes&&(e.nodes=po(e.nodes)),delete e.source,e))}function fo(e){if(e[ao]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)fo(t)}let mo=class e extends uo{append(...e){for(let t of e){let e=this.normalize(t,this.last);for(let t of e)this.proxyOf.nodes.push(t)}return this.markDirty(),this}cleanRaws(e){if(super.cleanRaws(e),this.nodes)for(let t of this.nodes)t.cleanRaws(e)}each(e){if(!this.proxyOf.nodes)return;let t,s,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],s=e(this.proxyOf.nodes[t],t),!1!==s);)this.indexes[r]+=1;return delete this.indexes[r],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)=>"proxyOf"===t?e:e[t]?"each"===t||"string"==typeof t&&t.startsWith("walk")?(...s)=>e[t](...s.map(e=>"function"==typeof e?(t,s)=>e(t.toProxy(),s):e)):"every"===t||"some"===t?s=>e[t]((e,...t)=>s(e.toProxy(),...t)):"root"===t?()=>e.root().toProxy():"nodes"===t?e.nodes.map(e=>e.toProxy()):"first"===t||"last"===t?e[t].toProxy():e[t]:e[t],set:(e,t,s)=>(e[t]===s||(e[t]=s,"name"!==t&&"params"!==t&&"selector"!==t||e.markDirty()),!0)}}index(e){return"number"==typeof e?e:(e.proxyOf&&(e=e.proxyOf),this.proxyOf.nodes.indexOf(e))}insertAfter(e,t){let s,r=this.index(e),n=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of n)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)s=this.indexes[e],r<s&&(this.indexes[e]=s+n.length);return this.markDirty(),this}insertBefore(e,t){let s,r=this.index(e),n=0===r&&"prepend",o=this.normalize(t,this.proxyOf.nodes[r],n).reverse();r=this.index(e);for(let e of o)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)s=this.indexes[e],r<=s&&(this.indexes[e]=s+o.length);return this.markDirty(),this}normalize(t,s){if("string"==typeof t)t=po(ro(t).nodes);else if(void 0===t)t=[];else if(Array.isArray(t)){t=t.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if("root"===t.type&&"document"!==this.type){t=t.nodes.slice(0);for(let e of t)e.parent&&e.parent.removeChild(e,"ignore")}else if(t.type)t=[t];else if(t.prop){if(void 0===t.value)throw new Error("Value field is missed in node creation");"string"!=typeof t.value&&(t.value=String(t.value)),t=[new co(t)]}else if(t.selector)t=[new no(t)];else if(t.name)t=[new oo(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new ho(t)]}return t.map(t=>(t[lo]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[ao]&&fo(t),void 0===t.raws.before&&s&&void 0!==s.raws.before&&(t.raws.before=s.raws.before.replace(/\S/g,"")),t.parent=this.proxyOf,t))}prepend(...e){e=e.reverse();for(let t of e){let e=this.normalize(t,this.first,"prepend").reverse();for(let t of e)this.proxyOf.nodes.unshift(t);for(let t in this.indexes)this.indexes[t]=this.indexes[t]+e.length}return this.markDirty(),this}push(e){return e.parent=this,this.proxyOf.nodes.push(e),this}removeAll(){for(let e of this.proxyOf.nodes)e.parent=void 0;return this.proxyOf.nodes=[],this.markDirty(),this}removeChild(e){let t;e=this.index(e),this.proxyOf.nodes[e].parent=void 0,this.proxyOf.nodes.splice(e,1);for(let s in this.indexes)t=this.indexes[s],t>=e&&(this.indexes[s]=t-1);return this.markDirty(),this}replaceValues(e,t,s){return s||(s=t,t={}),this.walkDecls(r=>{t.props&&!t.props.includes(r.prop)||t.fast&&!r.value.includes(t.fast)||(r.value=r.value.replace(e,s))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,s)=>{let r;try{r=e(t,s)}catch(e){throw t.addToError(e)}return!1!==r&&t.walk&&(r=t.walk(e)),r})}walkAtRules(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("atrule"===s.type&&e.test(s.name))return t(s,r)}):this.walk((s,r)=>{if("atrule"===s.type&&s.name===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("atrule"===e.type)return t(e,s)}))}walkComments(e){return this.walk((t,s)=>{if("comment"===t.type)return e(t,s)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("decl"===s.type&&e.test(s.prop))return t(s,r)}):this.walk((s,r)=>{if("decl"===s.type&&s.prop===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("decl"===e.type)return t(e,s)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((s,r)=>{if("rule"===s.type&&e.test(s.selector))return t(s,r)}):this.walk((s,r)=>{if("rule"===s.type&&s.selector===e)return t(s,r)}):(t=e,this.walk((e,s)=>{if("rule"===e.type)return t(e,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]}};mo.registerParse=e=>{ro=e},mo.registerRule=e=>{no=e},mo.registerAtRule=e=>{oo=e},mo.registerRoot=e=>{io=e};var go=mo;mo.default=mo,mo.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,oo.prototype):"rule"===e.type?Object.setPrototypeOf(e,no.prototype):"decl"===e.type?Object.setPrototypeOf(e,co.prototype):"comment"===e.type?Object.setPrototypeOf(e,ho.prototype):"root"===e.type&&Object.setPrototypeOf(e,io.prototype),e[lo]=!0,e.nodes&&e.nodes.forEach(e=>{mo.rebuild(e)})};let yo,wo,vo=go,bo=class extends vo{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new yo(new wo,this,e).stringify()}};bo.registerLazyResult=e=>{yo=e},bo.registerProcessor=e=>{wo=e};var So=bo;bo.default=bo;let Co={};var Io=function(e){Co[e]||(Co[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let ko=class{constructor(e,t={}){if(this.type="warning",this.text=e,t.node&&t.node.source){let e=t.node.rangeBy(t);this.line=e.start.line,this.column=e.start.column,this.endLine=e.end.line,this.endColumn=e.end.column}for(let e in t)this[e]=t[e]}toString(){return this.node?this.node.error(this.text,{index:this.index,plugin:this.plugin,word:this.word}).message:this.plugin?this.plugin+": "+this.text:this.text}};var xo=ko;ko.default=ko;let Oo=xo,Eo=class{constructor(e,t,s){this.processor=e,this.messages=[],this.root=t,this.opts=s,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 s=new Oo(e,t);return this.messages.push(s),s}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Mo=Eo;Eo.default=Eo;const Ro="'".charCodeAt(0),Ao='"'.charCodeAt(0),To="\\".charCodeAt(0),No="/".charCodeAt(0),Lo="\n".charCodeAt(0),Fo=" ".charCodeAt(0),Do="\f".charCodeAt(0),Po="\t".charCodeAt(0),_o="\r".charCodeAt(0),Uo="[".charCodeAt(0),Bo="]".charCodeAt(0),zo="(".charCodeAt(0),jo=")".charCodeAt(0),$o="{".charCodeAt(0),Wo="}".charCodeAt(0),Vo=";".charCodeAt(0),Go="*".charCodeAt(0),Yo=":".charCodeAt(0),Ko="@".charCodeAt(0),Zo=/[\t\n\f\r "#'()/;[\\\]{}]/g,Jo=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,Ho=/.[\r\n"'(/\\]/,Xo=/[\da-f]/i;let qo=go,Qo=class extends qo{constructor(e){super(e),this.type="atrule"}append(...e){return this.proxyOf.nodes||(this.nodes=[]),super.append(...e)}prepend(...e){return this.proxyOf.nodes||(this.nodes=[]),super.prepend(...e)}};var ei=Qo;Qo.default=Qo,qo.registerAtRule(Qo);let ti,si,ri=go,ni=class extends ri{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,s){let r=super.normalize(e);if(t)if("prepend"===s)this.nodes.length>1?t.raws.before=this.nodes[1].raws.before:delete t.raws.before;else if(this.first!==t)for(let e of r)e.raws.before=t.raws.before;return r}removeChild(e,t){let s=this.index(e);return!t&&0===s&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[s].raws.before),super.removeChild(e)}toResult(e={}){return new ti(new si,this,e).stringify()}};ni.registerLazyResult=e=>{ti=e},ni.registerProcessor=e=>{si=e};var oi=ni;ni.default=ni,ri.registerRoot(ni);let ii={comma:e=>ii.split(e,[","],!0),space:e=>ii.split(e,[" ","\n","\t"]),split(e,t,s){let r=[],n="",o=!1,i=0,a=!1,l="",c=!1;for(let s of e)c?c=!1:"\\"===s?c=!0:a?s===l&&(a=!1):'"'===s||"'"===s?(a=!0,l=s):"("===s?i+=1:")"===s?i>0&&(i-=1):0===i&&t.includes(s)&&(o=!0),o?(""!==n&&r.push(n.trim()),n="",o=!1):n+=s;return(s||""!==n)&&r.push(n.trim()),r}};var ai=ii;ii.default=ii;let li=go,ci=ai,hi=class extends li{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return ci.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,s=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(s)}};var ui=hi;hi.default=hi,li.registerRule(hi);let di=wn,pi=function(e,t={}){let s,r,n,o,i,a,l,c,h,u,d=e.css.valueOf(),p=t.ignoreErrors,f=d.length,m=0,g=[],y=[];function w(t){throw e.error("Unclosed "+t,m)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&m>=f},nextToken:function(e){if(y.length)return y.pop();if(m>=f)return;let t=!!e&&e.ignoreUnclosed;switch(s=d.charCodeAt(m),s){case Lo:case Fo:case Po:case _o:case Do:r=m;do{r+=1,s=d.charCodeAt(r)}while(s===Fo||s===Lo||s===Po||s===_o||s===Do);u=["space",d.slice(m,r)],m=r-1;break;case Uo:case Bo:case $o:case Wo:case Yo:case Vo:case jo:{let e=String.fromCharCode(s);u=[e,e,m];break}case zo:if(c=g.length?g.pop()[1]:"",h=d.charCodeAt(m+1),"url"===c&&h!==Ro&&h!==Ao&&h!==Fo&&h!==Lo&&h!==Po&&h!==Do&&h!==_o){r=m;do{if(a=!1,r=d.indexOf(")",r+1),-1===r){if(p||t){r=m;break}w("bracket")}for(l=r;d.charCodeAt(l-1)===To;)l-=1,a=!a}while(a);u=["brackets",d.slice(m,r+1),m,r],m=r}else r=d.indexOf(")",m+1),o=d.slice(m,r+1),-1===r||Ho.test(o)?u=["(","(",m]:(u=["brackets",o,m,r],m=r);break;case Ro:case Ao:n=s===Ro?"'":'"',r=m;do{if(a=!1,r=d.indexOf(n,r+1),-1===r){if(p||t){r=m+1;break}w("string")}for(l=r;d.charCodeAt(l-1)===To;)l-=1,a=!a}while(a);u=["string",d.slice(m,r+1),m,r],m=r;break;case Ko:Zo.lastIndex=m+1,Zo.test(d),r=0===Zo.lastIndex?d.length-1:Zo.lastIndex-2,u=["at-word",d.slice(m,r+1),m,r],m=r;break;case To:for(r=m,i=!0;d.charCodeAt(r+1)===To;)r+=1,i=!i;if(s=d.charCodeAt(r+1),i&&s!==No&&s!==Fo&&s!==Lo&&s!==Po&&s!==_o&&s!==Do&&(r+=1,Xo.test(d.charAt(r)))){for(;Xo.test(d.charAt(r+1));)r+=1;d.charCodeAt(r+1)===Fo&&(r+=1)}u=["word",d.slice(m,r+1),m,r],m=r;break;default:s===No&&d.charCodeAt(m+1)===Go?(r=d.indexOf("*/",m+2)+1,0===r&&(p||t?r=d.length:w("comment")),u=["comment",d.slice(m,r+1),m,r],m=r):(Jo.lastIndex=m+1,Jo.test(d),r=0===Jo.lastIndex?d.length-1:Jo.lastIndex-2,u=["word",d.slice(m,r+1),m,r],g.push(u),m=r)}return m++,u},position:function(){return m}}},fi=so,mi=ei,gi=oi,yi=ui;const wi={empty:!0,space:!0};let vi=go,bi=class{constructor(e){this.input=e,this.root=new gi,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,s,r,n=new mi;n.name=e[1].slice(1),""===n.name&&this.unnamedAtrule(n,e),this.init(n,e[2]);let o=!1,i=!1,a=[],l=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?l.push("("===t?")":"]"):"{"===t&&l.length>0?l.push("}"):t===l[l.length-1]&&l.pop(),0===l.length){if(";"===t){n.source.end=this.getPosition(e[2]),n.source.end.offset++,this.semicolon=!0;break}if("{"===t){i=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,s=a[r];s&&"space"===s[0];)s=a[--r];s&&(n.source.end=this.getPosition(s[3]||s[2]),n.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){o=!0;break}}n.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(n.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(n,"params",a),o&&(e=a[a.length-1],n.source.end=this.getPosition(e[3]||e[2]),n.source.end.offset++,this.spaces=n.raws.between,n.raws.between="")):(n.raws.afterName="",n.params=""),i&&(n.nodes=[],this.current=n)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let s,r=0;for(let n=t-1;n>=0&&(s=e[n],"space"===s[0]||(r+=1,2!==r));n--);throw this.input.error("Missed semicolon","word"===s[0]?s[3]+1:s[2])}colon(e){let t,s,r,n=0;for(let[o,i]of e.entries()){if(t=i,s=t[0],"("===s&&(n+=1),")"===s&&(n-=1),0===n&&":"===s){if(r){if("word"===r[0]&&"progid"===r[1])continue;return o}this.doubleColon(t)}r=t}return!1}comment(e){let t=new fi;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let s=e[1].slice(2,-2);if(/^\s*$/.test(s))t.text="",t.raws.left=s,t.raws.right="";else{let e=s.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=pi(this.input)}decl(e,t){let s=new di;this.init(s,e[0][2]);let r,n=e[e.length-1];for(";"===n[0]&&(this.semicolon=!0,e.pop()),s.source.end=this.getPosition(n[3]||n[2]||function(e){for(let t=e.length-1;t>=0;t--){let s=e[t],r=s[3]||s[2];if(r)return r}}(e)),s.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),s.raws.before+=e.shift()[1];for(s.source.start=this.getPosition(e[0][2]),s.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;s.prop+=e.shift()[1]}for(s.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){s.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),s.raws.between+=r[1]}"_"!==s.prop[0]&&"*"!==s.prop[0]||(s.raws.before+=s.prop[0],s.prop=s.prop.slice(1));let o,i=[];for(;e.length&&(o=e[0][0],"space"===o||"comment"===o);)i.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){s.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(s.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),n="";for(let e=t;e>0;e--){let t=r[e][0];if(0===n.trim().indexOf("!")&&"space"!==t)break;n=r.pop()[1]+n}0===n.trim().indexOf("!")&&(s.important=!0,s.raws.important=n,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(s.raws.between+=i.map(e=>e[1]).join(""),i=[]),this.raw(s,"value",i.concat(e),t),s.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 yi;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let e=this.current.nodes[this.current.nodes.length-1];e&&"rule"===e.type&&!e.raws.ownSemicolon&&(e.raws.ownSemicolon=this.spaces,this.spaces="")}}getPosition(e){let t=this.input.fromOffset(e);return{column:t.col,line:t.line,offset:e}}init(e,t){this.current.push(e),e.source={input:this.input,start:this.getPosition(t)},e.raws.before=this.spaces,this.spaces="","comment"!==e.type&&(this.semicolon=!1)}other(e){let t=!1,s=null,r=!1,n=null,o=[],i=e[1].startsWith("--"),a=[],l=e;for(;l;){if(s=l[0],a.push(l),"("===s||"["===s)n||(n=l),o.push("("===s?")":"]");else if(i&&r&&"{"===s)n||(n=l),o.push("}");else if(0===o.length){if(";"===s){if(r)return void this.decl(a,i);break}if("{"===s)return void this.rule(a);if("}"===s){this.tokenizer.back(a.pop()),t=!0;break}":"===s&&(r=!0)}else s===o[o.length-1]&&(o.pop(),0===o.length&&(n=null));l=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),o.length>0&&this.unclosedBracket(n),t&&r){if(!i)for(;a.length&&(l=a[a.length-1][0],"space"===l||"comment"===l);)this.tokenizer.back(a.pop());this.decl(a,i)}else this.unknownWord(a)}parse(){let e;for(;!this.tokenizer.endOfFile();)switch(e=this.tokenizer.nextToken(),e[0]){case"space":this.spaces+=e[1];break;case";":this.freeSemicolon(e);break;case"}":this.end(e);break;case"comment":this.comment(e);break;case"at-word":this.atrule(e);break;case"{":this.emptyRule(e);break;default:this.other(e)}this.endFile()}precheckMissedSemicolon(){}raw(e,t,s,r){let n,o,i,a,l=s.length,c="",h=!0;for(let e=0;e<l;e+=1)n=s[e],o=n[0],"space"!==o||e!==l-1||r?"comment"===o?(a=s[e-1]?s[e-1][0]:"empty",i=s[e+1]?s[e+1][0]:"empty",wi[a]||wi[i]||","===c.slice(-1)?h=!1:c+=n[1]):c+=n[1]:h=!1;if(!h){let r=s.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:c}}e[t]=c}rule(e){e.pop();let t=new yi;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)s=e.pop()[1]+s;return s}spacesAndCommentsFromStart(e){let t,s="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)s+=e.shift()[1];return s}spacesFromEnd(e){let t,s="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)s=e.pop()[1]+s;return s}stringFrom(e,t){let s="";for(let r=t;r<e.length;r++)s+=e[r][1];return e.splice(t,e.length-t),s}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})}},Si=$n;function Ci(e,t){let s=new Si(e,t),r=new bi(s);try{r.parse()}catch(e){throw"production"!==process.env.NODE_ENV&&"CssSyntaxError"===e.name&&t&&t.from&&(/\.scss$/i.test(t.from)?e.message+="\nYou tried to parse SCSS with the standard CSS parser; try again with the postcss-scss parser":/\.sass/i.test(t.from)?e.message+="\nYou tried to parse Sass with the standard CSS parser; try again with the postcss-sass parser":/\.less$/i.test(t.from)&&(e.message+="\nYou tried to parse Less with the standard CSS parser; try again with the postcss-less parser")),e}return r.root}var Ii=Ci;Ci.default=Ci,vi.registerParse(Ci);let{isClean:ki,my:xi}=en,Oi=Qn,Ei=an,Mi=go,Ri=So,Ai=Io,Ti=Mo,Ni=Ii,Li=oi;const Fi={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Di={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},Pi={Once:!0,postcssPlugin:!0,prepare:!0};function _i(e){return"object"==typeof e&&"function"==typeof e.then}function Ui(e){let t=!1,s=Fi[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[s,s+"-"+t,0,s+"Exit",s+"Exit-"+t]:t?[s,s+"-"+t,s+"Exit",s+"Exit-"+t]:e.append?[s,0,s+"Exit"]:[s,s+"Exit"]}function Bi(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:Ui(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function zi(e){return e[ki]=!1,e.nodes&&e.nodes.forEach(e=>zi(e)),e}let ji={},$i=class e{constructor(t,s,r){let n;if(this.stringified=!1,this.processed=!1,"object"!=typeof s||null===s||"root"!==s.type&&"document"!==s.type)if(s instanceof e||s instanceof Ti)n=zi(s.root),s.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=s.map);else{let e=Ni;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{n=e(s,r)}catch(e){this.processed=!0,this.error=e}n&&!n[xi]&&Mi.rebuild(n)}else n=zi(s);this.result=new Ti(t,n,r),this.helpers={...ji,postcss:ji,result:this.result},this.plugins=this.processor.plugins.map(e=>"object"==typeof e&&e.prepare?{...e,...e.prepare(this.result)}:e)}async(){return this.error?Promise.reject(this.error):this.processed?Promise.resolve(this.result):(this.processing||(this.processing=this.runAsync()),this.processing)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}getAsyncError(){throw new Error("Use process(css).then(cb) to work with async plugins")}handleError(e,t){let s=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(s.postcssVersion&&"production"!==process.env.NODE_ENV){let e=s.postcssPlugin,t=s.postcssVersion,r=this.result.processor.version,n=t.split("."),o=r.split(".");(n[0]!==o[0]||parseInt(n[1])>parseInt(o[1]))&&console.error("Unknown error from PostCSS plugin. Your current PostCSS version is "+r+", but "+e+" uses "+t+". Perhaps this is the source of the error below.")}}else e.plugin=s.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,s)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,s])};for(let t of this.plugins)if("object"==typeof t)for(let s in t){if(!Di[s]&&/^[A-Z]/.test(s))throw new Error(`Unknown event ${s} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!Pi[s])if("object"==typeof t[s])for(let r in t[s])e(t,"*"===r?s:s+"-"+r.toLowerCase(),t[s][r]);else"function"==typeof t[s]&&e(t,s,t[s])}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],s=this.runOnRoot(t);if(_i(s))try{await s}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ki];){e[ki]=!0;let t=[Bi(e)];for(;t.length>0;){let e=this.visitTick(t);if(_i(e))try{await e}catch(e){let s=t[t.length-1].node;throw this.handleError(e,s)}}}if(this.listeners.OnceExit)for(let[t,s]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>s(e,this.helpers));await Promise.all(t)}else await s(e,this.helpers)}catch(e){throw this.handleError(e)}}}return this.processed=!0,this.stringify()}runOnRoot(e){this.result.lastPlugin=e;try{if("object"==typeof e&&e.Once){if("document"===this.result.root.type){let t=this.result.root.nodes.map(t=>e.Once(t,this.helpers));return _i(t[0])?Promise.all(t):t}return e.Once(this.result.root,this.helpers)}if("function"==typeof e)return e(this.result.root,this.result)}catch(e){throw this.handleError(e)}}stringify(){if(this.error)throw this.error;if(this.stringified)return this.result;this.stringified=!0,this.sync();let e=this.result.opts,t=Ei;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let s=new Oi(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){if(_i(this.runOnRoot(e)))throw this.getAsyncError()}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[ki];)e[ki]=!0,this.walkSync(e);if(this.listeners.OnceExit)if("document"===e.type)for(let t of e.nodes)this.visitSync(this.listeners.OnceExit,t);else this.visitSync(this.listeners.OnceExit,e)}return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this.opts||Ai("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this.css}visitSync(e,t){for(let[s,r]of e){let e;this.result.lastPlugin=s;try{e=r(t,this.helpers)}catch(e){throw this.handleError(e,t.proxyOf)}if("root"!==t.type&&"document"!==t.type&&!t.parent)return!0;if(_i(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:s,visitors:r}=t;if("root"!==s.type&&"document"!==s.type&&!s.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,n]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return n(s.toProxy(),this.helpers)}catch(e){throw this.handleError(e,s)}}if(0!==t.iterator){let r,n=t.iterator;for(;r=s.nodes[s.indexes[n]];)if(s.indexes[n]+=1,!r[ki])return r[ki]=!0,void e.push(Bi(r));t.iterator=0,delete s.indexes[n]}let n=t.events;for(;t.eventIndex<n.length;){let e=n[t.eventIndex];if(t.eventIndex+=1,0===e)return void(s.nodes&&s.nodes.length&&(s[ki]=!0,t.iterator=s.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[ki]=!0;let t=Ui(e);for(let s of t)if(0===s)e.nodes&&e.each(e=>{e[ki]||this.walkSync(e)});else{let t=this.listeners[s];if(t&&this.visitSync(t,e.toProxy()))return}}warnings(){return this.sync().warnings()}get content(){return this.stringify().content}get css(){return this.stringify().css}get map(){return this.stringify().map}get messages(){return this.sync().messages}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){return this.sync().root}get[Symbol.toStringTag](){return"LazyResult"}};$i.registerPostcss=e=>{ji=e};var Wi=$i;$i.default=$i,Li.registerLazyResult($i),Ri.registerLazyResult($i);let Vi=Qn,Gi=an,Yi=Io,Ki=Ii;const Zi=Mo;let Ji=class{constructor(e,t,s){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=s,this._map=void 0;let n=Gi;this.result=new Zi(this._processor,r,this._opts),this.result.css=t;let o=this;Object.defineProperty(this.result,"root",{get:()=>o.root});let i=new Vi(n,r,this._opts,t);if(i.isMap()){let[e,t]=i.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else i.clearAnnotation(),this.result.css=i.css}async(){return this.error?Promise.reject(this.error):Promise.resolve(this.result)}catch(e){return this.async().catch(e)}finally(e){return this.async().then(e,e)}sync(){if(this.error)throw this.error;return this.result}then(e,t){return"production"!==process.env.NODE_ENV&&("from"in this._opts||Yi("Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.")),this.async().then(e,t)}toString(){return this._css}warnings(){return[]}get content(){return this.result.css}get css(){return this.result.css}get map(){return this.result.map}get messages(){return[]}get opts(){return this.result.opts}get processor(){return this.result.processor}get root(){if(this._root)return this._root;let e,t=Ki;try{e=t(this._css,this._opts)}catch(e){this.error=e}if(this.error)throw this.error;return this._root=e,e}get[Symbol.toStringTag](){return"NoWorkResult"}};var Hi=Ji;Ji.default=Ji;let Xi=Hi,qi=Wi,Qi=So,ea=oi,ta=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let s of e)if(!0===s.postcss?s=s():s.postcss&&(s=s.postcss),"object"==typeof s&&Array.isArray(s.plugins))t=t.concat(s.plugins);else if("object"==typeof s&&s.postcssPlugin)t.push(s);else if("function"==typeof s)t.push(s);else{if("object"!=typeof s||!s.parse&&!s.stringify)throw new Error(s+" is not a PostCSS plugin");if("production"!==process.env.NODE_ENV)throw new Error("PostCSS syntaxes cannot be used as plugins. Instead, please use one of the syntax/parser/stringifier options as outlined in your PostCSS runner documentation.")}return t}process(e,t={}){return this.plugins.length||t.parser||t.stringifier||t.syntax?new qi(this,e,t):new Xi(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var sa=ta;ta.default=ta,ea.registerProcessor(ta),Qi.registerProcessor(ta);let ra=wn,na=En,oa=so,ia=ei,aa=$n,la=oi,ca=ui;function ha(e,t){if(Array.isArray(e))return e.map(e=>ha(e));let{inputs:s,...r}=e;if(s){t=[];for(let e of s){let s={...e,__proto__:aa.prototype};s.map&&(s.map={...s.map,__proto__:na.prototype}),t.push(s)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>ha(e,t))),r.source){let{inputId:e,...s}=r.source;r.source=s,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new la(r);if("decl"===r.type)return new ra(r);if("rule"===r.type)return new ca(r);if("comment"===r.type)return new oa(r);if("atrule"===r.type)return new ia(r);throw new Error("Unknown node type: "+e.type)}var ua=ha;ha.default=ha;let da=Qr,pa=wn,fa=Wi,ma=go,ga=sa,ya=an,wa=ua,va=So,ba=xo,Sa=so,Ca=ei,Ia=Mo,ka=$n,xa=Ii,Oa=ai,Ea=ui,Ma=oi,Ra=mn;function Aa(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new ga(e)}Aa.plugin=function(e,t){let s,r=!1;function n(...s){console&&console.warn&&!r&&(r=!0,console.warn(e+": postcss.plugin was deprecated. Migration guide:\nhttps://evilmartians.com/chronicles/postcss-8-plugin-migration"),process.env.LANG&&process.env.LANG.startsWith("cn")&&console.warn(e+": 里面 postcss.plugin 被弃用. 迁移指南:\nhttps://www.w3ctech.com/topic/2226"));let n=t(...s);return n.postcssPlugin=e,n.postcssVersion=(new ga).version,n}return Object.defineProperty(n,"postcss",{get:()=>(s||(s=n()),s)}),n.process=function(e,t,s){return Aa([n(s)]).process(e,t)},n},Aa.stringify=ya,Aa.parse=xa,Aa.fromJSON=wa,Aa.list=Oa,Aa.comment=e=>new Sa(e),Aa.atRule=e=>new Ca(e),Aa.decl=e=>new pa(e),Aa.rule=e=>new Ea(e),Aa.root=e=>new Ma(e),Aa.document=e=>new va(e),Aa.CssSyntaxError=da,Aa.Declaration=pa,Aa.Container=ma,Aa.Processor=ga,Aa.Document=va,Aa.Comment=Sa,Aa.Warning=ba,Aa.AtRule=Ca,Aa.Result=Ia,Aa.Input=ka,Aa.Rule=Ea,Aa.Root=Ma,Aa.Node=Ra,fa.registerPostcss(Aa);var Ta=Aa;Aa.default=Aa;const Na=Wr(Ta);Na.stringify,Na.fromJSON,Na.plugin,Na.parse,Na.list,Na.document,Na.comment,Na.atRule,Na.rule,Na.decl,Na.root,Na.CssSyntaxError,Na.Declaration,Na.Container,Na.Processor,Na.Document,Na.Comment,Na.Warning,Na.AtRule,Na.Result,Na.Input,Na.Rule,Na.Root,Na.Node;class La{constructor(...e){$r(this,"parentElement",null),$r(this,"parentNode",null),$r(this,"ownerDocument"),$r(this,"firstChild",null),$r(this,"lastChild",null),$r(this,"previousSibling",null),$r(this,"nextSibling",null),$r(this,"ELEMENT_NODE",1),$r(this,"TEXT_NODE",3),$r(this,"nodeType"),$r(this,"nodeName"),$r(this,"RRNodeType")}get childNodes(){const e=[];let t=this.firstChild;for(;t;)e.push(t),t=t.nextSibling;return e}contains(e){if(!(e instanceof La))return!1;if(e.ownerDocument!==this.ownerDocument)return!1;if(e===this)return!0;for(;e.parentNode;){if(e.parentNode===this)return!0;e=e.parentNode}return!1}appendChild(e){throw new Error("RRDomException: Failed to execute 'appendChild' on 'RRNode': This RRNode type does not support this method.")}insertBefore(e,t){throw new Error("RRDomException: Failed to execute 'insertBefore' on 'RRNode': This RRNode type does not support this method.")}removeChild(e){throw new Error("RRDomException: Failed to execute 'removeChild' on 'RRNode': This RRNode type does not support this method.")}toString(){return"RRNode"}}const Fa={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Da={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Pa={};function _a(e){if(Pa[e])return Pa[e];const t=globalThis[e],s=t.prototype,r=e in Fa?Fa[e]:void 0,n=Boolean(r&&r.every(e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(s,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),o=e in Da?Da[e]:void 0,i=Boolean(o&&o.every(e=>{var t;return"function"==typeof s[e]&&(null==(t=s[e])?void 0:t.toString().includes("[native code]"))}));if(n&&i&&!globalThis.Zone)return Pa[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");document.body.appendChild(r);const n=r.contentWindow;if(!n)return t.prototype;const o=n[e].prototype;return document.body.removeChild(r),o?Pa[e]=o:s}catch{return s}}const Ua={};function Ba(e,t,s){var r;const n=`${e}.${String(s)}`;if(Ua[n])return Ua[n].call(t);const o=_a(e),i=null==(r=Object.getOwnPropertyDescriptor(o,s))?void 0:r.get;return i?(Ua[n]=i,i.call(t)):t[s]}const za={};function ja(e,t,s){const r=`${e}.${String(s)}`;if(za[r])return za[r].bind(t);const n=_a(e)[s];return"function"!=typeof n?t[s]:(za[r]=n,n.bind(t))}function $a(){return _a("MutationObserver").constructor}const Wa={childNodes:function(e){return Ba("Node",e,"childNodes")},parentNode:function(e){return Ba("Node",e,"parentNode")},parentElement:function(e){return Ba("Node",e,"parentElement")},textContent:function(e){return Ba("Node",e,"textContent")},contains:function(e,t){return ja("Node",e,"contains")(t)},getRootNode:function(e){return ja("Node",e,"getRootNode")()},host:function(e){return e&&"host"in e?Ba("ShadowRoot",e,"host"):null},styleSheets:function(e){return e.styleSheets},shadowRoot:function(e){return e&&"shadowRoot"in e?Ba("Element",e,"shadowRoot"):null},querySelector:function(e,t){return Ba("Element",e,"querySelector")(t)},querySelectorAll:function(e,t){return Ba("Element",e,"querySelectorAll")(t)},mutationObserver:$a};function Va(e,t,s=document){const r={capture:!0,passive:!0};return s.addEventListener(e,t,r),()=>s.removeEventListener(e,t,r)}const Ga="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let Ya={map:{},getId:()=>(console.error(Ga),-1),getNode:()=>(console.error(Ga),null),removeNodeFromMap(){console.error(Ga)},has:()=>(console.error(Ga),!1),reset(){console.error(Ga)}};function Ka(e,t,s={}){let r=null,n=0;return function(...o){const i=Date.now();n||!1!==s.leading||(n=i);const a=t-(i-n),l=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),n=i,e.apply(l,o)):r||!1===s.trailing||(r=setTimeout(()=>{n=!1===s.leading?0:Date.now(),r=null,e.apply(l,o)},a))}}function Za(e,t,s,r,n=window){const o=n.Object.getOwnPropertyDescriptor(e,t);return n.Object.defineProperty(e,t,r?s:{set(e){setTimeout(()=>{s.set.call(this,e)},0),o&&o.set&&o.set.call(this,e)}}),()=>Za(e,t,o||{},!0)}function Ja(e,t,s){try{if(!(t in e))return()=>{};const r=e[t],n=s(r);return"function"==typeof n&&(n.prototype=n.prototype||{},Object.defineProperties(n,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=n,()=>{e[t]=r}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Ya=new Proxy(Ya,{get:(e,t,s)=>("map"===t&&console.error(Ga),Reflect.get(e,t,s))}));let Ha=Date.now;function Xa(e){var t,s,r,n;const o=e.document;return{left:o.scrollingElement?o.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:o.documentElement.scrollLeft||(null==o?void 0:o.body)&&(null==(t=Wa.parentElement(o.body))?void 0:t.scrollLeft)||(null==(s=null==o?void 0:o.body)?void 0:s.scrollLeft)||0,top:o.scrollingElement?o.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==o?void 0:o.documentElement.scrollTop)||(null==o?void 0:o.body)&&(null==(r=Wa.parentElement(o.body))?void 0:r.scrollTop)||(null==(n=null==o?void 0:o.body)?void 0:n.scrollTop)||0}}function qa(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Qa(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function el(e){if(!e)return null;return e.nodeType===e.ELEMENT_NODE?e:Wa.parentElement(e)}function tl(e,t,s,r){if(!e)return!1;const n=el(e);if(!n)return!1;try{if("string"==typeof t){if(n.classList.contains(t))return!0;if(r&&null!==n.closest("."+t))return!0}else if(Z(n,t,r))return!0}catch(e){}if(s){if(n.matches(s))return!0;if(r&&null!==n.closest(s))return!0}return!1}function sl(e,t,s){return!("TITLE"!==e.tagName||!s.headTitleMutations)||-2===t.getId(e)}function rl(e,t){if(w(e))return!1;const s=t.getId(e);if(!t.has(s))return!0;const r=Wa.parentNode(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||rl(r,t))}function nl(e){return Boolean(e.changedTouches)}function ol(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function il(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function al(e){return!!e&&(e instanceof La&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(Wa.shadowRoot(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(Ha=()=>(new Date).getTime());class ll{constructor(){n(this,"id",1),n(this,"styleIDMap",new WeakMap),n(this,"idStyleMap",new Map)}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let s;return s=void 0===t?this.id++:t,this.styleIDMap.set(e,s),this.idStyleMap.set(s,e),s}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function cl(e){var t;let s=null;return"getRootNode"in e&&(null==(t=Wa.getRootNode(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&Wa.host(Wa.getRootNode(e))&&(s=Wa.host(Wa.getRootNode(e))),s}function hl(e){const t=e.ownerDocument;if(!t)return!1;const s=function(e){let t,s=e;for(;t=cl(s);)s=t;return s}(e);return Wa.contains(t,s)}function ul(e){const t=e.ownerDocument;return!!t&&(Wa.contains(t,e)||hl(e))}var dl=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(dl||{}),pl=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(pl||{}),fl=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(fl||{}),ml=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(ml||{}),gl=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(gl||{}),yl=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(yl||{}),wl=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(wl||{});function vl(e){return"__ln"in e}class bl{constructor(){n(this,"length",0),n(this,"head",null),n(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let s=0;s<e;s++)t=(null==t?void 0:t.next)||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&vl(e.previousSibling)){const s=e.previousSibling.__ln.next;t.next=s,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,s&&(s.previous=t)}else if(e.nextSibling&&vl(e.nextSibling)&&e.nextSibling.__ln.previous){const s=e.nextSibling.__ln.previous;t.previous=s,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,s&&(s.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Sl=(e,t)=>`${e}@${t}`;class Cl{constructor(){n(this,"frozen",!1),n(this,"locked",!1),n(this,"texts",[]),n(this,"attributes",[]),n(this,"attributeMap",new WeakMap),n(this,"removes",[]),n(this,"mapRemoves",[]),n(this,"movedMap",{}),n(this,"addedSet",new Set),n(this,"movedSet",new Set),n(this,"droppedSet",new Set),n(this,"removesSubTreeCache",new Set),n(this,"mutationCb"),n(this,"blockClass"),n(this,"blockSelector"),n(this,"maskTextClass"),n(this,"maskTextSelector"),n(this,"inlineStylesheet"),n(this,"maskInputOptions"),n(this,"maskTextFn"),n(this,"maskInputFn"),n(this,"keepIframeSrcFn"),n(this,"recordCanvas"),n(this,"inlineImages"),n(this,"slimDOMOptions"),n(this,"dataURLOptions"),n(this,"doc"),n(this,"mirror"),n(this,"iframeManager"),n(this,"stylesheetManager"),n(this,"shadowDomManager"),n(this,"canvasManager"),n(this,"processedNodeManager"),n(this,"unattachedDoc"),n(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),n(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,s=new bl,r=e=>{let t=e,s=-2;for(;-2===s;)t=t&&t.nextSibling,s=t&&this.mirror.getId(t);return s},n=n=>{const o=Wa.parentNode(n);if(!o||!ul(n))return;let i=!1;if(n.nodeType===Node.TEXT_NODE){const e=o.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(o)&&(i=!0)}const a=w(o)?this.mirror.getId(cl(n)):this.mirror.getId(o),l=r(n);if(-1===a||-1===l)return s.addNode(n);const c=q(n,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskTextClass:this.maskTextClass,maskTextSelector:this.maskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{ol(e,this.mirror)&&this.iframeManager.addIframe(e),il(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),al(n)&&this.shadowDomManager.addShadowRoot(Wa.shadowRoot(n),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:i});c&&(e.push({parentId:a,nextId:l,node:c}),t.add(c.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)kl(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(Wa.parentNode(e))||n(e);for(const e of this.addedSet)xl(this.droppedSet,e)||kl(this.removesSubTreeCache,e,this.mirror)?xl(this.movedSet,e)?n(e):this.droppedSet.add(e):n(e);let o=null;for(;s.length;){let e=null;if(o){const t=this.mirror.getId(Wa.parentNode(o.value)),s=r(o.value);-1!==t&&-1!==s&&(e=o)}if(!e){let t=s.tail;for(;t;){const s=t;if(t=t.previous,s){const t=this.mirror.getId(Wa.parentNode(s.value));if(-1===r(s.value))continue;if(-1!==t){e=s;break}{const t=s.value,r=Wa.parentNode(t);if(r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=Wa.host(r);if(-1!==this.mirror.getId(t)){e=s;break}}}}}}if(!e){for(;s.head;)s.removeNode(s.head.value);break}o=e.previous,s.removeNode(e.value),n(e.value)}const i={texts:this.texts.map(e=>{const t=e.node,s=Wa.parentNode(t);return s&&"TEXTAREA"===s.tagName&&this.genTextAreaValueMutation(s),{id:this.mirror.getId(t),value:e.value}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{const{attributes:t}=e;if("string"==typeof t.style){const s=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);s.length<t.style.length&&(s+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(i.texts.length||i.attributes.length||i.removes.length||i.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.removesSubTreeCache=new Set,this.movedMap={},this.mutationCb(i))}),n(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(Wa.childNodes(e),e=>Wa.textContent(e)||"").join("")}),n(this,"processMutation",e=>{if(!sl(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=Wa.textContent(e.target);tl(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:J(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,el(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let s=e.attributeName,r=e.target.getAttribute(s);if("value"===s){const e=O(t);r=I({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:r,maskInputFn:this.maskInputFn})}if(tl(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let n=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===s&&!this.keepIframeSrcFn(r)){if(t.contentDocument)return;s="rr_src"}if(n||(n={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(n),this.attributeMap.set(e.target,n)),"type"===s&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!K(t.tagName,s))if(n.attributes[s]=Y(this.doc,k(t.tagName),k(s),r),"style"===s){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const s=this.unattachedDoc.createElement("span");e.oldValue&&s.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),o=t.style.getPropertyPriority(e);r!==s.style.getPropertyValue(e)||o!==s.style.getPropertyPriority(e)?n.styleDiff[e]=""===o?r:[r,o]:n._unchangedStyles[e]=[r,o]}for(const e of Array.from(s.style))""===t.style.getPropertyValue(e)&&(n.styleDiff[e]=!1)}else"open"===s&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?n.attributes.rr_open_mode="modal":n.attributes.rr_open_mode="non-modal");break}case"childList":if(tl(e.target,this.blockClass,this.blockSelector,!0))return;if("TEXTAREA"===e.target.tagName)return void this.genTextAreaValueMutation(e.target);e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const s=this.mirror.getId(t),r=w(e.target)?this.mirror.getId(Wa.host(e.target)):this.mirror.getId(e.target);tl(e.target,this.blockClass,this.blockSelector,!1)||sl(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Il(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===s||rl(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Sl(s,r)]?Il(this.movedSet,t):(this.removes.push({parentId:r,id:s,isShadow:!(!w(e.target)||!v(e.target))||void 0}),function(e,t){const s=[e];for(;s.length;){const e=s.pop();t.has(e)||(t.add(e),Wa.childNodes(e).forEach(e=>s.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),n(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(sl(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let s=null;t&&this.mirror.hasNode(t)&&(s=this.mirror.getId(t)),s&&-1!==s&&(this.movedMap[Sl(this.mirror.getId(e),s)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);tl(e,this.blockClass,this.blockSelector,!1)||(Wa.childNodes(e).forEach(e=>this.genAdds(e)),al(e)&&Wa.childNodes(Wa.shadowRoot(e)).forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}})}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Il(e,t){e.delete(t),Wa.childNodes(t).forEach(t=>Il(e,t))}function kl(e,t,s){return 0!==e.size&&function(e,t){const s=Wa.parentNode(t);return!!s&&e.has(s)}(e,t)}function xl(e,t){return 0!==e.size&&Ol(e,t)}function Ol(e,t){const s=Wa.parentNode(t);return!!s&&(!!e.has(s)||Ol(e,s))}let El;const Ml=e=>{if(!El)return e;return(...t)=>{try{return e(...t)}catch(e){if(El&&!0===El(e))return;throw e}}},Rl=[];function Al(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Tl(e,t){const s=new Cl;Rl.push(s),s.init(e);const r=new($a())(Ml(s.processMutations.bind(s)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function Nl({mouseInteractionCb:e,doc:t,mirror:s,blockClass:r,blockSelector:n,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const i=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,a=[];let l=null;return Object.keys(fl).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==i[e]).forEach(o=>{let i=k(o);const c=(t=>o=>{const i=Al(o);if(tl(i,r,n,!0))return;let a=null,c=t;if("pointerType"in o){switch(o.pointerType){case"mouse":a=ml.Mouse;break;case"touch":a=ml.Touch;break;case"pen":a=ml.Pen}a===ml.Touch?fl[t]===fl.MouseDown?c="TouchStart":fl[t]===fl.MouseUp&&(c="TouchEnd"):ml.Pen}else nl(o)&&(a=ml.Touch);null!==a?(l=a,(c.startsWith("Touch")&&a===ml.Touch||c.startsWith("Mouse")&&a===ml.Mouse)&&(a=null)):fl[t]===fl.Click&&(a=l,l=null);const h=nl(o)?o.changedTouches[0]:o;if(!h)return;const u=s.getId(i),{clientX:d,clientY:p}=h;Ml(e)({type:fl[c],id:u,x:d,y:p,...null!==a&&{pointerType:a}})})(o);if(window.PointerEvent)switch(fl[o]){case fl.MouseDown:case fl.MouseUp:i=i.replace("mouse","pointer");break;case fl.TouchStart:case fl.TouchEnd:return}a.push(Va(i,c,t))}),Ml(()=>{a.forEach(e=>e())})}function Ll({scrollCb:e,doc:t,mirror:s,blockClass:r,blockSelector:n,sampling:o}){return Va("scroll",Ml(Ka(Ml(o=>{const i=Al(o);if(!i||tl(i,r,n,!0))return;const a=s.getId(i);if(i===t&&t.defaultView){const s=Xa(t.defaultView);e({id:a,x:s.left,y:s.top})}else e({id:a,x:i.scrollLeft,y:i.scrollTop})}),o.scroll||100)),t)}const Fl=["INPUT","TEXTAREA","SELECT"],Dl=new WeakMap;function Pl(e){return function(e,t){if(zl("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||zl("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||zl("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||zl("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const s=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(s)}else if(e.parentStyleSheet){const s=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(s)}return t}(e,[])}function _l(e,t,s){let r,n;return e?(e.ownerNode?r=t.getId(e.ownerNode):n=s.getId(e),{styleId:n,id:r}):{}}function Ul({mirror:e,stylesheetManager:t},s){var r,n,o;let i=null;i="#document"===s.nodeName?e.getId(s):e.getId(Wa.host(s));const a="#document"===s.nodeName?null==(r=s.defaultView)?void 0:r.Document:null==(o=null==(n=s.ownerDocument)?void 0:n.defaultView)?void 0:o.ShadowRoot,l=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==i&&-1!==i&&a&&l?(Object.defineProperty(s,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get(){var e;return null==(e=l.get)?void 0:e.call(this)},set(e){var s;const r=null==(s=l.set)?void 0:s.call(this,e);if(null!==i&&-1!==i)try{t.adoptStyleSheets(e,i)}catch(e){}return r}}),Ml(()=>{Object.defineProperty(s,"adoptedStyleSheets",{configurable:l.configurable,enumerable:l.enumerable,get:l.get,set:l.set})})):()=>{}}function Bl(e,t={}){const s=e.doc.defaultView;if(!s)return()=>{};let r;!function(e,t){const{mutationCb:s,mousemoveCb:r,mouseInteractionCb:n,scrollCb:o,viewportResizeCb:i,inputCb:a,mediaInteractionCb:l,styleSheetRuleCb:c,styleDeclarationCb:h,canvasMutationCb:u,fontCb:d,selectionCb:p,customElementCb:f}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),s(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),n(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),o(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),i(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),l(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),c(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),h(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),u(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),d(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),p(...e)},e.customElementCb=(...e)=>{t.customElement&&t.customElement(...e),f(...e)}}(e,t),e.recordDOM&&(r=Tl(e,e.doc));const n=function({mousemoveCb:e,sampling:t,doc:s,mirror:r}){if(!1===t.mousemove)return()=>{};const n="number"==typeof t.mousemove?t.mousemove:50,o="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let i,a=[];const l=Ka(Ml(t=>{const s=Date.now()-i;e(a.map(e=>(e.timeOffset-=s,e)),t),a=[],i=null}),o),c=Ml(Ka(Ml(e=>{const t=Al(e),{clientX:s,clientY:n}=nl(e)?e.changedTouches[0]:e;i||(i=Ha()),a.push({x:s,y:n,id:r.getId(t),timeOffset:Ha()-i}),l("undefined"!=typeof DragEvent&&e instanceof DragEvent?pl.Drag:e instanceof MouseEvent?pl.MouseMove:pl.TouchMove)}),n,{trailing:!1})),h=[Va("mousemove",c,s),Va("touchmove",c,s),Va("drag",c,s)];return Ml(()=>{h.forEach(e=>e())})}(e),o=Nl(e),i=Ll(e),a=function({viewportResizeCb:e},{win:t}){let s=-1,r=-1;return Va("resize",Ml(Ka(Ml(()=>{const t=qa(),n=Qa();s===t&&r===n||(e({width:Number(n),height:Number(t)}),s=t,r=n)}),200)),t)}(e,{win:s}),l=function({inputCb:e,doc:t,mirror:s,blockClass:r,blockSelector:n,ignoreClass:o,ignoreSelector:i,maskInputOptions:a,maskInputFn:l,sampling:c,userTriggeredOnInput:h}){function u(e){let s=Al(e);const c=e.isTrusted,u=s&&s.tagName;if(s&&"OPTION"===u&&(s=Wa.parentElement(s)),!s||!u||Fl.indexOf(u)<0||tl(s,r,n,!0))return;if(s.classList.contains(o)||i&&s.matches(i))return;let p=s.value,f=!1;const m=O(s)||"";"radio"===m||"checkbox"===m?f=s.checked:(a[u.toLowerCase()]||a[m])&&(p=I({element:s,maskInputOptions:a,tagName:u,type:m,value:p,maskInputFn:l})),d(s,h?{text:p,isChecked:f,userTriggered:c}:{text:p,isChecked:f});const g=s.name;"radio"===m&&g&&f&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==s){const t=e.value;d(e,h?{text:t,isChecked:!f,userTriggered:!1}:{text:t,isChecked:!f})}})}function d(t,r){const n=Dl.get(t);if(!n||n.text!==r.text||n.isChecked!==r.isChecked){Dl.set(t,r);const n=s.getId(t);Ml(e)({...r,id:n})}}const p=("last"===c.input?["change"]:["input","change"]).map(e=>Va(e,Ml(u),t)),f=t.defaultView;if(!f)return()=>{p.forEach(e=>e())};const m=f.Object.getOwnPropertyDescriptor(f.HTMLInputElement.prototype,"value"),g=[[f.HTMLInputElement.prototype,"value"],[f.HTMLInputElement.prototype,"checked"],[f.HTMLSelectElement.prototype,"value"],[f.HTMLTextAreaElement.prototype,"value"],[f.HTMLSelectElement.prototype,"selectedIndex"],[f.HTMLOptionElement.prototype,"selected"]];return m&&m.set&&p.push(...g.map(e=>Za(e[0],e[1],{set(){Ml(u)({target:this,isTrusted:!1})}},!1,f))),Ml(()=>{p.forEach(e=>e())})}(e),c=function({mediaInteractionCb:e,blockClass:t,blockSelector:s,mirror:r,sampling:n,doc:o}){const i=Ml(o=>Ka(Ml(n=>{const i=Al(n);if(!i||tl(i,t,s,!0))return;const{currentTime:a,volume:l,muted:c,playbackRate:h,loop:u}=i;e({type:o,id:r.getId(i),currentTime:a,volume:l,muted:c,playbackRate:h,loop:u})}),n.media||500)),a=[Va("play",i(yl.Play),o),Va("pause",i(yl.Pause),o),Va("seeked",i(yl.Seeked),o),Va("volumechange",i(yl.VolumeChange),o),Va("ratechange",i(yl.RateChange),o)];return Ml(()=>{a.forEach(e=>e())})}(e);let h=()=>{},u=()=>{},d=()=>{},p=()=>{};e.recordDOM&&(h=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:s},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const n=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(n,{apply:Ml((r,n,o)=>{const[i,a]=o,{id:l,styleId:c}=_l(n,t,s.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:a}]}),r.apply(n,o)})}),r.CSSStyleSheet.prototype.addRule=function(e,t,s=this.cssRules.length){const n=`${e} { ${t} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[n,s])};const o=r.CSSStyleSheet.prototype.deleteRule;let i,a;r.CSSStyleSheet.prototype.deleteRule=new Proxy(o,{apply:Ml((r,n,o)=>{const[i]=o,{id:a,styleId:l}=_l(n,t,s.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:i}]}),r.apply(n,o)})}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},r.CSSStyleSheet.prototype.replace&&(i=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(i,{apply:Ml((r,n,o)=>{const[i]=o,{id:a,styleId:l}=_l(n,t,s.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replace:i}),r.apply(n,o)})})),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Ml((r,n,o)=>{const[i]=o,{id:a,styleId:l}=_l(n,t,s.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,replaceSync:i}),r.apply(n,o)})}));const l={};jl("CSSGroupingRule")?l.CSSGroupingRule=r.CSSGroupingRule:(jl("CSSMediaRule")&&(l.CSSMediaRule=r.CSSMediaRule),jl("CSSConditionRule")&&(l.CSSConditionRule=r.CSSConditionRule),jl("CSSSupportsRule")&&(l.CSSSupportsRule=r.CSSSupportsRule));const c={};return Object.entries(l).forEach(([r,n])=>{c[r]={insertRule:n.prototype.insertRule,deleteRule:n.prototype.deleteRule},n.prototype.insertRule=new Proxy(c[r].insertRule,{apply:Ml((r,n,o)=>{const[i,a]=o,{id:l,styleId:c}=_l(n.parentStyleSheet,t,s.styleMirror);return(l&&-1!==l||c&&-1!==c)&&e({id:l,styleId:c,adds:[{rule:i,index:[...Pl(n),a||0]}]}),r.apply(n,o)})}),n.prototype.deleteRule=new Proxy(c[r].deleteRule,{apply:Ml((r,n,o)=>{const[i]=o,{id:a,styleId:l}=_l(n.parentStyleSheet,t,s.styleMirror);return(a&&-1!==a||l&&-1!==l)&&e({id:a,styleId:l,removes:[{index:[...Pl(n),i]}]}),r.apply(n,o)})})}),Ml(()=>{r.CSSStyleSheet.prototype.insertRule=n,r.CSSStyleSheet.prototype.deleteRule=o,i&&(r.CSSStyleSheet.prototype.replace=i),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(l).forEach(([e,t])=>{t.prototype.insertRule=c[e].insertRule,t.prototype.deleteRule=c[e].deleteRule})})}(e,{win:s}),u=Ul(e,e.doc),d=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:s,stylesheetManager:r},{win:n}){const o=n.CSSStyleDeclaration.prototype.setProperty;n.CSSStyleDeclaration.prototype.setProperty=new Proxy(o,{apply:Ml((n,i,a)=>{var l;const[c,h,u]=a;if(s.has(c))return o.apply(i,[c,h,u]);const{id:d,styleId:p}=_l(null==(l=i.parentRule)?void 0:l.parentStyleSheet,t,r.styleMirror);return(d&&-1!==d||p&&-1!==p)&&e({id:d,styleId:p,set:{property:c,value:h,priority:u},index:Pl(i.parentRule)}),n.apply(i,a)})});const i=n.CSSStyleDeclaration.prototype.removeProperty;return n.CSSStyleDeclaration.prototype.removeProperty=new Proxy(i,{apply:Ml((n,o,a)=>{var l;const[c]=a;if(s.has(c))return i.apply(o,[c]);const{id:h,styleId:u}=_l(null==(l=o.parentRule)?void 0:l.parentStyleSheet,t,r.styleMirror);return(h&&-1!==h||u&&-1!==u)&&e({id:h,styleId:u,remove:{property:c},index:Pl(o.parentRule)}),n.apply(o,a)})}),Ml(()=>{n.CSSStyleDeclaration.prototype.setProperty=o,n.CSSStyleDeclaration.prototype.removeProperty=i})}(e,{win:s}),e.collectFonts&&(p=function({fontCb:e,doc:t}){const s=t.defaultView;if(!s)return()=>{};const r=[],n=new WeakMap,o=s.FontFace;s.FontFace=function(e,t,s){const r=new o(e,t,s);return n.set(r,{family:e,buffer:"string"!=typeof t,descriptors:s,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const i=Ja(t.fonts,"add",function(t){return function(s){return setTimeout(Ml(()=>{const t=n.get(s);t&&(e(t),n.delete(s))}),0),t.apply(this,[s])}});return r.push(()=>{s.FontFace=o}),r.push(i),Ml(()=>{r.forEach(e=>e())})}(e)));const f=function(e){const{doc:t,mirror:s,blockClass:r,blockSelector:n,selectionCb:o}=e;let i=!0;const a=Ml(()=>{const e=t.getSelection();if(!e||i&&(null==e?void 0:e.isCollapsed))return;i=e.isCollapsed||!1;const a=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const o=e.getRangeAt(t),{startContainer:i,startOffset:l,endContainer:c,endOffset:h}=o;tl(i,r,n,!0)||tl(c,r,n,!0)||a.push({start:s.getId(i),startOffset:l,end:s.getId(c),endOffset:h})}o({ranges:a})});return a(),Va("selectionchange",a)}(e),m=function({doc:e,customElementCb:t}){const s=e.defaultView;return s&&s.customElements?Ja(s.customElements,"define",function(e){return function(s,r,n){try{t({define:{name:s}})}catch(e){console.warn(`Custom element callback failed for ${s}`)}return e.apply(this,[s,r,n])}}):()=>{}}(e),g=[];for(const t of e.plugins)g.push(t.observer(t.callback,s,t.options));return Ml(()=>{Rl.forEach(e=>e.reset()),null==r||r.disconnect(),n(),o(),i(),a(),l(),c(),h(),u(),d(),p(),f(),m(),g.forEach(e=>e())})}function zl(e){return void 0!==window[e]}function jl(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class $l{constructor(e){n(this,"iframeIdToRemoteIdMap",new WeakMap),n(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,s,r){const n=s||this.getIdToRemoteIdMap(e),o=r||this.getRemoteIdToIdMap(e);let i=n.get(t);return i||(i=this.generateIdFn(),n.set(t,i),o.set(i,t)),i}getIds(e,t){const s=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,s,r))}getRemoteId(e,t,s){const r=s||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;const n=r.get(t);return n||-1}getRemoteIds(e,t){const s=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,s))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Wl{constructor(e){n(this,"iframes",new WeakMap),n(this,"crossOriginIframeMap",new WeakMap),n(this,"crossOriginIframeMirror",new $l(_)),n(this,"crossOriginIframeStyleMirror"),n(this,"crossOriginIframeRootIdMap",new WeakMap),n(this,"mirror"),n(this,"mutationCb"),n(this,"wrappedEmit"),n(this,"loadListener"),n(this,"stylesheetManager"),n(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new $l(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 s,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(s=e.contentWindow)||s.addEventListener("message",this.handleMessage.bind(this))),null==(r=this.loadListener)||r.call(this,e),e.contentDocument&&e.contentDocument.adoptedStyleSheets&&e.contentDocument.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(e.contentDocument.adoptedStyleSheets,this.mirror.getId(e.contentDocument))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const s=this.crossOriginIframeMap.get(e.source);if(!s)return;const r=this.transformCrossOriginEvent(s,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var s;switch(t.type){case dl.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const s=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,s),this.patchRootIdOnNode(t.data.node,s),{timestamp:t.timestamp,type:dl.IncrementalSnapshot,data:{source:pl.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case dl.Meta:case dl.Load:case dl.DomContentLoaded:return!1;case dl.Plugin:return t;case dl.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case dl.IncrementalSnapshot:switch(t.data.source){case pl.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const s=this.crossOriginIframeRootIdMap.get(e);s&&this.patchRootIdOnNode(t.node,s)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case pl.Drag:case pl.TouchMove:case pl.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case pl.ViewportResize:return!1;case pl.MediaInteraction:case pl.MouseInteraction:case pl.Scroll:case pl.CanvasMutation:case pl.Input:return this.replaceIds(t.data,e,["id"]),t;case pl.StyleSheetRule:case pl.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case pl.Font:return t;case pl.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case pl.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(s=t.data.styles)||s.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}return!1}replace(e,t,s,r){for(const n of r)(Array.isArray(t[n])||"number"==typeof t[n])&&(Array.isArray(t[n])?t[n]=e.getIds(s,t[n]):t[n]=e.getId(s,t[n]));return t}replaceIds(e,t,s){return this.replace(this.crossOriginIframeMirror,e,t,s)}replaceStyleIds(e,t,s){return this.replace(this.crossOriginIframeStyleMirror,e,t,s)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===wl.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class Vl{constructor(e){n(this,"shadowDoms",new WeakSet),n(this,"mutationCb"),n(this,"scrollCb"),n(this,"bypassOptions"),n(this,"mirror"),n(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(!v(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const s=Tl({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>s.disconnect()),this.restoreHandlers.push(Ll({...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(Wa.host(e))),this.restoreHandlers.push(Ul({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){e.contentWindow&&e.contentDocument&&this.patchAttachShadow(e.contentWindow.Element,e.contentDocument)}patchAttachShadow(e,t){const s=this;this.restoreHandlers.push(Ja(e.prototype,"attachShadow",function(e){return function(r){const n=e.call(this,r),o=Wa.shadowRoot(this);return o&&ul(this)&&s.addShadowRoot(o,t),n}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var Gl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Yl="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Kl=0;Kl<64;Kl++)Yl[Gl.charCodeAt(Kl)]=Kl;const Zl=new Map;const Jl=(e,t,s)=>{if(!e||!ql(e,t)&&"object"!=typeof e)return;const r=function(e,t){let s=Zl.get(e);return s||(s=new Map,Zl.set(e,s)),s.has(t)||s.set(t,[]),s.get(t)}(s,e.constructor.name);let n=r.indexOf(e);return-1===n&&(n=r.length,r.push(e)),n};function Hl(e,t,s){if(e instanceof Array)return e.map(e=>Hl(e,t,s));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray){return{rr_type:e.constructor.name,args:[Object.values(e)]}}if(e instanceof ArrayBuffer){return{rr_type:e.constructor.name,base64:function(e){var t,s=new Uint8Array(e),r=s.length,n="";for(t=0;t<r;t+=3)n+=Gl[s[t]>>2],n+=Gl[(3&s[t])<<4|s[t+1]>>4],n+=Gl[(15&s[t+1])<<2|s[t+2]>>6],n+=Gl[63&s[t+2]];return r%3==2?n=n.substring(0,n.length-1)+"=":r%3==1&&(n=n.substring(0,n.length-2)+"=="),n}(e)}}if(e instanceof DataView){return{rr_type:e.constructor.name,args:[Hl(e.buffer,t,s),e.byteOffset,e.byteLength]}}if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:s}=e;return{rr_type:t,src:s}}if(e instanceof HTMLCanvasElement){return{rr_type:"HTMLImageElement",src:e.toDataURL()}}if(e instanceof ImageData){return{rr_type:e.constructor.name,args:[Hl(e.data,t,s),e.width,e.height]}}if(ql(e,t)||"object"==typeof e){return{rr_type:e.constructor.name,index:Jl(e,t,s)}}return e}const Xl=(e,t,s)=>e.map(e=>Hl(e,t,s)),ql=(e,t)=>{const s=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(s.find(s=>e instanceof t[s]))};function Ql(e,t,s,r){const n=[];try{const o=Ja(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(n,...o){if(!tl(this,t,s,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(n);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){const e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[n,...o])}});n.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{n.forEach(e=>e())}}function ec(e,t,s,r,n,o){const i=[],a=Object.getOwnPropertyNames(e);for(const l of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(l))try{if("function"!=typeof e[l])continue;const a=Ja(e,l,function(e){return function(...i){const a=e.apply(this,i);if(Jl(a,o,this),"tagName"in this.canvas&&!tl(this.canvas,r,n,!0)){const e=Xl(i,o,this),r={type:t,property:l,args:e};s(this.canvas,r)}return a}});i.push(a)}catch{const r=Za(e,l,{set(e){s(this.canvas,{type:t,property:l,args:[e],setter:!0})}});i.push(r)}return i}const tc="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",sc="undefined"!=typeof window&&window.Blob&&new Blob([(rc=tc,Uint8Array.from(atob(rc),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var rc;function nc(e){let t;try{if(t=sc&&(window.URL||window.webkitURL).createObjectURL(sc),!t)throw"";const s=new Worker(t,{name:null==e?void 0:e.name});return s.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),s}catch(t){return new Worker("data:text/javascript;base64,"+tc,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class oc{constructor(e){n(this,"pendingCanvasMutations",new Map),n(this,"rafStamps",{latestId:0,invokeId:null}),n(this,"mirror"),n(this,"mutationCb"),n(this,"resetObservers"),n(this,"frozen",!1),n(this,"locked",!1),n(this,"processMutation",(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)});const{sampling:t="all",win:s,blockClass:r,blockSelector:o,recordCanvas:i,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(s,r,o),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,s,r,o,{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,s,r,n){const o=Ql(t,s,r,!0),i=new Map,a=new nc;a.onmessage=e=>{const{id:t}=e.data;if(i.set(t,!1),!("base64"in e.data))return;const{base64:s,type:r,width:n,height:o}=e.data;this.mutationCb({id:t,type:gl["2D"],commands:[{property:"clearRect",args:[0,0,n,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:s}],type:r}]},0,0]}]})};const l=1e3/e;let c,h=0;const u=e=>{h&&e-h<l||(h=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{tl(t,s,r,!0)||e.push(t)}),e})().forEach(async e=>{var t;const s=this.mirror.getId(e);if(i.get(s))return;if(0===e.width||0===e.height)return;if(i.set(s,!0),["webgl","webgl2"].includes(e.__context)){const s=e.getContext(e.__context);!1===(null==(t=null==s?void 0:s.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&s.clear(s.COLOR_BUFFER_BIT)}const r=await createImageBitmap(e);a.postMessage({id:s,bitmap:r,width:e.width,height:e.height,dataURLOptions:n.dataURLOptions},[r])})),c=requestAnimationFrame(u)};c=requestAnimationFrame(u),this.resetObservers=()=>{o(),cancelAnimationFrame(c)}}initCanvasMutationObserver(e,t,s){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=Ql(e,t,s,!1),n=function(e,t,s,r){const n=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const i of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[i])continue;const o=Ja(t.CanvasRenderingContext2D.prototype,i,function(n){return function(...o){return tl(this.canvas,s,r,!0)||setTimeout(()=>{const s=Xl(o,t,this);e(this.canvas,{type:gl["2D"],property:i,args:s})},0),n.apply(this,o)}});n.push(o)}catch{const s=Za(t.CanvasRenderingContext2D.prototype,i,{set(t){e(this.canvas,{type:gl["2D"],property:i,args:[t],setter:!0})}});n.push(s)}return()=>{n.forEach(e=>e())}}(this.processMutation.bind(this),e,t,s),o=function(e,t,s,r){const n=[];return n.push(...ec(t.WebGLRenderingContext.prototype,gl.WebGL,e,s,r,t)),void 0!==t.WebGL2RenderingContext&&n.push(...ec(t.WebGL2RenderingContext.prototype,gl.WebGL2,e,s,r,t)),()=>{n.forEach(e=>e())}}(this.processMutation.bind(this),e,t,s);this.resetObservers=()=>{r(),n(),o()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const s=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,s)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const s=this.pendingCanvasMutations.get(e);if(!s||-1===t)return;const r=s.map(e=>{const{type:t,...s}=e;return s}),{type:n}=s[0];this.mutationCb({id:t,type:n,commands:r}),this.pendingCanvasMutations.delete(e)}}class ic{constructor(e){n(this,"trackedLinkElements",new WeakSet),n(this,"mutationCb"),n(this,"adoptedStyleSheetCb"),n(this,"styleMirror",new ll),this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const s={id:t,styleIds:[]},r=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,s)=>({rule:S(e,t.href),index:s}))})),s.styleIds.push(e)}r.length>0&&(s.styles=r),this.adoptedStyleSheetCb(s)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class ac{constructor(){n(this,"nodeMap",new WeakMap),n(this,"active",!1)}inOtherBuffer(e,t){const s=this.nodeMap.get(e);return s&&Array.from(s).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,requestAnimationFrame(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let lc,cc,hc,uc=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(s=e.contentWindow)?void 0:s.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const dc=new C;function pc(e={}){const{emit:t,checkoutEveryNms:s,checkoutEveryNth:r,blockClass:n="rr-block",blockSelector:o=null,ignoreClass:i="rr-ignore",ignoreSelector:a=null,maskTextClass:l="rr-mask",maskTextSelector:c=null,inlineStylesheet:h=!0,maskAllInputs:u,maskInputOptions:d,slimDOMOptions:p,maskInputFn:f,maskTextFn:m,hooks:g,packFn:y,sampling:w={},dataURLOptions:v={},mousemoveWait:b,recordDOM:S=!0,recordCanvas:I=!1,recordCrossOriginIframes:k=!1,recordAfter:x=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:O=!1,collectFonts:E=!1,inlineImages:M=!1,plugins:R,keepIframeSrcFn:A=()=>!1,ignoreCSSAttributes:T=new Set([]),errorHandler:N}=e;El=N;const L=!k||window.parent===window;let F=!1;if(!L)try{window.parent.document&&(F=!1)}catch(e){F=!0}if(L&&!t)throw new Error("emit function is required");if(!L&&!F)return()=>{};void 0!==b&&void 0===w.mousemove&&(w.mousemove=b),dc.reset();const D=!0===u?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:void 0!==d?d:{password:!0},P=!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===p,headMetaDescKeywords:"all"===p,headTitleMutations:"all"===p}:p||{};let _;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach)}();let U=0;const B=e=>{for(const t of R||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!F&&(e=y(e)),e};lc=(e,n)=>{var o;const i=e;if(i.timestamp=Ha(),!(null==(o=Rl[0])?void 0:o.isFrozen())||i.type===dl.FullSnapshot||i.type===dl.IncrementalSnapshot&&i.data.source===pl.Mutation||Rl.forEach(e=>e.unfreeze()),L)null==t||t(B(i),n);else if(F){const e={type:"rrweb",event:B(i),origin:window.location.origin,isCheckout:n};window.parent.postMessage(e,"*")}if(i.type===dl.FullSnapshot)_=i,U=0;else if(i.type===dl.IncrementalSnapshot){if(i.data.source===pl.Mutation&&i.data.isAttachIframe)return;U++;const e=r&&U>=r,t=s&&i.timestamp-_.timestamp>s;(e||t)&&cc(!0)}};const z=e=>{lc({type:dl.IncrementalSnapshot,data:{source:pl.Mutation,...e}})},j=e=>lc({type:dl.IncrementalSnapshot,data:{source:pl.Scroll,...e}}),$=e=>lc({type:dl.IncrementalSnapshot,data:{source:pl.CanvasMutation,...e}}),W=new ic({mutationCb:z,adoptedStyleSheetCb:e=>lc({type:dl.IncrementalSnapshot,data:{source:pl.AdoptedStyleSheet,...e}})}),V=new Wl({mirror:dc,mutationCb:z,stylesheetManager:W,recordCrossOriginIframes:k,wrappedEmit:lc});for(const e of R||[])e.getMirror&&e.getMirror({nodeMirror:dc,crossOriginIframeMirror:V.crossOriginIframeMirror,crossOriginIframeStyleMirror:V.crossOriginIframeStyleMirror});const G=new ac;hc=new oc({recordCanvas:I,mutationCb:$,win:window,blockClass:n,blockSelector:o,mirror:dc,sampling:w.canvas,dataURLOptions:v});const Y=new Vl({mutationCb:z,scrollCb:j,bypassOptions:{blockClass:n,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:h,maskInputOptions:D,dataURLOptions:v,maskTextFn:m,maskInputFn:f,recordCanvas:I,inlineImages:M,sampling:w,slimDOMOptions:P,iframeManager:V,stylesheetManager:W,canvasManager:hc,keepIframeSrcFn:A,processedNodeManager:G},mirror:dc});cc=(e=!1)=>{if(!S)return;lc({type:dl.Meta,data:{href:window.location.href,width:Qa(),height:qa()}},e),W.reset(),Y.init(),Rl.forEach(e=>e.lock());const t=function(e,t){const{mirror:s=new C,blockClass:r="rr-block",blockSelector:n=null,maskTextClass:o="rr-mask",maskTextSelector:i=null,inlineStylesheet:a=!0,inlineImages:l=!1,recordCanvas:c=!1,maskAllInputs:h=!1,maskTextFn:u,maskInputFn:d,slimDOM:p=!1,dataURLOptions:f,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:v,stylesheetLoadTimeout:b,keepIframeSrcFn:S=()=>!1}=t||{};return q(e,{doc:e,mirror:s,blockClass:r,blockSelector:n,maskTextClass:o,maskTextSelector:i,skipChild:!1,inlineStylesheet:a,maskInputOptions:!0===h?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:!1===h?{password:!0}:h,maskTextFn:u,maskInputFn:d,slimDOMOptions:!0===p||"all"===p?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===p,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:!1===p?{}:p,dataURLOptions:f,inlineImages:l,recordCanvas:c,preserveWhiteSpace:m,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:v,stylesheetLoadTimeout:b,keepIframeSrcFn:S,newlyAddedElement:!1})}(document,{mirror:dc,blockClass:n,blockSelector:o,maskTextClass:l,maskTextSelector:c,inlineStylesheet:h,maskAllInputs:D,maskTextFn:m,maskInputFn:f,slimDOM:P,dataURLOptions:v,recordCanvas:I,inlineImages:M,onSerialize:e=>{ol(e,dc)&&V.addIframe(e),il(e,dc)&&W.trackLinkElement(e),al(e)&&Y.addShadowRoot(Wa.shadowRoot(e),document)},onIframeLoad:(e,t)=>{V.attachIframe(e,t),Y.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{W.attachLinkElement(e,t)},keepIframeSrcFn:A});if(!t)return console.warn("Failed to snapshot the document");lc({type:dl.FullSnapshot,data:{node:t,initialOffset:Xa(window)}},e),Rl.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&W.adoptStyleSheets(document.adoptedStyleSheets,dc.getId(document))};try{const e=[],t=e=>{var t;return Ml(Bl)({mutationCb:z,mousemoveCb:(e,t)=>lc({type:dl.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>lc({type:dl.IncrementalSnapshot,data:{source:pl.MouseInteraction,...e}}),scrollCb:j,viewportResizeCb:e=>lc({type:dl.IncrementalSnapshot,data:{source:pl.ViewportResize,...e}}),inputCb:e=>lc({type:dl.IncrementalSnapshot,data:{source:pl.Input,...e}}),mediaInteractionCb:e=>lc({type:dl.IncrementalSnapshot,data:{source:pl.MediaInteraction,...e}}),styleSheetRuleCb:e=>lc({type:dl.IncrementalSnapshot,data:{source:pl.StyleSheetRule,...e}}),styleDeclarationCb:e=>lc({type:dl.IncrementalSnapshot,data:{source:pl.StyleDeclaration,...e}}),canvasMutationCb:$,fontCb:e=>lc({type:dl.IncrementalSnapshot,data:{source:pl.Font,...e}}),selectionCb:e=>{lc({type:dl.IncrementalSnapshot,data:{source:pl.Selection,...e}})},customElementCb:e=>{lc({type:dl.IncrementalSnapshot,data:{source:pl.CustomElement,...e}})},blockClass:n,ignoreClass:i,ignoreSelector:a,maskTextClass:l,maskTextSelector:c,maskInputOptions:D,inlineStylesheet:h,sampling:w,recordDOM:S,recordCanvas:I,inlineImages:M,userTriggeredOnInput:O,collectFonts:E,doc:e,maskInputFn:f,maskTextFn:m,keepIframeSrcFn:A,blockSelector:o,slimDOMOptions:P,dataURLOptions:v,mirror:dc,iframeManager:V,stylesheetManager:W,shadowDomManager:Y,processedNodeManager:G,canvasManager:hc,ignoreCSSAttributes:T,plugins:(null==(t=null==R?void 0:R.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>lc({type:dl.Plugin,data:{plugin:e.name,payload:t}})})))||[]},g)};V.addLoadListener(s=>{try{e.push(t(s.contentDocument))}catch(e){console.warn(e)}});const s=()=>{cc(),e.push(t(document)),uc=!0};return"interactive"===document.readyState||"complete"===document.readyState?s():(e.push(Va("DOMContentLoaded",()=>{lc({type:dl.DomContentLoaded,data:{}}),"DOMContentLoaded"===x&&s()})),e.push(Va("load",()=>{lc({type:dl.Load,data:{}}),"load"===x&&s()},window))),()=>{e.forEach(e=>e()),G.destroy(),uc=!1,El=void 0}}catch(e){console.warn(e)}}var fc,mc;pc.addCustomEvent=(e,t)=>{if(!uc)throw new Error("please add custom event after start recording");lc({type:dl.Custom,data:{tag:e,payload:t}})},pc.freezePage=()=>{Rl.forEach(e=>e.freeze())},pc.takeFullSnapshot=e=>{if(!uc)throw new Error("please take full snapshot after start recording");cc(e)},pc.mirror=dc,(mc=fc||(fc={}))[mc.NotStarted=0]="NotStarted",mc[mc.Running=1]="Running",mc[mc.Stopped=2]="Stopped";const gc=[];for(let e=0;e<256;++e)gc.push((e+256).toString(16).slice(1));let yc;const wc=new Uint8Array(16);const vc={};function bc(e,t,s){let r;{const e=Date.now(),n=function(){if(!yc){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");yc=crypto.getRandomValues.bind(crypto)}return yc(wc)}();!function(e,t,s){e.msecs??=-1/0,e.nsecs??=0,t===e.msecs?(e.nsecs++,e.nsecs>=1e4&&(e.node=void 0,e.nsecs=0)):t>e.msecs?e.nsecs=0:t<e.msecs&&(e.node=void 0);e.node||(e.node=s.slice(10,16),e.node[0]|=1,e.clockseq=16383&(s[8]<<8|s[9]));e.msecs=t}(vc,e,n),r=function(e,t,s,r,n,o,i=0){if(e.length<16)throw new Error("Random bytes length must be >= 16");if(o){if(i<0||i+16>o.length)throw new RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`)}else o=new Uint8Array(16),i=0;t??=Date.now(),s??=0,r??=16383&(e[8]<<8|e[9]),n??=e.slice(10,16);const a=(1e4*(268435455&(t+=122192928e5))+s)%4294967296;o[i++]=a>>>24&255,o[i++]=a>>>16&255,o[i++]=a>>>8&255,o[i++]=255&a;const l=t/4294967296*1e4&268435455;o[i++]=l>>>8&255,o[i++]=255&l,o[i++]=l>>>24&15|16,o[i++]=l>>>16&255,o[i++]=r>>>8|128,o[i++]=255&r;for(let e=0;e<6;++e)o[i++]=n[e];return o}(n,vc.msecs,vc.nsecs,vc.clockseq,vc.node,t,s)}return t??function(e,t=0){return(gc[e[t+0]]+gc[e[t+1]]+gc[e[t+2]]+gc[e[t+3]]+"-"+gc[e[t+4]]+gc[e[t+5]]+"-"+gc[e[t+6]]+gc[e[t+7]]+"-"+gc[e[t+8]]+gc[e[t+9]]+"-"+gc[e[t+10]]+gc[e[t+11]]+gc[e[t+12]]+gc[e[t+13]]+gc[e[t+14]]+gc[e[t+15]]).toLowerCase()}(r)}var Sc;e.LogLevel=void 0,(Sc=e.LogLevel||(e.LogLevel={}))[Sc.NONE=0]="NONE",Sc[Sc.ERROR=1]="ERROR",Sc[Sc.WARN=2]="WARN",Sc[Sc.INFO=3]="INFO",Sc[Sc.DEBUG=4]="DEBUG";const Cc=new class{constructor(t){this.config={level:e.LogLevel.ERROR,enableConsole:!0,enableStorage:!1},this.isBrowser="undefined"!=typeof window,t&&(this.config=Object.assign(Object.assign({},this.config),t))}setConfig(e){this.config=Object.assign(Object.assign({},this.config),e)}shouldLog(e){return e<=this.config.level}formatMessage(e,t,...s){return`[HumanBehavior ${e}] ${(new Date).toISOString()}: ${t}`}error(t,...s){if(!this.shouldLog(e.LogLevel.ERROR))return;const r=this.formatMessage("ERROR",t);this.config.enableConsole&&console.error(r,...s),this.config.enableStorage&&this.isBrowser&&this.logToStorage(r,s)}warn(t,...s){if(!this.shouldLog(e.LogLevel.WARN))return;const r=this.formatMessage("WARN",t);this.config.enableConsole&&console.warn(r,...s),this.config.enableStorage&&this.isBrowser&&this.logToStorage(r,s)}info(t,...s){if(!this.shouldLog(e.LogLevel.INFO))return;const r=this.formatMessage("INFO",t);this.config.enableConsole&&console.log(r,...s),this.config.enableStorage&&this.isBrowser&&this.logToStorage(r,s)}debug(t,...s){if(!this.shouldLog(e.LogLevel.DEBUG))return;const r=this.formatMessage("DEBUG",t);this.config.enableConsole&&console.log(r,...s),this.config.enableStorage&&this.isBrowser&&this.logToStorage(r,s)}logToStorage(e,t){try{const s=JSON.parse(localStorage.getItem("human_behavior_logs")||"[]"),r={message:e,args:t.length>0?t:void 0,timestamp:Date.now()};s.push(r),s.length>1e3&&s.splice(0,s.length-1e3),localStorage.setItem("human_behavior_logs",JSON.stringify(s))}catch(e){}}getLogs(){if(!this.isBrowser)return[];try{return JSON.parse(localStorage.getItem("human_behavior_logs")||"[]")}catch(e){return[]}}clearLogs(){this.isBrowser&&localStorage.removeItem("human_behavior_logs")}},Ic=(e,...t)=>Cc.error(e,...t),kc=(e,...t)=>Cc.warn(e,...t),xc=(e,...t)=>Cc.info(e,...t),Oc=(e,...t)=>Cc.debug(e,...t),Ec=1048576;function Mc(e,t,s){return(new TextEncoder).encode(JSON.stringify({sessionId:s,events:[...e,t]})).length>Ec}function Rc(e,t){if(!e||"object"!=typeof e)return[];if((new TextEncoder).encode(JSON.stringify({sessionId:t,events:[e]})).length<=Ec)return[e];const s=Object.assign({},e),r=["screenshot","html","dom","fullText","innerHTML","outerHTML"];r.forEach(e=>{s[e]&&delete s[e]});if((new TextEncoder).encode(JSON.stringify({sessionId:t,events:[s]})).length<=Ec)return[s];return[Object.assign({type:e.type,timestamp:e.timestamp,url:e.url,pathname:e.pathname},Object.fromEntries(Object.entries(e).filter(([e,t])=>!r.includes(e)&&"object"!=typeof t&&"string"!=typeof t||"string"==typeof t&&t.length<1e3)))]}class Ac{constructor({apiKey:e,ingestionUrl:t}){this.apiKey=e,this.baseUrl=t}init(e,s){return t(this,void 0,void 0,function*(){let t=null,r=null;"undefined"!=typeof window&&(t=window.location.href,r=document.referrer),xc("API init called with:",{sessionId:e,userId:s,entryURL:t,referrer:r,baseUrl:this.baseUrl});try{const n=yield fetch(`${this.baseUrl}/api/ingestion/init`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`,Referer:r||""},body:JSON.stringify({sessionId:e,endUserId:s,entryURL:t,referrer:r})});if(xc("API init response status:",n.status),!n.ok){const e=yield n.text();throw Ic("API init failed:",n.status,e),new Error(`Failed to initialize ingestion: ${n.statusText} - ${e}`)}const o=yield n.json();return xc("API init success:",o),{sessionId:o.sessionId,endUserId:o.endUserId}}catch(e){throw Ic("API init error:",e),e}})}sendEvents(e,s,r){return t(this,void 0,void 0,function*(){const t=e.filter(e=>e&&"object"==typeof e),n=yield fetch(`${this.baseUrl}/api/ingestion/events`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({sessionId:s,events:t,endUserId:r})});if(!n.ok)throw new Error(`Failed to send events: ${n.statusText}`)})}sendEventsChunked(e,s,r){return t(this,void 0,void 0,function*(){try{const t=[];let n=[];for(const o of e)if(o&&"object"==typeof o)if(Mc(n,o,s)){if(n.length>0){const e=yield fetch(`${this.baseUrl}/api/ingestion/events`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({sessionId:s,events:n,endUserId:r})});if(!e.ok)throw new Error(`Failed to send events: ${e.statusText}`);t.push(yield e.json()),n=[]}n=Rc(o,s)}else n.push(o);if(n.length>0){const e=yield fetch(`${this.baseUrl}/api/ingestion/events`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({sessionId:s,events:n,endUserId:r})});if(!e.ok)throw new Error(`Failed to send events: ${e.statusText}`);t.push(yield e.json())}return t.flat()}catch(e){throw Ic("Error sending events:",e),e}})}sendUserData(e,s,r){return t(this,void 0,void 0,function*(){try{const t={userId:e,userAttributes:s,sessionId:r,posthogName:s.email||s.name||null};Oc("Sending user data to server:",t);const n=yield fetch(`${this.baseUrl}/api/ingestion/user`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify(t)});if(!n.ok)throw new Error(`Failed to send user data: ${n.statusText} with API key: ${this.apiKey}`);const o=yield n.json();return Oc("Server response:",o),o}catch(e){throw Ic("Error sending user data:",e),e}})}sendUserAuth(e,s,r,n){return t(this,void 0,void 0,function*(){try{const t=yield fetch(`${this.baseUrl}/api/ingestion/user/auth`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({userId:e,userAttributes:s,sessionId:r,authFields:n})});if(!t.ok)throw new Error(`Failed to authenticate user: ${t.statusText} with API key: ${this.apiKey}`);return yield t.json()}catch(e){throw Ic("Error authenticating user:",e),e}})}sendBeaconEvents(e,t){const s={sessionId:t,events:e,endUserId:null,apiKey:this.apiKey},r=new Blob([JSON.stringify(s)],{type:"application/json"});return navigator.sendBeacon(`${this.baseUrl}/api/ingestion/events`,r)}sendCustomEvent(e,s,r){return t(this,void 0,void 0,function*(){xc("[SDK] Sending custom event",{sessionId:e,eventName:s,eventProperties:r});try{const t=yield fetch(`${this.baseUrl}/api/ingestion/customEvent`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({sessionId:e,eventName:s,eventProperties:r||{}})});if(xc("[SDK] Custom event response",{status:t.status,statusText:t.statusText}),!t.ok){const e=yield t.text();throw Ic("[SDK] Failed to send custom event",{status:t.status,statusText:t.statusText,errorText:e}),new Error(`Failed to send custom event: ${t.status} ${t.statusText} - ${e}`)}const n=yield t.json();return Oc("[SDK] Custom event success",n),n}catch(t){throw Ic("[SDK] Error sending custom event",t,{sessionId:e,eventName:s,eventProperties:r}),t}})}sendCustomEventBatch(e,s){return t(this,void 0,void 0,function*(){try{const t=yield fetch(`${this.baseUrl}/api/ingestion/customEvent/batch`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({sessionId:e,events:s})});if(!t.ok)throw new Error(`Failed to send custom event batch: ${t.statusText}`);return yield t.json()}catch(e){throw Ic("Error sending custom event batch:",e),e}})}}const Tc="undefined"!=typeof window;class Nc{constructor(e){this.redactedText="[REDACTED]",this.userSelectedFields=new Set,this.excludeSelectors=['[data-no-redact="true"]',".human-behavior-no-redact"],(null==e?void 0:e.redactedText)&&(this.redactedText=e.redactedText),(null==e?void 0:e.excludeSelectors)&&(this.excludeSelectors=[...this.excludeSelectors,...e.excludeSelectors]),(null==e?void 0:e.userFields)&&this.setFieldsToRedact(e.userFields)}setFieldsToRedact(e){this.userSelectedFields.clear(),e.forEach(e=>this.userSelectedFields.add(e)),e.length>0?(Oc(`Redaction: Active for ${e.length} field(s):`,e),e.forEach(e=>{const t=document.querySelectorAll(e);Oc(`Redaction: Found ${t.length} element(s) for selector '${e}'`),t.forEach((t,s)=>{Oc(`Redaction: Element ${s} for '${e}':`,t)})})):Oc("Redaction: Disabled - no fields selected")}isActive(){return this.userSelectedFields.size>0}getSelectedFields(){return Array.from(this.userSelectedFields)}processEvent(e){if(0===this.userSelectedFields.size)return e;const t=JSON.parse(JSON.stringify(e));if(3===t.type)if(5===t.data.source){this.isFieldSelected(t.data)&&(Oc("Redaction: Processing input event for redaction"),this.redactInputEvent(t.data))}else 0===t.data.source?this.redactDOMEvent(t.data):2===t.data.source&&this.redactMouseEvent(t.data);else 2===t.type&&this.redactFullSnapshot(t.data);return t}redactInputEvent(e){if(!this.isFieldSelected(e))return;Oc("Redaction: Redacting input event with text:",e.text);["text","value","content","data","input","textContent"].forEach(t=>{void 0!==e[t]&&"string"==typeof e[t]&&(e[t]=this.redactedText,Oc(`Redaction: Redacted property '${t}'`))}),Object.keys(e).forEach(t=>{"string"==typeof e[t]&&e[t].length>0&&(e[t]=this.redactedText,Oc(`Redaction: Redacted additional property '${t}'`))}),e.attributes&&"object"==typeof e.attributes&&e.attributes.value&&"string"==typeof e.attributes.value&&(e.attributes.value=this.redactedText,Oc("Redaction: Redacted nested value attribute")),Oc("Redaction: Input event redaction complete")}redactDOMEvent(e){e.texts&&Array.isArray(e.texts)&&e.texts.forEach(e=>{e.text&&"string"==typeof e.text&&this.shouldRedactDOMChange(e)&&(e.text=this.redactedText)}),e.attributes&&Array.isArray(e.attributes)&&e.attributes.forEach(e=>{e.attributes&&e.attributes.value&&"string"==typeof e.attributes.value&&this.shouldRedactDOMChange(e)&&(e.attributes.value=this.redactedText)}),e.adds&&Array.isArray(e.adds)&&e.adds.forEach(e=>{e.node&&e.node.textContent&&"string"==typeof e.node.textContent&&this.shouldRedactDOMChange(e)&&(e.node.textContent=this.redactedText)})}shouldRedactDOMChange(e){if(!Tc)return!1;try{const t=e.id;if(void 0!==t){let e=document.querySelector(`[data-rrweb-id="${t}"]`);if(e)return this.shouldRedactElement(e)}const s=e.nodeId;if(void 0!==s){const e=document.querySelector(`[data-rrweb-id="${s}"]`);if(e)return this.shouldRedactElement(e)}return!1}catch(e){return kc("Error checking if DOM change should be redacted:",e),!1}}redactMouseEvent(e){e.text&&"string"==typeof e.text&&this.isFieldSelected(e)&&(e.text=this.redactedText)}redactFullSnapshot(e){e.node&&2===e.node.type&&this.redactNode(e.node)}redactNode(e){e&&(2!==e.type||!e.tagName||"input"!==e.tagName.toLowerCase()&&"textarea"!==e.tagName.toLowerCase()||this.shouldRedactNode(e)&&(e.attributes&&e.attributes.value&&(e.attributes.value=this.redactedText),e.textContent&&(e.textContent=this.redactedText)),e.childNodes&&Array.isArray(e.childNodes)&&e.childNodes.forEach(e=>{this.redactNode(e)}))}shouldRedactNode(e){if(!e.attributes)return!1;for(const t of this.userSelectedFields)if(this.selectorMatchesNode(t,e))return!0;return!1}selectorMatchesNode(e,t){if(!t.attributes)return!1;try{const s=document.createElement(t.tagName||"div");return t.attributes&&Object.keys(t.attributes).forEach(e=>{s.setAttribute(e,t.attributes[e])}),s.matches(e)}catch(s){return this.basicSelectorMatch(e,t)}}basicSelectorMatch(e,t){if(!t.attributes)return!1;if(e.includes("input[type=")){const s=e.match(/input\[type="([^"]+)"\]/);if(s&&"input"===t.tagName&&t.attributes.type===s[1])return!0}if(e.startsWith("#")){const s=e.substring(1);return t.attributes.id===s}if(e.startsWith(".")){const s=e.substring(1);return t.attributes.class&&t.attributes.class.includes(s)}return!e.includes("[")&&!e.includes(".")&&(t.tagName&&t.tagName.toLowerCase()===e.toLowerCase())}isFieldSelected(e){if(!Tc)return!1;try{if(5===e.source){const t=e.id;if(void 0!==t){let s=document.querySelector(`[data-rrweb-id="${t}"]`);if(s)return this.shouldRedactElement(s);if(void 0!==e.nodeId&&(s=document.querySelector(`[data-rrweb-id="${e.nodeId}"]`),s))return this.shouldRedactElement(s);for(const e of this.userSelectedFields){const t=document.querySelectorAll(e);if(t.length>0)for(const s of t)if(s===document.activeElement)return Oc("Redaction: Found focused element matching selector:",e),!0}const r=document.activeElement;return!(!r||!this.shouldRedactElement(r))&&(Oc("Redaction: Active element should be redacted"),!0)}}const t=e.id;if(void 0!==t){let e=document.querySelector(`[data-rrweb-id="${t}"]`);if(e)return this.shouldRedactElement(e)}const s=e.nodeId;if(void 0!==s){const e=document.querySelector(`[data-rrweb-id="${s}"]`);if(e)return this.shouldRedactElement(e)}if(e.target&&e.target.id){const t=document.querySelector(`[data-rrweb-id="${e.target.id}"]`);if(t)return this.shouldRedactElement(t)}return!1}catch(e){return kc("Error checking if field should be redacted:",e),!1}}getMaskTextSelector(){return 0===this.userSelectedFields.size?null:Array.from(this.userSelectedFields).join(",")}shouldRedactElement(e){if(0===this.userSelectedFields.size)return!1;for(const t of this.userSelectedFields)try{if(e.matches(t))return!0}catch(e){kc(`Invalid selector: ${t}`)}return!1}applyRedactionClasses(){0!==this.userSelectedFields.size&&(document.querySelectorAll(".rr-mask").forEach(e=>{e.classList.remove("rr-mask")}),this.userSelectedFields.forEach(e=>{try{const t=document.querySelectorAll(e);t.forEach(e=>{e.classList.add("rr-mask")}),Oc(`Applied rr-mask class to ${t.length} element(s) for selector: ${e}`)}catch(t){kc(`Invalid selector: ${e}`)}}))}getOriginalValue(e){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)return e.value}isElementRedacted(e){return this.shouldRedactElement(e)}}const Lc=new Nc,Fc="undefined"!=typeof window;class Dc{static init(e,t){var s;if(Fc&&!1!==(null==t?void 0:t.suppressConsoleErrors)){const e=console.error;console.error=(...t)=>{const s=t.join(" ");s.includes("SecurityError: Failed to execute 'toDataURL'")||s.includes("Tainted canvases may not be exported")||s.includes("Cannot inline img src=")||s.includes("Cross-Origin")||s.includes("CORS")||s.includes("Access-Control-Allow-Origin")||s.includes("Failed to load resource")||s.includes("net::ERR_BLOCKED_BY_CLIENT")||e.apply(console,t)};const t=console.warn;console.warn=(...e)=>{const s=e.join(" ");s.includes("Cannot inline img src=")||s.includes("Cross-Origin")||s.includes("CORS")||s.includes("Access-Control-Allow-Origin")||s.includes("Failed to load resource")||s.includes("net::ERR_BLOCKED_BY_CLIENT")||t.apply(console,e)},window.addEventListener("error",e=>{const t=e.message||"";if(t.includes("SecurityError")||t.includes("Tainted canvases")||t.includes("toDataURL")||t.includes("Cross-Origin")||t.includes("CORS"))return e.preventDefault(),!1})}if(Fc&&window.__humanBehaviorGlobalTracker)return Oc("Tracker already initialized, returning existing instance"),window.__humanBehaviorGlobalTracker;(null==t?void 0:t.logLevel)&&this.configureLogging({level:t.logLevel});const r=new Dc(e,null==t?void 0:t.ingestionUrl);return r.recordCanvas=null!==(s=null==t?void 0:t.recordCanvas)&&void 0!==s&&s,(null==t?void 0:t.redactFields)&&(r.setRedactedFields(t.redactFields),r.redactionManager.applyRedactionClasses()),!1!==(null==t?void 0:t.enableAutomaticTracking)&&r.setupAutomaticTracking(null==t?void 0:t.automaticTrackingOptions),r.start(),r}constructor(e,t){if(this.eventIngestionQueue=[],this.userProperties={},this.isProcessing=!1,this.flushInterval=null,this.FLUSH_INTERVAL_MS=5e3,this.endUserId=null,this.initialized=!1,this.initializationPromise=null,this.originalConsole=null,this.consoleTrackingEnabled=!1,this.navigationTrackingEnabled=!1,this.currentUrl="",this.previousUrl="",this.originalPushState=null,this.originalReplaceState=null,this.navigationListeners=[],this._connectionBlocked=!1,this.recordInstance=null,this.sessionStartTime=Date.now(),this.rrwebRecord=null,this.fullSnapshotTimeout=null,this.recordCanvas=!1,!e)throw new Error("Human Behavior API Key is required");if(this.api=new Ac({apiKey:e,ingestionUrl:t||"https://ingest.humanbehavior.co"}),this.apiKey=e,this.redactionManager=new Nc,Fc){const e=localStorage.getItem(`human_behavior_session_id_${this.apiKey}`),t=localStorage.getItem(`human_behavior_last_activity_${this.apiKey}`),s=Date.now()-9e5;e&&t&&parseInt(t)>s?(this.sessionId=e,Oc(`Reusing existing session: ${this.sessionId}`),localStorage.setItem(`human_behavior_last_activity_${this.apiKey}`,Date.now().toString())):(e&&(Oc(`Session expired, clearing old session: ${e}`),localStorage.removeItem(`human_behavior_session_id_${this.apiKey}`),localStorage.removeItem(`human_behavior_last_activity_${this.apiKey}`)),this.sessionId=bc(),Oc(`Creating new session: ${this.sessionId}`),localStorage.setItem(`human_behavior_session_id_${this.apiKey}`,this.sessionId),localStorage.setItem(`human_behavior_last_activity_${this.apiKey}`,Date.now().toString())),this.currentUrl=window.location.href,window.__humanBehaviorGlobalTracker=this}else this.sessionId=bc();this.initializationPromise=this.init()}init(){return t(this,void 0,void 0,function*(){try{const e=this.getCookie(`human_behavior_end_user_id_${this.apiKey}`);Oc(`Initializing with sessionId: ${this.sessionId}, userId: ${e}`);const{sessionId:t,endUserId:s}=yield this.api.init(this.sessionId,e);t!==this.sessionId&&(Oc(`Server returned different sessionId: ${t} (client had: ${this.sessionId})`),this.sessionId=t,Fc&&localStorage.setItem(`human_behavior_session_id_${this.apiKey}`,this.sessionId)),this.endUserId=s,this.setCookie(`human_behavior_end_user_id_${this.apiKey}`,s,365),Fc?(this.setupPageUnloadHandler(),this.setupNavigationTracking()):kc("HumanBehaviorTracker initialized in a non-browser environment. Session tracking is disabled."),this.initialized=!0,xc(`HumanBehaviorTracker initialized with sessionId: ${this.sessionId}, endUserId: ${s}`)}catch(e){throw Ic("Failed to initialize HumanBehaviorTracker:",e),e}})}ensureInitialized(){return t(this,void 0,void 0,function*(){if(!this.initializationPromise)throw new Error("HumanBehaviorTracker initialization failed");yield this.initializationPromise})}setupNavigationTracking(){if(!Fc||this.navigationTrackingEnabled)return;this.navigationTrackingEnabled=!0,Oc("Setting up navigation tracking"),this.originalPushState=history.pushState,this.originalReplaceState=history.replaceState,history.pushState=(...e)=>{this.previousUrl=this.currentUrl,this.currentUrl=window.location.href,this.originalPushState.apply(history,e),this.trackNavigationEvent("pushState",this.previousUrl,this.currentUrl),this.takeFullSnapshot()},history.replaceState=(...e)=>{this.previousUrl=this.currentUrl,this.currentUrl=window.location.href,this.originalReplaceState.apply(history,e),this.trackNavigationEvent("replaceState",this.previousUrl,this.currentUrl),this.takeFullSnapshot()};const e=()=>{this.previousUrl=this.currentUrl,this.currentUrl=window.location.href,this.trackNavigationEvent("popstate",this.previousUrl,this.currentUrl),this.takeFullSnapshot()};window.addEventListener("popstate",e),this.navigationListeners.push(()=>{window.removeEventListener("popstate",e)});const t=()=>{this.previousUrl=this.currentUrl,this.currentUrl=window.location.href,this.trackNavigationEvent("hashchange",this.previousUrl,this.currentUrl)};window.addEventListener("hashchange",t),this.navigationListeners.push(()=>{window.removeEventListener("hashchange",t)}),this.trackNavigationEvent("pageLoad","",this.currentUrl)}trackNavigationEvent(e,s,r){return t(this,void 0,void 0,function*(){if(this.initialized)try{const t={type:e,from:s,to:r,timestamp:(new Date).toISOString(),pathname:window.location.pathname,search:window.location.search,hash:window.location.hash,referrer:document.referrer};yield this.addEvent({type:5,data:{payload:Object.assign({eventType:"navigation"},t)},timestamp:Date.now()}),Oc(`Navigation tracked: ${e} from ${s} to ${r}`)}catch(e){Ic("Failed to track navigation event:",e)}})}trackPageView(e){return t(this,void 0,void 0,function*(){if(this.initialized)try{const t={url:e||window.location.href,pathname:window.location.pathname,search:window.location.search,hash:window.location.hash,referrer:document.referrer,timestamp:(new Date).toISOString()};yield this.addEvent({type:5,data:{payload:Object.assign({eventType:"pageview"},t)},timestamp:Date.now()}),Oc(`Pageview tracked: ${t.url}`)}catch(e){Ic("Failed to track pageview event:",e)}})}customEvent(e,s){return t(this,void 0,void 0,function*(){var t,r,n,o,i;if(this.initialized)try{yield this.api.sendCustomEvent(this.sessionId,e,s),Oc(`Custom event tracked: ${e}`,s)}catch(a){Ic("Failed to track custom event:",a),(null===(t=a.message)||void 0===t?void 0:t.includes("500"))||(null===(r=a.message)||void 0===r?void 0:r.includes("Internal Server Error"))||(null===(n=a.message)||void 0===n?void 0:n.includes("Failed to send custom event"))?kc("Custom event endpoint failed, using fallback"):(null===(o=a.message)||void 0===o?void 0:o.includes("ERR_BLOCKED_BY_CLIENT"))?kc("Custom event request blocked by ad blocker, using fallback"):(null===(i=a.message)||void 0===i?void 0:i.includes("Failed to fetch"))&&kc("Custom event network error, using fallback");try{const t={eventName:e,properties:s||{},timestamp:(new Date).toISOString(),url:window.location.href,pathname:window.location.pathname};yield this.addEvent({type:5,data:{payload:Object.assign({eventType:"custom"},t)},timestamp:Date.now()}),Oc(`Custom event added to event stream as fallback: ${e}`)}catch(e){Ic("Failed to add custom event to event stream as fallback:",e)}}})}setupAutomaticTracking(e){if(!Fc)return;const t={trackButtons:!1!==(null==e?void 0:e.trackButtons),trackLinks:!1!==(null==e?void 0:e.trackLinks),trackForms:!1!==(null==e?void 0:e.trackForms),includeText:!1!==(null==e?void 0:e.includeText),includeClasses:(null==e?void 0:e.includeClasses)||!1};Oc("Setting up automatic tracking with config:",t),t.trackButtons&&this.setupAutomaticButtonTracking(t),t.trackLinks&&this.setupAutomaticLinkTracking(t),t.trackForms&&this.setupAutomaticFormTracking(t)}setupAutomaticButtonTracking(e){document.addEventListener("click",s=>t(this,void 0,void 0,function*(){var t;const r=s.target;if("BUTTON"===r.tagName||r.closest("button")){const s="BUTTON"===r.tagName?r:r.closest("button"),n={buttonId:s.id||null,buttonType:s.type||"button",page:window.location.pathname,timestamp:Date.now()};e.includeText&&(n.buttonText=(null===(t=s.textContent)||void 0===t?void 0:t.trim())||null),e.includeClasses&&(n.buttonClass=s.className||null),Object.keys(n).forEach(e=>{null===n[e]&&delete n[e]}),yield this.customEvent("button_clicked",n)}}))}setupAutomaticLinkTracking(e){document.addEventListener("click",s=>t(this,void 0,void 0,function*(){var t;const r=s.target;if("A"===r.tagName||r.closest("a")){const s="A"===r.tagName?r:r.closest("a"),n={linkUrl:s.href||null,linkId:s.id||null,linkTarget:s.target||null,page:window.location.pathname,timestamp:Date.now()};e.includeText&&(n.linkText=(null===(t=s.textContent)||void 0===t?void 0:t.trim())||null),e.includeClasses&&(n.linkClass=s.className||null),Object.keys(n).forEach(e=>{null===n[e]&&delete n[e]}),yield this.customEvent("link_clicked",n)}}))}setupAutomaticFormTracking(e){document.addEventListener("submit",s=>t(this,void 0,void 0,function*(){const t=s.target,r=new FormData(t),n={formId:t.id||null,formAction:t.action||null,formMethod:t.method||"get",fields:Array.from(r.keys()),page:window.location.pathname,timestamp:Date.now()};e.includeClasses&&(n.formClass=t.className||null),Object.keys(n).forEach(e=>{null===n[e]&&delete n[e]}),yield this.customEvent("form_submitted",n)}))}cleanupNavigationTracking(){this.navigationTrackingEnabled&&(this.originalPushState&&(history.pushState=this.originalPushState),this.originalReplaceState&&(history.replaceState=this.originalReplaceState),this.navigationListeners.forEach(e=>e()),this.navigationListeners=[],this.navigationTrackingEnabled=!1,Oc("Navigation tracking cleaned up"))}static logToStorage(e){xc(e)}static configureLogging(e){Cc.setConfig({level:{none:0,error:1,warn:2,info:3,debug:4}[e.level||"error"],enableConsole:!1!==e.enableConsole,enableStorage:e.enableStorage||!1})}enableConsoleTracking(){Fc&&!this.consoleTrackingEnabled&&(this.originalConsole={log:console.log,warn:console.warn,error:console.error},console.log=(...e)=>{this.trackConsoleEvent("log",e),this.originalConsole.log(...e)},console.warn=(...e)=>{this.trackConsoleEvent("warn",e),this.originalConsole.warn(...e)},console.error=(...e)=>{this.trackConsoleEvent("error",e),this.originalConsole.error(...e)},this.consoleTrackingEnabled=!0,Oc("Console tracking enabled"))}disableConsoleTracking(){Fc&&this.consoleTrackingEnabled&&(this.originalConsole&&(console.log=this.originalConsole.log,console.warn=this.originalConsole.warn,console.error=this.originalConsole.error),this.consoleTrackingEnabled=!1,Oc("Console tracking disabled"))}trackConsoleEvent(e,t){if(this.initialized)try{const s={level:e,message:t.map(e=>"object"==typeof e?JSON.stringify(e):String(e)).join(" "),timestamp:(new Date).toISOString(),url:window.location.href};this.addEvent({type:5,data:{payload:Object.assign({eventType:"console"},s)},timestamp:Date.now()}).catch(e=>{Ic("Failed to track console event:",e)})}catch(e){Ic("Error in trackConsoleEvent:",e)}}setupPageUnloadHandler(){if(!Fc)return;Oc("Setting up page unload handler"),window.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&(Oc("Page hidden - sending pending events"),this.api.sendBeaconEvents(this.eventIngestionQueue,this.sessionId))}),window.addEventListener("beforeunload",()=>{this.api.sendBeaconEvents(this.eventIngestionQueue,this.sessionId)});const e=()=>{localStorage.setItem(`human_behavior_last_activity_${this.apiKey}`,Date.now().toString())};window.addEventListener("click",e),window.addEventListener("keydown",e),window.addEventListener("scroll",e),window.addEventListener("mousemove",e)}viewLogs(){try{const e=Cc.getLogs();xc("HumanBehavior Logs:",e),Cc.clearLogs()}catch(e){Ic("Failed to read logs:",e)}}identifyUser(e){return t(this,arguments,void 0,function*({userProperties:e}){yield this.ensureInitialized();const t=this.endUserId;return this.userProperties=e,Oc("Identifying user:",{userProperties:e,originalEndUserId:t,sessionId:this.sessionId}),yield this.api.sendUserData(t,e,this.sessionId),t||""})}getUserAttributes(){return Object.assign({},this.userProperties)}start(){return t(this,void 0,void 0,function*(){if(yield this.ensureInitialized(),!Fc)return;this.flushInterval=window.setInterval(()=>{this.flush()},this.FLUSH_INTERVAL_MS);const e=()=>{Oc("🎯 DOM ready, starting session recording"),this.rrwebRecord=pc;const e=pc({emit:e=>{this.addEvent(e),2===e.type&&Oc(`🎯 FullSnapshot generated at ${(new Date).toISOString()}`)},maskTextSelector:this.redactionManager.getMaskTextSelector()||void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1,recordCanvas:this.recordCanvas,sampling:this.recordCanvas?{canvas:4}:void 0,dataURLOptions:this.recordCanvas?{type:"image/webp",quality:.4}:void 0});this.recordInstance=e||null};Oc(`🎯 DOM ready state: ${document.readyState}`),"complete"===document.readyState?(Oc("🎯 DOM already complete, starting recording immediately"),e()):(Oc("🎯 DOM not ready, waiting for DOMContentLoaded event"),document.addEventListener("DOMContentLoaded",()=>{Oc("🎯 DOMContentLoaded fired, starting recording"),e()},{once:!0}))})}takeFullSnapshot(){this.fullSnapshotTimeout&&clearTimeout(this.fullSnapshotTimeout),this.fullSnapshotTimeout=window.setTimeout(()=>{try{requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.rrwebRecord&&"function"==typeof this.rrwebRecord.takeFullSnapshot?(this.rrwebRecord.takeFullSnapshot(),Oc("✅ FullSnapshot taken for navigation (delayed for animations)")):kc("⚠️ takeFullSnapshot not available on record function")})})}catch(e){Ic("❌ Failed to take FullSnapshot for navigation:",e)}},1e3)}stop(){return t(this,void 0,void 0,function*(){yield this.ensureInitialized(),Fc&&(this.flushInterval&&(clearInterval(this.flushInterval),this.flushInterval=null),this.recordInstance&&(this.recordInstance(),this.recordInstance=null),this.fullSnapshotTimeout&&(clearTimeout(this.fullSnapshotTimeout),this.fullSnapshotTimeout=null),this.rrwebRecord=null,this.disableConsoleTracking(),this.cleanupNavigationTracking())})}addEvent(e){return t(this,void 0,void 0,function*(){var t,s;if(yield this.ensureInitialized(),e&&"object"==typeof e){if(2===e.type){const r=!!e.data,n=!(!e.data||!e.data.node);Oc(r&&n?`✅ Valid FullSnapshot: hasData=${r}, hasNode=${n}, dataType=${null===(s=null===(t=e.data)||void 0===t?void 0:t.node)||void 0===s?void 0:s.type}`:`⚠️ Empty FullSnapshot detected: hasData=${r}, hasNode=${n} - continuing session`)}this.eventIngestionQueue.push(e)}else Oc("⚠️ Skipping invalid event:",e)})}flush(){return t(this,void 0,void 0,function*(){var e,t,s,r,n,o;if(!this.isProcessing&&this.initialized){this.isProcessing=!0;try{const i=this.eventIngestionQueue;if(this.eventIngestionQueue=[],i.length>0){Oc("Flushing events:",i);const a=i.filter(e=>2===e.type);a.length>0&&Oc(`[FIXED] Sending ${a.length} FullSnapshot(s) with valid data`);try{yield this.api.sendEventsChunked(i,this.sessionId,this.endUserId)}catch(i){if(null===(e=i.message)||void 0===e?void 0:e.includes("ERROR: Session already completed"))kc("Session expired, events will be lost");else if((null===(t=i.message)||void 0===t?void 0:t.includes("413"))||(null===(s=i.message)||void 0===s?void 0:s.includes("Content Too Large")))kc("Payload too large, events will be lost");else{if(!((null===(r=i.message)||void 0===r?void 0:r.includes("ERR_BLOCKED_BY_CLIENT"))||(null===(n=i.message)||void 0===n?void 0:n.includes("Failed to fetch"))||(null===(o=i.message)||void 0===o?void 0:o.includes("NetworkError"))))throw i;kc("Request blocked by ad blocker or network issue, events will be lost")}}}}finally{this.isProcessing=!1}}})}setCookie(e,t,s){if(Fc)try{const r=new Date;r.setTime(r.getTime()+24*s*60*60*1e3);const n=`expires=${r.toUTCString()}`;document.cookie=`${e}=${t};${n};path=/;SameSite=Lax`,localStorage.setItem(e,t),Oc(`Set cookie and localStorage: ${e}`)}catch(s){try{localStorage.setItem(e,t),Oc(`Cookie blocked, using localStorage: ${e}`)}catch(e){Ic("Failed to store user ID in both cookie and localStorage:",e)}}}getCookie(e){if(!Fc)return null;try{const t=e+"=",s=document.cookie.split(";");for(let r=0;r<s.length;r++){let n=s[r];for(;" "===n.charAt(0);)n=n.substring(1,n.length);if(0===n.indexOf(t)){const s=n.substring(t.length,n.length);return Oc(`Found cookie: ${e}`),s}}const r=localStorage.getItem(e);return r?(Oc(`Cookie not found, using localStorage: ${e}`),r):null}catch(t){try{const t=localStorage.getItem(e);if(t)return Oc(`Cookie access failed, using localStorage: ${e}`),t}catch(e){Ic("Failed to access both cookie and localStorage:",e)}return null}}deleteCookie(e){if(Fc){try{document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; SameSite=Lax`,Oc(`Deleted cookie: ${e}`)}catch(t){Ic(`Failed to delete cookie: ${e}`,t)}try{localStorage.removeItem(e),Oc(`Removed from localStorage: ${e}`)}catch(t){Ic(`Failed to remove from localStorage: ${e}`,t)}}}logout(){if(Fc)try{const e=`human_behavior_end_user_id_${this.apiKey}`;this.deleteCookie(e),localStorage.removeItem(`human_behavior_session_id_${this.apiKey}`),localStorage.removeItem(`human_behavior_last_activity_${this.apiKey}`),this.endUserId=null,this.userProperties={},this.sessionId=bc(),Fc&&(localStorage.setItem(`human_behavior_session_id_${this.apiKey}`,this.sessionId),localStorage.setItem(`human_behavior_last_activity_${this.apiKey}`,Date.now().toString())),xc("User logged out - cleared all user data and started fresh session")}catch(e){Ic("Error during logout:",e)}}redact(e){return t(this,void 0,void 0,function*(){yield this.ensureInitialized(),Fc?this.redactionManager=new Nc(e):kc("Redaction is only available in browser environments")})}setRedactedFields(e){this.redactionManager.setFieldsToRedact(e),this.redactionManager.applyRedactionClasses(),this.recordInstance&&this.restartWithNewRedaction()}restartWithNewRedaction(){this.recordInstance&&(this.recordInstance(),this.start())}isRedactionActive(){return this.redactionManager.isActive()}getRedactedFields(){return this.redactionManager.getSelectedFields()}getSessionId(){return this.sessionId}getCurrentUrl(){return this.currentUrl}getSnapshotFrequencyInfo(){return{sessionDuration:Date.now()-this.sessionStartTime,currentInterval:3e5,currentThreshold:1e3,phase:"configured"}}testConnection(){return t(this,void 0,void 0,function*(){try{return yield this.api.init(this.sessionId,this.endUserId),{success:!0}}catch(e){return{success:!1,error:e.message||"Unknown error"}}})}getConnectionStatus(){const e=[];let t=!1;return this.eventIngestionQueue.length>0&&(t=!0,e.push("Some requests may be blocked by ad blockers")),this._connectionBlocked&&(t=!0,e.push("Initial connection test failed - ad blocker may be active")),"undefined"==typeof window&&e.push("Not running in browser environment"),void 0===navigator.sendBeacon&&e.push("sendBeacon not available, using fetch fallback"),{blocked:t,recommendations:e}}isPreexistingUser(){if(!Fc)return!1;const e=this.getCookie(`human_behavior_end_user_id_${this.apiKey}`);return null!==e&&e!==this.endUserId}getUserInfo(){return{endUserId:this.endUserId,sessionId:this.sessionId,isPreexistingUser:this.isPreexistingUser(),initialized:this.initialized}}}Fc&&(window.HumanBehaviorTracker=Dc),"undefined"!=typeof window&&(window.HumanBehaviorTracker=Dc),e.HumanBehaviorAPI=Ac,e.HumanBehaviorTracker=Dc,e.MAX_CHUNK_SIZE_BYTES=Ec,e.RedactionManager=Nc,e.isChunkSizeExceeded=Mc,e.logDebug=Oc,e.logError=Ic,e.logInfo=xc,e.logWarn=kc,e.logger=Cc,e.redactionManager=Lc,e.splitLargeEvent=Rc,e.validateSingleEventSize=function(e,t){const s=(new TextEncoder).encode(JSON.stringify({sessionId:t,events:[e]})).length;s>Ec&&kc(`Single event size (${s} bytes) exceeds maximum chunk size (1048576 bytes). Consider reducing event data size.`)}});
2
+ //# sourceMappingURL=index.min.js.map