@zaplier/sdk 1.3.2 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sdk.min.js CHANGED
@@ -4,4 +4,4 @@
4
4
  * (c) 2025 RabbitTracker Team
5
5
  * https://zaplier.com
6
6
  */
7
- var e=function(e){"use strict";function t(e,t){const n=e[1]+t[1]&4294967295;return[e[0]+t[0]+(n<e[1]?1:0)&4294967295,n]}function n(e,t){const n=65535&e[1],o=e[1]>>>16,r=65535&t[1],i=t[1]>>>16,a=n*i+o*r&4294967295,s=o*i+(a>>>16),c=n*r+((65535&a)<<16)&4294967295;return[e[0]*t[1]+e[1]*t[0]+s&4294967295,c]}function o(e,t){return 0==(t%=64)?e:t<32?[4294967295&(e[0]<<t|e[1]>>>32-t),4294967295&(e[1]<<t|e[0]>>>32-t)]:(t-=32,[4294967295&(e[1]<<t|e[0]>>>32-t),4294967295&(e[0]<<t|e[1]>>>32-t)])}function r(e,t){return[e[0]^t[0],e[1]^t[1]]}function i(e){let t=e;return t=r(t,[0,t[0]>>>1]),t=n(t,[4283543511,3981806797]),t=r(t,[0,t[0]>>>1]),t=n(t,[3301882366,444984403]),t=r(t,[0,t[0]>>>1]),t}function a(e,a=0){const s=function(e){const t=[];for(let n=0;n<e.length;n+=4){let o=0;for(let t=Math.min(3,e.length-n-1);t>=0;t--)o=o<<8|e.charCodeAt(n+t);t.push(o)}return t}(e),c=Math.floor(s.length/4);let l=[0,a],d=[0,a];const u=[2277735313,289559509],h=[1291169091,658871167];for(let e=0;e<c;e++){const i=4*e,a=4*e+2;let c=[s[i+1]||0,s[i]||0],m=[s[a+1]||0,s[a]||0];c=n(c,u),c=o(c,31),c=n(c,h),l=r(l,c),l=o(l,27),l=t(l,d),l=t(n(l,[0,5]),[0,1390208809]),m=n(m,h),m=o(m,33),m=n(m,u),d=r(d,m),d=o(d,31),d=t(d,l),d=t(n(d,[0,5]),[0,944331445])}const m=4*c,g=s.length-m;let p=[0,0],f=[0,0];return g>=12&&(f=r(f,[s[m+3]||0,0])),g>=8&&(f=r(f,[0,s[m+2]||0]),f=n(f,h),f=o(f,33),f=n(f,u),d=r(d,f)),g>=4&&(p=r(p,[s[m+1]||0,0])),g>=1&&(p=r(p,[0,s[m]||0]),p=n(p,u),p=o(p,31),p=n(p,h),l=r(l,p)),l=r(l,[0,e.length]),d=r(d,[0,e.length]),l=t(l,d),d=t(d,l),l=i(l),d=i(d),l=t(l,d),d=t(d,l),(l[0]>>>0).toString(16).padStart(8,"0")+(l[1]>>>0).toString(16).padStart(8,"0")+((d[0]>>>0).toString(16).padStart(8,"0")+(d[1]>>>0).toString(16).padStart(8,"0"))}function s(e){let t=0;if(0===e.length)return t.toString(36);for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return Math.abs(t).toString(36)}function c(e,t=!1){const n=u(e),o=JSON.stringify(n);t&&console.log("[RabbitTracker] hashFingerprint debug:",{originalKeys:Object.keys(e),canonicalizedKeys:Object.keys(n),canonicalLength:o.length,sample:o.substring(0,200)+"..."});const r=a(o);return t&&console.log("[RabbitTracker] Generated fingerprintHash:",r.substring(0,32)),r}function l(e){return"vis_"+e.substring(0,16)}function d(e){return["duration","timestamp","error","errors","collectionTime","startTime","endTime","_timestamp"].includes(e)||e.endsWith("_timestamp")||e.endsWith("Timestamp")}function u(e){if(null==e)return null;if(Array.isArray(e))return e.map(e=>u(e)).filter(e=>null!==e).sort((e,t)=>JSON.stringify(e).localeCompare(JSON.stringify(t)));if("object"==typeof e){const t=Object.keys(e).sort(),n={};for(const o of t){if(d(o))continue;const t=u(e[o]);null!==t&&(n[o]=t)}return n}return"number"==typeof e?Number.isFinite(e)?Math.abs(e)<1e-4?0:Math.abs(e)>1e6?e>0?1e6:-1e6:Number(e>=.1&&e<=10?e.toFixed(3):e.toFixed(2)):0:"string"==typeof e?e.trim().toLowerCase():"boolean"==typeof e?e:null}const h={SAMPLE_RATE:44100,DURATION:.1,FREQUENCIES:[440,1e3,1760,3520],COMPRESSOR_THRESHOLD:-50,COMPRESSOR_KNEE:40,COMPRESSOR_RATIO:12,COMPRESSOR_ATTACK:.003,COMPRESSOR_RELEASE:.25,FILTER_FREQUENCY:2e3,GAIN_VALUE:.5,DELAY_TIME:.02};function m(){try{const e=window.OfflineAudioContext||window.webkitOfflineAudioContext;if(!e)return null;const t=44100,n=h.DURATION;return new e(1,Math.floor(t*n),t)}catch{return null}}async function g(e){try{const t=h.FREQUENCIES.map((t,n)=>{const o=e.createOscillator(),r=["sine","square","sawtooth","triangle"],i=r[n%r.length];return o.type=i||"sine",o.frequency.setValueAtTime(t,e.currentTime),o}),n=e.createDynamicsCompressor(),o=e.createBiquadFilter(),r=e.createGain(),i=e.createDelay(),a=e.createAnalyser();n.threshold.setValueAtTime(h.COMPRESSOR_THRESHOLD,e.currentTime),n.knee.setValueAtTime(h.COMPRESSOR_KNEE,e.currentTime),n.ratio.setValueAtTime(h.COMPRESSOR_RATIO,e.currentTime),n.attack.setValueAtTime(h.COMPRESSOR_ATTACK,e.currentTime),n.release.setValueAtTime(h.COMPRESSOR_RELEASE,e.currentTime),o.type="bandpass",o.frequency.setValueAtTime(h.FILTER_FREQUENCY,e.currentTime),o.Q.setValueAtTime(.7,e.currentTime),r.gain.setValueAtTime(h.GAIN_VALUE,e.currentTime),i.delayTime.setValueAtTime(h.DELAY_TIME,e.currentTime);const c=e.createGain();c.gain.setValueAtTime(.25,e.currentTime),t.forEach(e=>{e.connect(c)}),c.connect(o),o.connect(n),n.connect(r),r.connect(i),i.connect(a),a.connect(e.destination),t.forEach((e,t)=>{e.start(.01*t),e.stop(h.DURATION)});const l=(await e.startRendering()).getChannelData(0),d=[];for(let e=0;e<32;e++){const t=Math.floor(l.length/32*e);d.push(l[t]||0)}const u=Math.sqrt(d.reduce((e,t)=>e+t*t,0)/d.length),m=Math.max(...d.map(Math.abs)),g=d.reduce((e,t)=>e+Math.abs(t),0)/d.length;let p=0;for(let e=0;e<Math.min(d.length,16);e++){const t=d[e];void 0!==t&&(p+=e*Math.abs(t))}return s([...d,u,m,g,p].join(","))}catch(e){return s("multi_oscillator_error")}}async function p(e){try{const t=[100,440,1e3,2e3,4e3,8e3,12e3,16e3],n=[];for(const o of t){const t=e.createOscillator(),r=e.createAnalyser();t.type="sine",t.frequency.setValueAtTime(o,e.currentTime),r.fftSize=256,r.smoothingTimeConstant=0,t.connect(r),r.connect(e.destination),t.start(),t.stop(.05);const i=m();if(i){const e=i.createOscillator();e.type="sine",e.frequency.setValueAtTime(o,i.currentTime),e.connect(i.destination),e.start(),e.stop(.05);try{const e=(await i.startRendering()).getChannelData(0),t=Math.sqrt(e.reduce((e,t)=>e+t*t,0)/e.length);n.push(t)}catch{n.push(0)}}}return s(n.join(","))}catch(e){return s("frequency_response_error")}}async function f(e){try{const t=e.createOscillator(),n=e.createDynamicsCompressor();t.type="triangle",t.frequency.setValueAtTime(h.FREQUENCIES[0],e.currentTime),n.threshold.setValueAtTime(h.COMPRESSOR_THRESHOLD,e.currentTime),n.knee.setValueAtTime(h.COMPRESSOR_KNEE,e.currentTime),n.ratio.setValueAtTime(h.COMPRESSOR_RATIO,e.currentTime),n.attack.setValueAtTime(h.COMPRESSOR_ATTACK,e.currentTime),n.release.setValueAtTime(h.COMPRESSOR_RELEASE,e.currentTime),t.connect(n),n.connect(e.destination),t.start(),t.stop(h.DURATION);const o=(await e.startRendering()).getChannelData(0);return s([o[0]||0,o[Math.floor(.25*o.length)]||0,o[Math.floor(.5*o.length)]||0,o[Math.floor(.75*o.length)]||0,o[o.length-1]||0].join(","))}catch(e){return s("compressor_error")}}async function y(){const e=performance.now();try{const t=function(){try{const e=window.OfflineAudioContext||window.webkitOfflineAudioContext;if(e)try{return new e(1,1,44100).sampleRate}catch{}const t=window.AudioContext||window.webkitAudioContext;if(t)try{const e=new t,n=e.sampleRate;return e.close().catch(()=>{}),n}catch{}}catch{}return 44100}(),n=function(){const e={};try{const t=m();if(t){e.sampleRate=t.sampleRate,e.length=t.length,e.state=t.state;const n=[],o=[8e3,22050,44100,48e3,96e3];for(const e of o)try{const t=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,1,e);t.sampleRate===e&&n.push(e),"close"in t&&"function"==typeof t.close&&t.close()}catch{}e.supportedSampleRates=n,"baseLatency"in t&&(e.baseLatency=t.baseLatency),"close"in t&&"function"==typeof t.close&&t.close()}}catch(t){e.error="context_characteristics_error"}return e}(),o={multiOsc:m(),compressor:m(),frequencyResponse:m()};if(!o.multiOsc||!o.compressor||!o.frequencyResponse)throw new Error("OfflineAudioContext not available");const[r,i,a]=await Promise.all([g(o.multiOsc).catch(()=>"multi_oscillator_error"),f(o.compressor).catch(()=>"compressor_error"),p(o.frequencyResponse).catch(()=>"frequency_response_error")]),c={};try{const e=m();if(e){const t=["createOscillator","createAnalyser","createBiquadFilter","createConvolver","createDelay","createDynamicsCompressor","createGain","createWaveShaper","createStereoPanner","createChannelSplitter","createChannelMerger"];for(const n of t)try{"function"==typeof e[n]&&(e[n](),c[n]=!0)}catch{c[n]=!1}"close"in e&&"function"==typeof e.close&&e.close()}}catch{}const l=s([r,i,a,t.toString(),JSON.stringify(n),JSON.stringify(c)].join("|")),d=performance.now();return{value:{oscillator:r,compressor:i,sampleRate:t,maxChannelCount:n.supportedSampleRates?.length||2,multiOscillatorFingerprint:r,frequencyResponseFingerprint:a,contextCharacteristics:n,nodeCapabilities:c,audioStackHash:l,supportedSampleRates:n.supportedSampleRates||[]},duration:d-e}}catch(t){return{value:{oscillator:"error",compressor:"error",sampleRate:0,maxChannelCount:0,multiOscillatorFingerprint:"error",frequencyResponseFingerprint:"error",contextCharacteristics:{},nodeCapabilities:{},audioStackHash:"error",supportedSampleRates:[]},duration:performance.now()-e,error:t instanceof Error?t.message:"Audio fingerprinting failed"}}}function v(){try{return"function"==typeof(window.OfflineAudioContext||window.webkitOfflineAudioContext)||"function"==typeof(window.AudioContext||window.webkitAudioContext)}catch{return!1}}function w(){try{return"WebKitAppearance"in document.documentElement.style||"webkitRequestFileSystem"in window||"webkitResolveLocalFileSystemURL"in window||Boolean(window.safari)}catch{return!1}}function b(){try{return"ontouchstart"in window&&("orientation"in window||"onorientationchange"in window)&&/android/i.test(navigator.userAgent)}catch{return!1}}function S(){try{if("brave"in navigator&&navigator.brave)return!0;const e=navigator.userAgent;return!!e.includes("Brave")||!(!window.chrome||!window.chrome.runtime||window.chrome.webstore||window.navigator.getBattery||!/Chrome/.test(e))}catch{return!1}}function C(){try{const e=navigator.userAgent;return!!(e.includes("Arc/")||window.arc||window.Arc||window.chrome&&window.chrome.runtime&&/Chrome/.test(e)&&(e.includes("ArcBrowser")||"arc:"===window.location.protocol))}catch{return!1}}function I(){try{if(window.opr||window.opera)return!0;const e=navigator.userAgent;return!(!e.includes("OPR/")&&!e.includes("Opera/"))}catch{return!1}}function k(){try{return!!navigator.userAgent.includes("Vivaldi/")||!!window.vivaldi}catch{return!1}}function A(){try{const e=navigator.userAgent;return e.includes("SamsungBrowser/")||e.includes("Samsung Internet")}catch{return!1}}function E(){try{return!(S()||C()||I()||k()||T()||A())&&Boolean(window.chrome&&(window.chrome.webstore||window.chrome.runtime)&&/Chrome/.test(navigator.userAgent)&&!/Edg|OPR|Opera|Vivaldi|SamsungBrowser|Arc|Brave/.test(navigator.userAgent))}catch{return!1}}function M(){try{return"InstallTrigger"in window||"mozInnerScreenX"in window||"mozPaintCount"in window||Boolean(navigator.mozApps)}catch{return!1}}function T(){try{return"msCredentials"in navigator||Boolean(window.StyleMedia)||E()&&/edg/i.test(navigator.userAgent)}catch{return!1}}function R(){try{return w()&&!E()&&!T()&&Boolean(window.safari)&&/safari/i.test(navigator.userAgent)}catch{return!1}}function _(){try{return window.isSecureContext||"https:"===location.protocol}catch{return!1}}function x(){try{return"webkitTemporaryStorage"in navigator||navigator.storage&&navigator.storage.estimate&&navigator.storage.estimate().then(e=>(e.quota||0)<104857600),!1}catch{return!1}}function D(){return S()||C()||I()||k()||A()||E()?"Blink":T()?"EdgeHTML/Blink":M()?"Gecko":w()||R()?"WebKit":"Unknown"}function O(){const e=function(){try{if(S())return"Brave";if(C())return"Arc";if(I())return"Opera";if(k())return"Vivaldi";if(A())return"Samsung Internet";if(T())return"Edge";if(M())return"Firefox";if(R())return"Safari";if(E())return"Chrome";const e=navigator.userAgent;return/Firefox/i.test(e)&&!E()?"Firefox":/Safari/i.test(e)&&!E()?"Safari":/Chrome/i.test(e)?"Chrome":"Unknown"}catch{return"Unknown"}}(),t=D(),n=["Brave","Arc","Opera","Vivaldi","Samsung Internet","Edge","Chrome"].includes(e);let o=e.toLowerCase();return n&&"Chrome"!==e&&(o=`${e.toLowerCase()}-chromium`),{name:e,engine:t,isChromiumBased:n,family:o}}function N(){try{return"undefined"!=typeof document&&"function"==typeof document.createElement&&void 0!==document.body}catch{return!1}}function F(){try{if(!N())return!1;const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)return!1;const n=t,o=n.getParameter(n.RENDERER),r=Boolean(o&&"string"==typeof o),i=n.getExtension("WEBGL_lose_context");return i&&i.loseContext(),r}catch{return!1}}function L(){try{return!(!window.AudioContext&&!window.webkitAudioContext)}catch{return!1}}function B(){const e=N(),t=function(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia}catch{return!1}}();return{engine:D(),supportsDOM:e,supportsMediaQueries:t,supportsWebGL:F(),supportsAudio:L(),isSecure:_(),isPrivateMode:x(),canRunDOMBlockers:(w()||b())&&e,canRunAccessibility:t,canRunBrowserAPIs:e&&"undefined"!=typeof navigator}}async function P(){const e=performance.now();try{const t=function(){try{const e=navigator.language||"";let t=[];navigator.languages?t=Array.from(navigator.languages):navigator.language&&(t=[navigator.language]);const n=[navigator.userLanguage,navigator.browserLanguage,navigator.systemLanguage].filter(Boolean);return t=[...new Set([...t,...n])],{language:e,languages:t}}catch{return{language:"",languages:[]}}}(),n=function(){try{let e="";if(Intl&&Intl.DateTimeFormat)try{e=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}if(!e){const t=new Date(2024,0,1).getTimezoneOffset(),n=t>0?"-":"+",o=Math.floor(Math.abs(t)/60),r=Math.abs(t)%60;e=`UTC${n}${o.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`}return{timezone:e,timezoneOffset:new Date(2024,0,1).getTimezoneOffset()}}catch{return{timezone:"",timezoneOffset:0}}}(),o=function(){try{return{platform:navigator.platform||"",userAgent:navigator.userAgent||""}}catch{return{platform:"",userAgent:""}}}(),r=function(){try{const e=navigator.hardwareConcurrency||0;let t;"deviceMemory"in navigator&&(t=navigator.deviceMemory);const n={hardwareConcurrency:e};return void 0!==t&&(n.deviceMemory=t),n}catch{return{hardwareConcurrency:0}}}(),i=function(){try{const e=!1!==navigator.cookieEnabled;let t=null;return"doNotTrack"in navigator?t=navigator.doNotTrack:"msDoNotTrack"in navigator?t=navigator.msDoNotTrack:"mozDoNotTrack"in window&&(t=window.mozDoNotTrack),{cookieEnabled:e,doNotTrack:t}}catch{return{cookieEnabled:!0,doNotTrack:null}}}(),a=function(){try{if(!navigator.plugins)return{length:0,names:[]};const e=Array.from(navigator.plugins).map(e=>e.name).filter(e=>e).sort();return{length:navigator.plugins.length,names:e.slice(0,10)}}catch{return{length:0,names:[]}}}(),s=function(){try{let e=0,t=!1,n=!1;"maxTouchPoints"in navigator?e=navigator.maxTouchPoints:"msMaxTouchPoints"in navigator&&(e=navigator.msMaxTouchPoints);try{t="TouchEvent"in window}catch{t="ontouchstart"in window}return n="ontouchstart"in window,{maxTouchPoints:e,touchEvent:t,touchStart:n}}catch{return{maxTouchPoints:0,touchEvent:!1,touchStart:!1}}}(),c=function(){try{return O()}catch{return{name:"Unknown",engine:"Unknown",isChromiumBased:!1,family:"unknown"}}}(),l=performance.now(),d={language:t.language,languages:t.languages,timezone:n.timezone,timezoneOffset:n.timezoneOffset,platform:o.platform,userAgent:o.userAgent,browserInfo:c,hardwareConcurrency:r.hardwareConcurrency,cookieEnabled:i.cookieEnabled,doNotTrack:i.doNotTrack,plugins:a,touchSupport:s};return void 0!==r.deviceMemory&&(d.deviceMemory=r.deviceMemory),{value:d,duration:l-e}}catch(t){return{value:{language:"",languages:[],timezone:"",timezoneOffset:0,platform:"",userAgent:"",hardwareConcurrency:0,cookieEnabled:!0,doNotTrack:null,plugins:{length:0,names:[]},touchSupport:{maxTouchPoints:0,touchEvent:!1,touchStart:!1}},duration:performance.now()-e,error:t instanceof Error?t.message:"Browser fingerprinting failed"}}}function U(){try{return"object"==typeof navigator&&null!==navigator}catch{return!1}}const W=["Zap Canvas 🎨🔒2024","Żółć gęślą jaźń €$¢£¥","αβγδεζηθικλμνξο","中文测试字体渲染","🌟🎯🚀💎🌊🎨"];function V(e){e.imageSmoothingEnabled=!0,e.imageSmoothingQuality="high";const t=e.createRadialGradient(75,75,0,75,75,50);t.addColorStop(0,"rgba(255, 0, 0, 0.8)"),t.addColorStop(.3,"rgba(0, 255, 0, 0.6)"),t.addColorStop(.7,"rgba(0, 0, 255, 0.4)"),t.addColorStop(1,"rgba(255, 255, 0, 0.2)"),e.fillStyle=t,e.fillRect(10,10,130,100),e.fillStyle="rgba(102, 204, 0, 0.7)",e.fillRect(15.5,15.3,49.7,49.2),e.fillStyle="#f60",e.fillRect(70.3,10.7,50.1,50.9),e.beginPath(),e.moveTo(25.2,120.1),e.bezierCurveTo(25.2,120.1,75.8,90.3,125.5,120.7),e.bezierCurveTo(125.5,120.7,90.1,150.2,60.8,140.9),e.closePath(),e.fillStyle="rgba(200, 100, 50, 0.6)",e.fill(),e.globalCompositeOperation="multiply",e.beginPath(),e.arc(50.7,80.3,20.1,0,2*Math.PI),e.fillStyle="rgba(255, 0, 100, 0.5)",e.fill(),e.beginPath(),e.arc(70.3,80.7,20.9,0,2*Math.PI),e.fillStyle="rgba(0, 255, 100, 0.5)",e.fill(),e.globalCompositeOperation="source-over",e.strokeStyle="rgba(50, 50, 50, 0.8)",e.lineWidth=.5,e.setLineDash([2.3,1.7]);for(let t=0;t<10;t++)e.beginPath(),e.moveTo(10+13.7*t,160),e.lineTo(50+11.3*t,200),e.stroke();e.setLineDash([]);const n=document.createElement("canvas");n.width=20,n.height=20;const o=n.getContext("2d");if(o){o.fillStyle="rgba(150, 75, 200, 0.3)",o.fillRect(0,0,10,10),o.fillRect(10,10,10,10);const t=e.createPattern(n,"repeat");t&&(e.fillStyle=t,e.fillRect(150,120,80,60))}e.shadowColor="rgba(0, 0, 0, 0.5)",e.shadowBlur=3.2,e.shadowOffsetX=2.1,e.shadowOffsetY=2.7,e.fillStyle="rgba(100, 200, 150, 0.8)",e.fillRect(160,30,60,40),e.shadowColor="transparent",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0}function Z(e){const t=["14px Arial, sans-serif",'13px "Times New Roman", serif',"12px Georgia, serif","15px Helvetica, Arial, sans-serif",'11px "Courier New", monospace',"13px Verdana, sans-serif","16px Impact, fantasy",'12px "Comic Sans MS", cursive'],n=["#000","#333","#666","#999","rgba(255, 0, 0, 0.8)","rgba(0, 255, 0, 0.7)","rgba(0, 0, 255, 0.6)","rgba(128, 64, 192, 0.9)"],o=["top","hanging","middle","alphabetic","bottom"],r=["left","center","right"];let i=250;W.forEach((a,s)=>{t.forEach((t,c)=>{const l=(s+c)%n.length,d=c%o.length,u=c%r.length;e.font=t,e.fillStyle=n[l]||n[0],e.textBaseline=o[d]||"top",e.textAlign=r[u]||"left";const h=10+.7*c%200,m=i+18.3*c%100;e.fillText(a,h,m),c%2==0&&(e.strokeStyle=`rgba(${100+20*c}, ${50+15*c}, ${150+10*c}, 0.5)`,e.lineWidth=.3,e.strokeText(a,h+.5,m+.5))}),i+=120}),e.save(),e.translate(100,400),e.rotate(Math.PI/6),e.scale(1.2,.8),e.font="italic 14px Arial",e.fillStyle="rgba(200, 100, 50, 0.8)",e.fillText("Transformed & Rotated Text",0,0),e.restore(),e.font="6px Arial",e.fillStyle="#000",e.fillText("Tiny text rendering test",10,500),e.font="32px Arial",e.fillStyle="rgba(255, 0, 0, 0.5)",e.fillText("Large",10,540),e.textAlign="left",e.textBaseline="top"}async function G(){const e=performance.now();try{const t=document.createElement("canvas");t.width=300,t.height=600;const n=t.getContext("2d",{alpha:!0,desynchronized:!1,colorSpace:"srgb",willReadFrequently:!0});if(!n)throw new Error("Canvas 2D context not available");n.rect(0,0,10,10),n.rect(2,2,6,6);const o=n.isPointInPath(5,5,"evenodd");Z(n);const r=s(t.toDataURL("image/png"));n.clearRect(0,0,t.width,t.height),V(n);const i=s(t.toDataURL("image/png")),a=function(e,t){try{e.clearRect(0,0,t.width,t.height),e.fillStyle="rgb(100, 150, 200)",e.fillRect(10.3,10.7,20.1,20.9),e.strokeStyle="rgb(200, 100, 50)",e.lineWidth=1.3,e.beginPath(),e.moveTo(15.2,35.8),e.lineTo(25.7,45.1),e.stroke();const n=e.getImageData(10,10,30,40).data;let o=0,r=0,i=0,a=0,s=0;for(let e=0;e<n.length;e+=4){const t=n[e]||0,c=n[e+1]||0,l=n[e+2]||0;if((n[e+3]||0)>25&&(o+=t,r+=c,i+=l,s++,e>=16)){const o=n[e-16]||0,r=Math.abs(t-o);r>=8&&(a+=r)}}if(0===s)return"no-valid-pixels";return`${10*Math.round(o/s/10)}-${10*Math.round(r/s/10)}-${10*Math.round(i/s/10)}-${10*Math.round(a/s/10)}`}catch(e){return"subpixel-error"}}(n,t),c=function(e,t,n,o){const r=[];let i=0;try{const a=o.getImageData(0,0,1,1);a&&0!==a.data.length||(r.push("getImageData-blocked"),i+=3),(e.length<8||t.length<8)&&(r.push("short-hash"),i+=2);const s=["error","blocked","disabled","00000000","ffffffff","12345678"];(s.includes(e)||s.includes(t))&&(r.push("known-blocked-hash"),i+=3),("subpixel-error"===n||n.includes("0-0-0"))&&(r.push("subpixel-anomaly"),i+=2),e===t&&"error"!==e&&(r.push("identical-hashes"),i+=2);const c=document.createElement("canvas");c.width=10,c.height=10;const l=c.getContext("2d");if(l){const e=performance.now();l.fillStyle="red",l.fillRect(0,0,10,10),c.toDataURL(),performance.now()-e>50&&(r.push("slow-canvas"),i+=1)}return{isInconsistent:i>=2,confidence:Math.min(i/5,1),reasons:r}}catch(e){return{isInconsistent:!0,confidence:1,reasons:["detection-error"]}}}(r,i,a,n);n.clearRect(0,0,t.width,t.height),Z(n),n.globalCompositeOperation="multiply",V(n),n.globalCompositeOperation="source-over";const l=s(t.toDataURL("image/png")),d=performance.now();return{value:{text:r,geometry:i,winding:o,isInconsistent:c.isInconsistent,subPixelAnalysis:a,compositeHash:l,inconsistencyConfidence:c.confidence,blockingReasons:c.reasons},duration:d-e}}catch(t){return{value:{text:"error",geometry:"error",winding:!1,isInconsistent:!0,subPixelAnalysis:"error",compositeHash:"error",inconsistencyConfidence:1,blockingReasons:["canvas-error"]},duration:performance.now()-e,error:t instanceof Error?t.message:"Canvas fingerprinting failed"}}}function z(){try{const e=document.createElement("canvas").getContext("2d");return null!==e&&"function"==typeof e.fillText}catch{return!1}}const H=["Arial","Arial Black","Calibri","Cambria","Comic Sans MS","Consolas","Courier New","Georgia","Impact","Lucida Console","Lucida Sans Unicode","Microsoft Sans Serif","Palatino Linotype","Segoe UI","Tahoma","Times New Roman","Trebuchet MS","Verdana","American Typewriter","Avenir","Baskerville","Big Caslon","Brush Script MT","Copperplate","Didot","Futura","Gill Sans","Helvetica","Helvetica Neue","Hoefler Text","Lucida Grande","Marker Felt","Optima","Papyrus","Phosphate","Rockwell","Savoye LET","SignPainter","Skia","Snell Roundhand","System Font","Zapfino","DejaVu Sans","DejaVu Sans Mono","DejaVu Serif","Droid Sans","Droid Sans Mono","Droid Serif","Liberation Sans","Liberation Sans Narrow","Liberation Serif","Ubuntu","Ubuntu Mono","Roboto","Roboto Condensed","Roboto Mono","Roboto Slab","Droid Sans","Droid Sans Mono","Droid Serif","Helvetica Neue","Arial","Helvetica","Courier New","Times New Roman","San Francisco","Avenir Next","Open Sans","Lato","Montserrat","Source Sans Pro","Raleway","PT Sans","Lora","Playfair Display","Oswald","Slabo 27px","Fira Sans","Hiragino Sans","Hiragino Kaku Gothic ProN","Meiryo","MS Gothic","MS Mincho","SimSun","SimHei","Microsoft YaHei","Malgun Gothic","Apple SD Gothic Neo"],j=["monospace","sans-serif","serif"],q="mmMwWLliI0O&1 ※";function K(e,t){const n=document.createElement("canvas").getContext("2d");if(!n)return{width:0,height:0};n.font=`12px ${t}`;const o=n.measureText(e);return{width:o.width,height:o.actualBoundingBoxAscent+o.actualBoundingBoxDescent}}function X(e,t){const n=document.createElement("span");n.style.position="absolute",n.style.left="-9999px",n.style.top="-9999px",n.style.fontSize="12px",n.style.fontFamily=t,n.style.whiteSpace="nowrap",n.textContent=e,document.body.appendChild(n);const o=n.getBoundingClientRect(),r={width:o.width,height:o.height};return document.body.removeChild(n),r}function Y(e,t="canvas"){const n="canvas"===t?K:X,o=j.map(e=>n(q,e)),r=j.map(t=>n(q,`${e}, ${t}`));for(let e=0;e<o.length;e++){const t=o[e],n=r[e];if(t&&n){const e=Math.abs(t.width-n.width),o=Math.abs(t.height-n.height);if(e>.1||o>.1)return!0}}return!1}function J(){try{const e=document.createElement("span");return e&&"object"==typeof e.style}catch{return!1}}function Q(e){return 10*Math.round(e/10)}async function $(){const e=performance.now();try{const t=function(){try{return{width:screen.width||0,height:screen.height||0}}catch{return{width:0,height:0}}}(),n=screen.colorDepth||screen.pixelDepth||0,o=function(){try{return window.devicePixelRatio||1}catch{return 1}}(),r=function(){try{const e=screen.availWidth||0,t=screen.availHeight||0;return 0===e&&0===t?{width:Q(screen.width||0),height:Q(screen.height||0)}:{width:Q(e),height:Q(t)}}catch{return{width:Q(screen.width||0),height:Q(screen.height||0)}}}(),i=function(){try{const e=document.documentElement,t=Math.max(e.clientWidth||0,window.innerWidth||0),n=Math.max(e.clientHeight||0,window.innerHeight||0);return{width:Q(t),height:Q(n)}}catch{const e=window.innerWidth||0,t=window.innerHeight||0;return{width:Q(e),height:Q(t)}}}(),a=function(){try{if(screen.orientation)return{angle:screen.orientation.angle,type:screen.orientation.type};const e=screen.mozOrientation||screen.msOrientation||screen.webkitOrientation;if(void 0!==e)return{angle:e,type:"unknown"};const t=screen.width>screen.height;return{angle:t?90:0,type:t?"landscape-primary":"portrait-primary"}}catch{return}}(),s=performance.now(),c={width:t.width,height:t.height,colorDepth:n,pixelRatio:o,availableWidth:r.width,availableHeight:r.height,viewportWidth:i.width,viewportHeight:i.height};return a&&(c.orientation=a),{value:c,duration:s-e}}catch(t){return{value:{width:0,height:0,colorDepth:0,pixelRatio:1,viewportWidth:0,viewportHeight:0,availableWidth:0,availableHeight:0},duration:performance.now()-e,error:t instanceof Error?t.message:"Screen fingerprinting failed"}}}function ee(){try{return"object"==typeof screen&&"number"==typeof screen.width&&"number"==typeof screen.height}catch{return!1}}let te=null,ne=0,oe=0;function re(){try{const e=performance.now();if(te&&te.isValid)if(e-te.timestamp<18e5){if(te.context&&!te.context.isContextLost())return te.usageCount++,te.lastUsed=e,te.context;ie()}else ie();if(ne>=8)return console.warn("[WebGL Cache] Maximum context limit reached, reusing existing contexts"),null;const t=function(){try{if("undefined"==typeof document)return null;const e=document.createElement("canvas");return e.width=1,e.height=1,e}catch{return null}}();if(!t)return null;const n=function(e){try{const t={alpha:!1,antialias:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!1,failIfMajorPerformanceCaveat:!0,powerPreference:"default"};return e.getContext("webgl",t)||e.getContext("experimental-webgl",t)}catch{return null}}(t);return n?(ne++,oe++,te={context:n,canvas:t,timestamp:e,isValid:!0,usageCount:1,lastUsed:e},n):null}catch(e){return ie(),null}}function ie(){if(te){try{if(te.context){const e=te.context.getExtension("WEBGL_lose_context");e&&e.loseContext()}te.canvas&&(te.canvas.width=0,te.canvas.height=0),ne>0&&ne--}catch{ne>0&&ne--}te.isValid=!1,te=null}}function ae(){if(!te||!te.context)return!1;try{return!te.context.isContextLost()}catch{return!1}}function se(){const e=re();if(!e)return[];try{const t=e.getSupportedExtensions();return t?Array.from(t).sort():[]}catch{return[]}}function ce(){const e=re();if(!e)return{};try{const t={},n=["VERSION","VENDOR","RENDERER","SHADING_LANGUAGE_VERSION","MAX_TEXTURE_SIZE","MAX_RENDERBUFFER_SIZE","MAX_VIEWPORT_DIMS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_UNIFORM_VECTORS","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_VARYING_VECTORS"];for(const o of n)try{const n=e[o];void 0!==n&&(t[o]=e.getParameter(n))}catch{}return t}catch{return{}}}function le(){try{ie(),ne=0,oe=0}catch(e){console.warn("[WebGL Cache] Cleanup error:",e)}}if("undefined"!=typeof window&&(window.addEventListener("beforeunload",le),window.addEventListener("pagehide",le),window.addEventListener("unload",le),document.addEventListener("visibilitychange",()=>{}),"memory"in performance&&"function"==typeof performance.memory.addEventListener))try{performance.memory.addEventListener("memorypressure",le)}catch(e){}var de=Object.freeze({__proto__:null,cleanupWebGLCache:le,forceCleanupWebGL:function(){ie(),ne=0},getCachedWebGLContext:re,getCachedWebGLExtensions:se,getCachedWebGLParameters:ce,invalidateWebGLCache:ie,isWebGLContextValid:ae});const ue={VENDOR:7936,RENDERER:7937,VERSION:7938,SHADING_LANGUAGE_VERSION:35724,MAX_VERTEX_ATTRIBS:34921,MAX_TEXTURE_SIZE:3379,MAX_RENDERBUFFER_SIZE:34024,MAX_VIEWPORT_DIMS:3386,ALIASED_LINE_WIDTH_RANGE:33902,ALIASED_POINT_SIZE_RANGE:33901,MAX_FRAGMENT_UNIFORM_VECTORS:36349,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661};function he(e,t,n){const o=e.createShader(t);return o?(e.shaderSource(o,n),e.compileShader(o),e.getShaderParameter(o,e.COMPILE_STATUS)?o:(e.deleteShader(o),null)):null}function me(e){try{const t=e.getParameter(e.VENDOR)||"unknown",n=e.getParameter(e.RENDERER)||"unknown",o=e.getParameter(e.VERSION)||"unknown",r=`${t}|${n}|${o}|${e.getParameter(e.MAX_TEXTURE_SIZE)||0}|${e.getParameter(e.MAX_VERTEX_ATTRIBS)||0}|${e.getParameter(e.MAX_VIEWPORT_DIMS)||[0,0]}`;let i=0;for(let e=0;e<r.length;e++)i=(i<<5)-i+r.charCodeAt(e)&4294967295;return`fallback_${Math.abs(i).toString(16)}`}catch{return"webgl_unavailable"}}async function ge(){const e=performance.now();try{if(!fe())throw new Error("WebGL not supported in this browser");const t=re();if(!t)throw new Error("WebGL context not available");if(!ae())throw new Error("WebGL context lost");const n=function(){try{return ce()}catch{return{}}}(),o=n.VENDOR||"unknown",r=n.RENDERER||"unknown",i=n.VERSION||"unknown";let a=o,s=r;for(let e=0;e<3;e++)try{const e=t.getExtension("WEBGL_debug_renderer_info");if(e){const n=t.getParameter(e.UNMASKED_VENDOR_WEBGL),o=t.getParameter(e.UNMASKED_RENDERER_WEBGL);n&&"unknown"!==n&&(a=n),o&&"unknown"!==o&&(s=o);break}}catch(t){if(2===e)break;await new Promise(e=>setTimeout(e,10))}const c=function(){try{return se()}catch{return[]}}(),l=function(e){const t={};return Object.entries(ue).forEach(([n,o])=>{const r=function(e,t){try{return e.getParameter(t)}catch{return null}}(e,o);null!==r&&(t[n]=Array.isArray(r)?r.join(","):r)}),["UNMASKED_VENDOR_WEBGL","UNMASKED_RENDERER_WEBGL"].forEach(n=>{try{const o=e.getExtension("WEBGL_debug_renderer_info");if(o){const r=o[n];if(void 0!==r){const o=e.getParameter(r);o&&(t[n]=o)}}}catch{}}),t}(t),d=function(e){const t=[],n=[];try{const o=[e.LOW_FLOAT,e.MEDIUM_FLOAT,e.HIGH_FLOAT,e.LOW_INT,e.MEDIUM_INT,e.HIGH_INT],r=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"];for(let i=0;i<o.length;i++){const a=o[i];if(void 0===a)continue;const s=e.getShaderPrecisionFormat(e.VERTEX_SHADER,a),c=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,a);s&&t.push(`${r[i]}:${s.precision},${s.rangeMin},${s.rangeMax}`),c&&n.push(`${r[i]}:${c.precision},${c.rangeMin},${c.rangeMax}`)}}catch{}return{vertex:t.join(";"),fragment:n.join(";")}}(t),u=function(e){try{const t="\n attribute vec2 a_position;\n attribute vec3 a_color;\n varying vec3 v_color;\n uniform float u_time;\n \n void main() {\n // Complex mathematical operations to differentiate GPUs\n float wave = sin(a_position.x * 10.0 + u_time) * 0.1;\n vec2 position = a_position + vec2(wave, cos(a_position.y * 8.0) * 0.1);\n \n // GPU-specific floating point calculations\n float precision = sin(position.x * 123.456) + cos(position.y * 789.012);\n position += vec2(precision * 0.001);\n \n gl_Position = vec4(position, 0.0, 1.0);\n v_color = a_color;\n }\n ",n="\n precision mediump float;\n varying vec3 v_color;\n uniform float u_time;\n \n void main() {\n // Complex color calculations that vary between GPU vendors\n vec3 color = v_color;\n color.r += sin(gl_FragCoord.x * 0.1 + u_time) * 0.1;\n color.g += cos(gl_FragCoord.y * 0.1 + u_time) * 0.1;\n color.b += sin((gl_FragCoord.x + gl_FragCoord.y) * 0.05) * 0.1;\n \n // GPU-specific precision in color calculations\n color = normalize(color) * length(v_color);\n \n gl_FragColor = vec4(color, 1.0);\n }\n ",o=he(e,e.VERTEX_SHADER,t),r=he(e,e.FRAGMENT_SHADER,n);if(!o||!r)return me(e);const i=function(e,t,n){const o=e.createProgram();return o?(e.attachShader(o,t),e.attachShader(o,n),e.linkProgram(o),e.getProgramParameter(o,e.LINK_STATUS)?o:(e.deleteProgram(o),null)):null}(e,o,r);if(!i)return me(e);e.useProgram(i);const a=new Float32Array([-.8,-.6,1,.2,.3,0,.8,.3,1,.2,.8,-.6,.2,.3,1,-.5,-.2,.8,.9,.1,.3,.6,.1,.8,.9,.7,-.3,.9,.1,.8]),s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.bufferData(e.ARRAY_BUFFER,a,e.STATIC_DRAW);const c=e.getAttribLocation(i,"a_position"),l=e.getAttribLocation(i,"a_color"),d=e.getUniformLocation(i,"u_time");e.enableVertexAttribArray(c),e.enableVertexAttribArray(l),e.vertexAttribPointer(c,2,e.FLOAT,!1,20,0),e.vertexAttribPointer(l,3,e.FLOAT,!1,20,8),e.uniform1f(d,1.23456789),e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.clearColor(.1,.2,.3,1),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.TRIANGLES,0,6);const u=new Uint8Array(e.canvas.width*e.canvas.height*4);e.readPixels(0,0,e.canvas.width,e.canvas.height,e.RGBA,e.UNSIGNED_BYTE,u);let h=0;for(let e=0;e<u.length;e+=4){const t=1*(u[e]??0);h=33*h+(t+256*(u[e+1]??0)+65536*(u[e+2]??0)+16777216*(u[e+3]??0))>>>0}return e.deleteProgram(i),e.deleteShader(o),e.deleteShader(r),e.deleteBuffer(s),h.toString(16)}catch(t){return me(e)}}(t),h=function(e){const t={};try{const n=e.getExtension("WEBGL_debug_renderer_info");n&&(t.unmaskedVendor=e.getParameter(n.UNMASKED_VENDOR_WEBGL),t.unmaskedRenderer=e.getParameter(n.UNMASKED_RENDERER_WEBGL)),t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),t.maxCombinedTextureImageUnits=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),t.maxViewportDims=e.getParameter(e.MAX_VIEWPORT_DIMS),t.maxRenderbufferSize=e.getParameter(e.MAX_RENDERBUFFER_SIZE),t.maxVertexAttribs=e.getParameter(e.MAX_VERTEX_ATTRIBS),t.maxVertexUniformVectors=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),t.maxFragmentUniformVectors=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),t.maxVaryingVectors=e.getParameter(e.MAX_VARYING_VECTORS),t.antialias=e.getContextAttributes()?.antialias||!1;const o=e.getExtension("OES_texture_float");t.floatTextures=!!o;const r=e.getExtension("OES_texture_half_float");t.halfFloatTextures=!!r;const i=e.getParameter(e.COMPRESSED_TEXTURE_FORMATS);t.compressedTextureFormats=Array.isArray(i)?i.length:0;const a=e instanceof WebGL2RenderingContext;if(t.webgl2=a,a){const n=e;t.maxColorAttachments=n.getParameter(n.MAX_COLOR_ATTACHMENTS),t.maxDrawBuffers=n.getParameter(n.MAX_DRAW_BUFFERS),t.maxTexture3DSize=n.getParameter(n.MAX_3D_TEXTURE_SIZE)}const s=e.getParameter(e.ALIASED_LINE_WIDTH_RANGE);t.lineWidthRange=Array.isArray(s)?s.join(","):"";const c=e.getParameter(e.ALIASED_POINT_SIZE_RANGE);t.pointSizeRange=Array.isArray(c)?c.join(","):""}catch(e){}return t}(t),m=(()=>{const e=`${a||o||""}|${s||r||""}`.toLowerCase();let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)&4294967295;return Math.abs(t).toString(16)})(),g=performance.now();return{value:{vendor:a,renderer:s,version:i,extensions:c,parameters:l,shaderPrecision:d,renderHash:u,capabilities:h,vendorRendererHash:m,contextAttributes:t.getContextAttributes()||{}},duration:g-e}}catch(t){return{value:{vendor:"unknown",renderer:"unknown",version:"unknown",extensions:[],parameters:{},shaderPrecision:{vertex:"",fragment:""},renderHash:"",capabilities:{},vendorRendererHash:"",contextAttributes:{}},duration:performance.now()-e,error:t instanceof Error?t.message:"WebGL fingerprinting failed"}}}let pe=null;function fe(){if(null!==pe)return pe;try{const e=document.createElement("canvas");e.width=1,e.height=1;const t=e.getContext("webgl",{failIfMajorPerformanceCaveat:!0,antialias:!1,alpha:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!1})||e.getContext("experimental-webgl",{failIfMajorPerformanceCaveat:!0,antialias:!1,alpha:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!1}),n=null!==t;if(t&&"getExtension"in t)try{const e=t.getExtension("WEBGL_lose_context");e&&e.loseContext()}catch(e){}return e.width=0,e.height=0,pe=n,n}catch{return pe=!1,!1}}function ye(){try{for(const e of["rec2020","p3","srgb"]){const t=Re(`(color-gamut: ${e})`);if(t?.matches)return e}return"unknown"}catch{return"unknown"}}function ve(){try{const e=Re("(forced-colors: active)");if(e?.matches)return!0;const t=Re("(forced-colors: none)");return!t?.matches&&null}catch{return null}}function we(){try{const e=["no-preference","high","more","low","less","forced"];for(const t of e){const e=Re(`(prefers-contrast: ${t})`);if(e?.matches)return"high"===t?"more":"low"===t?"less":t}return"unknown"}catch{return"unknown"}}function be(){try{const e=Re("(prefers-reduced-motion: reduce)");if(e?.matches)return!0;const t=Re("(prefers-reduced-motion: no-preference)");return!t?.matches&&null}catch{return null}}function Se(){try{return!!matchMedia("(prefers-reduced-transparency: reduce)").matches||!matchMedia("(prefers-reduced-transparency: no-preference)").matches&&null}catch{return null}}function Ce(){try{for(let e=8;e>=0;e--)if(matchMedia(`(monochrome: ${e})`).matches)return e;return 0}catch{return 0}}function Ie(){try{return!!matchMedia("(inverted-colors: inverted)").matches||!matchMedia("(inverted-colors: none)").matches&&null}catch{return null}}function ke(){try{return!!matchMedia("(dynamic-range: high)").matches||!matchMedia("(dynamic-range: standard)").matches&&null}catch{return null}}function Ae(){try{const e=[48,36,30,24,16,15,8];for(const t of e)if(matchMedia(`(color: ${t})`).matches)return t;return screen.colorDepth||24}catch{return screen.colorDepth||24}}function Ee(){try{return matchMedia("(hover: hover)").matches?"hover":matchMedia("(hover: none)").matches?"none":"unknown"}catch{return"unknown"}}function Me(){try{return matchMedia("(pointer: fine)").matches?"fine":matchMedia("(pointer: coarse)").matches?"coarse":matchMedia("(pointer: none)").matches?"none":"unknown"}catch{return"unknown"}}function Te(){return B().canRunAccessibility}function Re(e){try{return Te()?matchMedia(e):null}catch(e){return null}}function _e(){try{return!!matchMedia("(prefers-reduced-data: reduce)").matches||!matchMedia("(prefers-reduced-data: no-preference)").matches&&null}catch{return null}}function xe(){try{const e=["fullscreen","standalone","minimal-ui","browser"];for(const t of e)if(matchMedia(`(display-mode: ${t})`).matches)return t;return"unknown"}catch{return"unknown"}}function De(){try{const e=["opaque","additive","subtractive"];for(const t of e)if(matchMedia(`(environment-blending: ${t})`).matches)return t;return"unknown"}catch{return"unknown"}}function Oe(){try{return!!matchMedia("(any-hover: hover)").matches||!matchMedia("(any-hover: none)").matches&&null}catch{return null}}function Ne(){try{return matchMedia("(any-pointer: fine)").matches?"fine":matchMedia("(any-pointer: coarse)").matches?"coarse":matchMedia("(any-pointer: none)").matches?"none":"unknown"}catch{return"unknown"}}function Fe(){try{return matchMedia("(prefers-color-scheme: dark)").matches?"dark":matchMedia("(prefers-color-scheme: light)").matches?"light":matchMedia("(prefers-color-scheme: no-preference)").matches?"no-preference":"unknown"}catch{return"unknown"}}function Le(){const e=ye(),t=ve(),n=we(),o=be(),r=Se(),i=Ce(),a=Ie(),s=ke(),c=Ae(),l=Ee(),d=Me(),u=_e(),h=xe(),m=De(),g=Oe(),p=Ne(),f=Fe(),y=Boolean(t||o||r||a||u||"no-preference"!==n||"no-preference"!==f||i>0),v=[e,s?"hdr":"sdr",`${c}bit`,i>0?`mono${i}`:"color",f,h,m].join("-"),w=[l,d,g?"anyhover":"nohover",p].join("-");return{colorGamut:e,forcedColors:t,contrastPreference:n,reducedMotion:o,reducedTransparency:r,monochromeDepth:i,invertedColors:a,hdrSupport:s,enhancedColorDepth:c,hoverCapability:l,pointerCapability:d,reducedData:u,displayMode:h,environmentBlending:m,anyHover:g,anyPointer:p,colorScheme:f,hasAccessibilityFeatures:y,displayCapabilities:v,interactionCapabilities:w}}function Be(e){const t=["unknown"!==e.colorGamut,null!==e.forcedColors,"unknown"!==e.contrastPreference,null!==e.reducedMotion,null!==e.reducedTransparency,null!==e.invertedColors,null!==e.hdrSupport,null!==e.reducedData,"unknown"!==e.displayMode,"unknown"!==e.environmentBlending,null!==e.anyHover,"unknown"!==e.colorScheme],n=t.filter(Boolean).length/t.length,o=[null!==e.reducedData,"unknown"!==e.displayMode,"unknown"!==e.environmentBlending,"unknown"!==e.colorScheme,null!==e.hdrSupport],r=o.filter(Boolean).length/o.length,i=[!0===e.forcedColors,!0===e.reducedMotion,!0===e.reducedTransparency,!0===e.invertedColors,!0===e.reducedData,"no-preference"!==e.contrastPreference,"dark"===e.colorScheme,e.monochromeDepth>0],a=i.filter(Boolean).length/i.length,s=["srgb"!==e.colorGamut,!0===e.forcedColors,!0===e.reducedMotion,!0===e.reducedTransparency,!0===e.invertedColors,!0===e.reducedData,e.monochromeDepth>0,!0===e.hdrSupport,"browser"!==e.displayMode,"opaque"!==e.environmentBlending,"dark"===e.colorScheme],c=s.filter(Boolean).length/s.length;return{confidence:Math.round(100*n)/100,uniqueness:Math.round(100*c)/100,accessibilityScore:Math.round(100*a)/100,modernBrowserScore:Math.round(100*r)/100}}var Pe=Object.freeze({__proto__:null,analyzeAccessibilityFingerprint:Be,getAccessibilityFingerprint:Le,getAnyHover:Oe,getAnyPointer:Ne,getColorGamut:ye,getColorScheme:Fe,getContrastPreference:we,getDisplayMode:xe,getEnhancedColorDepth:Ae,getEnvironmentBlending:De,getForcedColors:ve,getHDRSupport:ke,getHoverCapability:Ee,getInvertedColors:Ie,getMonochromeDepth:Ce,getPointerCapability:Me,getReducedData:_e,getReducedMotion:be,getReducedTransparency:Se,isAccessibilityDetectionAvailable:Te});function Ue(e){if("number"==typeof e)return{confidence:0,uniqueness:0,intlApiSupport:0,localeComplexity:0};const t=Object.values(e.intlSupport).filter(Boolean).length/Object.keys(e.intlSupport).length,n=[e.locale,e.calendar,e.numberingSystem,e.timeZone,e.dateStyle,e.timeStyle,e.hourCycle,e.numberLocale,e.currencyDisplay,e.currencySign,e.notation,e.signDisplay,e.listStyle,e.relativeTimeStyle,e.pluralRules],o=n.filter(e=>"unknown"!==e&&""!==e).length/n.length,r=[e.locale.length>2?1:0,"gregory"!==e.calendar?1:0,"latn"!==e.numberingSystem?1:0,e.hour12?1:0,e.localeMatch?0:1].reduce((e,t)=>e+t,0)/5,i=(o+t+r)/3;return{confidence:Math.round(100*o)/100,uniqueness:Math.round(100*i)/100,intlApiSupport:Math.round(100*t)/100,localeComplexity:Math.round(100*r)/100}}const We="mmMwWLliI0fiflO&1",Ve={default:{text:We},serif:{style:{fontFamily:"serif"},text:We},sans:{style:{fontFamily:"sans-serif"},text:We},mono:{style:{fontFamily:"monospace"},text:We},apple:{style:{font:"-apple-system-body"},text:We},system:{style:{fontFamily:"system-ui"},text:We},min:{style:{fontSize:"1px"},text:We},large:{style:{fontSize:"72px"},text:We},ui:{style:{fontFamily:"ui-serif"},text:We},emoji:{style:{fontFamily:"Apple Color Emoji, Segoe UI Emoji, Noto Color Emoji"},text:"🎯🔥💯"},math:{style:{fontFamily:"STIX Two Math, Cambria Math"},text:"∑∆∇∂"},cjk:{style:{fontFamily:"Hiragino Sans, Microsoft YaHei, SimSun"},text:"中文测试"},arabic:{style:{fontFamily:"Tahoma, Arial Unicode MS"},text:"اختبار"},hebrew:{style:{fontFamily:"Tahoma, Arial Unicode MS"},text:"בדיקה"},subpixel:{style:{fontFamily:"Arial",fontSize:"11px",textRendering:"optimizeLegibility"},text:We},kerning:{style:{fontFamily:"Times",fontSize:"24px",fontKerning:"normal"},text:"AV To"},ligatures:{style:{fontFamily:"Times",fontSize:"24px",fontVariantLigatures:"common-ligatures"},text:"ffi ffl fi fl"}};function Ze(e,t,n){try{const o="mmmmmmmmmmlli",r=Ge(e,t,{style:{fontFamily:n},text:o}),i=Ge(e,t,{style:{fontFamily:"monospace"},text:o});if(Math.abs(r-i)<1)return"monospace-fallback";const a=Ge(e,t,{style:{fontFamily:"sans-serif"},text:o});return Math.abs(r-a)<1?"sans-serif-fallback":"native-font"}catch(e){return"fallback-error"}}function Ge(e,t,n){const o=e.createElement("span"),{style:r={},text:i=We}=n;o.textContent=i,o.style.cssText="position: absolute; left: 0; top: 0; white-space: nowrap; visibility: hidden;",Object.entries(r).forEach(([e,t])=>{void 0!==t&&(o.style[e]=t)}),t.appendChild(o);const a=o.getBoundingClientRect().width;return t.removeChild(o),Math.round(100*a)/100}function ze(e){const t=[e.default,e.serif,e.sans,e.mono,e.apple,e.system,e.min,e.large,e.ui,e.emoji,e.math,e.cjk,e.arabic,e.hebrew,e.subpixel,e.kerning,e.ligatures],n=t.some(e=>e>0),o=t.filter(e=>e>0).length,r=t.length;let i=n?o/r:0;(e.antiAliasing.enabled||e.systemFontHints.clearType)&&(i+=.2),Object.keys(e.fallbackBehavior).length>0&&(i+=.1),i=Math.min(i,1);const a=e.apple>0||e.system>0,s=[e.subpixel,e.kerning,e.ligatures,e.emoji,e.math].some(e=>e>0)||e.antiAliasing.enabled||e.systemFontHints.clearType,c=t.reduce((e,t)=>e+t,0)/t.length,l=t.reduce((e,t)=>e+Math.pow(t-c,2),0)/t.length;let d=Math.min(l/100,1);e.antiAliasing.smoothingLevel>0&&(d+=.1),e.systemFontHints.hintingLevel>0&&(d+=.1),d=Math.min(d,1);let u="low";const h=e.antiAliasing.smoothingLevel;h>50||e.systemFontHints.clearType?u="high":(h>20||e.systemFontHints.hintingLevel>2)&&(u="medium");const m="error"!==e.isolatedHash&&e.isolatedHash.length>0;return{confidence:Math.round(100*i)/100,uniqueness:Math.round(100*d)/100,hasSystemFonts:a,hasAdvancedFeatures:s,renderingQuality:u,isolationIntegrity:m}}const He=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF","Arial","Arial Black","Comic Sans MS","Courier New","Georgia","Impact","Palatino Linotype","Tahoma","Times New Roman","Trebuchet MS","Verdana","American Typewriter","Avenir","Baskerville","Big Caslon","Brush Script MT","Copperplate","Didot","Futura","Helvetica","Hoefler Text","Lucida Grande","Marker Felt","Optima","Papyrus","Phosphate","Rockwell","Savoye LET","SignPainter","Skia","Snell Roundhand","Zapfino","DejaVu Sans","DejaVu Sans Mono","DejaVu Serif","Liberation Sans","Liberation Serif","Ubuntu","Ubuntu Mono"],je="mmMwWLliI0O&1",qe="48px",Ke=["monospace","sans-serif","serif"];function Xe(e,t){const n=e.createElement("span");return n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.fontFamily=t,n.style.fontSize=qe,n.style.whiteSpace="nowrap",n.textContent=je,n}function Ye(e,t,n){return Xe(e,`'${t}',${n}`)}function Je(e,t){return Ke.some((n,o)=>{const r=e[o],i=t[n];return!(!r||!i||r.offsetWidth===i.width&&r.offsetHeight===i.height)})}function Qe(e){const{available:t,method:n,precision:o,totalTested:r,detectionTime:i}=e;let a=.5;"iframe"===n?a=.9:"dom"===n&&(a=.7),a*=o;const s=t.filter(e=>["Calibri","Segoe UI Light","MS UI Gothic","Arial Unicode MS"].includes(e)).length,c=t.filter(e=>["Helvetica Neue","Avenir","Menlo","Zapfino","Baskerville"].includes(e)).length,l=t.filter(e=>["DejaVu Sans","Liberation Sans","Ubuntu"].includes(e)).length,d=t.filter(e=>["sans-serif-thin","Roboto"].includes(e)).length;let u="unknown";s>=2?u="windows":c>=2?u="macos":l>=1?u="linux":d>=1&&(u="android");const h=Math.min(i<100?1:.8,1),m=["Arial","Times New Roman","Helvetica"],g=t.filter(e=>!m.includes(e)),p=Math.min(g.length/10,1);return{confidence:Math.round(100*a)/100,uniqueness:Math.round(100*p)/100,osSignature:u,browserCapabilities:Math.round(100*h)/100}}const $e=Math,et=()=>0;function tt(){const e=$e.acos||et,t=$e.acosh||et,n=$e.asin||et,o=$e.asinh||et,r=$e.atanh||et,i=$e.atan||et,a=$e.sin||et,s=$e.sinh||et,c=$e.cos||et,l=$e.cosh||et,d=$e.tan||et,u=$e.tanh||et,h=$e.exp||et,m=$e.expm1||et,g=$e.log1p||et,p=$e.cbrt||et,f=$e.hypot||et,y=$e.log10||et,v=$e.log2||et;return{acos:e(.12312423423423424),asin:n(.12312423423423424),atan:i(.5),cos:c(10.000000000123),sin:a(-1e300),tan:d(-1e300),acosh:t(1e308),asinh:o(1),atanh:r(.5),cosh:l(1),sinh:s(1),tanh:u(1),exp:h(1),expm1:m(1),log1p:g(10),powPI:$e.pow($e.PI,-100),cbrt:p(27),hypot:f(3,4),log10:y(100),log2:v(8),acoshPf:(w=1e154,$e.log(w+$e.sqrt(w*w-1))),asinhPf:$e.log(1+$e.sqrt(2)),atanhPf:$e.log(3)/2,sinhPf:($e.exp(1)-$e.exp(-1))/2,coshPf:($e.exp(1)+$e.exp(-1))/2,expm1Pf:$e.exp(1)-1,tanhPf:($e.exp(2)-1)/($e.exp(2)+1),log1pPf:$e.log(11),precision:{float32:$e.abs(0),float64:$e.abs(2-2.0000000000000004),bigNumbers:$e.abs(1),smallNumbers:$e.abs(1e-15+2e-15-3e-15)}};var w}function nt(){try{const e=tt();return[e.acos,e.asin,e.atan,e.cos,e.sin,e.tan,e.acosh,e.asinh,e.atanh,e.cosh,e.sinh,e.tanh,e.exp,e.expm1,e.log1p,e.powPI,e.cbrt,e.hypot,e.log10,e.log2,e.precision.float32,e.precision.float64,e.precision.bigNumbers,e.precision.smallNumbers].join(",")}catch{return"math-unavailable"}}function ot(e){let t=.9,n=.8;Object.values(e).some(e=>"number"==typeof e&&0!==e)||(t=.1,n=.1),t*=Object.values(e.precision).reduce((e,t)=>e+("number"!=typeof t||isNaN(t)?0:1),0)/4;let o="high";return t<.3?o="low":t<.7&&(o="medium"),{confidence:Math.round(100*t)/100,stability:o,uniqueness:Math.round(100*n)/100}}const rt={gdprMode:!1,includeInvasive:!0,timeout:5e3,debug:!1,excludeComponents:[]},it=new Map;function at(e,t){return!(t.excludeComponents.includes(e)||t.gdprMode&&!t.includeInvasive&&["canvas","webgl","audio","fontPreferences","enhancedFonts"].includes(e)||(["mathFingerprint","dateTimeLocale","accessibilityEnhanced","fontPreferences","enhancedFonts"].includes(e),0))}function st(e,t){it.set(e,t)}async function ct(e,t,n){const o=`${e}_${n.gdprMode}`,r=(i=o,it.get(i)||null);var i;if(r)return r;const a="webgl"===e,s=["canvas","webgl","audio","hardware","system"].includes(e),c=a?2:s?3:1,l=a?[200,500]:[100,250,500];for(let r=0;r<c;r++)try{const i=n.timeout+r*(a?2e3:1e3),s=new Promise((t,n)=>{setTimeout(()=>n(new Error(`${e} timeout after ${i}ms (attempt ${r+1})`)),i)}),c=await Promise.race([t(),s]);if(null!=c)return st(o,c),c;throw new Error(`${e} returned null/undefined result`)}catch(t){const n=r===c-1,o=t instanceof Error?t.message:String(t);if(a&&o.includes("context")){console.warn(`[RabbitTracker] WebGL context issue detected: ${o}`);try{const{forceCleanupWebGL:e}=await Promise.resolve().then(function(){return de});e()}catch(e){}return null}if(n)return console.warn(`[RabbitTracker] Component ${e} failed after ${c} attempts: ${o}`),null;!o.includes("timeout")&&r<l.length&&await new Promise(e=>setTimeout(e,l[r])),a&&await new Promise(e=>setTimeout(e,100))}return null}async function lt(e={}){const t=performance.now(),n={...rt,...e},o=[],r=[],i={collectionTime:t,gdprMode:n.gdprMode,components:[]},l=[];if(at("canvas",n)&&z()&&l.push(ct("canvas",G,n).then(e=>({component:"canvas",result:e}))),at("webgl",n)&&fe()&&l.push(ct("webgl",ge,n).then(e=>({component:"webgl",result:e}))),at("audio",n)&&v()&&l.push(ct("audio",y,n).then(e=>({component:"audio",result:e}))),at("fonts",n)&&J()&&l.push(ct("fonts",()=>async function(e=!0){const t=performance.now();try{let n;if(e&&function(){try{const e=document.createElement("canvas").getContext("2d");return null!==e&&"function"==typeof e.measureText}catch{return!1}}()){const{available:e,measurements:t}=function(){const e=[],t={};for(const n of H)try{const o=K(q,n);t[n]=o,Y(n,"canvas")&&e.push(n)}catch(e){continue}return{available:e,measurements:t}}();n={available:e.sort(),method:"advanced",measurements:t}}else n={available:function(){const e=[];for(const t of H)try{Y(t,"dom")&&e.push(t)}catch(e){continue}return e}().sort(),method:"basic"};return{value:n,duration:performance.now()-t}}catch(e){return{value:{available:[],method:"basic"},duration:performance.now()-t,error:e instanceof Error?e.message:"Font detection failed"}}}(!n.gdprMode),n).then(e=>({component:"fonts",result:e}))),at("screen",n)&&ee()&&l.push(ct("screen",$,n).then(e=>({component:"screen",result:e}))),at("browser",n)&&U()&&l.push(ct("browser",P,n).then(e=>({component:"browser",result:e}))),(await Promise.allSettled(l)).forEach((e,t)=>{if("fulfilled"===e.status&&e.value.result){const{component:t,result:n}=e.value;i[t]=n,o.push(t)}else{const n=l[t],o=n?.toString().match(/component: "(\w+)"/)?.[1]||"unknown";r.push({component:o,error:"rejected"===e.status?e.reason?.message||"Promise rejected":"Collection failed or timeout"})}}),!n.gdprMode)try{const{detectIncognitoHeuristics:e}=await Promise.resolve().then(function(){return Uo}),t=await e();t&&(i.incognitoDetection={likelihood:t.likelihood,methods:t.methods},o.push("incognito"))}catch(e){r.push({component:"incognito",error:e instanceof Error?e.message:"Incognito detection failed"})}if(at("hardware",n))try{const e=await Promise.resolve().then(function(){return zo}).catch(()=>null);if(e?.isHardwareDetectionAvailable?.()){const t=e.getHardwareFingerprint?.();t&&(i.hardware={value:t,duration:0},o.push("hardware"))}else if(!e){const e={hardwareConcurrency:navigator.hardwareConcurrency||0,deviceMemory:navigator.deviceMemory||0,platform:navigator.platform||"unknown"};i.hardware={value:e,duration:0},o.push("hardware")}}catch(e){r.push({component:"hardware",error:e instanceof Error?e.message:"Hardware detection failed"})}if(at("system",n))try{const{getSystemFingerprint:e,isSystemDetectionAvailable:t}=await Promise.resolve().then(function(){return Xo});if(t()){const t=e();t&&(i.system={value:t,duration:0},o.push("system"))}}catch(e){r.push({component:"system",error:e instanceof Error?e.message:"System detection failed"})}if(at("storage",n))try{const{getStorageFingerprint:e,isStorageDetectionAvailable:t}=await Promise.resolve().then(function(){return tr});if(t()){const t=performance.now(),n=await e(),r=performance.now()-t;n&&(i.storage={value:n,duration:r},o.push("storage"))}}catch(e){r.push({component:"storage",error:e instanceof Error?e.message:"Storage detection failed"})}if(at("math",n))try{const{getCompleteMathFingerprint:e,isMathDetectionAvailable:t}=await Promise.resolve().then(function(){return ir});if(t()){const t=performance.now(),n=e(),r=performance.now()-t;n&&(i.math={value:n,duration:r},o.push("math"))}}catch(e){r.push({component:"math",error:e instanceof Error?e.message:"Math fingerprinting failed"})}if(at("domBlockers",n))try{const{getDomBlockersFingerprint:e,isDomBlockersDetectionAvailable:t}=await Promise.resolve().then(function(){return mr});if(t()){const t=performance.now(),r=await e({debug:n.debug}),a=performance.now()-t;r&&(i.domBlockers={value:r,duration:a},o.push("domBlockers"))}}catch(e){r.push({component:"domBlockers",error:e instanceof Error?e.message:"DOM blockers detection failed"})}if(at("accessibility",n))try{const{getAccessibilityFingerprint:e,isAccessibilityDetectionAvailable:t}=await Promise.resolve().then(function(){return Pe});if(t()){const t=performance.now(),n=e(),r=performance.now()-t;n&&(i.accessibility={value:n,duration:r},o.push("accessibility"))}}catch(e){r.push({component:"accessibility",error:e instanceof Error?e.message:"Accessibility detection failed"})}if(at("browserApis",n))try{const{getBrowserApisFingerprint:e,isBrowserApisDetectionAvailable:t}=await Promise.resolve().then(function(){return kr});if(t()){const t=performance.now(),n=e(),r=performance.now()-t;n&&(i.browserApis={value:n,duration:r},o.push("browserApis"))}}catch(e){r.push({component:"browserApis",error:e instanceof Error?e.message:"Browser APIs detection failed"})}if(at("pluginsEnhanced",n))try{const{getEnhancedPluginFingerprint:e,isEnhancedPluginDetectionAvailable:t}=await Promise.resolve().then(function(){return Br});if(t()){const t=performance.now(),n=e(),r=performance.now()-t;n&&(i.pluginsEnhanced={value:n,duration:r},o.push("pluginsEnhanced"))}}catch(e){r.push({component:"pluginsEnhanced",error:e instanceof Error?e.message:"Enhanced plugin detection failed"})}if(at("mathFingerprint",n)&&function(){try{return"undefined"!=typeof Math&&"function"==typeof Math.sin}catch{return!1}}())try{const e=performance.now(),t=tt(),n=performance.now()-e;t&&(i.mathFingerprint={value:t,duration:n,analysis:ot(t),hash:nt()},o.push("mathFingerprint"))}catch(e){r.push({component:"mathFingerprint",error:e instanceof Error?e.message:"Math fingerprinting failed"})}if(at("fontPreferences",n)&&function(){try{return"undefined"!=typeof document&&"function"==typeof document.createElement&&void 0!==document.body}catch{return!1}}())try{const e=performance.now(),t=await async function(){try{const{document:e,container:t,cleanup:n}=await new Promise((e,t)=>{const n=document.createElement("iframe");n.style.cssText="position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; opacity: 0;",n.srcdoc='<!doctype html>\n <html>\n <head>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <style>\n body { \n margin: 0; \n padding: 20px; \n width: 4000px;\n text-size-adjust: none;\n -webkit-text-size-adjust: none;\n }\n </style>\n </head>\n <body></body>\n </html>',n.onload=()=>{try{const o=n.contentDocument,r=n.contentWindow;if(!o||!r)return void t(new Error("Cannot access iframe content"));const i=o.body;E()?i.style.zoom=""+1/r.devicePixelRatio:w()&&(i.style.zoom="reset");const a=o.createElement("div");a.textContent=Array(200).fill("word").join(" "),i.appendChild(a),e({document:o,container:i,cleanup:()=>{n.parentNode&&n.parentNode.removeChild(n)}})}catch(e){t(e)}},n.onerror=()=>{t(new Error("Failed to load iframe"))},document.body.appendChild(n)}),o={};for(const[n,r]of Object.entries(Ve))try{o[n]=Ge(e,t,r)}catch(e){o[n]=0}const r=function(e,t,n="Arial"){try{const t=e.createElement("canvas");t.width=100,t.height=50;const o=t.getContext("2d",{willReadFrequently:!0});if(!o)return{quality:0,antiAliasing:!1,smoothing:0};o.font=`24px "${n}"`,o.fillStyle="#000000",o.fillText("Wg",10.5,30.7);const r=o.getImageData(10,20,30,20).data;let i=0,a=0,s=0;for(let e=0;e<r.length;e+=4){const t=r[e]||0,n=r[e+1]||0,o=r[e+2]||0;(r[e+3]||0)<10||(s++,t===n&&n===o&&t>0&&t<255&&a++,e>4&&Math.abs(t-(r[e-4]||0))>50&&i++)}const c=s>0?a/s:0,l=s>0?100*a/s:0;return{quality:Math.round(l),antiAliasing:c>.1,smoothing:Math.round(100*l)/100}}catch(e){return{quality:0,antiAliasing:!1,smoothing:0}}}(e,0,"Arial"),i=function(e){try{const t=e.createElement("canvas");t.width=100,t.height=50;const n=t.getContext("2d",{willReadFrequently:!0});if(!n)return{clearType:!1,hintingLevel:0,subpixelRendering:!1};const o=["rn","il","WW","mm"];let r=0,i=0,a=0;for(const e of o){n.clearRect(0,0,t.width,t.height),n.font="16px Arial",n.fillStyle="#000",n.fillText(e,10,25);const o=n.getImageData(10,15,40,20).data;for(let e=0;e<o.length;e+=12){const t=o[e]||0,n=o[e+1]||0,s=o[e+2]||0,c=o[e+4]||0,l=o[e+5]||0,d=o[e+6]||0;(Math.abs(t-n)>20||Math.abs(n-s)>20)&&r++,Math.abs(t-c)+Math.abs(n-l)+Math.abs(s-d)>50&&i++,(t>0&&t<255||n>0&&n<255||s>0&&s<255)&&a++}}return{clearType:r>10,hintingLevel:Math.min(Math.round(a/10),5),subpixelRendering:i>5}}catch(e){return{clearType:!1,hintingLevel:0,subpixelRendering:!1}}}(e),a={},c=["Arial","Helvetica","Times New Roman","Georgia","Courier New"];for(const n of c)try{a[n]=Ze(e,t,n)}catch(e){a[n]="fallback-error"}const l=s([JSON.stringify(o),JSON.stringify(r),JSON.stringify(i),JSON.stringify(a)].join("|"));return n(),{...o,antiAliasing:{enabled:r.antiAliasing,type:i.clearType?"cleartype":r.antiAliasing?"standard":"none",smoothingLevel:r.smoothing},systemFontHints:i,fallbackBehavior:a,isolatedHash:l}}catch(e){return{...Object.keys(Ve).reduce((e,t)=>(e[t]=0,e),{}),antiAliasing:{enabled:!1,type:"unknown",smoothingLevel:0},systemFontHints:{clearType:!1,hintingLevel:0,subpixelRendering:!1},fallbackBehavior:{},isolatedHash:"error"}}}(),n=performance.now()-e;t&&(i.fontPreferences={value:t,duration:n,analysis:ze(t),hash:(d=t,d.isolatedHash&&"error"!==d.isolatedHash?d.isolatedHash:[...[d.default,d.serif,d.sans,d.mono,d.apple,d.system,d.min,d.large,d.ui,d.emoji,d.math,d.cjk,d.arabic,d.hebrew,d.subpixel,d.kerning,d.ligatures].map(e=>Math.round(e)),d.antiAliasing.enabled?1:0,d.systemFontHints.clearType?1:0,d.systemFontHints.hintingLevel,Math.round(d.antiAliasing.smoothingLevel)].join(","))},o.push("fontPreferences"))}catch(e){r.push({component:"fontPreferences",error:e instanceof Error?e.message:"Font preferences detection failed"})}var d,h,m;if(at("dateTimeLocale",n)&&function(){try{return"undefined"!=typeof window&&void 0!==window.Intl}catch{return!1}}())try{const e=performance.now(),t=function(){const e=function(){try{if(!window.Intl)return-1;const e=window.Intl.DateTimeFormat;if(!e)return-2;const t=(new e).resolvedOptions();return t.locale||""===t.locale?{locale:t.locale||"unknown",calendar:t.calendar||"unknown",numberingSystem:t.numberingSystem||"unknown",timeZone:t.timeZone||"unknown",hourCycle:t.hourCycle||"unknown",hour12:void 0!==t.hour12&&t.hour12}:-3}catch(e){return-2}}();if("number"==typeof e)return e;const t=function(){try{if(!window.Intl||!window.Intl.NumberFormat)return-4;const e=(new Intl.NumberFormat).resolvedOptions(),t=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD"}).resolvedOptions();return{numberLocale:e.locale||"unknown",currencyDisplay:t.currencyDisplay||"unknown",currencySign:t.currencySign||"unknown",notation:e.notation||"unknown",signDisplay:e.signDisplay||"unknown"}}catch(e){return-4}}(),n="number"==typeof t?{}:t,o=function(){const e={listStyle:"unknown",relativeTimeStyle:"unknown",pluralRules:"unknown"};try{if(window.Intl&&window.Intl.ListFormat){const t=(new window.Intl.ListFormat).resolvedOptions();e.listStyle=t.style||"unknown"}}catch(e){}try{if(window.Intl&&window.Intl.RelativeTimeFormat){const t=(new window.Intl.RelativeTimeFormat).resolvedOptions();e.relativeTimeStyle=t.style||"unknown"}}catch(e){}try{if(window.Intl&&window.Intl.PluralRules){const t=(new window.Intl.PluralRules).select(1);e.pluralRules=t||"unknown"}}catch(e){}return e}(),r=function(){const e={DateTimeFormat:!1,NumberFormat:!1,RelativeTimeFormat:!1,ListFormat:!1,PluralRules:!1,Collator:!1};try{window.Intl&&(e.DateTimeFormat="function"==typeof window.Intl.DateTimeFormat,e.NumberFormat="function"==typeof window.Intl.NumberFormat,e.RelativeTimeFormat="function"==typeof window.Intl.RelativeTimeFormat,e.ListFormat="function"==typeof window.Intl.ListFormat,e.PluralRules="function"==typeof window.Intl.PluralRules,e.Collator="function"==typeof window.Intl.Collator)}catch(e){}return e}(),i=navigator.language||"unknown",a=e.locale===i;let s="unknown",c="unknown";try{if(window.Intl&&"function"==typeof window.Intl.DateTimeFormat){const e=new Intl.DateTimeFormat(void 0,{dateStyle:"long"}),t=new Intl.DateTimeFormat(void 0,{timeStyle:"long"}),n=e.resolvedOptions(),o=t.resolvedOptions();s=n.dateStyle||"unknown",c=o.timeStyle||"unknown"}}catch(e){}return{locale:e.locale||"unknown",calendar:e.calendar||"unknown",numberingSystem:e.numberingSystem||"unknown",timeZone:e.timeZone||"unknown",dateStyle:s,timeStyle:c,hourCycle:e.hourCycle||"unknown",hour12:e.hour12||!1,numberLocale:n.numberLocale||e.locale||"unknown",currencyDisplay:n.currencyDisplay||"unknown",currencySign:n.currencySign||"unknown",notation:n.notation||"unknown",signDisplay:n.signDisplay||"unknown",listStyle:o.listStyle||"unknown",relativeTimeStyle:o.relativeTimeStyle||"unknown",pluralRules:o.pluralRules||"unknown",navigatorLanguage:i,localeMatch:a,intlSupport:r}}(),n=performance.now()-e;t&&"object"==typeof t&&(i.dateTimeLocale={value:t,duration:n,analysis:Ue(t),hash:(h=t,"number"==typeof h?`status-${h}`:[h.locale,h.calendar,h.numberingSystem,h.timeZone,h.hourCycle,h.hour12?"1":"0",h.localeMatch?"1":"0",Object.values(h.intlSupport).map(e=>e?"1":"0").join("")].join("|"))},o.push("dateTimeLocale"))}catch(e){r.push({component:"dateTimeLocale",error:e instanceof Error?e.message:"DateTime locale detection failed"})}if(at("accessibilityEnhanced",n)&&Te())try{const e=performance.now(),t=Le(),n=performance.now()-e;t&&(i.accessibilityEnhanced={value:t,duration:n,analysis:Be(t)},o.push("accessibilityEnhanced"))}catch(e){r.push({component:"accessibilityEnhanced",error:e instanceof Error?e.message:"Enhanced accessibility detection failed"})}if(at("enhancedFonts",n)&&function(){try{return"undefined"!=typeof document&&"function"==typeof document.createElement&&void 0!==document.body}catch{return!1}}())try{const e=performance.now(),t=await async function(){const e=performance.now();try{const{document:t,body:n,cleanup:o}=await new Promise((e,t)=>{const n=document.createElement("iframe");n.style.cssText="position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none;",n.onload=()=>{try{const t=n.contentDocument;if(!t)throw new Error("Cannot access iframe document");const o=t.body;if(!o)throw new Error("Iframe body not available");o.style.fontSize=qe,o.style.margin="0",o.style.padding="0",e({document:t,body:o,cleanup:()=>{n.parentNode&&n.parentNode.removeChild(n)}})}catch(e){t(e)}},n.onerror=()=>{t(new Error("Failed to load font measurement iframe"))},document.body.appendChild(n)});try{const o=t.createElement("div");o.style.setProperty("visibility","hidden","important");const r=Ke.map(e=>Xe(t,e));r.forEach(e=>o.appendChild(e));const i={};for(const e of He)i[e]=Ke.map(n=>Ye(t,e,n)),i[e].forEach(e=>o.appendChild(e));n.appendChild(o);const a={};Ke.forEach((e,t)=>{const n=r[t];n&&(a[e]={width:n.offsetWidth,height:n.offsetHeight})});const s=[],c={};for(const e of He){const t=i[e];t&&(Je(t,a)&&s.push(e),t.length>0&&t[0]&&(c[e]={width:t[0].offsetWidth,height:t[0].offsetHeight}))}const l=performance.now()-e,d=Object.values(c).map(e=>e.width);return{available:s,method:"iframe",measurements:c,precision:new Set(d).size/d.length,totalTested:He.length,detectionTime:l}}finally{o()}}catch(t){return function(e){const t=[],n={};try{const e=document.createElement("div");e.style.cssText="position: absolute; left: -9999px; top: -9999px; visibility: hidden;";const o={};Ke.forEach(t=>{const n=document.createElement("span");n.style.fontFamily=t,n.style.fontSize=qe,n.style.whiteSpace="nowrap",n.textContent=je,e.appendChild(n),document.body.appendChild(e),o[t]={width:n.offsetWidth,height:n.offsetHeight},document.body.removeChild(e),e.removeChild(n)});for(const r of He){let i=!1;for(const t of Ke){const a=document.createElement("span");a.style.fontFamily=`'${r}',${t}`,a.style.fontSize=qe,a.style.whiteSpace="nowrap",a.textContent=je,e.appendChild(a),document.body.appendChild(e);const s={width:a.offsetWidth,height:a.offsetHeight};n[r]=s;const c=o[t];if(!c||s.width===c.width&&s.height===c.height||(i=!0),document.body.removeChild(e),e.removeChild(a),i)break}i&&t.push(r)}}catch(e){}const o=performance.now()-e,r=Object.values(n).map(e=>e.width),i=new Set(r).size;return{available:t,method:"dom",measurements:n,precision:r.length>0?i/r.length:0,totalTested:He.length,detectionTime:o}}(e)}}(),n=performance.now()-e;t&&(i.enhancedFonts={value:t,duration:n,analysis:Qe(t),hash:(m=t,`${m.available.sort().join(",")}|${m.method}|${m.precision.toFixed(2)}`)},o.push("enhancedFonts"))}catch(e){r.push({component:"enhancedFonts",error:e instanceof Error?e.message:"Enhanced font detection failed"})}const g={};let p;o.forEach(e=>{const t=i[e];t&&t.value&&(g[e]=t.value)});try{const{calculateConfidence:e}=await Promise.resolve().then(function(){return Vr});p=e([...o.map(e=>({component:e,success:!0,duration:i[e]?.duration||0,value:i[e]?.value})),...r.map(e=>({component:e.component,success:!1,duration:0,error:e.error}))],{requireMinimumComponents:6,penalizeMissingCore:!0,adjustForIncognito:!0}),i.confidence={score:p.score,level:p.level,factors:p.factors,recommendations:p.recommendations}}catch(e){const t=o.length/(o.length+r.length||1);i.confidence={score:t>=.8?.95:t>=.6?.8:.5,level:t>=.8?"High":t>=.6?"Medium":"Low",factors:{componentCount:o.length,weightedScore:t,stabilityScore:t,entropyScore:t,spoofResistanceScore:t},recommendations:t<.8?["Enable more fingerprinting components"]:[]}}const f={...i,hash:"",components:o,collectionTime:performance.now()-t},b={success:o.length>0,collectedComponents:o,failedComponents:r,confidence:p||i.confidence};if(o.length>0){const e=f.browser?.value,t=f.screen?.value,i=e?.userAgent||"",s=(()=>{const e=!0===navigator.userAgentData?.mobile,n=navigator.maxTouchPoints||0,o=t?.width||0,r=t?.height||0,i=Math.min(o,r);return Math.max(o,r),e?"mobile":n>0?i<=480?"mobile":"tablet":i>1024?"desktop":i<=480?"mobile":"desktop"})();let l={};try{const{collectDeviceSignals:e}=await Promise.resolve().then(function(){return Xr});l=e()}catch(e){}const d={ua:(()=>{try{return O().family}catch{const e=i,t=e.match(/(chrome|safari|firefox|edge|edg|brave|opera|opr|chromium)/i);return(t?.[1]||e.split(" ")[0]||"unknown").toLowerCase()}})(),timezone:e?.timezone||"unknown",primaryLanguage:(()=>{try{const t=e?.languages;return Array.isArray(t)&&t.length>0&&t[0]?t[0].toLowerCase().split("-")[0]:"undefined"!=typeof navigator&&navigator.language?navigator.language.toLowerCase().split("-")[0]:"unknown"}catch{return"unknown"}})(),platform:(e?.platform||"unknown").toLowerCase(),deviceType:s,hardware:(()=>{const e=l.hardwareConcurrency,t=l.deviceMemory;if(!e&&!t)return;const n=e?(e=>e>=32?"workstation":e>=20?"ultra":e>=16?"high":e>=12?"premium":e>=8?"mid":e>=6?"normal":e>=4?"basic":e>=2?"low":"minimal")(e):"unknown",o=t?(e=>e>=64?"workstation":e>=32?"ultra":e>=24?"high":e>=16?"premium":e>=12?"mid":e>=8?"normal":e>=4?"basic":e>=2?"low":"minimal")(t):"unknown";var r;return{cores:n,memory:o,arch:void 0===(r=l.architecture)?"unknown":255===r?"arm64":0===r?"x86_64":"other",class:((e,t)=>"workstation"!==e&&"ultra"!==e||"workstation"!==t&&"ultra"!==t?"high"!==e&&"premium"!==e||"high"!==t&&"premium"!==t&&"ultra"!==t?"mid"!==e&&"normal"!==e||"mid"!==t&&"normal"!==t&&"premium"!==t?"basic"!==e&&"low"!==e||"basic"!==t&&"low"!==t&&"normal"!==t?"minimal"===e||"minimal"===t?"mobile":"mixed":"budget":"mainstream":"enthusiast":"professional")(n,o),touch:l.touchSupport?.maxTouchPoints?l.touchSupport.maxTouchPoints>=10?"multi":l.touchSupport.maxTouchPoints>=5?"standard":"basic":"none"}})(),screenFrame:l?.screenFrame?{top:l.screenFrame.top||0,right:l.screenFrame.right||0,bottom:l.screenFrame.bottom||0,left:l.screenFrame.left||0}:void 0,display:(()=>{const e=l.colorDepth,t=l.colorGamut,n=(e=>e?e>=48?"ultra_high":e>=32?"high":e>=24?"normal":e>=16?"basic":"low":"unknown")(e),o=(e=>{if(!e)return"unknown";switch(e){case"rec2020":return"professional";case"p3":return"enhanced";case"srgb":return"standard";default:return"unknown"}})(t);return{depth:n,gamut:o,class:((e,t)=>"ultra_high"===e||"professional"===t?"professional":"high"===e||"enhanced"===t?"premium":"normal"===e&&"standard"===t?"standard":"basic"===e?"basic":"legacy")(n,o)}})()},h=[d.ua||"",d.platform||"",d.deviceType||"",d.timezone||"",d.primaryLanguage||""].filter(Boolean);if(h.length>=3){const e=h.join("|");let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)&4294967295;d._entropy=Math.abs(t).toString(36).substring(0,8)}(n.debug||"undefined"!=typeof window&&window._rabbitTrackerDebug)&&console.log("[RabbitTracker DEBUG] coreVector components:",{ua:d.ua,platform:d.platform,deviceType:d.deviceType,timezone:d.timezone,primaryLanguage:d.primaryLanguage,hasHardware:!!d.hardware,hasDisplay:!!d.display,hasScreenFrame:!!d.screenFrame,_entropy:d._entropy});const m=function(e,t=!1){const n=u(e),o=JSON.stringify(n);t&&console.log("[RabbitTracker] hashStableCore debug:",{originalKeys:Object.keys(e),canonicalizedKeys:Object.keys(n),canonicalLength:o.length,sample:o.substring(0,200)+"..."});const r=a(o);return t&&console.log("[RabbitTracker] Generated stableCoreHash:",r.substring(0,32)),r}(d,n.debug),y=["canvas","webgl","audio","mathFingerprint","fontPreferences","enhancedFonts","dateTimeLocale","accessibilityEnhanced","domBlockers","pluginsEnhanced"],v={};for(const[e,t]of Object.entries(g))y.includes(e)||(v[e]=t);const w={...v,_stableCore:d},S=c(w,n.debug);f.hash=S,n.debug&&console.log("[RabbitTracker] Ultra-stable core vector:",{components:Object.keys(d),entropy:d._entropy,stableCoreHash:m.substring(0,16),enhancedFingerprintHash:S.substring(0,16),ua:d.ua,deviceType:d.deviceType,platform:d.platform,timezone:d.timezone,hasScreenFrame:!!d.screenFrame,hardwareClass:d.hardware?.class,displayClass:d.display?.class,totalComponentsInHash:Object.keys(w).length}),b.data={...f,stableCoreHash:m,stableCoreVector:d},n.debug&&(console.log("[RabbitTracker] Fingerprint collection completed:",{collected:o.length,failed:r.length,duration:f.collectionTime,enhancedFingerprintHash:f.hash,stableCoreHash:m,confidence:p?.level||"Unknown",score:p?.score||0,collisionResistance:"Enhanced with stable + unstable components (no temporal entropy)"}),p?.recommendations.length&&console.log("[RabbitTracker] Confidence recommendations:",p.recommendations))}else b.error="No components could be collected";return b}async function dt(){return lt({gdprMode:!0,includeInvasive:!1,excludeComponents:["canvas","webgl","audio"],timeout:2e3})}async function ut(){return lt({gdprMode:!1,includeInvasive:!0,timeout:5e3})}class ht{constructor(){this.name="fetch",this.available="undefined"!=typeof fetch}async send(e,t){const n=Date.now();try{const o=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!o.ok)throw new Error(`HTTP ${o.status}`);return{success:!0,method:this.name,latency:Date.now()-n}}catch(e){return{success:!1,method:this.name,latency:Date.now()-n,error:e instanceof Error?e.message:String(e)}}}}class mt{constructor(e,t){this.name="elysia-websocket",this.available="undefined"!=typeof WebSocket,this.connected=!1,this.baseUrl=e,this.token=t}async send(e,t){const n=Date.now();try{if(!this.token)throw new Error("Missing token for WebSocket connection");if(await this.connect(),!this.ws||!this.connected)throw new Error("WebSocket not connected");return new Promise((t,o)=>{const r=e=>{try{const o=JSON.parse(e.data);this.ws?.removeEventListener("message",r),t({success:o.success||!1,method:this.name,latency:Date.now()-n})}catch(e){this.ws?.removeEventListener("message",r),o(new Error("Failed to parse WebSocket response"))}};this.ws?.addEventListener("message",r),this.ws?.send(JSON.stringify({...e,eventId:e.eventId||crypto.randomUUID(),sessionId:e.sessionId||e.s,eventType:e.eventType||e.type||"websocket_event",eventName:e.eventName||e.name,url:e.url,userAgent:e.userAgent||navigator.userAgent,timestamp:(new Date).toISOString(),fingerprintHash:e.fingerprintHash,stableCoreHash:e.stableCoreHash,stableCoreVector:e.stableCoreVector})),setTimeout(()=>{this.ws?.removeEventListener("message",r),o(new Error("WebSocket response timeout"))},5e3)})}catch(e){return{success:!1,method:this.name,latency:Date.now()-n,error:e instanceof Error?e.message:String(e)}}}async connect(){if(!this.connected||this.ws?.readyState!==WebSocket.OPEN)return new Promise((e,t)=>{try{const n=new URL(this.baseUrl),o=`${"https:"===n.protocol?"wss:":"ws:"}//${n.host}/ws/track?token=${encodeURIComponent(this.token)}`;this.ws=new WebSocket(o),this.ws.onopen=()=>{this.connected=!0,e()},this.ws.onerror=()=>{this.connected=!1,t(new Error("WebSocket connection failed"))},this.ws.onclose=()=>{this.connected=!1},setTimeout(()=>{this.connected||(this.ws?.close(),t(new Error("WebSocket connection timeout")))},5e3)}catch(e){t(e)}})}cleanup(){this.ws&&(this.ws.close(),this.connected=!1)}}class gt{constructor(){this.name="webrtc",this.available=void 0!==globalThis.RTCPeerConnection,this.connected=!1}async send(e,t){const n=Date.now();if(!this.available)return{success:!1,method:this.name,error:"WebRTC not available"};try{return await this.setupConnection(),this.dataChannel&&this.connected?(this.dataChannel.send(JSON.stringify(e)),{success:!0,method:this.name,latency:Date.now()-n}):{success:!1,method:this.name,error:"DataChannel not ready"}}catch(e){return{success:!1,method:this.name,error:e instanceof Error?e.message:String(e)}}}async setupConnection(){if(!this.connected)return new Promise((e,t)=>{try{this.pc=new globalThis.RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]}),this.dataChannel=this.pc.createDataChannel("tracking",{ordered:!1,maxRetransmits:0}),this.dataChannel.onopen=()=>{this.connected=!0,e()},this.dataChannel.onerror=e=>{t(e)}}catch(e){t(e)}})}destroy(){this.dataChannel&&this.dataChannel.close(),this.pc&&this.pc.close(),this.connected=!1}}class pt{constructor(e,t,n={}){this.transports=[],this.stats={totalRequests:0,successfulRequests:0,methodSuccess:new Map,methodFailures:new Map},this.baseUrl=e,this.token=t,this.config={enabled:!0,methods:["elysia-websocket","fetch"],fallbackDelay:100,maxRetries:2,debug:!1,...n},this.initializeTransports()}initializeTransports(){const e={"elysia-websocket":()=>new mt(this.baseUrl,this.token),fetch:()=>new ht,webrtc:()=>new gt};this.transports=this.config.methods.map(t=>e[t]?.()).filter(e=>void 0!==e&&e.available),this.config.debug&&console.log("[Zaplier] Anti-adblock initialized with transports:",this.transports.map(e=>e.name))}async send(e,t="/tracking/event"){if(this.stats.totalRequests++,!this.config.enabled||0===this.transports.length)return{success:!1,method:"none",error:"No transports available"};let n="";for(const o of this.transports){this.config.debug&&console.log(`[Zaplier] Trying transport: ${o.name}`);try{const r=await o.send(e,`${this.baseUrl}${t}`);if(r.success)return this.stats.successfulRequests++,this.updateMethodStats(o.name,!0),this.config.debug&&console.log(`[Zaplier] ✅ Data sent successfully via ${o.name} - STOPPING fallback chain`,r),r;this.updateMethodStats(o.name,!1),n=r.error||"Unknown error",this.config.debug&&console.warn(`[Zaplier] ❌ Transport ${o.name} failed:`,r.error)}catch(e){n=e instanceof Error?e.message:String(e),this.updateMethodStats(o.name,!1),this.config.debug&&console.warn(`[Zaplier] ❌ Transport ${o.name} threw error:`,e)}this.config.fallbackDelay>0&&await new Promise(e=>setTimeout(e,this.config.fallbackDelay))}return{success:!1,method:"all_failed",error:`All transports failed. Last error: ${n}`}}updateMethodStats(e,t){t?this.stats.methodSuccess.set(e,(this.stats.methodSuccess.get(e)||0)+1):this.stats.methodFailures.set(e,(this.stats.methodFailures.get(e)||0)+1)}getStats(){return{...this.stats}}getSuccessRates(){const e={};for(const t of this.transports){const n=this.stats.methodSuccess.get(t.name)||0,o=n+(this.stats.methodFailures.get(t.name)||0);e[t.name]=o>0?n/o*100:0}return e}destroy(){this.transports.forEach(e=>{e.destroy&&e.destroy()}),this.transports=[]}async testTransports(){const e={},t={test:!0,timestamp:Date.now()};for(const n of this.transports)try{e[n.name]=await n.send(t,`${this.baseUrl}/test`)}catch(t){e[n.name]={success:!1,method:n.name,error:t instanceof Error?t.message:String(t)}}return e}}class ft{constructor(e,t={}){this.clicks=[],this.scrollData=[],this.mouseMoves=[],this.lastMouseMove=0,this.maxScrollDepth=0,this.isActive=!1,this.recentClicks=[],this.handleClick=e=>{if(!this.config.trackClicks)return;const t=e.target;t.getBoundingClientRect();const n=window.pageXOffset||document.documentElement.scrollLeft,o=window.pageYOffset||document.documentElement.scrollTop,r={x:e.clientX,y:e.clientY,absoluteX:e.clientX+n,absoluteY:e.clientY+o,element:this.getElementSelector(t),timestamp:Date.now(),button:e.button};this.config.trackRageClicks&&this.detectRageClick(r.x,r.y,r.timestamp)&&(r.rageClick=!0),this.clicks.push(r),this.clicks.length>this.config.maxClickBuffer&&(this.clicks=this.clicks.slice(-this.config.maxClickBuffer))},this.handleScroll=()=>{if(!this.config.trackScrollDepth)return;const e=this.calculateScrollDepth();this.maxScrollDepth=Math.max(this.maxScrollDepth,e),this.scrollData.push({depth:e,maxDepth:this.maxScrollDepth,timestamp:Date.now(),viewport:{width:window.innerWidth,height:window.innerHeight}}),this.scrollData.length>100&&(this.scrollData=this.scrollData.slice(-50))},this.handleMouseMove=e=>{if(!this.config.trackMouseMoves)return;const t=Date.now();t-this.lastMouseMove<this.config.mouseMoveThrottle||(this.lastMouseMove=t,this.mouseMoves.push({x:e.clientX,y:e.clientY,timestamp:t}),this.mouseMoves.length>200&&(this.mouseMoves=this.mouseMoves.slice(-100)))},this.handleResize=()=>{const e=this.calculateScrollDepth();this.scrollData.push({depth:e,maxDepth:this.maxScrollDepth,timestamp:Date.now(),viewport:{width:window.innerWidth,height:window.innerHeight}})},this.sessionId=e,this.config={enabled:!0,trackClicks:!0,trackScrollDepth:!0,trackMouseMoves:!1,trackRageClicks:!0,mouseMoveThrottle:200,batchInterval:1e4,maxClickBuffer:500,rageClickThreshold:3,rageClickTimeWindow:1e3,...t}}start(){return!(!this.config.enabled||this.isActive||(this.isActive=!0,this.setupEventListeners(),this.startBatchTimer(),this.trackInitialViewport(),0))}stop(){this.isActive&&(this.isActive=!1,this.removeEventListeners(),this.batchTimer&&(clearInterval(this.batchTimer),this.batchTimer=void 0),this.sendBatch())}setupEventListeners(){this.config.trackClicks&&document.addEventListener("click",this.handleClick,!0),this.config.trackScrollDepth&&(window.addEventListener("scroll",this.handleScroll,{passive:!0}),document.addEventListener("scroll",this.handleScroll,{passive:!0})),this.config.trackMouseMoves&&document.addEventListener("mousemove",this.handleMouseMove,{passive:!0}),window.addEventListener("resize",this.handleResize),window.addEventListener("orientationchange",this.handleResize)}removeEventListeners(){document.removeEventListener("click",this.handleClick,!0),window.removeEventListener("scroll",this.handleScroll),document.removeEventListener("scroll",this.handleScroll),document.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("resize",this.handleResize),window.removeEventListener("orientationchange",this.handleResize)}trackInitialViewport(){const e=this.calculateScrollDepth();this.scrollData.push({depth:e,maxDepth:e,timestamp:Date.now(),viewport:{width:window.innerWidth,height:window.innerHeight}})}calculateScrollDepth(){const e=window.pageYOffset||document.documentElement.scrollTop,t=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight),n=window.innerHeight;return t<=n?100:Math.min(100,Math.round((e+n)/t*100))}detectRageClick(e,t,n){const o=this.config.rageClickTimeWindow;this.recentClicks=this.recentClicks.filter(e=>n-e.timestamp<=o);const r=this.recentClicks.filter(n=>Math.sqrt(Math.pow(n.x-e,2)+Math.pow(n.y-t,2))<=50);return this.recentClicks.push({x:e,y:t,timestamp:n}),r.length>=this.config.rageClickThreshold-1}getElementSelector(e){if(e.id)return`#${e.id}`;if(e.className&&"string"==typeof e.className){const t=e.className.split(" ").filter(e=>e.length>0);if(t.length>0)return`.${t.slice(0,2).join(".")}`}const t=e.tagName.toLowerCase();return e.parentElement?`${t}:nth-child(${Array.from(e.parentElement.children).indexOf(e)+1})`:t}startBatchTimer(){this.batchTimer=window.setInterval(()=>{this.sendBatch()},this.config.batchInterval)}sendBatch(){if(0===this.clicks.length&&0===this.scrollData.length&&0===this.mouseMoves.length)return;const e={sessionId:this.sessionId,pageMetadata:{url:window.location.href,title:document.title,viewport:{width:window.innerWidth,height:window.innerHeight},documentSize:{width:Math.max(document.body.scrollWidth,document.body.offsetWidth,document.documentElement.clientWidth,document.documentElement.scrollWidth,document.documentElement.offsetWidth),height:Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)}},clicks:[...this.clicks],scrollData:[...this.scrollData],mouseMoves:this.config.trackMouseMoves?[...this.mouseMoves]:[],maxScrollDepth:this.maxScrollDepth,timestamp:Date.now()};this.clicks=[],this.scrollData=[],this.mouseMoves=[],this.sendToBackend(e)}setAntiAdblockManager(e){this.antiAdblockManager=e}async sendToBackend(e){try{if(this.antiAdblockManager&&(await this.antiAdblockManager.send(e,"/api/heatmap/record")).success)return;(await fetch("/api/heatmap/track",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok||console.warn("[Zaplier] Heatmap batch failed to send")}catch(e){console.warn("[Zaplier] Heatmap error:",e)}}getStats(){const e=this.clicks.filter(e=>e.rageClick).length;return{clickCount:this.clicks.length,maxScrollDepth:this.maxScrollDepth,isRecording:this.isActive,mouseMovements:this.mouseMoves.length,rageClicks:e}}enableMouseTracking(){this.config.trackMouseMoves||(this.config.trackMouseMoves=!0,this.isActive&&document.addEventListener("mousemove",this.handleMouseMove,{passive:!0}))}disableMouseTracking(){this.config.trackMouseMoves&&(this.config.trackMouseMoves=!1,document.removeEventListener("mousemove",this.handleMouseMove),this.mouseMoves=[])}isRecording(){return this.isActive}}var yt;function vt(e){var t=null==e?void 0:e.host;return Boolean((null==t?void 0:t.shadowRoot)===e)}function wt(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function bt(e){try{var t=e.rules||e.cssRules;return t?((n=Array.from(t).map(St).join("")).includes(" background-clip: text;")&&!n.includes(" -webkit-background-clip: text;")&&(n=n.replace(" background-clip: text;"," -webkit-background-clip: text; background-clip: text;")),n):null}catch(e){return null}var n}function St(e){var t=e.cssText;if(function(e){return"styleSheet"in e}(e))try{t=bt(e.styleSheet)||t}catch(e){}return t}!function(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"}(yt||(yt={}));var Ct=function(){function e(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}return e.prototype.getId=function(e){var t;if(!e)return-1;var n=null===(t=this.getMeta(e))||void 0===t?void 0:t.id;return null!=n?n:-1},e.prototype.getNode=function(e){return this.idNodeMap.get(e)||null},e.prototype.getIds=function(){return Array.from(this.idNodeMap.keys())},e.prototype.getMeta=function(e){return this.nodeMetaMap.get(e)||null},e.prototype.removeNodeFromMap=function(e){var t=this,n=this.getId(e);this.idNodeMap.delete(n),e.childNodes&&e.childNodes.forEach(function(e){return t.removeNodeFromMap(e)})},e.prototype.has=function(e){return this.idNodeMap.has(e)},e.prototype.hasNode=function(e){return this.nodeMetaMap.has(e)},e.prototype.add=function(e,t){var n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)},e.prototype.replace=function(e,t){var n=this.getNode(e);if(n){var o=this.nodeMetaMap.get(n);o&&this.nodeMetaMap.set(t,o)}this.idNodeMap.set(e,t)},e.prototype.reset=function(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap},e}();function It(e){var t=e.maskInputOptions,n=e.tagName,o=e.type,r=e.value,i=e.maskInputFn,a=r||"";return(t[n.toLowerCase()]||t[o])&&(a=i?i(a):"*".repeat(a.length)),a}var kt,At,Et="__rrweb_original__",Mt=1,Tt=new RegExp("[^a-z0-9-_:]");function Rt(){return Mt++}var _t=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,xt=/^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/|#).*/,Dt=/^(data:)([^,]*),(.*)/i;function Ot(e,t){return(e||"").replace(_t,function(e,n,o,r,i,a){var s,c=o||i||a,l=n||r||"";if(!c)return e;if(!xt.test(c))return"url(".concat(l).concat(c).concat(l,")");if(Dt.test(c))return"url(".concat(l).concat(c).concat(l,")");if("/"===c[0])return"url(".concat(l).concat((s=t,(s.indexOf("//")>-1?s.split("/").slice(0,3).join("/"):s.split("/")[0]).split("?")[0]+c)).concat(l,")");var d=t.split("/"),u=c.split("/");d.pop();for(var h=0,m=u;h<m.length;h++){var g=m[h];"."!==g&&(".."===g?d.pop():d.push(g))}return"url(".concat(l).concat(d.join("/")).concat(l,")")})}var Nt=/^[^ \t\n\r\u000c]+/,Ft=/^[, \t\n\r\u000c]+/;function Lt(e,t){if(!t||""===t.trim())return t;var n=e.createElement("a");return n.href=t,n.href}function Bt(){var e=document.createElement("a");return e.href="",e.href}function Pt(e,t,n,o){return"src"===n||"href"===n&&o&&("use"!==t||"#"!==o[0])||"xlink:href"===n&&o&&"#"!==o[0]?Lt(e,o):"background"!==n||!o||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n&&o?function(e,t){if(""===t.trim())return t;var n=0;function o(e){var o,r=e.exec(t.substring(n));return r?(o=r[0],n+=o.length,o):""}for(var r=[];o(Ft),!(n>=t.length);){var i=o(Nt);if(","===i.slice(-1))i=Lt(e,i.substring(0,i.length-1)),r.push(i);else{var a="";i=Lt(e,i);for(var s=!1;;){var c=t.charAt(n);if(""===c){r.push((i+a).trim());break}if(s)")"===c&&(s=!1);else{if(","===c){n+=1,r.push((i+a).trim());break}"("===c&&(s=!0)}a+=c,n+=1}}}return r.join(", ")}(e,o):"style"===n&&o?Ot(o,Bt()):"object"===t&&"data"===n&&o?Lt(e,o):o:Lt(e,o)}function Ut(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&Ut(e.parentNode,t,n);for(var o=e.classList.length;o--;){var r=e.classList[o];if(t.test(r))return!0}return!!n&&Ut(e.parentNode,t,n)}function Wt(e,t,n){var o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===o)return!1;if("string"==typeof t){if(o.classList.contains(t))return!0;if(o.closest(".".concat(t)))return!0}else if(Ut(o,t,!0))return!0;if(n){if(o.matches(n))return!0;if(o.closest(n))return!0}return!1}function Vt(e){return void 0===e?"":e.toLowerCase()}function Zt(e,t){var n,o=t.doc,r=t.mirror,i=t.blockClass,a=t.blockSelector,s=t.maskTextClass,c=t.maskTextSelector,l=t.skipChild,d=void 0!==l&&l,u=t.inlineStylesheet,h=void 0===u||u,m=t.maskInputOptions,g=void 0===m?{}:m,p=t.maskTextFn,f=t.maskInputFn,y=t.slimDOMOptions,v=t.dataURLOptions,w=void 0===v?{}:v,b=t.inlineImages,S=void 0!==b&&b,C=t.recordCanvas,I=void 0!==C&&C,k=t.onSerialize,A=t.onIframeLoad,E=t.iframeLoadTimeout,M=void 0===E?5e3:E,T=t.onStylesheetLoad,R=t.stylesheetLoadTimeout,_=void 0===R?5e3:R,x=t.keepIframeSrcFn,D=void 0===x?function(){return!1}:x,O=t.newlyAddedElement,N=void 0!==O&&O,F=t.preserveWhiteSpace,L=void 0===F||F,B=function(e,t){var n=t.doc,o=t.blockClass,r=t.blockSelector,i=t.maskTextClass,a=t.maskTextSelector,s=t.inlineStylesheet,c=t.maskInputOptions,l=void 0===c?{}:c,d=t.maskTextFn,u=t.maskInputFn,h=t.dataURLOptions,m=void 0===h?{}:h,g=t.inlineImages,p=t.recordCanvas,f=t.keepIframeSrcFn,y=t.newlyAddedElement,v=void 0!==y&&y,w=function(e,t){if(t.hasNode(e)){var n=t.getId(e);return 1===n?void 0:n}}(n,t.mirror);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:yt.Document,childNodes:[],compatMode:e.compatMode}:{type:yt.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:yt.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:w};case e.ELEMENT_NODE:return function(e,t){for(var n=t.doc,o=t.inlineStylesheet,r=t.maskInputOptions,i=void 0===r?{}:r,a=t.maskInputFn,s=t.dataURLOptions,c=void 0===s?{}:s,l=t.inlineImages,d=t.recordCanvas,u=t.keepIframeSrcFn,h=t.newlyAddedElement,m=void 0!==h&&h,g=t.rootId,p=function(e,t,n){if("string"==typeof t){if(e.classList.contains(t))return!0}else for(var o=e.classList.length;o--;){var r=e.classList[o];if(t.test(r))return!0}return!!n&&e.matches(n)}(e,t.blockClass,t.blockSelector),f=function(e){if(e instanceof HTMLFormElement)return"form";var t=e.tagName.toLowerCase().trim();return Tt.test(t)?"div":t}(e),y={},v=e.attributes.length,w=0;w<v;w++){var b=e.attributes[w];y[b.name]=Pt(n,f,b.name,b.value)}if("link"===f&&o){var S=Array.from(n.styleSheets).find(function(t){return t.href===e.href}),C=null;S&&(C=bt(S)),C&&(delete y.rel,delete y.href,y._cssText=Ot(C,S.href))}if("style"===f&&e.sheet&&!(e.innerText||e.textContent||"").trim().length&&(C=bt(e.sheet))&&(y._cssText=Ot(C,Bt())),"input"===f||"textarea"===f||"select"===f){var I=e.value,k=e.checked;"radio"!==y.type&&"checkbox"!==y.type&&"submit"!==y.type&&"button"!==y.type&&I?y.value=It({type:y.type,tagName:f,value:I,maskInputOptions:i,maskInputFn:a}):k&&(y.checked=k)}if("option"===f&&(e.selected&&!i.select?y.selected=!0:delete y.selected),"canvas"===f&&d)if("2d"===e.__context)(function(e){var t=e.getContext("2d");if(!t)return!0;for(var n=0;n<e.width;n+=50)for(var o=0;o<e.height;o+=50){var r=t.getImageData,i=Et in r?r[Et]:r;if(new Uint32Array(i.call(t,n,o,Math.min(50,e.width-n),Math.min(50,e.height-o)).data.buffer).some(function(e){return 0!==e}))return!1}return!0})(e)||(y.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){var A=e.toDataURL(c.type,c.quality),E=document.createElement("canvas");E.width=e.width,E.height=e.height,A!==E.toDataURL(c.type,c.quality)&&(y.rr_dataURL=A)}if("img"===f&&l){kt||(kt=n.createElement("canvas"),At=kt.getContext("2d"));var M=e,T=M.crossOrigin;M.crossOrigin="anonymous";var R=function(){try{kt.width=M.naturalWidth,kt.height=M.naturalHeight,At.drawImage(M,0,0),y.rr_dataURL=kt.toDataURL(c.type,c.quality)}catch(e){console.warn("Cannot inline img src=".concat(M.currentSrc,"! Error: ").concat(e))}T?y.crossOrigin=T:M.removeAttribute("crossorigin")};M.complete&&0!==M.naturalWidth?R():M.onload=R}if("audio"!==f&&"video"!==f||(y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime),m||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),p){var _=e.getBoundingClientRect(),x=_.width,D=_.height;y={class:y.class,rr_width:"".concat(x,"px"),rr_height:"".concat(D,"px")}}return"iframe"!==f||u(y.src)||(e.contentDocument||(y.rr_src=y.src),delete y.src),{type:yt.Element,tagName:f,attributes:y,childNodes:[],isSVG:(O=e,Boolean("svg"===O.tagName||O.ownerSVGElement)||void 0),needBlock:p,rootId:g};var O}(e,{doc:n,blockClass:o,blockSelector:r,inlineStylesheet:s,maskInputOptions:l,maskInputFn:u,dataURLOptions:m,inlineImages:g,recordCanvas:p,keepIframeSrcFn:f,newlyAddedElement:v,rootId:w});case e.TEXT_NODE:return function(e,t){var n,o,r=t.maskTextClass,i=t.maskTextSelector,a=t.maskTextFn,s=t.rootId,c=e.parentNode&&e.parentNode.tagName,l=e.textContent,d="STYLE"===c||void 0,u="SCRIPT"===c||void 0;if(d&&l){try{e.nextSibling||e.previousSibling||(null===(n=e.parentNode.sheet)||void 0===n?void 0:n.cssRules)&&(l=(o=e.parentNode.sheet).cssRules?Array.from(o.cssRules).map(function(e){return e.cssText||""}).join(""):"")}catch(t){console.warn("Cannot get CSS styles from text's parentNode. Error: ".concat(t),e)}l=Ot(l,Bt())}return u&&(l="SCRIPT_PLACEHOLDER"),!d&&!u&&l&&Wt(e,r,i)&&(l=a?a(l):l.replace(/[\S]/g,"*")),{type:yt.Text,textContent:l||"",isStyle:d,rootId:s}}(e,{maskTextClass:i,maskTextSelector:a,maskTextFn:d,rootId:w});case e.CDATA_SECTION_NODE:return{type:yt.CDATA,textContent:"",rootId:w};case e.COMMENT_NODE:return{type:yt.Comment,textContent:e.textContent||"",rootId:w};default:return!1}}(e,{doc:o,mirror:r,blockClass:i,blockSelector:a,maskTextClass:s,maskTextSelector:c,inlineStylesheet:h,maskInputOptions:g,maskTextFn:p,maskInputFn:f,dataURLOptions:w,inlineImages:S,recordCanvas:I,keepIframeSrcFn:D,newlyAddedElement:N});if(!B)return console.warn(e,"not serialized"),null;n=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===yt.Comment)return!0;if(e.type===yt.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&"preload"===e.attributes.rel&&"script"===e.attributes.as||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&e.attributes.href.endsWith(".js")))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(Vt(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===Vt(e.attributes.name)||"icon"===Vt(e.attributes.rel)||"apple-touch-icon"===Vt(e.attributes.rel)||"shortcut icon"===Vt(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&Vt(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(Vt(e.attributes.property).match(/^(og|twitter|fb):/)||Vt(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===Vt(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===Vt(e.attributes.name)||"googlebot"===Vt(e.attributes.name)||"bingbot"===Vt(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===Vt(e.attributes.name)||"generator"===Vt(e.attributes.name)||"framework"===Vt(e.attributes.name)||"publisher"===Vt(e.attributes.name)||"progid"===Vt(e.attributes.name)||Vt(e.attributes.property).match(/^article:/)||Vt(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===Vt(e.attributes.name)||"yandex-verification"===Vt(e.attributes.name)||"csrf-token"===Vt(e.attributes.name)||"p:domain_verify"===Vt(e.attributes.name)||"verify-v1"===Vt(e.attributes.name)||"verification"===Vt(e.attributes.name)||"shopify-checkout-api-token"===Vt(e.attributes.name)))return!0}}return!1}(B,y)&&(L||B.type!==yt.Text||B.isStyle||B.textContent.replace(/^\s+|\s+$/gm,"").length)?Rt():-2;var P=Object.assign(B,{id:n});if(r.add(e,P),-2===n)return null;k&&k(e);var U=!d;if(P.type===yt.Element){U=U&&!P.needBlock,delete P.needBlock;var W=e.shadowRoot;W&&wt(W)&&(P.isShadowHost=!0)}if((P.type===yt.Document||P.type===yt.Element)&&U){y.headWhitespace&&P.type===yt.Element&&"head"===P.tagName&&(L=!1);for(var V={doc:o,mirror:r,blockClass:i,blockSelector:a,maskTextClass:s,maskTextSelector:c,skipChild:d,inlineStylesheet:h,maskInputOptions:g,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:w,inlineImages:S,recordCanvas:I,preserveWhiteSpace:L,onSerialize:k,onIframeLoad:A,iframeLoadTimeout:M,onStylesheetLoad:T,stylesheetLoadTimeout:_,keepIframeSrcFn:D},Z=0,G=Array.from(e.childNodes);Z<G.length;Z++)(j=Zt(G[Z],V))&&P.childNodes.push(j);if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(var z=0,H=Array.from(e.shadowRoot.childNodes);z<H.length;z++){var j;(j=Zt(H[z],V))&&(wt(e.shadowRoot)&&(j.isShadow=!0),P.childNodes.push(j))}}return e.parentNode&&vt(e.parentNode)&&wt(e.parentNode)&&(P.isShadow=!0),P.type===yt.Element&&"iframe"===P.tagName&&function(e,t,n){var o=e.contentWindow;if(o){var r,i=!1;try{r=o.document.readyState}catch(e){return}if("complete"===r){var a="about:blank";if(o.location.href!==a||e.src===a||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}else{var s=setTimeout(function(){i||(t(),i=!0)},n);e.addEventListener("load",function(){clearTimeout(s),i=!0,t()})}}}(e,function(){var t=e.contentDocument;if(t&&A){var n=Zt(t,{doc:t,mirror:r,blockClass:i,blockSelector:a,maskTextClass:s,maskTextSelector:c,skipChild:!1,inlineStylesheet:h,maskInputOptions:g,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:w,inlineImages:S,recordCanvas:I,preserveWhiteSpace:L,onSerialize:k,onIframeLoad:A,iframeLoadTimeout:M,onStylesheetLoad:T,stylesheetLoadTimeout:_,keepIframeSrcFn:D});n&&A(e,n)}},M),P.type===yt.Element&&"link"===P.tagName&&"stylesheet"===P.attributes.rel&&function(e,t,n){var o,r=!1;try{o=e.sheet}catch(e){return}if(!o){var i=setTimeout(function(){r||(t(),r=!0)},n);e.addEventListener("load",function(){clearTimeout(i),r=!0,t()})}}(e,function(){if(T){var t=Zt(e,{doc:o,mirror:r,blockClass:i,blockSelector:a,maskTextClass:s,maskTextSelector:c,skipChild:!1,inlineStylesheet:h,maskInputOptions:g,maskTextFn:p,maskInputFn:f,slimDOMOptions:y,dataURLOptions:w,inlineImages:S,recordCanvas:I,preserveWhiteSpace:L,onSerialize:k,onIframeLoad:A,iframeLoadTimeout:M,onStylesheetLoad:T,stylesheetLoadTimeout:_,keepIframeSrcFn:D});t&&T(e,t)}},_),P}function Gt(e,t,n=document){const o={capture:!0,passive:!0};return n.addEventListener(e,t,o),()=>n.removeEventListener(e,t,o)}const zt="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 Ht={map:{},getId:()=>(console.error(zt),-1),getNode:()=>(console.error(zt),null),removeNodeFromMap(){console.error(zt)},has:()=>(console.error(zt),!1),reset(){console.error(zt)}};function jt(e,t,n={}){let o=null,r=0;return function(...i){const a=Date.now();r||!1!==n.leading||(r=a);const s=t-(a-r),c=this;s<=0||s>t?(o&&(clearTimeout(o),o=null),r=a,e.apply(c,i)):o||!1===n.trailing||(o=setTimeout(()=>{r=!1===n.leading?0:Date.now(),o=null,e.apply(c,i)},s))}}function qt(e,t,n,o,r=window){const i=r.Object.getOwnPropertyDescriptor(e,t);return r.Object.defineProperty(e,t,o?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),i&&i.set&&i.set.call(this,e)}}),()=>qt(e,t,i||{},!0)}function Kt(e,t,n){try{if(!(t in e))return()=>{};const o=e[t],r=n(o);return"function"==typeof r&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__rrweb_original__:{enumerable:!1,value:o}})),e[t]=r,()=>{e[t]=o}}catch(e){return()=>{}}}function Xt(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function Yt(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Jt(e,t,n,o){if(!e)return!1;const r=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(!r)return!1;if("string"==typeof t){if(r.classList.contains(t))return!0;if(o&&null!==r.closest("."+t))return!0}else if(Ut(r,t,o))return!0;if(n){if(e.matches(n))return!0;if(o&&null!==r.closest(n))return!0}return!1}function Qt(e,t){return-2===t.getId(e)}function $t(e,t){if(vt(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||$t(e.parentNode,t))}function en(e){return Boolean(e.changedTouches)}function tn(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function nn(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function on(e){return Boolean(null==e?void 0:e.shadowRoot)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Ht=new Proxy(Ht,{get:(e,t,n)=>("map"===t&&console.error(zt),Reflect.get(e,t,n))}));class rn{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){var t;return null!==(t=this.styleIDMap.get(e))&&void 0!==t?t:-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}var an=(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))(an||{}),sn=(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))(sn||{}),cn=(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))(cn||{}),ln=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(ln||{});function dn(e){return"__ln"in e}class un{constructor(){this.length=0,this.head=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)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&&dn(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&dn(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=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.head=t.next,this.head&&(this.head.previous=null)),e.__ln&&delete e.__ln,this.length--)}}const hn=(e,t)=>`${e}@${t}`;class mn{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new un,n=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},o=o=>{var r,i,a,s;let c=null;(null===(i=null===(r=o.getRootNode)||void 0===r?void 0:r.call(o))||void 0===i?void 0:i.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&o.getRootNode().host&&(c=o.getRootNode().host);let l=c;for(;(null===(s=null===(a=null==l?void 0:l.getRootNode)||void 0===a?void 0:a.call(l))||void 0===s?void 0:s.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&l.getRootNode().host;)l=l.getRootNode().host;const d=!(this.doc.contains(o)||l&&this.doc.contains(l));if(!o.parentNode||d)return;const u=vt(o.parentNode)?this.mirror.getId(c):this.mirror.getId(o.parentNode),h=n(o);if(-1===u||-1===h)return t.addNode(o);const m=Zt(o,{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=>{tn(e,this.mirror)&&this.iframeManager.addIframe(e),nn(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),on(o)&&this.shadowDomManager.addShadowRoot(o.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)}});m&&e.push({parentId:u,nextId:h,node:m})};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of Array.from(this.movedSet.values()))pn(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||o(e);for(const e of Array.from(this.addedSet.values()))yn(this.droppedSet,e)||pn(this.removes,e,this.mirror)?yn(this.movedSet,e)?o(e):this.droppedSet.add(e):o(e);let r=null;for(;t.length;){let e=null;if(r){const t=this.mirror.getId(r.value.parentNode),o=n(r.value);-1!==t&&-1!==o&&(e=r)}if(!e)for(let o=t.length-1;o>=0;o--){const r=t.get(o);if(r){const t=this.mirror.getId(r.value.parentNode);if(-1===n(r.value))continue;if(-1!==t){e=r;break}{const t=r.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const n=t.parentNode.host;if(-1!==this.mirror.getId(n)){e=r;break}}}}}if(!e){for(;t.head;)t.removeNode(t.head.value);break}r=e.previous,t.removeNode(e.value),o(e.value)}const i={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>({id:this.mirror.getId(e.node),attributes:e.attributes})).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.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(i))},this.processMutation=e=>{if(!Qt(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;Jt(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:Wt(e.target,this.maskTextClass,this.maskTextSelector)&&t?this.maskTextFn?this.maskTextFn(t):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.target.getAttribute(e.attributeName);if("value"===e.attributeName&&(n=It({maskInputOptions:this.maskInputOptions,tagName:e.target.tagName,type:e.target.getAttribute("type"),value:n,maskInputFn:this.maskInputFn})),Jt(e.target,this.blockClass,this.blockSelector,!1)||n===e.oldValue)return;let o=this.attributes.find(t=>t.node===e.target);if("IFRAME"===t.tagName&&"src"===e.attributeName&&!this.keepIframeSrcFn(n)){if(t.contentDocument)return;e.attributeName="rr_src"}if(o||(o={node:e.target,attributes:{}},this.attributes.push(o)),"style"===e.attributeName){const n=this.doc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue),void 0!==o.attributes.style&&null!==o.attributes.style||(o.attributes.style={});const r=o.attributes.style;for(const e of Array.from(t.style)){const o=t.style.getPropertyValue(e),i=t.style.getPropertyPriority(e);o===n.style.getPropertyValue(e)&&i===n.style.getPropertyPriority(e)||(r[e]=""===i?o:[o,i])}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(r[e]=!1)}else o.attributes[e.attributeName]=Pt(this.doc,t.tagName,e.attributeName,n);break}case"childList":if(Jt(e.target,this.blockClass,this.blockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const n=this.mirror.getId(t),o=vt(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);Jt(e.target,this.blockClass,this.blockSelector,!1)||Qt(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(gn(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||$t(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[hn(n,o)]?gn(this.movedSet,t):this.removes.push({parentId:o,id:n,isShadow:!(!vt(e.target)||!wt(e.target))||void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(this.mirror.hasNode(e)){if(Qt(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[hn(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);Jt(e,this.blockClass,this.blockSelector,!1)||e.childNodes.forEach(e=>this.genAdds(e))}}init(e){["mutationCb","blockClass","blockSelector","maskTextClass","maskTextSelector","inlineStylesheet","maskInputOptions","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager"].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 gn(e,t){e.delete(t),t.childNodes.forEach(t=>gn(e,t))}function pn(e,t,n){return 0!==e.length&&fn(e,t,n)}function fn(e,t,n){const{parentNode:o}=t;if(!o)return!1;const r=n.getId(o);return!!e.some(e=>e.id===r)||fn(e,o,n)}function yn(e,t){return 0!==e.size&&vn(e,t)}function vn(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||vn(e,n))}const wn=[],bn="undefined"!=typeof CSSGroupingRule,Sn="undefined"!=typeof CSSMediaRule,Cn="undefined"!=typeof CSSSupportsRule,In="undefined"!=typeof CSSConditionRule;function kn(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];return e.target}catch(t){return e.target}}function An(e,t){var n,o;const r=new mn;wn.push(r),r.init(e);let i=window.MutationObserver||window.__rrMutationObserver;const a=null===(o=null===(n=null===window||void 0===window?void 0:window.Zone)||void 0===n?void 0:n.__symbol__)||void 0===o?void 0:o.call(n,"MutationObserver");a&&window[a]&&(i=window[a]);const s=new i(r.processMutations.bind(r));return s.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),s}function En({scrollCb:e,doc:t,mirror:n,blockClass:o,blockSelector:r,sampling:i}){return Gt("scroll",jt(i=>{const a=kn(i);if(!a||Jt(a,o,r,!0))return;const s=n.getId(a);if(a===t){const n=t.scrollingElement||t.documentElement;e({id:s,x:n.scrollLeft,y:n.scrollTop})}else e({id:s,x:a.scrollLeft,y:a.scrollTop})},i.scroll||100),t)}function Mn(e,t){const n=Object.assign({},e);return t||delete n.userTriggered,n}const Tn=["INPUT","TEXTAREA","SELECT"],Rn=new WeakMap;function _n(e){return function(e,t){if(bn&&e.parentRule instanceof CSSGroupingRule||Sn&&e.parentRule instanceof CSSMediaRule||Cn&&e.parentRule instanceof CSSSupportsRule||In&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function xn(e,t,n){let o,r;return e?(e.ownerNode?o=t.getId(e.ownerNode):r=n.getId(e),{styleId:r,id:o}):{}}function Dn({mirror:e,stylesheetManager:t},n){var o,r,i;let a=null;a="#document"===n.nodeName?e.getId(n):e.getId(n.host);const s="#document"===n.nodeName?null===(o=n.defaultView)||void 0===o?void 0:o.Document:null===(i=null===(r=n.ownerDocument)||void 0===r?void 0:r.defaultView)||void 0===i?void 0:i.ShadowRoot,c=Object.getOwnPropertyDescriptor(null==s?void 0:s.prototype,"adoptedStyleSheets");return null!==a&&-1!==a&&s&&c?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null===(e=c.get)||void 0===e?void 0:e.call(this)},set(e){var n;const o=null===(n=c.set)||void 0===n?void 0:n.call(this,e);if(null!==a&&-1!==a)try{t.adoptStyleSheets(e,a)}catch(e){}return o}}),()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})}):()=>{}}class On{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,o){const r=n||this.getIdToRemoteIdMap(e),i=o||this.getRemoteIdToIdMap(e);let a=r.get(t);return a||(a=this.generateIdFn(),r.set(t,a),i.set(a,t)),a}getIds(e,t){const n=this.getIdToRemoteIdMap(e),o=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,o))}getRemoteId(e,t,n){const o=n||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:o.get(t)||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}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 Nn{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new On(Rt),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new On(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 n;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),null===(n=this.loadListener)||void 0===n||n.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){if("rrweb"===e.data.type){if(!e.source)return;const t=this.crossOriginIframeMap.get(e.source);if(!t)return;const n=this.transformCrossOriginEvent(t,e.data.event);n&&this.wrappedEmit(n,e.data.isCheckout)}}transformCrossOriginEvent(e,t){var n;switch(t.type){case an.FullSnapshot:return this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e),{timestamp:t.timestamp,type:an.IncrementalSnapshot,data:{source:sn.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}};case an.Meta:case an.Load:case an.DomContentLoaded:return!1;case an.Plugin:return t;case an.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case an.IncrementalSnapshot:switch(t.data.source){case sn.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e)}),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 sn.Drag:case sn.TouchMove:case sn.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case sn.ViewportResize:return!1;case sn.MediaInteraction:case sn.MouseInteraction:case sn.Scroll:case sn.CanvasMutation:case sn.Input:return this.replaceIds(t.data,e,["id"]),t;case sn.StyleSheetRule:case sn.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case sn.Font:return t;case sn.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case sn.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null===(n=t.data.styles)||void 0===n||n.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}}replace(e,t,n,o){for(const r of o)(Array.isArray(t[r])||"number"==typeof t[r])&&(Array.isArray(t[r])?t[r]=e.getIds(n,t[r]):t[r]=e.getId(n,t[r]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id"]),"childNodes"in e&&e.childNodes.forEach(e=>{this.replaceIdOnNode(e,t)})}}class Fn{constructor(e){this.shadowDoms=new WeakSet,this.restorePatches=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror;const t=this;this.restorePatches.push(Kt(Element.prototype,"attachShadow",function(e){return function(n){const o=e.call(this,n);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,this.ownerDocument),o}}))}addShadowRoot(e,t){wt(e)&&(this.shadowDoms.has(e)||(this.shadowDoms.add(e),An(Object.assign(Object.assign({},this.bypassOptions),{doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this}),e),En(Object.assign(Object.assign({},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(e.host)),Dn({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e)},0)))}observeAttachShadow(e){if(e.contentWindow){const t=this;this.restorePatches.push(Kt(e.contentWindow.HTMLElement.prototype,"attachShadow",function(n){return function(o){const r=n.call(this,o);return this.shadowRoot&&t.addShadowRoot(this.shadowRoot,e.contentDocument),r}}))}}reset(){this.restorePatches.forEach(e=>e()),this.shadowDoms=new WeakSet}}for(var Ln="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Bn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Pn=0;Pn<64;Pn++)Bn[Ln.charCodeAt(Pn)]=Pn;const Un=new Map,Wn=(e,t,n)=>{if(!e||!Gn(e,t)&&"object"!=typeof e)return;const o=function(e,t){let n=Un.get(e);return n||(n=new Map,Un.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let r=o.indexOf(e);return-1===r&&(r=o.length,o.push(e)),r};function Vn(e,t,n){if(e instanceof Array)return e.map(e=>Vn(e,t,n));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){const t=e.constructor.name,n=function(e){var t,n=new Uint8Array(e),o=n.length,r="";for(t=0;t<o;t+=3)r+=Ln[n[t]>>2],r+=Ln[(3&n[t])<<4|n[t+1]>>4],r+=Ln[(15&n[t+1])<<2|n[t+2]>>6],r+=Ln[63&n[t+2]];return o%3==2?r=r.substring(0,r.length-1)+"=":o%3==1&&(r=r.substring(0,r.length-2)+"=="),r}(e);return{rr_type:t,base64:n}}if(e instanceof DataView)return{rr_type:e.constructor.name,args:[Vn(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[Vn(e.data,t,n),e.width,e.height]}:Gn(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:Wn(e,t,n)}:e}const Zn=(e,t,n)=>[...e].map(e=>Vn(e,t,n)),Gn=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(n.find(n=>e instanceof t[n]))};function zn(e,t,n){const o=[];try{const r=Kt(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(o,...r){return Jt(this,t,n,!0)||"__context"in this||(this.__context=o),e.apply(this,[o,...r])}});o.push(r)}catch(e){console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach(e=>e())}}function Hn(e,t,n,o,r,i,a){const s=[],c=Object.getOwnPropertyNames(e);for(const i of c)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(i))try{if("function"!=typeof e[i])continue;const c=Kt(e,i,function(e){return function(...s){const c=e.apply(this,s);if(Wn(c,a,this),!Jt(this.canvas,o,r,!0)){const e=Zn([...s],a,this),o={type:t,property:i,args:e};n(this.canvas,o)}return c}});s.push(c)}catch(o){const r=qt(e,i,{set(e){n(this.canvas,{type:t,property:i,args:[e],setter:!0})}});s.push(r)}return s}var jn=null;try{var qn="undefined"!=typeof module&&"function"==typeof module.require&&module.require("worker_threads")||"function"==typeof __non_webpack_require__&&__non_webpack_require__("worker_threads")||"function"==typeof require&&require("worker_threads");jn=qn.Worker}catch(e){}var Kn,Xn=(Kn="Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwooZnVuY3Rpb24gKCkgewogICAgJ3VzZSBzdHJpY3QnOwoKICAgIC8qISAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKg0KICAgIENvcHlyaWdodCAoYykgTWljcm9zb2Z0IENvcnBvcmF0aW9uLg0KDQogICAgUGVybWlzc2lvbiB0byB1c2UsIGNvcHksIG1vZGlmeSwgYW5kL29yIGRpc3RyaWJ1dGUgdGhpcyBzb2Z0d2FyZSBmb3IgYW55DQogICAgcHVycG9zZSB3aXRoIG9yIHdpdGhvdXQgZmVlIGlzIGhlcmVieSBncmFudGVkLg0KDQogICAgVEhFIFNPRlRXQVJFIElTIFBST1ZJREVEICJBUyBJUyIgQU5EIFRIRSBBVVRIT1IgRElTQ0xBSU1TIEFMTCBXQVJSQU5USUVTIFdJVEgNCiAgICBSRUdBUkQgVE8gVEhJUyBTT0ZUV0FSRSBJTkNMVURJTkcgQUxMIElNUExJRUQgV0FSUkFOVElFUyBPRiBNRVJDSEFOVEFCSUxJVFkNCiAgICBBTkQgRklUTkVTUy4gSU4gTk8gRVZFTlQgU0hBTEwgVEhFIEFVVEhPUiBCRSBMSUFCTEUgRk9SIEFOWSBTUEVDSUFMLCBESVJFQ1QsDQogICAgSU5ESVJFQ1QsIE9SIENPTlNFUVVFTlRJQUwgREFNQUdFUyBPUiBBTlkgREFNQUdFUyBXSEFUU09FVkVSIFJFU1VMVElORyBGUk9NDQogICAgTE9TUyBPRiBVU0UsIERBVEEgT1IgUFJPRklUUywgV0hFVEhFUiBJTiBBTiBBQ1RJT04gT0YgQ09OVFJBQ1QsIE5FR0xJR0VOQ0UgT1INCiAgICBPVEhFUiBUT1JUSU9VUyBBQ1RJT04sIEFSSVNJTkcgT1VUIE9GIE9SIElOIENPTk5FQ1RJT04gV0lUSCBUSEUgVVNFIE9SDQogICAgUEVSRk9STUFOQ0UgT0YgVEhJUyBTT0ZUV0FSRS4NCiAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAqLw0KDQogICAgZnVuY3Rpb24gX19hd2FpdGVyKHRoaXNBcmcsIF9hcmd1bWVudHMsIFAsIGdlbmVyYXRvcikgew0KICAgICAgICBmdW5jdGlvbiBhZG9wdCh2YWx1ZSkgeyByZXR1cm4gdmFsdWUgaW5zdGFuY2VvZiBQID8gdmFsdWUgOiBuZXcgUChmdW5jdGlvbiAocmVzb2x2ZSkgeyByZXNvbHZlKHZhbHVlKTsgfSk7IH0NCiAgICAgICAgcmV0dXJuIG5ldyAoUCB8fCAoUCA9IFByb21pc2UpKShmdW5jdGlvbiAocmVzb2x2ZSwgcmVqZWN0KSB7DQogICAgICAgICAgICBmdW5jdGlvbiBmdWxmaWxsZWQodmFsdWUpIHsgdHJ5IHsgc3RlcChnZW5lcmF0b3IubmV4dCh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiByZWplY3RlZCh2YWx1ZSkgeyB0cnkgeyBzdGVwKGdlbmVyYXRvclsidGhyb3ciXSh2YWx1ZSkpOyB9IGNhdGNoIChlKSB7IHJlamVjdChlKTsgfSB9DQogICAgICAgICAgICBmdW5jdGlvbiBzdGVwKHJlc3VsdCkgeyByZXN1bHQuZG9uZSA/IHJlc29sdmUocmVzdWx0LnZhbHVlKSA6IGFkb3B0KHJlc3VsdC52YWx1ZSkudGhlbihmdWxmaWxsZWQsIHJlamVjdGVkKTsgfQ0KICAgICAgICAgICAgc3RlcCgoZ2VuZXJhdG9yID0gZ2VuZXJhdG9yLmFwcGx5KHRoaXNBcmcsIF9hcmd1bWVudHMgfHwgW10pKS5uZXh0KCkpOw0KICAgICAgICB9KTsNCiAgICB9CgogICAgLyoKICAgICAqIGJhc2U2NC1hcnJheWJ1ZmZlciAxLjAuMSA8aHR0cHM6Ly9naXRodWIuY29tL25pa2xhc3ZoL2Jhc2U2NC1hcnJheWJ1ZmZlcj4KICAgICAqIENvcHlyaWdodCAoYykgMjAyMSBOaWtsYXMgdm9uIEhlcnR6ZW4gPGh0dHBzOi8vaGVydHplbi5jb20+CiAgICAgKiBSZWxlYXNlZCB1bmRlciBNSVQgTGljZW5zZQogICAgICovCiAgICB2YXIgY2hhcnMgPSAnQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyc7CiAgICAvLyBVc2UgYSBsb29rdXAgdGFibGUgdG8gZmluZCB0aGUgaW5kZXguCiAgICB2YXIgbG9va3VwID0gdHlwZW9mIFVpbnQ4QXJyYXkgPT09ICd1bmRlZmluZWQnID8gW10gOiBuZXcgVWludDhBcnJheSgyNTYpOwogICAgZm9yICh2YXIgaSA9IDA7IGkgPCBjaGFycy5sZW5ndGg7IGkrKykgewogICAgICAgIGxvb2t1cFtjaGFycy5jaGFyQ29kZUF0KGkpXSA9IGk7CiAgICB9CiAgICB2YXIgZW5jb2RlID0gZnVuY3Rpb24gKGFycmF5YnVmZmVyKSB7CiAgICAgICAgdmFyIGJ5dGVzID0gbmV3IFVpbnQ4QXJyYXkoYXJyYXlidWZmZXIpLCBpLCBsZW4gPSBieXRlcy5sZW5ndGgsIGJhc2U2NCA9ICcnOwogICAgICAgIGZvciAoaSA9IDA7IGkgPCBsZW47IGkgKz0gMykgewogICAgICAgICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaV0gPj4gMl07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1soKGJ5dGVzW2ldICYgMykgPDwgNCkgfCAoYnl0ZXNbaSArIDFdID4+IDQpXTsKICAgICAgICAgICAgYmFzZTY0ICs9IGNoYXJzWygoYnl0ZXNbaSArIDFdICYgMTUpIDw8IDIpIHwgKGJ5dGVzW2kgKyAyXSA+PiA2KV07CiAgICAgICAgICAgIGJhc2U2NCArPSBjaGFyc1tieXRlc1tpICsgMl0gJiA2M107CiAgICAgICAgfQogICAgICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgJz0nOwogICAgICAgIH0KICAgICAgICBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgICAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgJz09JzsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIGJhc2U2NDsKICAgIH07CgogICAgY29uc3QgbGFzdEJsb2JNYXAgPSBuZXcgTWFwKCk7DQogICAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gbmV3IE1hcCgpOw0KICAgIGZ1bmN0aW9uIGdldFRyYW5zcGFyZW50QmxvYkZvcih3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucykgew0KICAgICAgICByZXR1cm4gX19hd2FpdGVyKHRoaXMsIHZvaWQgMCwgdm9pZCAwLCBmdW5jdGlvbiogKCkgew0KICAgICAgICAgICAgY29uc3QgaWQgPSBgJHt3aWR0aH0tJHtoZWlnaHR9YDsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgaWYgKHRyYW5zcGFyZW50QmxvYk1hcC5oYXMoaWQpKQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJhbnNwYXJlbnRCbG9iTWFwLmdldChpZCk7DQogICAgICAgICAgICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsNCiAgICAgICAgICAgICAgICBvZmZzY3JlZW4uZ2V0Q29udGV4dCgnMmQnKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0geWllbGQgYmxvYi5hcnJheUJ1ZmZlcigpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7DQogICAgICAgICAgICAgICAgdHJhbnNwYXJlbnRCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICByZXR1cm4gYmFzZTY0Ow0KICAgICAgICAgICAgfQ0KICAgICAgICAgICAgZWxzZSB7DQogICAgICAgICAgICAgICAgcmV0dXJuICcnOw0KICAgICAgICAgICAgfQ0KICAgICAgICB9KTsNCiAgICB9DQogICAgY29uc3Qgd29ya2VyID0gc2VsZjsNCiAgICB3b3JrZXIub25tZXNzYWdlID0gZnVuY3Rpb24gKGUpIHsNCiAgICAgICAgcmV0dXJuIF9fYXdhaXRlcih0aGlzLCB2b2lkIDAsIHZvaWQgMCwgZnVuY3Rpb24qICgpIHsNCiAgICAgICAgICAgIGlmICgnT2Zmc2NyZWVuQ2FudmFzJyBpbiBnbG9iYWxUaGlzKSB7DQogICAgICAgICAgICAgICAgY29uc3QgeyBpZCwgYml0bWFwLCB3aWR0aCwgaGVpZ2h0LCBkYXRhVVJMT3B0aW9ucyB9ID0gZS5kYXRhOw0KICAgICAgICAgICAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zKTsNCiAgICAgICAgICAgICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOw0KICAgICAgICAgICAgICAgIGNvbnN0IGN0eCA9IG9mZnNjcmVlbi5nZXRDb250ZXh0KCcyZCcpOw0KICAgICAgICAgICAgICAgIGN0eC5kcmF3SW1hZ2UoYml0bWFwLCAwLCAwKTsNCiAgICAgICAgICAgICAgICBiaXRtYXAuY2xvc2UoKTsNCiAgICAgICAgICAgICAgICBjb25zdCBibG9iID0geWllbGQgb2Zmc2NyZWVuLmNvbnZlcnRUb0Jsb2IoZGF0YVVSTE9wdGlvbnMpOw0KICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBibG9iLnR5cGU7DQogICAgICAgICAgICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSB5aWVsZCBibG9iLmFycmF5QnVmZmVyKCk7DQogICAgICAgICAgICAgICAgY29uc3QgYmFzZTY0ID0gZW5jb2RlKGFycmF5QnVmZmVyKTsNCiAgICAgICAgICAgICAgICBpZiAoIWxhc3RCbG9iTWFwLmhhcyhpZCkgJiYgKHlpZWxkIHRyYW5zcGFyZW50QmFzZTY0KSA9PT0gYmFzZTY0KSB7DQogICAgICAgICAgICAgICAgICAgIGxhc3RCbG9iTWFwLnNldChpZCwgYmFzZTY0KTsNCiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHdvcmtlci5wb3N0TWVzc2FnZSh7IGlkIH0pOw0KICAgICAgICAgICAgICAgIH0NCiAgICAgICAgICAgICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KQ0KICAgICAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7DQogICAgICAgICAgICAgICAgd29ya2VyLnBvc3RNZXNzYWdlKHsNCiAgICAgICAgICAgICAgICAgICAgaWQsDQogICAgICAgICAgICAgICAgICAgIHR5cGUsDQogICAgICAgICAgICAgICAgICAgIGJhc2U2NCwNCiAgICAgICAgICAgICAgICAgICAgd2lkdGgsDQogICAgICAgICAgICAgICAgICAgIGhlaWdodCwNCiAgICAgICAgICAgICAgICB9KTsNCiAgICAgICAgICAgICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7DQogICAgICAgICAgICB9DQogICAgICAgICAgICBlbHNlIHsNCiAgICAgICAgICAgICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsNCiAgICAgICAgICAgIH0NCiAgICAgICAgfSk7DQogICAgfTsKCn0pKCk7Cgo=","[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)?function(e){var t=function(e){return Buffer.from(e,"base64").toString("utf8")}(e),n=t.indexOf("\n",10)+1,o=t.substring(n)+"";return function(e){return new jn(o,Object.assign({},e,{eval:!0}))}}(Kn):function(e){var t;return function(n){return t=t||function(e){var t=function(e){return atob(e)}(e),n=t.indexOf("\n",10)+1,o=t.substring(n)+"",r=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(r)}(e),new Worker(t,n)}}(Kn));class Yn{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,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:n,blockClass:o,blockSelector:r,recordCanvas:i,dataURLOptions:a}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(n,o,r),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,o,r,{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,n,o,r){const i=zn(t,n,o),a=new Map,s=new Xn;s.onmessage=e=>{const{id:t}=e.data;if(a.set(t,!1),!("base64"in e.data))return;const{base64:n,type:o,width:r,height:i}=e.data;this.mutationCb({id:t,type:ln["2D"],commands:[{property:"clearRect",args:[0,0,r,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:o}]},0,0]}]})};const c=1e3/e;let l,d=0;const u=e=>{d&&e-d<c||(d=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{Jt(t,n,o,!0)||e.push(t)}),e})().forEach(e=>{return t=this,o=function*(){var t;const n=this.mirror.getId(e);if(a.get(n))return;if(a.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null===(t=null==n?void 0:n.getContextAttributes())||void 0===t?void 0:t.preserveDrawingBuffer)&&(null==n||n.clear(n.COLOR_BUFFER_BIT))}const o=yield createImageBitmap(e);s.postMessage({id:n,bitmap:o,width:e.width,height:e.height,dataURLOptions:r.dataURLOptions},[o])},new((n=void 0)||(n=Promise))(function(e,r){function i(e){try{s(o.next(e))}catch(e){r(e)}}function a(e){try{s(o.throw(e))}catch(e){r(e)}}function s(t){var o;t.done?e(t.value):(o=t.value,o instanceof n?o:new n(function(e){e(o)})).then(i,a)}s((o=o.apply(t,[])).next())});var t,n,o})),l=requestAnimationFrame(u)};l=requestAnimationFrame(u),this.resetObservers=()=>{i(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const o=zn(e,t,n),r=function(e,t,n,o){const r=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[a])continue;const i=Kt(t.CanvasRenderingContext2D.prototype,a,function(r){return function(...i){return Jt(this.canvas,n,o,!0)||setTimeout(()=>{const n=Zn([...i],t,this);e(this.canvas,{type:ln["2D"],property:a,args:n})},0),r.apply(this,i)}});r.push(i)}catch(n){const o=qt(t.CanvasRenderingContext2D.prototype,a,{set(t){e(this.canvas,{type:ln["2D"],property:a,args:[t],setter:!0})}});r.push(o)}return()=>{r.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n),i=function(e,t,n,o){const r=[];return r.push(...Hn(t.WebGLRenderingContext.prototype,ln.WebGL,e,n,o,0,t)),void 0!==t.WebGL2RenderingContext&&r.push(...Hn(t.WebGL2RenderingContext.prototype,ln.WebGL2,e,n,o,0,t)),()=>{r.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n,this.mirror);this.resetObservers=()=>{o(),r(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const o=n.map(e=>{const t=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}(e,["type"]);return t}),{type:r}=n[0];this.mutationCb({id:t,type:r,commands:o}),this.pendingCanvasMutations.delete(e)}}class Jn{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new rn,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 n={id:t,styleIds:[]},o=[];for(const t of e){let e;if(this.styleMirror.has(t))e=this.styleMirror.getId(t);else{e=this.styleMirror.add(t);const n=Array.from(t.rules||CSSRule);o.push({styleId:e,rules:n.map((e,t)=>({rule:St(e),index:t}))})}n.styleIds.push(e)}o.length>0&&(n.styles=o),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}function Qn(e){return Object.assign(Object.assign({},e),{timestamp:Date.now()})}let $n,eo,to,no=!1;const oo=new Ct;function ro(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:o,blockClass:r="rr-block",blockSelector:i=null,ignoreClass:a="rr-ignore",maskTextClass:s="rr-mask",maskTextSelector:c=null,inlineStylesheet:l=!0,maskAllInputs:d,maskInputOptions:u,slimDOMOptions:h,maskInputFn:m,maskTextFn:g,hooks:p,packFn:f,sampling:y={},dataURLOptions:v={},mousemoveWait:w,recordCanvas:b=!1,recordCrossOriginIframes:S=!1,userTriggeredOnInput:C=!1,collectFonts:I=!1,inlineImages:k=!1,plugins:A,keepIframeSrcFn:E=()=>!1,ignoreCSSAttributes:M=new Set([])}=e,T=!S||window.parent===window;let R=!1;if(!T)try{window.parent.document,R=!1}catch(e){R=!0}if(T&&!t)throw new Error("emit function is required");void 0!==w&&void 0===y.mousemove&&(y.mousemove=w),oo.reset();const _=!0===d?{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!==u?u:{password:!0},x=!0===h||"all"===h?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===h,headMetaDescKeywords:"all"===h}:h||{};let D;!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),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let O=0;const N=e=>{for(const t of A||[])t.eventProcessor&&(e=t.eventProcessor(e));return f&&(e=f(e)),e};$n=(e,r)=>{var i;if(!(null===(i=wn[0])||void 0===i?void 0:i.isFrozen())||e.type===an.FullSnapshot||e.type===an.IncrementalSnapshot&&e.data.source===sn.Mutation||wn.forEach(e=>e.unfreeze()),T)null==t||t(N(e),r);else if(R){const t={type:"rrweb",event:N(e),isCheckout:r};window.parent.postMessage(t,"*")}if(e.type===an.FullSnapshot)D=e,O=0;else if(e.type===an.IncrementalSnapshot){if(e.data.source===sn.Mutation&&e.data.isAttachIframe)return;O++;const t=o&&O>=o,r=n&&e.timestamp-D.timestamp>n;(t||r)&&eo(!0)}};const F=e=>{$n(Qn({type:an.IncrementalSnapshot,data:Object.assign({source:sn.Mutation},e)}))},L=e=>$n(Qn({type:an.IncrementalSnapshot,data:Object.assign({source:sn.Scroll},e)})),B=e=>$n(Qn({type:an.IncrementalSnapshot,data:Object.assign({source:sn.CanvasMutation},e)})),P=new Jn({mutationCb:F,adoptedStyleSheetCb:e=>$n(Qn({type:an.IncrementalSnapshot,data:Object.assign({source:sn.AdoptedStyleSheet},e)}))}),U=new Nn({mirror:oo,mutationCb:F,stylesheetManager:P,recordCrossOriginIframes:S,wrappedEmit:$n});for(const e of A||[])e.getMirror&&e.getMirror({nodeMirror:oo,crossOriginIframeMirror:U.crossOriginIframeMirror,crossOriginIframeStyleMirror:U.crossOriginIframeStyleMirror});to=new Yn({recordCanvas:b,mutationCb:B,win:window,blockClass:r,blockSelector:i,mirror:oo,sampling:y.canvas,dataURLOptions:v});const W=new Fn({mutationCb:F,scrollCb:L,bypassOptions:{blockClass:r,blockSelector:i,maskTextClass:s,maskTextSelector:c,inlineStylesheet:l,maskInputOptions:_,dataURLOptions:v,maskTextFn:g,maskInputFn:m,recordCanvas:b,inlineImages:k,sampling:y,slimDOMOptions:x,iframeManager:U,stylesheetManager:P,canvasManager:to,keepIframeSrcFn:E},mirror:oo});eo=(e=!1)=>{var t,n,o,a,d,u;$n(Qn({type:an.Meta,data:{href:window.location.href,width:Yt(),height:Xt()}}),e),P.reset(),wn.forEach(e=>e.lock());const h=function(e,t){var n=t||{},o=n.mirror,r=void 0===o?new Ct:o,i=n.blockClass,a=n.blockSelector,s=n.maskTextClass,c=n.maskTextSelector,l=n.inlineStylesheet,d=n.inlineImages,u=n.recordCanvas,h=n.maskAllInputs,m=void 0!==h&&h,g=n.slimDOM,p=void 0!==g&&g,f=n.keepIframeSrcFn;return Zt(e,{doc:e,mirror:r,blockClass:void 0===i?"rr-block":i,blockSelector:void 0===a?null:a,maskTextClass:void 0===s?"rr-mask":s,maskTextSelector:void 0===c?null:c,skipChild:!1,inlineStylesheet:void 0===l||l,maskInputOptions:!0===m?{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===m?{password:!0}:m,maskTextFn:n.maskTextFn,maskInputFn:n.maskInputFn,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:n.dataURLOptions,inlineImages:void 0!==d&&d,recordCanvas:void 0!==u&&u,preserveWhiteSpace:n.preserveWhiteSpace,onSerialize:n.onSerialize,onIframeLoad:n.onIframeLoad,iframeLoadTimeout:n.iframeLoadTimeout,onStylesheetLoad:n.onStylesheetLoad,stylesheetLoadTimeout:n.stylesheetLoadTimeout,keepIframeSrcFn:void 0===f?function(){return!1}:f,newlyAddedElement:!1})}(document,{mirror:oo,blockClass:r,blockSelector:i,maskTextClass:s,maskTextSelector:c,inlineStylesheet:l,maskAllInputs:_,maskTextFn:g,slimDOM:x,dataURLOptions:v,recordCanvas:b,inlineImages:k,onSerialize:e=>{tn(e,oo)&&U.addIframe(e),nn(e,oo)&&P.trackLinkElement(e),on(e)&&W.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{U.attachIframe(e,t),W.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{P.attachLinkElement(e,t)},keepIframeSrcFn:E});if(!h)return console.warn("Failed to snapshot the document");$n(Qn({type:an.FullSnapshot,data:{node:h,initialOffset:{left:void 0!==window.pageXOffset?window.pageXOffset:(null===document||void 0===document?void 0:document.documentElement.scrollLeft)||(null===(n=null===(t=null===document||void 0===document?void 0:document.body)||void 0===t?void 0:t.parentElement)||void 0===n?void 0:n.scrollLeft)||(null===(o=null===document||void 0===document?void 0:document.body)||void 0===o?void 0:o.scrollLeft)||0,top:void 0!==window.pageYOffset?window.pageYOffset:(null===document||void 0===document?void 0:document.documentElement.scrollTop)||(null===(d=null===(a=null===document||void 0===document?void 0:document.body)||void 0===a?void 0:a.parentElement)||void 0===d?void 0:d.scrollTop)||(null===(u=null===document||void 0===document?void 0:document.body)||void 0===u?void 0:u.scrollTop)||0}}})),wn.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&P.adoptStyleSheets(document.adoptedStyleSheets,oo.getId(document))};try{const e=[];e.push(Gt("DOMContentLoaded",()=>{$n(Qn({type:an.DomContentLoaded,data:{}}))}));const t=e=>{var t;return function(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};!function(e,t){const{mutationCb:n,mousemoveCb:o,mouseInteractionCb:r,scrollCb:i,viewportResizeCb:a,inputCb:s,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:d,canvasMutationCb:u,fontCb:h,selectionCb:m}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),o(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),r(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),i(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),a(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),s(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),l(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),d(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),u(...e)},e.fontCb=(...e)=>{t.font&&t.font(...e),h(...e)},e.selectionCb=(...e)=>{t.selection&&t.selection(...e),m(...e)}}(e,t);const o=An(e,e.doc),r=function({mousemoveCb:e,sampling:t,doc:n,mirror:o}){if(!1===t.mousemove)return()=>{};const r="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let a,s=[];const c=jt(t=>{const n=Date.now()-a;e(s.map(e=>(e.timeOffset-=n,e)),t),s=[],a=null},i),l=jt(e=>{const t=kn(e),{clientX:n,clientY:r}=en(e)?e.changedTouches[0]:e;a||(a=Date.now()),s.push({x:n,y:r,id:o.getId(t),timeOffset:Date.now()-a}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?sn.Drag:e instanceof MouseEvent?sn.MouseMove:sn.TouchMove)},r,{trailing:!1}),d=[Gt("mousemove",l,n),Gt("touchmove",l,n),Gt("drag",l,n)];return()=>{d.forEach(e=>e())}}(e),i=function({mouseInteractionCb:e,doc:t,mirror:n,blockClass:o,blockSelector:r,sampling:i}){if(!1===i.mouseInteraction)return()=>{};const a=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,s=[];return Object.keys(cn).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]).forEach(i=>{const a=i.toLowerCase(),c=(t=>i=>{const a=kn(i);if(Jt(a,o,r,!0))return;const s=en(i)?i.changedTouches[0]:i;if(!s)return;const c=n.getId(a),{clientX:l,clientY:d}=s;e({type:cn[t],id:c,x:l,y:d})})(i);s.push(Gt(a,c,t))}),()=>{s.forEach(e=>e())}}(e),a=En(e),s=function({viewportResizeCb:e}){let t=-1,n=-1;return Gt("resize",jt(()=>{const o=Xt(),r=Yt();t===o&&n===r||(e({width:Number(r),height:Number(o)}),t=o,n=r)},200),window)}(e),c=function({inputCb:e,doc:t,mirror:n,blockClass:o,blockSelector:r,ignoreClass:i,maskInputOptions:a,maskInputFn:s,sampling:c,userTriggeredOnInput:l}){function d(e){let n=kn(e);const c=e.isTrusted;if(n&&"OPTION"===n.tagName&&(n=n.parentElement),!n||!n.tagName||Tn.indexOf(n.tagName)<0||Jt(n,o,r,!0))return;const d=n.type;if(n.classList.contains(i))return;let h=n.value,m=!1;"radio"===d||"checkbox"===d?m=n.checked:(a[n.tagName.toLowerCase()]||a[d])&&(h=It({maskInputOptions:a,tagName:n.tagName,type:d,value:h,maskInputFn:s})),u(n,Mn({text:h,isChecked:m,userTriggered:c},l));const g=n.name;"radio"===d&&g&&m&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{e!==n&&u(e,Mn({text:e.value,isChecked:!m,userTriggered:!1},l))})}function u(t,o){const r=Rn.get(t);if(!r||r.text!==o.text||r.isChecked!==o.isChecked){Rn.set(t,o);const r=n.getId(t);e(Object.assign(Object.assign({},o),{id:r}))}}const h=("last"===c.input?["change"]:["input","change"]).map(e=>Gt(e,d,t)),m=t.defaultView;if(!m)return()=>{h.forEach(e=>e())};const g=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),p=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return g&&g.set&&h.push(...p.map(e=>qt(e[0],e[1],{set(){d({target:this})}},!1,m))),()=>{h.forEach(e=>e())}}(e),l=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:o,sampling:r}){const i=i=>jt(r=>{const a=kn(r);if(!a||Jt(a,t,n,!0))return;const{currentTime:s,volume:c,muted:l,playbackRate:d}=a;e({type:i,id:o.getId(a),currentTime:s,volume:c,muted:l,playbackRate:d})},r.media||500),a=[Gt("play",i(0)),Gt("pause",i(1)),Gt("seeked",i(2)),Gt("volumechange",i(3)),Gt("ratechange",i(4))];return()=>{a.forEach(e=>e())}}(e),d=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:o}){const r=o.CSSStyleSheet.prototype.insertRule;o.CSSStyleSheet.prototype.insertRule=function(o,i){const{id:a,styleId:s}=xn(this,t,n.styleMirror);return(a&&-1!==a||s&&-1!==s)&&e({id:a,styleId:s,adds:[{rule:o,index:i}]}),r.apply(this,[o,i])};const i=o.CSSStyleSheet.prototype.deleteRule;let a,s;o.CSSStyleSheet.prototype.deleteRule=function(o){const{id:r,styleId:a}=xn(this,t,n.styleMirror);return(r&&-1!==r||a&&-1!==a)&&e({id:r,styleId:a,removes:[{index:o}]}),i.apply(this,[o])},o.CSSStyleSheet.prototype.replace&&(a=o.CSSStyleSheet.prototype.replace,o.CSSStyleSheet.prototype.replace=function(o){const{id:r,styleId:i}=xn(this,t,n.styleMirror);return(r&&-1!==r||i&&-1!==i)&&e({id:r,styleId:i,replace:o}),a.apply(this,[o])}),o.CSSStyleSheet.prototype.replaceSync&&(s=o.CSSStyleSheet.prototype.replaceSync,o.CSSStyleSheet.prototype.replaceSync=function(o){const{id:r,styleId:i}=xn(this,t,n.styleMirror);return(r&&-1!==r||i&&-1!==i)&&e({id:r,styleId:i,replaceSync:o}),s.apply(this,[o])});const c={};bn?c.CSSGroupingRule=o.CSSGroupingRule:(Sn&&(c.CSSMediaRule=o.CSSMediaRule),In&&(c.CSSConditionRule=o.CSSConditionRule),Cn&&(c.CSSSupportsRule=o.CSSSupportsRule));const l={};return Object.entries(c).forEach(([o,r])=>{l[o]={insertRule:r.prototype.insertRule,deleteRule:r.prototype.deleteRule},r.prototype.insertRule=function(r,i){const{id:a,styleId:s}=xn(this.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||s&&-1!==s)&&e({id:a,styleId:s,adds:[{rule:r,index:[..._n(this),i||0]}]}),l[o].insertRule.apply(this,[r,i])},r.prototype.deleteRule=function(r){const{id:i,styleId:a}=xn(this.parentStyleSheet,t,n.styleMirror);return(i&&-1!==i||a&&-1!==a)&&e({id:i,styleId:a,removes:[{index:[..._n(this),r]}]}),l[o].deleteRule.apply(this,[r])}}),()=>{o.CSSStyleSheet.prototype.insertRule=r,o.CSSStyleSheet.prototype.deleteRule=i,a&&(o.CSSStyleSheet.prototype.replace=a),s&&(o.CSSStyleSheet.prototype.replaceSync=s),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})}}(e,{win:n}),u=Dn(e,e.doc),h=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:o},{win:r}){const i=r.CSSStyleDeclaration.prototype.setProperty;r.CSSStyleDeclaration.prototype.setProperty=function(r,a,s){var c;if(n.has(r))return i.apply(this,[r,a,s]);const{id:l,styleId:d}=xn(null===(c=this.parentRule)||void 0===c?void 0:c.parentStyleSheet,t,o.styleMirror);return(l&&-1!==l||d&&-1!==d)&&e({id:l,styleId:d,set:{property:r,value:a,priority:s},index:_n(this.parentRule)}),i.apply(this,[r,a,s])};const a=r.CSSStyleDeclaration.prototype.removeProperty;return r.CSSStyleDeclaration.prototype.removeProperty=function(r){var i;if(n.has(r))return a.apply(this,[r]);const{id:s,styleId:c}=xn(null===(i=this.parentRule)||void 0===i?void 0:i.parentStyleSheet,t,o.styleMirror);return(s&&-1!==s||c&&-1!==c)&&e({id:s,styleId:c,remove:{property:r},index:_n(this.parentRule)}),a.apply(this,[r])},()=>{r.CSSStyleDeclaration.prototype.setProperty=i,r.CSSStyleDeclaration.prototype.removeProperty=a}}(e,{win:n}),m=e.collectFonts?function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const o=[],r=new WeakMap,i=n.FontFace;n.FontFace=function(e,t,n){const o=new i(e,t,n);return r.set(o,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),o};const a=Kt(t.fonts,"add",function(t){return function(n){return setTimeout(()=>{const t=r.get(n);t&&(e(t),r.delete(n))},0),t.apply(this,[n])}});return o.push(()=>{n.FontFace=i}),o.push(a),()=>{o.forEach(e=>e())}}(e):()=>{},g=function(e){const{doc:t,mirror:n,blockClass:o,blockSelector:r,selectionCb:i}=e;let a=!0;const s=()=>{const e=t.getSelection();if(!e||a&&(null==e?void 0:e.isCollapsed))return;a=e.isCollapsed||!1;const s=[],c=e.rangeCount||0;for(let t=0;t<c;t++){const i=e.getRangeAt(t),{startContainer:a,startOffset:c,endContainer:l,endOffset:d}=i;Jt(a,o,r,!0)||Jt(l,o,r,!0)||s.push({start:n.getId(a),startOffset:c,end:n.getId(l),endOffset:d})}i({ranges:s})};return s(),Gt("selectionchange",s)}(e),p=[];for(const t of e.plugins)p.push(t.observer(t.callback,n,t.options));return()=>{wn.forEach(e=>e.reset()),o.disconnect(),r(),i(),a(),s(),c(),l(),d(),u(),h(),m(),g(),p.forEach(e=>e())}}({mutationCb:F,mousemoveCb:(e,t)=>$n(Qn({type:an.IncrementalSnapshot,data:{source:t,positions:e}})),mouseInteractionCb:e=>$n(Qn({type:an.IncrementalSnapshot,data:Object.assign({source:sn.MouseInteraction},e)})),scrollCb:L,viewportResizeCb:e=>$n(Qn({type:an.IncrementalSnapshot,data:Object.assign({source:sn.ViewportResize},e)})),inputCb:e=>$n(Qn({type:an.IncrementalSnapshot,data:Object.assign({source:sn.Input},e)})),mediaInteractionCb:e=>$n(Qn({type:an.IncrementalSnapshot,data:Object.assign({source:sn.MediaInteraction},e)})),styleSheetRuleCb:e=>$n(Qn({type:an.IncrementalSnapshot,data:Object.assign({source:sn.StyleSheetRule},e)})),styleDeclarationCb:e=>$n(Qn({type:an.IncrementalSnapshot,data:Object.assign({source:sn.StyleDeclaration},e)})),canvasMutationCb:B,fontCb:e=>$n(Qn({type:an.IncrementalSnapshot,data:Object.assign({source:sn.Font},e)})),selectionCb:e=>{$n(Qn({type:an.IncrementalSnapshot,data:Object.assign({source:sn.Selection},e)}))},blockClass:r,ignoreClass:a,maskTextClass:s,maskTextSelector:c,maskInputOptions:_,inlineStylesheet:l,sampling:y,recordCanvas:b,inlineImages:k,userTriggeredOnInput:C,collectFonts:I,doc:e,maskInputFn:m,maskTextFn:g,keepIframeSrcFn:E,blockSelector:i,slimDOMOptions:x,dataURLOptions:v,mirror:oo,iframeManager:U,stylesheetManager:P,shadowDomManager:W,canvasManager:to,ignoreCSSAttributes:M,plugins:(null===(t=null==A?void 0:A.filter(e=>e.observer))||void 0===t?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>$n(Qn({type:an.Plugin,data:{plugin:e.name,payload:t}}))})))||[]},p)};U.addLoadListener(n=>{e.push(t(n.contentDocument))});const n=()=>{eo(),e.push(t(document)),no=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():e.push(Gt("load",()=>{$n(Qn({type:an.Load,data:{}})),n()},window)),()=>{e.forEach(e=>e()),no=!1}}catch(e){console.warn(e)}}ro.addCustomEvent=(e,t)=>{if(!no)throw new Error("please add custom event after start recording");$n(Qn({type:an.Custom,data:{tag:e,payload:t}}))},ro.freezePage=()=>{wn.forEach(e=>e.freeze())},ro.takeFullSnapshot=e=>{if(!no)throw new Error("please take full snapshot after start recording");eo(e)},ro.mirror=oo;class io{constructor(e,t={}){this.events=[],this.isActive=!1,this.hasFullSnapshot=!1,this.sessionId=e,this.config={enabled:!0,sampleRate:1,maskSensitiveFields:!0,maxEventBuffer:1e3,batchInterval:2e3,captureClicks:!0,captureScrolls:!0,captureInputs:!0,captureMouseMoves:!1,compressionEnabled:!0,...t}}start(){if(!this.config.enabled||this.isActive)return!1;if(Math.random()>this.config.sampleRate)return!1;try{return this.rrwebStopRecord=ro({emit:e=>{this.handleRRWebEvent(e)},maskAllInputs:this.config.maskSensitiveFields,maskTextSelector:'input[type="password"], input[type="email"], [data-sensitive], [data-mask]',blockSelector:"[data-no-replay]",recordCanvas:!1,recordCrossOriginIframes:!1,inlineStylesheet:!0,collectFonts:!1,errorHandler:e=>{console.warn("[Zaplier] rrweb error:",e)}}),this.isActive=!0,this.hasFullSnapshot=!1,this.startBatchTimer(),console.log("[Zaplier] Session replay started with rrweb"),!0}catch(e){return console.error("[Zaplier] Failed to start rrweb recording:",e),!1}}stop(){this.isActive&&(this.isActive=!1,this.rrwebStopRecord&&(this.rrwebStopRecord(),this.rrwebStopRecord=void 0),this.batchTimer&&(clearInterval(this.batchTimer),this.batchTimer=void 0),this.sendBatch())}handleRRWebEvent(e){2===e.type&&(this.hasFullSnapshot=!0,console.log("[Zaplier] FullSnapshot captured")),this.addEvent(e)}addEvent(e){if(this.events.push(e),this.events.length>this.config.maxEventBuffer){const e=this.events.findIndex(e=>2===e.type);if(e>=0&&e<this.events.length-this.config.maxEventBuffer){const t=this.events[e],n=this.events.slice(1-this.config.maxEventBuffer);this.events=[t,...n]}else this.events=this.events.slice(-this.config.maxEventBuffer)}}startBatchTimer(){this.batchTimer=window.setInterval(()=>{this.sendBatch()},this.config.batchInterval)}sendBatch(){if(0===this.events.length)return;if(!this.hasFullSnapshot)return void console.log("[Zaplier] Waiting for FullSnapshot before sending batch...");const e=[...this.events];this.events=[];const t=e.some(e=>2===e.type);!t&&this.hasFullSnapshot&&console.warn("[Zaplier] Batch missing FullSnapshot, but one was captured earlier"),console.log(`[Zaplier] Sending batch with ${e.length} events for session ${this.sessionId}`,{hasSnapshot:t,firstEventType:e[0]?.type});const n={sessionId:this.sessionId,events:e,metadata:{userAgent:navigator.userAgent,timestamp:Date.now(),compression:this.config.compressionEnabled}};this.sendToBackend(n)}setSDKInstance(e){this.sdkInstance=e}async sendToBackend(e){try{if(!this.sdkInstance)return void console.error("[Zaplier] No SDK instance available for replay transport");console.log("[Zaplier] Sending replay batch via SDK transport"),console.log("[Zaplier] Payload:",{sessionId:e.sessionId,eventCount:e.events.length,hasMetadata:!!e.metadata});const t=await this.sdkInstance.sendReplayBatch({sessionId:e.sessionId,events:e.events,metadata:{startUrl:window.location.href,duration:Date.now()-(performance.timeOrigin||Date.now()),funnelSteps:[],hasConversion:!1,...e.metadata}});t&&t.success?console.log("[Zaplier] Session replay batch sent successfully"):console.error("[Zaplier] Session replay batch failed:",t)}catch(e){console.error("[Zaplier] Session replay error:",e)}}getEventCount(){return this.events.length}isRecording(){return this.isActive}}const ao={apiEndpoint:"https://api.zaplier.com",retryEnabled:!0,maxRetries:3,retryDelays:[1e3,2e3,4e3],autoTrack:!0,dedupeEnabled:!0,fingerprintEnabled:!0,presenceTracking:!1,heartbeatInterval:3e4,scrollTracking:!0,scrollDepthTracking:!0,gdprCompliant:!0,enhancedTracking:"ask",replaySampling:.1,replayMaskInputs:!0};class so{constructor(e){if(this.version="1.3.0",this.isInitialized=!1,this.eventQueue=[],this.heatmap={enable:()=>{if(this.config.heatmap=!0,!this.heatmapEngine&&this.isInitialized){this.sessionId||(this.sessionId=this.generateSessionId());const e=this.sessionId;this.heatmapEngine=new ft(e,{trackClicks:!0,trackScrollDepth:!0,trackRageClicks:!0,trackMouseMoves:!1}),this.antiAdblockManager&&this.heatmapEngine.setAntiAdblockManager(this.antiAdblockManager),this.heatmapEngine.start()}this.config.debug&&console.log("[Zaplier] Heatmap enabled")},disable:()=>{this.config.heatmap=!1,this.heatmapEngine&&(this.heatmapEngine.stop(),this.heatmapEngine=void 0),this.config.debug&&console.log("[Zaplier] Heatmap disabled")},enableMouseTracking:()=>{this.heatmapEngine&&this.heatmapEngine.enableMouseTracking()},disableMouseTracking:()=>{this.heatmapEngine&&this.heatmapEngine.disableMouseTracking()},getStats:()=>this.heatmapEngine?this.heatmapEngine.getStats():null,isRecording:()=>!!this.heatmapEngine&&this.heatmapEngine.isRecording()},this.replay={enable:()=>{if(this.config.replay=!0,!this.replayEngine&&this.isInitialized){this.sessionId||(this.sessionId=this.generateSessionId());const e=this.sessionId;this.replayEngine=new io(e,{sampleRate:1,maskSensitiveFields:this.config.replayMaskInputs,compressionEnabled:!0}),this.antiAdblockManager&&this.replayEngine.setSDKInstance(this);const t=this.replayEngine.start();this.config.debug&&console.log("[Zaplier] Replay enabled",{started:t,isRecording:this.replayEngine.isRecording()})}else if(this.replayEngine)if(this.replayEngine.isRecording())this.config.debug&&console.log("[Zaplier] Replay already recording");else{this.replayEngine.stop(),this.replayEngine=void 0,this.sessionId||(this.sessionId=this.generateSessionId());const e=this.sessionId;this.replayEngine=new io(e,{sampleRate:1,maskSensitiveFields:this.config.replayMaskInputs,compressionEnabled:!0}),this.antiAdblockManager&&this.replayEngine.setSDKInstance(this);const t=this.replayEngine.start();this.config.debug&&console.log("[Zaplier] Replay engine recreated with 100% sample rate",{started:t,isRecording:this.replayEngine.isRecording()})}this.config.debug&&!this.replayEngine&&console.log("[Zaplier] Replay enabled (will start when SDK initializes)")},disable:()=>{this.config.replay=!1,this.replayEngine&&(this.replayEngine.stop(),this.replayEngine=void 0),this.config.debug&&console.log("[Zaplier] Replay disabled")},start:()=>{if(!this.replayEngine&&this.isInitialized){this.sessionId||(this.sessionId=this.generateSessionId());const e=this.sessionId;return this.replayEngine=new io(e,{sampleRate:1,maskSensitiveFields:this.config.replayMaskInputs,compressionEnabled:!0}),this.antiAdblockManager&&this.replayEngine.setSDKInstance(this),this.replayEngine.start()}return!!this.replayEngine&&this.replayEngine.start()},stop:()=>{this.replayEngine&&this.replayEngine.stop()},isRecording:()=>!!this.replayEngine&&this.replayEngine.isRecording(),getEventCount:()=>this.replayEngine?this.replayEngine.getEventCount():0,addFunnelStep:e=>{this.sendEvent({eventType:"funnel_step",eventName:"funnel_step",customData:e})},markConversion:e=>{this.trackConversion("funnel_conversion",e.value,e.currency,e)}},!e.token)throw new Error("Zaplier: token is required");this.config={...ao,...e,gdprMode:e.gdprMode??!1},"undefined"!=typeof window&&this.initialize()}async initialize(){try{if(this.config.debug&&console.log("[Zaplier] Initializing SDK v"+this.version),!this.config.allow_localhost&&this.isLocalhost())return void(this.config.debug&&console.log("[Zaplier] Skipping tracking on localhost"));await this.collectFingerprint(),this.config.autoTrack&&this.trackPageView(),this.isInitialized=!0,this.initializeAntiAdblock(),this.initializeTrackingEngines(),this.processEventQueue(),this.config.debug&&console.log("[Zaplier] SDK initialized successfully",{visitorId:this.visitorId,gdprMode:this.config.gdprMode})}catch(e){console.error("[Zaplier] Initialization failed:",e)}}initializeTrackingEngines(){try{if(this.sessionId||(this.sessionId=this.generateSessionId(),this.config.debug&&console.log("[Zaplier] Generated session ID:",this.sessionId)),this.config.replay){const e=!0===this.config.replay?1:this.config.replaySampling;this.replayEngine=new io(this.sessionId,{sampleRate:e,maskSensitiveFields:this.config.replayMaskInputs,compressionEnabled:!0}),this.replayEngine.setSDKInstance(this);const t=this.replayEngine.start();this.config.debug&&console.log("[Zaplier] Session Replay started",{started:t,sampleRate:e,isRecording:this.replayEngine.isRecording()})}this.config.heatmap&&(this.heatmapEngine=new ft(this.sessionId,{trackClicks:!0,trackScrollDepth:!0,trackRageClicks:!0,trackMouseMoves:!1}),this.antiAdblockManager&&this.heatmapEngine.setAntiAdblockManager(this.antiAdblockManager),this.heatmapEngine.start(),this.config.debug&&console.log("[Zaplier] Heatmap tracking started"))}catch(e){console.error("[Zaplier] Failed to initialize tracking engines:",e)}}generateSessionId(){const e=performance.timeOrigin||Date.now(),t=this.getBrowserFingerprint();return e.toString(36)+t.substring(0,8)}getBrowserFingerprint(){const e=[navigator.userAgent||"",navigator.platform||"",screen.width||0,screen.height||0,new Date(2024,0,1).getTimezoneOffset(),navigator.language||"",navigator.hardwareConcurrency||0].join("|");let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)&4294967295;return Math.abs(t).toString(36)}initializeAntiAdblock(){try{this.antiAdblockManager=new pt(this.config.apiEndpoint,this.config.token,{enabled:!0,methods:["elysia-websocket","fetch"],fallbackDelay:100,maxRetries:2,debug:this.config.debug}),this.config.debug&&console.log("[Zaplier] Anti-Adblock Manager initialized")}catch(e){console.error("[Zaplier] Failed to initialize Anti-Adblock Manager:",e)}}async collectFingerprint(){try{const e=this.config.gdprMode?await dt():await ut();if(!e.success||!e.data)throw new Error("Fingerprint collection failed");this.fingerprint=e.data,e.data.incognitoDetection&&(this.fingerprint.incognitoDetection={...e.data.incognitoDetection,detectionTimestamp:Date.now(),sdkVersion:this.version}),this.config.debug&&console.log("[Zaplier] Fingerprint collected:",{components:e.collectedComponents,hashes:{full:e.data.hash,stableCore:e.data.stableCoreHash},gdprMode:this.config.gdprMode,incognitoDetected:e.data.incognitoDetection?.isIncognito,incognitoConfidence:e.data.incognitoDetection?.confidence})}catch(e){this.config.debug&&console.error("[Zaplier] Fingerprint collection failed:",e);try{const e=[navigator.userAgent||"",navigator.language||"",navigator.platform||"",screen.width||0,screen.height||0,screen.colorDepth||0,new Date(2024,0,1).getTimezoneOffset(),navigator.hardwareConcurrency||0,navigator.deviceMemory||0,navigator.maxTouchPoints||0,performance.timeOrigin||0,navigator.plugins?navigator.plugins.length:0,navigator.mimeTypes?navigator.mimeTypes.length:0,Math.floor((performance.memory?.usedJSHeapSize||0)/1e6),Math.floor((performance.memory?.totalJSHeapSize||0)/1e6),navigator.connection?.effectiveType||"",Math.floor(navigator.connection?.downlink||0),window.outerHeight||0,window.outerWidth||0,Math.floor(100*(window.devicePixelRatio||1))/100,"function"==typeof document.createElement("canvas").getContext?1:0].join("|");let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)&4294967295;const n=Math.abs(t).toString(36);let o=0;const r=e+n;for(let e=0;e<r.length;e++)o=(o<<5)-o+r.charCodeAt(e)&4294967295,o^=o>>>16;this.fingerprint||(this.fingerprint={}),this.fingerprint.fallbackEntropy=Math.abs(o).toString(36)}catch{}}}isLocalhost(){return!("undefined"==typeof window||!window.location)&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname||window.location.hostname.startsWith("192.168.")||window.location.hostname.startsWith("10.")||window.location.hostname.includes("local"))}async sendEvent(e){if(this.isInitialized)try{const t={fingerprintHash:this.fingerprint?.hash,stableCoreHash:this.fingerprint?.stableCoreHash,stableCoreVector:this.fingerprint?.stableCoreVector,fingerprintVector:this.fingerprint||void 0,incognitoDetection:this.fingerprint?.incognitoDetection&&(void 0!==this.fingerprint.incognitoDetection.likelihood||this.fingerprint.incognitoDetection.methods&&this.fingerprint.incognitoDetection.methods.length>0)?this.fingerprint.incognitoDetection:void 0,isSafari:"undefined"!=typeof navigator&&/safari/i.test(navigator.userAgent)&&!/chrome|chromium|opr|edg|edge/i.test(navigator.userAgent),ch:navigator.userAgentData?{brands:navigator.userAgentData.brands||[],platform:navigator.userAgentData.platform||void 0,mobile:navigator.userAgentData.mobile||void 0,model:navigator.userAgentData.model||void 0}:void 0,fingerprintComponents:this.fingerprint?.components||{},...e,timestamp:(new Date).toISOString(),url:"undefined"!=typeof window&&window.location?window.location.href:"",referrer:"undefined"!=typeof document?document.referrer:"",pageTitle:"undefined"!=typeof document?document.title:"",userAgent:"undefined"!=typeof navigator?navigator.userAgent:"",screenWidth:this.fingerprint?.screen?.value?.width||("undefined"!=typeof window&&window.screen?window.screen.width:0),screenHeight:this.fingerprint?.screen?.value?.height||("undefined"!=typeof window&&window.screen?window.screen.height:0),viewportWidth:this.fingerprint?.screen?.value?.viewportWidth||("undefined"!=typeof window?window.innerWidth:0),viewportHeight:this.fingerprint?.screen?.value?.viewportHeight||("undefined"!=typeof window?window.innerHeight:0),gdprMode:this.config.gdprMode},n=await this.makeRequest(`/tracking/event?token=${encodeURIComponent(this.config.token)}`,t);return n.visitorId&&(this.backendVisitorId=n.visitorId,this.config.debug&&console.log("[Zaplier] Backend visitor ID received:",n.visitorId)),n.sessionId&&(this.sessionId=n.sessionId),n}catch(t){this.config.debug&&console.error("[Zaplier] Event sending failed:",t),this.config.retryEnabled&&setTimeout(()=>this.sendEvent(e),5e3)}else this.eventQueue.push(e)}async sendReplayBatch(e){if(!this.isInitialized)return console.error("[Zaplier] SDK not initialized for replay batch sending"),{success:!1,error:"SDK not initialized"};try{const t={sessionId:e.sessionId,userId:this.backendVisitorId,events:e.events,metadata:{...e.metadata,visitorId:this.backendVisitorId,fingerprintHash:this.fingerprint?.hash}};this.config.debug&&console.log("[Zaplier] Sending replay batch:",{sessionId:t.sessionId,eventCount:t.events.length,hasMetadata:!!t.metadata});const n=await this.makeRequest(`/replays/record?token=${encodeURIComponent(this.config.token)}`,t,"POST");return this.config.debug&&console.log("[Zaplier] Replay batch result:",n),n}catch(e){return this.config.debug&&console.error("[Zaplier] Replay batch sending failed:",e),{success:!1,error:e instanceof Error?e.message:"Unknown error"}}}async makeRequest(e,t,n="POST"){const o=`${this.config.apiEndpoint}${e}`,r={method:n,headers:{"Content-Type":"application/json"}};"POST"===n&&t&&(r.body=JSON.stringify(t));try{const e=Promise.race([fetch(o,r),new Promise((e,t)=>setTimeout(()=>t(new Error("Fetch timeout - possibly blocked")),5e3))]),t=await e;if(!t.ok)throw new Error(`HTTP ${t.status}: ${t.statusText}`);return await t.json()}catch(o){if(this.antiAdblockManager&&"POST"===n){this.config.debug&&console.warn(`[Zaplier] Standard fetch failed (${o instanceof Error?o.message:String(o)}), trying anti-adblock fallback`);try{const n=await this.antiAdblockManager.send(t,e);if(n.success)return this.config.debug&&console.log(`[Zaplier] Request sent via ${n.method} (${n.latency}ms) as fallback`),{success:!0,method:n.method}}catch(e){this.config.debug&&console.warn("[Zaplier] Both standard fetch and anti-adblock failed:",e)}}throw o}}processEventQueue(){for(;this.eventQueue.length>0;){const e=this.eventQueue.shift();this.sendEvent(e)}}track(e,t){this.sendEvent({eventType:e,eventName:e,customData:t})}trackCustomEvent(e,t){return this.sendEvent({eventType:"custom",eventName:e,customData:t}),!0}trackConversion(e,t,n,o){return this.sendEvent({eventType:"conversion",eventName:e,revenue:t,currency:n||"USD",customData:o}),!0}trackPageView(e){this.sendEvent({eventType:"page_view",eventName:"page_view",...e})}trackPurchase(e){this.sendEvent({eventType:"purchase",eventName:"purchase",revenue:e.value||e.revenue,currency:e.currency||"USD",quantity:e.quantity||1,productId:e.productId,customData:{productName:e.productName,orderId:e.orderId,...e.customData}})}trackAddToCart(e){this.sendEvent({eventType:"add_to_cart",eventName:"add_to_cart",revenue:e?.price,quantity:e?.quantity||1,productId:e?.productId,customData:{productName:e?.productName,...e?.customData}})}trackViewContent(e){this.sendEvent({eventType:"view_content",eventName:"view_content",productId:e?.productId,customData:{productName:e?.productName,category:e?.category,...e?.customData}})}trackInitiateCheckout(e){this.sendEvent({eventType:"initiate_checkout",eventName:"initiate_checkout",revenue:e?.value,currency:e?.currency||"USD",quantity:e?.numItems,customData:e?.customData})}trackLead(e){this.sendEvent({eventType:"lead",eventName:"lead",customData:e})}identify(e){this.sendEvent({eventType:"identify",eventName:"identify",email:e.email,phone:e.phone,customData:e})}trackSPANavigation(e,t){this.trackPageView({url:e||("undefined"!=typeof window&&window.location?window.location.href:""),pageTitle:t||("undefined"!=typeof document?document.title:"")})}resetScrollTracking(){this.config.debug&&console.log("[Zaplier] Scroll tracking reset")}startPresenceTracking(){this.config.presenceTracking=!0,this.config.debug&&console.log("[Zaplier] Presence tracking started")}stopPresenceTracking(){this.config.presenceTracking=!1,this.config.debug&&console.log("[Zaplier] Presence tracking stopped")}enableEnhancedTracking(){return this.config.enhancedTracking="true",this.config.gdprMode=!1,this.collectFingerprint(),this.config.debug&&console.log("[Zaplier] Enhanced tracking enabled"),!0}disableEnhancedTracking(){this.config.enhancedTracking="false",this.config.gdprMode=!0,this.config.debug&&console.log("[Zaplier] Enhanced tracking disabled")}isEnhancedMode(){return"true"===this.config.enhancedTracking&&!this.config.gdprMode}getVisitorId(){return this.backendVisitorId||this.visitorId||null}async getVisitorInfo(){const e=this.backendVisitorId;if(!e)return this.config.debug&&console.warn("[Zaplier] No backend visitor ID available. Track an event first and wait for the response."),null;if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e))return this.config.debug&&console.warn("[Zaplier] Invalid visitor ID format. Expected UUID, got:",e),null;try{return await this.makeRequest(`/tracking/visitor/${e}?token=${encodeURIComponent(this.config.token)}`,null,"GET")}catch(e){return this.config.debug&&console.error("[Zaplier] Failed to get visitor info:",e),null}}async getVisitorHistory(){const e=this.backendVisitorId;if(!e)return this.config.debug&&console.warn("[Zaplier] No backend visitor ID available. Track an event first and wait for the response."),null;if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e))return this.config.debug&&console.warn("[Zaplier] Invalid visitor ID format. Expected UUID, got:",e),null;try{return await this.makeRequest(`/tracking/visitor/${e}/history?token=${encodeURIComponent(this.config.token)}`,null,"GET")}catch(e){return this.config.debug&&console.error("[Zaplier] Failed to get visitor history:",e),null}}getUserData(){const e="undefined"!=typeof window&&"undefined"!=typeof navigator?{userAgent:navigator.userAgent||"",language:navigator.language||"",screen:{width:window.screen?.width||0,height:window.screen?.height||0}}:{userAgent:"",language:"",screen:{width:0,height:0}};return{sessionId:this.sessionId||"",visitorId:this.getVisitorId()||void 0,location:{},device:e,journey:[],fingerprint:this.fingerprint?.hash}}getConversionLikelihood(){return{score:.5,factors:["Requires backend analysis"]}}getUserSegment(){return{type:"medium_intent",confidence:.5}}}let co=null;const lo={init:e=>co?(console.warn("[Zaplier] SDK already initialized"),co):(co=new so(e),co),getInstance:()=>co,track:(e,t)=>{co?co.track(e,t):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackPageView:e=>{co?co.trackPageView(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackEvent:(e,t)=>co?co.trackCustomEvent(e,t):(console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first"),!1),trackConversion:(e,t,n,o)=>{co?co.trackConversion(e,t,n,o):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackPurchase:e=>{co?co.trackPurchase(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackAddToCart:e=>{co?co.trackAddToCart(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},identify:e=>{co?co.identify(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},getVisitorId:()=>co?co.getVisitorId():null,getVisitorInfo:()=>co?co.getVisitorInfo():Promise.resolve(null),getUserData:()=>co?co.getUserData():null,enableEnhancedTracking:()=>co?co.enableEnhancedTracking():(console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first"),!1),disableEnhancedTracking:()=>{co?co.disableEnhancedTracking():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},isEnhancedMode:()=>!!co&&co.isEnhancedMode(),heatmap:{enable:()=>{co?co.heatmap.enable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},disable:()=>{co?co.heatmap.disable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},enableMouseTracking:()=>{co?co.heatmap.enableMouseTracking():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},disableMouseTracking:()=>{co?co.heatmap.disableMouseTracking():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},getStats:()=>co?co.heatmap.getStats():null,isRecording:()=>!!co&&co.heatmap.isRecording()},replay:{enable:()=>{co?co.replay.enable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},disable:()=>{co?co.replay.disable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},start:()=>co?co.replay.start():(console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first"),!1),stop:()=>{co?co.replay.stop():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},isRecording:()=>!!co&&co.replay.isRecording(),getEventCount:()=>co?co.replay.getEventCount():0,addFunnelStep:e=>{co?co.replay.addFunnelStep(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},markConversion:e=>{co?co.replay.markConversion(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")}},debug:{getStats:()=>co&&co.antiAdblockManager?co.antiAdblockManager.getStats():null,getSuccessRates:()=>co&&co.antiAdblockManager?co.antiAdblockManager.getSuccessRates():null,testTransports:()=>co&&co.antiAdblockManager?co.antiAdblockManager.testTransports():Promise.resolve(null)},version:"3.0.0"};function uo(){if("undefined"==typeof window||"undefined"==typeof document)return;const e=document.getElementsByTagName("script");let t=null;for(const n of Array.from(e))if(n.src&&(n.src.includes("zaplier")||n.src.includes("sdk.js")||n.src.includes("sdk.min.js"))&&n.dataset.token){t=n;break}if(!t||!t.dataset.token)return;const n={token:t.dataset.token,debug:"true"===t.dataset.debug,gdprMode:"true"===t.dataset.gdprMode,heatmap:"true"===t.dataset.heatmap,replay:"true"===t.dataset.replay,allow_localhost:"true"===t.dataset.allowLocalhost};try{lo.init(n),n.debug&&console.log("[Zaplier] Auto-initialized from script tag",n)}catch(e){console.error("[Zaplier] Auto-initialization failed:",e)}}"undefined"!=typeof window&&(window.Zaplier=lo,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",uo):uo());const ho=[/HeadlessChrome/i,/PhantomJS/i,/SlimerJS/i,/Selenium/i,/WebDriver/i,/ChromeDriver/i,/GeckoDriver/i,/bot/i,/crawler/i,/spider/i,/scraper/i,/Googlebot/i,/Bingbot/i,/Slurp/i,/DuckDuckBot/i,/Baiduspider/i,/YandexBot/i,/facebookexternalhit/i,/Twitterbot/i,/LinkedInBot/i,/WhatsApp/i,/SkypeUriPreview/i],mo=[/^Mozilla\/5\.0$/,/Headless/i,/automated/i,/testing/i,/^$/];function go(){try{if(!0===navigator.webdriver)return{detected:!0,confidence:95,method:"navigator.webdriver_true"};if(!0===window.webdriver)return{detected:!0,confidence:90,method:"window.webdriver_true"};const e=["_selenium","callSelenium","_Selenium_IDE_Recorder","callPhantom","_phantom","__phantomas","__fxdriver_evaluate","__fxdriver_unwrapped","_fxdriver_evaluate","_fxdriver_unwrapped"];for(const t of e)if(t in window||t in document)return{detected:!0,confidence:85,method:`selenium_property_${t}`};return document.documentElement.getAttribute("webdriver")?{detected:!0,confidence:80,method:"document_webdriver_attribute"}:{detected:!1,confidence:0,method:"webdriver_not_detected"}}catch(e){return{detected:!1,confidence:0,method:"webdriver_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function po(){try{let e=0;const t=[];window.outerHeight&&window.outerWidth||(e++,t.push("missing_outer_dimensions")),0===navigator.plugins.length&&(e++,t.push("no_plugins")),navigator.languages&&0!==navigator.languages.length||(e++,t.push("no_languages"));const n=navigator.userAgent;return(!n||n.length<50)&&(e++,t.push("short_user_agent")),void 0===Notification?.permission&&(e++,t.push("no_notification_permission")),window.performance&&window.performance.timing||(e++,t.push("missing_performance_api")),n.includes("Chrome")&&(window.chrome||(e++,t.push("missing_chrome_object")),n.includes("HeadlessChrome"))?{detected:!0,confidence:95,method:"chrome_headless_user_agent"}:{detected:e>=3,confidence:Math.min(15*e,90),method:"headless_characteristics",details:{issues:t,suspiciousCount:e}}}catch(e){return{detected:!1,confidence:0,method:"headless_detection_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function fo(){try{const e=["webdriver","selenium","phantomjs","slimerjs","chromedriver","geckodriver","automation","puppeteer"],t=[];for(const n of e)(window[n]||window[`_${n}`]||window[`__${n}`])&&t.push(n);for(const n of e)(document[n]||document[`_${n}`]||document[`__${n}`])&&t.push(n);try{window.navigator||t.push("navigation_missing")}catch(e){const n=e instanceof Error?e.message:"";(n.includes("automation")||n.includes("webdriver"))&&t.push("navigation_automation_error")}return t.length>0?{detected:!0,confidence:Math.min(30*t.length,95),method:"automation_tools_detected",details:{tools:t}}:{detected:!1,confidence:0,method:"no_automation_tools"}}catch(e){return{detected:!1,confidence:0,method:"automation_detection_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function yo(){try{const e=["#ad-banner",".advertisement",".google-ads",".adsense","#google-analytics",".analytics",'[src*="google-analytics"]','[src*="googletagmanager"]',".facebook-widget",".twitter-widget",".social-share"];let t=0;for(const n of e)document.querySelector(n)||t++;try{const e=document.createElement("img");e.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",e.style.display="none",document.body.appendChild(e),setTimeout(()=>{e.parentNode&&e.parentNode.removeChild(e)},100)}catch{t++}return{detected:t>=2,confidence:Math.min(20*t,80),method:"dom_blockers",details:{blockedCount:t,totalTests:e.length+1}}}catch(e){return{detected:!1,confidence:0,method:"dom_blocker_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function vo(){try{return navigator.languages&&0!==navigator.languages.length?1===navigator.languages.length&&"en-US"===navigator.languages[0]?{detected:!0,confidence:40,method:"single_default_language"}:navigator.language!==navigator.languages[0]?{detected:!0,confidence:30,method:"inconsistent_languages",details:{language:navigator.language,firstLanguage:navigator.languages[0]}}:{detected:!1,confidence:0,method:"languages_normal",details:{languageCount:navigator.languages.length}}:{detected:!0,confidence:70,method:"no_languages"}}catch(e){return{detected:!0,confidence:50,method:"language_detection_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function wo(){try{const e=new Function("return 2 + 2")();if(4!==e)return{detected:!0,confidence:90,method:"function_constructor_incorrect_result",details:{expected:4,actual:e}};const t=Function.toString();return t.includes("[native code]")||t.includes("function Function()")?{detected:!1,confidence:0,method:"eval_normal"}:{detected:!0,confidence:70,method:"function_constructor_modified_toString",details:{functionString:t.substring(0,100)}}}catch(e){return{detected:!0,confidence:60,method:"eval_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function bo(){const e=navigator.userAgent,t=ho.filter(t=>t.test(e)),n=mo.filter(t=>t.test(e));let o="legitimate";t.some(e=>e.source.includes("bot|crawler|spider"))?o="crawler":t.some(e=>e.source.includes("Selenium|WebDriver"))?o="automation":t.some(e=>e.source.includes("Headless|Phantom"))&&(o="headless");const r=[...t.map(e=>e.source),...n.map(e=>e.source)];return{browser:{name:"Unknown",version:"Unknown",major:"Unknown",engine:"unknown"},os:{name:"Unknown",version:"Unknown",family:"unknown"},device:{type:"desktop"},suspicious:{isBot:t.length>0||n.length>0,patterns:r,category:t.length>0?o:"legitimate"},isMobile:!1,isTablet:!1,isDesktop:!0,isBot:t.length>0||n.length>0,raw:e}}async function So(){try{const e="__incognito_test_"+Date.now(),t="test";localStorage.setItem(e,t);const n=localStorage.getItem(e);if(localStorage.removeItem(e),n!==t)return{detected:!0,confidence:80,method:"localStorage_inconsistency",details:{retrieved:n,expected:t}};try{const e="x".repeat(1048576);return localStorage.setItem("__capacity_test",e),localStorage.removeItem("__capacity_test"),{detected:!1,confidence:30,method:"localStorage_capacity"}}catch(e){return{detected:!0,confidence:60,method:"localStorage_capacity_limited",details:{error:e instanceof Error?e.message:"Unknown"}}}}catch(e){return{detected:!0,confidence:90,method:"localStorage_unavailable",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Co(){try{const e="__session_test_"+Date.now(),t="test";sessionStorage.setItem(e,t);const n=sessionStorage.getItem(e);return sessionStorage.removeItem(e),n!==t?{detected:!0,confidence:75,method:"sessionStorage_inconsistency",details:{retrieved:n,expected:t}}:{detected:!1,confidence:20,method:"sessionStorage_working"}}catch(e){return{detected:!0,confidence:85,method:"sessionStorage_unavailable",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Io(){try{return window.indexedDB?new Promise(e=>{const t="__incognito_test_"+Date.now(),n=indexedDB.open(t,1),o=setTimeout(()=>{e({detected:!0,confidence:60,method:"indexedDB_timeout"})},1e3);n.onerror=()=>{clearTimeout(o),e({detected:!0,confidence:80,method:"indexedDB_error",details:{error:n.error?.message}})},n.onsuccess=()=>{clearTimeout(o),n.result.close(),indexedDB.deleteDatabase(t),e({detected:!1,confidence:25,method:"indexedDB_working"})},n.onblocked=()=>{clearTimeout(o),e({detected:!0,confidence:70,method:"indexedDB_blocked"})}}):{detected:!0,confidence:70,method:"indexedDB_unavailable"}}catch(e){return{detected:!0,confidence:85,method:"indexedDB_exception",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function ko(){try{if(!navigator.permissions)return{detected:!1,confidence:10,method:"permissions_unsupported"};const e=await navigator.permissions.query({name:"notifications"});return"denied"===e.state?{detected:!0,confidence:40,method:"permissions_notifications_denied",details:{state:e.state}}:{detected:!1,confidence:30,method:"permissions_working",details:{state:e.state}}}catch(e){return{detected:!0,confidence:50,method:"permissions_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Ao(){try{if(!navigator.storage||!navigator.storage.estimate)return{detected:!1,confidence:10,method:"quota_unsupported"};const e=await navigator.storage.estimate(),t=navigator.userAgent,n=/Chrome/.test(t)&&!/Edg|OPR/.test(t),o=/Safari/.test(t)&&!/Chrome/.test(t);let r,i;if(n?(r=157286400,i=125829120):o?(r=52428800,i=26214400):(r=104857600,i=52428800),e.quota){if(e.quota<=i)return{detected:!0,confidence:85,method:"quota_very_limited",details:{quota:e.quota,usage:e.usage,quotaMB:Math.round(e.quota/1048576),threshold:Math.round(i/1048576)}};if(e.quota<=r)return{detected:!0,confidence:65,method:"quota_limited",details:{quota:e.quota,usage:e.usage,quotaMB:Math.round(e.quota/1048576),threshold:Math.round(r/1048576)}}}return{detected:!1,confidence:30,method:"quota_normal",details:{quota:e.quota,usage:e.usage,quotaMB:e.quota?Math.round(e.quota/1048576):null}}}catch(e){return{detected:!0,confidence:50,method:"quota_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Eo(){try{const e=navigator.userAgent;return/Chrome/.test(e)&&!/Edg|OPR/.test(e)?window.webkitRequestFileSystem?new Promise(e=>{const t=()=>{e({detected:!1,confidence:40,method:"chrome_filesystem_available"})},n=()=>{e({detected:!0,confidence:80,method:"chrome_filesystem_blocked"})};try{window.webkitRequestFileSystem(0,1,t,n)}catch(t){e({detected:!0,confidence:70,method:"chrome_filesystem_exception"})}setTimeout(()=>{e({detected:!1,confidence:20,method:"chrome_filesystem_timeout"})},1e3)}):{detected:!1,confidence:10,method:"chrome_filesystem_unsupported"}:{detected:!1,confidence:0,method:"chrome_detection_not_applicable"}}catch(e){return{detected:!1,confidence:10,method:"chrome_detection_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Mo(){try{const e=navigator.userAgent;if(!/Safari/.test(e)||/Chrome/.test(e))return{detected:!1,confidence:0,method:"safari_detection_not_applicable"};try{localStorage.setItem("__safari_test","test");const e=localStorage.length;if(localStorage.removeItem("__safari_test"),0===e)return{detected:!0,confidence:75,method:"safari_localStorage_blocked"}}catch(e){return{detected:!0,confidence:80,method:"safari_localStorage_exception"}}return window.indexedDB?{detected:!1,confidence:30,method:"safari_detection_normal"}:{detected:!0,confidence:70,method:"safari_indexedDB_missing"}}catch(e){return{detected:!1,confidence:10,method:"safari_detection_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function To(){try{const e=window.requestFileSystem||window.webkitRequestFileSystem;return e?new Promise(t=>{e(window.TEMPORARY||0,1024,()=>{t({detected:!1,confidence:30,method:"filesystem_working"})},e=>{t({detected:!0,confidence:60,method:"filesystem_error",details:{error:e.name||"Unknown"}})}),setTimeout(()=>{t({detected:!0,confidence:50,method:"filesystem_timeout"})},1e3)}):{detected:!1,confidence:10,method:"filesystem_unsupported"}}catch(e){return{detected:!0,confidence:70,method:"filesystem_exception",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Ro(){try{const e=new Image,t=performance.now();return new Promise(n=>{const o=setTimeout(()=>{n({detected:!1,confidence:10,method:"cache_timeout"})},3e3);e.onload=()=>{clearTimeout(o);const e=performance.now()-t;n(e<5?{detected:!0,confidence:30,method:"cache_too_fast",details:{loadTime:e}}:{detected:!1,confidence:20,method:"cache_normal",details:{loadTime:e}})},e.onerror=()=>{clearTimeout(o),n({detected:!1,confidence:10,method:"cache_error"})},e.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"})}catch(e){return{detected:!1,confidence:10,method:"cache_exception",details:{error:e instanceof Error?e.message:"Unknown"}}}}function _o(e,t){return new Promise(n=>{setTimeout(()=>{n({detected:!1,confidence:0,method:`${t}_timeout`})},e)})}function xo(){try{return"object"==typeof window.chrome&&null!==window.chrome&&"object"==typeof window.chrome.runtime}catch{return!1}}function Do(){return navigator.userAgent.includes("WebKit")&&!navigator.userAgent.includes("Chrome")}function Oo(){return navigator.userAgent.includes("Gecko")&&!navigator.userAgent.includes("Chrome")}function No(){return navigator.userAgent.includes("SamsungBrowser")||navigator.userAgent.includes("Samsung Internet")}function Fo(){return navigator.userAgent.includes("iPad")||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1}function Lo(){return navigator.userAgent.includes("Android")}function Bo(e,t){const n=e.match(t);return n&&n[1]||"Unknown"}function Po(e){const t=e.toLowerCase();return t.includes("tablet")||Fo()?Fo()?{type:"tablet",vendor:"Apple",model:"iPad"}:t.includes("kindle")?{type:"tablet",vendor:"Amazon",model:"Kindle"}:{type:"tablet"}:t.includes("mobile")||t.includes("iphone")||t.includes("ipod")||Lo()?t.includes("iphone")?{type:"mobile",vendor:"Apple",model:"iPhone"}:t.includes("ipod")?{type:"mobile",vendor:"Apple",model:"iPod"}:Lo()&&t.includes("mobile")?{type:"mobile",vendor:"Android"}:{type:"mobile"}:{type:"desktop"}}var Uo=Object.freeze({__proto__:null,detectIncognitoHeuristics:async function(){const e=[];let t=0;const n=await async function(){try{const e="__incognito_test__",t=Date.now().toString();localStorage.setItem(e,t);const n=localStorage.getItem(e);return localStorage.removeItem(e),n===t}catch{return!1}}();n||(t+=.25,e.push("localStorage_blocked"));const o=await async function(){try{const e="__incognito_test__",t=Date.now().toString();sessionStorage.setItem(e,t);const n=sessionStorage.getItem(e);return sessionStorage.removeItem(e),n===t}catch{return!1}}();o||(t+=.2,e.push("sessionStorage_blocked"));const r=await async function(){try{return!!window.indexedDB&&new Promise(e=>{const t=indexedDB.open("__incognito_test__",1);t.onsuccess=()=>{t.result.close(),indexedDB.deleteDatabase("__incognito_test__"),e(!0)},t.onerror=()=>e(!1),t.onblocked=()=>e(!1)})}catch{return!1}}();r||(t+=.15,e.push("indexedDB_blocked"));const i=function(){try{const e="__incognito_test__",t=Date.now().toString();document.cookie=`${e}=${t}; SameSite=Strict; path=/`;const n=-1!==document.cookie.indexOf(`${e}=${t}`);return document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`,n}catch{return!1}}();i||(t+=.2,e.push("cookies_blocked")),function(){try{return!(!Array.isArray(navigator.languages)||1!==navigator.languages.length||!navigator.language)&&navigator.languages[0]===navigator.language}catch{return!1}}()&&(t+=.25,e.push("languages_single_value"));try{if(n){const n="__incognito_persistence_test__",o="persist_test";localStorage.setItem(n,o);const r=localStorage.getItem(n)===o;localStorage.removeItem(n),r||(t+=.2,e.push("localStorage_not_persistent"))}}catch{}try{if(navigator.storage?.estimate){const n=await navigator.storage.estimate(),o=n?.quota||0,r=n?.usage||0;0===o?(t+=.3,e.push("storage_quota_zero")):o>0&&o<125829120&&(t+=.25,e.push("storage_quota_low")),0===r&&o>0&&(t+=.1,e.push("storage_usage_zero"))}else e.push("storage_estimate_unavailable")}catch{e.push("storage_estimate_error")}"serviceWorker"in navigator||(t+=.1,e.push("service_worker_absent")),"caches"in window||(t+=.05,e.push("cache_api_absent"));try{if(navigator.permissions?.query){const n=await navigator.permissions.query({name:"notifications"});"denied"===n?.state&&(t+=.05,e.push("notifications_denied"))}}catch{e.push("permissions_query_error")}(function(){try{return!!window.showOpenFilePicker}catch{return!1}})()||e.push("fs_access_absent"),"connection"in navigator||e.push("network_info_absent"),t=Math.max(0,Math.min(1,t));const a=[n,o,r,i].filter(e=>!e).length;return a>=3?t=Math.max(t,.85):a>=2&&(t=Math.max(t,.7)),e.includes("languages_single_value")&&(a>=1||t>=.2)&&(t=Math.max(t,.5)),{likelihood:t,methods:e}}});function Wo(){try{if("deviceMemory"in navigator){const e=navigator.deviceMemory;return"number"==typeof e?e:null}return null}catch{return null}}function Vo(){try{if("hardwareConcurrency"in navigator){const e=navigator.hardwareConcurrency;return"number"==typeof e?e:null}return null}catch{return null}}function Zo(){try{return[navigator.platform,navigator.userAgent,navigator.userAgent.includes("ARM")?"ARM":null,navigator.userAgent.includes("arm64")?"ARM64":null,navigator.userAgent.includes("aarch64")?"ARM64":null,navigator.userAgent.includes("x86_64")?"x86_64":null,navigator.userAgent.includes("WOW64")?"x86_64":null,navigator.userAgent.includes("Win64")?"x86_64":null,navigator.userAgent.includes("Intel")?"Intel":null].filter(Boolean).join("|")||"unknown"}catch{return"unknown"}}function Go(){try{return navigator.maxTouchPoints||0}catch{return 0}}var zo=Object.freeze({__proto__:null,getArchitecture:Zo,getDeviceMemory:Wo,getHardwareConcurrency:Vo,getHardwareFingerprint:function(){return{deviceMemory:Wo(),hardwareConcurrency:Vo(),architecture:Zo(),maxTouchPoints:Go(),platform:navigator.platform||"unknown"}},getMaxTouchPoints:Go,isHardwareDetectionAvailable:function(){return"undefined"!=typeof navigator}});function Ho(){try{if("undefined"!=typeof Intl&&Intl.DateTimeFormat){const e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(e)return e}const e=new Date(2024,0,1).getTimezoneOffset();return`UTC${e>0?"-":"+"}${Math.abs(e/60)}`}catch{return"unknown"}}function jo(){try{const e=[];navigator.languages&&Array.isArray(navigator.languages)&&e.push(...navigator.languages),navigator.language&&e.push(navigator.language);const t=navigator.userLanguage||navigator.browserLanguage;return t&&e.push(t),[...new Set(e)]}catch{return["unknown"]}}function qo(){try{if("undefined"!=typeof Intl&&Intl.DateTimeFormat){const e=(new Intl.DateTimeFormat).resolvedOptions();return{locale:e.locale||"unknown",calendar:e.calendar||"unknown",numberingSystem:e.numberingSystem||"unknown",timeZone:e.timeZone||"unknown"}}return{locale:"unknown"}}catch{return{locale:"unknown"}}}function Ko(){try{const e={platform:navigator.platform||"unknown",oscpu:navigator.oscpu||null,vendor:navigator.vendor||null},t=navigator.userAgent;if(t.includes("Windows"))e.os="Windows",t.includes("Windows NT 10.0")?e.osVersion="10":t.includes("Windows NT 6.3")?e.osVersion="8.1":t.includes("Windows NT 6.2")?e.osVersion="8":t.includes("Windows NT 6.1")&&(e.osVersion="7");else if(t.includes("Macintosh")||t.includes("Mac OS")){e.os="macOS";const n=t.match(/Mac OS X ([0-9_]+)/);n&&n[1]&&(e.osVersion=n[1].replace(/_/g,"."))}else if(t.includes("Linux"))e.os="Linux";else if(t.includes("Android")){e.os="Android";const n=t.match(/Android ([0-9.]+)/);n&&n[1]&&(e.osVersion=n[1])}else if(t.includes("iOS")||t.includes("iPhone")||t.includes("iPad")){e.os="iOS";const n=t.match(/OS ([0-9_]+)/);n&&n[1]&&(e.osVersion=n[1].replace(/_/g,"."))}return e}catch{return{platform:"unknown"}}}var Xo=Object.freeze({__proto__:null,getDateTimeLocale:qo,getLanguages:jo,getPlatformExtended:Ko,getSystemFingerprint:function(){return{timezone:Ho(),languages:jo(),dateTimeLocale:qo(),platform:Ko(),cookiesEnabled:navigator.cookieEnabled||!1}},getTimezone:Ho,isSystemDetectionAvailable:function(){return"undefined"!=typeof navigator}});function Yo(){try{if("undefined"==typeof localStorage)return!1;const e="__rb_test__",t="test";localStorage.setItem(e,t);const n=localStorage.getItem(e);return localStorage.removeItem(e),n===t}catch(e){return"blocked"}}function Jo(){try{if("undefined"==typeof sessionStorage)return!1;const e="__rb_test__",t="test";sessionStorage.setItem(e,t);const n=sessionStorage.getItem(e);return sessionStorage.removeItem(e),n===t}catch(e){return"blocked"}}function Qo(){return new Promise(e=>{try{if(!("indexedDB"in window))return void e(!1);const t="__rb_test_db__",n=indexedDB.open(t,1);let o=!1;const r=t=>{o||(o=!0,e(t))};setTimeout(()=>r("blocked"),1e3),n.onerror=()=>r("blocked"),n.onsuccess=()=>{try{n.result.close();const e=indexedDB.deleteDatabase(t);e.onsuccess=()=>r(!0),e.onerror=()=>r(!0)}catch{r("blocked")}},n.onupgradeneeded=()=>{try{const e=n.result;e.objectStoreNames.contains("test")||e.createObjectStore("test")}catch{r("blocked")}}}catch{e("blocked")}})}function $o(){try{return"openDatabase"in window&&"function"==typeof window.openDatabase}catch{return!1}}async function er(){try{if("storage"in navigator&&"estimate"in navigator.storage){const e=await navigator.storage.estimate();return{quota:e.quota||null,usage:e.usage||null,available:e.quota&&e.usage?e.quota-e.usage:null}}return{}}catch{return{}}}var tr=Object.freeze({__proto__:null,getIndexedDBSupport:Qo,getLocalStorageSupport:Yo,getSessionStorageSupport:Jo,getStorageFingerprint:async function(){const[e,t]=await Promise.all([Qo(),er()]);return{localStorage:Yo(),sessionStorage:Jo(),indexedDB:e,webSQL:$o(),quota:t}},getStorageQuota:er,getWebSQLSupport:$o,isStorageDetectionAvailable:function(){return"undefined"!=typeof window}});function nr(){const e=Math,t=()=>0,n=e.acos||t,o=e.acosh||t,r=e.asin||t,i=e.asinh||t,a=e.atanh||t,s=e.atan||t,c=e.sin||t,l=e.sinh||t,d=e.cos||t,u=e.cosh||t,h=e.tan||t,m=e.tanh||t,g=e.exp||t,p=e.expm1||t,f=e.log1p||t,y=t=>e.pow(e.PI,t),v=t=>e.log(t+e.sqrt(t*t+1)),w=t=>e.log((1+t)/(1-t))/2,b=t=>(e.exp(t)-1/e.exp(t))/2,S=t=>(e.exp(t)+1/e.exp(t))/2,C=t=>e.exp(t)-1,I=t=>(e.exp(2*t)-1)/(e.exp(2*t)+1),k=t=>e.log(1+t);try{return{acos:n(.12312423423423424),asin:r(.12312423423423424),atan:s(.5),cos:d(10.000000000123),sin:c(-1e300),tan:h(-1e300),acosh:o(1e308),acoshPf:(A=1e154,e.log(A+e.sqrt(A*A-1))),asinh:i(1),asinhPf:v(1),atanh:a(.5),atanhPf:w(.5),cosh:u(1),coshPf:S(1),sinh:l(1),sinhPf:b(1),tanh:m(1),tanhPf:I(1),exp:g(1),expm1:p(1),expm1Pf:C(1),log1p:f(10),log1pPf:k(10),powPI:y(-100),sqrt:e.sqrt(2),cbrt:e.cbrt?e.cbrt(8):0,log:e.log(e.E),log10:e.log10?e.log10(10):0,log2:e.log2?e.log2(2):0,special_0:e.sin(e.PI),special_1:e.cos(e.PI/2),special_2:e.tan(e.PI/4),special_3:e.sqrt(-1),special_4:e.log(-1),special_5:1/0,special_6:NaN}}catch(t){return{error:1,basicMath:e.PI+e.E}}var A}function or(){try{return{PI:Math.PI,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2}}catch{return{}}}function rr(){try{return{precision1:.1+.2,precision2:.3-.1,precision3:.1*3,precision4:1.1-.9,largeAdd:1e16,largeSub:1e16,tiny:Number.MIN_VALUE,epsilon:Number.EPSILON||2220446049250313e-31,maxValue:Number.MAX_VALUE,maxSafeInteger:Number.MAX_SAFE_INTEGER||9007199254740991,minSafeInteger:Number.MIN_SAFE_INTEGER||-9007199254740991}}catch{return{}}}var ir=Object.freeze({__proto__:null,getCompleteMathFingerprint:function(){return{operations:nr(),constants:or(),floatingPoint:rr()}},getFloatingPointBehavior:rr,getMathConstants:or,getMathFingerprint:nr,isMathDetectionAvailable:function(){return"undefined"!=typeof Math}});function ar(){const e=atob;return{adBlock:["#ad-banner",".advertisement",e("I2FkLWNvbnRhaW5lcg=="),e("LmFkdmVydGlzZW1lbnQ="),e("W2NsYXNzKj0iYWQtIl0=")],uBlockOrigin:["#ublock-stats",".adsbygoogle",e("I2dvb2dsZV9hZHM="),e("LmFkc2J5Z29vZ2xl"),e("LnVibG9jay1ibG9ja2Vk")],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0"),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],privacyBadger:["#privacy-badger-popup",".privacy-badger-blocked",e("LnByaXZhY3ktYmFkZ2Vy")],ghostery:["#ghostery-popup",".ghostery-blocking",e("Lmdob3N0ZXJ5LWJsb2NrZWQ=")],brave:["#brave-ads-blocked",".brave-blocked",e("LmJyYXZlLWFkLWJsb2Nr")],facebookContainer:[".facebook-container-blocked",e("LmZiLWJsb2NrZWQ=")],cookieBlockers:[".cookie-notice-blocked","#cookie-banner-hidden",e("LmNvb2tpZS1ibG9ja2Vy")],trackingProtection:[".tracking-blocked","#tracking-protection-enabled",e("LnRyYWNrZXItYmxvY2tlZA==")]}}function sr(e){const t=document.createElement("div");if(e.startsWith("#"))t.id=e.substring(1);else if(e.startsWith("."))t.className=e.substring(1);else if(e.includes("["))try{const n=e.match(/\[([^=]+)([*^$|~]?=)"([^"]+)"\]/);if(n&&n[1]&&n[3]){const[,e,o,r]=n;"*="===o?t.setAttribute(e,`test-${r}-test`):t.setAttribute(e,r)}}catch{t.className="test-element"}else t.className=e.replace(/[^a-zA-Z0-9-_]/g,"");return t}function cr(e){const t=e.style;t.setProperty("visibility","hidden","important"),t.setProperty("display","block","important"),t.setProperty("position","absolute","important"),t.setProperty("left","-9999px","important"),t.setProperty("width","1px","important"),t.setProperty("height","1px","important"),t.setProperty("pointer-events","none","important"),t.setProperty("z-index","-1","important")}function lr(e){return new Promise(t=>setTimeout(t,e))}async function dr(e){const t=document,n=t.createElement("div"),o=new Array(e.length),r={};cr(n);const i=t.createDocumentFragment();for(let n=0;n<e.length;n++){const r=e[n];if(r)try{const e=sr(r),a=t.createElement("div");"DIALOG"===e.tagName&&e.show?.(),cr(a),a.appendChild(e),i.appendChild(a),o[n]=e}catch(e){o[n]=void 0}}n.appendChild(i);let a=0;for(;!t.body&&a<100;)await lr(50),a++;if(!t.body)throw new Error("Document body not available for DOM blockers detection");t.body.appendChild(n);try{await lr(50),await new Promise(t=>{requestAnimationFrame(()=>{for(let t=0;t<e.length;t++){const n=o[t],i=e[t];n&&i&&!n.offsetParent&&(r[i]=!0)}t()})})}finally{try{n.parentNode&&n.parentNode.removeChild(n)}catch(e){setTimeout(()=>{try{n.parentNode&&n.parentNode.removeChild(n)}catch{}},0)}}return r}async function ur(e={}){const{debug:t=!1,timeout:n=5e3}=e;try{if(!hr())return t&&console.log("[RabbitTracker] DOM Blockers detection not applicable for this browser"),"BROWSER_INCOMPATIBLE";if(!document||!document.body)return t&&console.log("[RabbitTracker] DOM not ready for blockers detection"),"DOM_NOT_AVAILABLE";const e=ar(),o=Object.keys(e),r=[].concat(...o.map(t=>e[t]||[])),i=new Promise((e,t)=>{setTimeout(()=>t(new Error("DOM blockers detection timeout")),n)}),a=await Promise.race([dr(r),i]);return t&&console.log("[RabbitTracker] DOM Blockers Debug:",{totalSelectors:r.length,blockedCount:Object.keys(a).length,blockedSelectors:a}),o.filter(t=>{const n=e[t];return!(!n||0===n.length)&&n.map(e=>a[e]).filter(Boolean).length>.6*n.length}).sort()}catch(e){if(t&&console.error("[RabbitTracker] DOM Blockers detection failed:",e),e instanceof Error){if(e.message.includes("timeout"))return"TIMEOUT";if("SecurityError"===e.name||e.message.includes("SecurityError"))return"SECURITY_ERROR"}return"NOT_SUPPORTED"}}function hr(){return B().canRunDOMBlockers}var mr=Object.freeze({__proto__:null,getBlockedSelectors:dr,getBlockerFilters:ar,getDomBlockers:ur,getDomBlockersFingerprint:async function(e={}){const t=await ur(e),n=Array.isArray(t)?t:[];return{activeBlockers:n,blockerCount:n.length,hasAdBlocker:n.some(e=>["adBlock","uBlockOrigin","adGuardBase","easyList"].includes(e)),hasPrivacyExtension:n.some(e=>["privacyBadger","ghostery","brave"].includes(e)),hasTrackingProtection:n.includes("trackingProtection")}},isDomBlockersDetectionAvailable:hr});function gr(){try{return E()?navigator.pdfViewerEnabled??null:null}catch{return null}}function pr(){try{if(!R())return-1;const{ApplePaySession:e}=window;if("function"!=typeof e?.canMakePayments)return-1;if(!_())return-2;if(window.self!==window.top)return-3;try{return e.canMakePayments()?1:0}catch(e){if(e instanceof Error&&"InvalidAccessError"===e.name)return-2;throw e}}catch{return-1}}function fr(){try{return"attributionReporting"in window||"privateClickMeasurement"in window||null}catch{return null}}function yr(){const e={enabled:!1,sameSiteSupport:!1,secureSupport:!1,partitionedSupport:!1};try{if(e.enabled=navigator.cookieEnabled,!e.enabled)return e;e.sameSiteSupport=vr("__rb_test_samesite","SameSite=Strict"),_()&&(e.secureSupport=vr("__rb_test_secure","Secure")),_()&&E()&&(e.partitionedSupport=vr("__rb_test_partitioned","Partitioned; Secure; SameSite=None"))}catch{}return e}function vr(e,t){try{const n="1",o=`${e}=${n}; ${t}; path=/`;document.cookie=o;const r=document.cookie.includes(`${e}=${n}`);return wr(e),r}catch{return wr(e),!1}}function wr(e){try{const t=[`${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/`,`${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=${location.hostname}`,`${e}=; max-age=0; path=/`,`${e}=; max-age=0; path=/; domain=${location.hostname}`];for(const e of t)try{document.cookie=e}catch{}setTimeout(()=>{try{document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/`}catch{}},100)}catch{}}function br(){try{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");return t?(t.getSupportedExtensions()||[]).sort():[]}catch{return[]}}function Sr(){try{const e=performance.memory;return e?{usedJSHeapSize:e.usedJSHeapSize,totalJSHeapSize:e.totalJSHeapSize,jsHeapSizeLimit:e.jsHeapSizeLimit}:null}catch{return null}}function Cr(){try{const e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return e?{effectiveType:e.effectiveType,downlink:e.downlink,rtt:e.rtt,saveData:e.saveData}:null}catch{return null}}function Ir(){const e={};try{e.webkitTemporaryStorage="webkitTemporaryStorage"in navigator,e.webkitPersistentStorage="webkitPersistentStorage"in navigator,window.safari&&(e.safariObjectTypes=Object.getOwnPropertyNames(window.safari)),e.chromeRuntime=!!window.chrome?.runtime,e.mozInnerScreenX="mozInnerScreenX"in window,e.msCredentials="msCredentials"in navigator}catch{}return e}var kr=Object.freeze({__proto__:null,getApplePayState:pr,getBrowserApisFingerprint:function(){const e=gr(),t=pr(),n=fr(),o=yr(),r=br(),i=Sr(),a=Cr(),s=Ir();let c="unknown";s.chromeRuntime?c="chrome":-1!==t?c="safari":s.mozInnerScreenX?c="firefox":s.msCredentials&&(c="edge");const l=Boolean(e||t>-1||n||i||a),d=[null!==e,-1!==t,null!==n,o.enabled,r.length>0,null!==i,null!==a,Object.keys(s).length>0];return{pdfViewerEnabled:e,applePayState:t,privateClickMeasurement:n,cookieCapabilities:o,webglExtensions:r,performanceMemory:i,connectionInfo:a,vendorProperties:s,browserVendor:c,hasNativeFeatures:l,apiScore:Math.round(d.filter(Boolean).length/d.length*100)}},getConnectionInfo:Cr,getCookieCapabilities:yr,getPdfViewerEnabled:gr,getPerformanceMemory:Sr,getPrivateClickMeasurement:fr,getVendorProperties:Ir,getWebGLExtensions:br,isBrowserApisDetectionAvailable:function(){return"undefined"!=typeof window&&"undefined"!=typeof navigator}});function Ar(){try{if(!Lr())return"NOT_SUPPORTED";const e=function(){try{return navigator.plugins||null}catch(e){if("SecurityError"===e.name)return null;throw e}}();if(!e)return"NAVIGATOR_UNAVAILABLE";const t=[];if(0===e.length)return t;for(let n=0;n<e.length;n++){const o=e[n];if(!o)continue;const r=[];if(o.length>0)for(let e=0;e<o.length;e++){const t=o[e];t&&t.type&&r.push(t.type)}t.push({name:o.name||"",filename:o.filename||"",description:o.description||"",version:o.version||void 0,mimeTypes:r})}return t.sort((e,t)=>e.name.localeCompare(t.name))}catch(e){return"SecurityError"===e.name?"SECURITY_RESTRICTED":[]}}function Er(){try{if(!navigator.mimeTypes||0===navigator.mimeTypes.length)return[];const e=[];for(let t=0;t<navigator.mimeTypes.length;t++){const n=navigator.mimeTypes[t];n&&n.type&&e.push(n.type)}return e.sort()}catch{return[]}}function Mr(){try{if(navigator.plugins&&Array.from(navigator.plugins).some(e=>e.name.toLowerCase().includes("flash")||e.description.toLowerCase().includes("flash")))return!0;if(navigator.mimeTypes&&Array.from(navigator.mimeTypes).some(e=>"application/x-shockwave-flash"===e.type))return!0;if(void 0!==window.ActiveXObject)try{return!!new window.ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch{return!1}return!1}catch{return!1}}function Tr(){try{if(navigator.plugins&&Array.from(navigator.plugins).some(e=>e.name.toLowerCase().includes("java")&&!e.name.toLowerCase().includes("javascript")))return!0;const e=["application/x-java-applet","application/x-java-bean","application/x-java-vm"];return!(!navigator.mimeTypes||!e.some(e=>Array.from(navigator.mimeTypes).some(t=>t.type===e)))||"function"==typeof navigator.javaEnabled&&navigator.javaEnabled()}catch{return!1}}function Rr(){try{if(navigator.plugins&&Array.from(navigator.plugins).some(e=>e.name.toLowerCase().includes("silverlight")))return!0;if(navigator.mimeTypes&&Array.from(navigator.mimeTypes).some(e=>"application/x-silverlight"===e.type))return!0;if(void 0!==window.ActiveXObject)try{return!!new window.ActiveXObject("AgControl.AgControl")}catch{return!1}return!1}catch{return!1}}function _r(){try{if(!E())return"NOT_SUPPORTED";if(!navigator.plugins)return"NAVIGATOR_UNAVAILABLE";const e=navigator.plugins.length;return 0===e||!window.chrome?.runtime&&!window.chrome?.webstore&&void 0!==window.chrome||!Array.from(navigator.plugins).some(e=>e.name.toLowerCase().includes("pdf")||e.name.toLowerCase().includes("chrome"))&&e<3}catch(e){return"SecurityError"===e.name&&"SECURITY_RESTRICTED"}}function xr(){try{if(!M())return"NOT_SUPPORTED";const e={mozInnerScreenX:"mozInnerScreenX"in window,mozPaintCount:"mozPaintCount"in window,mozApps:!!navigator.mozApps,buildID:!!navigator.buildID,oscpu:!!navigator.oscpu},t=Object.values(e).filter(Boolean).length;return 0===t||(navigator.plugins?0===navigator.plugins.length&&t<2:"NAVIGATOR_UNAVAILABLE")}catch(e){return"SecurityError"===e.name&&"SECURITY_RESTRICTED"}}function Dr(e){const t=["antivirus","security","firewall","malware","protection","kaspersky","norton","mcafee","avast","avira","bitdefender","eset","sophos","symantec","trend micro","f-secure"];return e.filter(e=>t.some(t=>e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t))).map(e=>e.name)}function Or(e){const t=["adblock","adblocker","ad block","ublock","ghostery","privacy badger","disconnect","noscript","tracking protection"];return e.filter(e=>t.some(t=>e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t))).map(e=>e.name)}function Nr(e,t,n,o){let r=50;return r+=10*e.length,r+=5*t.length,n&&(r-=15),o&&(r-=10),Math.max(0,Math.min(100,r))}function Fr(e,t){const n=e.map(e=>e.name).sort(),o=t.slice(0,10).sort();return[`plugins:${n.length}`,`mimes:${t.length}`,...n.slice(0,5),...o.slice(0,5)].join("|")}function Lr(){return B().canRunBrowserAPIs&&"undefined"!=typeof navigator}var Br=Object.freeze({__proto__:null,calculateSecurityScore:Nr,detectChromeExtensionsBlocked:_r,detectFirefoxExtensionsBlocked:xr,generatePluginSignature:Fr,getEnhancedPluginFingerprint:function(){const e=Ar(),t=Array.isArray(e)?e:[],n=Er(),o=Array.isArray(n)?n:[],r=Mr(),i=Tr(),a=Rr(),s=_r(),c="boolean"==typeof s&&s,l=xr(),d="boolean"==typeof l&&l,u=Dr(t),h=Or(t),m=Fr(t,o),g=Nr(u,h,r,i);return{plugins:t,pluginCount:t.length,mimeTypes:o,mimeTypeCount:o.length,flashEnabled:r,javaEnabled:i,silverLightEnabled:a,chromeExtensionsBlocked:c,firefoxExtensionsBlocked:d,securityPlugins:u,adBlockerPlugins:h,pluginSignature:m,securityScore:g}},getMimeTypes:Er,getNavigatorPlugins:Ar,identifyAdBlockerPlugins:Or,identifySecurityPlugins:Dr,isEnhancedPluginDetectionAvailable:Lr,testFlashEnabled:Mr,testJavaEnabled:Tr,testSilverlightEnabled:Rr});const Pr={canvas:{stability:.95,entropy:.9,uniqueness:.85,spoofResistance:.8},webgl:{stability:.92,entropy:.88,uniqueness:.82,spoofResistance:.85},audio:{stability:.9,entropy:.85,uniqueness:.8,spoofResistance:.9},hardware:{stability:.98,entropy:.7,uniqueness:.75,spoofResistance:.95},screen:{stability:.85,entropy:.6,uniqueness:.65,spoofResistance:.7},system:{stability:.8,entropy:.65,uniqueness:.7,spoofResistance:.6},browser:{stability:.75,entropy:.6,uniqueness:.65,spoofResistance:.5},fonts:{stability:.7,entropy:.75,uniqueness:.7,spoofResistance:.4},math:{stability:.95,entropy:.8,uniqueness:.9,spoofResistance:.95},storage:{stability:.6,entropy:.5,uniqueness:.6,spoofResistance:.3},incognito:{stability:.5,entropy:.4,uniqueness:.3,spoofResistance:.2},domBlockers:{stability:.8,entropy:.7,uniqueness:.6,spoofResistance:.9},accessibility:{stability:.9,entropy:.6,uniqueness:.7,spoofResistance:.85},browserApis:{stability:.85,entropy:.75,uniqueness:.8,spoofResistance:.7},pluginsEnhanced:{stability:.7,entropy:.65,uniqueness:.75,spoofResistance:.5},mathFingerprint:{stability:.99,entropy:.95,uniqueness:.9,spoofResistance:.98},fontPreferences:{stability:.92,entropy:.88,uniqueness:.85,spoofResistance:.75},dateTimeLocale:{stability:.95,entropy:.7,uniqueness:.75,spoofResistance:.8},accessibilityEnhanced:{stability:.93,entropy:.65,uniqueness:.8,spoofResistance:.9},enhancedFonts:{stability:.88,entropy:.85,uniqueness:.82,spoofResistance:.7}},Ur={domBlockers:{stability:.8,entropy:.7,uniqueness:.6,spoofResistance:.9},accessibility:{stability:.9,entropy:.6,uniqueness:.7,spoofResistance:.85},browserApis:{stability:.85,entropy:.75,uniqueness:.8,spoofResistance:.7}};function Wr(e){const t=Pr[e]||Ur[e];if(!t)return.5;const n=.3*t.stability+.25*t.entropy+.25*t.uniqueness+.2*t.spoofResistance;return Math.max(.1,Math.min(1,n))}var Vr=Object.freeze({__proto__:null,ADVANCED_COMPONENT_CHARACTERISTICS:Ur,COMPONENT_CHARACTERISTICS:Pr,calculateComponentWeight:Wr,calculateConfidence:function(e,t={}){const{requireMinimumComponents:n=4,penalizeMissingCore:o=!0,adjustForIncognito:r=!0}=t,i=e.filter(e=>e.success),a=[];i.length<n&&a.push(`Collect at least ${n} components for reliable identification`);let s=0,c=0,l=0,d=0,u=0;const h=["canvas","webgl","audio","hardware"].filter(e=>!i.some(t=>t.component===e));for(const e of i){const t=Wr(e.component),n=Pr[e.component]||Ur[e.component];n&&(s+=t,c+=n.stability*t,l+=n.entropy*t,d+=n.uniqueness*t,u+=n.spoofResistance*t)}const m=s>0?c/s:0,g=s>0?l/s:0,p=s>0?u/s:0;let f,y,v=.35*m+.25*g+.25*(s>0?d/s:0)+.15*p,w=v;return o&&h.length>0&&(w-=.1*h.length,a.push(`Missing core components: ${h.join(", ")}`)),i.length<6&&(w-=.05*(6-i.length)),r&&i.some(e=>"incognito"===e.component)&&(w+=.02),i.filter(e=>["domBlockers","accessibility","browserApis","math"].includes(e.component)).length>=2&&(w+=.05),w=Math.max(0,Math.min(1,w)),w>=.995?(f=.995,y="Very High"):w>=.99?(f=.99,y="High"):w>=.95?(f=.95,y="Medium"):w>=.8?(f=.8,y="Low"):(f=.5,y="Very Low",a.push("Consider implementing additional fingerprinting techniques")),w<.95&&a.push("Enable all available fingerprinting components for better accuracy"),p<.6&&a.push("Include more spoof-resistant components like audio and WebGL"),g<.6&&a.push("Add high-entropy components like canvas and math fingerprinting"),{score:f,level:y,factors:{componentCount:i.length,weightedScore:Math.round(1e3*v)/1e3,stabilityScore:Math.round(1e3*m)/1e3,entropyScore:Math.round(1e3*g)/1e3,spoofResistanceScore:Math.round(1e3*p)/1e3},recommendations:a.slice(0,3)}}});function Zr(){try{const e=screen,t=e.availTop??0,n=e.availLeft??0,o=e.availWidth??e.width,r=e.availHeight??e.height,i=t||null,a=e.width-o-n||null,s=e.height-r-t||null,c=n||null;if(null===i&&null===a&&null===s&&null===c)return null;const l=e=>null===e?null:10*Math.round(e/10);return{top:l(i),right:l(a),bottom:l(s),left:l(c)}}catch{return null}}function Gr(){try{const e=navigator.platform?.toLowerCase()||"",t=navigator.userAgent?.toLowerCase()||"";if(e.includes("win")&&(t.includes("wow64")||t.includes("x64")||t.includes("x86_64")))return 0;if(e.includes("linux")&&(e.includes("x86_64")||t.includes("x86_64")))return 0;if(e.includes("mac")&&(e.includes("intel")||t.includes("intel mac")))return 0;if(e.includes("x86")||e.includes("x64")||e.includes("intel")||e.includes("amd64")||t.includes("x86")||t.includes("amd64"))return 0;if(e.includes("arm")||t.includes("arm")||t.includes("aarch64")||e.includes("aarch64"))return 255;try{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(t&&"getExtension"in t&&"getParameter"in t){const e=t.getExtension("WEBGL_debug_renderer_info");if(e){const n=t.getParameter(e.UNMASKED_VENDOR_WEBGL)?.toLowerCase()||"",o=t.getParameter(e.UNMASKED_RENDERER_WEBGL)?.toLowerCase()||"";if(n.includes("intel")||n.includes("nvidia")||n.includes("amd")||o.includes("intel")||o.includes("nvidia")||o.includes("amd")||o.includes("radeon")||o.includes("geforce")||o.includes("quadro")||o.includes("iris")||o.includes("uhd")||o.includes("hd graphics"))return 0;if(o.includes("mali")||o.includes("adreno")||o.includes("powervr")||o.includes("tegra")||o.includes("apple gpu")||n.includes("arm")||o.includes("videocore"))return 255}}}catch{}try{const t=new Float32Array(1),n=new Uint8Array(t.buffer);t[0]=1/0,t[0]=t[0]-t[0];const o=n[3];return e.includes("linux"),o}catch{return}}catch{return}}function zr(){try{const e=navigator;let t=0;void 0!==e.maxTouchPoints?t=e.maxTouchPoints:void 0!==e.msMaxTouchPoints&&(t=e.msMaxTouchPoints);let n=!1;try{document.createEvent("TouchEvent"),n=!0}catch{n=!1}return{maxTouchPoints:t,touchEvent:n,touchStart:"ontouchstart"in window}}catch{return}}function Hr(){const e=[],t=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];for(const n of t){const t=window[n];t&&"object"==typeof t&&e.push(n)}return e.sort()}function jr(){try{const e=navigator.deviceMemory;if("number"==typeof e)return Math.round(e);if("string"==typeof e){const t=parseFloat(e);return isNaN(t)?void 0:Math.round(t)}return}catch{return}}function qr(){try{return screen.colorDepth||void 0}catch{return}}function Kr(){try{for(const e of["rec2020","p3","srgb"])if(window.matchMedia(`(color-gamut: ${e})`).matches)return e;return}catch{return}}var Xr=Object.freeze({__proto__:null,collectDeviceSignals:function(){return{screenFrame:Zr(),hardwareConcurrency:navigator.hardwareConcurrency||void 0,deviceMemory:jr(),architecture:Gr(),touchSupport:zr(),vendorFlavors:Hr(),cpuClass:navigator.cpuClass||void 0,colorDepth:qr(),colorGamut:Kr()}}});return e.Zaplier=lo,e.ZaplierSDK=so,e.analyzeUserAgent=function(e){const t=e||navigator.userAgent||"",n=function(e){const t=e.toLowerCase();if(t.includes("edg/")){const t=Bo(e,/edg\/([0-9.]+)/i);return{name:"Edge",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("edge/")){const t=Bo(e,/edge\/([0-9.]+)/i);return{name:"Edge Legacy",version:t,major:t.split(".")[0]||"Unknown",engine:"edgehtml"}}if(t.includes("brave/")||navigator.brave){const t=Bo(e,/chrome\/([0-9.]+)/i);return{name:"Brave",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(No()){const t=Bo(e,/samsungbrowser\/([0-9.]+)/i);return{name:"Samsung Internet",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("chrome/")&&!t.includes("edg")){const t=Bo(e,/chrome\/([0-9.]+)/i);return{name:"Chrome",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("firefox/")){const t=Bo(e,/firefox\/([0-9.]+)/i);return{name:"Firefox",version:t,major:t.split(".")[0]||"Unknown",engine:"gecko"}}if(t.includes("safari/")&&!t.includes("chrome")){const t=Bo(e,/version\/([0-9.]+)/i);return{name:"Safari",version:t,major:t.split(".")[0]||"Unknown",engine:"webkit"}}if(t.includes("opr/")||t.includes("opera/")){const t=Bo(e,/(?:opr|opera)\/([0-9.]+)/i);return{name:"Opera",version:t,major:t.split(".")[0]||"Unknown",engine:xo()?"chromium":"unknown"}}if(t.includes("vivaldi/")){const t=Bo(e,/vivaldi\/([0-9.]+)/i);return{name:"Vivaldi",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("yabrowser/")){const t=Bo(e,/yabrowser\/([0-9.]+)/i);return{name:"Yandex Browser",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("msie")||t.includes("trident/")){const t=Bo(e,/(?:msie |rv:)([0-9.]+)/i);return{name:"Internet Explorer",version:t,major:t.split(".")[0]||"Unknown",engine:"trident"}}if(t.includes("ucbrowser/")){const t=Bo(e,/ucbrowser\/([0-9.]+)/i);return{name:"UC Browser",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("qqbrowser/")){const t=Bo(e,/qqbrowser\/([0-9.]+)/i);return{name:"QQ Browser",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}return{name:"Unknown",version:"Unknown",major:"Unknown",engine:"unknown"}}(t),o=function(e){const t=e.toLowerCase();if(t.includes("windows nt")){const t=Bo(e,/windows nt ([0-9.]+)/i);let n="Windows";switch(t){case"10.0":n="Windows 10/11";break;case"6.3":n="Windows 8.1";break;case"6.2":n="Windows 8";break;case"6.1":n="Windows 7";break;case"6.0":n="Windows Vista";break;case"5.1":n="Windows XP";break;default:n="Windows"}return{name:n,version:t,family:"windows"}}return t.includes("mac os x")||t.includes("macos")?{name:"macOS",version:Bo(e,/mac os x ([0-9._]+)/i).replace(/_/g,"."),family:"macos"}:t.includes("iphone")||t.includes("ipad")||t.includes("ipod")||Fo()?{name:"iOS",version:Bo(e,/os ([0-9._]+)/i).replace(/_/g,"."),family:"ios"}:Lo()?{name:"Android",version:Bo(e,/android ([0-9.]+)/i),family:"android"}:t.includes("linux")?{name:"Linux",version:"Unknown",family:"linux"}:t.includes("cros")?{name:"Chrome OS",version:Bo(e,/cros [a-z0-9_]+ ([0-9.]+)/i),family:"linux"}:t.includes("freebsd")?{name:"FreeBSD",version:"Unknown",family:"unix"}:{name:"Unknown",version:"Unknown",family:"unknown"}}(t),r=Po(t),i=function(e){const t=[];let n="legitimate";const o=["bot","crawler","spider","scraper","automation","headless","phantom","selenium","webdriver","google","bing","yahoo","baidu","yandex","facebook","twitter","linkedin","whatsapp"];for(const r of o)e.toLowerCase().includes(r)&&(t.push(r),["bot","crawler","spider","scraper"].some(e=>r.includes(e))?n="crawler":["selenium","webdriver","automation"].some(e=>r.includes(e))?n="automation":["headless","phantom"].some(e=>r.includes(e))&&(n="headless"));return e.length<10&&t.push("too_short"),e&&"Mozilla/5.0"!==e||t.push("generic_mozilla"),{isBot:t.length>0,patterns:t,category:n}}(t);return{browser:{name:n.name,version:n.version,major:n.major,engine:n.engine},os:{name:o.name,version:o.version,family:o.family},device:{type:r.type,vendor:r.vendor,model:r.model},suspicious:{isBot:i.isBot,patterns:i.patterns,category:i.category},isMobile:"mobile"===r.type,isTablet:"tablet"===r.type,isDesktop:"desktop"===r.type,isBot:i.isBot,raw:t}},e.autoInitializeFromScript=uo,e.clearFingerprintCache=function(){it.clear()},e.collectFingerprint=lt,e.default=so,e.detectBot=async function(){const e={webDriver:go(),headlessBrowser:po(),automationTools:fo(),domBlockers:yo(),missingLanguages:vo(),inconsistentEval:wo(),humanBehavior:{detected:!1,confidence:0,method:"not_implemented"},mouseMovement:{detected:!1,confidence:0,method:"not_implemented"},clickPatterns:{detected:!1,confidence:0,method:"not_implemented"},canvasInconsistency:{detected:!1,confidence:0,method:"not_implemented"},webglAnomaly:{detected:!1,confidence:0,method:"not_implemented"},missingPlugins:{detected:0===navigator.plugins.length,confidence:30,method:"plugin_count"},inconsistentProperties:{detected:!1,confidence:0,method:"not_implemented"},modifiedBuiltins:{detected:!1,confidence:0,method:"not_implemented"}},t=bo(),n=Object.values(e).filter(e=>e.detected),o=n.reduce((e,t)=>e+t.confidence,0),r=n.length>0?o/n.length:0,i=n.length>=2||n.some(e=>e.confidence>=90)||(t.suspicious?.isBot??!1);let a="low";return r>=70?a="high":(r>=40||n.length>=2)&&(a="medium"),{isBot:i,confidence:Math.round(Math.min(r,95)),riskLevel:a,detectionMethods:Object.keys(e).filter(t=>e[t]?.detected),detectors:e,userAgent:t}},e.detectIncognitoMode=async function(){!function(){const e=navigator.userAgent.toLowerCase();e.includes("chrome")||e.includes("firefox")||e.includes("safari")||e.includes("edge")}();const e=navigator.userAgent,t=/Chrome/.test(e)&&!/Edg|OPR/.test(e),n=/Safari/.test(e)&&!/Chrome/.test(e),o=/Firefox/.test(e),r=/Edg/.test(e),i=2e3,[a,s,c,l,d,u,h,m,g]=await Promise.allSettled([Promise.race([So(),_o(i,"localStorage")]),Promise.race([Co(),_o(i,"sessionStorage")]),Promise.race([Io(),_o(i,"indexedDB")]),Promise.race([ko(),_o(i,"permissions")]),Promise.race([Ao(),_o(i,"quotaManagement")]),Promise.race([To(),_o(i,"filesystem")]),Promise.race([Ro(),_o(i,"cacheDetection")]),Promise.race([Eo(),_o(i,"chromeSpecific")]),Promise.race([Mo(),_o(i,"safariSpecific")])]),p=[];[{name:"localStorage",result:a},{name:"sessionStorage",result:s},{name:"indexedDB",result:c},{name:"permissions",result:l},{name:"quotaManagement",result:d},{name:"filesystem",result:u},{name:"cacheDetection",result:h},{name:"chromeSpecific",result:m},{name:"safariSpecific",result:g}].forEach(({name:e,result:i})=>{if("fulfilled"===i.status&&i.value.detected){const a=function(e,t,n){const o=Math.floor(.5*n);switch(e){case"quotaManagement":return t.isChrome||t.isEdge?Math.min(50,o+25):t.isSafari?Math.min(40,o+15):Math.min(30,o+10);case"filesystem":return t.isChrome||t.isEdge?Math.min(40,o+20):Math.max(5,o-5);case"indexedDB":return t.isFirefox?Math.min(45,o+20):t.isSafari?Math.min(35,o+10):o;case"localStorage":return Math.max(5,o-15);case"sessionStorage":return Math.max(5,o-10);case"permissions":return t.isChrome?Math.min(30,o+10):Math.max(5,o-5);case"cacheDetection":return Math.max(5,o-20);case"chromeSpecific":return t.isChrome?Math.min(50,o+30):0;case"safariSpecific":return t.isSafari?Math.min(45,o+25):0;default:return Math.max(5,o)}}(e,{isChrome:t,isSafari:n,isFirefox:o,isEdge:r},i.value.confidence);p.push({method:i.value.method,confidence:i.value.confidence,weight:a})}});const f=p.reduce((e,t)=>e+t.weight,0),y=p.reduce((e,t)=>e+t.confidence*t.weight/100,0);let v;v=n?35:t||r?45:o?40:50;const w=f>=v,b=f>0?Math.min(95,y/f*100):0,S="fulfilled"===a.status?a.value:{detected:!1},C="fulfilled"===s.status?s.value:{detected:!1},I="fulfilled"===c.status?c.value:{detected:!1},k="fulfilled"===l.status?l.value:{},A="fulfilled"===d.status?d.value:{detected:!1};return"fulfilled"===u.status&&u.value,"fulfilled"===h.status&&h.value,"undefined"!=typeof window&&window.RabbitTracker?.config?.debug&&console.debug("Incognito Detection Analysis:",{browserInfo:{isChrome:t,isSafari:n,isFirefox:o,isEdge:r},detectedSignals:p,totalWeight:f,minWeightThreshold:v,finalConfidence:b,isDetected:w}),{isIncognito:w,confidence:Math.round(b),detectionMethods:p.map(e=>e.method),details:{localStorage:S?.detected??!1,sessionStorage:C?.detected??!1,indexedDB:I?.detected??!1,cookiesEnabled:!1,quota:A?.detected?0:null,permissions:k?.details||{}}}},e.generateVisitorId=l,e.generateVisitorIdFromFingerprint=function(e){return l(e.hash)},e.getAvailableComponents=function(){const e=[];return z()&&e.push("canvas"),fe()&&e.push("webgl"),v()&&e.push("audio"),J()&&e.push("fonts"),ee()&&e.push("screen"),U()&&e.push("browser"),e},e.getBrowserEngine=function(){return xo()?"chromium":Do()?"webkit":Oo()?"gecko":navigator.userAgent.toLowerCase().includes("trident")?"trident":"unknown"},e.getCompleteFingerprint=ut,e.getLightweightFingerprint=dt,e.hash32=s,e.hashFingerprint=c,e.isAndroid=Lo,e.isChromium=xo,e.isDesktop=function(){return"desktop"===Po(navigator.userAgent).type},e.isFingerprintingAvailable=function(){return ee()&&U()},e.isGecko=Oo,e.isIPad=Fo,e.isMobile=function(){return"mobile"===Po(navigator.userAgent).type},e.isSamsungInternet=No,e.isTablet=function(){return"tablet"===Po(navigator.userAgent).type},e.isWebKit=Do,e.quickBotDetection=async function(){const e=go(),t=bo();return e.detected||(t.suspicious?.isBot??!1)},e.quickIncognitoDetection=async function(){try{const[e,t]=await Promise.all([So(),Io()]);return e.detected||t.detected}catch{return!1}},e.x64hash128=a,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
7
+ var e=function(e){"use strict";function t(e,t){const n=e[1]+t[1]&4294967295;return[e[0]+t[0]+(n<e[1]?1:0)&4294967295,n]}function n(e,t){const n=65535&e[1],r=e[1]>>>16,o=65535&t[1],i=t[1]>>>16,s=n*i+r*o&4294967295,a=r*i+(s>>>16),c=n*o+((65535&s)<<16)&4294967295;return[e[0]*t[1]+e[1]*t[0]+a&4294967295,c]}function r(e,t){return 0==(t%=64)?e:t<32?[4294967295&(e[0]<<t|e[1]>>>32-t),4294967295&(e[1]<<t|e[0]>>>32-t)]:(t-=32,[4294967295&(e[1]<<t|e[0]>>>32-t),4294967295&(e[0]<<t|e[1]>>>32-t)])}function o(e,t){return[e[0]^t[0],e[1]^t[1]]}function i(e){let t=e;return t=o(t,[0,t[0]>>>1]),t=n(t,[4283543511,3981806797]),t=o(t,[0,t[0]>>>1]),t=n(t,[3301882366,444984403]),t=o(t,[0,t[0]>>>1]),t}function s(e,s=0){const a=function(e){const t=[];for(let n=0;n<e.length;n+=4){let r=0;for(let t=Math.min(3,e.length-n-1);t>=0;t--)r=r<<8|e.charCodeAt(n+t);t.push(r)}return t}(e),c=Math.floor(a.length/4);let l=[0,s],u=[0,s];const h=[2277735313,289559509],d=[1291169091,658871167];for(let e=0;e<c;e++){const i=4*e,s=4*e+2;let c=[a[i+1]||0,a[i]||0],p=[a[s+1]||0,a[s]||0];c=n(c,h),c=r(c,31),c=n(c,d),l=o(l,c),l=r(l,27),l=t(l,u),l=t(n(l,[0,5]),[0,1390208809]),p=n(p,d),p=r(p,33),p=n(p,h),u=o(u,p),u=r(u,31),u=t(u,l),u=t(n(u,[0,5]),[0,944331445])}const p=4*c,m=a.length-p;let f=[0,0],g=[0,0];return m>=12&&(g=o(g,[a[p+3]||0,0])),m>=8&&(g=o(g,[0,a[p+2]||0]),g=n(g,d),g=r(g,33),g=n(g,h),u=o(u,g)),m>=4&&(f=o(f,[a[p+1]||0,0])),m>=1&&(f=o(f,[0,a[p]||0]),f=n(f,h),f=r(f,31),f=n(f,d),l=o(l,f)),l=o(l,[0,e.length]),u=o(u,[0,e.length]),l=t(l,u),u=t(u,l),l=i(l),u=i(u),l=t(l,u),u=t(u,l),(l[0]>>>0).toString(16).padStart(8,"0")+(l[1]>>>0).toString(16).padStart(8,"0")+((u[0]>>>0).toString(16).padStart(8,"0")+(u[1]>>>0).toString(16).padStart(8,"0"))}function a(e){let t=0;if(0===e.length)return t.toString(36);for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return Math.abs(t).toString(36)}function c(e,t=!1){const n=h(e),r=JSON.stringify(n);t&&console.log("[RabbitTracker] hashFingerprint debug:",{originalKeys:Object.keys(e),canonicalizedKeys:Object.keys(n),canonicalLength:r.length,sample:r.substring(0,200)+"..."});const o=s(r);return t&&console.log("[RabbitTracker] Generated fingerprintHash:",o.substring(0,32)),o}function l(e){return"vis_"+e.substring(0,16)}function u(e){return["duration","timestamp","error","errors","collectionTime","startTime","endTime","_timestamp"].includes(e)||e.endsWith("_timestamp")||e.endsWith("Timestamp")}function h(e){if(null==e)return null;if(Array.isArray(e))return e.map(e=>h(e)).filter(e=>null!==e).sort((e,t)=>JSON.stringify(e).localeCompare(JSON.stringify(t)));if("object"==typeof e){const t=Object.keys(e).sort(),n={};for(const r of t){if(u(r))continue;const t=h(e[r]);null!==t&&(n[r]=t)}return n}return"number"==typeof e?Number.isFinite(e)?Math.abs(e)<1e-4?0:Math.abs(e)>1e6?e>0?1e6:-1e6:Number(e>=.1&&e<=10?e.toFixed(3):e.toFixed(2)):0:"string"==typeof e?e.trim().toLowerCase():"boolean"==typeof e?e:null}const d={SAMPLE_RATE:44100,DURATION:.1,FREQUENCIES:[440,1e3,1760,3520],COMPRESSOR_THRESHOLD:-50,COMPRESSOR_KNEE:40,COMPRESSOR_RATIO:12,COMPRESSOR_ATTACK:.003,COMPRESSOR_RELEASE:.25,FILTER_FREQUENCY:2e3,GAIN_VALUE:.5,DELAY_TIME:.02};function p(){try{const e=window.OfflineAudioContext||window.webkitOfflineAudioContext;if(!e)return null;const t=44100,n=d.DURATION;return new e(1,Math.floor(t*n),t)}catch{return null}}async function m(e){try{const t=d.FREQUENCIES.map((t,n)=>{const r=e.createOscillator(),o=["sine","square","sawtooth","triangle"],i=o[n%o.length];return r.type=i||"sine",r.frequency.setValueAtTime(t,e.currentTime),r}),n=e.createDynamicsCompressor(),r=e.createBiquadFilter(),o=e.createGain(),i=e.createDelay(),s=e.createAnalyser();n.threshold.setValueAtTime(d.COMPRESSOR_THRESHOLD,e.currentTime),n.knee.setValueAtTime(d.COMPRESSOR_KNEE,e.currentTime),n.ratio.setValueAtTime(d.COMPRESSOR_RATIO,e.currentTime),n.attack.setValueAtTime(d.COMPRESSOR_ATTACK,e.currentTime),n.release.setValueAtTime(d.COMPRESSOR_RELEASE,e.currentTime),r.type="bandpass",r.frequency.setValueAtTime(d.FILTER_FREQUENCY,e.currentTime),r.Q.setValueAtTime(.7,e.currentTime),o.gain.setValueAtTime(d.GAIN_VALUE,e.currentTime),i.delayTime.setValueAtTime(d.DELAY_TIME,e.currentTime);const c=e.createGain();c.gain.setValueAtTime(.25,e.currentTime),t.forEach(e=>{e.connect(c)}),c.connect(r),r.connect(n),n.connect(o),o.connect(i),i.connect(s),s.connect(e.destination),t.forEach((e,t)=>{e.start(.01*t),e.stop(d.DURATION)});const l=(await e.startRendering()).getChannelData(0),u=[];for(let e=0;e<32;e++){const t=Math.floor(l.length/32*e);u.push(l[t]||0)}const h=Math.sqrt(u.reduce((e,t)=>e+t*t,0)/u.length),p=Math.max(...u.map(Math.abs)),m=u.reduce((e,t)=>e+Math.abs(t),0)/u.length;let f=0;for(let e=0;e<Math.min(u.length,16);e++){const t=u[e];void 0!==t&&(f+=e*Math.abs(t))}return a([...u,h,p,m,f].join(","))}catch(e){return a("multi_oscillator_error")}}async function f(e){try{const t=[100,440,1e3,2e3,4e3,8e3,12e3,16e3],n=[];for(const r of t){const t=e.createOscillator(),o=e.createAnalyser();t.type="sine",t.frequency.setValueAtTime(r,e.currentTime),o.fftSize=256,o.smoothingTimeConstant=0,t.connect(o),o.connect(e.destination),t.start(),t.stop(.05);const i=p();if(i){const e=i.createOscillator();e.type="sine",e.frequency.setValueAtTime(r,i.currentTime),e.connect(i.destination),e.start(),e.stop(.05);try{const e=(await i.startRendering()).getChannelData(0),t=Math.sqrt(e.reduce((e,t)=>e+t*t,0)/e.length);n.push(t)}catch{n.push(0)}}}return a(n.join(","))}catch(e){return a("frequency_response_error")}}async function g(e){try{const t=e.createOscillator(),n=e.createDynamicsCompressor();t.type="triangle",t.frequency.setValueAtTime(d.FREQUENCIES[0],e.currentTime),n.threshold.setValueAtTime(d.COMPRESSOR_THRESHOLD,e.currentTime),n.knee.setValueAtTime(d.COMPRESSOR_KNEE,e.currentTime),n.ratio.setValueAtTime(d.COMPRESSOR_RATIO,e.currentTime),n.attack.setValueAtTime(d.COMPRESSOR_ATTACK,e.currentTime),n.release.setValueAtTime(d.COMPRESSOR_RELEASE,e.currentTime),t.connect(n),n.connect(e.destination),t.start(),t.stop(d.DURATION);const r=(await e.startRendering()).getChannelData(0);return a([r[0]||0,r[Math.floor(.25*r.length)]||0,r[Math.floor(.5*r.length)]||0,r[Math.floor(.75*r.length)]||0,r[r.length-1]||0].join(","))}catch(e){return a("compressor_error")}}async function y(){const e=performance.now();try{const t=function(){try{const e=window.OfflineAudioContext||window.webkitOfflineAudioContext;if(e)try{return new e(1,1,44100).sampleRate}catch{}const t=window.AudioContext||window.webkitAudioContext;if(t)try{const e=new t,n=e.sampleRate;return e.close().catch(()=>{}),n}catch{}}catch{}return 44100}(),n=function(){const e={};try{const t=p();if(t){e.sampleRate=t.sampleRate,e.length=t.length,e.state=t.state;const n=[],r=[8e3,22050,44100,48e3,96e3];for(const e of r)try{const t=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,1,e);t.sampleRate===e&&n.push(e),"close"in t&&"function"==typeof t.close&&t.close()}catch{}e.supportedSampleRates=n,"baseLatency"in t&&(e.baseLatency=t.baseLatency),"close"in t&&"function"==typeof t.close&&t.close()}}catch(t){e.error="context_characteristics_error"}return e}(),r={multiOsc:p(),compressor:p(),frequencyResponse:p()};if(!r.multiOsc||!r.compressor||!r.frequencyResponse)throw new Error("OfflineAudioContext not available");const[o,i,s]=await Promise.all([m(r.multiOsc).catch(()=>"multi_oscillator_error"),g(r.compressor).catch(()=>"compressor_error"),f(r.frequencyResponse).catch(()=>"frequency_response_error")]),c={};try{const e=p();if(e){const t=["createOscillator","createAnalyser","createBiquadFilter","createConvolver","createDelay","createDynamicsCompressor","createGain","createWaveShaper","createStereoPanner","createChannelSplitter","createChannelMerger"];for(const n of t)try{"function"==typeof e[n]&&(e[n](),c[n]=!0)}catch{c[n]=!1}"close"in e&&"function"==typeof e.close&&e.close()}}catch{}const l=a([o,i,s,t.toString(),JSON.stringify(n),JSON.stringify(c)].join("|")),u=performance.now();return{value:{oscillator:o,compressor:i,sampleRate:t,maxChannelCount:n.supportedSampleRates?.length||2,multiOscillatorFingerprint:o,frequencyResponseFingerprint:s,contextCharacteristics:n,nodeCapabilities:c,audioStackHash:l,supportedSampleRates:n.supportedSampleRates||[]},duration:u-e}}catch(t){return{value:{oscillator:"error",compressor:"error",sampleRate:0,maxChannelCount:0,multiOscillatorFingerprint:"error",frequencyResponseFingerprint:"error",contextCharacteristics:{},nodeCapabilities:{},audioStackHash:"error",supportedSampleRates:[]},duration:performance.now()-e,error:t instanceof Error?t.message:"Audio fingerprinting failed"}}}function w(){try{return"function"==typeof(window.OfflineAudioContext||window.webkitOfflineAudioContext)||"function"==typeof(window.AudioContext||window.webkitAudioContext)}catch{return!1}}function b(){try{return"WebKitAppearance"in document.documentElement.style||"webkitRequestFileSystem"in window||"webkitResolveLocalFileSystemURL"in window||Boolean(window.safari)}catch{return!1}}function v(){try{return"ontouchstart"in window&&("orientation"in window||"onorientationchange"in window)&&/android/i.test(navigator.userAgent)}catch{return!1}}function S(){try{if("brave"in navigator&&navigator.brave)return!0;const e=navigator.userAgent;return!!e.includes("Brave")||!(!window.chrome||!window.chrome.runtime||window.chrome.webstore||window.navigator.getBattery||!/Chrome/.test(e))}catch{return!1}}function C(){try{const e=navigator.userAgent;return!!(e.includes("Arc/")||window.arc||window.Arc||window.chrome&&window.chrome.runtime&&/Chrome/.test(e)&&(e.includes("ArcBrowser")||"arc:"===window.location.protocol))}catch{return!1}}function k(){try{if(window.opr||window.opera)return!0;const e=navigator.userAgent;return!(!e.includes("OPR/")&&!e.includes("Opera/"))}catch{return!1}}function I(){try{return!!navigator.userAgent.includes("Vivaldi/")||!!window.vivaldi}catch{return!1}}function E(){try{const e=navigator.userAgent;return e.includes("SamsungBrowser/")||e.includes("Samsung Internet")}catch{return!1}}function M(){try{return!(S()||C()||k()||I()||A()||E())&&Boolean(window.chrome&&(window.chrome.webstore||window.chrome.runtime)&&/Chrome/.test(navigator.userAgent)&&!/Edg|OPR|Opera|Vivaldi|SamsungBrowser|Arc|Brave/.test(navigator.userAgent))}catch{return!1}}function x(){try{return"InstallTrigger"in window||"mozInnerScreenX"in window||"mozPaintCount"in window||Boolean(navigator.mozApps)}catch{return!1}}function A(){try{return"msCredentials"in navigator||Boolean(window.StyleMedia)||M()&&/edg/i.test(navigator.userAgent)}catch{return!1}}function R(){try{return b()&&!M()&&!A()&&Boolean(window.safari)&&/safari/i.test(navigator.userAgent)}catch{return!1}}function T(){try{return window.isSecureContext||"https:"===location.protocol}catch{return!1}}function O(){try{return"webkitTemporaryStorage"in navigator||navigator.storage&&navigator.storage.estimate&&navigator.storage.estimate().then(e=>(e.quota||0)<104857600),!1}catch{return!1}}function _(){return S()||C()||k()||I()||E()||M()?"Blink":A()?"EdgeHTML/Blink":x()?"Gecko":b()||R()?"WebKit":"Unknown"}function D(){const e=function(){try{if(S())return"Brave";if(C())return"Arc";if(k())return"Opera";if(I())return"Vivaldi";if(E())return"Samsung Internet";if(A())return"Edge";if(x())return"Firefox";if(R())return"Safari";if(M())return"Chrome";const e=navigator.userAgent;return/Firefox/i.test(e)&&!M()?"Firefox":/Safari/i.test(e)&&!M()?"Safari":/Chrome/i.test(e)?"Chrome":"Unknown"}catch{return"Unknown"}}(),t=_(),n=["Brave","Arc","Opera","Vivaldi","Samsung Internet","Edge","Chrome"].includes(e);let r=e.toLowerCase();return n&&"Chrome"!==e&&(r=`${e.toLowerCase()}-chromium`),{name:e,engine:t,isChromiumBased:n,family:r}}function P(){try{return"undefined"!=typeof document&&"function"==typeof document.createElement&&void 0!==document.body}catch{return!1}}function L(){try{if(!P())return!1;const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(!t)return!1;const n=t,r=n.getParameter(n.RENDERER),o=Boolean(r&&"string"==typeof r),i=n.getExtension("WEBGL_lose_context");return i&&i.loseContext(),o}catch{return!1}}function N(){try{return!(!window.AudioContext&&!window.webkitAudioContext)}catch{return!1}}function F(){const e=P(),t=function(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia}catch{return!1}}();return{engine:_(),supportsDOM:e,supportsMediaQueries:t,supportsWebGL:L(),supportsAudio:N(),isSecure:T(),isPrivateMode:O(),canRunDOMBlockers:(b()||v())&&e,canRunAccessibility:t,canRunBrowserAPIs:e&&"undefined"!=typeof navigator}}async function B(){const e=performance.now();try{const t=function(){try{const e=navigator.language||"";let t=[];navigator.languages?t=Array.from(navigator.languages):navigator.language&&(t=[navigator.language]);const n=[navigator.userLanguage,navigator.browserLanguage,navigator.systemLanguage].filter(Boolean);return t=[...new Set([...t,...n])],{language:e,languages:t}}catch{return{language:"",languages:[]}}}(),n=function(){try{let e="";if(Intl&&Intl.DateTimeFormat)try{e=Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}if(!e){const t=new Date(2024,0,1).getTimezoneOffset(),n=t>0?"-":"+",r=Math.floor(Math.abs(t)/60),o=Math.abs(t)%60;e=`UTC${n}${r.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`}return{timezone:e,timezoneOffset:new Date(2024,0,1).getTimezoneOffset()}}catch{return{timezone:"",timezoneOffset:0}}}(),r=function(){try{return{platform:navigator.platform||"",userAgent:navigator.userAgent||""}}catch{return{platform:"",userAgent:""}}}(),o=function(){try{const e=navigator.hardwareConcurrency||0;let t;"deviceMemory"in navigator&&(t=navigator.deviceMemory);const n={hardwareConcurrency:e};return void 0!==t&&(n.deviceMemory=t),n}catch{return{hardwareConcurrency:0}}}(),i=function(){try{const e=!1!==navigator.cookieEnabled;let t=null;return"doNotTrack"in navigator?t=navigator.doNotTrack:"msDoNotTrack"in navigator?t=navigator.msDoNotTrack:"mozDoNotTrack"in window&&(t=window.mozDoNotTrack),{cookieEnabled:e,doNotTrack:t}}catch{return{cookieEnabled:!0,doNotTrack:null}}}(),s=function(){try{if(!navigator.plugins)return{length:0,names:[]};const e=Array.from(navigator.plugins).map(e=>e.name).filter(e=>e).sort();return{length:navigator.plugins.length,names:e.slice(0,10)}}catch{return{length:0,names:[]}}}(),a=function(){try{let e=0,t=!1,n=!1;"maxTouchPoints"in navigator?e=navigator.maxTouchPoints:"msMaxTouchPoints"in navigator&&(e=navigator.msMaxTouchPoints);try{t="TouchEvent"in window}catch{t="ontouchstart"in window}return n="ontouchstart"in window,{maxTouchPoints:e,touchEvent:t,touchStart:n}}catch{return{maxTouchPoints:0,touchEvent:!1,touchStart:!1}}}(),c=function(){try{return D()}catch{return{name:"Unknown",engine:"Unknown",isChromiumBased:!1,family:"unknown"}}}(),l=performance.now(),u={language:t.language,languages:t.languages,timezone:n.timezone,timezoneOffset:n.timezoneOffset,platform:r.platform,userAgent:r.userAgent,browserInfo:c,hardwareConcurrency:o.hardwareConcurrency,cookieEnabled:i.cookieEnabled,doNotTrack:i.doNotTrack,plugins:s,touchSupport:a};return void 0!==o.deviceMemory&&(u.deviceMemory=o.deviceMemory),{value:u,duration:l-e}}catch(t){return{value:{language:"",languages:[],timezone:"",timezoneOffset:0,platform:"",userAgent:"",hardwareConcurrency:0,cookieEnabled:!0,doNotTrack:null,plugins:{length:0,names:[]},touchSupport:{maxTouchPoints:0,touchEvent:!1,touchStart:!1}},duration:performance.now()-e,error:t instanceof Error?t.message:"Browser fingerprinting failed"}}}function U(){try{return"object"==typeof navigator&&null!==navigator}catch{return!1}}const z=["Zap Canvas 🎨🔒2024","Żółć gęślą jaźń €$¢£¥","αβγδεζηθικλμνξο","中文测试字体渲染","🌟🎯🚀💎🌊🎨"];function W(e){e.imageSmoothingEnabled=!0,e.imageSmoothingQuality="high";const t=e.createRadialGradient(75,75,0,75,75,50);t.addColorStop(0,"rgba(255, 0, 0, 0.8)"),t.addColorStop(.3,"rgba(0, 255, 0, 0.6)"),t.addColorStop(.7,"rgba(0, 0, 255, 0.4)"),t.addColorStop(1,"rgba(255, 255, 0, 0.2)"),e.fillStyle=t,e.fillRect(10,10,130,100),e.fillStyle="rgba(102, 204, 0, 0.7)",e.fillRect(15.5,15.3,49.7,49.2),e.fillStyle="#f60",e.fillRect(70.3,10.7,50.1,50.9),e.beginPath(),e.moveTo(25.2,120.1),e.bezierCurveTo(25.2,120.1,75.8,90.3,125.5,120.7),e.bezierCurveTo(125.5,120.7,90.1,150.2,60.8,140.9),e.closePath(),e.fillStyle="rgba(200, 100, 50, 0.6)",e.fill(),e.globalCompositeOperation="multiply",e.beginPath(),e.arc(50.7,80.3,20.1,0,2*Math.PI),e.fillStyle="rgba(255, 0, 100, 0.5)",e.fill(),e.beginPath(),e.arc(70.3,80.7,20.9,0,2*Math.PI),e.fillStyle="rgba(0, 255, 100, 0.5)",e.fill(),e.globalCompositeOperation="source-over",e.strokeStyle="rgba(50, 50, 50, 0.8)",e.lineWidth=.5,e.setLineDash([2.3,1.7]);for(let t=0;t<10;t++)e.beginPath(),e.moveTo(10+13.7*t,160),e.lineTo(50+11.3*t,200),e.stroke();e.setLineDash([]);const n=document.createElement("canvas");n.width=20,n.height=20;const r=n.getContext("2d");if(r){r.fillStyle="rgba(150, 75, 200, 0.3)",r.fillRect(0,0,10,10),r.fillRect(10,10,10,10);const t=e.createPattern(n,"repeat");t&&(e.fillStyle=t,e.fillRect(150,120,80,60))}e.shadowColor="rgba(0, 0, 0, 0.5)",e.shadowBlur=3.2,e.shadowOffsetX=2.1,e.shadowOffsetY=2.7,e.fillStyle="rgba(100, 200, 150, 0.8)",e.fillRect(160,30,60,40),e.shadowColor="transparent",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0}function j(e){const t=["14px Arial, sans-serif",'13px "Times New Roman", serif',"12px Georgia, serif","15px Helvetica, Arial, sans-serif",'11px "Courier New", monospace',"13px Verdana, sans-serif","16px Impact, fantasy",'12px "Comic Sans MS", cursive'],n=["#000","#333","#666","#999","rgba(255, 0, 0, 0.8)","rgba(0, 255, 0, 0.7)","rgba(0, 0, 255, 0.6)","rgba(128, 64, 192, 0.9)"],r=["top","hanging","middle","alphabetic","bottom"],o=["left","center","right"];let i=250;z.forEach((s,a)=>{t.forEach((t,c)=>{const l=(a+c)%n.length,u=c%r.length,h=c%o.length;e.font=t,e.fillStyle=n[l]||n[0],e.textBaseline=r[u]||"top",e.textAlign=o[h]||"left";const d=10+.7*c%200,p=i+18.3*c%100;e.fillText(s,d,p),c%2==0&&(e.strokeStyle=`rgba(${100+20*c}, ${50+15*c}, ${150+10*c}, 0.5)`,e.lineWidth=.3,e.strokeText(s,d+.5,p+.5))}),i+=120}),e.save(),e.translate(100,400),e.rotate(Math.PI/6),e.scale(1.2,.8),e.font="italic 14px Arial",e.fillStyle="rgba(200, 100, 50, 0.8)",e.fillText("Transformed & Rotated Text",0,0),e.restore(),e.font="6px Arial",e.fillStyle="#000",e.fillText("Tiny text rendering test",10,500),e.font="32px Arial",e.fillStyle="rgba(255, 0, 0, 0.5)",e.fillText("Large",10,540),e.textAlign="left",e.textBaseline="top"}async function V(){const e=performance.now();try{const t=document.createElement("canvas");t.width=300,t.height=600;const n=t.getContext("2d",{alpha:!0,desynchronized:!1,colorSpace:"srgb",willReadFrequently:!0});if(!n)throw new Error("Canvas 2D context not available");n.rect(0,0,10,10),n.rect(2,2,6,6);const r=n.isPointInPath(5,5,"evenodd");j(n);const o=a(t.toDataURL("image/png"));n.clearRect(0,0,t.width,t.height),W(n);const i=a(t.toDataURL("image/png")),s=function(e,t){try{e.clearRect(0,0,t.width,t.height),e.fillStyle="rgb(100, 150, 200)",e.fillRect(10.3,10.7,20.1,20.9),e.strokeStyle="rgb(200, 100, 50)",e.lineWidth=1.3,e.beginPath(),e.moveTo(15.2,35.8),e.lineTo(25.7,45.1),e.stroke();const n=e.getImageData(10,10,30,40).data;let r=0,o=0,i=0,s=0,a=0;for(let e=0;e<n.length;e+=4){const t=n[e]||0,c=n[e+1]||0,l=n[e+2]||0;if((n[e+3]||0)>25&&(r+=t,o+=c,i+=l,a++,e>=16)){const r=n[e-16]||0,o=Math.abs(t-r);o>=8&&(s+=o)}}if(0===a)return"no-valid-pixels";return`${10*Math.round(r/a/10)}-${10*Math.round(o/a/10)}-${10*Math.round(i/a/10)}-${10*Math.round(s/a/10)}`}catch(e){return"subpixel-error"}}(n,t),c=function(e,t,n,r){const o=[];let i=0;try{const s=r.getImageData(0,0,1,1);s&&0!==s.data.length||(o.push("getImageData-blocked"),i+=3),(e.length<8||t.length<8)&&(o.push("short-hash"),i+=2);const a=["error","blocked","disabled","00000000","ffffffff","12345678"];(a.includes(e)||a.includes(t))&&(o.push("known-blocked-hash"),i+=3),("subpixel-error"===n||n.includes("0-0-0"))&&(o.push("subpixel-anomaly"),i+=2),e===t&&"error"!==e&&(o.push("identical-hashes"),i+=2);const c=document.createElement("canvas");c.width=10,c.height=10;const l=c.getContext("2d");if(l){const e=performance.now();l.fillStyle="red",l.fillRect(0,0,10,10),c.toDataURL(),performance.now()-e>50&&(o.push("slow-canvas"),i+=1)}return{isInconsistent:i>=2,confidence:Math.min(i/5,1),reasons:o}}catch(e){return{isInconsistent:!0,confidence:1,reasons:["detection-error"]}}}(o,i,s,n);n.clearRect(0,0,t.width,t.height),j(n),n.globalCompositeOperation="multiply",W(n),n.globalCompositeOperation="source-over";const l=a(t.toDataURL("image/png")),u=performance.now();return{value:{text:o,geometry:i,winding:r,isInconsistent:c.isInconsistent,subPixelAnalysis:s,compositeHash:l,inconsistencyConfidence:c.confidence,blockingReasons:c.reasons},duration:u-e}}catch(t){return{value:{text:"error",geometry:"error",winding:!1,isInconsistent:!0,subPixelAnalysis:"error",compositeHash:"error",inconsistencyConfidence:1,blockingReasons:["canvas-error"]},duration:performance.now()-e,error:t instanceof Error?t.message:"Canvas fingerprinting failed"}}}function Z(){try{const e=document.createElement("canvas").getContext("2d");return null!==e&&"function"==typeof e.fillText}catch{return!1}}const G=["Arial","Arial Black","Calibri","Cambria","Comic Sans MS","Consolas","Courier New","Georgia","Impact","Lucida Console","Lucida Sans Unicode","Microsoft Sans Serif","Palatino Linotype","Segoe UI","Tahoma","Times New Roman","Trebuchet MS","Verdana","American Typewriter","Avenir","Baskerville","Big Caslon","Brush Script MT","Copperplate","Didot","Futura","Gill Sans","Helvetica","Helvetica Neue","Hoefler Text","Lucida Grande","Marker Felt","Optima","Papyrus","Phosphate","Rockwell","Savoye LET","SignPainter","Skia","Snell Roundhand","System Font","Zapfino","DejaVu Sans","DejaVu Sans Mono","DejaVu Serif","Droid Sans","Droid Sans Mono","Droid Serif","Liberation Sans","Liberation Sans Narrow","Liberation Serif","Ubuntu","Ubuntu Mono","Roboto","Roboto Condensed","Roboto Mono","Roboto Slab","Droid Sans","Droid Sans Mono","Droid Serif","Helvetica Neue","Arial","Helvetica","Courier New","Times New Roman","San Francisco","Avenir Next","Open Sans","Lato","Montserrat","Source Sans Pro","Raleway","PT Sans","Lora","Playfair Display","Oswald","Slabo 27px","Fira Sans","Hiragino Sans","Hiragino Kaku Gothic ProN","Meiryo","MS Gothic","MS Mincho","SimSun","SimHei","Microsoft YaHei","Malgun Gothic","Apple SD Gothic Neo"],H=["monospace","sans-serif","serif"],$="mmMwWLliI0O&1 ※";function X(e,t){const n=document.createElement("canvas").getContext("2d");if(!n)return{width:0,height:0};n.font=`12px ${t}`;const r=n.measureText(e);return{width:r.width,height:r.actualBoundingBoxAscent+r.actualBoundingBoxDescent}}function q(e,t){const n=document.createElement("span");n.style.position="absolute",n.style.left="-9999px",n.style.top="-9999px",n.style.fontSize="12px",n.style.fontFamily=t,n.style.whiteSpace="nowrap",n.textContent=e,document.body.appendChild(n);const r=n.getBoundingClientRect(),o={width:r.width,height:r.height};return document.body.removeChild(n),o}function Y(e,t="canvas"){const n="canvas"===t?X:q,r=H.map(e=>n($,e)),o=H.map(t=>n($,`${e}, ${t}`));for(let e=0;e<r.length;e++){const t=r[e],n=o[e];if(t&&n){const e=Math.abs(t.width-n.width),r=Math.abs(t.height-n.height);if(e>.1||r>.1)return!0}}return!1}function J(){try{const e=document.createElement("span");return e&&"object"==typeof e.style}catch{return!1}}function K(e){return 10*Math.round(e/10)}async function Q(){const e=performance.now();try{const t=function(){try{return{width:screen.width||0,height:screen.height||0}}catch{return{width:0,height:0}}}(),n=screen.colorDepth||screen.pixelDepth||0,r=function(){try{return window.devicePixelRatio||1}catch{return 1}}(),o=function(){try{const e=screen.availWidth||0,t=screen.availHeight||0;return 0===e&&0===t?{width:K(screen.width||0),height:K(screen.height||0)}:{width:K(e),height:K(t)}}catch{return{width:K(screen.width||0),height:K(screen.height||0)}}}(),i=function(){try{const e=document.documentElement,t=Math.max(e.clientWidth||0,window.innerWidth||0),n=Math.max(e.clientHeight||0,window.innerHeight||0);return{width:K(t),height:K(n)}}catch{const e=window.innerWidth||0,t=window.innerHeight||0;return{width:K(e),height:K(t)}}}(),s=function(){try{if(screen.orientation)return{angle:screen.orientation.angle,type:screen.orientation.type};const e=screen.mozOrientation||screen.msOrientation||screen.webkitOrientation;if(void 0!==e)return{angle:e,type:"unknown"};const t=screen.width>screen.height;return{angle:t?90:0,type:t?"landscape-primary":"portrait-primary"}}catch{return}}(),a=performance.now(),c={width:t.width,height:t.height,colorDepth:n,pixelRatio:r,availableWidth:o.width,availableHeight:o.height,viewportWidth:i.width,viewportHeight:i.height};return s&&(c.orientation=s),{value:c,duration:a-e}}catch(t){return{value:{width:0,height:0,colorDepth:0,pixelRatio:1,viewportWidth:0,viewportHeight:0,availableWidth:0,availableHeight:0},duration:performance.now()-e,error:t instanceof Error?t.message:"Screen fingerprinting failed"}}}function ee(){try{return"object"==typeof screen&&"number"==typeof screen.width&&"number"==typeof screen.height}catch{return!1}}let te=null,ne=0,re=0;function oe(){try{const e=performance.now();if(te&&te.isValid)if(e-te.timestamp<18e5){if(te.context&&!te.context.isContextLost())return te.usageCount++,te.lastUsed=e,te.context;ie()}else ie();if(ne>=8)return console.warn("[WebGL Cache] Maximum context limit reached, reusing existing contexts"),null;const t=function(){try{if("undefined"==typeof document)return null;const e=document.createElement("canvas");return e.width=1,e.height=1,e}catch{return null}}();if(!t)return null;const n=function(e){try{const t={alpha:!1,antialias:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!1,failIfMajorPerformanceCaveat:!0,powerPreference:"default"};return e.getContext("webgl",t)||e.getContext("experimental-webgl",t)}catch{return null}}(t);return n?(ne++,re++,te={context:n,canvas:t,timestamp:e,isValid:!0,usageCount:1,lastUsed:e},n):null}catch(e){return ie(),null}}function ie(){if(te){try{if(te.context){const e=te.context.getExtension("WEBGL_lose_context");e&&e.loseContext()}te.canvas&&(te.canvas.width=0,te.canvas.height=0),ne>0&&ne--}catch{ne>0&&ne--}te.isValid=!1,te=null}}function se(){if(!te||!te.context)return!1;try{return!te.context.isContextLost()}catch{return!1}}function ae(){const e=oe();if(!e)return[];try{const t=e.getSupportedExtensions();return t?Array.from(t).sort():[]}catch{return[]}}function ce(){const e=oe();if(!e)return{};try{const t={},n=["VERSION","VENDOR","RENDERER","SHADING_LANGUAGE_VERSION","MAX_TEXTURE_SIZE","MAX_RENDERBUFFER_SIZE","MAX_VIEWPORT_DIMS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_UNIFORM_VECTORS","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_VARYING_VECTORS"];for(const r of n)try{const n=e[r];void 0!==n&&(t[r]=e.getParameter(n))}catch{}return t}catch{return{}}}function le(){try{ie(),ne=0,re=0}catch(e){console.warn("[WebGL Cache] Cleanup error:",e)}}if("undefined"!=typeof window&&(window.addEventListener("beforeunload",le),window.addEventListener("pagehide",le),window.addEventListener("unload",le),document.addEventListener("visibilitychange",()=>{}),"memory"in performance&&"function"==typeof performance.memory.addEventListener))try{performance.memory.addEventListener("memorypressure",le)}catch(e){}var ue=Object.freeze({__proto__:null,cleanupWebGLCache:le,forceCleanupWebGL:function(){ie(),ne=0},getCachedWebGLContext:oe,getCachedWebGLExtensions:ae,getCachedWebGLParameters:ce,invalidateWebGLCache:ie,isWebGLContextValid:se});const he={VENDOR:7936,RENDERER:7937,VERSION:7938,SHADING_LANGUAGE_VERSION:35724,MAX_VERTEX_ATTRIBS:34921,MAX_TEXTURE_SIZE:3379,MAX_RENDERBUFFER_SIZE:34024,MAX_VIEWPORT_DIMS:3386,ALIASED_LINE_WIDTH_RANGE:33902,ALIASED_POINT_SIZE_RANGE:33901,MAX_FRAGMENT_UNIFORM_VECTORS:36349,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661};function de(e,t,n){const r=e.createShader(t);return r?(e.shaderSource(r,n),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(e.deleteShader(r),null)):null}function pe(e){try{const t=e.getParameter(e.VENDOR)||"unknown",n=e.getParameter(e.RENDERER)||"unknown",r=e.getParameter(e.VERSION)||"unknown",o=`${t}|${n}|${r}|${e.getParameter(e.MAX_TEXTURE_SIZE)||0}|${e.getParameter(e.MAX_VERTEX_ATTRIBS)||0}|${e.getParameter(e.MAX_VIEWPORT_DIMS)||[0,0]}`;let i=0;for(let e=0;e<o.length;e++)i=(i<<5)-i+o.charCodeAt(e)&4294967295;return`fallback_${Math.abs(i).toString(16)}`}catch{return"webgl_unavailable"}}async function me(){const e=performance.now();try{if(!ge())throw new Error("WebGL not supported in this browser");const t=oe();if(!t)throw new Error("WebGL context not available");if(!se())throw new Error("WebGL context lost");const n=function(){try{return ce()}catch{return{}}}(),r=n.VENDOR||"unknown",o=n.RENDERER||"unknown",i=n.VERSION||"unknown";let s=r,a=o;for(let e=0;e<3;e++)try{const e=t.getExtension("WEBGL_debug_renderer_info");if(e){const n=t.getParameter(e.UNMASKED_VENDOR_WEBGL),r=t.getParameter(e.UNMASKED_RENDERER_WEBGL);n&&"unknown"!==n&&(s=n),r&&"unknown"!==r&&(a=r);break}}catch(t){if(2===e)break;await new Promise(e=>setTimeout(e,10))}const c=function(){try{return ae()}catch{return[]}}(),l=function(e){const t={};return Object.entries(he).forEach(([n,r])=>{const o=function(e,t){try{return e.getParameter(t)}catch{return null}}(e,r);null!==o&&(t[n]=Array.isArray(o)?o.join(","):o)}),["UNMASKED_VENDOR_WEBGL","UNMASKED_RENDERER_WEBGL"].forEach(n=>{try{const r=e.getExtension("WEBGL_debug_renderer_info");if(r){const o=r[n];if(void 0!==o){const r=e.getParameter(o);r&&(t[n]=r)}}}catch{}}),t}(t),u=function(e){const t=[],n=[];try{const r=[e.LOW_FLOAT,e.MEDIUM_FLOAT,e.HIGH_FLOAT,e.LOW_INT,e.MEDIUM_INT,e.HIGH_INT],o=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"];for(let i=0;i<r.length;i++){const s=r[i];if(void 0===s)continue;const a=e.getShaderPrecisionFormat(e.VERTEX_SHADER,s),c=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,s);a&&t.push(`${o[i]}:${a.precision},${a.rangeMin},${a.rangeMax}`),c&&n.push(`${o[i]}:${c.precision},${c.rangeMin},${c.rangeMax}`)}}catch{}return{vertex:t.join(";"),fragment:n.join(";")}}(t),h=function(e){try{const t="\n attribute vec2 a_position;\n attribute vec3 a_color;\n varying vec3 v_color;\n uniform float u_time;\n \n void main() {\n // Complex mathematical operations to differentiate GPUs\n float wave = sin(a_position.x * 10.0 + u_time) * 0.1;\n vec2 position = a_position + vec2(wave, cos(a_position.y * 8.0) * 0.1);\n \n // GPU-specific floating point calculations\n float precision = sin(position.x * 123.456) + cos(position.y * 789.012);\n position += vec2(precision * 0.001);\n \n gl_Position = vec4(position, 0.0, 1.0);\n v_color = a_color;\n }\n ",n="\n precision mediump float;\n varying vec3 v_color;\n uniform float u_time;\n \n void main() {\n // Complex color calculations that vary between GPU vendors\n vec3 color = v_color;\n color.r += sin(gl_FragCoord.x * 0.1 + u_time) * 0.1;\n color.g += cos(gl_FragCoord.y * 0.1 + u_time) * 0.1;\n color.b += sin((gl_FragCoord.x + gl_FragCoord.y) * 0.05) * 0.1;\n \n // GPU-specific precision in color calculations\n color = normalize(color) * length(v_color);\n \n gl_FragColor = vec4(color, 1.0);\n }\n ",r=de(e,e.VERTEX_SHADER,t),o=de(e,e.FRAGMENT_SHADER,n);if(!r||!o)return pe(e);const i=function(e,t,n){const r=e.createProgram();return r?(e.attachShader(r,t),e.attachShader(r,n),e.linkProgram(r),e.getProgramParameter(r,e.LINK_STATUS)?r:(e.deleteProgram(r),null)):null}(e,r,o);if(!i)return pe(e);e.useProgram(i);const s=new Float32Array([-.8,-.6,1,.2,.3,0,.8,.3,1,.2,.8,-.6,.2,.3,1,-.5,-.2,.8,.9,.1,.3,.6,.1,.8,.9,.7,-.3,.9,.1,.8]),a=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,a),e.bufferData(e.ARRAY_BUFFER,s,e.STATIC_DRAW);const c=e.getAttribLocation(i,"a_position"),l=e.getAttribLocation(i,"a_color"),u=e.getUniformLocation(i,"u_time");e.enableVertexAttribArray(c),e.enableVertexAttribArray(l),e.vertexAttribPointer(c,2,e.FLOAT,!1,20,0),e.vertexAttribPointer(l,3,e.FLOAT,!1,20,8),e.uniform1f(u,1.23456789),e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),e.clearColor(.1,.2,.3,1),e.clear(e.COLOR_BUFFER_BIT),e.drawArrays(e.TRIANGLES,0,6);const h=new Uint8Array(e.canvas.width*e.canvas.height*4);e.readPixels(0,0,e.canvas.width,e.canvas.height,e.RGBA,e.UNSIGNED_BYTE,h);let d=0;for(let e=0;e<h.length;e+=4){const t=1*(h[e]??0);d=33*d+(t+256*(h[e+1]??0)+65536*(h[e+2]??0)+16777216*(h[e+3]??0))>>>0}return e.deleteProgram(i),e.deleteShader(r),e.deleteShader(o),e.deleteBuffer(a),d.toString(16)}catch(t){return pe(e)}}(t),d=function(e){const t={};try{const n=e.getExtension("WEBGL_debug_renderer_info");n&&(t.unmaskedVendor=e.getParameter(n.UNMASKED_VENDOR_WEBGL),t.unmaskedRenderer=e.getParameter(n.UNMASKED_RENDERER_WEBGL)),t.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),t.maxCombinedTextureImageUnits=e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS),t.maxViewportDims=e.getParameter(e.MAX_VIEWPORT_DIMS),t.maxRenderbufferSize=e.getParameter(e.MAX_RENDERBUFFER_SIZE),t.maxVertexAttribs=e.getParameter(e.MAX_VERTEX_ATTRIBS),t.maxVertexUniformVectors=e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),t.maxFragmentUniformVectors=e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),t.maxVaryingVectors=e.getParameter(e.MAX_VARYING_VECTORS),t.antialias=e.getContextAttributes()?.antialias||!1;const r=e.getExtension("OES_texture_float");t.floatTextures=!!r;const o=e.getExtension("OES_texture_half_float");t.halfFloatTextures=!!o;const i=e.getParameter(e.COMPRESSED_TEXTURE_FORMATS);t.compressedTextureFormats=Array.isArray(i)?i.length:0;const s=e instanceof WebGL2RenderingContext;if(t.webgl2=s,s){const n=e;t.maxColorAttachments=n.getParameter(n.MAX_COLOR_ATTACHMENTS),t.maxDrawBuffers=n.getParameter(n.MAX_DRAW_BUFFERS),t.maxTexture3DSize=n.getParameter(n.MAX_3D_TEXTURE_SIZE)}const a=e.getParameter(e.ALIASED_LINE_WIDTH_RANGE);t.lineWidthRange=Array.isArray(a)?a.join(","):"";const c=e.getParameter(e.ALIASED_POINT_SIZE_RANGE);t.pointSizeRange=Array.isArray(c)?c.join(","):""}catch(e){}return t}(t),p=(()=>{const e=`${s||r||""}|${a||o||""}`.toLowerCase();let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)&4294967295;return Math.abs(t).toString(16)})(),m=performance.now();return{value:{vendor:s,renderer:a,version:i,extensions:c,parameters:l,shaderPrecision:u,renderHash:h,capabilities:d,vendorRendererHash:p,contextAttributes:t.getContextAttributes()||{}},duration:m-e}}catch(t){return{value:{vendor:"unknown",renderer:"unknown",version:"unknown",extensions:[],parameters:{},shaderPrecision:{vertex:"",fragment:""},renderHash:"",capabilities:{},vendorRendererHash:"",contextAttributes:{}},duration:performance.now()-e,error:t instanceof Error?t.message:"WebGL fingerprinting failed"}}}let fe=null;function ge(){if(null!==fe)return fe;try{const e=document.createElement("canvas");e.width=1,e.height=1;const t=e.getContext("webgl",{failIfMajorPerformanceCaveat:!0,antialias:!1,alpha:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!1})||e.getContext("experimental-webgl",{failIfMajorPerformanceCaveat:!0,antialias:!1,alpha:!1,depth:!1,stencil:!1,preserveDrawingBuffer:!1}),n=null!==t;if(t&&"getExtension"in t)try{const e=t.getExtension("WEBGL_lose_context");e&&e.loseContext()}catch(e){}return e.width=0,e.height=0,fe=n,n}catch{return fe=!1,!1}}function ye(){try{for(const e of["rec2020","p3","srgb"]){const t=Re(`(color-gamut: ${e})`);if(t?.matches)return e}return"unknown"}catch{return"unknown"}}function we(){try{const e=Re("(forced-colors: active)");if(e?.matches)return!0;const t=Re("(forced-colors: none)");return!t?.matches&&null}catch{return null}}function be(){try{const e=["no-preference","high","more","low","less","forced"];for(const t of e){const e=Re(`(prefers-contrast: ${t})`);if(e?.matches)return"high"===t?"more":"low"===t?"less":t}return"unknown"}catch{return"unknown"}}function ve(){try{const e=Re("(prefers-reduced-motion: reduce)");if(e?.matches)return!0;const t=Re("(prefers-reduced-motion: no-preference)");return!t?.matches&&null}catch{return null}}function Se(){try{return!!matchMedia("(prefers-reduced-transparency: reduce)").matches||!matchMedia("(prefers-reduced-transparency: no-preference)").matches&&null}catch{return null}}function Ce(){try{for(let e=8;e>=0;e--)if(matchMedia(`(monochrome: ${e})`).matches)return e;return 0}catch{return 0}}function ke(){try{return!!matchMedia("(inverted-colors: inverted)").matches||!matchMedia("(inverted-colors: none)").matches&&null}catch{return null}}function Ie(){try{return!!matchMedia("(dynamic-range: high)").matches||!matchMedia("(dynamic-range: standard)").matches&&null}catch{return null}}function Ee(){try{const e=[48,36,30,24,16,15,8];for(const t of e)if(matchMedia(`(color: ${t})`).matches)return t;return screen.colorDepth||24}catch{return screen.colorDepth||24}}function Me(){try{return matchMedia("(hover: hover)").matches?"hover":matchMedia("(hover: none)").matches?"none":"unknown"}catch{return"unknown"}}function xe(){try{return matchMedia("(pointer: fine)").matches?"fine":matchMedia("(pointer: coarse)").matches?"coarse":matchMedia("(pointer: none)").matches?"none":"unknown"}catch{return"unknown"}}function Ae(){return F().canRunAccessibility}function Re(e){try{return Ae()?matchMedia(e):null}catch(e){return null}}function Te(){try{return!!matchMedia("(prefers-reduced-data: reduce)").matches||!matchMedia("(prefers-reduced-data: no-preference)").matches&&null}catch{return null}}function Oe(){try{const e=["fullscreen","standalone","minimal-ui","browser"];for(const t of e)if(matchMedia(`(display-mode: ${t})`).matches)return t;return"unknown"}catch{return"unknown"}}function _e(){try{const e=["opaque","additive","subtractive"];for(const t of e)if(matchMedia(`(environment-blending: ${t})`).matches)return t;return"unknown"}catch{return"unknown"}}function De(){try{return!!matchMedia("(any-hover: hover)").matches||!matchMedia("(any-hover: none)").matches&&null}catch{return null}}function Pe(){try{return matchMedia("(any-pointer: fine)").matches?"fine":matchMedia("(any-pointer: coarse)").matches?"coarse":matchMedia("(any-pointer: none)").matches?"none":"unknown"}catch{return"unknown"}}function Le(){try{return matchMedia("(prefers-color-scheme: dark)").matches?"dark":matchMedia("(prefers-color-scheme: light)").matches?"light":matchMedia("(prefers-color-scheme: no-preference)").matches?"no-preference":"unknown"}catch{return"unknown"}}function Ne(){const e=ye(),t=we(),n=be(),r=ve(),o=Se(),i=Ce(),s=ke(),a=Ie(),c=Ee(),l=Me(),u=xe(),h=Te(),d=Oe(),p=_e(),m=De(),f=Pe(),g=Le(),y=Boolean(t||r||o||s||h||"no-preference"!==n||"no-preference"!==g||i>0),w=[e,a?"hdr":"sdr",`${c}bit`,i>0?`mono${i}`:"color",g,d,p].join("-"),b=[l,u,m?"anyhover":"nohover",f].join("-");return{colorGamut:e,forcedColors:t,contrastPreference:n,reducedMotion:r,reducedTransparency:o,monochromeDepth:i,invertedColors:s,hdrSupport:a,enhancedColorDepth:c,hoverCapability:l,pointerCapability:u,reducedData:h,displayMode:d,environmentBlending:p,anyHover:m,anyPointer:f,colorScheme:g,hasAccessibilityFeatures:y,displayCapabilities:w,interactionCapabilities:b}}function Fe(e){const t=["unknown"!==e.colorGamut,null!==e.forcedColors,"unknown"!==e.contrastPreference,null!==e.reducedMotion,null!==e.reducedTransparency,null!==e.invertedColors,null!==e.hdrSupport,null!==e.reducedData,"unknown"!==e.displayMode,"unknown"!==e.environmentBlending,null!==e.anyHover,"unknown"!==e.colorScheme],n=t.filter(Boolean).length/t.length,r=[null!==e.reducedData,"unknown"!==e.displayMode,"unknown"!==e.environmentBlending,"unknown"!==e.colorScheme,null!==e.hdrSupport],o=r.filter(Boolean).length/r.length,i=[!0===e.forcedColors,!0===e.reducedMotion,!0===e.reducedTransparency,!0===e.invertedColors,!0===e.reducedData,"no-preference"!==e.contrastPreference,"dark"===e.colorScheme,e.monochromeDepth>0],s=i.filter(Boolean).length/i.length,a=["srgb"!==e.colorGamut,!0===e.forcedColors,!0===e.reducedMotion,!0===e.reducedTransparency,!0===e.invertedColors,!0===e.reducedData,e.monochromeDepth>0,!0===e.hdrSupport,"browser"!==e.displayMode,"opaque"!==e.environmentBlending,"dark"===e.colorScheme],c=a.filter(Boolean).length/a.length;return{confidence:Math.round(100*n)/100,uniqueness:Math.round(100*c)/100,accessibilityScore:Math.round(100*s)/100,modernBrowserScore:Math.round(100*o)/100}}var Be=Object.freeze({__proto__:null,analyzeAccessibilityFingerprint:Fe,getAccessibilityFingerprint:Ne,getAnyHover:De,getAnyPointer:Pe,getColorGamut:ye,getColorScheme:Le,getContrastPreference:be,getDisplayMode:Oe,getEnhancedColorDepth:Ee,getEnvironmentBlending:_e,getForcedColors:we,getHDRSupport:Ie,getHoverCapability:Me,getInvertedColors:ke,getMonochromeDepth:Ce,getPointerCapability:xe,getReducedData:Te,getReducedMotion:ve,getReducedTransparency:Se,isAccessibilityDetectionAvailable:Ae});function Ue(e){if("number"==typeof e)return{confidence:0,uniqueness:0,intlApiSupport:0,localeComplexity:0};const t=Object.values(e.intlSupport).filter(Boolean).length/Object.keys(e.intlSupport).length,n=[e.locale,e.calendar,e.numberingSystem,e.timeZone,e.dateStyle,e.timeStyle,e.hourCycle,e.numberLocale,e.currencyDisplay,e.currencySign,e.notation,e.signDisplay,e.listStyle,e.relativeTimeStyle,e.pluralRules],r=n.filter(e=>"unknown"!==e&&""!==e).length/n.length,o=[e.locale.length>2?1:0,"gregory"!==e.calendar?1:0,"latn"!==e.numberingSystem?1:0,e.hour12?1:0,e.localeMatch?0:1].reduce((e,t)=>e+t,0)/5,i=(r+t+o)/3;return{confidence:Math.round(100*r)/100,uniqueness:Math.round(100*i)/100,intlApiSupport:Math.round(100*t)/100,localeComplexity:Math.round(100*o)/100}}const ze="mmMwWLliI0fiflO&1",We={default:{text:ze},serif:{style:{fontFamily:"serif"},text:ze},sans:{style:{fontFamily:"sans-serif"},text:ze},mono:{style:{fontFamily:"monospace"},text:ze},apple:{style:{font:"-apple-system-body"},text:ze},system:{style:{fontFamily:"system-ui"},text:ze},min:{style:{fontSize:"1px"},text:ze},large:{style:{fontSize:"72px"},text:ze},ui:{style:{fontFamily:"ui-serif"},text:ze},emoji:{style:{fontFamily:"Apple Color Emoji, Segoe UI Emoji, Noto Color Emoji"},text:"🎯🔥💯"},math:{style:{fontFamily:"STIX Two Math, Cambria Math"},text:"∑∆∇∂"},cjk:{style:{fontFamily:"Hiragino Sans, Microsoft YaHei, SimSun"},text:"中文测试"},arabic:{style:{fontFamily:"Tahoma, Arial Unicode MS"},text:"اختبار"},hebrew:{style:{fontFamily:"Tahoma, Arial Unicode MS"},text:"בדיקה"},subpixel:{style:{fontFamily:"Arial",fontSize:"11px",textRendering:"optimizeLegibility"},text:ze},kerning:{style:{fontFamily:"Times",fontSize:"24px",fontKerning:"normal"},text:"AV To"},ligatures:{style:{fontFamily:"Times",fontSize:"24px",fontVariantLigatures:"common-ligatures"},text:"ffi ffl fi fl"}};function je(e,t,n){try{const r="mmmmmmmmmmlli",o=Ve(e,t,{style:{fontFamily:n},text:r}),i=Ve(e,t,{style:{fontFamily:"monospace"},text:r});if(Math.abs(o-i)<1)return"monospace-fallback";const s=Ve(e,t,{style:{fontFamily:"sans-serif"},text:r});return Math.abs(o-s)<1?"sans-serif-fallback":"native-font"}catch(e){return"fallback-error"}}function Ve(e,t,n){const r=e.createElement("span"),{style:o={},text:i=ze}=n;r.textContent=i,r.style.cssText="position: absolute; left: 0; top: 0; white-space: nowrap; visibility: hidden;",Object.entries(o).forEach(([e,t])=>{void 0!==t&&(r.style[e]=t)}),t.appendChild(r);const s=r.getBoundingClientRect().width;return t.removeChild(r),Math.round(100*s)/100}function Ze(e){const t=[e.default,e.serif,e.sans,e.mono,e.apple,e.system,e.min,e.large,e.ui,e.emoji,e.math,e.cjk,e.arabic,e.hebrew,e.subpixel,e.kerning,e.ligatures],n=t.some(e=>e>0),r=t.filter(e=>e>0).length,o=t.length;let i=n?r/o:0;(e.antiAliasing.enabled||e.systemFontHints.clearType)&&(i+=.2),Object.keys(e.fallbackBehavior).length>0&&(i+=.1),i=Math.min(i,1);const s=e.apple>0||e.system>0,a=[e.subpixel,e.kerning,e.ligatures,e.emoji,e.math].some(e=>e>0)||e.antiAliasing.enabled||e.systemFontHints.clearType,c=t.reduce((e,t)=>e+t,0)/t.length,l=t.reduce((e,t)=>e+Math.pow(t-c,2),0)/t.length;let u=Math.min(l/100,1);e.antiAliasing.smoothingLevel>0&&(u+=.1),e.systemFontHints.hintingLevel>0&&(u+=.1),u=Math.min(u,1);let h="low";const d=e.antiAliasing.smoothingLevel;d>50||e.systemFontHints.clearType?h="high":(d>20||e.systemFontHints.hintingLevel>2)&&(h="medium");const p="error"!==e.isolatedHash&&e.isolatedHash.length>0;return{confidence:Math.round(100*i)/100,uniqueness:Math.round(100*u)/100,hasSystemFonts:s,hasAdvancedFeatures:a,renderingQuality:h,isolationIntegrity:p}}const Ge=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF","Arial","Arial Black","Comic Sans MS","Courier New","Georgia","Impact","Palatino Linotype","Tahoma","Times New Roman","Trebuchet MS","Verdana","American Typewriter","Avenir","Baskerville","Big Caslon","Brush Script MT","Copperplate","Didot","Futura","Helvetica","Hoefler Text","Lucida Grande","Marker Felt","Optima","Papyrus","Phosphate","Rockwell","Savoye LET","SignPainter","Skia","Snell Roundhand","Zapfino","DejaVu Sans","DejaVu Sans Mono","DejaVu Serif","Liberation Sans","Liberation Serif","Ubuntu","Ubuntu Mono"],He="mmMwWLliI0O&1",$e="48px",Xe=["monospace","sans-serif","serif"];function qe(e,t){const n=e.createElement("span");return n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.fontFamily=t,n.style.fontSize=$e,n.style.whiteSpace="nowrap",n.textContent=He,n}function Ye(e,t,n){return qe(e,`'${t}',${n}`)}function Je(e,t){return Xe.some((n,r)=>{const o=e[r],i=t[n];return!(!o||!i||o.offsetWidth===i.width&&o.offsetHeight===i.height)})}function Ke(e){const{available:t,method:n,precision:r,totalTested:o,detectionTime:i}=e;let s=.5;"iframe"===n?s=.9:"dom"===n&&(s=.7),s*=r;const a=t.filter(e=>["Calibri","Segoe UI Light","MS UI Gothic","Arial Unicode MS"].includes(e)).length,c=t.filter(e=>["Helvetica Neue","Avenir","Menlo","Zapfino","Baskerville"].includes(e)).length,l=t.filter(e=>["DejaVu Sans","Liberation Sans","Ubuntu"].includes(e)).length,u=t.filter(e=>["sans-serif-thin","Roboto"].includes(e)).length;let h="unknown";a>=2?h="windows":c>=2?h="macos":l>=1?h="linux":u>=1&&(h="android");const d=Math.min(i<100?1:.8,1),p=["Arial","Times New Roman","Helvetica"],m=t.filter(e=>!p.includes(e)),f=Math.min(m.length/10,1);return{confidence:Math.round(100*s)/100,uniqueness:Math.round(100*f)/100,osSignature:h,browserCapabilities:Math.round(100*d)/100}}const Qe=Math,et=()=>0;function tt(){const e=Qe.acos||et,t=Qe.acosh||et,n=Qe.asin||et,r=Qe.asinh||et,o=Qe.atanh||et,i=Qe.atan||et,s=Qe.sin||et,a=Qe.sinh||et,c=Qe.cos||et,l=Qe.cosh||et,u=Qe.tan||et,h=Qe.tanh||et,d=Qe.exp||et,p=Qe.expm1||et,m=Qe.log1p||et,f=Qe.cbrt||et,g=Qe.hypot||et,y=Qe.log10||et,w=Qe.log2||et;return{acos:e(.12312423423423424),asin:n(.12312423423423424),atan:i(.5),cos:c(10.000000000123),sin:s(-1e300),tan:u(-1e300),acosh:t(1e308),asinh:r(1),atanh:o(.5),cosh:l(1),sinh:a(1),tanh:h(1),exp:d(1),expm1:p(1),log1p:m(10),powPI:Qe.pow(Qe.PI,-100),cbrt:f(27),hypot:g(3,4),log10:y(100),log2:w(8),acoshPf:(b=1e154,Qe.log(b+Qe.sqrt(b*b-1))),asinhPf:Qe.log(1+Qe.sqrt(2)),atanhPf:Qe.log(3)/2,sinhPf:(Qe.exp(1)-Qe.exp(-1))/2,coshPf:(Qe.exp(1)+Qe.exp(-1))/2,expm1Pf:Qe.exp(1)-1,tanhPf:(Qe.exp(2)-1)/(Qe.exp(2)+1),log1pPf:Qe.log(11),precision:{float32:Qe.abs(0),float64:Qe.abs(2-2.0000000000000004),bigNumbers:Qe.abs(1),smallNumbers:Qe.abs(1e-15+2e-15-3e-15)}};var b}function nt(){try{const e=tt();return[e.acos,e.asin,e.atan,e.cos,e.sin,e.tan,e.acosh,e.asinh,e.atanh,e.cosh,e.sinh,e.tanh,e.exp,e.expm1,e.log1p,e.powPI,e.cbrt,e.hypot,e.log10,e.log2,e.precision.float32,e.precision.float64,e.precision.bigNumbers,e.precision.smallNumbers].join(",")}catch{return"math-unavailable"}}function rt(e){let t=.9,n=.8;Object.values(e).some(e=>"number"==typeof e&&0!==e)||(t=.1,n=.1),t*=Object.values(e.precision).reduce((e,t)=>e+("number"!=typeof t||isNaN(t)?0:1),0)/4;let r="high";return t<.3?r="low":t<.7&&(r="medium"),{confidence:Math.round(100*t)/100,stability:r,uniqueness:Math.round(100*n)/100}}const ot={gdprMode:!1,includeInvasive:!0,timeout:5e3,debug:!1,excludeComponents:[]},it=new Map;function st(e,t){return!(t.excludeComponents.includes(e)||t.gdprMode&&!t.includeInvasive&&["canvas","webgl","audio","fontPreferences","enhancedFonts"].includes(e)||(["mathFingerprint","dateTimeLocale","accessibilityEnhanced","fontPreferences","enhancedFonts"].includes(e),0))}function at(e,t){it.set(e,t)}async function ct(e,t,n){const r=`${e}_${n.gdprMode}`,o=(i=r,it.get(i)||null);var i;if(o)return o;const s="webgl"===e,a=["canvas","webgl","audio","hardware","system"].includes(e),c=s?2:a?3:1,l=s?[200,500]:[100,250,500];for(let o=0;o<c;o++)try{const i=n.timeout+o*(s?2e3:1e3),a=new Promise((t,n)=>{setTimeout(()=>n(new Error(`${e} timeout after ${i}ms (attempt ${o+1})`)),i)}),c=await Promise.race([t(),a]);if(null!=c)return at(r,c),c;throw new Error(`${e} returned null/undefined result`)}catch(t){const n=o===c-1,r=t instanceof Error?t.message:String(t);if(s&&r.includes("context")){console.warn(`[RabbitTracker] WebGL context issue detected: ${r}`);try{const{forceCleanupWebGL:e}=await Promise.resolve().then(function(){return ue});e()}catch(e){}return null}if(n)return console.warn(`[RabbitTracker] Component ${e} failed after ${c} attempts: ${r}`),null;!r.includes("timeout")&&o<l.length&&await new Promise(e=>setTimeout(e,l[o])),s&&await new Promise(e=>setTimeout(e,100))}return null}async function lt(e={}){const t=performance.now(),n={...ot,...e},r=[],o=[],i={collectionTime:t,gdprMode:n.gdprMode,components:[]},l=[];if(st("canvas",n)&&Z()&&l.push(ct("canvas",V,n).then(e=>({component:"canvas",result:e}))),st("webgl",n)&&ge()&&l.push(ct("webgl",me,n).then(e=>({component:"webgl",result:e}))),st("audio",n)&&w()&&l.push(ct("audio",y,n).then(e=>({component:"audio",result:e}))),st("fonts",n)&&J()&&l.push(ct("fonts",()=>async function(e=!0){const t=performance.now();try{let n;if(e&&function(){try{const e=document.createElement("canvas").getContext("2d");return null!==e&&"function"==typeof e.measureText}catch{return!1}}()){const{available:e,measurements:t}=function(){const e=[],t={};for(const n of G)try{const r=X($,n);t[n]=r,Y(n,"canvas")&&e.push(n)}catch(e){continue}return{available:e,measurements:t}}();n={available:e.sort(),method:"advanced",measurements:t}}else n={available:function(){const e=[];for(const t of G)try{Y(t,"dom")&&e.push(t)}catch(e){continue}return e}().sort(),method:"basic"};return{value:n,duration:performance.now()-t}}catch(e){return{value:{available:[],method:"basic"},duration:performance.now()-t,error:e instanceof Error?e.message:"Font detection failed"}}}(!n.gdprMode),n).then(e=>({component:"fonts",result:e}))),st("screen",n)&&ee()&&l.push(ct("screen",Q,n).then(e=>({component:"screen",result:e}))),st("browser",n)&&U()&&l.push(ct("browser",B,n).then(e=>({component:"browser",result:e}))),(await Promise.allSettled(l)).forEach((e,t)=>{if("fulfilled"===e.status&&e.value.result){const{component:t,result:n}=e.value;i[t]=n,r.push(t)}else{const n=l[t],r=n?.toString().match(/component: "(\w+)"/)?.[1]||"unknown";o.push({component:r,error:"rejected"===e.status?e.reason?.message||"Promise rejected":"Collection failed or timeout"})}}),!n.gdprMode)try{const{detectIncognitoHeuristics:e}=await Promise.resolve().then(function(){return ud}),t=await e();t&&(i.incognitoDetection={likelihood:t.likelihood,methods:t.methods},r.push("incognito"))}catch(e){o.push({component:"incognito",error:e instanceof Error?e.message:"Incognito detection failed"})}if(st("hardware",n))try{const e=await Promise.resolve().then(function(){return fd}).catch(()=>null);if(e?.isHardwareDetectionAvailable?.()){const t=e.getHardwareFingerprint?.();t&&(i.hardware={value:t,duration:0},r.push("hardware"))}else if(!e){const e={hardwareConcurrency:navigator.hardwareConcurrency||0,deviceMemory:navigator.deviceMemory||0,platform:navigator.platform||"unknown"};i.hardware={value:e,duration:0},r.push("hardware")}}catch(e){o.push({component:"hardware",error:e instanceof Error?e.message:"Hardware detection failed"})}if(st("system",n))try{const{getSystemFingerprint:e,isSystemDetectionAvailable:t}=await Promise.resolve().then(function(){return vd});if(t()){const t=e();t&&(i.system={value:t,duration:0},r.push("system"))}}catch(e){o.push({component:"system",error:e instanceof Error?e.message:"System detection failed"})}if(st("storage",n))try{const{getStorageFingerprint:e,isStorageDetectionAvailable:t}=await Promise.resolve().then(function(){return Md});if(t()){const t=performance.now(),n=await e(),o=performance.now()-t;n&&(i.storage={value:n,duration:o},r.push("storage"))}}catch(e){o.push({component:"storage",error:e instanceof Error?e.message:"Storage detection failed"})}if(st("math",n))try{const{getCompleteMathFingerprint:e,isMathDetectionAvailable:t}=await Promise.resolve().then(function(){return Td});if(t()){const t=performance.now(),n=e(),o=performance.now()-t;n&&(i.math={value:n,duration:o},r.push("math"))}}catch(e){o.push({component:"math",error:e instanceof Error?e.message:"Math fingerprinting failed"})}if(st("domBlockers",n))try{const{getDomBlockersFingerprint:e,isDomBlockersDetectionAvailable:t}=await Promise.resolve().then(function(){return Bd});if(t()){const t=performance.now(),o=await e({debug:n.debug}),s=performance.now()-t;o&&(i.domBlockers={value:o,duration:s},r.push("domBlockers"))}}catch(e){o.push({component:"domBlockers",error:e instanceof Error?e.message:"DOM blockers detection failed"})}if(st("accessibility",n))try{const{getAccessibilityFingerprint:e,isAccessibilityDetectionAvailable:t}=await Promise.resolve().then(function(){return Be});if(t()){const t=performance.now(),n=e(),o=performance.now()-t;n&&(i.accessibility={value:n,duration:o},r.push("accessibility"))}}catch(e){o.push({component:"accessibility",error:e instanceof Error?e.message:"Accessibility detection failed"})}if(st("browserApis",n))try{const{getBrowserApisFingerprint:e,isBrowserApisDetectionAvailable:t}=await Promise.resolve().then(function(){return qd});if(t()){const t=performance.now(),n=e(),o=performance.now()-t;n&&(i.browserApis={value:n,duration:o},r.push("browserApis"))}}catch(e){o.push({component:"browserApis",error:e instanceof Error?e.message:"Browser APIs detection failed"})}if(st("pluginsEnhanced",n))try{const{getEnhancedPluginFingerprint:e,isEnhancedPluginDetectionAvailable:t}=await Promise.resolve().then(function(){return cp});if(t()){const t=performance.now(),n=e(),o=performance.now()-t;n&&(i.pluginsEnhanced={value:n,duration:o},r.push("pluginsEnhanced"))}}catch(e){o.push({component:"pluginsEnhanced",error:e instanceof Error?e.message:"Enhanced plugin detection failed"})}if(st("mathFingerprint",n)&&function(){try{return"undefined"!=typeof Math&&"function"==typeof Math.sin}catch{return!1}}())try{const e=performance.now(),t=tt(),n=performance.now()-e;t&&(i.mathFingerprint={value:t,duration:n,analysis:rt(t),hash:nt()},r.push("mathFingerprint"))}catch(e){o.push({component:"mathFingerprint",error:e instanceof Error?e.message:"Math fingerprinting failed"})}if(st("fontPreferences",n)&&function(){try{return"undefined"!=typeof document&&"function"==typeof document.createElement&&void 0!==document.body}catch{return!1}}())try{const e=performance.now(),t=await async function(){try{const{document:e,container:t,cleanup:n}=await new Promise((e,t)=>{const n=document.createElement("iframe");n.style.cssText="position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; opacity: 0;",n.srcdoc='<!doctype html>\n <html>\n <head>\n <meta name="viewport" content="width=device-width, initial-scale=1">\n <style>\n body { \n margin: 0; \n padding: 20px; \n width: 4000px;\n text-size-adjust: none;\n -webkit-text-size-adjust: none;\n }\n </style>\n </head>\n <body></body>\n </html>',n.onload=()=>{try{const r=n.contentDocument,o=n.contentWindow;if(!r||!o)return void t(new Error("Cannot access iframe content"));const i=r.body;M()?i.style.zoom=""+1/o.devicePixelRatio:b()&&(i.style.zoom="reset");const s=r.createElement("div");s.textContent=Array(200).fill("word").join(" "),i.appendChild(s),e({document:r,container:i,cleanup:()=>{n.parentNode&&n.parentNode.removeChild(n)}})}catch(e){t(e)}},n.onerror=()=>{t(new Error("Failed to load iframe"))},document.body.appendChild(n)}),r={};for(const[n,o]of Object.entries(We))try{r[n]=Ve(e,t,o)}catch(e){r[n]=0}const o=function(e,t,n="Arial"){try{const t=e.createElement("canvas");t.width=100,t.height=50;const r=t.getContext("2d",{willReadFrequently:!0});if(!r)return{quality:0,antiAliasing:!1,smoothing:0};r.font=`24px "${n}"`,r.fillStyle="#000000",r.fillText("Wg",10.5,30.7);const o=r.getImageData(10,20,30,20).data;let i=0,s=0,a=0;for(let e=0;e<o.length;e+=4){const t=o[e]||0,n=o[e+1]||0,r=o[e+2]||0;(o[e+3]||0)<10||(a++,t===n&&n===r&&t>0&&t<255&&s++,e>4&&Math.abs(t-(o[e-4]||0))>50&&i++)}const c=a>0?s/a:0,l=a>0?100*s/a:0;return{quality:Math.round(l),antiAliasing:c>.1,smoothing:Math.round(100*l)/100}}catch(e){return{quality:0,antiAliasing:!1,smoothing:0}}}(e,0,"Arial"),i=function(e){try{const t=e.createElement("canvas");t.width=100,t.height=50;const n=t.getContext("2d",{willReadFrequently:!0});if(!n)return{clearType:!1,hintingLevel:0,subpixelRendering:!1};const r=["rn","il","WW","mm"];let o=0,i=0,s=0;for(const e of r){n.clearRect(0,0,t.width,t.height),n.font="16px Arial",n.fillStyle="#000",n.fillText(e,10,25);const r=n.getImageData(10,15,40,20).data;for(let e=0;e<r.length;e+=12){const t=r[e]||0,n=r[e+1]||0,a=r[e+2]||0,c=r[e+4]||0,l=r[e+5]||0,u=r[e+6]||0;(Math.abs(t-n)>20||Math.abs(n-a)>20)&&o++,Math.abs(t-c)+Math.abs(n-l)+Math.abs(a-u)>50&&i++,(t>0&&t<255||n>0&&n<255||a>0&&a<255)&&s++}}return{clearType:o>10,hintingLevel:Math.min(Math.round(s/10),5),subpixelRendering:i>5}}catch(e){return{clearType:!1,hintingLevel:0,subpixelRendering:!1}}}(e),s={},c=["Arial","Helvetica","Times New Roman","Georgia","Courier New"];for(const n of c)try{s[n]=je(e,t,n)}catch(e){s[n]="fallback-error"}const l=a([JSON.stringify(r),JSON.stringify(o),JSON.stringify(i),JSON.stringify(s)].join("|"));return n(),{...r,antiAliasing:{enabled:o.antiAliasing,type:i.clearType?"cleartype":o.antiAliasing?"standard":"none",smoothingLevel:o.smoothing},systemFontHints:i,fallbackBehavior:s,isolatedHash:l}}catch(e){return{...Object.keys(We).reduce((e,t)=>(e[t]=0,e),{}),antiAliasing:{enabled:!1,type:"unknown",smoothingLevel:0},systemFontHints:{clearType:!1,hintingLevel:0,subpixelRendering:!1},fallbackBehavior:{},isolatedHash:"error"}}}(),n=performance.now()-e;t&&(i.fontPreferences={value:t,duration:n,analysis:Ze(t),hash:(u=t,u.isolatedHash&&"error"!==u.isolatedHash?u.isolatedHash:[...[u.default,u.serif,u.sans,u.mono,u.apple,u.system,u.min,u.large,u.ui,u.emoji,u.math,u.cjk,u.arabic,u.hebrew,u.subpixel,u.kerning,u.ligatures].map(e=>Math.round(e)),u.antiAliasing.enabled?1:0,u.systemFontHints.clearType?1:0,u.systemFontHints.hintingLevel,Math.round(u.antiAliasing.smoothingLevel)].join(","))},r.push("fontPreferences"))}catch(e){o.push({component:"fontPreferences",error:e instanceof Error?e.message:"Font preferences detection failed"})}var u,d,p;if(st("dateTimeLocale",n)&&function(){try{return"undefined"!=typeof window&&void 0!==window.Intl}catch{return!1}}())try{const e=performance.now(),t=function(){const e=function(){try{if(!window.Intl)return-1;const e=window.Intl.DateTimeFormat;if(!e)return-2;const t=(new e).resolvedOptions();return t.locale||""===t.locale?{locale:t.locale||"unknown",calendar:t.calendar||"unknown",numberingSystem:t.numberingSystem||"unknown",timeZone:t.timeZone||"unknown",hourCycle:t.hourCycle||"unknown",hour12:void 0!==t.hour12&&t.hour12}:-3}catch(e){return-2}}();if("number"==typeof e)return e;const t=function(){try{if(!window.Intl||!window.Intl.NumberFormat)return-4;const e=(new Intl.NumberFormat).resolvedOptions(),t=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD"}).resolvedOptions();return{numberLocale:e.locale||"unknown",currencyDisplay:t.currencyDisplay||"unknown",currencySign:t.currencySign||"unknown",notation:e.notation||"unknown",signDisplay:e.signDisplay||"unknown"}}catch(e){return-4}}(),n="number"==typeof t?{}:t,r=function(){const e={listStyle:"unknown",relativeTimeStyle:"unknown",pluralRules:"unknown"};try{if(window.Intl&&window.Intl.ListFormat){const t=(new window.Intl.ListFormat).resolvedOptions();e.listStyle=t.style||"unknown"}}catch(e){}try{if(window.Intl&&window.Intl.RelativeTimeFormat){const t=(new window.Intl.RelativeTimeFormat).resolvedOptions();e.relativeTimeStyle=t.style||"unknown"}}catch(e){}try{if(window.Intl&&window.Intl.PluralRules){const t=(new window.Intl.PluralRules).select(1);e.pluralRules=t||"unknown"}}catch(e){}return e}(),o=function(){const e={DateTimeFormat:!1,NumberFormat:!1,RelativeTimeFormat:!1,ListFormat:!1,PluralRules:!1,Collator:!1};try{window.Intl&&(e.DateTimeFormat="function"==typeof window.Intl.DateTimeFormat,e.NumberFormat="function"==typeof window.Intl.NumberFormat,e.RelativeTimeFormat="function"==typeof window.Intl.RelativeTimeFormat,e.ListFormat="function"==typeof window.Intl.ListFormat,e.PluralRules="function"==typeof window.Intl.PluralRules,e.Collator="function"==typeof window.Intl.Collator)}catch(e){}return e}(),i=navigator.language||"unknown",s=e.locale===i;let a="unknown",c="unknown";try{if(window.Intl&&"function"==typeof window.Intl.DateTimeFormat){const e=new Intl.DateTimeFormat(void 0,{dateStyle:"long"}),t=new Intl.DateTimeFormat(void 0,{timeStyle:"long"}),n=e.resolvedOptions(),r=t.resolvedOptions();a=n.dateStyle||"unknown",c=r.timeStyle||"unknown"}}catch(e){}return{locale:e.locale||"unknown",calendar:e.calendar||"unknown",numberingSystem:e.numberingSystem||"unknown",timeZone:e.timeZone||"unknown",dateStyle:a,timeStyle:c,hourCycle:e.hourCycle||"unknown",hour12:e.hour12||!1,numberLocale:n.numberLocale||e.locale||"unknown",currencyDisplay:n.currencyDisplay||"unknown",currencySign:n.currencySign||"unknown",notation:n.notation||"unknown",signDisplay:n.signDisplay||"unknown",listStyle:r.listStyle||"unknown",relativeTimeStyle:r.relativeTimeStyle||"unknown",pluralRules:r.pluralRules||"unknown",navigatorLanguage:i,localeMatch:s,intlSupport:o}}(),n=performance.now()-e;t&&"object"==typeof t&&(i.dateTimeLocale={value:t,duration:n,analysis:Ue(t),hash:(d=t,"number"==typeof d?`status-${d}`:[d.locale,d.calendar,d.numberingSystem,d.timeZone,d.hourCycle,d.hour12?"1":"0",d.localeMatch?"1":"0",Object.values(d.intlSupport).map(e=>e?"1":"0").join("")].join("|"))},r.push("dateTimeLocale"))}catch(e){o.push({component:"dateTimeLocale",error:e instanceof Error?e.message:"DateTime locale detection failed"})}if(st("accessibilityEnhanced",n)&&Ae())try{const e=performance.now(),t=Ne(),n=performance.now()-e;t&&(i.accessibilityEnhanced={value:t,duration:n,analysis:Fe(t)},r.push("accessibilityEnhanced"))}catch(e){o.push({component:"accessibilityEnhanced",error:e instanceof Error?e.message:"Enhanced accessibility detection failed"})}if(st("enhancedFonts",n)&&function(){try{return"undefined"!=typeof document&&"function"==typeof document.createElement&&void 0!==document.body}catch{return!1}}())try{const e=performance.now(),t=await async function(){const e=performance.now();try{const{document:t,body:n,cleanup:r}=await new Promise((e,t)=>{const n=document.createElement("iframe");n.style.cssText="position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none;",n.onload=()=>{try{const t=n.contentDocument;if(!t)throw new Error("Cannot access iframe document");const r=t.body;if(!r)throw new Error("Iframe body not available");r.style.fontSize=$e,r.style.margin="0",r.style.padding="0",e({document:t,body:r,cleanup:()=>{n.parentNode&&n.parentNode.removeChild(n)}})}catch(e){t(e)}},n.onerror=()=>{t(new Error("Failed to load font measurement iframe"))},document.body.appendChild(n)});try{const r=t.createElement("div");r.style.setProperty("visibility","hidden","important");const o=Xe.map(e=>qe(t,e));o.forEach(e=>r.appendChild(e));const i={};for(const e of Ge)i[e]=Xe.map(n=>Ye(t,e,n)),i[e].forEach(e=>r.appendChild(e));n.appendChild(r);const s={};Xe.forEach((e,t)=>{const n=o[t];n&&(s[e]={width:n.offsetWidth,height:n.offsetHeight})});const a=[],c={};for(const e of Ge){const t=i[e];t&&(Je(t,s)&&a.push(e),t.length>0&&t[0]&&(c[e]={width:t[0].offsetWidth,height:t[0].offsetHeight}))}const l=performance.now()-e,u=Object.values(c).map(e=>e.width);return{available:a,method:"iframe",measurements:c,precision:new Set(u).size/u.length,totalTested:Ge.length,detectionTime:l}}finally{r()}}catch(t){return function(e){const t=[],n={};try{const e=document.createElement("div");e.style.cssText="position: absolute; left: -9999px; top: -9999px; visibility: hidden;";const r={};Xe.forEach(t=>{const n=document.createElement("span");n.style.fontFamily=t,n.style.fontSize=$e,n.style.whiteSpace="nowrap",n.textContent=He,e.appendChild(n),document.body.appendChild(e),r[t]={width:n.offsetWidth,height:n.offsetHeight},document.body.removeChild(e),e.removeChild(n)});for(const o of Ge){let i=!1;for(const t of Xe){const s=document.createElement("span");s.style.fontFamily=`'${o}',${t}`,s.style.fontSize=$e,s.style.whiteSpace="nowrap",s.textContent=He,e.appendChild(s),document.body.appendChild(e);const a={width:s.offsetWidth,height:s.offsetHeight};n[o]=a;const c=r[t];if(!c||a.width===c.width&&a.height===c.height||(i=!0),document.body.removeChild(e),e.removeChild(s),i)break}i&&t.push(o)}}catch(e){}const r=performance.now()-e,o=Object.values(n).map(e=>e.width),i=new Set(o).size;return{available:t,method:"dom",measurements:n,precision:o.length>0?i/o.length:0,totalTested:Ge.length,detectionTime:r}}(e)}}(),n=performance.now()-e;t&&(i.enhancedFonts={value:t,duration:n,analysis:Ke(t),hash:(p=t,`${p.available.sort().join(",")}|${p.method}|${p.precision.toFixed(2)}`)},r.push("enhancedFonts"))}catch(e){o.push({component:"enhancedFonts",error:e instanceof Error?e.message:"Enhanced font detection failed"})}const m={};let f;r.forEach(e=>{const t=i[e];t&&t.value&&(m[e]=t.value)});try{const{calculateConfidence:e}=await Promise.resolve().then(function(){return dp});f=e([...r.map(e=>({component:e,success:!0,duration:i[e]?.duration||0,value:i[e]?.value})),...o.map(e=>({component:e.component,success:!1,duration:0,error:e.error}))],{requireMinimumComponents:6,penalizeMissingCore:!0,adjustForIncognito:!0}),i.confidence={score:f.score,level:f.level,factors:f.factors,recommendations:f.recommendations}}catch(e){const t=r.length/(r.length+o.length||1);i.confidence={score:t>=.8?.95:t>=.6?.8:.5,level:t>=.8?"High":t>=.6?"Medium":"Low",factors:{componentCount:r.length,weightedScore:t,stabilityScore:t,entropyScore:t,spoofResistanceScore:t},recommendations:t<.8?["Enable more fingerprinting components"]:[]}}const g={...i,hash:"",components:r,collectionTime:performance.now()-t},v={success:r.length>0,collectedComponents:r,failedComponents:o,confidence:f||i.confidence};if(r.length>0){const e=g.browser?.value,t=g.screen?.value,i=e?.userAgent||"",a=(()=>{const e=!0===navigator.userAgentData?.mobile,n=navigator.maxTouchPoints||0,r=t?.width||0,o=t?.height||0,i=Math.min(r,o);return Math.max(r,o),e?"mobile":n>0?i<=480?"mobile":"tablet":i>1024?"desktop":i<=480?"mobile":"desktop"})();let l={};try{const{collectDeviceSignals:e}=await Promise.resolve().then(function(){return vp});l=e()}catch(e){}const u={ua:(()=>{try{return D().family}catch{const e=i,t=e.match(/(chrome|safari|firefox|edge|edg|brave|opera|opr|chromium)/i);return(t?.[1]||e.split(" ")[0]||"unknown").toLowerCase()}})(),timezone:e?.timezone||"unknown",primaryLanguage:(()=>{try{const t=e?.languages;return Array.isArray(t)&&t.length>0&&t[0]?t[0].toLowerCase().split("-")[0]:"undefined"!=typeof navigator&&navigator.language?navigator.language.toLowerCase().split("-")[0]:"unknown"}catch{return"unknown"}})(),platform:(e?.platform||"unknown").toLowerCase(),deviceType:a,hardware:(()=>{const e=l.hardwareConcurrency,t=l.deviceMemory;if(!e&&!t)return;const n=e?(e=>e>=32?"workstation":e>=20?"ultra":e>=16?"high":e>=12?"premium":e>=8?"mid":e>=6?"normal":e>=4?"basic":e>=2?"low":"minimal")(e):"unknown",r=t?(e=>e>=64?"workstation":e>=32?"ultra":e>=24?"high":e>=16?"premium":e>=12?"mid":e>=8?"normal":e>=4?"basic":e>=2?"low":"minimal")(t):"unknown";var o;return{cores:n,memory:r,arch:void 0===(o=l.architecture)?"unknown":255===o?"arm64":0===o?"x86_64":"other",class:((e,t)=>"workstation"!==e&&"ultra"!==e||"workstation"!==t&&"ultra"!==t?"high"!==e&&"premium"!==e||"high"!==t&&"premium"!==t&&"ultra"!==t?"mid"!==e&&"normal"!==e||"mid"!==t&&"normal"!==t&&"premium"!==t?"basic"!==e&&"low"!==e||"basic"!==t&&"low"!==t&&"normal"!==t?"minimal"===e||"minimal"===t?"mobile":"mixed":"budget":"mainstream":"enthusiast":"professional")(n,r),touch:l.touchSupport?.maxTouchPoints?l.touchSupport.maxTouchPoints>=10?"multi":l.touchSupport.maxTouchPoints>=5?"standard":"basic":"none"}})(),screenFrame:l?.screenFrame?{top:l.screenFrame.top||0,right:l.screenFrame.right||0,bottom:l.screenFrame.bottom||0,left:l.screenFrame.left||0}:void 0,display:(()=>{const e=l.colorDepth,t=l.colorGamut,n=(e=>e?e>=48?"ultra_high":e>=32?"high":e>=24?"normal":e>=16?"basic":"low":"unknown")(e),r=(e=>{if(!e)return"unknown";switch(e){case"rec2020":return"professional";case"p3":return"enhanced";case"srgb":return"standard";default:return"unknown"}})(t);return{depth:n,gamut:r,class:((e,t)=>"ultra_high"===e||"professional"===t?"professional":"high"===e||"enhanced"===t?"premium":"normal"===e&&"standard"===t?"standard":"basic"===e?"basic":"legacy")(n,r)}})()},d=[u.ua||"",u.platform||"",u.deviceType||"",u.timezone||"",u.primaryLanguage||""].filter(Boolean);if(d.length>=3){const e=d.join("|");let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)&4294967295;u._entropy=Math.abs(t).toString(36).substring(0,8)}(n.debug||"undefined"!=typeof window&&window._rabbitTrackerDebug)&&console.log("[RabbitTracker DEBUG] coreVector components:",{ua:u.ua,platform:u.platform,deviceType:u.deviceType,timezone:u.timezone,primaryLanguage:u.primaryLanguage,hasHardware:!!u.hardware,hasDisplay:!!u.display,hasScreenFrame:!!u.screenFrame,_entropy:u._entropy});const p=function(e,t=!1){const n=h(e),r=JSON.stringify(n);t&&console.log("[RabbitTracker] hashStableCore debug:",{originalKeys:Object.keys(e),canonicalizedKeys:Object.keys(n),canonicalLength:r.length,sample:r.substring(0,200)+"..."});const o=s(r);return t&&console.log("[RabbitTracker] Generated stableCoreHash:",o.substring(0,32)),o}(u,n.debug),y=["canvas","webgl","audio","mathFingerprint","fontPreferences","enhancedFonts","dateTimeLocale","accessibilityEnhanced","domBlockers","pluginsEnhanced"],w={};for(const[e,t]of Object.entries(m))y.includes(e)||(w[e]=t);const b={...w,_stableCore:u},S=c(b,n.debug);g.hash=S,n.debug&&console.log("[RabbitTracker] Ultra-stable core vector:",{components:Object.keys(u),entropy:u._entropy,stableCoreHash:p.substring(0,16),enhancedFingerprintHash:S.substring(0,16),ua:u.ua,deviceType:u.deviceType,platform:u.platform,timezone:u.timezone,hasScreenFrame:!!u.screenFrame,hardwareClass:u.hardware?.class,displayClass:u.display?.class,totalComponentsInHash:Object.keys(b).length}),v.data={...g,stableCoreHash:p,stableCoreVector:u},n.debug&&(console.log("[RabbitTracker] Fingerprint collection completed:",{collected:r.length,failed:o.length,duration:g.collectionTime,enhancedFingerprintHash:g.hash,stableCoreHash:p,confidence:f?.level||"Unknown",score:f?.score||0,collisionResistance:"Enhanced with stable + unstable components (no temporal entropy)"}),f?.recommendations.length&&console.log("[RabbitTracker] Confidence recommendations:",f.recommendations))}else v.error="No components could be collected";return v}async function ut(){return lt({gdprMode:!0,includeInvasive:!1,excludeComponents:["canvas","webgl","audio"],timeout:2e3})}async function ht(){return lt({gdprMode:!1,includeInvasive:!0,timeout:5e3})}class dt{constructor(){this.name="fetch",this.available="undefined"!=typeof fetch}async send(e,t){const n=Date.now();try{const r=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!r.ok)throw new Error(`HTTP ${r.status}`);return{success:!0,method:this.name,latency:Date.now()-n}}catch(e){return{success:!1,method:this.name,latency:Date.now()-n,error:e instanceof Error?e.message:String(e)}}}}class pt{constructor(e,t){this.name="elysia-websocket",this.available="undefined"!=typeof WebSocket,this.connected=!1,this.baseUrl=e,this.token=t}async send(e,t){const n=Date.now();try{if(!this.token)throw new Error("Missing token for WebSocket connection");if(await this.connect(),!this.ws||!this.connected)throw new Error("WebSocket not connected");return new Promise((t,r)=>{const o=e=>{try{const r=JSON.parse(e.data);this.ws?.removeEventListener("message",o),t({success:r.success||!1,method:this.name,latency:Date.now()-n})}catch(e){this.ws?.removeEventListener("message",o),r(new Error("Failed to parse WebSocket response"))}};this.ws?.addEventListener("message",o),this.ws?.send(JSON.stringify({...e,eventId:e.eventId||crypto.randomUUID(),sessionId:e.sessionId||e.s,eventType:e.eventType||e.type||"websocket_event",eventName:e.eventName||e.name,url:e.url,userAgent:e.userAgent||navigator.userAgent,timestamp:(new Date).toISOString(),fingerprintHash:e.fingerprintHash,stableCoreHash:e.stableCoreHash,stableCoreVector:e.stableCoreVector})),setTimeout(()=>{this.ws?.removeEventListener("message",o),r(new Error("WebSocket response timeout"))},5e3)})}catch(e){return{success:!1,method:this.name,latency:Date.now()-n,error:e instanceof Error?e.message:String(e)}}}async connect(){if(!this.connected||this.ws?.readyState!==WebSocket.OPEN)return new Promise((e,t)=>{try{const n=new URL(this.baseUrl),r=`${"https:"===n.protocol?"wss:":"ws:"}//${n.host}/ws/track?token=${encodeURIComponent(this.token)}`;this.ws=new WebSocket(r),this.ws.onopen=()=>{this.connected=!0,e()},this.ws.onerror=()=>{this.connected=!1,t(new Error("WebSocket connection failed"))},this.ws.onclose=()=>{this.connected=!1},setTimeout(()=>{this.connected||(this.ws?.close(),t(new Error("WebSocket connection timeout")))},5e3)}catch(e){t(e)}})}cleanup(){this.ws&&(this.ws.close(),this.connected=!1)}}class mt{constructor(){this.name="webrtc",this.available=void 0!==globalThis.RTCPeerConnection,this.connected=!1}async send(e,t){const n=Date.now();if(!this.available)return{success:!1,method:this.name,error:"WebRTC not available"};try{return await this.setupConnection(),this.dataChannel&&this.connected?(this.dataChannel.send(JSON.stringify(e)),{success:!0,method:this.name,latency:Date.now()-n}):{success:!1,method:this.name,error:"DataChannel not ready"}}catch(e){return{success:!1,method:this.name,error:e instanceof Error?e.message:String(e)}}}async setupConnection(){if(!this.connected)return new Promise((e,t)=>{try{this.pc=new globalThis.RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]}),this.dataChannel=this.pc.createDataChannel("tracking",{ordered:!1,maxRetransmits:0}),this.dataChannel.onopen=()=>{this.connected=!0,e()},this.dataChannel.onerror=e=>{t(e)}}catch(e){t(e)}})}destroy(){this.dataChannel&&this.dataChannel.close(),this.pc&&this.pc.close(),this.connected=!1}}class ft{constructor(e,t,n={}){this.transports=[],this.stats={totalRequests:0,successfulRequests:0,methodSuccess:new Map,methodFailures:new Map},this.baseUrl=e,this.token=t,this.config={enabled:!0,methods:["elysia-websocket","fetch"],fallbackDelay:100,maxRetries:2,debug:!1,...n},this.initializeTransports()}initializeTransports(){const e={"elysia-websocket":()=>new pt(this.baseUrl,this.token),fetch:()=>new dt,webrtc:()=>new mt};this.transports=this.config.methods.map(t=>e[t]?.()).filter(e=>void 0!==e&&e.available),this.config.debug&&console.log("[Zaplier] Anti-adblock initialized with transports:",this.transports.map(e=>e.name))}async send(e,t="/tracking/event"){if(this.stats.totalRequests++,!this.config.enabled||0===this.transports.length)return{success:!1,method:"none",error:"No transports available"};let n="";for(const r of this.transports){this.config.debug&&console.log(`[Zaplier] Trying transport: ${r.name}`);try{const o=await r.send(e,`${this.baseUrl}${t}`);if(o.success)return this.stats.successfulRequests++,this.updateMethodStats(r.name,!0),this.config.debug&&console.log(`[Zaplier] ✅ Data sent successfully via ${r.name} - STOPPING fallback chain`,o),o;this.updateMethodStats(r.name,!1),n=o.error||"Unknown error",this.config.debug&&console.warn(`[Zaplier] ❌ Transport ${r.name} failed:`,o.error)}catch(e){n=e instanceof Error?e.message:String(e),this.updateMethodStats(r.name,!1),this.config.debug&&console.warn(`[Zaplier] ❌ Transport ${r.name} threw error:`,e)}this.config.fallbackDelay>0&&await new Promise(e=>setTimeout(e,this.config.fallbackDelay))}return{success:!1,method:"all_failed",error:`All transports failed. Last error: ${n}`}}updateMethodStats(e,t){t?this.stats.methodSuccess.set(e,(this.stats.methodSuccess.get(e)||0)+1):this.stats.methodFailures.set(e,(this.stats.methodFailures.get(e)||0)+1)}getStats(){return{...this.stats}}getSuccessRates(){const e={};for(const t of this.transports){const n=this.stats.methodSuccess.get(t.name)||0,r=n+(this.stats.methodFailures.get(t.name)||0);e[t.name]=r>0?n/r*100:0}return e}destroy(){this.transports.forEach(e=>{e.destroy&&e.destroy()}),this.transports=[]}async testTransports(){const e={},t={test:!0,timestamp:Date.now()};for(const n of this.transports)try{e[n.name]=await n.send(t,`${this.baseUrl}/test`)}catch(t){e[n.name]={success:!1,method:n.name,error:t instanceof Error?t.message:String(t)}}return e}}class gt{constructor(e,t={}){this.clicks=[],this.scrollData=[],this.mouseMoves=[],this.lastMouseMove=0,this.maxScrollDepth=0,this.isActive=!1,this.recentClicks=[],this.handleClick=e=>{if(!this.config.trackClicks)return;const t=e.target;t.getBoundingClientRect();const n=window.pageXOffset||document.documentElement.scrollLeft,r=window.pageYOffset||document.documentElement.scrollTop,o={x:e.clientX,y:e.clientY,absoluteX:e.clientX+n,absoluteY:e.clientY+r,element:this.getElementSelector(t),timestamp:Date.now(),button:e.button};this.config.trackRageClicks&&this.detectRageClick(o.x,o.y,o.timestamp)&&(o.rageClick=!0),this.clicks.push(o),this.clicks.length>this.config.maxClickBuffer&&(this.clicks=this.clicks.slice(-this.config.maxClickBuffer))},this.handleScroll=()=>{if(!this.config.trackScrollDepth)return;const e=this.calculateScrollDepth();this.maxScrollDepth=Math.max(this.maxScrollDepth,e),this.scrollData.push({depth:e,maxDepth:this.maxScrollDepth,timestamp:Date.now(),viewport:{width:window.innerWidth,height:window.innerHeight}}),this.scrollData.length>100&&(this.scrollData=this.scrollData.slice(-50))},this.handleMouseMove=e=>{if(!this.config.trackMouseMoves)return;const t=Date.now();t-this.lastMouseMove<this.config.mouseMoveThrottle||(this.lastMouseMove=t,this.mouseMoves.push({x:e.clientX,y:e.clientY,timestamp:t}),this.mouseMoves.length>200&&(this.mouseMoves=this.mouseMoves.slice(-100)))},this.handleResize=()=>{const e=this.calculateScrollDepth();this.scrollData.push({depth:e,maxDepth:this.maxScrollDepth,timestamp:Date.now(),viewport:{width:window.innerWidth,height:window.innerHeight}})},this.sessionId=e,this.config={enabled:!0,trackClicks:!0,trackScrollDepth:!0,trackMouseMoves:!1,trackRageClicks:!0,mouseMoveThrottle:200,batchInterval:1e4,maxClickBuffer:500,rageClickThreshold:3,rageClickTimeWindow:1e3,...t}}start(){return!(!this.config.enabled||this.isActive||(this.isActive=!0,this.setupEventListeners(),this.startBatchTimer(),this.trackInitialViewport(),0))}stop(){this.isActive&&(this.isActive=!1,this.removeEventListeners(),this.batchTimer&&(clearInterval(this.batchTimer),this.batchTimer=void 0),this.sendBatch())}setupEventListeners(){this.config.trackClicks&&document.addEventListener("click",this.handleClick,!0),this.config.trackScrollDepth&&(window.addEventListener("scroll",this.handleScroll,{passive:!0}),document.addEventListener("scroll",this.handleScroll,{passive:!0})),this.config.trackMouseMoves&&document.addEventListener("mousemove",this.handleMouseMove,{passive:!0}),window.addEventListener("resize",this.handleResize),window.addEventListener("orientationchange",this.handleResize)}removeEventListeners(){document.removeEventListener("click",this.handleClick,!0),window.removeEventListener("scroll",this.handleScroll),document.removeEventListener("scroll",this.handleScroll),document.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("resize",this.handleResize),window.removeEventListener("orientationchange",this.handleResize)}trackInitialViewport(){const e=this.calculateScrollDepth();this.scrollData.push({depth:e,maxDepth:e,timestamp:Date.now(),viewport:{width:window.innerWidth,height:window.innerHeight}})}calculateScrollDepth(){const e=window.pageYOffset||document.documentElement.scrollTop,t=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight),n=window.innerHeight;return t<=n?100:Math.min(100,Math.round((e+n)/t*100))}detectRageClick(e,t,n){const r=this.config.rageClickTimeWindow;this.recentClicks=this.recentClicks.filter(e=>n-e.timestamp<=r);const o=this.recentClicks.filter(n=>Math.sqrt(Math.pow(n.x-e,2)+Math.pow(n.y-t,2))<=50);return this.recentClicks.push({x:e,y:t,timestamp:n}),o.length>=this.config.rageClickThreshold-1}getElementSelector(e){if(e.id)return`#${e.id}`;if(e.className&&"string"==typeof e.className){const t=e.className.split(" ").filter(e=>e.length>0);if(t.length>0)return`.${t.slice(0,2).join(".")}`}const t=e.tagName.toLowerCase();return e.parentElement?`${t}:nth-child(${Array.from(e.parentElement.children).indexOf(e)+1})`:t}startBatchTimer(){this.batchTimer=window.setInterval(()=>{this.sendBatch()},this.config.batchInterval)}sendBatch(){if(0===this.clicks.length&&0===this.scrollData.length&&0===this.mouseMoves.length)return;const e={sessionId:this.sessionId,pageMetadata:{url:window.location.href,title:document.title,viewport:{width:window.innerWidth,height:window.innerHeight},documentSize:{width:Math.max(document.body.scrollWidth,document.body.offsetWidth,document.documentElement.clientWidth,document.documentElement.scrollWidth,document.documentElement.offsetWidth),height:Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)}},clicks:[...this.clicks],scrollData:[...this.scrollData],mouseMoves:this.config.trackMouseMoves?[...this.mouseMoves]:[],maxScrollDepth:this.maxScrollDepth,timestamp:Date.now()};this.clicks=[],this.scrollData=[],this.mouseMoves=[],this.sendToBackend(e)}setAntiAdblockManager(e){this.antiAdblockManager=e}async sendToBackend(e){try{if(this.antiAdblockManager&&(await this.antiAdblockManager.send(e,"/api/heatmap/record")).success)return;(await fetch("/api/heatmap/track",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok||console.warn("[Zaplier] Heatmap batch failed to send")}catch(e){console.warn("[Zaplier] Heatmap error:",e)}}getStats(){const e=this.clicks.filter(e=>e.rageClick).length;return{clickCount:this.clicks.length,maxScrollDepth:this.maxScrollDepth,isRecording:this.isActive,mouseMovements:this.mouseMoves.length,rageClicks:e}}enableMouseTracking(){this.config.trackMouseMoves||(this.config.trackMouseMoves=!0,this.isActive&&document.addEventListener("mousemove",this.handleMouseMove,{passive:!0}))}disableMouseTracking(){this.config.trackMouseMoves&&(this.config.trackMouseMoves=!1,document.removeEventListener("mousemove",this.handleMouseMove),this.mouseMoves=[])}isRecording(){return this.isActive}}var yt,wt=Object.defineProperty,bt=(e,t,n)=>((e,t,n)=>t in e?wt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),vt=Object.defineProperty,St=(e,t,n)=>((e,t,n)=>t in e?vt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),Ct=(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))(Ct||{});const kt={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},It={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},Et={};const Mt={};function xt(e,t,n){var r;const o=`${e}.${String(n)}`;if(Mt[o])return Mt[o].call(t);const i=function(e){if(Et[e])return Et[e];const t=globalThis[e],n=t.prototype,r=e in kt?kt[e]:void 0,o=Boolean(r&&r.every(e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),i=e in It?It[e]:void 0,s=Boolean(i&&i.every(e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(o&&s&&!globalThis.Zone)return Et[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");document.body.appendChild(r);const o=r.contentWindow;if(!o)return t.prototype;const i=o[e].prototype;return document.body.removeChild(r),i?Et[e]=i:n}catch{return n}}(e),s=null==(r=Object.getOwnPropertyDescriptor(i,n))?void 0:r.get;return s?(Mt[o]=s,s.call(t)):t[n]}const At=function(e){return xt("Node",e,"childNodes")},Rt=function(e){return xt("Node",e,"parentNode")},Tt=function(e){return xt("Node",e,"parentElement")},Ot=function(e){return xt("Node",e,"textContent")},_t=function(e){return e&&"shadowRoot"in e?xt("Element",e,"shadowRoot"):null};function Dt(e){return e.nodeType===e.ELEMENT_NODE}function Pt(e){const t=e&&"host"in e&&"mode"in e&&function(e){return e&&"host"in e?xt("ShadowRoot",e,"host"):null}(e)||null;return Boolean(t&&"shadowRoot"in t&&_t(t)===e)}function Lt(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function Nt(e){try{const n=e.rules||e.cssRules;if(!n)return null;let r=e.href;return!r&&e.ownerNode&&e.ownerNode.ownerDocument&&(r=e.ownerNode.ownerDocument.location.href),(t=Array.from(n,e=>Ft(e,r)).join("")).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 Ft(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=Nt(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(n){t=e.cssText}return e.styleSheet.href?Xt(t,e.styleSheet.href):t}{let n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?Xt(n,t):n}}class Bt{constructor(){St(this,"idNodeMap",new Map),St(this,"nodeMetaMap",new WeakMap)}getId(e){var t;return e?(null==(t=this.getMeta(e))?void 0:t.id)??-1:-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function Ut({element:e,maskInputOptions:t,tagName:n,type:r,value:o,maskInputFn:i}){let s=o||"";const a=r&&zt(r);return(t[n.toLowerCase()]||a&&t[a])&&(s=i?i(s,e):"*".repeat(s.length)),s}function zt(e){return e.toLowerCase()}const Wt="__rrweb_original__";function jt(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?zt(t):null}function Vt(e,t){let n;try{n=new URL(e,t??window.location.href)}catch(e){return null}const r=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return(null==r?void 0:r[1])??null}const Zt=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Gt=/^(?:[a-z+]+:)?\/\//i,Ht=/^www\..*/i,$t=/^(data:)([^,]*),(.*)/i;function Xt(e,t){return(e||"").replace(Zt,(e,n,r,o,i,s)=>{const a=r||i||s,c=n||o||"";if(!a)return e;if(Gt.test(a)||Ht.test(a))return`url(${c}${a}${c})`;if($t.test(a))return`url(${c}${a}${c})`;if("/"===a[0])return`url(${c}${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}${c})`;const l=t.split("/"),u=a.split("/");l.pop();for(const e of u)"."!==e&&(".."===e?l.pop():l.push(e));return`url(${c}${l.join("/")}${c})`})}function qt(e){return e.replace(/(\/\*[^*]*\*\/)|[\s;]/g,"")}let Yt=1;const Jt=new RegExp("[^a-z0-9-_:]");function Kt(){return Yt++}let Qt,en;const tn=/^[^ \t\n\r\u000c]+/,nn=/^[, \t\n\r\u000c]+/,rn=new WeakMap;function on(e,t){return t&&""!==t.trim()?sn(e,t):t}function sn(e,t){let n=rn.get(e);if(n||(n=e.createElement("a"),rn.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function an(e,t,n,r){return r?"src"===n||"href"===n&&("use"!==t||"#"!==r[0])||"xlink:href"===n&&"#"!==r[0]?on(e,r):"background"!==n||"table"!==t&&"td"!==t&&"th"!==t?"srcset"===n?function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const o=e.exec(t.substring(n));return o?(r=o[0],n+=r.length,r):""}const o=[];for(;r(nn),!(n>=t.length);){let i=r(tn);if(","===i.slice(-1))i=on(e,i.substring(0,i.length-1)),o.push(i);else{let r="";i=on(e,i);let s=!1;for(;;){const e=t.charAt(n);if(""===e){o.push((i+r).trim());break}if(s)")"===e&&(s=!1);else{if(","===e){n+=1,o.push((i+r).trim());break}"("===e&&(s=!0)}r+=e,n+=1}}}return o.join(", ")}(e,r):"style"===n?Xt(r,sn(e)):"object"===t&&"data"===n?on(e,r):r:on(e,r):r}function cn(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function ln(e,t,n){if(!e)return!1;if(e.nodeType!==e.ELEMENT_NODE)return!!n&&ln(Rt(e),t,n);for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!!n&&ln(Rt(e),t,n)}function un(e,t,n,r){let o;if(Dt(e)){if(o=e,!At(o).length)return!1}else{if(null===Tt(e))return!1;o=Tt(e)}try{if("string"==typeof t){if(r){if(o.closest(`.${t}`))return!0}else if(o.classList.contains(t))return!0}else if(ln(o,t,r))return!0;if(n)if(r){if(o.closest(n))return!0}else if(o.matches(n))return!0}catch(e){}return!1}function hn(e){return null==e?"":e.toLowerCase()}function dn(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:i,maskTextClass:s,maskTextSelector:a,skipChild:c=!1,inlineStylesheet:l=!0,maskInputOptions:u={},maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:m={},inlineImages:f=!1,recordCanvas:g=!1,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b=5e3,onStylesheetLoad:v,stylesheetLoadTimeout:S=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:k=!1,cssCaptured:I=!1}=t;let{needsMask:E}=t,{preserveWhiteSpace:M=!0}=t;E||(E=un(e,s,a,void 0===E));const x=function(e,t){const{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:s,inlineStylesheet:a,maskInputOptions:c={},maskTextFn:l,maskInputFn:u,dataURLOptions:h={},inlineImages:d,recordCanvas:p,keepIframeSrcFn:m,newlyAddedElement:f=!1,cssCaptured:g=!1}=t,y=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:Ct.Document,childNodes:[],compatMode:e.compatMode}:{type:Ct.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:Ct.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:r,blockSelector:o,inlineStylesheet:i,maskInputOptions:s={},maskInputFn:a,dataURLOptions:c={},inlineImages:l,recordCanvas:u,keepIframeSrcFn:h,newlyAddedElement:d=!1,rootId:p}=t,m=function(e,t,n){try{if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,r,o),f=function(e){if(e instanceof HTMLFormElement)return"form";const t=zt(e.tagName);return Jt.test(t)?"div":t}(e);let g={};const y=e.attributes.length;for(let t=0;t<y;t++){const r=e.attributes[t];cn(f,r.name,r.value)||(g[r.name]=an(n,f,zt(r.name),r.value))}if("link"===f&&i){const t=Array.from(n.styleSheets).find(t=>t.href===e.href);let r=null;t&&(r=Nt(t)),r&&(delete g.rel,delete g.href,g._cssText=r)}if("style"===f&&e.sheet){let t=Nt(e.sheet);t&&(e.childNodes.length>1&&(t=function(e,t){return function(e,t){const n=Array.from(t.childNodes),r=[];if(n.length>1&&e&&"string"==typeof e){const t=qt(e);for(let o=1;o<n.length;o++)if(n[o].textContent&&"string"==typeof n[o].textContent){const i=qt(n[o].textContent);for(let n=3;n<i.length;n++){const o=i.substring(0,n);if(2===t.split(o).length){const n=t.indexOf(o);for(let t=n;t<e.length;t++)if(qt(e.substring(0,t)).length===n){r.push(e.substring(0,t)),e=e.substring(t);break}break}}}}return r.push(e),r}(e,t).join("/* rr_split */")}(t,e)),g._cssText=t)}if("input"===f||"textarea"===f||"select"===f){const t=e.value,n=e.checked;"radio"!==g.type&&"checkbox"!==g.type&&"submit"!==g.type&&"button"!==g.type&&t?g.value=Ut({element:e,type:jt(e),tagName:f,value:t,maskInputOptions:s,maskInputFn:a}):n&&(g.checked=n)}if("option"===f&&(e.selected&&!s.select?g.selected=!0:delete g.selected),"dialog"===f&&e.open&&(g.rr_open_mode=e.matches("dialog:modal")?"modal":"non-modal"),"canvas"===f&&u)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){const o=t.getImageData,i=Wt in o?o[Wt]:o;if(new Uint32Array(i.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(g.rr_dataURL=e.toDataURL(c.type,c.quality));else if(!("__context"in e)){const t=e.toDataURL(c.type,c.quality),r=n.createElement("canvas");r.width=e.width,r.height=e.height,t!==r.toDataURL(c.type,c.quality)&&(g.rr_dataURL=t)}if("img"===f&&l){Qt||(Qt=n.createElement("canvas"),en=Qt.getContext("2d"));const t=e,r=t.currentSrc||t.getAttribute("src")||"<unknown-src>",o=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{Qt.width=t.naturalWidth,Qt.height=t.naturalHeight,en.drawImage(t,0,0),g.rr_dataURL=Qt.toDataURL(c.type,c.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i));console.warn(`Cannot inline img src=${r}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(o?g.crossOrigin=o:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i)}if("audio"===f||"video"===f){const t=g;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}if(d||(e.scrollLeft&&(g.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(g.rr_scrollTop=e.scrollTop)),m){const{width:t,height:n}=e.getBoundingClientRect();g={class:g.class,rr_width:`${t}px`,rr_height:`${n}px`}}let w;"iframe"!==f||h(g.src)||(e.contentDocument||(g.rr_src=g.src),delete g.src);try{customElements.get(f)&&(w=!0)}catch(e){}return{type:Ct.Element,tagName:f,attributes:g,childNodes:[],isSVG:(b=e,Boolean("svg"===b.tagName||b.ownerSVGElement)||void 0),needBlock:m,rootId:p,isCustom:w};var b}(e,{doc:n,blockClass:o,blockSelector:i,inlineStylesheet:a,maskInputOptions:c,maskInputFn:u,dataURLOptions:h,inlineImages:d,recordCanvas:p,keepIframeSrcFn:m,newlyAddedElement:f,rootId:y});case e.TEXT_NODE:return function(e,t){const{needsMask:n,maskTextFn:r,rootId:o,cssCaptured:i}=t,s=Rt(e),a=s&&s.tagName;let c="";const l="STYLE"===a||void 0,u="SCRIPT"===a||void 0;return u?c="SCRIPT_PLACEHOLDER":i||(c=Ot(e),l&&c&&(c=Xt(c,sn(t.doc)))),!l&&!u&&c&&n&&(c=r?r(c,Tt(e)):c.replace(/[\S]/g,"*")),{type:Ct.Text,textContent:c||"",rootId:o}}(e,{doc:n,needsMask:s,maskTextFn:l,rootId:y,cssCaptured:g});case e.CDATA_SECTION_NODE:return{type:Ct.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:Ct.Comment,textContent:Ot(e)||"",rootId:y};default:return!1}}(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,inlineStylesheet:l,maskInputOptions:u,maskTextFn:h,maskInputFn:d,dataURLOptions:m,inlineImages:f,recordCanvas:g,keepIframeSrcFn:C,newlyAddedElement:k,cssCaptured:I});if(!x)return console.warn(e,"not serialized"),null;let A;A=r.hasNode(e)?r.getId(e):function(e,t){if(t.comment&&e.type===Ct.Comment)return!0;if(e.type===Ct.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"===Vt(e.attributes.href)))return!0;if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(hn(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===hn(e.attributes.name)||"icon"===hn(e.attributes.rel)||"apple-touch-icon"===hn(e.attributes.rel)||"shortcut icon"===hn(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&hn(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(hn(e.attributes.property).match(/^(og|twitter|fb):/)||hn(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===hn(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===hn(e.attributes.name)||"googlebot"===hn(e.attributes.name)||"bingbot"===hn(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===hn(e.attributes.name)||"generator"===hn(e.attributes.name)||"framework"===hn(e.attributes.name)||"publisher"===hn(e.attributes.name)||"progid"===hn(e.attributes.name)||hn(e.attributes.property).match(/^article:/)||hn(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===hn(e.attributes.name)||"yandex-verification"===hn(e.attributes.name)||"csrf-token"===hn(e.attributes.name)||"p:domain_verify"===hn(e.attributes.name)||"verify-v1"===hn(e.attributes.name)||"verification"===hn(e.attributes.name)||"shopify-checkout-api-token"===hn(e.attributes.name)))return!0}}return!1}(x,p)||!M&&x.type===Ct.Text&&!x.textContent.replace(/^\s+|\s+$/gm,"").length?-2:Kt();const R=Object.assign(x,{id:A});if(r.add(e,R),-2===A)return null;y&&y(e);let T=!c;if(R.type===Ct.Element){T=T&&!R.needBlock,delete R.needBlock;const t=_t(e);t&&Lt(t)&&(R.isShadowHost=!0)}if((R.type===Ct.Document||R.type===Ct.Element)&&T){p.headWhitespace&&R.type===Ct.Element&&"head"===R.tagName&&(M=!1);const t={doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:c,inlineStylesheet:l,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:m,inlineImages:f,recordCanvas:g,preserveWhiteSpace:M,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:S,keepIframeSrcFn:C,cssCaptured:!1};if(R.type===Ct.Element&&"textarea"===R.tagName&&void 0!==R.attributes.value);else{R.type===Ct.Element&&void 0!==R.attributes._cssText&&"string"==typeof R.attributes._cssText&&(t.cssCaptured=!0);for(const n of Array.from(At(e))){const e=dn(n,t);e&&R.childNodes.push(e)}}let k=null;if(Dt(e)&&(k=_t(e)))for(const e of Array.from(At(k))){const n=dn(e,t);n&&(Lt(k)&&(n.isShadow=!0),R.childNodes.push(n))}}const O=Rt(e);return O&&Pt(O)&&Lt(O)&&(R.isShadow=!0),R.type===Ct.Element&&"iframe"===R.tagName&&function(e,t,n){const r=e.contentWindow;if(!r)return;let o,i=!1;try{o=r.document.readyState}catch(e){return}if("complete"!==o){const r=setTimeout(()=>{i||(t(),i=!0)},n);return void e.addEventListener("load",()=>{clearTimeout(r),i=!0,t()})}const s="about:blank";if(r.location.href!==s||e.src===s||""===e.src)return setTimeout(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=e.contentDocument;if(t&&w){const n=dn(t,{doc:t,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:m,inlineImages:f,recordCanvas:g,preserveWhiteSpace:M,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:S,keepIframeSrcFn:C});n&&w(e,n)}},b),R.type===Ct.Element&&"link"===R.tagName&&"string"==typeof R.attributes.rel&&("stylesheet"===R.attributes.rel||"preload"===R.attributes.rel&&"string"==typeof R.attributes.href&&"css"===Vt(R.attributes.href))&&function(e,t,n){let r,o=!1;try{r=e.sheet}catch(e){return}if(r)return;const i=setTimeout(()=>{o||(t(),o=!0)},n);e.addEventListener("load",()=>{clearTimeout(i),o=!0,t()})}(e,()=>{if(v){const t=dn(e,{doc:n,mirror:r,blockClass:o,blockSelector:i,needsMask:E,maskTextClass:s,maskTextSelector:a,skipChild:!1,inlineStylesheet:l,maskInputOptions:u,maskTextFn:h,maskInputFn:d,slimDOMOptions:p,dataURLOptions:m,inlineImages:f,recordCanvas:g,preserveWhiteSpace:M,onSerialize:y,onIframeLoad:w,iframeLoadTimeout:b,onStylesheetLoad:v,stylesheetLoadTimeout:S,keepIframeSrcFn:C});t&&v(e,t)}},S),R}function pn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function mn(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var fn={exports:{}},gn=String,yn=function(){return{isColorSupported:!1,reset:gn,bold:gn,dim:gn,italic:gn,underline:gn,inverse:gn,hidden:gn,strikethrough:gn,black:gn,red:gn,green:gn,yellow:gn,blue:gn,magenta:gn,cyan:gn,white:gn,gray:gn,bgBlack:gn,bgRed:gn,bgGreen:gn,bgYellow:gn,bgBlue:gn,bgMagenta:gn,bgCyan:gn,bgWhite:gn}};fn.exports=yn(),fn.exports.createColors=yn;var wn=fn.exports;const bn=mn(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let vn=wn,Sn=bn,Cn=class e extends Error{constructor(t,n,r,o,i,s){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),o&&(this.source=o),s&&(this.plugin=s),void 0!==n&&void 0!==r&&("number"==typeof n?(this.line=n,this.column=r):(this.line=n.line,this.column=n.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=vn.isColorSupported),Sn&&e&&(t=Sn(t));let n,r,o=t.split(/\r?\n/),i=Math.max(this.line-3,0),s=Math.min(this.line+2,o.length),a=String(s).length;if(e){let{bold:e,gray:t,red:o}=vn.createColors(!0);n=t=>e(o(t)),r=e=>t(e)}else n=r=e=>e;return o.slice(i,s).map((e,t)=>{let o=i+1+t,s=" "+(" "+o).slice(-a)+" | ";if(o===this.line){let t=r(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+r(s)+e+"\n "+t+n("^")}return" "+r(s)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var kn=Cn;Cn.default=Cn;var In={};In.isClean=Symbol("isClean"),In.my=Symbol("my");const En={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let Mn=class{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{let o=(e.raws.between||"")+(t?";":"");this.builder(n+r+o,e)}}beforeAfter(e,t){let n;n="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,o=0;for(;r&&"root"!==r.type;)o+=1,r=r.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<o;e++)n+=t}return n}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let o=e.nodes[r],i=this.raw(o,"before");i&&this.builder(i),this.stringify(o,t!==r||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}decl(e,t){let n=this.raw(e,"between","colon"),r=e.prop+n+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,n){let r;if(n||(n=t),t&&(r=e.raws[t],void 0!==r))return r;let o=e.parent;if("before"===n){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}if(!o)return En[n];let i=e.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[n])return i.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);{let o="raw"+((s=n)[0].toUpperCase()+s.slice(1));this[o]?r=this[o](i,e):i.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var s;return void 0===r&&(r=En[n]),i.rawCache[n]=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 n;return e.walkComments(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}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(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.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(n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==n.raws.before){let e=n.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 n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}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 xn=Mn;Mn.default=Mn;let An=xn;function Rn(e,t){new An(t).stringify(e)}var Tn=Rn;Rn.default=Rn;let{isClean:On,my:_n}=In,Dn=kn,Pn=xn,Ln=Tn;function Nn(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let o=e[r],i=typeof o;"parent"===r&&"object"===i?t&&(n[r]=t):"source"===r?n[r]=o:Array.isArray(o)?n[r]=o.map(e=>Nn(e,n)):("object"===i&&null!==o&&(o=Nn(o)),n[r]=o)}return n}let Fn=class{constructor(e={}){this.raws={},this[On]=!1,this[_n]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}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=Nn(this);for(let n in e)t[n]=e[n];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:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new Dn(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[On]){this[On]=!1;let e=this;for(;e=e.parent;)e[On]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,o=this.source.start.line;for(let t=0;t<e;t++)"\n"===n[t]?(r=1,o+=1):r+=1;return{column:r,line:o}}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},n=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(),o=r.indexOf(e.word);-1!==o&&(t=this.positionInside(o,r),n=this.positionInside(o+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?n={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return(new Pn).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,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},r=null==t;t=t||new Map;let o=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))n[e]=r.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof r&&r.toJSON)n[e]=r.toJSON(null,t);else if("source"===e){let i=t.get(r.input);null==i&&(i=o,t.set(r.input,o),o++),n[e]={end:r.end,inputId:i,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Ln){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,n){let r={node:this};for(let e in n)r[e]=n[e];return e.warn(t,r)}get proxyOf(){return this}};var Bn=Fn;Fn.default=Fn;let Un=Bn,zn=class extends Un{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=zn;zn.default=zn;var jn={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:Vn,SourceMapGenerator:Zn}=bn,{existsSync:Gn,readFileSync:Hn}=bn,{dirname:$n,join:Xn}=bn,qn=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=$n(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new Vn(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 n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}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 n=e.lastIndexOf(t.pop()),r=e.indexOf("*/",n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=$n(e),Gn(e))return this.mapFile=e,Hn(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 Vn)return Zn.fromSourceMap(t).toString();if(t instanceof Zn)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Xn($n(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 Yn=qn;qn.default=qn;let{SourceMapConsumer:Jn,SourceMapGenerator:Kn}=bn,{fileURLToPath:Qn,pathToFileURL:er}=bn,{isAbsolute:tr,resolve:nr}=bn,{nanoid:rr}=jn,or=bn,ir=kn,sr=Yn,ar=Symbol("fromOffsetCache"),cr=Boolean(Jn&&Kn),lr=Boolean(nr&&tr),ur=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&&(!lr||/^\w+:\/\//.test(t.from)||tr(t.from)?this.file=t.from:this.file=nr(t.from)),lr&&cr){let e=new sr(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 "+rr(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,r={}){let o,i,s;if(t&&"object"==typeof t){let e=t,r=n;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);i=e.line,s=e.col}else i=r.line,s=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let a=this.origin(t,n,i,s);return o=a?new ir(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 ir(e,void 0===i?t:{column:n,line:t},void 0===i?n:{column:s,line:i},this.css,this.file,r.plugin),o.input={column:n,endColumn:s,endLine:i,line:t,source:this.css},this.file&&(er&&(o.input.url=er(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,n;if(this[ar])n=this[ar];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let r=0,o=e.length;r<o;r++)n[r]=t,t+=e[r].length+1;this[ar]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t,o=n.length-2;for(;r<o;)if(t=r+(o-r>>1),e<n[t])o=t-1;else{if(!(e>=n[t+1])){r=t;break}r=t+1}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:nr(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,r){if(!this.map)return!1;let o,i,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(o=s.originalPositionFor({column:r,line:n})),i=tr(a.source)?er(a.source):new URL(a.source,this.map.consumer().sourceRoot||er(this.map.mapFile));let c={column:a.column,endColumn:o&&o.column,endLine:o&&o.line,line:a.line,url:i.toString()};if("file:"===i.protocol){if(!Qn)throw new Error("file: protocol is not available in this PostCSS build");c.file=Qn(i)}let l=s.sourceContentFor(a.source);return l&&(c.source=l),c}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 hr=ur;ur.default=ur,or&&or.registerInput&&or.registerInput(ur);let{SourceMapConsumer:dr,SourceMapGenerator:pr}=bn,{dirname:mr,relative:fr,resolve:gr,sep:yr}=bn,{pathToFileURL:wr}=bn,br=hr,vr=Boolean(dr&&pr),Sr=Boolean(mr&&gr&&fr&&yr);var Cr=class{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,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,n=this.toUrl(this.path(e.file)),r=e.root||mr(e.file);!1===this.mapOpts.sourcesContent?(t=new dr(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,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(),Sr&&vr&&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=pr.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new pr({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 pr({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,r=1,o="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(s,a,c)=>{if(this.css+=s,a&&"end"!==c&&(i.generated.line=n,i.generated.column=r-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=o,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=s.match(/\n/g),e?(n+=e.length,t=s.lastIndexOf("\n"),r=s.length-t):r+=s.length,a&&"start"!==c){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=n,i.generated.column=r-2,this.map.addMapping(i)):(i.source=o,i.original.line=1,i.original.column=0,i.generated.line=n,i.generated.column=r-1,this.map.addMapping(i)))}})}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 n=this.opts.to?mr(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=mr(gr(n,this.mapOpts.annotation)));let r=fr(n,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 br(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 n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));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(wr){let t=wr(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;"\\"===yr&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}};let kr=Bn,Ir=class extends kr{constructor(e){super(e),this.type="comment"}};var Er=Ir;Ir.default=Ir;let Mr,xr,Ar,Rr,{isClean:Tr,my:Or}=In,_r=Wn,Dr=Er,Pr=Bn;function Lr(e){return e.map(e=>(e.nodes&&(e.nodes=Lr(e.nodes)),delete e.source,e))}function Nr(e){if(e[Tr]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Nr(t)}let Fr=class e extends Pr{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,n,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[r]+=1;return delete this.indexes[r],n}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")?(...n)=>e[t](...n.map(e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e)):"every"===t||"some"===t?n=>e[t]((e,...t)=>n(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,n)=>(e[t]===n||(e[t]=n,"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 n,r=this.index(e),o=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of o)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)n=this.indexes[e],r<n&&(this.indexes[e]=n+o.length);return this.markDirty(),this}insertBefore(e,t){let n,r=this.index(e),o=0===r&&"prepend",i=this.normalize(t,this.proxyOf.nodes[r],o).reverse();r=this.index(e);for(let e of i)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)n=this.indexes[e],r<=n&&(this.indexes[e]=n+i.length);return this.markDirty(),this}normalize(t,n){if("string"==typeof t)t=Lr(Mr(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 _r(t)]}else if(t.selector)t=[new xr(t)];else if(t.name)t=[new Ar(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new Dr(t)]}return t.map(t=>(t[Or]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[Tr]&&Nr(t),void 0===t.raws.before&&n&&void 0!==n.raws.before&&(t.raws.before=n.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 n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=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,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let r;try{r=e(t,n)}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((n,r)=>{if("atrule"===n.type&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if("atrule"===n.type&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("atrule"===e.type)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if("comment"===t.type)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("decl"===n.type&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if("decl"===n.type&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("decl"===e.type)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("rule"===n.type&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if("rule"===n.type&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("rule"===e.type)return t(e,n)}))}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]}};Fr.registerParse=e=>{Mr=e},Fr.registerRule=e=>{xr=e},Fr.registerAtRule=e=>{Ar=e},Fr.registerRoot=e=>{Rr=e};var Br=Fr;Fr.default=Fr,Fr.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,Ar.prototype):"rule"===e.type?Object.setPrototypeOf(e,xr.prototype):"decl"===e.type?Object.setPrototypeOf(e,_r.prototype):"comment"===e.type?Object.setPrototypeOf(e,Dr.prototype):"root"===e.type&&Object.setPrototypeOf(e,Rr.prototype),e[Or]=!0,e.nodes&&e.nodes.forEach(e=>{Fr.rebuild(e)})};let Ur,zr,Wr=Br,jr=class extends Wr{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Ur(new zr,this,e).stringify()}};jr.registerLazyResult=e=>{Ur=e},jr.registerProcessor=e=>{zr=e};var Vr=jr;jr.default=jr;let Zr={};var Gr=function(e){Zr[e]||(Zr[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Hr=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 $r=Hr;Hr.default=Hr;let Xr=$r,qr=class{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,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 n=new Xr(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var Yr=qr;qr.default=qr;const Jr="'".charCodeAt(0),Kr='"'.charCodeAt(0),Qr="\\".charCodeAt(0),eo="/".charCodeAt(0),to="\n".charCodeAt(0),no=" ".charCodeAt(0),ro="\f".charCodeAt(0),oo="\t".charCodeAt(0),io="\r".charCodeAt(0),so="[".charCodeAt(0),ao="]".charCodeAt(0),co="(".charCodeAt(0),lo=")".charCodeAt(0),uo="{".charCodeAt(0),ho="}".charCodeAt(0),po=";".charCodeAt(0),mo="*".charCodeAt(0),fo=":".charCodeAt(0),go="@".charCodeAt(0),yo=/[\t\n\f\r "#'()/;[\\\]{}]/g,wo=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,bo=/.[\r\n"'(/\\]/,vo=/[\da-f]/i;let So=Br,Co=class extends So{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 ko=Co;Co.default=Co,So.registerAtRule(Co);let Io,Eo,Mo=Br,xo=class extends Mo{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let r=super.normalize(e);if(t)if("prepend"===n)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 n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new Io(new Eo,this,e).stringify()}};xo.registerLazyResult=e=>{Io=e},xo.registerProcessor=e=>{Eo=e};var Ao=xo;xo.default=xo,Mo.registerRoot(xo);let Ro={comma:e=>Ro.split(e,[","],!0),space:e=>Ro.split(e,[" ","\n","\t"]),split(e,t,n){let r=[],o="",i=!1,s=0,a=!1,c="",l=!1;for(let n of e)l?l=!1:"\\"===n?l=!0:a?n===c&&(a=!1):'"'===n||"'"===n?(a=!0,c=n):"("===n?s+=1:")"===n?s>0&&(s-=1):0===s&&t.includes(n)&&(i=!0),i?(""!==o&&r.push(o.trim()),o="",i=!1):o+=n;return(n||""!==o)&&r.push(o.trim()),r}};var To=Ro;Ro.default=Ro;let Oo=Br,_o=To,Do=class extends Oo{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return _o.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}};var Po=Do;Do.default=Do,Oo.registerRule(Do);let Lo=Wn,No=Er,Fo=ko,Bo=Ao,Uo=Po;const zo={empty:!0,space:!0};let Wo=Br,jo=class{constructor(e){this.input=e,this.root=new Bo,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,n,r,o=new Fo;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let i=!1,s=!1,a=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,n=a[r];n&&"space"===n[0];)n=a[--r];n&&(o.source.end=this.getPosition(n[3]||n[2]),o.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(o.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(o,"params",a),i&&(e=a[a.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),s&&(o.nodes=[],this.current=o)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,r=0;for(let o=t-1;o>=0&&(n=e[o],"space"===n[0]||(r+=1,2!==r));o--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,r,o=0;for(let[i,s]of e.entries()){if(t=s,n=t[0],"("===n&&(o+=1),")"===n&&(o-=1),0===o&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return i}this.doubleColon(t)}r=t}return!1}comment(e){let t=new No;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=function(e,t={}){let n,r,o,i,s,a,c,l,u,h,d=e.css.valueOf(),p=t.ignoreErrors,m=d.length,f=0,g=[],y=[];function w(t){throw e.error("Unclosed "+t,f)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&f>=m},nextToken:function(e){if(y.length)return y.pop();if(f>=m)return;let t=!!e&&e.ignoreUnclosed;switch(n=d.charCodeAt(f),n){case to:case no:case oo:case io:case ro:r=f;do{r+=1,n=d.charCodeAt(r)}while(n===no||n===to||n===oo||n===io||n===ro);h=["space",d.slice(f,r)],f=r-1;break;case so:case ao:case uo:case ho:case fo:case po:case lo:{let e=String.fromCharCode(n);h=[e,e,f];break}case co:if(l=g.length?g.pop()[1]:"",u=d.charCodeAt(f+1),"url"===l&&u!==Jr&&u!==Kr&&u!==no&&u!==to&&u!==oo&&u!==ro&&u!==io){r=f;do{if(a=!1,r=d.indexOf(")",r+1),-1===r){if(p||t){r=f;break}w("bracket")}for(c=r;d.charCodeAt(c-1)===Qr;)c-=1,a=!a}while(a);h=["brackets",d.slice(f,r+1),f,r],f=r}else r=d.indexOf(")",f+1),i=d.slice(f,r+1),-1===r||bo.test(i)?h=["(","(",f]:(h=["brackets",i,f,r],f=r);break;case Jr:case Kr:o=n===Jr?"'":'"',r=f;do{if(a=!1,r=d.indexOf(o,r+1),-1===r){if(p||t){r=f+1;break}w("string")}for(c=r;d.charCodeAt(c-1)===Qr;)c-=1,a=!a}while(a);h=["string",d.slice(f,r+1),f,r],f=r;break;case go:yo.lastIndex=f+1,yo.test(d),r=0===yo.lastIndex?d.length-1:yo.lastIndex-2,h=["at-word",d.slice(f,r+1),f,r],f=r;break;case Qr:for(r=f,s=!0;d.charCodeAt(r+1)===Qr;)r+=1,s=!s;if(n=d.charCodeAt(r+1),s&&n!==eo&&n!==no&&n!==to&&n!==oo&&n!==io&&n!==ro&&(r+=1,vo.test(d.charAt(r)))){for(;vo.test(d.charAt(r+1));)r+=1;d.charCodeAt(r+1)===no&&(r+=1)}h=["word",d.slice(f,r+1),f,r],f=r;break;default:n===eo&&d.charCodeAt(f+1)===mo?(r=d.indexOf("*/",f+2)+1,0===r&&(p||t?r=d.length:w("comment")),h=["comment",d.slice(f,r+1),f,r],f=r):(wo.lastIndex=f+1,wo.test(d),r=0===wo.lastIndex?d.length-1:wo.lastIndex-2,h=["word",d.slice(f,r+1),f,r],g.push(h),f=r)}return f++,h},position:function(){return f}}}(this.input)}decl(e,t){let n=new Lo;this.init(n,e[0][2]);let r,o=e[e.length-1];for(";"===o[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(o[3]||o[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let i,s=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)s.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),o="";for(let e=t;e>0;e--){let t=r[e][0];if(0===o.trim().indexOf("!")&&"space"!==t)break;o=r.pop()[1]+o}0===o.trim().indexOf("!")&&(n.important=!0,n.raws.important=o,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=s.map(e=>e[1]).join(""),s=[]),this.raw(n,"value",s.concat(e),t),n.value.includes(":")&&!t&&this.checkMissedSemicolon(e)}doubleColon(e){throw this.input.error("Double colon",{offset:e[2]},{offset:e[2]+e[1].length})}emptyRule(e){let t=new Uo;this.init(t,e[2]),t.selector="",t.raws.between="",this.current=t}end(e){this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.semicolon=!1,this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.spaces="",this.current.parent?(this.current.source.end=this.getPosition(e[2]),this.current.source.end.offset++,this.current=this.current.parent):this.unexpectedClose(e)}endFile(){this.current.parent&&this.unclosedBlock(),this.current.nodes&&this.current.nodes.length&&(this.current.raws.semicolon=this.semicolon),this.current.raws.after=(this.current.raws.after||"")+this.spaces,this.root.source.end=this.getPosition(this.tokenizer.position())}freeSemicolon(e){if(this.spaces+=e[1],this.current.nodes){let 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,n=null,r=!1,o=null,i=[],s=e[1].startsWith("--"),a=[],c=e;for(;c;){if(n=c[0],a.push(c),"("===n||"["===n)o||(o=c),i.push("("===n?")":"]");else if(s&&r&&"{"===n)o||(o=c),i.push("}");else if(0===i.length){if(";"===n){if(r)return void this.decl(a,s);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===i[i.length-1]&&(i.pop(),0===i.length&&(o=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(o),t&&r){if(!s)for(;a.length&&(c=a[a.length-1][0],"space"===c||"comment"===c);)this.tokenizer.back(a.pop());this.decl(a,s)}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,n,r){let o,i,s,a,c=n.length,l="",u=!0;for(let e=0;e<c;e+=1)o=n[e],i=o[0],"space"!==i||e!==c-1||r?"comment"===i?(a=n[e-1]?n[e-1][0]:"empty",s=n[e+1]?n[e+1][0]:"empty",zo[a]||zo[s]||","===l.slice(-1)?u=!1:l+=o[1]):l+=o[1]:u=!1;if(!u){let r=n.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:l}}e[t]=l}rule(e){e.pop();let t=new Uo;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n="";for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}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})}},Vo=hr;function Zo(e,t){let n=new Vo(e,t),r=new jo(n);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 Go=Zo;Zo.default=Zo,Wo.registerParse(Zo);let{isClean:Ho,my:$o}=In,Xo=Cr,qo=Tn,Yo=Br,Jo=Vr,Ko=Gr,Qo=Yr,ei=Go,ti=Ao;const ni={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},ri={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},oi={Once:!0,postcssPlugin:!0,prepare:!0};function ii(e){return"object"==typeof e&&"function"==typeof e.then}function si(e){let t=!1,n=ni[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function ai(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:si(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function ci(e){return e[Ho]=!1,e.nodes&&e.nodes.forEach(e=>ci(e)),e}let li={},ui=class e{constructor(t,n,r){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof n||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof Qo)o=ci(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=ei;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{o=e(n,r)}catch(e){this.processed=!0,this.error=e}o&&!o[$o]&&Yo.rebuild(o)}else o=ci(n);this.result=new Qo(t,o,r),this.helpers={...li,postcss:li,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 n=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(n.postcssVersion&&"production"!==process.env.NODE_ENV){let e=n.postcssPlugin,t=n.postcssVersion,r=this.result.processor.version,o=t.split("."),i=r.split(".");(o[0]!==i[0]||parseInt(o[1])>parseInt(i[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=n.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if("object"==typeof t)for(let n in t){if(!ri[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!oi[n])if("object"==typeof t[n])for(let r in t[n])e(t,"*"===r?n:n+"-"+r.toLowerCase(),t[n][r]);else"function"==typeof t[n]&&e(t,n,t[n])}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],n=this.runOnRoot(t);if(ii(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ho];){e[Ho]=!0;let t=[ai(e)];for(;t.length>0;){let e=this.visitTick(t);if(ii(e))try{await e}catch(e){let n=t[t.length-1].node;throw this.handleError(e,n)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>n(e,this.helpers));await Promise.all(t)}else await n(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 ii(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=qo;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new Xo(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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(ii(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Ho];)e[Ho]=!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||Ko("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[n,r]of e){let e;this.result.lastPlugin=n;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(ii(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:r}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,o]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return o(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){let r,o=t.iterator;for(;r=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!r[Ho])return r[Ho]=!0,void e.push(ai(r));t.iterator=0,delete n.indexes[o]}let o=t.events;for(;t.eventIndex<o.length;){let e=o[t.eventIndex];if(t.eventIndex+=1,0===e)return void(n.nodes&&n.nodes.length&&(n[Ho]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Ho]=!0;let t=si(e);for(let n of t)if(0===n)e.nodes&&e.each(e=>{e[Ho]||this.walkSync(e)});else{let t=this.listeners[n];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"}};ui.registerPostcss=e=>{li=e};var hi=ui;ui.default=ui,ti.registerLazyResult(ui),Jo.registerLazyResult(ui);let di=Cr,pi=Tn,mi=Gr,fi=Go;const gi=Yr;let yi=class{constructor(e,t,n){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let o=pi;this.result=new gi(this._processor,r,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let s=new di(o,r,this._opts,t);if(s.isMap()){let[e,t]=s.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else s.clearAnnotation(),this.result.css=s.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||mi("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=fi;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 wi=yi;yi.default=yi;let bi=wi,vi=hi,Si=Vr,Ci=Ao,ki=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else{if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" 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 vi(this,e,t):new bi(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var Ii=ki;ki.default=ki,Ci.registerProcessor(ki),Si.registerProcessor(ki);let Ei=Wn,Mi=Yn,xi=Er,Ai=ko,Ri=hr,Ti=Ao,Oi=Po;function _i(e,t){if(Array.isArray(e))return e.map(e=>_i(e));let{inputs:n,...r}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:Ri.prototype};n.map&&(n.map={...n.map,__proto__:Mi.prototype}),t.push(n)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>_i(e,t))),r.source){let{inputId:e,...n}=r.source;r.source=n,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new Ti(r);if("decl"===r.type)return new Ei(r);if("rule"===r.type)return new Oi(r);if("comment"===r.type)return new xi(r);if("atrule"===r.type)return new Ai(r);throw new Error("Unknown node type: "+e.type)}var Di=_i;_i.default=_i;let Pi=kn,Li=Wn,Ni=hi,Fi=Br,Bi=Ii,Ui=Tn,zi=Di,Wi=Vr,ji=$r,Vi=Er,Zi=ko,Gi=Yr,Hi=hr,$i=Go,Xi=To,qi=Po,Yi=Ao,Ji=Bn;function Ki(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new Bi(e)}Ki.plugin=function(e,t){let n,r=!1;function o(...n){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 o=t(...n);return o.postcssPlugin=e,o.postcssVersion=(new Bi).version,o}return Object.defineProperty(o,"postcss",{get:()=>(n||(n=o()),n)}),o.process=function(e,t,n){return Ki([o(n)]).process(e,t)},o},Ki.stringify=Ui,Ki.parse=$i,Ki.fromJSON=zi,Ki.list=Xi,Ki.comment=e=>new Vi(e),Ki.atRule=e=>new Zi(e),Ki.decl=e=>new Li(e),Ki.rule=e=>new qi(e),Ki.root=e=>new Yi(e),Ki.document=e=>new Wi(e),Ki.CssSyntaxError=Pi,Ki.Declaration=Li,Ki.Container=Fi,Ki.Processor=Bi,Ki.Document=Wi,Ki.Comment=Vi,Ki.Warning=ji,Ki.AtRule=Zi,Ki.Result=Gi,Ki.Input=Hi,Ki.Rule=qi,Ki.Root=Yi,Ki.Node=Ji,Ni.registerPostcss(Ki);var Qi=Ki;Ki.default=Ki;const es=pn(Qi);es.stringify,es.fromJSON,es.plugin,es.parse,es.list,es.document,es.comment,es.atRule,es.rule,es.decl,es.root,es.CssSyntaxError,es.Declaration,es.Container,es.Processor,es.Document,es.Comment,es.Warning,es.AtRule,es.Result,es.Input,es.Rule,es.Root,es.Node;var ts=Object.defineProperty,ns=(e,t,n)=>((e,t,n)=>t in e?ts(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);function rs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function os(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})}),n}var is={exports:{}},ss=String,as=function(){return{isColorSupported:!1,reset:ss,bold:ss,dim:ss,italic:ss,underline:ss,inverse:ss,hidden:ss,strikethrough:ss,black:ss,red:ss,green:ss,yellow:ss,blue:ss,magenta:ss,cyan:ss,white:ss,gray:ss,bgBlack:ss,bgRed:ss,bgGreen:ss,bgYellow:ss,bgBlue:ss,bgMagenta:ss,bgCyan:ss,bgWhite:ss}};is.exports=as(),is.exports.createColors=as;var cs=is.exports;const ls=os(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));let us=cs,hs=ls,ds=class e extends Error{constructor(t,n,r,o,i,s){super(t),this.name="CssSyntaxError",this.reason=t,i&&(this.file=i),o&&(this.source=o),s&&(this.plugin=s),void 0!==n&&void 0!==r&&("number"==typeof n?(this.line=n,this.column=r):(this.line=n.line,this.column=n.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=us.isColorSupported),hs&&e&&(t=hs(t));let n,r,o=t.split(/\r?\n/),i=Math.max(this.line-3,0),s=Math.min(this.line+2,o.length),a=String(s).length;if(e){let{bold:e,gray:t,red:o}=us.createColors(!0);n=t=>e(o(t)),r=e=>t(e)}else n=r=e=>e;return o.slice(i,s).map((e,t)=>{let o=i+1+t,s=" "+(" "+o).slice(-a)+" | ";if(o===this.line){let t=r(s.replace(/\d/g," "))+e.slice(0,this.column-1).replace(/[^\t]/g," ");return n(">")+r(s)+e+"\n "+t+n("^")}return" "+r(s)+e}).join("\n")}toString(){let e=this.showSourceCode();return e&&(e="\n\n"+e+"\n"),this.name+": "+this.message+e}};var ps=ds;ds.default=ds;var ms={};ms.isClean=Symbol("isClean"),ms.my=Symbol("my");const fs={after:"\n",beforeClose:"\n",beforeComment:"\n",beforeDecl:"\n",beforeOpen:" ",beforeRule:"\n",colon:": ",commentLeft:" ",commentRight:" ",emptyBody:"",indent:" ",semicolon:!1};let gs=class{constructor(e){this.builder=e}atrule(e,t){let n="@"+e.name,r=e.params?this.rawValue(e,"params"):"";if(void 0!==e.raws.afterName?n+=e.raws.afterName:r&&(n+=" "),e.nodes)this.block(e,n+r);else{let o=(e.raws.between||"")+(t?";":"");this.builder(n+r+o,e)}}beforeAfter(e,t){let n;n="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,o=0;for(;r&&"root"!==r.type;)o+=1,r=r.parent;if(n.includes("\n")){let t=this.raw(e,null,"indent");if(t.length)for(let e=0;e<o;e++)n+=t}return n}block(e,t){let n,r=this.raw(e,"between","beforeOpen");this.builder(t+r+"{",e,"start"),e.nodes&&e.nodes.length?(this.body(e),n=this.raw(e,"after")):n=this.raw(e,"after","emptyBody"),n&&this.builder(n),this.builder("}",e,"end")}body(e){let t=e.nodes.length-1;for(;t>0&&"comment"===e.nodes[t].type;)t-=1;let n=this.raw(e,"semicolon");for(let r=0;r<e.nodes.length;r++){let o=e.nodes[r],i=this.raw(o,"before");i&&this.builder(i),this.stringify(o,t!==r||n)}}comment(e){let t=this.raw(e,"left","commentLeft"),n=this.raw(e,"right","commentRight");this.builder("/*"+t+e.text+n+"*/",e)}decl(e,t){let n=this.raw(e,"between","colon"),r=e.prop+n+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,n){let r;if(n||(n=t),t&&(r=e.raws[t],void 0!==r))return r;let o=e.parent;if("before"===n){if(!o||"root"===o.type&&o.first===e)return"";if(o&&"document"===o.type)return""}if(!o)return fs[n];let i=e.root();if(i.rawCache||(i.rawCache={}),void 0!==i.rawCache[n])return i.rawCache[n];if("before"===n||"after"===n)return this.beforeAfter(e,n);{let o="raw"+((s=n)[0].toUpperCase()+s.slice(1));this[o]?r=this[o](i,e):i.walk(e=>{if(r=e.raws[t],void 0!==r)return!1})}var s;return void 0===r&&(r=fs[n]),i.rawCache[n]=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 n;return e.walkComments(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeDecl"):n&&(n=n.replace(/\S/g,"")),n}rawBeforeDecl(e,t){let n;return e.walkDecls(e=>{if(void 0!==e.raws.before)return n=e.raws.before,n.includes("\n")&&(n=n.replace(/[^\n]+$/,"")),!1}),void 0===n?n=this.raw(t,null,"beforeRule"):n&&(n=n.replace(/\S/g,"")),n}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(n=>{if(n.nodes&&(n.parent!==e||e.first!==n)&&void 0!==n.raws.before)return t=n.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(n=>{let r=n.parent;if(r&&r!==e&&r.parent&&r.parent===e&&void 0!==n.raws.before){let e=n.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 n=e[t],r=e.raws[t];return r&&r.value===n?r.raw:n}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 ys=gs;gs.default=gs;let ws=ys;function bs(e,t){new ws(t).stringify(e)}var vs=bs;bs.default=bs;let{isClean:Ss,my:Cs}=ms,ks=ps,Is=ys,Es=vs;function Ms(e,t){let n=new e.constructor;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if("proxyCache"===r)continue;let o=e[r],i=typeof o;"parent"===r&&"object"===i?t&&(n[r]=t):"source"===r?n[r]=o:Array.isArray(o)?n[r]=o.map(e=>Ms(e,n)):("object"===i&&null!==o&&(o=Ms(o)),n[r]=o)}return n}let xs=class{constructor(e={}){this.raws={},this[Ss]=!1,this[Cs]=!0;for(let t in e)if("nodes"===t){this.nodes=[];for(let n of e[t])"function"==typeof n.clone?this.append(n.clone()):this.append(n)}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=Ms(this);for(let n in e)t[n]=e[n];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:n,start:r}=this.rangeBy(t);return this.source.input.error(e,{column:r.column,line:r.line},{column:n.column,line:n.line},t)}return new ks(e)}getProxyProcessor(){return{get:(e,t)=>"proxyOf"===t?e:"root"===t?()=>e.root().toProxy():e[t],set:(e,t,n)=>(e[t]===n||(e[t]=n,"prop"!==t&&"value"!==t&&"name"!==t&&"params"!==t&&"important"!==t&&"text"!==t||e.markDirty()),!0)}}markDirty(){if(this[Ss]){this[Ss]=!1;let e=this;for(;e=e.parent;)e[Ss]=!1}}next(){if(!this.parent)return;let e=this.parent.index(this);return this.parent.nodes[e+1]}positionBy(e,t){let n=this.source.start;if(e.index)n=this.positionInside(e.index,t);else if(e.word){let r=(t=this.toString()).indexOf(e.word);-1!==r&&(n=this.positionInside(r,t))}return n}positionInside(e,t){let n=t||this.toString(),r=this.source.start.column,o=this.source.start.line;for(let t=0;t<e;t++)"\n"===n[t]?(r=1,o+=1):r+=1;return{column:r,line:o}}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},n=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(),o=r.indexOf(e.word);-1!==o&&(t=this.positionInside(o,r),n=this.positionInside(o+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?n={column:e.end.column,line:e.end.line}:"number"==typeof e.endIndex?n=this.positionInside(e.endIndex):e.index&&(n=this.positionInside(e.index+1));return(n.line<t.line||n.line===t.line&&n.column<=t.column)&&(n={column:t.column+1,line:t.line}),{end:n,start:t}}raw(e,t){return(new Is).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,n=!1;for(let r of e)r===this?n=!0:n?(this.parent.insertAfter(t,r),t=r):this.parent.insertBefore(t,r);n||this.remove()}return this}root(){let e=this;for(;e.parent&&"document"!==e.parent.type;)e=e.parent;return e}toJSON(e,t){let n={},r=null==t;t=t||new Map;let o=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))n[e]=r.map(e=>"object"==typeof e&&e.toJSON?e.toJSON(null,t):e);else if("object"==typeof r&&r.toJSON)n[e]=r.toJSON(null,t);else if("source"===e){let i=t.get(r.input);null==i&&(i=o,t.set(r.input,o),o++),n[e]={end:r.end,inputId:i,start:r.start}}else n[e]=r}return r&&(n.inputs=[...t.keys()].map(e=>e.toJSON())),n}toProxy(){return this.proxyCache||(this.proxyCache=new Proxy(this,this.getProxyProcessor())),this.proxyCache}toString(e=Es){e.stringify&&(e=e.stringify);let t="";return e(this,e=>{t+=e}),t}warn(e,t,n){let r={node:this};for(let e in n)r[e]=n[e];return e.warn(t,r)}get proxyOf(){return this}};var As=xs;xs.default=xs;let Rs=As,Ts=class extends Rs{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 Os=Ts;Ts.default=Ts;var _s={nanoid:(e=21)=>{let t="",n=e;for(;n--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}};let{SourceMapConsumer:Ds,SourceMapGenerator:Ps}=ls,{existsSync:Ls,readFileSync:Ns}=ls,{dirname:Fs,join:Bs}=ls,Us=class{constructor(e,t){if(!1===t.map)return;this.loadAnnotation(e),this.inline=this.startWith(this.annotation,"data:");let n=t.map?t.map.prev:void 0,r=this.loadMap(t.from,n);!this.mapFile&&t.from&&(this.mapFile=t.from),this.mapFile&&(this.root=Fs(this.mapFile)),r&&(this.text=r)}consumer(){return this.consumerCache||(this.consumerCache=new Ds(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 n=e.match(/data:application\/json;([^,]+),/)[1];throw new Error("Unsupported source map encoding "+n)}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 n=e.lastIndexOf(t.pop()),r=e.indexOf("*/",n);n>-1&&r>-1&&(this.annotation=this.getAnnotationURL(e.substring(n,r)))}loadFile(e){if(this.root=Fs(e),Ls(e))return this.mapFile=e,Ns(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 Ds)return Ps.fromSourceMap(t).toString();if(t instanceof Ps)return t.toString();if(this.isMap(t))return JSON.stringify(t);throw new Error("Unsupported previous source map format: "+t.toString())}{let n=t(e);if(n){let e=this.loadFile(n);if(!e)throw new Error("Unable to load previous source map: "+n.toString());return e}}}else{if(this.inline)return this.decodeInline(this.annotation);if(this.annotation){let t=this.annotation;return e&&(t=Bs(Fs(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 zs=Us;Us.default=Us;let{SourceMapConsumer:Ws,SourceMapGenerator:js}=ls,{fileURLToPath:Vs,pathToFileURL:Zs}=ls,{isAbsolute:Gs,resolve:Hs}=ls,{nanoid:$s}=_s,Xs=ls,qs=ps,Ys=zs,Js=Symbol("fromOffsetCache"),Ks=Boolean(Ws&&js),Qs=Boolean(Hs&&Gs),ea=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&&(!Qs||/^\w+:\/\//.test(t.from)||Gs(t.from)?this.file=t.from:this.file=Hs(t.from)),Qs&&Ks){let e=new Ys(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 "+$s(6)+">"),this.map&&(this.map.file=this.from)}error(e,t,n,r={}){let o,i,s;if(t&&"object"==typeof t){let e=t,r=n;if("number"==typeof e.offset){let r=this.fromOffset(e.offset);t=r.line,n=r.col}else t=e.line,n=e.column;if("number"==typeof r.offset){let e=this.fromOffset(r.offset);i=e.line,s=e.col}else i=r.line,s=r.column}else if(!n){let e=this.fromOffset(t);t=e.line,n=e.col}let a=this.origin(t,n,i,s);return o=a?new qs(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 qs(e,void 0===i?t:{column:n,line:t},void 0===i?n:{column:s,line:i},this.css,this.file,r.plugin),o.input={column:n,endColumn:s,endLine:i,line:t,source:this.css},this.file&&(Zs&&(o.input.url=Zs(this.file).toString()),o.input.file=this.file),o}fromOffset(e){let t,n;if(this[Js])n=this[Js];else{let e=this.css.split("\n");n=new Array(e.length);let t=0;for(let r=0,o=e.length;r<o;r++)n[r]=t,t+=e[r].length+1;this[Js]=n}t=n[n.length-1];let r=0;if(e>=t)r=n.length-1;else{let t,o=n.length-2;for(;r<o;)if(t=r+(o-r>>1),e<n[t])o=t-1;else{if(!(e>=n[t+1])){r=t;break}r=t+1}}return{col:e-n[r]+1,line:r+1}}mapResolve(e){return/^\w+:\/\//.test(e)?e:Hs(this.map.consumer().sourceRoot||this.map.root||".",e)}origin(e,t,n,r){if(!this.map)return!1;let o,i,s=this.map.consumer(),a=s.originalPositionFor({column:t,line:e});if(!a.source)return!1;"number"==typeof n&&(o=s.originalPositionFor({column:r,line:n})),i=Gs(a.source)?Zs(a.source):new URL(a.source,this.map.consumer().sourceRoot||Zs(this.map.mapFile));let c={column:a.column,endColumn:o&&o.column,endLine:o&&o.line,line:a.line,url:i.toString()};if("file:"===i.protocol){if(!Vs)throw new Error("file: protocol is not available in this PostCSS build");c.file=Vs(i)}let l=s.sourceContentFor(a.source);return l&&(c.source=l),c}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 ta=ea;ea.default=ea,Xs&&Xs.registerInput&&Xs.registerInput(ea);let{SourceMapConsumer:na,SourceMapGenerator:ra}=ls,{dirname:oa,relative:ia,resolve:sa,sep:aa}=ls,{pathToFileURL:ca}=ls,la=ta,ua=Boolean(na&&ra),ha=Boolean(oa&&sa&&ia&&aa);var da=class{constructor(e,t,n,r){this.stringify=e,this.mapOpts=n.map||{},this.root=t,this.opts=n,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,n=this.toUrl(this.path(e.file)),r=e.root||oa(e.file);!1===this.mapOpts.sourcesContent?(t=new na(e.text),t.sourcesContent&&(t.sourcesContent=null)):t=e.consumer(),this.map.applySourceMap(t,n,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(),ha&&ua&&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=ra.fromSourceMap(e,{ignoreInvalidMapping:!0})}else this.map=new ra({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 ra({file:this.outputFile(),ignoreInvalidMapping:!0});let e,t,n=1,r=1,o="<no source>",i={generated:{column:0,line:0},original:{column:0,line:0},source:""};this.stringify(this.root,(s,a,c)=>{if(this.css+=s,a&&"end"!==c&&(i.generated.line=n,i.generated.column=r-1,a.source&&a.source.start?(i.source=this.sourcePath(a),i.original.line=a.source.start.line,i.original.column=a.source.start.column-1,this.map.addMapping(i)):(i.source=o,i.original.line=1,i.original.column=0,this.map.addMapping(i))),e=s.match(/\n/g),e?(n+=e.length,t=s.lastIndexOf("\n"),r=s.length-t):r+=s.length,a&&"start"!==c){let e=a.parent||{raws:{}};("decl"===a.type||"atrule"===a.type&&!a.nodes)&&a===e.last&&!e.raws.semicolon||(a.source&&a.source.end?(i.source=this.sourcePath(a),i.original.line=a.source.end.line,i.original.column=a.source.end.column-1,i.generated.line=n,i.generated.column=r-2,this.map.addMapping(i)):(i.source=o,i.original.line=1,i.original.column=0,i.generated.line=n,i.generated.column=r-1,this.map.addMapping(i)))}})}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 n=this.opts.to?oa(this.opts.to):".";"string"==typeof this.mapOpts.annotation&&(n=oa(sa(n,this.mapOpts.annotation)));let r=ia(n,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 la(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 n=t.source.input.from;if(n&&!e[n]){e[n]=!0;let r=this.usesFileUrls?this.toFileUrl(n):this.toUrl(this.path(n));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(ca){let t=ca(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;"\\"===aa&&(e=e.replace(/\\/g,"/"));let n=encodeURI(e).replace(/[#?]/g,encodeURIComponent);return this.memoizedURLs.set(e,n),n}};let pa=As,ma=class extends pa{constructor(e){super(e),this.type="comment"}};var fa=ma;ma.default=ma;let ga,ya,wa,ba,{isClean:va,my:Sa}=ms,Ca=Os,ka=fa,Ia=As;function Ea(e){return e.map(e=>(e.nodes&&(e.nodes=Ea(e.nodes)),delete e.source,e))}function Ma(e){if(e[va]=!1,e.proxyOf.nodes)for(let t of e.proxyOf.nodes)Ma(t)}let xa=class e extends Ia{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,n,r=this.getIterator();for(;this.indexes[r]<this.proxyOf.nodes.length&&(t=this.indexes[r],n=e(this.proxyOf.nodes[t],t),!1!==n);)this.indexes[r]+=1;return delete this.indexes[r],n}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")?(...n)=>e[t](...n.map(e=>"function"==typeof e?(t,n)=>e(t.toProxy(),n):e)):"every"===t||"some"===t?n=>e[t]((e,...t)=>n(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,n)=>(e[t]===n||(e[t]=n,"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 n,r=this.index(e),o=this.normalize(t,this.proxyOf.nodes[r]).reverse();r=this.index(e);for(let e of o)this.proxyOf.nodes.splice(r+1,0,e);for(let e in this.indexes)n=this.indexes[e],r<n&&(this.indexes[e]=n+o.length);return this.markDirty(),this}insertBefore(e,t){let n,r=this.index(e),o=0===r&&"prepend",i=this.normalize(t,this.proxyOf.nodes[r],o).reverse();r=this.index(e);for(let e of i)this.proxyOf.nodes.splice(r,0,e);for(let e in this.indexes)n=this.indexes[e],r<=n&&(this.indexes[e]=n+i.length);return this.markDirty(),this}normalize(t,n){if("string"==typeof t)t=Ea(ga(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 Ca(t)]}else if(t.selector)t=[new ya(t)];else if(t.name)t=[new wa(t)];else{if(!t.text)throw new Error("Unknown node type in node creation");t=[new ka(t)]}return t.map(t=>(t[Sa]||e.rebuild(t),(t=t.proxyOf).parent&&t.parent.removeChild(t),t[va]&&Ma(t),void 0===t.raws.before&&n&&void 0!==n.raws.before&&(t.raws.before=n.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 n in this.indexes)t=this.indexes[n],t>=e&&(this.indexes[n]=t-1);return this.markDirty(),this}replaceValues(e,t,n){return n||(n=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,n))}),this.markDirty(),this}some(e){return this.nodes.some(e)}walk(e){return this.each((t,n)=>{let r;try{r=e(t,n)}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((n,r)=>{if("atrule"===n.type&&e.test(n.name))return t(n,r)}):this.walk((n,r)=>{if("atrule"===n.type&&n.name===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("atrule"===e.type)return t(e,n)}))}walkComments(e){return this.walk((t,n)=>{if("comment"===t.type)return e(t,n)})}walkDecls(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("decl"===n.type&&e.test(n.prop))return t(n,r)}):this.walk((n,r)=>{if("decl"===n.type&&n.prop===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("decl"===e.type)return t(e,n)}))}walkRules(e,t){return t?e instanceof RegExp?this.walk((n,r)=>{if("rule"===n.type&&e.test(n.selector))return t(n,r)}):this.walk((n,r)=>{if("rule"===n.type&&n.selector===e)return t(n,r)}):(t=e,this.walk((e,n)=>{if("rule"===e.type)return t(e,n)}))}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]}};xa.registerParse=e=>{ga=e},xa.registerRule=e=>{ya=e},xa.registerAtRule=e=>{wa=e},xa.registerRoot=e=>{ba=e};var Aa=xa;xa.default=xa,xa.rebuild=e=>{"atrule"===e.type?Object.setPrototypeOf(e,wa.prototype):"rule"===e.type?Object.setPrototypeOf(e,ya.prototype):"decl"===e.type?Object.setPrototypeOf(e,Ca.prototype):"comment"===e.type?Object.setPrototypeOf(e,ka.prototype):"root"===e.type&&Object.setPrototypeOf(e,ba.prototype),e[Sa]=!0,e.nodes&&e.nodes.forEach(e=>{xa.rebuild(e)})};let Ra,Ta,Oa=Aa,_a=class extends Oa{constructor(e){super({type:"document",...e}),this.nodes||(this.nodes=[])}toResult(e={}){return new Ra(new Ta,this,e).stringify()}};_a.registerLazyResult=e=>{Ra=e},_a.registerProcessor=e=>{Ta=e};var Da=_a;_a.default=_a;let Pa={};var La=function(e){Pa[e]||(Pa[e]=!0,"undefined"!=typeof console&&console.warn&&console.warn(e))};let Na=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 Fa=Na;Na.default=Na;let Ba=Fa,Ua=class{constructor(e,t,n){this.processor=e,this.messages=[],this.root=t,this.opts=n,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 n=new Ba(e,t);return this.messages.push(n),n}warnings(){return this.messages.filter(e=>"warning"===e.type)}get content(){return this.css}};var za=Ua;Ua.default=Ua;const Wa="'".charCodeAt(0),ja='"'.charCodeAt(0),Va="\\".charCodeAt(0),Za="/".charCodeAt(0),Ga="\n".charCodeAt(0),Ha=" ".charCodeAt(0),$a="\f".charCodeAt(0),Xa="\t".charCodeAt(0),qa="\r".charCodeAt(0),Ya="[".charCodeAt(0),Ja="]".charCodeAt(0),Ka="(".charCodeAt(0),Qa=")".charCodeAt(0),ec="{".charCodeAt(0),tc="}".charCodeAt(0),nc=";".charCodeAt(0),rc="*".charCodeAt(0),oc=":".charCodeAt(0),ic="@".charCodeAt(0),sc=/[\t\n\f\r "#'()/;[\\\]{}]/g,ac=/[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g,cc=/.[\r\n"'(/\\]/,lc=/[\da-f]/i;let uc=Aa,hc=class extends uc{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 dc=hc;hc.default=hc,uc.registerAtRule(hc);let pc,mc,fc=Aa,gc=class extends fc{constructor(e){super(e),this.type="root",this.nodes||(this.nodes=[])}normalize(e,t,n){let r=super.normalize(e);if(t)if("prepend"===n)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 n=this.index(e);return!t&&0===n&&this.nodes.length>1&&(this.nodes[1].raws.before=this.nodes[n].raws.before),super.removeChild(e)}toResult(e={}){return new pc(new mc,this,e).stringify()}};gc.registerLazyResult=e=>{pc=e},gc.registerProcessor=e=>{mc=e};var yc=gc;gc.default=gc,fc.registerRoot(gc);let wc={comma:e=>wc.split(e,[","],!0),space:e=>wc.split(e,[" ","\n","\t"]),split(e,t,n){let r=[],o="",i=!1,s=0,a=!1,c="",l=!1;for(let n of e)l?l=!1:"\\"===n?l=!0:a?n===c&&(a=!1):'"'===n||"'"===n?(a=!0,c=n):"("===n?s+=1:")"===n?s>0&&(s-=1):0===s&&t.includes(n)&&(i=!0),i?(""!==o&&r.push(o.trim()),o="",i=!1):o+=n;return(n||""!==o)&&r.push(o.trim()),r}};var bc=wc;wc.default=wc;let vc=Aa,Sc=bc,Cc=class extends vc{constructor(e){super(e),this.type="rule",this.nodes||(this.nodes=[])}get selectors(){return Sc.comma(this.selector)}set selectors(e){let t=this.selector?this.selector.match(/,\s*/):null,n=t?t[0]:","+this.raw("between","beforeOpen");this.selector=e.join(n)}};var kc=Cc;Cc.default=Cc,vc.registerRule(Cc);let Ic=Os,Ec=fa,Mc=dc,xc=yc,Ac=kc;const Rc={empty:!0,space:!0};let Tc=Aa,Oc=class{constructor(e){this.input=e,this.root=new xc,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,n,r,o=new Mc;o.name=e[1].slice(1),""===o.name&&this.unnamedAtrule(o,e),this.init(o,e[2]);let i=!1,s=!1,a=[],c=[];for(;!this.tokenizer.endOfFile();){if(t=(e=this.tokenizer.nextToken())[0],"("===t||"["===t?c.push("("===t?")":"]"):"{"===t&&c.length>0?c.push("}"):t===c[c.length-1]&&c.pop(),0===c.length){if(";"===t){o.source.end=this.getPosition(e[2]),o.source.end.offset++,this.semicolon=!0;break}if("{"===t){s=!0;break}if("}"===t){if(a.length>0){for(r=a.length-1,n=a[r];n&&"space"===n[0];)n=a[--r];n&&(o.source.end=this.getPosition(n[3]||n[2]),o.source.end.offset++)}this.end(e);break}a.push(e)}else a.push(e);if(this.tokenizer.endOfFile()){i=!0;break}}o.raws.between=this.spacesAndCommentsFromEnd(a),a.length?(o.raws.afterName=this.spacesAndCommentsFromStart(a),this.raw(o,"params",a),i&&(e=a[a.length-1],o.source.end=this.getPosition(e[3]||e[2]),o.source.end.offset++,this.spaces=o.raws.between,o.raws.between="")):(o.raws.afterName="",o.params=""),s&&(o.nodes=[],this.current=o)}checkMissedSemicolon(e){let t=this.colon(e);if(!1===t)return;let n,r=0;for(let o=t-1;o>=0&&(n=e[o],"space"===n[0]||(r+=1,2!==r));o--);throw this.input.error("Missed semicolon","word"===n[0]?n[3]+1:n[2])}colon(e){let t,n,r,o=0;for(let[i,s]of e.entries()){if(t=s,n=t[0],"("===n&&(o+=1),")"===n&&(o-=1),0===o&&":"===n){if(r){if("word"===r[0]&&"progid"===r[1])continue;return i}this.doubleColon(t)}r=t}return!1}comment(e){let t=new Ec;this.init(t,e[2]),t.source.end=this.getPosition(e[3]||e[2]),t.source.end.offset++;let n=e[1].slice(2,-2);if(/^\s*$/.test(n))t.text="",t.raws.left=n,t.raws.right="";else{let e=n.match(/^(\s*)([^]*\S)(\s*)$/);t.text=e[2],t.raws.left=e[1],t.raws.right=e[3]}}createTokenizer(){this.tokenizer=function(e,t={}){let n,r,o,i,s,a,c,l,u,h,d=e.css.valueOf(),p=t.ignoreErrors,m=d.length,f=0,g=[],y=[];function w(t){throw e.error("Unclosed "+t,f)}return{back:function(e){y.push(e)},endOfFile:function(){return 0===y.length&&f>=m},nextToken:function(e){if(y.length)return y.pop();if(f>=m)return;let t=!!e&&e.ignoreUnclosed;switch(n=d.charCodeAt(f),n){case Ga:case Ha:case Xa:case qa:case $a:r=f;do{r+=1,n=d.charCodeAt(r)}while(n===Ha||n===Ga||n===Xa||n===qa||n===$a);h=["space",d.slice(f,r)],f=r-1;break;case Ya:case Ja:case ec:case tc:case oc:case nc:case Qa:{let e=String.fromCharCode(n);h=[e,e,f];break}case Ka:if(l=g.length?g.pop()[1]:"",u=d.charCodeAt(f+1),"url"===l&&u!==Wa&&u!==ja&&u!==Ha&&u!==Ga&&u!==Xa&&u!==$a&&u!==qa){r=f;do{if(a=!1,r=d.indexOf(")",r+1),-1===r){if(p||t){r=f;break}w("bracket")}for(c=r;d.charCodeAt(c-1)===Va;)c-=1,a=!a}while(a);h=["brackets",d.slice(f,r+1),f,r],f=r}else r=d.indexOf(")",f+1),i=d.slice(f,r+1),-1===r||cc.test(i)?h=["(","(",f]:(h=["brackets",i,f,r],f=r);break;case Wa:case ja:o=n===Wa?"'":'"',r=f;do{if(a=!1,r=d.indexOf(o,r+1),-1===r){if(p||t){r=f+1;break}w("string")}for(c=r;d.charCodeAt(c-1)===Va;)c-=1,a=!a}while(a);h=["string",d.slice(f,r+1),f,r],f=r;break;case ic:sc.lastIndex=f+1,sc.test(d),r=0===sc.lastIndex?d.length-1:sc.lastIndex-2,h=["at-word",d.slice(f,r+1),f,r],f=r;break;case Va:for(r=f,s=!0;d.charCodeAt(r+1)===Va;)r+=1,s=!s;if(n=d.charCodeAt(r+1),s&&n!==Za&&n!==Ha&&n!==Ga&&n!==Xa&&n!==qa&&n!==$a&&(r+=1,lc.test(d.charAt(r)))){for(;lc.test(d.charAt(r+1));)r+=1;d.charCodeAt(r+1)===Ha&&(r+=1)}h=["word",d.slice(f,r+1),f,r],f=r;break;default:n===Za&&d.charCodeAt(f+1)===rc?(r=d.indexOf("*/",f+2)+1,0===r&&(p||t?r=d.length:w("comment")),h=["comment",d.slice(f,r+1),f,r],f=r):(ac.lastIndex=f+1,ac.test(d),r=0===ac.lastIndex?d.length-1:ac.lastIndex-2,h=["word",d.slice(f,r+1),f,r],g.push(h),f=r)}return f++,h},position:function(){return f}}}(this.input)}decl(e,t){let n=new Ic;this.init(n,e[0][2]);let r,o=e[e.length-1];for(";"===o[0]&&(this.semicolon=!0,e.pop()),n.source.end=this.getPosition(o[3]||o[2]||function(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=n[3]||n[2];if(r)return r}}(e)),n.source.end.offset++;"word"!==e[0][0];)1===e.length&&this.unknownWord(e),n.raws.before+=e.shift()[1];for(n.source.start=this.getPosition(e[0][2]),n.prop="";e.length;){let t=e[0][0];if(":"===t||"space"===t||"comment"===t)break;n.prop+=e.shift()[1]}for(n.raws.between="";e.length;){if(r=e.shift(),":"===r[0]){n.raws.between+=r[1];break}"word"===r[0]&&/\w/.test(r[1])&&this.unknownWord([r]),n.raws.between+=r[1]}"_"!==n.prop[0]&&"*"!==n.prop[0]||(n.raws.before+=n.prop[0],n.prop=n.prop.slice(1));let i,s=[];for(;e.length&&(i=e[0][0],"space"===i||"comment"===i);)s.push(e.shift());this.precheckMissedSemicolon(e);for(let t=e.length-1;t>=0;t--){if(r=e[t],"!important"===r[1].toLowerCase()){n.important=!0;let r=this.stringFrom(e,t);r=this.spacesFromEnd(e)+r," !important"!==r&&(n.raws.important=r);break}if("important"===r[1].toLowerCase()){let r=e.slice(0),o="";for(let e=t;e>0;e--){let t=r[e][0];if(0===o.trim().indexOf("!")&&"space"!==t)break;o=r.pop()[1]+o}0===o.trim().indexOf("!")&&(n.important=!0,n.raws.important=o,e=r)}if("space"!==r[0]&&"comment"!==r[0])break}e.some(e=>"space"!==e[0]&&"comment"!==e[0])&&(n.raws.between+=s.map(e=>e[1]).join(""),s=[]),this.raw(n,"value",s.concat(e),t),n.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 Ac;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,n=null,r=!1,o=null,i=[],s=e[1].startsWith("--"),a=[],c=e;for(;c;){if(n=c[0],a.push(c),"("===n||"["===n)o||(o=c),i.push("("===n?")":"]");else if(s&&r&&"{"===n)o||(o=c),i.push("}");else if(0===i.length){if(";"===n){if(r)return void this.decl(a,s);break}if("{"===n)return void this.rule(a);if("}"===n){this.tokenizer.back(a.pop()),t=!0;break}":"===n&&(r=!0)}else n===i[i.length-1]&&(i.pop(),0===i.length&&(o=null));c=this.tokenizer.nextToken()}if(this.tokenizer.endOfFile()&&(t=!0),i.length>0&&this.unclosedBracket(o),t&&r){if(!s)for(;a.length&&(c=a[a.length-1][0],"space"===c||"comment"===c);)this.tokenizer.back(a.pop());this.decl(a,s)}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,n,r){let o,i,s,a,c=n.length,l="",u=!0;for(let e=0;e<c;e+=1)o=n[e],i=o[0],"space"!==i||e!==c-1||r?"comment"===i?(a=n[e-1]?n[e-1][0]:"empty",s=n[e+1]?n[e+1][0]:"empty",Rc[a]||Rc[s]||","===l.slice(-1)?u=!1:l+=o[1]):l+=o[1]:u=!1;if(!u){let r=n.reduce((e,t)=>e+t[1],"");e.raws[t]={raw:r,value:l}}e[t]=l}rule(e){e.pop();let t=new Ac;this.init(t,e[0][2]),t.raws.between=this.spacesAndCommentsFromEnd(e),this.raw(t,"selector",e),this.current=t}spacesAndCommentsFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t||"comment"===t);)n=e.pop()[1]+n;return n}spacesAndCommentsFromStart(e){let t,n="";for(;e.length&&(t=e[0][0],"space"===t||"comment"===t);)n+=e.shift()[1];return n}spacesFromEnd(e){let t,n="";for(;e.length&&(t=e[e.length-1][0],"space"===t);)n=e.pop()[1]+n;return n}stringFrom(e,t){let n="";for(let r=t;r<e.length;r++)n+=e[r][1];return e.splice(t,e.length-t),n}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})}},_c=ta;function Dc(e,t){let n=new _c(e,t),r=new Oc(n);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 Pc=Dc;Dc.default=Dc,Tc.registerParse(Dc);let{isClean:Lc,my:Nc}=ms,Fc=da,Bc=vs,Uc=Aa,zc=Da,Wc=La,jc=za,Vc=Pc,Zc=yc;const Gc={atrule:"AtRule",comment:"Comment",decl:"Declaration",document:"Document",root:"Root",rule:"Rule"},Hc={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},$c={Once:!0,postcssPlugin:!0,prepare:!0};function Xc(e){return"object"==typeof e&&"function"==typeof e.then}function qc(e){let t=!1,n=Gc[e.type];return"decl"===e.type?t=e.prop.toLowerCase():"atrule"===e.type&&(t=e.name.toLowerCase()),t&&e.append?[n,n+"-"+t,0,n+"Exit",n+"Exit-"+t]:t?[n,n+"-"+t,n+"Exit",n+"Exit-"+t]:e.append?[n,0,n+"Exit"]:[n,n+"Exit"]}function Yc(e){let t;return t="document"===e.type?["Document",0,"DocumentExit"]:"root"===e.type?["Root",0,"RootExit"]:qc(e),{eventIndex:0,events:t,iterator:0,node:e,visitorIndex:0,visitors:[]}}function Jc(e){return e[Lc]=!1,e.nodes&&e.nodes.forEach(e=>Jc(e)),e}let Kc={},Qc=class e{constructor(t,n,r){let o;if(this.stringified=!1,this.processed=!1,"object"!=typeof n||null===n||"root"!==n.type&&"document"!==n.type)if(n instanceof e||n instanceof jc)o=Jc(n.root),n.map&&(void 0===r.map&&(r.map={}),r.map.inline||(r.map.inline=!1),r.map.prev=n.map);else{let e=Vc;r.syntax&&(e=r.syntax.parse),r.parser&&(e=r.parser),e.parse&&(e=e.parse);try{o=e(n,r)}catch(e){this.processed=!0,this.error=e}o&&!o[Nc]&&Uc.rebuild(o)}else o=Jc(n);this.result=new jc(t,o,r),this.helpers={...Kc,postcss:Kc,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 n=this.result.lastPlugin;try{if(t&&t.addToError(e),this.error=e,"CssSyntaxError"!==e.name||e.plugin){if(n.postcssVersion&&"production"!==process.env.NODE_ENV){let e=n.postcssPlugin,t=n.postcssVersion,r=this.result.processor.version,o=t.split("."),i=r.split(".");(o[0]!==i[0]||parseInt(o[1])>parseInt(i[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=n.postcssPlugin,e.setMessage()}catch(e){console&&console.error&&console.error(e)}return e}prepareVisitors(){this.listeners={};let e=(e,t,n)=>{this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push([e,n])};for(let t of this.plugins)if("object"==typeof t)for(let n in t){if(!Hc[n]&&/^[A-Z]/.test(n))throw new Error(`Unknown event ${n} in ${t.postcssPlugin}. Try to update PostCSS (${this.processor.version} now).`);if(!$c[n])if("object"==typeof t[n])for(let r in t[n])e(t,"*"===r?n:n+"-"+r.toLowerCase(),t[n][r]);else"function"==typeof t[n]&&e(t,n,t[n])}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],n=this.runOnRoot(t);if(Xc(n))try{await n}catch(e){throw this.handleError(e)}}if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Lc];){e[Lc]=!0;let t=[Yc(e)];for(;t.length>0;){let e=this.visitTick(t);if(Xc(e))try{await e}catch(e){let n=t[t.length-1].node;throw this.handleError(e,n)}}}if(this.listeners.OnceExit)for(let[t,n]of this.listeners.OnceExit){this.result.lastPlugin=t;try{if("document"===e.type){let t=e.nodes.map(e=>n(e,this.helpers));await Promise.all(t)}else await n(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 Xc(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=Bc;e.syntax&&(t=e.syntax.stringify),e.stringifier&&(t=e.stringifier),t.stringify&&(t=t.stringify);let n=new Fc(t,this.result.root,this.result.opts).generate();return this.result.css=n[0],this.result.map=n[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(Xc(this.runOnRoot(e)))throw this.getAsyncError();if(this.prepareVisitors(),this.hasListener){let e=this.result.root;for(;!e[Lc];)e[Lc]=!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||Wc("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[n,r]of e){let e;this.result.lastPlugin=n;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(Xc(e))throw this.getAsyncError()}}visitTick(e){let t=e[e.length-1],{node:n,visitors:r}=t;if("root"!==n.type&&"document"!==n.type&&!n.parent)return void e.pop();if(r.length>0&&t.visitorIndex<r.length){let[e,o]=r[t.visitorIndex];t.visitorIndex+=1,t.visitorIndex===r.length&&(t.visitors=[],t.visitorIndex=0),this.result.lastPlugin=e;try{return o(n.toProxy(),this.helpers)}catch(e){throw this.handleError(e,n)}}if(0!==t.iterator){let r,o=t.iterator;for(;r=n.nodes[n.indexes[o]];)if(n.indexes[o]+=1,!r[Lc])return r[Lc]=!0,void e.push(Yc(r));t.iterator=0,delete n.indexes[o]}let o=t.events;for(;t.eventIndex<o.length;){let e=o[t.eventIndex];if(t.eventIndex+=1,0===e)return void(n.nodes&&n.nodes.length&&(n[Lc]=!0,t.iterator=n.getIterator()));if(this.listeners[e])return void(t.visitors=this.listeners[e])}e.pop()}walkSync(e){e[Lc]=!0;let t=qc(e);for(let n of t)if(0===n)e.nodes&&e.each(e=>{e[Lc]||this.walkSync(e)});else{let t=this.listeners[n];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"}};Qc.registerPostcss=e=>{Kc=e};var el=Qc;Qc.default=Qc,Zc.registerLazyResult(Qc),zc.registerLazyResult(Qc);let tl=da,nl=vs,rl=La,ol=Pc;const il=za;let sl=class{constructor(e,t,n){let r;t=t.toString(),this.stringified=!1,this._processor=e,this._css=t,this._opts=n,this._map=void 0;let o=nl;this.result=new il(this._processor,r,this._opts),this.result.css=t;let i=this;Object.defineProperty(this.result,"root",{get:()=>i.root});let s=new tl(o,r,this._opts,t);if(s.isMap()){let[e,t]=s.generate();e&&(this.result.css=e),t&&(this.result.map=t)}else s.clearAnnotation(),this.result.css=s.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||rl("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=ol;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 al=sl;sl.default=sl;let cl=al,ll=el,ul=Da,hl=yc,dl=class{constructor(e=[]){this.version="8.4.38",this.plugins=this.normalize(e)}normalize(e){let t=[];for(let n of e)if(!0===n.postcss?n=n():n.postcss&&(n=n.postcss),"object"==typeof n&&Array.isArray(n.plugins))t=t.concat(n.plugins);else if("object"==typeof n&&n.postcssPlugin)t.push(n);else if("function"==typeof n)t.push(n);else{if("object"!=typeof n||!n.parse&&!n.stringify)throw new Error(n+" 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 ll(this,e,t):new cl(this,e,t)}use(e){return this.plugins=this.plugins.concat(this.normalize([e])),this}};var pl=dl;dl.default=dl,hl.registerProcessor(dl),ul.registerProcessor(dl);let ml=Os,fl=zs,gl=fa,yl=dc,wl=ta,bl=yc,vl=kc;function Sl(e,t){if(Array.isArray(e))return e.map(e=>Sl(e));let{inputs:n,...r}=e;if(n){t=[];for(let e of n){let n={...e,__proto__:wl.prototype};n.map&&(n.map={...n.map,__proto__:fl.prototype}),t.push(n)}}if(r.nodes&&(r.nodes=e.nodes.map(e=>Sl(e,t))),r.source){let{inputId:e,...n}=r.source;r.source=n,null!=e&&(r.source.input=t[e])}if("root"===r.type)return new bl(r);if("decl"===r.type)return new ml(r);if("rule"===r.type)return new vl(r);if("comment"===r.type)return new gl(r);if("atrule"===r.type)return new yl(r);throw new Error("Unknown node type: "+e.type)}var Cl=Sl;Sl.default=Sl;let kl=ps,Il=Os,El=el,Ml=Aa,xl=pl,Al=vs,Rl=Cl,Tl=Da,Ol=Fa,_l=fa,Dl=dc,Pl=za,Ll=ta,Nl=Pc,Fl=bc,Bl=kc,Ul=yc,zl=As;function Wl(...e){return 1===e.length&&Array.isArray(e[0])&&(e=e[0]),new xl(e)}Wl.plugin=function(e,t){let n,r=!1;function o(...n){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 o=t(...n);return o.postcssPlugin=e,o.postcssVersion=(new xl).version,o}return Object.defineProperty(o,"postcss",{get:()=>(n||(n=o()),n)}),o.process=function(e,t,n){return Wl([o(n)]).process(e,t)},o},Wl.stringify=Al,Wl.parse=Nl,Wl.fromJSON=Rl,Wl.list=Fl,Wl.comment=e=>new _l(e),Wl.atRule=e=>new Dl(e),Wl.decl=e=>new Il(e),Wl.rule=e=>new Bl(e),Wl.root=e=>new Ul(e),Wl.document=e=>new Tl(e),Wl.CssSyntaxError=kl,Wl.Declaration=Il,Wl.Container=Ml,Wl.Processor=xl,Wl.Document=Tl,Wl.Comment=_l,Wl.Warning=Ol,Wl.AtRule=Dl,Wl.Result=Pl,Wl.Input=Ll,Wl.Rule=Bl,Wl.Root=Ul,Wl.Node=zl,El.registerPostcss(Wl);var jl=Wl;Wl.default=Wl;const Vl=rs(jl);Vl.stringify,Vl.fromJSON,Vl.plugin,Vl.parse,Vl.list,Vl.document,Vl.comment,Vl.atRule,Vl.rule,Vl.decl,Vl.root,Vl.CssSyntaxError,Vl.Declaration,Vl.Container,Vl.Processor,Vl.Document,Vl.Comment,Vl.Warning,Vl.AtRule,Vl.Result,Vl.Input,Vl.Rule,Vl.Root,Vl.Node;class Zl{constructor(...e){ns(this,"parentElement",null),ns(this,"parentNode",null),ns(this,"ownerDocument"),ns(this,"firstChild",null),ns(this,"lastChild",null),ns(this,"previousSibling",null),ns(this,"nextSibling",null),ns(this,"ELEMENT_NODE",1),ns(this,"TEXT_NODE",3),ns(this,"nodeType"),ns(this,"nodeName"),ns(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 Zl))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 Gl={Node:["childNodes","parentNode","parentElement","textContent"],ShadowRoot:["host","styleSheets"],Element:["shadowRoot","querySelector","querySelectorAll"],MutationObserver:[]},Hl={Node:["contains","getRootNode"],ShadowRoot:["getSelection"],Element:[],MutationObserver:["constructor"]},$l={};function Xl(e){if($l[e])return $l[e];const t=globalThis[e],n=t.prototype,r=e in Gl?Gl[e]:void 0,o=Boolean(r&&r.every(e=>{var t,r;return Boolean(null==(r=null==(t=Object.getOwnPropertyDescriptor(n,e))?void 0:t.get)?void 0:r.toString().includes("[native code]"))})),i=e in Hl?Hl[e]:void 0,s=Boolean(i&&i.every(e=>{var t;return"function"==typeof n[e]&&(null==(t=n[e])?void 0:t.toString().includes("[native code]"))}));if(o&&s&&!globalThis.Zone)return $l[e]=t.prototype,t.prototype;try{const r=document.createElement("iframe");document.body.appendChild(r);const o=r.contentWindow;if(!o)return t.prototype;const i=o[e].prototype;return document.body.removeChild(r),i?$l[e]=i:n}catch{return n}}const ql={};function Yl(e,t,n){var r;const o=`${e}.${String(n)}`;if(ql[o])return ql[o].call(t);const i=Xl(e),s=null==(r=Object.getOwnPropertyDescriptor(i,n))?void 0:r.get;return s?(ql[o]=s,s.call(t)):t[n]}const Jl={};function Kl(e,t,n){const r=`${e}.${String(n)}`;if(Jl[r])return Jl[r].bind(t);const o=Xl(e)[n];return"function"!=typeof o?t[n]:(Jl[r]=o,o.bind(t))}const Ql=function(e){return Yl("Node",e,"childNodes")},eu=function(e){return Yl("Node",e,"parentNode")},tu=function(e){return Yl("Node",e,"parentElement")},nu=function(e){return Yl("Node",e,"textContent")},ru=function(e,t){return Kl("Node",e,"contains")(t)},ou=function(e){return Kl("Node",e,"getRootNode")()},iu=function(e){return e&&"host"in e?Yl("ShadowRoot",e,"host"):null},su=function(e){return e&&"shadowRoot"in e?Yl("Element",e,"shadowRoot"):null};function au(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const cu="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 lu={map:{},getId:()=>(console.error(cu),-1),getNode:()=>(console.error(cu),null),removeNodeFromMap(){console.error(cu)},has:()=>(console.error(cu),!1),reset(){console.error(cu)}};function uu(e,t,n={}){let r=null,o=0;return function(...i){const s=Date.now();o||!1!==n.leading||(o=s);const a=t-(s-o),c=this;a<=0||a>t?(r&&(clearTimeout(r),r=null),o=s,e.apply(c,i)):r||!1===n.trailing||(r=setTimeout(()=>{o=!1===n.leading?0:Date.now(),r=null,e.apply(c,i)},a))}}function hu(e,t,n,r,o=window){const i=o.Object.getOwnPropertyDescriptor(e,t);return o.Object.defineProperty(e,t,r?n:{set(e){setTimeout(()=>{n.set.call(this,e)},0),i&&i.set&&i.set.call(this,e)}}),()=>hu(e,t,i||{},!0)}function du(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],o=n(r);return"function"==typeof o&&(o.prototype=o.prototype||{},Object.defineProperties(o,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=o,()=>{e[t]=r}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(lu=new Proxy(lu,{get:(e,t,n)=>("map"===t&&console.error(cu),Reflect.get(e,t,n))}));let pu=Date.now;function mu(e){var t,n,r,o;const i=e.document;return{left:i.scrollingElement?i.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:i.documentElement.scrollLeft||(null==i?void 0:i.body)&&(null==(t=tu(i.body))?void 0:t.scrollLeft)||(null==(n=null==i?void 0:i.body)?void 0:n.scrollLeft)||0,top:i.scrollingElement?i.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:(null==i?void 0:i.documentElement.scrollTop)||(null==i?void 0:i.body)&&(null==(r=tu(i.body))?void 0:r.scrollTop)||(null==(o=null==i?void 0:i.body)?void 0:o.scrollTop)||0}}function fu(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function gu(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function yu(e){return e?e.nodeType===e.ELEMENT_NODE?e:tu(e):null}function wu(e,t,n,r){if(!e)return!1;const o=yu(e);if(!o)return!1;try{if("string"==typeof t){if(o.classList.contains(t))return!0;if(r&&null!==o.closest("."+t))return!0}else if(ln(o,t,r))return!0}catch(e){}if(n){if(o.matches(n))return!0;if(r&&null!==o.closest(n))return!0}return!1}function bu(e,t,n){return!("TITLE"!==e.tagName||!n.headTitleMutations)||-2===t.getId(e)}function vu(e,t){if(Pt(e))return!1;const n=t.getId(e);if(!t.has(n))return!0;const r=eu(e);return(!r||r.nodeType!==e.DOCUMENT_NODE)&&(!r||vu(r,t))}function Su(e){return Boolean(e.changedTouches)}function Cu(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function ku(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function Iu(e){return!!e&&(e instanceof Zl&&"shadowRoot"in e?Boolean(e.shadowRoot):Boolean(su(e)))}/[1-9][0-9]{12}/.test(Date.now().toString())||(pu=()=>(new Date).getTime());class Eu{constructor(){bt(this,"id",1),bt(this,"styleIDMap",new WeakMap),bt(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 n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}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 Mu(e){var t;let n=null;return"getRootNode"in e&&(null==(t=ou(e))?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&iu(ou(e))&&(n=iu(ou(e))),n}function xu(e){const t=e.ownerDocument;return!!t&&(ru(t,e)||function(e){const t=e.ownerDocument;if(!t)return!1;const n=function(e){let t,n=e;for(;t=Mu(n);)n=t;return n}(e);return ru(t,n)}(e))}var Au=(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))(Au||{}),Ru=(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))(Ru||{}),Tu=(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))(Tu||{}),Ou=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(Ou||{}),_u=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(_u||{}),Du=(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))(Du||{}),Pu=(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))(Pu||{});function Lu(e){return"__ln"in e}class Nu{constructor(){bt(this,"length",0),bt(this,"head",null),bt(this,"tail",null)}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)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&&Lu(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&(n.previous=t)}else if(e.nextSibling&&Lu(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.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 Fu=(e,t)=>`${e}@${t}`;class Bu{constructor(){bt(this,"frozen",!1),bt(this,"locked",!1),bt(this,"texts",[]),bt(this,"attributes",[]),bt(this,"attributeMap",new WeakMap),bt(this,"removes",[]),bt(this,"mapRemoves",[]),bt(this,"movedMap",{}),bt(this,"addedSet",new Set),bt(this,"movedSet",new Set),bt(this,"droppedSet",new Set),bt(this,"removesSubTreeCache",new Set),bt(this,"mutationCb"),bt(this,"blockClass"),bt(this,"blockSelector"),bt(this,"maskTextClass"),bt(this,"maskTextSelector"),bt(this,"inlineStylesheet"),bt(this,"maskInputOptions"),bt(this,"maskTextFn"),bt(this,"maskInputFn"),bt(this,"keepIframeSrcFn"),bt(this,"recordCanvas"),bt(this,"inlineImages"),bt(this,"slimDOMOptions"),bt(this,"dataURLOptions"),bt(this,"doc"),bt(this,"mirror"),bt(this,"iframeManager"),bt(this,"stylesheetManager"),bt(this,"shadowDomManager"),bt(this,"canvasManager"),bt(this,"processedNodeManager"),bt(this,"unattachedDoc"),bt(this,"processMutations",e=>{e.forEach(this.processMutation),this.emit()}),bt(this,"emit",()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new Nu,r=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},o=o=>{const i=eu(o);if(!i||!xu(o))return;let s=!1;if(o.nodeType===Node.TEXT_NODE){const e=i.tagName;if("TEXTAREA"===e)return;"STYLE"===e&&this.addedSet.has(i)&&(s=!0)}const a=Pt(i)?this.mirror.getId(Mu(o)):this.mirror.getId(i),c=r(o);if(-1===a||-1===c)return n.addNode(o);const l=dn(o,{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=>{Cu(e,this.mirror)&&this.iframeManager.addIframe(e),ku(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),Iu(o)&&this.shadowDomManager.addShadowRoot(su(o),this.doc)},onIframeLoad:(e,t)=>{this.iframeManager.attachIframe(e,t),this.shadowDomManager.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},cssCaptured:s});l&&(e.push({parentId:a,nextId:c,node:l}),t.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)zu(this.removesSubTreeCache,e,this.mirror)&&!this.movedSet.has(eu(e))||o(e);for(const e of this.addedSet)Wu(this.droppedSet,e)||zu(this.removesSubTreeCache,e,this.mirror)?Wu(this.movedSet,e)?o(e):this.droppedSet.add(e):o(e);let i=null;for(;n.length;){let e=null;if(i){const t=this.mirror.getId(eu(i.value)),n=r(i.value);-1!==t&&-1!==n&&(e=i)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(eu(n.value));if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value,r=eu(t);if(r&&r.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const t=iu(r);if(-1!==this.mirror.getId(t)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}i=e.previous,n.removeNode(e.value),o(e.value)}const s={texts:this.texts.map(e=>{const t=e.node,n=eu(t);return n&&"TEXTAREA"===n.tagName&&this.genTextAreaValueMutation(n),{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 n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+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};(s.texts.length||s.attributes.length||s.removes.length||s.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(s))}),bt(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(Ql(e),e=>nu(e)||"").join("")}),bt(this,"processMutation",e=>{if(!bu(e.target,this.mirror,this.slimDOMOptions))switch(e.type){case"characterData":{const t=nu(e.target);wu(e.target,this.blockClass,this.blockSelector,!1)||t===e.oldValue||this.texts.push({value:un(e.target,this.maskTextClass,this.maskTextSelector,!0)&&t?this.maskTextFn?this.maskTextFn(t,yu(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.attributeName,r=e.target.getAttribute(n);if("value"===n){const e=jt(t);r=Ut({element:t,maskInputOptions:this.maskInputOptions,tagName:t.tagName,type:e,value:r,maskInputFn:this.maskInputFn})}if(wu(e.target,this.blockClass,this.blockSelector,!1)||r===e.oldValue)return;let o=this.attributeMap.get(e.target);if("IFRAME"===t.tagName&&"src"===n&&!this.keepIframeSrcFn(r)){if(t.contentDocument)return;n="rr_src"}if(o||(o={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(o),this.attributeMap.set(e.target,o)),"type"===n&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!cn(t.tagName,n))if(o.attributes[n]=an(this.doc,zt(t.tagName),zt(n),r),"style"===n){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),i=t.style.getPropertyPriority(e);r!==n.style.getPropertyValue(e)||i!==n.style.getPropertyPriority(e)?o.styleDiff[e]=""===i?r:[r,i]:o._unchangedStyles[e]=[r,i]}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(o.styleDiff[e]=!1)}else"open"===n&&"DIALOG"===t.tagName&&(t.matches("dialog:modal")?o.attributes.rr_open_mode="modal":o.attributes.rr_open_mode="non-modal");break}case"childList":if(wu(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 n=this.mirror.getId(t),r=Pt(e.target)?this.mirror.getId(iu(e.target)):this.mirror.getId(e.target);wu(e.target,this.blockClass,this.blockSelector,!1)||bu(t,this.mirror,this.slimDOMOptions)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Uu(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||vu(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Fu(n,r)]?Uu(this.movedSet,t):(this.removes.push({parentId:r,id:n,isShadow:!(!Pt(e.target)||!Lt(e.target))||void 0}),function(e,t){const n=[e];for(;n.length;){const e=n.pop();t.has(e)||(t.add(e),Ql(e).forEach(e=>n.push(e)))}}(t,this.removesSubTreeCache))),this.mapRemoves.push(t))})}}),bt(this,"genAdds",(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(bu(e,this.mirror,this.slimDOMOptions))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[Fu(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);wu(e,this.blockClass,this.blockSelector,!1)||(Ql(e).forEach(e=>this.genAdds(e)),Iu(e)&&Ql(su(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 Uu(e,t){e.delete(t),Ql(t).forEach(t=>Uu(e,t))}function zu(e,t,n){return 0!==e.size&&function(e,t){const n=eu(t);return!!n&&e.has(n)}(e,t)}function Wu(e,t){return 0!==e.size&&ju(e,t)}function ju(e,t){const n=eu(t);return!!n&&(!!e.has(n)||ju(e,n))}let Vu;const Zu=e=>Vu?(...t)=>{try{return e(...t)}catch(e){if(Vu&&!0===Vu(e))return;throw e}}:e,Gu=[];function Hu(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 $u(e,t){const n=new Bu;Gu.push(n),n.init(e);const r=new(Xl("MutationObserver").constructor)(Zu(n.processMutations.bind(n)));return r.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),r}function Xu({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){return au("scroll",Zu(uu(Zu(i=>{const s=Hu(i);if(!s||wu(s,r,o,!0))return;const a=n.getId(s);if(s===t&&t.defaultView){const n=mu(t.defaultView);e({id:a,x:n.left,y:n.top})}else e({id:a,x:s.scrollLeft,y:s.scrollTop})}),i.scroll||100)),t)}const qu=["INPUT","TEXTAREA","SELECT"],Yu=new WeakMap;function Ju(e){return function(e,t){if(th("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||th("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||th("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||th("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Ku(e,t,n){let r,o;return e?(e.ownerNode?r=t.getId(e.ownerNode):o=n.getId(e),{styleId:o,id:r}):{}}function Qu({mirror:e,stylesheetManager:t},n){var r,o,i;let s=null;s="#document"===n.nodeName?e.getId(n):e.getId(iu(n));const a="#document"===n.nodeName?null==(r=n.defaultView)?void 0:r.Document:null==(i=null==(o=n.ownerDocument)?void 0:o.defaultView)?void 0:i.ShadowRoot,c=(null==a?void 0:a.prototype)?Object.getOwnPropertyDescriptor(null==a?void 0:a.prototype,"adoptedStyleSheets"):void 0;return null!==s&&-1!==s&&a&&c?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get(){var e;return null==(e=c.get)?void 0:e.call(this)},set(e){var n;const r=null==(n=c.set)?void 0:n.call(this,e);if(null!==s&&-1!==s)try{t.adoptStyleSheets(e,s)}catch(e){}return r}}),Zu(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:c.configurable,enumerable:c.enumerable,get:c.get,set:c.set})})):()=>{}}function eh(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;!function(e,t){const{mutationCb:n,mousemoveCb:r,mouseInteractionCb:o,scrollCb:i,viewportResizeCb:s,inputCb:a,mediaInteractionCb:c,styleSheetRuleCb:l,styleDeclarationCb:u,canvasMutationCb:h,fontCb:d,selectionCb:p,customElementCb:m}=e;e.mutationCb=(...e)=>{t.mutation&&t.mutation(...e),n(...e)},e.mousemoveCb=(...e)=>{t.mousemove&&t.mousemove(...e),r(...e)},e.mouseInteractionCb=(...e)=>{t.mouseInteraction&&t.mouseInteraction(...e),o(...e)},e.scrollCb=(...e)=>{t.scroll&&t.scroll(...e),i(...e)},e.viewportResizeCb=(...e)=>{t.viewportResize&&t.viewportResize(...e),s(...e)},e.inputCb=(...e)=>{t.input&&t.input(...e),a(...e)},e.mediaInteractionCb=(...e)=>{t.mediaInteaction&&t.mediaInteaction(...e),c(...e)},e.styleSheetRuleCb=(...e)=>{t.styleSheetRule&&t.styleSheetRule(...e),l(...e)},e.styleDeclarationCb=(...e)=>{t.styleDeclaration&&t.styleDeclaration(...e),u(...e)},e.canvasMutationCb=(...e)=>{t.canvasMutation&&t.canvasMutation(...e),h(...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),m(...e)}}(e,t),e.recordDOM&&(r=$u(e,e.doc));const o=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const o="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let s,a=[];const c=uu(Zu(t=>{const n=Date.now()-s;e(a.map(e=>(e.timeOffset-=n,e)),t),a=[],s=null}),i),l=Zu(uu(Zu(e=>{const t=Hu(e),{clientX:n,clientY:o}=Su(e)?e.changedTouches[0]:e;s||(s=pu()),a.push({x:n,y:o,id:r.getId(t),timeOffset:pu()-s}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?Ru.Drag:e instanceof MouseEvent?Ru.MouseMove:Ru.TouchMove)}),o,{trailing:!1})),u=[au("mousemove",l,n),au("touchmove",l,n),au("drag",l,n)];return Zu(()=>{u.forEach(e=>e())})}(e),i=function({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,sampling:i}){if(!1===i.mouseInteraction)return()=>{};const s=!0===i.mouseInteraction||void 0===i.mouseInteraction?{}:i.mouseInteraction,a=[];let c=null;return Object.keys(Tu).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==s[e]).forEach(i=>{let s=zt(i);const l=(t=>i=>{const s=Hu(i);if(wu(s,r,o,!0))return;let a=null,l=t;if("pointerType"in i){switch(i.pointerType){case"mouse":a=Ou.Mouse;break;case"touch":a=Ou.Touch;break;case"pen":a=Ou.Pen}a===Ou.Touch?Tu[t]===Tu.MouseDown?l="TouchStart":Tu[t]===Tu.MouseUp&&(l="TouchEnd"):Ou.Pen}else Su(i)&&(a=Ou.Touch);null!==a?(c=a,(l.startsWith("Touch")&&a===Ou.Touch||l.startsWith("Mouse")&&a===Ou.Mouse)&&(a=null)):Tu[t]===Tu.Click&&(a=c,c=null);const u=Su(i)?i.changedTouches[0]:i;if(!u)return;const h=n.getId(s),{clientX:d,clientY:p}=u;Zu(e)({type:Tu[l],id:h,x:d,y:p,...null!==a&&{pointerType:a}})})(i);if(window.PointerEvent)switch(Tu[i]){case Tu.MouseDown:case Tu.MouseUp:s=s.replace("mouse","pointer");break;case Tu.TouchStart:case Tu.TouchEnd:return}a.push(au(s,l,t))}),Zu(()=>{a.forEach(e=>e())})}(e),s=Xu(e),a=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return au("resize",Zu(uu(Zu(()=>{const t=fu(),o=gu();n===t&&r===o||(e({width:Number(o),height:Number(t)}),n=t,r=o)}),200)),t)}(e,{win:n}),c=function({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:o,ignoreClass:i,ignoreSelector:s,maskInputOptions:a,maskInputFn:c,sampling:l,userTriggeredOnInput:u}){function h(e){let n=Hu(e);const l=e.isTrusted,h=n&&n.tagName;if(n&&"OPTION"===h&&(n=tu(n)),!n||!h||qu.indexOf(h)<0||wu(n,r,o,!0))return;if(n.classList.contains(i)||s&&n.matches(s))return;let p=n.value,m=!1;const f=jt(n)||"";"radio"===f||"checkbox"===f?m=n.checked:(a[h.toLowerCase()]||a[f])&&(p=Ut({element:n,maskInputOptions:a,tagName:h,type:f,value:p,maskInputFn:c})),d(n,u?{text:p,isChecked:m,userTriggered:l}:{text:p,isChecked:m});const g=n.name;"radio"===f&&g&&m&&t.querySelectorAll(`input[type="radio"][name="${g}"]`).forEach(e=>{if(e!==n){const t=e.value;d(e,u?{text:t,isChecked:!m,userTriggered:!1}:{text:t,isChecked:!m})}})}function d(t,r){const o=Yu.get(t);if(!o||o.text!==r.text||o.isChecked!==r.isChecked){Yu.set(t,r);const o=n.getId(t);Zu(e)({...r,id:o})}}const p=("last"===l.input?["change"]:["input","change"]).map(e=>au(e,Zu(h),t)),m=t.defaultView;if(!m)return()=>{p.forEach(e=>e())};const f=m.Object.getOwnPropertyDescriptor(m.HTMLInputElement.prototype,"value"),g=[[m.HTMLInputElement.prototype,"value"],[m.HTMLInputElement.prototype,"checked"],[m.HTMLSelectElement.prototype,"value"],[m.HTMLTextAreaElement.prototype,"value"],[m.HTMLSelectElement.prototype,"selectedIndex"],[m.HTMLOptionElement.prototype,"selected"]];return f&&f.set&&p.push(...g.map(e=>hu(e[0],e[1],{set(){Zu(h)({target:this,isTrusted:!1})}},!1,m))),Zu(()=>{p.forEach(e=>e())})}(e),l=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,mirror:r,sampling:o,doc:i}){const s=Zu(i=>uu(Zu(o=>{const s=Hu(o);if(!s||wu(s,t,n,!0))return;const{currentTime:a,volume:c,muted:l,playbackRate:u,loop:h}=s;e({type:i,id:r.getId(s),currentTime:a,volume:c,muted:l,playbackRate:u,loop:h})}),o.media||500)),a=[au("play",s(Du.Play),i),au("pause",s(Du.Pause),i),au("seeked",s(Du.Seeked),i),au("volumechange",s(Du.VolumeChange),i),au("ratechange",s(Du.RateChange),i)];return Zu(()=>{a.forEach(e=>e())})}(e);let u=()=>{},h=()=>{},d=()=>{},p=()=>{};e.recordDOM&&(u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const o=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(o,{apply:Zu((r,o,i)=>{const[s,a]=i,{id:c,styleId:l}=Ku(o,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:s,index:a}]}),r.apply(o,i)})}),r.CSSStyleSheet.prototype.addRule=function(e,t,n=this.cssRules.length){const o=`${e} { ${t} }`;return r.CSSStyleSheet.prototype.insertRule.apply(this,[o,n])};const i=r.CSSStyleSheet.prototype.deleteRule;let s,a;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Zu((r,o,i)=>{const[s]=i,{id:a,styleId:c}=Ku(o,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,removes:[{index:s}]}),r.apply(o,i)})}),r.CSSStyleSheet.prototype.removeRule=function(e){return r.CSSStyleSheet.prototype.deleteRule.apply(this,[e])},r.CSSStyleSheet.prototype.replace&&(s=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(s,{apply:Zu((r,o,i)=>{const[s]=i,{id:a,styleId:c}=Ku(o,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,replace:s}),r.apply(o,i)})})),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Zu((r,o,i)=>{const[s]=i,{id:a,styleId:c}=Ku(o,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,replaceSync:s}),r.apply(o,i)})}));const c={};nh("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(nh("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),nh("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),nh("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(c).forEach(([r,o])=>{l[r]={insertRule:o.prototype.insertRule,deleteRule:o.prototype.deleteRule},o.prototype.insertRule=new Proxy(l[r].insertRule,{apply:Zu((r,o,i)=>{const[s,a]=i,{id:c,styleId:l}=Ku(o.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:s,index:[...Ju(o),a||0]}]}),r.apply(o,i)})}),o.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:Zu((r,o,i)=>{const[s]=i,{id:a,styleId:c}=Ku(o.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,removes:[{index:[...Ju(o),s]}]}),r.apply(o,i)})})}),Zu(()=>{r.CSSStyleSheet.prototype.insertRule=o,r.CSSStyleSheet.prototype.deleteRule=i,s&&(r.CSSStyleSheet.prototype.replace=s),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})})}(e,{win:n}),h=Qu(e,e.doc),d=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:o}){const i=o.CSSStyleDeclaration.prototype.setProperty;o.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Zu((o,s,a)=>{var c;const[l,u,h]=a;if(n.has(l))return i.apply(s,[l,u,h]);const{id:d,styleId:p}=Ku(null==(c=s.parentRule)?void 0:c.parentStyleSheet,t,r.styleMirror);return(d&&-1!==d||p&&-1!==p)&&e({id:d,styleId:p,set:{property:l,value:u,priority:h},index:Ju(s.parentRule)}),o.apply(s,a)})});const s=o.CSSStyleDeclaration.prototype.removeProperty;return o.CSSStyleDeclaration.prototype.removeProperty=new Proxy(s,{apply:Zu((o,i,a)=>{var c;const[l]=a;if(n.has(l))return s.apply(i,[l]);const{id:u,styleId:h}=Ku(null==(c=i.parentRule)?void 0:c.parentStyleSheet,t,r.styleMirror);return(u&&-1!==u||h&&-1!==h)&&e({id:u,styleId:h,remove:{property:l},index:Ju(i.parentRule)}),o.apply(i,a)})}),Zu(()=>{o.CSSStyleDeclaration.prototype.setProperty=i,o.CSSStyleDeclaration.prototype.removeProperty=s})}(e,{win:n}),e.collectFonts&&(p=function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],o=new WeakMap,i=n.FontFace;n.FontFace=function(e,t,n){const r=new i(e,t,n);return o.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const s=du(t.fonts,"add",function(t){return function(n){return setTimeout(Zu(()=>{const t=o.get(n);t&&(e(t),o.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=i}),r.push(s),Zu(()=>{r.forEach(e=>e())})}(e)));const m=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:o,selectionCb:i}=e;let s=!0;const a=Zu(()=>{const e=t.getSelection();if(!e||s&&(null==e?void 0:e.isCollapsed))return;s=e.isCollapsed||!1;const a=[],c=e.rangeCount||0;for(let t=0;t<c;t++){const i=e.getRangeAt(t),{startContainer:s,startOffset:c,endContainer:l,endOffset:u}=i;wu(s,r,o,!0)||wu(l,r,o,!0)||a.push({start:n.getId(s),startOffset:c,end:n.getId(l),endOffset:u})}i({ranges:a})});return a(),au("selectionchange",a)}(e),f=function({doc:e,customElementCb:t}){const n=e.defaultView;return n&&n.customElements?du(n.customElements,"define",function(e){return function(n,r,o){try{t({define:{name:n}})}catch(e){console.warn(`Custom element callback failed for ${n}`)}return e.apply(this,[n,r,o])}}):()=>{}}(e),g=[];for(const t of e.plugins)g.push(t.observer(t.callback,n,t.options));return Zu(()=>{Gu.forEach(e=>e.reset()),null==r||r.disconnect(),o(),i(),s(),a(),c(),l(),u(),h(),d(),p(),m(),f(),g.forEach(e=>e())})}function th(e){return void 0!==window[e]}function nh(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class rh{constructor(e){bt(this,"iframeIdToRemoteIdMap",new WeakMap),bt(this,"iframeRemoteIdToIdMap",new WeakMap),this.generateIdFn=e}getId(e,t,n,r){const o=n||this.getIdToRemoteIdMap(e),i=r||this.getRemoteIdToIdMap(e);let s=o.get(t);return s||(s=this.generateIdFn(),o.set(t,s),i.set(s,t)),s}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);return"number"!=typeof t?t:r.get(t)||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}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 oh{constructor(e){bt(this,"iframes",new WeakMap),bt(this,"crossOriginIframeMap",new WeakMap),bt(this,"crossOriginIframeMirror",new rh(Kt)),bt(this,"crossOriginIframeStyleMirror"),bt(this,"crossOriginIframeRootIdMap",new WeakMap),bt(this,"mirror"),bt(this,"mutationCb"),bt(this,"wrappedEmit"),bt(this,"loadListener"),bt(this,"stylesheetManager"),bt(this,"recordCrossOriginIframes"),this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new rh(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 n,r;this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&(null==(n=e.contentWindow)||n.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 n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){var n;switch(t.type){case Au.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:Au.IncrementalSnapshot,data:{source:Ru.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case Au.Meta:case Au.Load:case Au.DomContentLoaded:return!1;case Au.Plugin:return t;case Au.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case Au.IncrementalSnapshot:switch(t.data.source){case Ru.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),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 Ru.Drag:case Ru.TouchMove:case Ru.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case Ru.ViewportResize:return!1;case Ru.MediaInteraction:case Ru.MouseInteraction:case Ru.Scroll:case Ru.CanvasMutation:case Ru.Input:return this.replaceIds(t.data,e,["id"]),t;case Ru.StyleSheetRule:case Ru.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case Ru.Font:return t;case Ru.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case Ru.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),null==(n=t.data.styles)||n.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}return!1}replace(e,t,n,r){for(const o of r)(Array.isArray(t[o])||"number"==typeof t[o])&&(Array.isArray(t[o])?t[o]=e.getIds(n,t[o]):t[o]=e.getId(n,t[o]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}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===Pu.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class ih{constructor(e){bt(this,"shadowDoms",new WeakSet),bt(this,"mutationCb"),bt(this,"scrollCb"),bt(this,"bypassOptions"),bt(this,"mirror"),bt(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(!Lt(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e);const n=$u({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(Xu({...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(iu(e))),this.restoreHandlers.push(Qu({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 n=this;this.restoreHandlers.push(du(e.prototype,"attachShadow",function(e){return function(r){const o=e.call(this,r),i=su(this);return i&&xu(this)&&n.addShadowRoot(i,t),o}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet}}for(var sh="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ah="undefined"==typeof Uint8Array?[]:new Uint8Array(256),ch=0;ch<64;ch++)ah[sh.charCodeAt(ch)]=ch;const lh=new Map,uh=(e,t,n)=>{if(!e||!ph(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=lh.get(e);return n||(n=new Map,lh.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let o=r.indexOf(e);return-1===o&&(o=r.length,r.push(e)),o};function hh(e,t,n){if(e instanceof Array)return e.map(e=>hh(e,t,n));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,n=new Uint8Array(e),r=n.length,o="";for(t=0;t<r;t+=3)o+=sh[n[t]>>2],o+=sh[(3&n[t])<<4|n[t+1]>>4],o+=sh[(15&n[t+1])<<2|n[t+2]>>6],o+=sh[63&n[t+2]];return r%3==2?o=o.substring(0,o.length-1)+"=":r%3==1&&(o=o.substring(0,o.length-2)+"=="),o}(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[hh(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[hh(e.data,t,n),e.width,e.height]}:ph(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:uh(e,t,n)}:e}const dh=(e,t,n)=>e.map(e=>hh(e,t,n)),ph=(e,t)=>{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(n.find(n=>e instanceof t[n]))};function mh(e,t,n,r){const o=[];try{const i=du(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(o,...i){if(!wu(this,t,n,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(o);if("__context"in this||(this.__context=e),r&&["webgl","webgl2"].includes(e))if(i[0]&&"object"==typeof i[0]){const e=i[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else i.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[o,...i])}});o.push(i)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{o.forEach(e=>e())}}function fh(e,t,n,r,o,i){const s=[],a=Object.getOwnPropertyNames(e);for(const c of a)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(c))try{if("function"!=typeof e[c])continue;const a=du(e,c,function(e){return function(...s){const a=e.apply(this,s);if(uh(a,i,this),"tagName"in this.canvas&&!wu(this.canvas,r,o,!0)){const e=dh(s,i,this),r={type:t,property:c,args:e};n(this.canvas,r)}return a}});s.push(a)}catch{const r=hu(e,c,{set(e){n(this.canvas,{type:t,property:c,args:[e],setter:!0})}});s.push(r)}return s}const gh="KGZ1bmN0aW9uKCkgewogICJ1c2Ugc3RyaWN0IjsKICB2YXIgY2hhcnMgPSAiQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVphYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ejAxMjM0NTY3ODkrLyI7CiAgdmFyIGxvb2t1cCA9IHR5cGVvZiBVaW50OEFycmF5ID09PSAidW5kZWZpbmVkIiA/IFtdIDogbmV3IFVpbnQ4QXJyYXkoMjU2KTsKICBmb3IgKHZhciBpID0gMDsgaSA8IGNoYXJzLmxlbmd0aDsgaSsrKSB7CiAgICBsb29rdXBbY2hhcnMuY2hhckNvZGVBdChpKV0gPSBpOwogIH0KICB2YXIgZW5jb2RlID0gZnVuY3Rpb24oYXJyYXlidWZmZXIpIHsKICAgIHZhciBieXRlcyA9IG5ldyBVaW50OEFycmF5KGFycmF5YnVmZmVyKSwgaTIsIGxlbiA9IGJ5dGVzLmxlbmd0aCwgYmFzZTY0ID0gIiI7CiAgICBmb3IgKGkyID0gMDsgaTIgPCBsZW47IGkyICs9IDMpIHsKICAgICAgYmFzZTY0ICs9IGNoYXJzW2J5dGVzW2kyXSA+PiAyXTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMl0gJiAzKSA8PCA0IHwgYnl0ZXNbaTIgKyAxXSA+PiA0XTsKICAgICAgYmFzZTY0ICs9IGNoYXJzWyhieXRlc1tpMiArIDFdICYgMTUpIDw8IDIgfCBieXRlc1tpMiArIDJdID4+IDZdOwogICAgICBiYXNlNjQgKz0gY2hhcnNbYnl0ZXNbaTIgKyAyXSAmIDYzXTsKICAgIH0KICAgIGlmIChsZW4gJSAzID09PSAyKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDEpICsgIj0iOwogICAgfSBlbHNlIGlmIChsZW4gJSAzID09PSAxKSB7CiAgICAgIGJhc2U2NCA9IGJhc2U2NC5zdWJzdHJpbmcoMCwgYmFzZTY0Lmxlbmd0aCAtIDIpICsgIj09IjsKICAgIH0KICAgIHJldHVybiBiYXNlNjQ7CiAgfTsKICBjb25zdCBsYXN0QmxvYk1hcCA9IC8qIEBfX1BVUkVfXyAqLyBuZXcgTWFwKCk7CiAgY29uc3QgdHJhbnNwYXJlbnRCbG9iTWFwID0gLyogQF9fUFVSRV9fICovIG5ldyBNYXAoKTsKICBhc3luYyBmdW5jdGlvbiBnZXRUcmFuc3BhcmVudEJsb2JGb3Iod2lkdGgsIGhlaWdodCwgZGF0YVVSTE9wdGlvbnMpIHsKICAgIGNvbnN0IGlkID0gYCR7d2lkdGh9LSR7aGVpZ2h0fWA7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBpZiAodHJhbnNwYXJlbnRCbG9iTWFwLmhhcyhpZCkpIHJldHVybiB0cmFuc3BhcmVudEJsb2JNYXAuZ2V0KGlkKTsKICAgICAgY29uc3Qgb2Zmc2NyZWVuID0gbmV3IE9mZnNjcmVlbkNhbnZhcyh3aWR0aCwgaGVpZ2h0KTsKICAgICAgb2Zmc2NyZWVuLmdldENvbnRleHQoIjJkIik7CiAgICAgIGNvbnN0IGJsb2IgPSBhd2FpdCBvZmZzY3JlZW4uY29udmVydFRvQmxvYihkYXRhVVJMT3B0aW9ucyk7CiAgICAgIGNvbnN0IGFycmF5QnVmZmVyID0gYXdhaXQgYmxvYi5hcnJheUJ1ZmZlcigpOwogICAgICBjb25zdCBiYXNlNjQgPSBlbmNvZGUoYXJyYXlCdWZmZXIpOwogICAgICB0cmFuc3BhcmVudEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICByZXR1cm4gYmFzZTY0OwogICAgfSBlbHNlIHsKICAgICAgcmV0dXJuICIiOwogICAgfQogIH0KICBjb25zdCB3b3JrZXIgPSBzZWxmOwogIHdvcmtlci5vbm1lc3NhZ2UgPSBhc3luYyBmdW5jdGlvbihlKSB7CiAgICBpZiAoIk9mZnNjcmVlbkNhbnZhcyIgaW4gZ2xvYmFsVGhpcykgewogICAgICBjb25zdCB7IGlkLCBiaXRtYXAsIHdpZHRoLCBoZWlnaHQsIGRhdGFVUkxPcHRpb25zIH0gPSBlLmRhdGE7CiAgICAgIGNvbnN0IHRyYW5zcGFyZW50QmFzZTY0ID0gZ2V0VHJhbnNwYXJlbnRCbG9iRm9yKAogICAgICAgIHdpZHRoLAogICAgICAgIGhlaWdodCwKICAgICAgICBkYXRhVVJMT3B0aW9ucwogICAgICApOwogICAgICBjb25zdCBvZmZzY3JlZW4gPSBuZXcgT2Zmc2NyZWVuQ2FudmFzKHdpZHRoLCBoZWlnaHQpOwogICAgICBjb25zdCBjdHggPSBvZmZzY3JlZW4uZ2V0Q29udGV4dCgiMmQiKTsKICAgICAgY3R4LmRyYXdJbWFnZShiaXRtYXAsIDAsIDApOwogICAgICBiaXRtYXAuY2xvc2UoKTsKICAgICAgY29uc3QgYmxvYiA9IGF3YWl0IG9mZnNjcmVlbi5jb252ZXJ0VG9CbG9iKGRhdGFVUkxPcHRpb25zKTsKICAgICAgY29uc3QgdHlwZSA9IGJsb2IudHlwZTsKICAgICAgY29uc3QgYXJyYXlCdWZmZXIgPSBhd2FpdCBibG9iLmFycmF5QnVmZmVyKCk7CiAgICAgIGNvbnN0IGJhc2U2NCA9IGVuY29kZShhcnJheUJ1ZmZlcik7CiAgICAgIGlmICghbGFzdEJsb2JNYXAuaGFzKGlkKSAmJiBhd2FpdCB0cmFuc3BhcmVudEJhc2U2NCA9PT0gYmFzZTY0KSB7CiAgICAgICAgbGFzdEJsb2JNYXAuc2V0KGlkLCBiYXNlNjQpOwogICAgICAgIHJldHVybiB3b3JrZXIucG9zdE1lc3NhZ2UoeyBpZCB9KTsKICAgICAgfQogICAgICBpZiAobGFzdEJsb2JNYXAuZ2V0KGlkKSA9PT0gYmFzZTY0KSByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQgfSk7CiAgICAgIHdvcmtlci5wb3N0TWVzc2FnZSh7CiAgICAgICAgaWQsCiAgICAgICAgdHlwZSwKICAgICAgICBiYXNlNjQsCiAgICAgICAgd2lkdGgsCiAgICAgICAgaGVpZ2h0CiAgICAgIH0pOwogICAgICBsYXN0QmxvYk1hcC5zZXQoaWQsIGJhc2U2NCk7CiAgICB9IGVsc2UgewogICAgICByZXR1cm4gd29ya2VyLnBvc3RNZXNzYWdlKHsgaWQ6IGUuZGF0YS5pZCB9KTsKICAgIH0KICB9Owp9KSgpOwovLyMgc291cmNlTWFwcGluZ1VSTD1pbWFnZS1iaXRtYXAtZGF0YS11cmwtd29ya2VyLUlKcEM3Z19iLmpzLm1hcAo=",yh="undefined"!=typeof window&&window.Blob&&new Blob([(wh=gh,Uint8Array.from(atob(wh),e=>e.charCodeAt(0)))],{type:"text/javascript;charset=utf-8"});var wh;function bh(e){let t;try{if(t=yh&&(window.URL||window.webkitURL).createObjectURL(yh),!t)throw"";const n=new Worker(t,{name:null==e?void 0:e.name});return n.addEventListener("error",()=>{(window.URL||window.webkitURL).revokeObjectURL(t)}),n}catch(t){return new Worker("data:text/javascript;base64,"+gh,{name:null==e?void 0:e.name})}finally{t&&(window.URL||window.webkitURL).revokeObjectURL(t)}}class vh{constructor(e){bt(this,"pendingCanvasMutations",new Map),bt(this,"rafStamps",{latestId:0,invokeId:null}),bt(this,"mirror"),bt(this,"mutationCb"),bt(this,"resetObservers"),bt(this,"frozen",!1),bt(this,"locked",!1),bt(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:n,blockClass:r,blockSelector:o,recordCanvas:i,dataURLOptions:s}=e;this.mutationCb=e.mutationCb,this.mirror=e.mirror,i&&"all"===t&&this.initCanvasMutationObserver(n,r,o),i&&"number"==typeof t&&this.initCanvasFPSObserver(t,n,r,o,{dataURLOptions:s})}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,n,r,o){const i=mh(t,n,r,!0),s=new Map,a=new bh;a.onmessage=e=>{const{id:t}=e.data;if(s.set(t,!1),!("base64"in e.data))return;const{base64:n,type:r,width:o,height:i}=e.data;this.mutationCb({id:t,type:_u["2D"],commands:[{property:"clearRect",args:[0,0,o,i]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:n}],type:r}]},0,0]}]})};const c=1e3/e;let l,u=0;const h=e=>{u&&e-u<c||(u=e,(()=>{const e=[];return t.document.querySelectorAll("canvas").forEach(t=>{wu(t,n,r,!0)||e.push(t)}),e})().forEach(async e=>{var t;const n=this.mirror.getId(e);if(s.get(n))return;if(0===e.width||0===e.height)return;if(s.set(n,!0),["webgl","webgl2"].includes(e.__context)){const n=e.getContext(e.__context);!1===(null==(t=null==n?void 0:n.getContextAttributes())?void 0:t.preserveDrawingBuffer)&&n.clear(n.COLOR_BUFFER_BIT)}const r=await createImageBitmap(e);a.postMessage({id:n,bitmap:r,width:e.width,height:e.height,dataURLOptions:o.dataURLOptions},[r])})),l=requestAnimationFrame(h)};l=requestAnimationFrame(h),this.resetObservers=()=>{i(),cancelAnimationFrame(l)}}initCanvasMutationObserver(e,t,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const r=mh(e,t,n,!1),o=function(e,t,n,r){const o=[],i=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const s of i)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[s])continue;const i=du(t.CanvasRenderingContext2D.prototype,s,function(o){return function(...i){return wu(this.canvas,n,r,!0)||setTimeout(()=>{const n=dh(i,t,this);e(this.canvas,{type:_u["2D"],property:s,args:n})},0),o.apply(this,i)}});o.push(i)}catch{const n=hu(t.CanvasRenderingContext2D.prototype,s,{set(t){e(this.canvas,{type:_u["2D"],property:s,args:[t],setter:!0})}});o.push(n)}return()=>{o.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n),i=function(e,t,n,r){const o=[];return o.push(...fh(t.WebGLRenderingContext.prototype,_u.WebGL,e,n,r,t)),void 0!==t.WebGL2RenderingContext&&o.push(...fh(t.WebGL2RenderingContext.prototype,_u.WebGL2,e,n,r,t)),()=>{o.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n);this.resetObservers=()=>{r(),o(),i()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,requestAnimationFrame(e)};requestAnimationFrame(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map(e=>{const{type:t,...n}=e;return n}),{type:o}=n[0];this.mutationCb({id:t,type:o,commands:r}),this.pendingCanvasMutations.delete(e)}}class Sh{constructor(e){bt(this,"trackedLinkElements",new WeakSet),bt(this,"mutationCb"),bt(this,"adoptedStyleSheetCb"),bt(this,"styleMirror",new Eu),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 n={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,n)=>({rule:Ft(e,t.href),index:n}))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class Ch{constructor(){bt(this,"nodeMap",new WeakMap),bt(this,"active",!1)}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).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 kh,Ih,Eh,Mh=!1;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=(null==(yt=e.contentWindow)?void 0:yt.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const xh=new Bt;function Ah(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:o="rr-block",blockSelector:i=null,ignoreClass:s="rr-ignore",ignoreSelector:a=null,maskTextClass:c="rr-mask",maskTextSelector:l=null,inlineStylesheet:u=!0,maskAllInputs:h,maskInputOptions:d,slimDOMOptions:p,maskInputFn:m,maskTextFn:f,hooks:g,packFn:y,sampling:w={},dataURLOptions:b={},mousemoveWait:v,recordDOM:S=!0,recordCanvas:C=!1,recordCrossOriginIframes:k=!1,recordAfter:I=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:E=!1,collectFonts:M=!1,inlineImages:x=!1,plugins:A,keepIframeSrcFn:R=()=>!1,ignoreCSSAttributes:T=new Set([]),errorHandler:O}=e;Vu=O;const _=!k||window.parent===window;let D=!1;if(!_)try{window.parent.document&&(D=!1)}catch(e){D=!0}if(_&&!t)throw new Error("emit function is required");if(!_&&!D)return()=>{};void 0!==v&&void 0===w.mousemove&&(w.mousemove=v),xh.reset();const P=!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}:void 0!==d?d:{password:!0},L=!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 N;!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 F=0;const B=e=>{for(const t of A||[])t.eventProcessor&&(e=t.eventProcessor(e));return y&&!D&&(e=y(e)),e};kh=(e,o)=>{var i;const s=e;if(s.timestamp=pu(),!(null==(i=Gu[0])?void 0:i.isFrozen())||s.type===Au.FullSnapshot||s.type===Au.IncrementalSnapshot&&s.data.source===Ru.Mutation||Gu.forEach(e=>e.unfreeze()),_)null==t||t(B(s),o);else if(D){const e={type:"rrweb",event:B(s),origin:window.location.origin,isCheckout:o};window.parent.postMessage(e,"*")}if(s.type===Au.FullSnapshot)N=s,F=0;else if(s.type===Au.IncrementalSnapshot){if(s.data.source===Ru.Mutation&&s.data.isAttachIframe)return;F++;const e=r&&F>=r,t=n&&s.timestamp-N.timestamp>n;(e||t)&&Ih(!0)}};const U=e=>{kh({type:Au.IncrementalSnapshot,data:{source:Ru.Mutation,...e}})},z=e=>kh({type:Au.IncrementalSnapshot,data:{source:Ru.Scroll,...e}}),W=e=>kh({type:Au.IncrementalSnapshot,data:{source:Ru.CanvasMutation,...e}}),j=new Sh({mutationCb:U,adoptedStyleSheetCb:e=>kh({type:Au.IncrementalSnapshot,data:{source:Ru.AdoptedStyleSheet,...e}})}),V=new oh({mirror:xh,mutationCb:U,stylesheetManager:j,recordCrossOriginIframes:k,wrappedEmit:kh});for(const e of A||[])e.getMirror&&e.getMirror({nodeMirror:xh,crossOriginIframeMirror:V.crossOriginIframeMirror,crossOriginIframeStyleMirror:V.crossOriginIframeStyleMirror});const Z=new Ch;Eh=new vh({recordCanvas:C,mutationCb:W,win:window,blockClass:o,blockSelector:i,mirror:xh,sampling:w.canvas,dataURLOptions:b});const G=new ih({mutationCb:U,scrollCb:z,bypassOptions:{blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskInputOptions:P,dataURLOptions:b,maskTextFn:f,maskInputFn:m,recordCanvas:C,inlineImages:x,sampling:w,slimDOMOptions:L,iframeManager:V,stylesheetManager:j,canvasManager:Eh,keepIframeSrcFn:R,processedNodeManager:Z},mirror:xh});Ih=(e=!1)=>{if(!S)return;kh({type:Au.Meta,data:{href:window.location.href,width:gu(),height:fu()}},e),j.reset(),G.init(),Gu.forEach(e=>e.lock());const t=function(e,t){const{mirror:n=new Bt,blockClass:r="rr-block",blockSelector:o=null,maskTextClass:i="rr-mask",maskTextSelector:s=null,inlineStylesheet:a=!0,inlineImages:c=!1,recordCanvas:l=!1,maskAllInputs:u=!1,maskTextFn:h,maskInputFn:d,slimDOM:p=!1,dataURLOptions:m,preserveWhiteSpace:f,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:v,keepIframeSrcFn:S=()=>!1}=t||{};return dn(e,{doc:e,mirror:n,blockClass:r,blockSelector:o,maskTextClass:i,maskTextSelector:s,skipChild:!1,inlineStylesheet:a,maskInputOptions:!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}:!1===u?{password:!0}:u,maskTextFn:h,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:m,inlineImages:c,recordCanvas:l,preserveWhiteSpace:f,onSerialize:g,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:b,stylesheetLoadTimeout:v,keepIframeSrcFn:S,newlyAddedElement:!1})}(document,{mirror:xh,blockClass:o,blockSelector:i,maskTextClass:c,maskTextSelector:l,inlineStylesheet:u,maskAllInputs:P,maskTextFn:f,maskInputFn:m,slimDOM:L,dataURLOptions:b,recordCanvas:C,inlineImages:x,onSerialize:e=>{Cu(e,xh)&&V.addIframe(e),ku(e,xh)&&j.trackLinkElement(e),Iu(e)&&G.addShadowRoot(su(e),document)},onIframeLoad:(e,t)=>{V.attachIframe(e,t),G.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{j.attachLinkElement(e,t)},keepIframeSrcFn:R});if(!t)return console.warn("Failed to snapshot the document");kh({type:Au.FullSnapshot,data:{node:t,initialOffset:mu(window)}},e),Gu.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&j.adoptStyleSheets(document.adoptedStyleSheets,xh.getId(document))};try{const e=[],t=e=>{var t;return Zu(eh)({mutationCb:U,mousemoveCb:(e,t)=>kh({type:Au.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>kh({type:Au.IncrementalSnapshot,data:{source:Ru.MouseInteraction,...e}}),scrollCb:z,viewportResizeCb:e=>kh({type:Au.IncrementalSnapshot,data:{source:Ru.ViewportResize,...e}}),inputCb:e=>kh({type:Au.IncrementalSnapshot,data:{source:Ru.Input,...e}}),mediaInteractionCb:e=>kh({type:Au.IncrementalSnapshot,data:{source:Ru.MediaInteraction,...e}}),styleSheetRuleCb:e=>kh({type:Au.IncrementalSnapshot,data:{source:Ru.StyleSheetRule,...e}}),styleDeclarationCb:e=>kh({type:Au.IncrementalSnapshot,data:{source:Ru.StyleDeclaration,...e}}),canvasMutationCb:W,fontCb:e=>kh({type:Au.IncrementalSnapshot,data:{source:Ru.Font,...e}}),selectionCb:e=>{kh({type:Au.IncrementalSnapshot,data:{source:Ru.Selection,...e}})},customElementCb:e=>{kh({type:Au.IncrementalSnapshot,data:{source:Ru.CustomElement,...e}})},blockClass:o,ignoreClass:s,ignoreSelector:a,maskTextClass:c,maskTextSelector:l,maskInputOptions:P,inlineStylesheet:u,sampling:w,recordDOM:S,recordCanvas:C,inlineImages:x,userTriggeredOnInput:E,collectFonts:M,doc:e,maskInputFn:m,maskTextFn:f,keepIframeSrcFn:R,blockSelector:i,slimDOMOptions:L,dataURLOptions:b,mirror:xh,iframeManager:V,stylesheetManager:j,shadowDomManager:G,processedNodeManager:Z,canvasManager:Eh,ignoreCSSAttributes:T,plugins:(null==(t=null==A?void 0:A.filter(e=>e.observer))?void 0:t.map(e=>({observer:e.observer,options:e.options,callback:t=>kh({type:Au.Plugin,data:{plugin:e.name,payload:t}})})))||[]},g)};V.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}});const n=()=>{Ih(),e.push(t(document)),Mh=!0};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(au("DOMContentLoaded",()=>{kh({type:Au.DomContentLoaded,data:{}}),"DOMContentLoaded"===I&&n()})),e.push(au("load",()=>{kh({type:Au.Load,data:{}}),"load"===I&&n()},window))),()=>{e.forEach(e=>e()),Z.destroy(),Mh=!1,Vu=void 0}}catch(e){console.warn(e)}}var Rh,Th;Ah.addCustomEvent=(e,t)=>{if(!Mh)throw new Error("please add custom event after start recording");kh({type:Au.Custom,data:{tag:e,payload:t}})},Ah.freezePage=()=>{Gu.forEach(e=>e.freeze())},Ah.takeFullSnapshot=e=>{if(!Mh)throw new Error("please take full snapshot after start recording");Ih(e)},Ah.mirror=xh,(Th=Rh||(Rh={}))[Th.NotStarted=0]="NotStarted",Th[Th.Running=1]="Running",Th[Th.Stopped=2]="Stopped";class Oh{constructor(e,t={}){this.events=[],this.isActive=!1,this.hasFullSnapshot=!1,this.startTime=0,this.sessionId=e,this.config={enabled:!0,sampleRate:1,maskSensitiveFields:!0,maxEventBuffer:1e3,batchInterval:2e3,captureClicks:!0,captureScrolls:!0,captureInputs:!0,captureMouseMoves:!1,compressionEnabled:!0,...t}}start(){if(!this.config.enabled||this.isActive)return!1;if(Math.random()>this.config.sampleRate)return!1;try{return this.rrwebStopRecord=Ah({emit:e=>{this.handleRRWebEvent(e)},maskAllInputs:this.config.maskSensitiveFields,recordCanvas:!1,recordCrossOriginIframes:!1,inlineStylesheet:!0,collectFonts:!1}),this.isActive=!0,this.hasFullSnapshot=!1,this.startTime=Date.now(),this.startBatchTimer(),this.snapshotTimeout=window.setTimeout(()=>{this.hasFullSnapshot?console.log("[Zaplier] FullSnapshot confirmed captured"):console.error("[Zaplier] CRITICAL: FullSnapshot not captured after 5 seconds!",{eventsReceived:this.events.length,eventTypes:this.events.map(e=>e.type).slice(0,10)})},5e3),console.log("[Zaplier] Session replay started with rrweb"),!0}catch(e){return console.error("[Zaplier] Failed to start rrweb recording:",e),!1}}stop(){this.isActive&&(this.isActive=!1,this.rrwebStopRecord&&(this.rrwebStopRecord(),this.rrwebStopRecord=void 0),this.batchTimer&&(clearInterval(this.batchTimer),this.batchTimer=void 0),this.snapshotTimeout&&(clearTimeout(this.snapshotTimeout),this.snapshotTimeout=void 0),this.sendBatch())}handleRRWebEvent(e){try{if(!this.hasFullSnapshot||this.events.length<5){const t={[Au.DomContentLoaded]:"DomContentLoaded",[Au.Load]:"Load",[Au.FullSnapshot]:"FullSnapshot",[Au.IncrementalSnapshot]:"IncrementalSnapshot",[Au.Meta]:"Meta",[Au.Custom]:"Custom",[Au.Plugin]:"Plugin"};console.log(`[Zaplier] Received event type ${e.type} (${t[e.type]||"Unknown"})`,{timestamp:new Date(e.timestamp).toISOString(),isFirst:0===this.events.length,totalEvents:this.events.length+1})}e.type===Au.FullSnapshot?(this.hasFullSnapshot=!0,console.log("[Zaplier] ✅ FullSnapshot captured! Replay will work correctly."),this.snapshotTimeout&&(clearTimeout(this.snapshotTimeout),this.snapshotTimeout=void 0)):0===this.events.length&&console.error(`[Zaplier] ⚠️ WARNING: First event is type ${e.type}, not FullSnapshot! Replay may not work.`),this.addEvent(e),e.type===Au.FullSnapshot&&this.events.length>0&&setTimeout(()=>{this.sendBatch()},100)}catch(e){console.warn("[Zaplier] Error handling rrweb event:",e)}}addEvent(e){if(this.events.push(e),this.events.length>this.config.maxEventBuffer){const e=this.events.findIndex(e=>e.type===Au.FullSnapshot);if(e>=0&&e<this.events.length-this.config.maxEventBuffer){const t=this.events[e],n=this.events.slice(1-this.config.maxEventBuffer);this.events=[t,...n]}else this.events=this.events.slice(-this.config.maxEventBuffer)}}startBatchTimer(){this.batchTimer=window.setInterval(()=>{this.sendBatch()},this.config.batchInterval)}sendBatch(){if(0===this.events.length)return;if(!this.hasFullSnapshot){const e=Date.now()-this.startTime;return void(e%2e3<100&&console.warn(`[Zaplier] Waiting for FullSnapshot before sending batch... (${Math.floor(e/1e3)}s). Events so far: ${this.events.length}, types:`,this.events.map(e=>e.type).slice(0,5)))}const e=[...this.events];this.events=[];const t=e.some(e=>e.type===Au.FullSnapshot);!t&&this.hasFullSnapshot&&console.warn("[Zaplier] Batch missing FullSnapshot, but one was captured earlier"),console.log(`[Zaplier] Sending batch with ${e.length} events for session ${this.sessionId}`,{hasSnapshot:t,firstEventType:e[0]?.type});const n={sessionId:this.sessionId,events:e,metadata:{userAgent:navigator.userAgent,timestamp:Date.now(),compression:this.config.compressionEnabled}};this.sendToBackend(n)}setSDKInstance(e){this.sdkInstance=e}async sendToBackend(e){try{if(!this.sdkInstance)return void console.error("[Zaplier] No SDK instance available for replay transport");console.log("[Zaplier] Sending replay batch via SDK transport"),console.log("[Zaplier] Payload:",{sessionId:e.sessionId,eventCount:e.events.length,hasMetadata:!!e.metadata});const t=await this.sdkInstance.sendReplayBatch({sessionId:e.sessionId,events:e.events,metadata:{startUrl:window.location.href,duration:Date.now()-(performance.timeOrigin||Date.now()),funnelSteps:[],hasConversion:!1,...e.metadata}});t&&t.success?console.log("[Zaplier] Session replay batch sent successfully"):console.error("[Zaplier] Session replay batch failed:",t)}catch(e){console.error("[Zaplier] Session replay error:",e)}}getEventCount(){return this.events.length}isRecording(){return this.isActive}}const _h={apiEndpoint:"https://api.zaplier.com",retryEnabled:!0,maxRetries:3,retryDelays:[1e3,2e3,4e3],autoTrack:!0,dedupeEnabled:!0,fingerprintEnabled:!0,presenceTracking:!1,heartbeatInterval:3e4,scrollTracking:!0,scrollDepthTracking:!0,gdprCompliant:!0,enhancedTracking:"ask",replaySampling:.1,replayMaskInputs:!0};class Dh{constructor(e){if(this.version="1.3.0",this.isInitialized=!1,this.eventQueue=[],this.heatmap={enable:()=>{if(this.config.heatmap=!0,!this.heatmapEngine&&this.isInitialized){this.sessionId||(this.sessionId=this.generateSessionId());const e=this.sessionId;this.heatmapEngine=new gt(e,{trackClicks:!0,trackScrollDepth:!0,trackRageClicks:!0,trackMouseMoves:!1}),this.antiAdblockManager&&this.heatmapEngine.setAntiAdblockManager(this.antiAdblockManager),this.heatmapEngine.start()}this.config.debug&&console.log("[Zaplier] Heatmap enabled")},disable:()=>{this.config.heatmap=!1,this.heatmapEngine&&(this.heatmapEngine.stop(),this.heatmapEngine=void 0),this.config.debug&&console.log("[Zaplier] Heatmap disabled")},enableMouseTracking:()=>{this.heatmapEngine&&this.heatmapEngine.enableMouseTracking()},disableMouseTracking:()=>{this.heatmapEngine&&this.heatmapEngine.disableMouseTracking()},getStats:()=>this.heatmapEngine?this.heatmapEngine.getStats():null,isRecording:()=>!!this.heatmapEngine&&this.heatmapEngine.isRecording()},this.replay={enable:()=>{if(this.config.replay=!0,!this.replayEngine&&this.isInitialized){this.sessionId||(this.sessionId=this.generateSessionId());const e=this.sessionId;this.replayEngine=new Oh(e,{sampleRate:1,maskSensitiveFields:this.config.replayMaskInputs,compressionEnabled:!0}),this.antiAdblockManager&&this.replayEngine.setSDKInstance(this);const t=this.replayEngine.start();this.config.debug&&console.log("[Zaplier] Replay enabled",{started:t,isRecording:this.replayEngine.isRecording()})}else if(this.replayEngine)if(this.replayEngine.isRecording())this.config.debug&&console.log("[Zaplier] Replay already recording");else{this.replayEngine.stop(),this.replayEngine=void 0,this.sessionId||(this.sessionId=this.generateSessionId());const e=this.sessionId;this.replayEngine=new Oh(e,{sampleRate:1,maskSensitiveFields:this.config.replayMaskInputs,compressionEnabled:!0}),this.antiAdblockManager&&this.replayEngine.setSDKInstance(this);const t=this.replayEngine.start();this.config.debug&&console.log("[Zaplier] Replay engine recreated with 100% sample rate",{started:t,isRecording:this.replayEngine.isRecording()})}this.config.debug&&!this.replayEngine&&console.log("[Zaplier] Replay enabled (will start when SDK initializes)")},disable:()=>{this.config.replay=!1,this.replayEngine&&(this.replayEngine.stop(),this.replayEngine=void 0),this.config.debug&&console.log("[Zaplier] Replay disabled")},start:()=>{if(!this.replayEngine&&this.isInitialized){this.sessionId||(this.sessionId=this.generateSessionId());const e=this.sessionId;return this.replayEngine=new Oh(e,{sampleRate:1,maskSensitiveFields:this.config.replayMaskInputs,compressionEnabled:!0}),this.antiAdblockManager&&this.replayEngine.setSDKInstance(this),this.replayEngine.start()}return!!this.replayEngine&&this.replayEngine.start()},stop:()=>{this.replayEngine&&this.replayEngine.stop()},isRecording:()=>!!this.replayEngine&&this.replayEngine.isRecording(),getEventCount:()=>this.replayEngine?this.replayEngine.getEventCount():0,addFunnelStep:e=>{this.sendEvent({eventType:"funnel_step",eventName:"funnel_step",customData:e})},markConversion:e=>{this.trackConversion("funnel_conversion",e.value,e.currency,e)}},!e.token)throw new Error("Zaplier: token is required");this.config={..._h,...e,gdprMode:e.gdprMode??!1},"undefined"!=typeof window&&this.initialize()}async initialize(){try{if(this.config.debug&&console.log("[Zaplier] Initializing SDK v"+this.version),!this.config.allow_localhost&&this.isLocalhost())return void(this.config.debug&&console.log("[Zaplier] Skipping tracking on localhost"));await this.collectFingerprint(),this.config.autoTrack&&this.trackPageView(),this.isInitialized=!0,this.initializeAntiAdblock(),this.initializeTrackingEngines(),this.processEventQueue(),this.config.debug&&console.log("[Zaplier] SDK initialized successfully",{visitorId:this.visitorId,gdprMode:this.config.gdprMode})}catch(e){console.error("[Zaplier] Initialization failed:",e)}}initializeTrackingEngines(){try{if(this.sessionId||(this.sessionId=this.generateSessionId(),this.config.debug&&console.log("[Zaplier] Generated session ID:",this.sessionId)),this.config.replay){const e=!0===this.config.replay?1:this.config.replaySampling;this.replayEngine=new Oh(this.sessionId,{sampleRate:e,maskSensitiveFields:this.config.replayMaskInputs,compressionEnabled:!0}),this.replayEngine.setSDKInstance(this);const t=this.replayEngine.start();this.config.debug&&console.log("[Zaplier] Session Replay started",{started:t,sampleRate:e,isRecording:this.replayEngine.isRecording()})}this.config.heatmap&&(this.heatmapEngine=new gt(this.sessionId,{trackClicks:!0,trackScrollDepth:!0,trackRageClicks:!0,trackMouseMoves:!1}),this.antiAdblockManager&&this.heatmapEngine.setAntiAdblockManager(this.antiAdblockManager),this.heatmapEngine.start(),this.config.debug&&console.log("[Zaplier] Heatmap tracking started"))}catch(e){console.error("[Zaplier] Failed to initialize tracking engines:",e)}}generateSessionId(){const e=performance.timeOrigin||Date.now(),t=this.getBrowserFingerprint();return e.toString(36)+t.substring(0,8)}getBrowserFingerprint(){const e=[navigator.userAgent||"",navigator.platform||"",screen.width||0,screen.height||0,new Date(2024,0,1).getTimezoneOffset(),navigator.language||"",navigator.hardwareConcurrency||0].join("|");let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)&4294967295;return Math.abs(t).toString(36)}initializeAntiAdblock(){try{this.antiAdblockManager=new ft(this.config.apiEndpoint,this.config.token,{enabled:!0,methods:["elysia-websocket","fetch"],fallbackDelay:100,maxRetries:2,debug:this.config.debug}),this.config.debug&&console.log("[Zaplier] Anti-Adblock Manager initialized")}catch(e){console.error("[Zaplier] Failed to initialize Anti-Adblock Manager:",e)}}async collectFingerprint(){try{const e=this.config.gdprMode?await ut():await ht();if(!e.success||!e.data)throw new Error("Fingerprint collection failed");this.fingerprint=e.data,e.data.incognitoDetection&&(this.fingerprint.incognitoDetection={...e.data.incognitoDetection,detectionTimestamp:Date.now(),sdkVersion:this.version}),this.config.debug&&console.log("[Zaplier] Fingerprint collected:",{components:e.collectedComponents,hashes:{full:e.data.hash,stableCore:e.data.stableCoreHash},gdprMode:this.config.gdprMode,incognitoDetected:e.data.incognitoDetection?.isIncognito,incognitoConfidence:e.data.incognitoDetection?.confidence})}catch(e){this.config.debug&&console.error("[Zaplier] Fingerprint collection failed:",e);try{const e=[navigator.userAgent||"",navigator.language||"",navigator.platform||"",screen.width||0,screen.height||0,screen.colorDepth||0,new Date(2024,0,1).getTimezoneOffset(),navigator.hardwareConcurrency||0,navigator.deviceMemory||0,navigator.maxTouchPoints||0,performance.timeOrigin||0,navigator.plugins?navigator.plugins.length:0,navigator.mimeTypes?navigator.mimeTypes.length:0,Math.floor((performance.memory?.usedJSHeapSize||0)/1e6),Math.floor((performance.memory?.totalJSHeapSize||0)/1e6),navigator.connection?.effectiveType||"",Math.floor(navigator.connection?.downlink||0),window.outerHeight||0,window.outerWidth||0,Math.floor(100*(window.devicePixelRatio||1))/100,"function"==typeof document.createElement("canvas").getContext?1:0].join("|");let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)&4294967295;const n=Math.abs(t).toString(36);let r=0;const o=e+n;for(let e=0;e<o.length;e++)r=(r<<5)-r+o.charCodeAt(e)&4294967295,r^=r>>>16;this.fingerprint||(this.fingerprint={}),this.fingerprint.fallbackEntropy=Math.abs(r).toString(36)}catch{}}}isLocalhost(){return!("undefined"==typeof window||!window.location)&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname||window.location.hostname.startsWith("192.168.")||window.location.hostname.startsWith("10.")||window.location.hostname.includes("local"))}async sendEvent(e){if(this.isInitialized)try{const t={fingerprintHash:this.fingerprint?.hash,stableCoreHash:this.fingerprint?.stableCoreHash,stableCoreVector:this.fingerprint?.stableCoreVector,fingerprintVector:this.fingerprint||void 0,incognitoDetection:this.fingerprint?.incognitoDetection&&(void 0!==this.fingerprint.incognitoDetection.likelihood||this.fingerprint.incognitoDetection.methods&&this.fingerprint.incognitoDetection.methods.length>0)?this.fingerprint.incognitoDetection:void 0,isSafari:"undefined"!=typeof navigator&&/safari/i.test(navigator.userAgent)&&!/chrome|chromium|opr|edg|edge/i.test(navigator.userAgent),ch:navigator.userAgentData?{brands:navigator.userAgentData.brands||[],platform:navigator.userAgentData.platform||void 0,mobile:navigator.userAgentData.mobile||void 0,model:navigator.userAgentData.model||void 0}:void 0,fingerprintComponents:this.fingerprint?.components||{},...e,timestamp:(new Date).toISOString(),url:"undefined"!=typeof window&&window.location?window.location.href:"",referrer:"undefined"!=typeof document?document.referrer:"",pageTitle:"undefined"!=typeof document?document.title:"",userAgent:"undefined"!=typeof navigator?navigator.userAgent:"",screenWidth:this.fingerprint?.screen?.value?.width||("undefined"!=typeof window&&window.screen?window.screen.width:0),screenHeight:this.fingerprint?.screen?.value?.height||("undefined"!=typeof window&&window.screen?window.screen.height:0),viewportWidth:this.fingerprint?.screen?.value?.viewportWidth||("undefined"!=typeof window?window.innerWidth:0),viewportHeight:this.fingerprint?.screen?.value?.viewportHeight||("undefined"!=typeof window?window.innerHeight:0),gdprMode:this.config.gdprMode},n=await this.makeRequest(`/tracking/event?token=${encodeURIComponent(this.config.token)}`,t);return n.visitorId&&(this.backendVisitorId=n.visitorId,this.config.debug&&console.log("[Zaplier] Backend visitor ID received:",n.visitorId)),n.sessionId&&(this.sessionId=n.sessionId),n}catch(t){this.config.debug&&console.error("[Zaplier] Event sending failed:",t),this.config.retryEnabled&&setTimeout(()=>this.sendEvent(e),5e3)}else this.eventQueue.push(e)}async sendReplayBatch(e){if(!this.isInitialized)return console.error("[Zaplier] SDK not initialized for replay batch sending"),{success:!1,error:"SDK not initialized"};try{const t={sessionId:e.sessionId,userId:this.backendVisitorId,events:e.events,metadata:{...e.metadata,visitorId:this.backendVisitorId,fingerprintHash:this.fingerprint?.hash}};this.config.debug&&console.log("[Zaplier] Sending replay batch:",{sessionId:t.sessionId,eventCount:t.events.length,hasMetadata:!!t.metadata});const n=await this.makeRequest(`/replays/record?token=${encodeURIComponent(this.config.token)}`,t,"POST");return this.config.debug&&console.log("[Zaplier] Replay batch result:",n),n}catch(e){return this.config.debug&&console.error("[Zaplier] Replay batch sending failed:",e),{success:!1,error:e instanceof Error?e.message:"Unknown error"}}}async makeRequest(e,t,n="POST"){const r=`${this.config.apiEndpoint}${e}`,o={method:n,headers:{"Content-Type":"application/json"}};"POST"===n&&t&&(o.body=JSON.stringify(t));try{const e=Promise.race([fetch(r,o),new Promise((e,t)=>setTimeout(()=>t(new Error("Fetch timeout - possibly blocked")),5e3))]),t=await e;if(!t.ok)throw new Error(`HTTP ${t.status}: ${t.statusText}`);return await t.json()}catch(r){if(this.antiAdblockManager&&"POST"===n){this.config.debug&&console.warn(`[Zaplier] Standard fetch failed (${r instanceof Error?r.message:String(r)}), trying anti-adblock fallback`);try{const n=await this.antiAdblockManager.send(t,e);if(n.success)return this.config.debug&&console.log(`[Zaplier] Request sent via ${n.method} (${n.latency}ms) as fallback`),{success:!0,method:n.method}}catch(e){this.config.debug&&console.warn("[Zaplier] Both standard fetch and anti-adblock failed:",e)}}throw r}}processEventQueue(){for(;this.eventQueue.length>0;){const e=this.eventQueue.shift();this.sendEvent(e)}}track(e,t){this.sendEvent({eventType:e,eventName:e,customData:t})}trackCustomEvent(e,t){return this.sendEvent({eventType:"custom",eventName:e,customData:t}),!0}trackConversion(e,t,n,r){return this.sendEvent({eventType:"conversion",eventName:e,revenue:t,currency:n||"USD",customData:r}),!0}trackPageView(e){this.sendEvent({eventType:"page_view",eventName:"page_view",...e})}trackPurchase(e){this.sendEvent({eventType:"purchase",eventName:"purchase",revenue:e.value||e.revenue,currency:e.currency||"USD",quantity:e.quantity||1,productId:e.productId,customData:{productName:e.productName,orderId:e.orderId,...e.customData}})}trackAddToCart(e){this.sendEvent({eventType:"add_to_cart",eventName:"add_to_cart",revenue:e?.price,quantity:e?.quantity||1,productId:e?.productId,customData:{productName:e?.productName,...e?.customData}})}trackViewContent(e){this.sendEvent({eventType:"view_content",eventName:"view_content",productId:e?.productId,customData:{productName:e?.productName,category:e?.category,...e?.customData}})}trackInitiateCheckout(e){this.sendEvent({eventType:"initiate_checkout",eventName:"initiate_checkout",revenue:e?.value,currency:e?.currency||"USD",quantity:e?.numItems,customData:e?.customData})}trackLead(e){this.sendEvent({eventType:"lead",eventName:"lead",customData:e})}identify(e){this.sendEvent({eventType:"identify",eventName:"identify",email:e.email,phone:e.phone,customData:e})}trackSPANavigation(e,t){this.trackPageView({url:e||("undefined"!=typeof window&&window.location?window.location.href:""),pageTitle:t||("undefined"!=typeof document?document.title:"")})}resetScrollTracking(){this.config.debug&&console.log("[Zaplier] Scroll tracking reset")}startPresenceTracking(){this.config.presenceTracking=!0,this.config.debug&&console.log("[Zaplier] Presence tracking started")}stopPresenceTracking(){this.config.presenceTracking=!1,this.config.debug&&console.log("[Zaplier] Presence tracking stopped")}enableEnhancedTracking(){return this.config.enhancedTracking="true",this.config.gdprMode=!1,this.collectFingerprint(),this.config.debug&&console.log("[Zaplier] Enhanced tracking enabled"),!0}disableEnhancedTracking(){this.config.enhancedTracking="false",this.config.gdprMode=!0,this.config.debug&&console.log("[Zaplier] Enhanced tracking disabled")}isEnhancedMode(){return"true"===this.config.enhancedTracking&&!this.config.gdprMode}getVisitorId(){return this.backendVisitorId||this.visitorId||null}async getVisitorInfo(){const e=this.backendVisitorId;if(!e)return this.config.debug&&console.warn("[Zaplier] No backend visitor ID available. Track an event first and wait for the response."),null;if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e))return this.config.debug&&console.warn("[Zaplier] Invalid visitor ID format. Expected UUID, got:",e),null;try{return await this.makeRequest(`/tracking/visitor/${e}?token=${encodeURIComponent(this.config.token)}`,null,"GET")}catch(e){return this.config.debug&&console.error("[Zaplier] Failed to get visitor info:",e),null}}async getVisitorHistory(){const e=this.backendVisitorId;if(!e)return this.config.debug&&console.warn("[Zaplier] No backend visitor ID available. Track an event first and wait for the response."),null;if(!/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(e))return this.config.debug&&console.warn("[Zaplier] Invalid visitor ID format. Expected UUID, got:",e),null;try{return await this.makeRequest(`/tracking/visitor/${e}/history?token=${encodeURIComponent(this.config.token)}`,null,"GET")}catch(e){return this.config.debug&&console.error("[Zaplier] Failed to get visitor history:",e),null}}getUserData(){const e="undefined"!=typeof window&&"undefined"!=typeof navigator?{userAgent:navigator.userAgent||"",language:navigator.language||"",screen:{width:window.screen?.width||0,height:window.screen?.height||0}}:{userAgent:"",language:"",screen:{width:0,height:0}};return{sessionId:this.sessionId||"",visitorId:this.getVisitorId()||void 0,location:{},device:e,journey:[],fingerprint:this.fingerprint?.hash}}getConversionLikelihood(){return{score:.5,factors:["Requires backend analysis"]}}getUserSegment(){return{type:"medium_intent",confidence:.5}}}let Ph=null;const Lh={init:e=>Ph?(console.warn("[Zaplier] SDK already initialized"),Ph):(Ph=new Dh(e),Ph),getInstance:()=>Ph,track:(e,t)=>{Ph?Ph.track(e,t):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackPageView:e=>{Ph?Ph.trackPageView(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackEvent:(e,t)=>Ph?Ph.trackCustomEvent(e,t):(console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first"),!1),trackConversion:(e,t,n,r)=>{Ph?Ph.trackConversion(e,t,n,r):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackPurchase:e=>{Ph?Ph.trackPurchase(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackAddToCart:e=>{Ph?Ph.trackAddToCart(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},identify:e=>{Ph?Ph.identify(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},getVisitorId:()=>Ph?Ph.getVisitorId():null,getVisitorInfo:()=>Ph?Ph.getVisitorInfo():Promise.resolve(null),getUserData:()=>Ph?Ph.getUserData():null,enableEnhancedTracking:()=>Ph?Ph.enableEnhancedTracking():(console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first"),!1),disableEnhancedTracking:()=>{Ph?Ph.disableEnhancedTracking():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},isEnhancedMode:()=>!!Ph&&Ph.isEnhancedMode(),heatmap:{enable:()=>{Ph?Ph.heatmap.enable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},disable:()=>{Ph?Ph.heatmap.disable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},enableMouseTracking:()=>{Ph?Ph.heatmap.enableMouseTracking():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},disableMouseTracking:()=>{Ph?Ph.heatmap.disableMouseTracking():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},getStats:()=>Ph?Ph.heatmap.getStats():null,isRecording:()=>!!Ph&&Ph.heatmap.isRecording()},replay:{enable:()=>{Ph?Ph.replay.enable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},disable:()=>{Ph?Ph.replay.disable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},start:()=>Ph?Ph.replay.start():(console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first"),!1),stop:()=>{Ph?Ph.replay.stop():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},isRecording:()=>!!Ph&&Ph.replay.isRecording(),getEventCount:()=>Ph?Ph.replay.getEventCount():0,addFunnelStep:e=>{Ph?Ph.replay.addFunnelStep(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},markConversion:e=>{Ph?Ph.replay.markConversion(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")}},debug:{getStats:()=>Ph&&Ph.antiAdblockManager?Ph.antiAdblockManager.getStats():null,getSuccessRates:()=>Ph&&Ph.antiAdblockManager?Ph.antiAdblockManager.getSuccessRates():null,testTransports:()=>Ph&&Ph.antiAdblockManager?Ph.antiAdblockManager.testTransports():Promise.resolve(null)},version:"3.0.0"};function Nh(){if("undefined"==typeof window||"undefined"==typeof document)return;const e=document.getElementsByTagName("script");let t=null;for(const n of Array.from(e))if(n.src&&(n.src.includes("zaplier")||n.src.includes("sdk.js")||n.src.includes("sdk.min.js"))&&n.dataset.token){t=n;break}if(!t||!t.dataset.token)return;const n={token:t.dataset.token,debug:"true"===t.dataset.debug,gdprMode:"true"===t.dataset.gdprMode,heatmap:"true"===t.dataset.heatmap,replay:"true"===t.dataset.replay,allow_localhost:"true"===t.dataset.allowLocalhost};try{Lh.init(n),n.debug&&console.log("[Zaplier] Auto-initialized from script tag",n)}catch(e){console.error("[Zaplier] Auto-initialization failed:",e)}}"undefined"!=typeof window&&(window.Zaplier=Lh,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",Nh):Nh());const Fh=[/HeadlessChrome/i,/PhantomJS/i,/SlimerJS/i,/Selenium/i,/WebDriver/i,/ChromeDriver/i,/GeckoDriver/i,/bot/i,/crawler/i,/spider/i,/scraper/i,/Googlebot/i,/Bingbot/i,/Slurp/i,/DuckDuckBot/i,/Baiduspider/i,/YandexBot/i,/facebookexternalhit/i,/Twitterbot/i,/LinkedInBot/i,/WhatsApp/i,/SkypeUriPreview/i],Bh=[/^Mozilla\/5\.0$/,/Headless/i,/automated/i,/testing/i,/^$/];function Uh(){try{if(!0===navigator.webdriver)return{detected:!0,confidence:95,method:"navigator.webdriver_true"};if(!0===window.webdriver)return{detected:!0,confidence:90,method:"window.webdriver_true"};const e=["_selenium","callSelenium","_Selenium_IDE_Recorder","callPhantom","_phantom","__phantomas","__fxdriver_evaluate","__fxdriver_unwrapped","_fxdriver_evaluate","_fxdriver_unwrapped"];for(const t of e)if(t in window||t in document)return{detected:!0,confidence:85,method:`selenium_property_${t}`};return document.documentElement.getAttribute("webdriver")?{detected:!0,confidence:80,method:"document_webdriver_attribute"}:{detected:!1,confidence:0,method:"webdriver_not_detected"}}catch(e){return{detected:!1,confidence:0,method:"webdriver_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function zh(){try{let e=0;const t=[];window.outerHeight&&window.outerWidth||(e++,t.push("missing_outer_dimensions")),0===navigator.plugins.length&&(e++,t.push("no_plugins")),navigator.languages&&0!==navigator.languages.length||(e++,t.push("no_languages"));const n=navigator.userAgent;return(!n||n.length<50)&&(e++,t.push("short_user_agent")),void 0===Notification?.permission&&(e++,t.push("no_notification_permission")),window.performance&&window.performance.timing||(e++,t.push("missing_performance_api")),n.includes("Chrome")&&(window.chrome||(e++,t.push("missing_chrome_object")),n.includes("HeadlessChrome"))?{detected:!0,confidence:95,method:"chrome_headless_user_agent"}:{detected:e>=3,confidence:Math.min(15*e,90),method:"headless_characteristics",details:{issues:t,suspiciousCount:e}}}catch(e){return{detected:!1,confidence:0,method:"headless_detection_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function Wh(){try{const e=["webdriver","selenium","phantomjs","slimerjs","chromedriver","geckodriver","automation","puppeteer"],t=[];for(const n of e)(window[n]||window[`_${n}`]||window[`__${n}`])&&t.push(n);for(const n of e)(document[n]||document[`_${n}`]||document[`__${n}`])&&t.push(n);try{window.navigator||t.push("navigation_missing")}catch(e){const n=e instanceof Error?e.message:"";(n.includes("automation")||n.includes("webdriver"))&&t.push("navigation_automation_error")}return t.length>0?{detected:!0,confidence:Math.min(30*t.length,95),method:"automation_tools_detected",details:{tools:t}}:{detected:!1,confidence:0,method:"no_automation_tools"}}catch(e){return{detected:!1,confidence:0,method:"automation_detection_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function jh(){try{const e=["#ad-banner",".advertisement",".google-ads",".adsense","#google-analytics",".analytics",'[src*="google-analytics"]','[src*="googletagmanager"]',".facebook-widget",".twitter-widget",".social-share"];let t=0;for(const n of e)document.querySelector(n)||t++;try{const e=document.createElement("img");e.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",e.style.display="none",document.body.appendChild(e),setTimeout(()=>{e.parentNode&&e.parentNode.removeChild(e)},100)}catch{t++}return{detected:t>=2,confidence:Math.min(20*t,80),method:"dom_blockers",details:{blockedCount:t,totalTests:e.length+1}}}catch(e){return{detected:!1,confidence:0,method:"dom_blocker_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function Vh(){try{return navigator.languages&&0!==navigator.languages.length?1===navigator.languages.length&&"en-US"===navigator.languages[0]?{detected:!0,confidence:40,method:"single_default_language"}:navigator.language!==navigator.languages[0]?{detected:!0,confidence:30,method:"inconsistent_languages",details:{language:navigator.language,firstLanguage:navigator.languages[0]}}:{detected:!1,confidence:0,method:"languages_normal",details:{languageCount:navigator.languages.length}}:{detected:!0,confidence:70,method:"no_languages"}}catch(e){return{detected:!0,confidence:50,method:"language_detection_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function Zh(){try{const e=new Function("return 2 + 2")();if(4!==e)return{detected:!0,confidence:90,method:"function_constructor_incorrect_result",details:{expected:4,actual:e}};const t=Function.toString();return t.includes("[native code]")||t.includes("function Function()")?{detected:!1,confidence:0,method:"eval_normal"}:{detected:!0,confidence:70,method:"function_constructor_modified_toString",details:{functionString:t.substring(0,100)}}}catch(e){return{detected:!0,confidence:60,method:"eval_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}function Gh(){const e=navigator.userAgent,t=Fh.filter(t=>t.test(e)),n=Bh.filter(t=>t.test(e));let r="legitimate";t.some(e=>e.source.includes("bot|crawler|spider"))?r="crawler":t.some(e=>e.source.includes("Selenium|WebDriver"))?r="automation":t.some(e=>e.source.includes("Headless|Phantom"))&&(r="headless");const o=[...t.map(e=>e.source),...n.map(e=>e.source)];return{browser:{name:"Unknown",version:"Unknown",major:"Unknown",engine:"unknown"},os:{name:"Unknown",version:"Unknown",family:"unknown"},device:{type:"desktop"},suspicious:{isBot:t.length>0||n.length>0,patterns:o,category:t.length>0?r:"legitimate"},isMobile:!1,isTablet:!1,isDesktop:!0,isBot:t.length>0||n.length>0,raw:e}}async function Hh(){try{const e="__incognito_test_"+Date.now(),t="test";localStorage.setItem(e,t);const n=localStorage.getItem(e);if(localStorage.removeItem(e),n!==t)return{detected:!0,confidence:80,method:"localStorage_inconsistency",details:{retrieved:n,expected:t}};try{const e="x".repeat(1048576);return localStorage.setItem("__capacity_test",e),localStorage.removeItem("__capacity_test"),{detected:!1,confidence:30,method:"localStorage_capacity"}}catch(e){return{detected:!0,confidence:60,method:"localStorage_capacity_limited",details:{error:e instanceof Error?e.message:"Unknown"}}}}catch(e){return{detected:!0,confidence:90,method:"localStorage_unavailable",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function $h(){try{const e="__session_test_"+Date.now(),t="test";sessionStorage.setItem(e,t);const n=sessionStorage.getItem(e);return sessionStorage.removeItem(e),n!==t?{detected:!0,confidence:75,method:"sessionStorage_inconsistency",details:{retrieved:n,expected:t}}:{detected:!1,confidence:20,method:"sessionStorage_working"}}catch(e){return{detected:!0,confidence:85,method:"sessionStorage_unavailable",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Xh(){try{return window.indexedDB?new Promise(e=>{const t="__incognito_test_"+Date.now(),n=indexedDB.open(t,1),r=setTimeout(()=>{e({detected:!0,confidence:60,method:"indexedDB_timeout"})},1e3);n.onerror=()=>{clearTimeout(r),e({detected:!0,confidence:80,method:"indexedDB_error",details:{error:n.error?.message}})},n.onsuccess=()=>{clearTimeout(r),n.result.close(),indexedDB.deleteDatabase(t),e({detected:!1,confidence:25,method:"indexedDB_working"})},n.onblocked=()=>{clearTimeout(r),e({detected:!0,confidence:70,method:"indexedDB_blocked"})}}):{detected:!0,confidence:70,method:"indexedDB_unavailable"}}catch(e){return{detected:!0,confidence:85,method:"indexedDB_exception",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function qh(){try{if(!navigator.permissions)return{detected:!1,confidence:10,method:"permissions_unsupported"};const e=await navigator.permissions.query({name:"notifications"});return"denied"===e.state?{detected:!0,confidence:40,method:"permissions_notifications_denied",details:{state:e.state}}:{detected:!1,confidence:30,method:"permissions_working",details:{state:e.state}}}catch(e){return{detected:!0,confidence:50,method:"permissions_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Yh(){try{if(!navigator.storage||!navigator.storage.estimate)return{detected:!1,confidence:10,method:"quota_unsupported"};const e=await navigator.storage.estimate(),t=navigator.userAgent,n=/Chrome/.test(t)&&!/Edg|OPR/.test(t),r=/Safari/.test(t)&&!/Chrome/.test(t);let o,i;if(n?(o=157286400,i=125829120):r?(o=52428800,i=26214400):(o=104857600,i=52428800),e.quota){if(e.quota<=i)return{detected:!0,confidence:85,method:"quota_very_limited",details:{quota:e.quota,usage:e.usage,quotaMB:Math.round(e.quota/1048576),threshold:Math.round(i/1048576)}};if(e.quota<=o)return{detected:!0,confidence:65,method:"quota_limited",details:{quota:e.quota,usage:e.usage,quotaMB:Math.round(e.quota/1048576),threshold:Math.round(o/1048576)}}}return{detected:!1,confidence:30,method:"quota_normal",details:{quota:e.quota,usage:e.usage,quotaMB:e.quota?Math.round(e.quota/1048576):null}}}catch(e){return{detected:!0,confidence:50,method:"quota_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Jh(){try{const e=navigator.userAgent;return/Chrome/.test(e)&&!/Edg|OPR/.test(e)?window.webkitRequestFileSystem?new Promise(e=>{const t=()=>{e({detected:!1,confidence:40,method:"chrome_filesystem_available"})},n=()=>{e({detected:!0,confidence:80,method:"chrome_filesystem_blocked"})};try{window.webkitRequestFileSystem(0,1,t,n)}catch(t){e({detected:!0,confidence:70,method:"chrome_filesystem_exception"})}setTimeout(()=>{e({detected:!1,confidence:20,method:"chrome_filesystem_timeout"})},1e3)}):{detected:!1,confidence:10,method:"chrome_filesystem_unsupported"}:{detected:!1,confidence:0,method:"chrome_detection_not_applicable"}}catch(e){return{detected:!1,confidence:10,method:"chrome_detection_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Kh(){try{const e=navigator.userAgent;if(!/Safari/.test(e)||/Chrome/.test(e))return{detected:!1,confidence:0,method:"safari_detection_not_applicable"};try{localStorage.setItem("__safari_test","test");const e=localStorage.length;if(localStorage.removeItem("__safari_test"),0===e)return{detected:!0,confidence:75,method:"safari_localStorage_blocked"}}catch(e){return{detected:!0,confidence:80,method:"safari_localStorage_exception"}}return window.indexedDB?{detected:!1,confidence:30,method:"safari_detection_normal"}:{detected:!0,confidence:70,method:"safari_indexedDB_missing"}}catch(e){return{detected:!1,confidence:10,method:"safari_detection_error",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function Qh(){try{const e=window.requestFileSystem||window.webkitRequestFileSystem;return e?new Promise(t=>{e(window.TEMPORARY||0,1024,()=>{t({detected:!1,confidence:30,method:"filesystem_working"})},e=>{t({detected:!0,confidence:60,method:"filesystem_error",details:{error:e.name||"Unknown"}})}),setTimeout(()=>{t({detected:!0,confidence:50,method:"filesystem_timeout"})},1e3)}):{detected:!1,confidence:10,method:"filesystem_unsupported"}}catch(e){return{detected:!0,confidence:70,method:"filesystem_exception",details:{error:e instanceof Error?e.message:"Unknown"}}}}async function ed(){try{const e=new Image,t=performance.now();return new Promise(n=>{const r=setTimeout(()=>{n({detected:!1,confidence:10,method:"cache_timeout"})},3e3);e.onload=()=>{clearTimeout(r);const e=performance.now()-t;n(e<5?{detected:!0,confidence:30,method:"cache_too_fast",details:{loadTime:e}}:{detected:!1,confidence:20,method:"cache_normal",details:{loadTime:e}})},e.onerror=()=>{clearTimeout(r),n({detected:!1,confidence:10,method:"cache_error"})},e.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"})}catch(e){return{detected:!1,confidence:10,method:"cache_exception",details:{error:e instanceof Error?e.message:"Unknown"}}}}function td(e,t){return new Promise(n=>{setTimeout(()=>{n({detected:!1,confidence:0,method:`${t}_timeout`})},e)})}function nd(){try{return"object"==typeof window.chrome&&null!==window.chrome&&"object"==typeof window.chrome.runtime}catch{return!1}}function rd(){return navigator.userAgent.includes("WebKit")&&!navigator.userAgent.includes("Chrome")}function od(){return navigator.userAgent.includes("Gecko")&&!navigator.userAgent.includes("Chrome")}function id(){return navigator.userAgent.includes("SamsungBrowser")||navigator.userAgent.includes("Samsung Internet")}function sd(){return navigator.userAgent.includes("iPad")||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1}function ad(){return navigator.userAgent.includes("Android")}function cd(e,t){const n=e.match(t);return n&&n[1]||"Unknown"}function ld(e){const t=e.toLowerCase();return t.includes("tablet")||sd()?sd()?{type:"tablet",vendor:"Apple",model:"iPad"}:t.includes("kindle")?{type:"tablet",vendor:"Amazon",model:"Kindle"}:{type:"tablet"}:t.includes("mobile")||t.includes("iphone")||t.includes("ipod")||ad()?t.includes("iphone")?{type:"mobile",vendor:"Apple",model:"iPhone"}:t.includes("ipod")?{type:"mobile",vendor:"Apple",model:"iPod"}:ad()&&t.includes("mobile")?{type:"mobile",vendor:"Android"}:{type:"mobile"}:{type:"desktop"}}var ud=Object.freeze({__proto__:null,detectIncognitoHeuristics:async function(){const e=[];let t=0;const n=await async function(){try{const e="__incognito_test__",t=Date.now().toString();localStorage.setItem(e,t);const n=localStorage.getItem(e);return localStorage.removeItem(e),n===t}catch{return!1}}();n||(t+=.25,e.push("localStorage_blocked"));const r=await async function(){try{const e="__incognito_test__",t=Date.now().toString();sessionStorage.setItem(e,t);const n=sessionStorage.getItem(e);return sessionStorage.removeItem(e),n===t}catch{return!1}}();r||(t+=.2,e.push("sessionStorage_blocked"));const o=await async function(){try{return!!window.indexedDB&&new Promise(e=>{const t=indexedDB.open("__incognito_test__",1);t.onsuccess=()=>{t.result.close(),indexedDB.deleteDatabase("__incognito_test__"),e(!0)},t.onerror=()=>e(!1),t.onblocked=()=>e(!1)})}catch{return!1}}();o||(t+=.15,e.push("indexedDB_blocked"));const i=function(){try{const e="__incognito_test__",t=Date.now().toString();document.cookie=`${e}=${t}; SameSite=Strict; path=/`;const n=-1!==document.cookie.indexOf(`${e}=${t}`);return document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/`,n}catch{return!1}}();i||(t+=.2,e.push("cookies_blocked")),function(){try{return!(!Array.isArray(navigator.languages)||1!==navigator.languages.length||!navigator.language)&&navigator.languages[0]===navigator.language}catch{return!1}}()&&(t+=.25,e.push("languages_single_value"));try{if(n){const n="__incognito_persistence_test__",r="persist_test";localStorage.setItem(n,r);const o=localStorage.getItem(n)===r;localStorage.removeItem(n),o||(t+=.2,e.push("localStorage_not_persistent"))}}catch{}try{if(navigator.storage?.estimate){const n=await navigator.storage.estimate(),r=n?.quota||0,o=n?.usage||0;0===r?(t+=.3,e.push("storage_quota_zero")):r>0&&r<125829120&&(t+=.25,e.push("storage_quota_low")),0===o&&r>0&&(t+=.1,e.push("storage_usage_zero"))}else e.push("storage_estimate_unavailable")}catch{e.push("storage_estimate_error")}"serviceWorker"in navigator||(t+=.1,e.push("service_worker_absent")),"caches"in window||(t+=.05,e.push("cache_api_absent"));try{if(navigator.permissions?.query){const n=await navigator.permissions.query({name:"notifications"});"denied"===n?.state&&(t+=.05,e.push("notifications_denied"))}}catch{e.push("permissions_query_error")}(function(){try{return!!window.showOpenFilePicker}catch{return!1}})()||e.push("fs_access_absent"),"connection"in navigator||e.push("network_info_absent"),t=Math.max(0,Math.min(1,t));const s=[n,r,o,i].filter(e=>!e).length;return s>=3?t=Math.max(t,.85):s>=2&&(t=Math.max(t,.7)),e.includes("languages_single_value")&&(s>=1||t>=.2)&&(t=Math.max(t,.5)),{likelihood:t,methods:e}}});function hd(){try{if("deviceMemory"in navigator){const e=navigator.deviceMemory;return"number"==typeof e?e:null}return null}catch{return null}}function dd(){try{if("hardwareConcurrency"in navigator){const e=navigator.hardwareConcurrency;return"number"==typeof e?e:null}return null}catch{return null}}function pd(){try{return[navigator.platform,navigator.userAgent,navigator.userAgent.includes("ARM")?"ARM":null,navigator.userAgent.includes("arm64")?"ARM64":null,navigator.userAgent.includes("aarch64")?"ARM64":null,navigator.userAgent.includes("x86_64")?"x86_64":null,navigator.userAgent.includes("WOW64")?"x86_64":null,navigator.userAgent.includes("Win64")?"x86_64":null,navigator.userAgent.includes("Intel")?"Intel":null].filter(Boolean).join("|")||"unknown"}catch{return"unknown"}}function md(){try{return navigator.maxTouchPoints||0}catch{return 0}}var fd=Object.freeze({__proto__:null,getArchitecture:pd,getDeviceMemory:hd,getHardwareConcurrency:dd,getHardwareFingerprint:function(){return{deviceMemory:hd(),hardwareConcurrency:dd(),architecture:pd(),maxTouchPoints:md(),platform:navigator.platform||"unknown"}},getMaxTouchPoints:md,isHardwareDetectionAvailable:function(){return"undefined"!=typeof navigator}});function gd(){try{if("undefined"!=typeof Intl&&Intl.DateTimeFormat){const e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(e)return e}const e=new Date(2024,0,1).getTimezoneOffset();return`UTC${e>0?"-":"+"}${Math.abs(e/60)}`}catch{return"unknown"}}function yd(){try{const e=[];navigator.languages&&Array.isArray(navigator.languages)&&e.push(...navigator.languages),navigator.language&&e.push(navigator.language);const t=navigator.userLanguage||navigator.browserLanguage;return t&&e.push(t),[...new Set(e)]}catch{return["unknown"]}}function wd(){try{if("undefined"!=typeof Intl&&Intl.DateTimeFormat){const e=(new Intl.DateTimeFormat).resolvedOptions();return{locale:e.locale||"unknown",calendar:e.calendar||"unknown",numberingSystem:e.numberingSystem||"unknown",timeZone:e.timeZone||"unknown"}}return{locale:"unknown"}}catch{return{locale:"unknown"}}}function bd(){try{const e={platform:navigator.platform||"unknown",oscpu:navigator.oscpu||null,vendor:navigator.vendor||null},t=navigator.userAgent;if(t.includes("Windows"))e.os="Windows",t.includes("Windows NT 10.0")?e.osVersion="10":t.includes("Windows NT 6.3")?e.osVersion="8.1":t.includes("Windows NT 6.2")?e.osVersion="8":t.includes("Windows NT 6.1")&&(e.osVersion="7");else if(t.includes("Macintosh")||t.includes("Mac OS")){e.os="macOS";const n=t.match(/Mac OS X ([0-9_]+)/);n&&n[1]&&(e.osVersion=n[1].replace(/_/g,"."))}else if(t.includes("Linux"))e.os="Linux";else if(t.includes("Android")){e.os="Android";const n=t.match(/Android ([0-9.]+)/);n&&n[1]&&(e.osVersion=n[1])}else if(t.includes("iOS")||t.includes("iPhone")||t.includes("iPad")){e.os="iOS";const n=t.match(/OS ([0-9_]+)/);n&&n[1]&&(e.osVersion=n[1].replace(/_/g,"."))}return e}catch{return{platform:"unknown"}}}var vd=Object.freeze({__proto__:null,getDateTimeLocale:wd,getLanguages:yd,getPlatformExtended:bd,getSystemFingerprint:function(){return{timezone:gd(),languages:yd(),dateTimeLocale:wd(),platform:bd(),cookiesEnabled:navigator.cookieEnabled||!1}},getTimezone:gd,isSystemDetectionAvailable:function(){return"undefined"!=typeof navigator}});function Sd(){try{if("undefined"==typeof localStorage)return!1;const e="__rb_test__",t="test";localStorage.setItem(e,t);const n=localStorage.getItem(e);return localStorage.removeItem(e),n===t}catch(e){return"blocked"}}function Cd(){try{if("undefined"==typeof sessionStorage)return!1;const e="__rb_test__",t="test";sessionStorage.setItem(e,t);const n=sessionStorage.getItem(e);return sessionStorage.removeItem(e),n===t}catch(e){return"blocked"}}function kd(){return new Promise(e=>{try{if(!("indexedDB"in window))return void e(!1);const t="__rb_test_db__",n=indexedDB.open(t,1);let r=!1;const o=t=>{r||(r=!0,e(t))};setTimeout(()=>o("blocked"),1e3),n.onerror=()=>o("blocked"),n.onsuccess=()=>{try{n.result.close();const e=indexedDB.deleteDatabase(t);e.onsuccess=()=>o(!0),e.onerror=()=>o(!0)}catch{o("blocked")}},n.onupgradeneeded=()=>{try{const e=n.result;e.objectStoreNames.contains("test")||e.createObjectStore("test")}catch{o("blocked")}}}catch{e("blocked")}})}function Id(){try{return"openDatabase"in window&&"function"==typeof window.openDatabase}catch{return!1}}async function Ed(){try{if("storage"in navigator&&"estimate"in navigator.storage){const e=await navigator.storage.estimate();return{quota:e.quota||null,usage:e.usage||null,available:e.quota&&e.usage?e.quota-e.usage:null}}return{}}catch{return{}}}var Md=Object.freeze({__proto__:null,getIndexedDBSupport:kd,getLocalStorageSupport:Sd,getSessionStorageSupport:Cd,getStorageFingerprint:async function(){const[e,t]=await Promise.all([kd(),Ed()]);return{localStorage:Sd(),sessionStorage:Cd(),indexedDB:e,webSQL:Id(),quota:t}},getStorageQuota:Ed,getWebSQLSupport:Id,isStorageDetectionAvailable:function(){return"undefined"!=typeof window}});function xd(){const e=Math,t=()=>0,n=e.acos||t,r=e.acosh||t,o=e.asin||t,i=e.asinh||t,s=e.atanh||t,a=e.atan||t,c=e.sin||t,l=e.sinh||t,u=e.cos||t,h=e.cosh||t,d=e.tan||t,p=e.tanh||t,m=e.exp||t,f=e.expm1||t,g=e.log1p||t,y=t=>e.pow(e.PI,t),w=t=>e.log(t+e.sqrt(t*t+1)),b=t=>e.log((1+t)/(1-t))/2,v=t=>(e.exp(t)-1/e.exp(t))/2,S=t=>(e.exp(t)+1/e.exp(t))/2,C=t=>e.exp(t)-1,k=t=>(e.exp(2*t)-1)/(e.exp(2*t)+1),I=t=>e.log(1+t);try{return{acos:n(.12312423423423424),asin:o(.12312423423423424),atan:a(.5),cos:u(10.000000000123),sin:c(-1e300),tan:d(-1e300),acosh:r(1e308),acoshPf:(E=1e154,e.log(E+e.sqrt(E*E-1))),asinh:i(1),asinhPf:w(1),atanh:s(.5),atanhPf:b(.5),cosh:h(1),coshPf:S(1),sinh:l(1),sinhPf:v(1),tanh:p(1),tanhPf:k(1),exp:m(1),expm1:f(1),expm1Pf:C(1),log1p:g(10),log1pPf:I(10),powPI:y(-100),sqrt:e.sqrt(2),cbrt:e.cbrt?e.cbrt(8):0,log:e.log(e.E),log10:e.log10?e.log10(10):0,log2:e.log2?e.log2(2):0,special_0:e.sin(e.PI),special_1:e.cos(e.PI/2),special_2:e.tan(e.PI/4),special_3:e.sqrt(-1),special_4:e.log(-1),special_5:1/0,special_6:NaN}}catch(t){return{error:1,basicMath:e.PI+e.E}}var E}function Ad(){try{return{PI:Math.PI,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2}}catch{return{}}}function Rd(){try{return{precision1:.1+.2,precision2:.3-.1,precision3:.1*3,precision4:1.1-.9,largeAdd:1e16,largeSub:1e16,tiny:Number.MIN_VALUE,epsilon:Number.EPSILON||2220446049250313e-31,maxValue:Number.MAX_VALUE,maxSafeInteger:Number.MAX_SAFE_INTEGER||9007199254740991,minSafeInteger:Number.MIN_SAFE_INTEGER||-9007199254740991}}catch{return{}}}var Td=Object.freeze({__proto__:null,getCompleteMathFingerprint:function(){return{operations:xd(),constants:Ad(),floatingPoint:Rd()}},getFloatingPointBehavior:Rd,getMathConstants:Ad,getMathFingerprint:xd,isMathDetectionAvailable:function(){return"undefined"!=typeof Math}});function Od(){const e=atob;return{adBlock:["#ad-banner",".advertisement",e("I2FkLWNvbnRhaW5lcg=="),e("LmFkdmVydGlzZW1lbnQ="),e("W2NsYXNzKj0iYWQtIl0=")],uBlockOrigin:["#ublock-stats",".adsbygoogle",e("I2dvb2dsZV9hZHM="),e("LmFkc2J5Z29vZ2xl"),e("LnVibG9jay1ibG9ja2Vk")],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0"),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],privacyBadger:["#privacy-badger-popup",".privacy-badger-blocked",e("LnByaXZhY3ktYmFkZ2Vy")],ghostery:["#ghostery-popup",".ghostery-blocking",e("Lmdob3N0ZXJ5LWJsb2NrZWQ=")],brave:["#brave-ads-blocked",".brave-blocked",e("LmJyYXZlLWFkLWJsb2Nr")],facebookContainer:[".facebook-container-blocked",e("LmZiLWJsb2NrZWQ=")],cookieBlockers:[".cookie-notice-blocked","#cookie-banner-hidden",e("LmNvb2tpZS1ibG9ja2Vy")],trackingProtection:[".tracking-blocked","#tracking-protection-enabled",e("LnRyYWNrZXItYmxvY2tlZA==")]}}function _d(e){const t=document.createElement("div");if(e.startsWith("#"))t.id=e.substring(1);else if(e.startsWith("."))t.className=e.substring(1);else if(e.includes("["))try{const n=e.match(/\[([^=]+)([*^$|~]?=)"([^"]+)"\]/);if(n&&n[1]&&n[3]){const[,e,r,o]=n;"*="===r?t.setAttribute(e,`test-${o}-test`):t.setAttribute(e,o)}}catch{t.className="test-element"}else t.className=e.replace(/[^a-zA-Z0-9-_]/g,"");return t}function Dd(e){const t=e.style;t.setProperty("visibility","hidden","important"),t.setProperty("display","block","important"),t.setProperty("position","absolute","important"),t.setProperty("left","-9999px","important"),t.setProperty("width","1px","important"),t.setProperty("height","1px","important"),t.setProperty("pointer-events","none","important"),t.setProperty("z-index","-1","important")}function Pd(e){return new Promise(t=>setTimeout(t,e))}async function Ld(e){const t=document,n=t.createElement("div"),r=new Array(e.length),o={};Dd(n);const i=t.createDocumentFragment();for(let n=0;n<e.length;n++){const o=e[n];if(o)try{const e=_d(o),s=t.createElement("div");"DIALOG"===e.tagName&&e.show?.(),Dd(s),s.appendChild(e),i.appendChild(s),r[n]=e}catch(e){r[n]=void 0}}n.appendChild(i);let s=0;for(;!t.body&&s<100;)await Pd(50),s++;if(!t.body)throw new Error("Document body not available for DOM blockers detection");t.body.appendChild(n);try{await Pd(50),await new Promise(t=>{requestAnimationFrame(()=>{for(let t=0;t<e.length;t++){const n=r[t],i=e[t];n&&i&&!n.offsetParent&&(o[i]=!0)}t()})})}finally{try{n.parentNode&&n.parentNode.removeChild(n)}catch(e){setTimeout(()=>{try{n.parentNode&&n.parentNode.removeChild(n)}catch{}},0)}}return o}async function Nd(e={}){const{debug:t=!1,timeout:n=5e3}=e;try{if(!Fd())return t&&console.log("[RabbitTracker] DOM Blockers detection not applicable for this browser"),"BROWSER_INCOMPATIBLE";if(!document||!document.body)return t&&console.log("[RabbitTracker] DOM not ready for blockers detection"),"DOM_NOT_AVAILABLE";const e=Od(),r=Object.keys(e),o=[].concat(...r.map(t=>e[t]||[])),i=new Promise((e,t)=>{setTimeout(()=>t(new Error("DOM blockers detection timeout")),n)}),s=await Promise.race([Ld(o),i]);return t&&console.log("[RabbitTracker] DOM Blockers Debug:",{totalSelectors:o.length,blockedCount:Object.keys(s).length,blockedSelectors:s}),r.filter(t=>{const n=e[t];return!(!n||0===n.length)&&n.map(e=>s[e]).filter(Boolean).length>.6*n.length}).sort()}catch(e){if(t&&console.error("[RabbitTracker] DOM Blockers detection failed:",e),e instanceof Error){if(e.message.includes("timeout"))return"TIMEOUT";if("SecurityError"===e.name||e.message.includes("SecurityError"))return"SECURITY_ERROR"}return"NOT_SUPPORTED"}}function Fd(){return F().canRunDOMBlockers}var Bd=Object.freeze({__proto__:null,getBlockedSelectors:Ld,getBlockerFilters:Od,getDomBlockers:Nd,getDomBlockersFingerprint:async function(e={}){const t=await Nd(e),n=Array.isArray(t)?t:[];return{activeBlockers:n,blockerCount:n.length,hasAdBlocker:n.some(e=>["adBlock","uBlockOrigin","adGuardBase","easyList"].includes(e)),hasPrivacyExtension:n.some(e=>["privacyBadger","ghostery","brave"].includes(e)),hasTrackingProtection:n.includes("trackingProtection")}},isDomBlockersDetectionAvailable:Fd});function Ud(){try{return M()?navigator.pdfViewerEnabled??null:null}catch{return null}}function zd(){try{if(!R())return-1;const{ApplePaySession:e}=window;if("function"!=typeof e?.canMakePayments)return-1;if(!T())return-2;if(window.self!==window.top)return-3;try{return e.canMakePayments()?1:0}catch(e){if(e instanceof Error&&"InvalidAccessError"===e.name)return-2;throw e}}catch{return-1}}function Wd(){try{return"attributionReporting"in window||"privateClickMeasurement"in window||null}catch{return null}}function jd(){const e={enabled:!1,sameSiteSupport:!1,secureSupport:!1,partitionedSupport:!1};try{if(e.enabled=navigator.cookieEnabled,!e.enabled)return e;e.sameSiteSupport=Vd("__rb_test_samesite","SameSite=Strict"),T()&&(e.secureSupport=Vd("__rb_test_secure","Secure")),T()&&M()&&(e.partitionedSupport=Vd("__rb_test_partitioned","Partitioned; Secure; SameSite=None"))}catch{}return e}function Vd(e,t){try{const n="1",r=`${e}=${n}; ${t}; path=/`;document.cookie=r;const o=document.cookie.includes(`${e}=${n}`);return Zd(e),o}catch{return Zd(e),!1}}function Zd(e){try{const t=[`${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/`,`${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/; domain=${location.hostname}`,`${e}=; max-age=0; path=/`,`${e}=; max-age=0; path=/; domain=${location.hostname}`];for(const e of t)try{document.cookie=e}catch{}setTimeout(()=>{try{document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/`}catch{}},100)}catch{}}function Gd(){try{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");return t?(t.getSupportedExtensions()||[]).sort():[]}catch{return[]}}function Hd(){try{const e=performance.memory;return e?{usedJSHeapSize:e.usedJSHeapSize,totalJSHeapSize:e.totalJSHeapSize,jsHeapSizeLimit:e.jsHeapSizeLimit}:null}catch{return null}}function $d(){try{const e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return e?{effectiveType:e.effectiveType,downlink:e.downlink,rtt:e.rtt,saveData:e.saveData}:null}catch{return null}}function Xd(){const e={};try{e.webkitTemporaryStorage="webkitTemporaryStorage"in navigator,e.webkitPersistentStorage="webkitPersistentStorage"in navigator,window.safari&&(e.safariObjectTypes=Object.getOwnPropertyNames(window.safari)),e.chromeRuntime=!!window.chrome?.runtime,e.mozInnerScreenX="mozInnerScreenX"in window,e.msCredentials="msCredentials"in navigator}catch{}return e}var qd=Object.freeze({__proto__:null,getApplePayState:zd,getBrowserApisFingerprint:function(){const e=Ud(),t=zd(),n=Wd(),r=jd(),o=Gd(),i=Hd(),s=$d(),a=Xd();let c="unknown";a.chromeRuntime?c="chrome":-1!==t?c="safari":a.mozInnerScreenX?c="firefox":a.msCredentials&&(c="edge");const l=Boolean(e||t>-1||n||i||s),u=[null!==e,-1!==t,null!==n,r.enabled,o.length>0,null!==i,null!==s,Object.keys(a).length>0];return{pdfViewerEnabled:e,applePayState:t,privateClickMeasurement:n,cookieCapabilities:r,webglExtensions:o,performanceMemory:i,connectionInfo:s,vendorProperties:a,browserVendor:c,hasNativeFeatures:l,apiScore:Math.round(u.filter(Boolean).length/u.length*100)}},getConnectionInfo:$d,getCookieCapabilities:jd,getPdfViewerEnabled:Ud,getPerformanceMemory:Hd,getPrivateClickMeasurement:Wd,getVendorProperties:Xd,getWebGLExtensions:Gd,isBrowserApisDetectionAvailable:function(){return"undefined"!=typeof window&&"undefined"!=typeof navigator}});function Yd(){try{if(!ap())return"NOT_SUPPORTED";const e=function(){try{return navigator.plugins||null}catch(e){if("SecurityError"===e.name)return null;throw e}}();if(!e)return"NAVIGATOR_UNAVAILABLE";const t=[];if(0===e.length)return t;for(let n=0;n<e.length;n++){const r=e[n];if(!r)continue;const o=[];if(r.length>0)for(let e=0;e<r.length;e++){const t=r[e];t&&t.type&&o.push(t.type)}t.push({name:r.name||"",filename:r.filename||"",description:r.description||"",version:r.version||void 0,mimeTypes:o})}return t.sort((e,t)=>e.name.localeCompare(t.name))}catch(e){return"SecurityError"===e.name?"SECURITY_RESTRICTED":[]}}function Jd(){try{if(!navigator.mimeTypes||0===navigator.mimeTypes.length)return[];const e=[];for(let t=0;t<navigator.mimeTypes.length;t++){const n=navigator.mimeTypes[t];n&&n.type&&e.push(n.type)}return e.sort()}catch{return[]}}function Kd(){try{if(navigator.plugins&&Array.from(navigator.plugins).some(e=>e.name.toLowerCase().includes("flash")||e.description.toLowerCase().includes("flash")))return!0;if(navigator.mimeTypes&&Array.from(navigator.mimeTypes).some(e=>"application/x-shockwave-flash"===e.type))return!0;if(void 0!==window.ActiveXObject)try{return!!new window.ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch{return!1}return!1}catch{return!1}}function Qd(){try{if(navigator.plugins&&Array.from(navigator.plugins).some(e=>e.name.toLowerCase().includes("java")&&!e.name.toLowerCase().includes("javascript")))return!0;const e=["application/x-java-applet","application/x-java-bean","application/x-java-vm"];return!(!navigator.mimeTypes||!e.some(e=>Array.from(navigator.mimeTypes).some(t=>t.type===e)))||"function"==typeof navigator.javaEnabled&&navigator.javaEnabled()}catch{return!1}}function ep(){try{if(navigator.plugins&&Array.from(navigator.plugins).some(e=>e.name.toLowerCase().includes("silverlight")))return!0;if(navigator.mimeTypes&&Array.from(navigator.mimeTypes).some(e=>"application/x-silverlight"===e.type))return!0;if(void 0!==window.ActiveXObject)try{return!!new window.ActiveXObject("AgControl.AgControl")}catch{return!1}return!1}catch{return!1}}function tp(){try{if(!M())return"NOT_SUPPORTED";if(!navigator.plugins)return"NAVIGATOR_UNAVAILABLE";const e=navigator.plugins.length;return 0===e||!window.chrome?.runtime&&!window.chrome?.webstore&&void 0!==window.chrome||!Array.from(navigator.plugins).some(e=>e.name.toLowerCase().includes("pdf")||e.name.toLowerCase().includes("chrome"))&&e<3}catch(e){return"SecurityError"===e.name&&"SECURITY_RESTRICTED"}}function np(){try{if(!x())return"NOT_SUPPORTED";const e={mozInnerScreenX:"mozInnerScreenX"in window,mozPaintCount:"mozPaintCount"in window,mozApps:!!navigator.mozApps,buildID:!!navigator.buildID,oscpu:!!navigator.oscpu},t=Object.values(e).filter(Boolean).length;return 0===t||(navigator.plugins?0===navigator.plugins.length&&t<2:"NAVIGATOR_UNAVAILABLE")}catch(e){return"SecurityError"===e.name&&"SECURITY_RESTRICTED"}}function rp(e){const t=["antivirus","security","firewall","malware","protection","kaspersky","norton","mcafee","avast","avira","bitdefender","eset","sophos","symantec","trend micro","f-secure"];return e.filter(e=>t.some(t=>e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t))).map(e=>e.name)}function op(e){const t=["adblock","adblocker","ad block","ublock","ghostery","privacy badger","disconnect","noscript","tracking protection"];return e.filter(e=>t.some(t=>e.name.toLowerCase().includes(t)||e.description.toLowerCase().includes(t))).map(e=>e.name)}function ip(e,t,n,r){let o=50;return o+=10*e.length,o+=5*t.length,n&&(o-=15),r&&(o-=10),Math.max(0,Math.min(100,o))}function sp(e,t){const n=e.map(e=>e.name).sort(),r=t.slice(0,10).sort();return[`plugins:${n.length}`,`mimes:${t.length}`,...n.slice(0,5),...r.slice(0,5)].join("|")}function ap(){return F().canRunBrowserAPIs&&"undefined"!=typeof navigator}var cp=Object.freeze({__proto__:null,calculateSecurityScore:ip,detectChromeExtensionsBlocked:tp,detectFirefoxExtensionsBlocked:np,generatePluginSignature:sp,getEnhancedPluginFingerprint:function(){const e=Yd(),t=Array.isArray(e)?e:[],n=Jd(),r=Array.isArray(n)?n:[],o=Kd(),i=Qd(),s=ep(),a=tp(),c="boolean"==typeof a&&a,l=np(),u="boolean"==typeof l&&l,h=rp(t),d=op(t),p=sp(t,r),m=ip(h,d,o,i);return{plugins:t,pluginCount:t.length,mimeTypes:r,mimeTypeCount:r.length,flashEnabled:o,javaEnabled:i,silverLightEnabled:s,chromeExtensionsBlocked:c,firefoxExtensionsBlocked:u,securityPlugins:h,adBlockerPlugins:d,pluginSignature:p,securityScore:m}},getMimeTypes:Jd,getNavigatorPlugins:Yd,identifyAdBlockerPlugins:op,identifySecurityPlugins:rp,isEnhancedPluginDetectionAvailable:ap,testFlashEnabled:Kd,testJavaEnabled:Qd,testSilverlightEnabled:ep});const lp={canvas:{stability:.95,entropy:.9,uniqueness:.85,spoofResistance:.8},webgl:{stability:.92,entropy:.88,uniqueness:.82,spoofResistance:.85},audio:{stability:.9,entropy:.85,uniqueness:.8,spoofResistance:.9},hardware:{stability:.98,entropy:.7,uniqueness:.75,spoofResistance:.95},screen:{stability:.85,entropy:.6,uniqueness:.65,spoofResistance:.7},system:{stability:.8,entropy:.65,uniqueness:.7,spoofResistance:.6},browser:{stability:.75,entropy:.6,uniqueness:.65,spoofResistance:.5},fonts:{stability:.7,entropy:.75,uniqueness:.7,spoofResistance:.4},math:{stability:.95,entropy:.8,uniqueness:.9,spoofResistance:.95},storage:{stability:.6,entropy:.5,uniqueness:.6,spoofResistance:.3},incognito:{stability:.5,entropy:.4,uniqueness:.3,spoofResistance:.2},domBlockers:{stability:.8,entropy:.7,uniqueness:.6,spoofResistance:.9},accessibility:{stability:.9,entropy:.6,uniqueness:.7,spoofResistance:.85},browserApis:{stability:.85,entropy:.75,uniqueness:.8,spoofResistance:.7},pluginsEnhanced:{stability:.7,entropy:.65,uniqueness:.75,spoofResistance:.5},mathFingerprint:{stability:.99,entropy:.95,uniqueness:.9,spoofResistance:.98},fontPreferences:{stability:.92,entropy:.88,uniqueness:.85,spoofResistance:.75},dateTimeLocale:{stability:.95,entropy:.7,uniqueness:.75,spoofResistance:.8},accessibilityEnhanced:{stability:.93,entropy:.65,uniqueness:.8,spoofResistance:.9},enhancedFonts:{stability:.88,entropy:.85,uniqueness:.82,spoofResistance:.7}},up={domBlockers:{stability:.8,entropy:.7,uniqueness:.6,spoofResistance:.9},accessibility:{stability:.9,entropy:.6,uniqueness:.7,spoofResistance:.85},browserApis:{stability:.85,entropy:.75,uniqueness:.8,spoofResistance:.7}};function hp(e){const t=lp[e]||up[e];if(!t)return.5;const n=.3*t.stability+.25*t.entropy+.25*t.uniqueness+.2*t.spoofResistance;return Math.max(.1,Math.min(1,n))}var dp=Object.freeze({__proto__:null,ADVANCED_COMPONENT_CHARACTERISTICS:up,COMPONENT_CHARACTERISTICS:lp,calculateComponentWeight:hp,calculateConfidence:function(e,t={}){const{requireMinimumComponents:n=4,penalizeMissingCore:r=!0,adjustForIncognito:o=!0}=t,i=e.filter(e=>e.success),s=[];i.length<n&&s.push(`Collect at least ${n} components for reliable identification`);let a=0,c=0,l=0,u=0,h=0;const d=["canvas","webgl","audio","hardware"].filter(e=>!i.some(t=>t.component===e));for(const e of i){const t=hp(e.component),n=lp[e.component]||up[e.component];n&&(a+=t,c+=n.stability*t,l+=n.entropy*t,u+=n.uniqueness*t,h+=n.spoofResistance*t)}const p=a>0?c/a:0,m=a>0?l/a:0,f=a>0?h/a:0;let g,y,w=.35*p+.25*m+.25*(a>0?u/a:0)+.15*f,b=w;return r&&d.length>0&&(b-=.1*d.length,s.push(`Missing core components: ${d.join(", ")}`)),i.length<6&&(b-=.05*(6-i.length)),o&&i.some(e=>"incognito"===e.component)&&(b+=.02),i.filter(e=>["domBlockers","accessibility","browserApis","math"].includes(e.component)).length>=2&&(b+=.05),b=Math.max(0,Math.min(1,b)),b>=.995?(g=.995,y="Very High"):b>=.99?(g=.99,y="High"):b>=.95?(g=.95,y="Medium"):b>=.8?(g=.8,y="Low"):(g=.5,y="Very Low",s.push("Consider implementing additional fingerprinting techniques")),b<.95&&s.push("Enable all available fingerprinting components for better accuracy"),f<.6&&s.push("Include more spoof-resistant components like audio and WebGL"),m<.6&&s.push("Add high-entropy components like canvas and math fingerprinting"),{score:g,level:y,factors:{componentCount:i.length,weightedScore:Math.round(1e3*w)/1e3,stabilityScore:Math.round(1e3*p)/1e3,entropyScore:Math.round(1e3*m)/1e3,spoofResistanceScore:Math.round(1e3*f)/1e3},recommendations:s.slice(0,3)}}});function pp(){try{const e=screen,t=e.availTop??0,n=e.availLeft??0,r=e.availWidth??e.width,o=e.availHeight??e.height,i=t||null,s=e.width-r-n||null,a=e.height-o-t||null,c=n||null;if(null===i&&null===s&&null===a&&null===c)return null;const l=e=>null===e?null:10*Math.round(e/10);return{top:l(i),right:l(s),bottom:l(a),left:l(c)}}catch{return null}}function mp(){try{const e=navigator.platform?.toLowerCase()||"",t=navigator.userAgent?.toLowerCase()||"";if(e.includes("win")&&(t.includes("wow64")||t.includes("x64")||t.includes("x86_64")))return 0;if(e.includes("linux")&&(e.includes("x86_64")||t.includes("x86_64")))return 0;if(e.includes("mac")&&(e.includes("intel")||t.includes("intel mac")))return 0;if(e.includes("x86")||e.includes("x64")||e.includes("intel")||e.includes("amd64")||t.includes("x86")||t.includes("amd64"))return 0;if(e.includes("arm")||t.includes("arm")||t.includes("aarch64")||e.includes("aarch64"))return 255;try{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(t&&"getExtension"in t&&"getParameter"in t){const e=t.getExtension("WEBGL_debug_renderer_info");if(e){const n=t.getParameter(e.UNMASKED_VENDOR_WEBGL)?.toLowerCase()||"",r=t.getParameter(e.UNMASKED_RENDERER_WEBGL)?.toLowerCase()||"";if(n.includes("intel")||n.includes("nvidia")||n.includes("amd")||r.includes("intel")||r.includes("nvidia")||r.includes("amd")||r.includes("radeon")||r.includes("geforce")||r.includes("quadro")||r.includes("iris")||r.includes("uhd")||r.includes("hd graphics"))return 0;if(r.includes("mali")||r.includes("adreno")||r.includes("powervr")||r.includes("tegra")||r.includes("apple gpu")||n.includes("arm")||r.includes("videocore"))return 255}}}catch{}try{const t=new Float32Array(1),n=new Uint8Array(t.buffer);t[0]=1/0,t[0]=t[0]-t[0];const r=n[3];return e.includes("linux"),r}catch{return}}catch{return}}function fp(){try{const e=navigator;let t=0;void 0!==e.maxTouchPoints?t=e.maxTouchPoints:void 0!==e.msMaxTouchPoints&&(t=e.msMaxTouchPoints);let n=!1;try{document.createEvent("TouchEvent"),n=!0}catch{n=!1}return{maxTouchPoints:t,touchEvent:n,touchStart:"ontouchstart"in window}}catch{return}}function gp(){const e=[],t=["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"];for(const n of t){const t=window[n];t&&"object"==typeof t&&e.push(n)}return e.sort()}function yp(){try{const e=navigator.deviceMemory;if("number"==typeof e)return Math.round(e);if("string"==typeof e){const t=parseFloat(e);return isNaN(t)?void 0:Math.round(t)}return}catch{return}}function wp(){try{return screen.colorDepth||void 0}catch{return}}function bp(){try{for(const e of["rec2020","p3","srgb"])if(window.matchMedia(`(color-gamut: ${e})`).matches)return e;return}catch{return}}var vp=Object.freeze({__proto__:null,collectDeviceSignals:function(){return{screenFrame:pp(),hardwareConcurrency:navigator.hardwareConcurrency||void 0,deviceMemory:yp(),architecture:mp(),touchSupport:fp(),vendorFlavors:gp(),cpuClass:navigator.cpuClass||void 0,colorDepth:wp(),colorGamut:bp()}}});return e.Zaplier=Lh,e.ZaplierSDK=Dh,e.analyzeUserAgent=function(e){const t=e||navigator.userAgent||"",n=function(e){const t=e.toLowerCase();if(t.includes("edg/")){const t=cd(e,/edg\/([0-9.]+)/i);return{name:"Edge",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("edge/")){const t=cd(e,/edge\/([0-9.]+)/i);return{name:"Edge Legacy",version:t,major:t.split(".")[0]||"Unknown",engine:"edgehtml"}}if(t.includes("brave/")||navigator.brave){const t=cd(e,/chrome\/([0-9.]+)/i);return{name:"Brave",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(id()){const t=cd(e,/samsungbrowser\/([0-9.]+)/i);return{name:"Samsung Internet",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("chrome/")&&!t.includes("edg")){const t=cd(e,/chrome\/([0-9.]+)/i);return{name:"Chrome",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("firefox/")){const t=cd(e,/firefox\/([0-9.]+)/i);return{name:"Firefox",version:t,major:t.split(".")[0]||"Unknown",engine:"gecko"}}if(t.includes("safari/")&&!t.includes("chrome")){const t=cd(e,/version\/([0-9.]+)/i);return{name:"Safari",version:t,major:t.split(".")[0]||"Unknown",engine:"webkit"}}if(t.includes("opr/")||t.includes("opera/")){const t=cd(e,/(?:opr|opera)\/([0-9.]+)/i);return{name:"Opera",version:t,major:t.split(".")[0]||"Unknown",engine:nd()?"chromium":"unknown"}}if(t.includes("vivaldi/")){const t=cd(e,/vivaldi\/([0-9.]+)/i);return{name:"Vivaldi",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("yabrowser/")){const t=cd(e,/yabrowser\/([0-9.]+)/i);return{name:"Yandex Browser",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("msie")||t.includes("trident/")){const t=cd(e,/(?:msie |rv:)([0-9.]+)/i);return{name:"Internet Explorer",version:t,major:t.split(".")[0]||"Unknown",engine:"trident"}}if(t.includes("ucbrowser/")){const t=cd(e,/ucbrowser\/([0-9.]+)/i);return{name:"UC Browser",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("qqbrowser/")){const t=cd(e,/qqbrowser\/([0-9.]+)/i);return{name:"QQ Browser",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}return{name:"Unknown",version:"Unknown",major:"Unknown",engine:"unknown"}}(t),r=function(e){const t=e.toLowerCase();if(t.includes("windows nt")){const t=cd(e,/windows nt ([0-9.]+)/i);let n="Windows";switch(t){case"10.0":n="Windows 10/11";break;case"6.3":n="Windows 8.1";break;case"6.2":n="Windows 8";break;case"6.1":n="Windows 7";break;case"6.0":n="Windows Vista";break;case"5.1":n="Windows XP";break;default:n="Windows"}return{name:n,version:t,family:"windows"}}return t.includes("mac os x")||t.includes("macos")?{name:"macOS",version:cd(e,/mac os x ([0-9._]+)/i).replace(/_/g,"."),family:"macos"}:t.includes("iphone")||t.includes("ipad")||t.includes("ipod")||sd()?{name:"iOS",version:cd(e,/os ([0-9._]+)/i).replace(/_/g,"."),family:"ios"}:ad()?{name:"Android",version:cd(e,/android ([0-9.]+)/i),family:"android"}:t.includes("linux")?{name:"Linux",version:"Unknown",family:"linux"}:t.includes("cros")?{name:"Chrome OS",version:cd(e,/cros [a-z0-9_]+ ([0-9.]+)/i),family:"linux"}:t.includes("freebsd")?{name:"FreeBSD",version:"Unknown",family:"unix"}:{name:"Unknown",version:"Unknown",family:"unknown"}}(t),o=ld(t),i=function(e){const t=[];let n="legitimate";const r=["bot","crawler","spider","scraper","automation","headless","phantom","selenium","webdriver","google","bing","yahoo","baidu","yandex","facebook","twitter","linkedin","whatsapp"];for(const o of r)e.toLowerCase().includes(o)&&(t.push(o),["bot","crawler","spider","scraper"].some(e=>o.includes(e))?n="crawler":["selenium","webdriver","automation"].some(e=>o.includes(e))?n="automation":["headless","phantom"].some(e=>o.includes(e))&&(n="headless"));return e.length<10&&t.push("too_short"),e&&"Mozilla/5.0"!==e||t.push("generic_mozilla"),{isBot:t.length>0,patterns:t,category:n}}(t);return{browser:{name:n.name,version:n.version,major:n.major,engine:n.engine},os:{name:r.name,version:r.version,family:r.family},device:{type:o.type,vendor:o.vendor,model:o.model},suspicious:{isBot:i.isBot,patterns:i.patterns,category:i.category},isMobile:"mobile"===o.type,isTablet:"tablet"===o.type,isDesktop:"desktop"===o.type,isBot:i.isBot,raw:t}},e.autoInitializeFromScript=Nh,e.clearFingerprintCache=function(){it.clear()},e.collectFingerprint=lt,e.default=Dh,e.detectBot=async function(){const e={webDriver:Uh(),headlessBrowser:zh(),automationTools:Wh(),domBlockers:jh(),missingLanguages:Vh(),inconsistentEval:Zh(),humanBehavior:{detected:!1,confidence:0,method:"not_implemented"},mouseMovement:{detected:!1,confidence:0,method:"not_implemented"},clickPatterns:{detected:!1,confidence:0,method:"not_implemented"},canvasInconsistency:{detected:!1,confidence:0,method:"not_implemented"},webglAnomaly:{detected:!1,confidence:0,method:"not_implemented"},missingPlugins:{detected:0===navigator.plugins.length,confidence:30,method:"plugin_count"},inconsistentProperties:{detected:!1,confidence:0,method:"not_implemented"},modifiedBuiltins:{detected:!1,confidence:0,method:"not_implemented"}},t=Gh(),n=Object.values(e).filter(e=>e.detected),r=n.reduce((e,t)=>e+t.confidence,0),o=n.length>0?r/n.length:0,i=n.length>=2||n.some(e=>e.confidence>=90)||(t.suspicious?.isBot??!1);let s="low";return o>=70?s="high":(o>=40||n.length>=2)&&(s="medium"),{isBot:i,confidence:Math.round(Math.min(o,95)),riskLevel:s,detectionMethods:Object.keys(e).filter(t=>e[t]?.detected),detectors:e,userAgent:t}},e.detectIncognitoMode=async function(){!function(){const e=navigator.userAgent.toLowerCase();e.includes("chrome")||e.includes("firefox")||e.includes("safari")||e.includes("edge")}();const e=navigator.userAgent,t=/Chrome/.test(e)&&!/Edg|OPR/.test(e),n=/Safari/.test(e)&&!/Chrome/.test(e),r=/Firefox/.test(e),o=/Edg/.test(e),i=2e3,[s,a,c,l,u,h,d,p,m]=await Promise.allSettled([Promise.race([Hh(),td(i,"localStorage")]),Promise.race([$h(),td(i,"sessionStorage")]),Promise.race([Xh(),td(i,"indexedDB")]),Promise.race([qh(),td(i,"permissions")]),Promise.race([Yh(),td(i,"quotaManagement")]),Promise.race([Qh(),td(i,"filesystem")]),Promise.race([ed(),td(i,"cacheDetection")]),Promise.race([Jh(),td(i,"chromeSpecific")]),Promise.race([Kh(),td(i,"safariSpecific")])]),f=[];[{name:"localStorage",result:s},{name:"sessionStorage",result:a},{name:"indexedDB",result:c},{name:"permissions",result:l},{name:"quotaManagement",result:u},{name:"filesystem",result:h},{name:"cacheDetection",result:d},{name:"chromeSpecific",result:p},{name:"safariSpecific",result:m}].forEach(({name:e,result:i})=>{if("fulfilled"===i.status&&i.value.detected){const s=function(e,t,n){const r=Math.floor(.5*n);switch(e){case"quotaManagement":return t.isChrome||t.isEdge?Math.min(50,r+25):t.isSafari?Math.min(40,r+15):Math.min(30,r+10);case"filesystem":return t.isChrome||t.isEdge?Math.min(40,r+20):Math.max(5,r-5);case"indexedDB":return t.isFirefox?Math.min(45,r+20):t.isSafari?Math.min(35,r+10):r;case"localStorage":return Math.max(5,r-15);case"sessionStorage":return Math.max(5,r-10);case"permissions":return t.isChrome?Math.min(30,r+10):Math.max(5,r-5);case"cacheDetection":return Math.max(5,r-20);case"chromeSpecific":return t.isChrome?Math.min(50,r+30):0;case"safariSpecific":return t.isSafari?Math.min(45,r+25):0;default:return Math.max(5,r)}}(e,{isChrome:t,isSafari:n,isFirefox:r,isEdge:o},i.value.confidence);f.push({method:i.value.method,confidence:i.value.confidence,weight:s})}});const g=f.reduce((e,t)=>e+t.weight,0),y=f.reduce((e,t)=>e+t.confidence*t.weight/100,0);let w;w=n?35:t||o?45:r?40:50;const b=g>=w,v=g>0?Math.min(95,y/g*100):0,S="fulfilled"===s.status?s.value:{detected:!1},C="fulfilled"===a.status?a.value:{detected:!1},k="fulfilled"===c.status?c.value:{detected:!1},I="fulfilled"===l.status?l.value:{},E="fulfilled"===u.status?u.value:{detected:!1};return"fulfilled"===h.status&&h.value,"fulfilled"===d.status&&d.value,"undefined"!=typeof window&&window.RabbitTracker?.config?.debug&&console.debug("Incognito Detection Analysis:",{browserInfo:{isChrome:t,isSafari:n,isFirefox:r,isEdge:o},detectedSignals:f,totalWeight:g,minWeightThreshold:w,finalConfidence:v,isDetected:b}),{isIncognito:b,confidence:Math.round(v),detectionMethods:f.map(e=>e.method),details:{localStorage:S?.detected??!1,sessionStorage:C?.detected??!1,indexedDB:k?.detected??!1,cookiesEnabled:!1,quota:E?.detected?0:null,permissions:I?.details||{}}}},e.generateVisitorId=l,e.generateVisitorIdFromFingerprint=function(e){return l(e.hash)},e.getAvailableComponents=function(){const e=[];return Z()&&e.push("canvas"),ge()&&e.push("webgl"),w()&&e.push("audio"),J()&&e.push("fonts"),ee()&&e.push("screen"),U()&&e.push("browser"),e},e.getBrowserEngine=function(){return nd()?"chromium":rd()?"webkit":od()?"gecko":navigator.userAgent.toLowerCase().includes("trident")?"trident":"unknown"},e.getCompleteFingerprint=ht,e.getLightweightFingerprint=ut,e.hash32=a,e.hashFingerprint=c,e.isAndroid=ad,e.isChromium=nd,e.isDesktop=function(){return"desktop"===ld(navigator.userAgent).type},e.isFingerprintingAvailable=function(){return ee()&&U()},e.isGecko=od,e.isIPad=sd,e.isMobile=function(){return"mobile"===ld(navigator.userAgent).type},e.isSamsungInternet=id,e.isTablet=function(){return"tablet"===ld(navigator.userAgent).type},e.isWebKit=rd,e.quickBotDetection=async function(){const e=Uh(),t=Gh();return e.detected||(t.suspicious?.isBot??!1)},e.quickIncognitoDetection=async function(){try{const[e,t]=await Promise.all([Hh(),Xh()]);return e.detected||t.detected}catch{return!1}},e.x64hash128=s,Object.defineProperty(e,"__esModule",{value:!0}),e}({});