@zaplier/sdk 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,i=65535&t[1],r=t[1]>>>16,a=n*r+o*i&4294967295,s=o*r+(a>>>16),c=n*i+((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 i(e,t){return[e[0]^t[0],e[1]^t[1]]}function r(e){let t=e;return t=i(t,[0,t[0]>>>1]),t=n(t,[4283543511,3981806797]),t=i(t,[0,t[0]>>>1]),t=n(t,[3301882366,444984403]),t=i(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],u=[0,a];const d=[2277735313,289559509],h=[1291169091,658871167];for(let e=0;e<c;e++){const r=4*e,a=4*e+2;let c=[s[r+1]||0,s[r]||0],m=[s[a+1]||0,s[a]||0];c=n(c,d),c=o(c,31),c=n(c,h),l=i(l,c),l=o(l,27),l=t(l,u),l=t(n(l,[0,5]),[0,1390208809]),m=n(m,h),m=o(m,33),m=n(m,d),u=i(u,m),u=o(u,31),u=t(u,l),u=t(n(u,[0,5]),[0,944331445])}const m=4*c,g=s.length-m;let p=[0,0],f=[0,0];return g>=12&&(f=i(f,[s[m+3]||0,0])),g>=8&&(f=i(f,[0,s[m+2]||0]),f=n(f,h),f=o(f,33),f=n(f,d),u=i(u,f)),g>=4&&(p=i(p,[s[m+1]||0,0])),g>=1&&(p=i(p,[0,s[m]||0]),p=n(p,d),p=o(p,31),p=n(p,h),l=i(l,p)),l=i(l,[0,e.length]),u=i(u,[0,e.length]),l=t(l,u),u=t(u,l),l=r(l),u=r(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 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=d(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 i=a(o);return t&&console.log("[RabbitTracker] Generated fingerprintHash:",i.substring(0,32)),i}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 d(e){if(null==e)return null;if(Array.isArray(e))return e.map(e=>d(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(u(o))continue;const t=d(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(),i=["sine","square","sawtooth","triangle"],r=i[n%i.length];return o.type=r||"sine",o.frequency.setValueAtTime(t,e.currentTime),o}),n=e.createDynamicsCompressor(),o=e.createBiquadFilter(),i=e.createGain(),r=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),i.gain.setValueAtTime(h.GAIN_VALUE,e.currentTime),r.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(i),i.connect(r),r.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),u=[];for(let e=0;e<32;e++){const t=Math.floor(l.length/32*e);u.push(l[t]||0)}const d=Math.sqrt(u.reduce((e,t)=>e+t*t,0)/u.length),m=Math.max(...u.map(Math.abs)),g=u.reduce((e,t)=>e+Math.abs(t),0)/u.length;let p=0;for(let e=0;e<Math.min(u.length,16);e++){const t=u[e];void 0!==t&&(p+=e*Math.abs(t))}return s([...u,d,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(),i=e.createAnalyser();t.type="sine",t.frequency.setValueAtTime(o,e.currentTime),i.fftSize=256,i.smoothingTimeConstant=0,t.connect(i),i.connect(e.destination),t.start(),t.stop(.05);const r=m();if(r){const e=r.createOscillator();e.type="sine",e.frequency.setValueAtTime(o,r.currentTime),e.connect(r.destination),e.start(),e.stop(.05);try{const e=(await r.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 w(){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[i,r,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([i,r,a,t.toString(),JSON.stringify(n),JSON.stringify(c)].join("|")),u=performance.now();return{value:{oscillator:i,compressor:r,sampleRate:t,maxChannelCount:n.supportedSampleRates?.length||2,multiOscillatorFingerprint:i,frequencyResponseFingerprint:a,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 y(){try{return"function"==typeof(window.OfflineAudioContext||window.webkitOfflineAudioContext)||"function"==typeof(window.AudioContext||window.webkitAudioContext)}catch{return!1}}function v(){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 k(){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 E(){try{if(window.opr||window.opera)return!0;const e=navigator.userAgent;return!(!e.includes("OPR/")&&!e.includes("Opera/"))}catch{return!1}}function _(){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 M(){try{return!(S()||k()||E()||_()||C()||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 T(){try{return"InstallTrigger"in window||"mozInnerScreenX"in window||"mozPaintCount"in window||Boolean(navigator.mozApps)}catch{return!1}}function C(){try{return"msCredentials"in navigator||Boolean(window.StyleMedia)||M()&&/edg/i.test(navigator.userAgent)}catch{return!1}}function x(){try{return v()&&!M()&&!C()&&Boolean(window.safari)&&/safari/i.test(navigator.userAgent)}catch{return!1}}function R(){try{return window.isSecureContext||"https:"===location.protocol}catch{return!1}}function D(){try{return"webkitTemporaryStorage"in navigator||navigator.storage&&navigator.storage.estimate&&navigator.storage.estimate().then(e=>(e.quota||0)<104857600),!1}catch{return!1}}function I(){return S()||k()||E()||_()||A()||M()?"Blink":C()?"EdgeHTML/Blink":T()?"Gecko":v()||x()?"WebKit":"Unknown"}function P(){const e=function(){try{if(S())return"Brave";if(k())return"Arc";if(E())return"Opera";if(_())return"Vivaldi";if(A())return"Samsung Internet";if(C())return"Edge";if(T())return"Firefox";if(x())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=I(),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 L(){try{return"undefined"!=typeof document&&"function"==typeof document.createElement&&void 0!==document.body}catch{return!1}}function O(){try{if(!L())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),i=Boolean(o&&"string"==typeof o),r=n.getExtension("WEBGL_lose_context");return r&&r.loseContext(),i}catch{return!1}}function N(){try{return!(!window.AudioContext&&!window.webkitAudioContext)}catch{return!1}}function F(){const e=L(),t=function(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia}catch{return!1}}();return{engine:I(),supportsDOM:e,supportsMediaQueries:t,supportsWebGL:O(),supportsAudio:N(),isSecure:R(),isPrivateMode:D(),canRunDOMBlockers:(v()||b())&&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?"-":"+",o=Math.floor(Math.abs(t)/60),i=Math.abs(t)%60;e=`UTC${n}${o.toString().padStart(2,"0")}:${i.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:""}}}(),i=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}}}(),r=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 P()}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:o.platform,userAgent:o.userAgent,browserInfo:c,hardwareConcurrency:i.hardwareConcurrency,cookieEnabled:r.cookieEnabled,doNotTrack:r.doNotTrack,plugins:a,touchSupport:s};return void 0!==i.deviceMemory&&(u.deviceMemory=i.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 V=["Zap Canvas 🎨🔒2024","Żółć gęślą jaźń €$¢£¥","αβγδεζηθικλμνξο","中文测试字体渲染","🌟🎯🚀💎🌊🎨"];function z(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 H(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"],i=["left","center","right"];let r=250;V.forEach((a,s)=>{t.forEach((t,c)=>{const l=(s+c)%n.length,u=c%o.length,d=c%i.length;e.font=t,e.fillStyle=n[l]||n[0],e.textBaseline=o[u]||"top",e.textAlign=i[d]||"left";const h=10+.7*c%200,m=r+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))}),r+=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 W(){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");H(n);const i=s(t.toDataURL("image/png"));n.clearRect(0,0,t.width,t.height),z(n);const r=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,i=0,r=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,i+=c,r+=l,s++,e>=16)){const o=n[e-16]||0,i=Math.abs(t-o);i>=8&&(a+=i)}}if(0===s)return"no-valid-pixels";return`${10*Math.round(o/s/10)}-${10*Math.round(i/s/10)}-${10*Math.round(r/s/10)}-${10*Math.round(a/s/10)}`}catch(e){return"subpixel-error"}}(n,t),c=function(e,t,n,o){const i=[];let r=0;try{const a=o.getImageData(0,0,1,1);a&&0!==a.data.length||(i.push("getImageData-blocked"),r+=3),(e.length<8||t.length<8)&&(i.push("short-hash"),r+=2);const s=["error","blocked","disabled","00000000","ffffffff","12345678"];(s.includes(e)||s.includes(t))&&(i.push("known-blocked-hash"),r+=3),("subpixel-error"===n||n.includes("0-0-0"))&&(i.push("subpixel-anomaly"),r+=2),e===t&&"error"!==e&&(i.push("identical-hashes"),r+=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&&(i.push("slow-canvas"),r+=1)}return{isInconsistent:r>=2,confidence:Math.min(r/5,1),reasons:i}}catch(e){return{isInconsistent:!0,confidence:1,reasons:["detection-error"]}}}(i,r,a,n);n.clearRect(0,0,t.width,t.height),H(n),n.globalCompositeOperation="multiply",z(n),n.globalCompositeOperation="source-over";const l=s(t.toDataURL("image/png")),u=performance.now();return{value:{text:i,geometry:r,winding:o,isInconsistent:c.isInconsistent,subPixelAnalysis:a,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 q(){try{const e=document.createElement("canvas").getContext("2d");return null!==e&&"function"==typeof e.fillText}catch{return!1}}const j=["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"],Z=["monospace","sans-serif","serif"],G="mmMwWLliI0O&1 ※";function $(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(),i={width:o.width,height:o.height};return document.body.removeChild(n),i}function K(e,t="canvas"){const n="canvas"===t?$:X,o=Z.map(e=>n(G,e)),i=Z.map(t=>n(G,`${e}, ${t}`));for(let e=0;e<o.length;e++){const t=o[e],n=i[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 Y(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,o=function(){try{return window.devicePixelRatio||1}catch{return 1}}(),i=function(){try{const e=screen.availWidth||0,t=screen.availHeight||0;return 0===e&&0===t?{width:Y(screen.width||0),height:Y(screen.height||0)}:{width:Y(e),height:Y(t)}}catch{return{width:Y(screen.width||0),height:Y(screen.height||0)}}}(),r=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:Y(t),height:Y(n)}}catch{const e=window.innerWidth||0,t=window.innerHeight||0;return{width:Y(e),height:Y(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:i.width,availableHeight:i.height,viewportWidth:r.width,viewportHeight:r.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 ie(){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;re()}else re();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 re(),null}}function re(){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=ie();if(!e)return[];try{const t=e.getSupportedExtensions();return t?Array.from(t).sort():[]}catch{return[]}}function ce(){const e=ie();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{re(),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 ue=Object.freeze({__proto__:null,cleanupWebGLCache:le,forceCleanupWebGL:function(){re(),ne=0},getCachedWebGLContext:ie,getCachedWebGLExtensions:se,getCachedWebGLParameters:ce,invalidateWebGLCache:re,isWebGLContextValid:ae});const de={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",i=`${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 r=0;for(let e=0;e<i.length;e++)r=(r<<5)-r+i.charCodeAt(e)&4294967295;return`fallback_${Math.abs(r).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=ie();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",i=n.RENDERER||"unknown",r=n.VERSION||"unknown";let a=o,s=i;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(de).forEach(([n,o])=>{const i=function(e,t){try{return e.getParameter(t)}catch{return null}}(e,o);null!==i&&(t[n]=Array.isArray(i)?i.join(","):i)}),["UNMASKED_VENDOR_WEBGL","UNMASKED_RENDERER_WEBGL"].forEach(n=>{try{const o=e.getExtension("WEBGL_debug_renderer_info");if(o){const i=o[n];if(void 0!==i){const o=e.getParameter(i);o&&(t[n]=o)}}}catch{}}),t}(t),u=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],i=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"];for(let r=0;r<o.length;r++){const a=o[r];if(void 0===a)continue;const s=e.getShaderPrecisionFormat(e.VERTEX_SHADER,a),c=e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,a);s&&t.push(`${i[r]}:${s.precision},${s.rangeMin},${s.rangeMax}`),c&&n.push(`${i[r]}:${c.precision},${c.rangeMin},${c.rangeMax}`)}}catch{}return{vertex:t.join(";"),fragment:n.join(";")}}(t),d=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),i=he(e,e.FRAGMENT_SHADER,n);if(!o||!i)return me(e);const r=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,i);if(!r)return me(e);e.useProgram(r);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(r,"a_position"),l=e.getAttribLocation(r,"a_color"),u=e.getUniformLocation(r,"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 d=new Uint8Array(e.canvas.width*e.canvas.height*4);e.readPixels(0,0,e.canvas.width,e.canvas.height,e.RGBA,e.UNSIGNED_BYTE,d);let h=0;for(let e=0;e<d.length;e+=4){const t=1*(d[e]??0);h=33*h+(t+256*(d[e+1]??0)+65536*(d[e+2]??0)+16777216*(d[e+3]??0))>>>0}return e.deleteProgram(r),e.deleteShader(o),e.deleteShader(i),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 i=e.getExtension("OES_texture_half_float");t.halfFloatTextures=!!i;const r=e.getParameter(e.COMPRESSED_TEXTURE_FORMATS);t.compressedTextureFormats=Array.isArray(r)?r.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||i||""}`.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:r,extensions:c,parameters:l,shaderPrecision:u,renderHash:d,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 we(){try{for(const e of["rec2020","p3","srgb"]){const t=xe(`(color-gamut: ${e})`);if(t?.matches)return e}return"unknown"}catch{return"unknown"}}function ye(){try{const e=xe("(forced-colors: active)");if(e?.matches)return!0;const t=xe("(forced-colors: none)");return!t?.matches&&null}catch{return null}}function ve(){try{const e=["no-preference","high","more","low","less","forced"];for(const t of e){const e=xe(`(prefers-contrast: ${t})`);if(e?.matches)return"high"===t?"more":"low"===t?"less":t}return"unknown"}catch{return"unknown"}}function be(){try{const e=xe("(prefers-reduced-motion: reduce)");if(e?.matches)return!0;const t=xe("(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 ke(){try{for(let e=8;e>=0;e--)if(matchMedia(`(monochrome: ${e})`).matches)return e;return 0}catch{return 0}}function Ee(){try{return!!matchMedia("(inverted-colors: inverted)").matches||!matchMedia("(inverted-colors: none)").matches&&null}catch{return null}}function _e(){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 Me(){try{return matchMedia("(hover: hover)").matches?"hover":matchMedia("(hover: none)").matches?"none":"unknown"}catch{return"unknown"}}function Te(){try{return matchMedia("(pointer: fine)").matches?"fine":matchMedia("(pointer: coarse)").matches?"coarse":matchMedia("(pointer: none)").matches?"none":"unknown"}catch{return"unknown"}}function Ce(){return F().canRunAccessibility}function xe(e){try{return Ce()?matchMedia(e):null}catch(e){return null}}function Re(){try{return!!matchMedia("(prefers-reduced-data: reduce)").matches||!matchMedia("(prefers-reduced-data: no-preference)").matches&&null}catch{return null}}function De(){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 Ie(){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 Pe(){try{return!!matchMedia("(any-hover: hover)").matches||!matchMedia("(any-hover: none)").matches&&null}catch{return null}}function Le(){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 Oe(){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=we(),t=ye(),n=ve(),o=be(),i=Se(),r=ke(),a=Ee(),s=_e(),c=Ae(),l=Me(),u=Te(),d=Re(),h=De(),m=Ie(),g=Pe(),p=Le(),f=Oe(),w=Boolean(t||o||i||a||d||"no-preference"!==n||"no-preference"!==f||r>0),y=[e,s?"hdr":"sdr",`${c}bit`,r>0?`mono${r}`:"color",f,h,m].join("-"),v=[l,u,g?"anyhover":"nohover",p].join("-");return{colorGamut:e,forcedColors:t,contrastPreference:n,reducedMotion:o,reducedTransparency:i,monochromeDepth:r,invertedColors:a,hdrSupport:s,enhancedColorDepth:c,hoverCapability:l,pointerCapability:u,reducedData:d,displayMode:h,environmentBlending:m,anyHover:g,anyPointer:p,colorScheme:f,hasAccessibilityFeatures:w,displayCapabilities:y,interactionCapabilities:v}}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,o=[null!==e.reducedData,"unknown"!==e.displayMode,"unknown"!==e.environmentBlending,"unknown"!==e.colorScheme,null!==e.hdrSupport],i=o.filter(Boolean).length/o.length,r=[!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=r.filter(Boolean).length/r.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*i)/100}}var Be=Object.freeze({__proto__:null,analyzeAccessibilityFingerprint:Fe,getAccessibilityFingerprint:Ne,getAnyHover:Pe,getAnyPointer:Le,getColorGamut:we,getColorScheme:Oe,getContrastPreference:ve,getDisplayMode:De,getEnhancedColorDepth:Ae,getEnvironmentBlending:Ie,getForcedColors:ye,getHDRSupport:_e,getHoverCapability:Me,getInvertedColors:Ee,getMonochromeDepth:ke,getPointerCapability:Te,getReducedData:Re,getReducedMotion:be,getReducedTransparency:Se,isAccessibilityDetectionAvailable:Ce});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,i=[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,r=(o+t+i)/3;return{confidence:Math.round(100*o)/100,uniqueness:Math.round(100*r)/100,intlApiSupport:Math.round(100*t)/100,localeComplexity:Math.round(100*i)/100}}const Ve="mmMwWLliI0fiflO&1",ze={default:{text:Ve},serif:{style:{fontFamily:"serif"},text:Ve},sans:{style:{fontFamily:"sans-serif"},text:Ve},mono:{style:{fontFamily:"monospace"},text:Ve},apple:{style:{font:"-apple-system-body"},text:Ve},system:{style:{fontFamily:"system-ui"},text:Ve},min:{style:{fontSize:"1px"},text:Ve},large:{style:{fontSize:"72px"},text:Ve},ui:{style:{fontFamily:"ui-serif"},text:Ve},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:Ve},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 He(e,t,n){try{const o="mmmmmmmmmmlli",i=We(e,t,{style:{fontFamily:n},text:o}),r=We(e,t,{style:{fontFamily:"monospace"},text:o});if(Math.abs(i-r)<1)return"monospace-fallback";const a=We(e,t,{style:{fontFamily:"sans-serif"},text:o});return Math.abs(i-a)<1?"sans-serif-fallback":"native-font"}catch(e){return"fallback-error"}}function We(e,t,n){const o=e.createElement("span"),{style:i={},text:r=Ve}=n;o.textContent=r,o.style.cssText="position: absolute; left: 0; top: 0; white-space: nowrap; visibility: hidden;",Object.entries(i).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 qe(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,i=t.length;let r=n?o/i:0;(e.antiAliasing.enabled||e.systemFontHints.clearType)&&(r+=.2),Object.keys(e.fallbackBehavior).length>0&&(r+=.1),r=Math.min(r,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 u=Math.min(l/100,1);e.antiAliasing.smoothingLevel>0&&(u+=.1),e.systemFontHints.hintingLevel>0&&(u+=.1),u=Math.min(u,1);let d="low";const h=e.antiAliasing.smoothingLevel;h>50||e.systemFontHints.clearType?d="high":(h>20||e.systemFontHints.hintingLevel>2)&&(d="medium");const m="error"!==e.isolatedHash&&e.isolatedHash.length>0;return{confidence:Math.round(100*r)/100,uniqueness:Math.round(100*u)/100,hasSystemFonts:a,hasAdvancedFeatures:s,renderingQuality:d,isolationIntegrity:m}}const je=["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"],Ze="mmMwWLliI0O&1",Ge="48px",$e=["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=Ge,n.style.whiteSpace="nowrap",n.textContent=Ze,n}function Ke(e,t,n){return Xe(e,`'${t}',${n}`)}function Je(e,t){return $e.some((n,o)=>{const i=e[o],r=t[n];return!(!i||!r||i.offsetWidth===r.width&&i.offsetHeight===r.height)})}function Ye(e){const{available:t,method:n,precision:o,totalTested:i,detectionTime:r}=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,u=t.filter(e=>["sans-serif-thin","Roboto"].includes(e)).length;let d="unknown";s>=2?d="windows":c>=2?d="macos":l>=1?d="linux":u>=1&&(d="android");const h=Math.min(r<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:d,browserCapabilities:Math.round(100*h)/100}}const Qe=Math,et=()=>0;function tt(){const e=Qe.acos||et,t=Qe.acosh||et,n=Qe.asin||et,o=Qe.asinh||et,i=Qe.atanh||et,r=Qe.atan||et,a=Qe.sin||et,s=Qe.sinh||et,c=Qe.cos||et,l=Qe.cosh||et,u=Qe.tan||et,d=Qe.tanh||et,h=Qe.exp||et,m=Qe.expm1||et,g=Qe.log1p||et,p=Qe.cbrt||et,f=Qe.hypot||et,w=Qe.log10||et,y=Qe.log2||et;return{acos:e(.12312423423423424),asin:n(.12312423423423424),atan:r(.5),cos:c(10.000000000123),sin:a(-1e300),tan:u(-1e300),acosh:t(1e308),asinh:o(1),atanh:i(.5),cosh:l(1),sinh:s(1),tanh:d(1),exp:h(1),expm1:m(1),log1p:g(10),powPI:Qe.pow(Qe.PI,-100),cbrt:p(27),hypot:f(3,4),log10:w(100),log2:y(8),acoshPf:(v=1e154,Qe.log(v+Qe.sqrt(v*v-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 v}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 it={gdprMode:!1,includeInvasive:!0,timeout:5e3,debug:!1,excludeComponents:[]},rt=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){rt.set(e,t)}async function ct(e,t,n){const o=`${e}_${n.gdprMode}`,i=(r=o,rt.get(r)||null);var r;if(i)return i;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 i=0;i<c;i++)try{const r=n.timeout+i*(a?2e3:1e3),s=new Promise((t,n)=>{setTimeout(()=>n(new Error(`${e} timeout after ${r}ms (attempt ${i+1})`)),r)}),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=i===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 ue});e()}catch(e){}return null}if(n)return console.warn(`[RabbitTracker] Component ${e} failed after ${c} attempts: ${o}`),null;!o.includes("timeout")&&i<l.length&&await new Promise(e=>setTimeout(e,l[i])),a&&await new Promise(e=>setTimeout(e,100))}return null}async function lt(e={}){const t=performance.now(),n={...it,...e},o=[],i=[],r={collectionTime:t,gdprMode:n.gdprMode,components:[]},l=[];if(at("canvas",n)&&q()&&l.push(ct("canvas",W,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)&&y()&&l.push(ct("audio",w,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 j)try{const o=$(G,n);t[n]=o,K(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 j)try{K(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",Q,n).then(e=>({component:"screen",result:e}))),at("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;r[t]=n,o.push(t)}else{const n=l[t],o=n?.toString().match(/component: "(\w+)"/)?.[1]||"unknown";i.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 Kt}),t=await e();t&&(r.incognitoDetection={likelihood:t.likelihood,methods:t.methods},o.push("incognito"))}catch(e){i.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 tn}).catch(()=>null);if(e?.isHardwareDetectionAvailable?.()){const t=e.getHardwareFingerprint?.();t&&(r.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"};r.hardware={value:e,duration:0},o.push("hardware")}}catch(e){i.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 sn});if(t()){const t=e();t&&(r.system={value:t,duration:0},o.push("system"))}}catch(e){i.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 mn});if(t()){const t=performance.now(),n=await e(),i=performance.now()-t;n&&(r.storage={value:n,duration:i},o.push("storage"))}}catch(e){i.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 wn});if(t()){const t=performance.now(),n=e(),i=performance.now()-t;n&&(r.math={value:n,duration:i},o.push("math"))}}catch(e){i.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 An});if(t()){const t=performance.now(),i=await e({debug:n.debug}),a=performance.now()-t;i&&(r.domBlockers={value:i,duration:a},o.push("domBlockers"))}}catch(e){i.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 Be});if(t()){const t=performance.now(),n=e(),i=performance.now()-t;n&&(r.accessibility={value:n,duration:i},o.push("accessibility"))}}catch(e){i.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 Nn});if(t()){const t=performance.now(),n=e(),i=performance.now()-t;n&&(r.browserApis={value:n,duration:i},o.push("browserApis"))}}catch(e){i.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 Xn});if(t()){const t=performance.now(),n=e(),i=performance.now()-t;n&&(r.pluginsEnhanced={value:n,duration:i},o.push("pluginsEnhanced"))}}catch(e){i.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&&(r.mathFingerprint={value:t,duration:n,analysis:ot(t),hash:nt()},o.push("mathFingerprint"))}catch(e){i.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,i=n.contentWindow;if(!o||!i)return void t(new Error("Cannot access iframe content"));const r=o.body;M()?r.style.zoom=""+1/i.devicePixelRatio:v()&&(r.style.zoom="reset");const a=o.createElement("div");a.textContent=Array(200).fill("word").join(" "),r.appendChild(a),e({document:o,container:r,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,i]of Object.entries(ze))try{o[n]=We(e,t,i)}catch(e){o[n]=0}const i=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 i=o.getImageData(10,20,30,20).data;let r=0,a=0,s=0;for(let e=0;e<i.length;e+=4){const t=i[e]||0,n=i[e+1]||0,o=i[e+2]||0;(i[e+3]||0)<10||(s++,t===n&&n===o&&t>0&&t<255&&a++,e>4&&Math.abs(t-(i[e-4]||0))>50&&r++)}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"),r=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 i=0,r=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,u=o[e+6]||0;(Math.abs(t-n)>20||Math.abs(n-s)>20)&&i++,Math.abs(t-c)+Math.abs(n-l)+Math.abs(s-u)>50&&r++,(t>0&&t<255||n>0&&n<255||s>0&&s<255)&&a++}}return{clearType:i>10,hintingLevel:Math.min(Math.round(a/10),5),subpixelRendering:r>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]=He(e,t,n)}catch(e){a[n]="fallback-error"}const l=s([JSON.stringify(o),JSON.stringify(i),JSON.stringify(r),JSON.stringify(a)].join("|"));return n(),{...o,antiAliasing:{enabled:i.antiAliasing,type:r.clearType?"cleartype":i.antiAliasing?"standard":"none",smoothingLevel:i.smoothing},systemFontHints:r,fallbackBehavior:a,isolatedHash:l}}catch(e){return{...Object.keys(ze).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&&(r.fontPreferences={value:t,duration:n,analysis:qe(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(","))},o.push("fontPreferences"))}catch(e){i.push({component:"fontPreferences",error:e instanceof Error?e.message:"Font preferences detection failed"})}var u,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}(),i=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}(),r=navigator.language||"unknown",a=e.locale===r;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:r,localeMatch:a,intlSupport:i}}(),n=performance.now()-e;t&&"object"==typeof t&&(r.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){i.push({component:"dateTimeLocale",error:e instanceof Error?e.message:"DateTime locale detection failed"})}if(at("accessibilityEnhanced",n)&&Ce())try{const e=performance.now(),t=Ne(),n=performance.now()-e;t&&(r.accessibilityEnhanced={value:t,duration:n,analysis:Fe(t)},o.push("accessibilityEnhanced"))}catch(e){i.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=Ge,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 i=$e.map(e=>Xe(t,e));i.forEach(e=>o.appendChild(e));const r={};for(const e of je)r[e]=$e.map(n=>Ke(t,e,n)),r[e].forEach(e=>o.appendChild(e));n.appendChild(o);const a={};$e.forEach((e,t)=>{const n=i[t];n&&(a[e]={width:n.offsetWidth,height:n.offsetHeight})});const s=[],c={};for(const e of je){const t=r[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,u=Object.values(c).map(e=>e.width);return{available:s,method:"iframe",measurements:c,precision:new Set(u).size/u.length,totalTested:je.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={};$e.forEach(t=>{const n=document.createElement("span");n.style.fontFamily=t,n.style.fontSize=Ge,n.style.whiteSpace="nowrap",n.textContent=Ze,e.appendChild(n),document.body.appendChild(e),o[t]={width:n.offsetWidth,height:n.offsetHeight},document.body.removeChild(e),e.removeChild(n)});for(const i of je){let r=!1;for(const t of $e){const a=document.createElement("span");a.style.fontFamily=`'${i}',${t}`,a.style.fontSize=Ge,a.style.whiteSpace="nowrap",a.textContent=Ze,e.appendChild(a),document.body.appendChild(e);const s={width:a.offsetWidth,height:a.offsetHeight};n[i]=s;const c=o[t];if(!c||s.width===c.width&&s.height===c.height||(r=!0),document.body.removeChild(e),e.removeChild(a),r)break}r&&t.push(i)}}catch(e){}const o=performance.now()-e,i=Object.values(n).map(e=>e.width),r=new Set(i).size;return{available:t,method:"dom",measurements:n,precision:i.length>0?r/i.length:0,totalTested:je.length,detectionTime:o}}(e)}}(),n=performance.now()-e;t&&(r.enhancedFonts={value:t,duration:n,analysis:Ye(t),hash:(m=t,`${m.available.sort().join(",")}|${m.method}|${m.precision.toFixed(2)}`)},o.push("enhancedFonts"))}catch(e){i.push({component:"enhancedFonts",error:e instanceof Error?e.message:"Enhanced font detection failed"})}const g={};let p;o.forEach(e=>{const t=r[e];t&&t.value&&(g[e]=t.value)});try{const{calculateConfidence:e}=await Promise.resolve().then(function(){return Qn});p=e([...o.map(e=>({component:e,success:!0,duration:r[e]?.duration||0,value:r[e]?.value})),...i.map(e=>({component:e.component,success:!1,duration:0,error:e.error}))],{requireMinimumComponents:6,penalizeMissingCore:!0,adjustForIncognito:!0}),r.confidence={score:p.score,level:p.level,factors:p.factors,recommendations:p.recommendations}}catch(e){const t=o.length/(o.length+i.length||1);r.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={...r,hash:"",components:o,collectionTime:performance.now()-t},b={success:o.length>0,collectedComponents:o,failedComponents:i,confidence:p||r.confidence};if(o.length>0){const e=f.browser?.value,t=f.screen?.value,r=e?.userAgent||"",s=(()=>{const e=!0===navigator.userAgentData?.mobile,n=navigator.maxTouchPoints||0,o=t?.width||0,i=t?.height||0,r=Math.min(o,i);return Math.max(o,i),e?"mobile":n>0?r<=480?"mobile":"tablet":r>1024?"desktop":r<=480?"mobile":"desktop"})();let l={};try{const{collectDeviceSignals:e}=await Promise.resolve().then(function(){return so});l=e()}catch(e){}const u={ua:(()=>{try{return P().family}catch{const e=r,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 i;return{cores:n,memory:o,arch:void 0===(i=l.architecture)?"unknown":255===i?"arm64":0===i?"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=[u.ua||"",u.platform||"",u.deviceType||"",u.timezone||"",u.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;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 m=function(e,t=!1){const n=d(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 i=a(o);return t&&console.log("[RabbitTracker] Generated stableCoreHash:",i.substring(0,32)),i}(u,n.debug),w=["canvas","webgl","audio","mathFingerprint","fontPreferences","enhancedFonts","dateTimeLocale","accessibilityEnhanced","domBlockers","pluginsEnhanced"],y={};for(const[e,t]of Object.entries(g))w.includes(e)||(y[e]=t);const v={...y,_stableCore:u},S=c(v,n.debug);f.hash=S,n.debug&&console.log("[RabbitTracker] Ultra-stable core vector:",{components:Object.keys(u),entropy:u._entropy,stableCoreHash:m.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(v).length}),b.data={...f,stableCoreHash:m,stableCoreVector:u},n.debug&&(console.log("[RabbitTracker] Fingerprint collection completed:",{collected:o.length,failed:i.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 ut(){return lt({gdprMode:!0,includeInvasive:!1,excludeComponents:["canvas","webgl","audio"],timeout:2e3})}async function dt(){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 i=e=>{try{const o=JSON.parse(e.data);this.ws?.removeEventListener("message",i),t({success:o.success||!1,method:this.name,latency:Date.now()-n})}catch(e){this.ws?.removeEventListener("message",i),o(new Error("Failed to parse WebSocket response"))}};this.ws?.addEventListener("message",i),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",i),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 i=await o.send(e,`${this.baseUrl}${t}`);if(i.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`,i),i;this.updateMethodStats(o.name,!1),n=i.error||"Unknown error",this.config.debug&&console.warn(`[Zaplier] ❌ Transport ${o.name} failed:`,i.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,i={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(i.x,i.y,i.timestamp)&&(i.rageClick=!0),this.clicks.push(i),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 i=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}),i.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}}class wt{constructor(e,t={}){this.events=[],this.sequence=0,this.isActive=!1,this.lastMouseMove=0,this.mouseMoveThrottle=100,this.handleClick=e=>{const t=e.target,n=this.getElementPath(t);this.addEvent({type:"click",timestamp:Date.now(),data:{x:e.clientX,y:e.clientY,element:n,button:e.button,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey},sequence:this.sequence++})},this.handleScroll=()=>{this.addEvent({type:"scroll",timestamp:Date.now(),data:{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop},sequence:this.sequence++})},this.handleInput=e=>{const t=e.target,n=this.getElementPath(t);let o=t.value;this.config.maskSensitiveFields&&this.isSensitiveField(t)&&(o="*".repeat(o.length)),this.addEvent({type:"input",timestamp:Date.now(),data:{element:n,value:o,inputType:e.inputType},sequence:this.sequence++})},this.handleChange=e=>{const t=e.target,n=this.getElementPath(t);let o=t.value;this.config.maskSensitiveFields&&this.isSensitiveField(t)&&(o="*".repeat(o.length)),this.addEvent({type:"input",timestamp:Date.now(),data:{element:n,value:o,type:"change"},sequence:this.sequence++})},this.handleMouseMove=e=>{const t=Date.now();t-this.lastMouseMove<this.mouseMoveThrottle||(this.lastMouseMove=t,this.addEvent({type:"mouse",timestamp:t,data:{x:e.clientX,y:e.clientY},sequence:this.sequence++}))},this.handleViewportChange=()=>{this.addEvent({type:"viewport",timestamp:Date.now(),data:{width:window.innerWidth,height:window.innerHeight},sequence:this.sequence++})},this.handleNavigation=()=>{this.sendBatch()},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(){return!(!this.config.enabled||this.isActive||Math.random()>this.config.sampleRate||(this.isActive=!0,this.setupDOMObserver(),this.setupEventListeners(),this.startBatchTimer(),this.recordInitialState(),0))}stop(){this.isActive&&(this.isActive=!1,this.observer&&(this.observer.disconnect(),this.observer=void 0),this.removeEventListeners(),this.batchTimer&&(clearInterval(this.batchTimer),this.batchTimer=void 0),this.sendBatch())}setupDOMObserver(){"undefined"!=typeof MutationObserver&&(this.observer=new MutationObserver(e=>{const t=e.map(e=>this.serializeMutation(e)).filter(Boolean);t.length>0&&this.addEvent({type:"mutation",timestamp:Date.now(),data:{mutations:t},sequence:this.sequence++})}),this.observer.observe(document,{childList:!0,subtree:!0,attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0}))}setupEventListeners(){this.config.captureClicks&&document.addEventListener("click",this.handleClick,!0),this.config.captureScrolls&&(window.addEventListener("scroll",this.handleScroll,{passive:!0}),document.addEventListener("scroll",this.handleScroll,{passive:!0})),this.config.captureInputs&&(document.addEventListener("input",this.handleInput,!0),document.addEventListener("change",this.handleChange,!0)),this.config.captureMouseMoves&&document.addEventListener("mousemove",this.handleMouseMove,{passive:!0}),window.addEventListener("resize",this.handleViewportChange),window.addEventListener("orientationchange",this.handleViewportChange),window.addEventListener("beforeunload",this.handleNavigation),window.addEventListener("pagehide",this.handleNavigation)}removeEventListeners(){document.removeEventListener("click",this.handleClick,!0),window.removeEventListener("scroll",this.handleScroll),document.removeEventListener("scroll",this.handleScroll),document.removeEventListener("input",this.handleInput,!0),document.removeEventListener("change",this.handleChange,!0),document.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("resize",this.handleViewportChange),window.removeEventListener("orientationchange",this.handleViewportChange),window.removeEventListener("beforeunload",this.handleNavigation),window.removeEventListener("pagehide",this.handleNavigation)}recordInitialState(){this.addEvent({type:"navigation",timestamp:Date.now(),data:{url:window.location.href,referrer:document.referrer,title:document.title,viewport:{width:window.innerWidth,height:window.innerHeight},screen:{width:window.screen?.width||0,height:window.screen?.height||0}},sequence:this.sequence++})}serializeMutation(e){const t={type:e.type,target:this.getElementPath(e.target)};switch(e.type){case"childList":t.addedNodes=Array.from(e.addedNodes).filter(e=>e.nodeType===Node.ELEMENT_NODE).map(e=>this.serializeElement(e)).slice(0,10),t.removedNodes=Array.from(e.removedNodes).filter(e=>e.nodeType===Node.ELEMENT_NODE).map(e=>this.getElementPath(e)).slice(0,10);break;case"attributes":t.attributeName=e.attributeName,t.oldValue=e.oldValue,t.newValue=e.target.getAttribute(e.attributeName);break;case"characterData":t.oldValue=e.oldValue,t.newValue=e.target.textContent}return t}serializeElement(e){const t={};for(const n of Array.from(e.attributes))this.isSensitiveAttribute(n.name)||(t[n.name]=n.value);return{tagName:e.tagName.toLowerCase(),attributes:t,textContent:e.textContent?.substring(0,1e3)||""}}getElementPath(e){const t=[];let n=e;for(;n&&n!==document.body;){let e=n.tagName.toLowerCase();if(n.id){e+=`#${n.id}`,t.unshift(e);break}n.className&&(e+=`.${n.className.toString().split(/\s+/).slice(0,2).join(".")}`),n.id||n.className||(e+=`:nth-child(${Array.from(n.parentElement?.children||[]).indexOf(n)+1})`),t.unshift(e),n=n.parentElement}return t.join(" > ")}isSensitiveField(e){const t=e.getAttribute("type")?.toLowerCase(),n=e.getAttribute("name")?.toLowerCase(),o=e.className.toLowerCase();return["password","email","tel","ssn","cc"].includes(t||"")||["password","email","phone","credit","card","ssn","social"].some(e=>n&&n.includes(e)||o.includes(e))}isSensitiveAttribute(e){return["data-token","data-key","data-secret","authorization"].includes(e.toLowerCase())}addEvent(e){this.events.push(e),this.events.length>this.config.maxEventBuffer&&(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 void console.log("[Zaplier] No events to send in batch");const e=[...this.events];this.events=[],console.log(`[Zaplier] Sending batch with ${e.length} events for session ${this.sessionId}`);const t={sessionId:this.sessionId,events:e,metadata:{userAgent:navigator.userAgent,timestamp:Date.now(),compression:this.config.compressionEnabled}};this.sendToBackend(t)}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 yt={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 vt{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 wt(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 wt(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 wt(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={...yt,...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 wt(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 ut():await dt();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 i=e+n;for(let e=0;e<i.length;e++)o=(o<<5)-o+i.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}`,i={method:n,headers:{"Content-Type":"application/json"}};"POST"===n&&t&&(i.body=JSON.stringify(t));try{const e=Promise.race([fetch(o,i),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 bt=null;const St={init:e=>bt?(console.warn("[Zaplier] SDK already initialized"),bt):(bt=new vt(e),bt),getInstance:()=>bt,track:(e,t)=>{bt?bt.track(e,t):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackPageView:e=>{bt?bt.trackPageView(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackEvent:(e,t)=>bt?bt.trackCustomEvent(e,t):(console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first"),!1),trackConversion:(e,t,n,o)=>{bt?bt.trackConversion(e,t,n,o):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackPurchase:e=>{bt?bt.trackPurchase(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackAddToCart:e=>{bt?bt.trackAddToCart(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},identify:e=>{bt?bt.identify(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},getVisitorId:()=>bt?bt.getVisitorId():null,getVisitorInfo:()=>bt?bt.getVisitorInfo():Promise.resolve(null),getUserData:()=>bt?bt.getUserData():null,enableEnhancedTracking:()=>bt?bt.enableEnhancedTracking():(console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first"),!1),disableEnhancedTracking:()=>{bt?bt.disableEnhancedTracking():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},isEnhancedMode:()=>!!bt&&bt.isEnhancedMode(),heatmap:{enable:()=>{bt?bt.heatmap.enable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},disable:()=>{bt?bt.heatmap.disable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},enableMouseTracking:()=>{bt?bt.heatmap.enableMouseTracking():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},disableMouseTracking:()=>{bt?bt.heatmap.disableMouseTracking():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},getStats:()=>bt?bt.heatmap.getStats():null,isRecording:()=>!!bt&&bt.heatmap.isRecording()},replay:{enable:()=>{bt?bt.replay.enable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},disable:()=>{bt?bt.replay.disable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},start:()=>bt?bt.replay.start():(console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first"),!1),stop:()=>{bt?bt.replay.stop():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},isRecording:()=>!!bt&&bt.replay.isRecording(),getEventCount:()=>bt?bt.replay.getEventCount():0,addFunnelStep:e=>{bt?bt.replay.addFunnelStep(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},markConversion:e=>{bt?bt.replay.markConversion(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")}},debug:{getStats:()=>bt&&bt.antiAdblockManager?bt.antiAdblockManager.getStats():null,getSuccessRates:()=>bt&&bt.antiAdblockManager?bt.antiAdblockManager.getSuccessRates():null,testTransports:()=>bt&&bt.antiAdblockManager?bt.antiAdblockManager.testTransports():Promise.resolve(null)},version:"3.0.0"};function kt(){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{St.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=St,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",kt):kt());const Et=[/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],_t=[/^Mozilla\/5\.0$/,/Headless/i,/automated/i,/testing/i,/^$/];function At(){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 Mt(){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 Tt(){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 Ct(){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 xt(){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 Rt(){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 Dt(){const e=navigator.userAgent,t=Et.filter(t=>t.test(e)),n=_t.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 i=[...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:i,category:t.length>0?o:"legitimate"},isMobile:!1,isTablet:!1,isDesktop:!0,isBot:t.length>0||n.length>0,raw:e}}async function It(){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 Pt(){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 Lt(){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 Ot(){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 Nt(){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 i,r;if(n?(i=157286400,r=125829120):o?(i=52428800,r=26214400):(i=104857600,r=52428800),e.quota){if(e.quota<=r)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(r/1048576)}};if(e.quota<=i)return{detected:!0,confidence:65,method:"quota_limited",details:{quota:e.quota,usage:e.usage,quotaMB:Math.round(e.quota/1048576),threshold:Math.round(i/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 Ft(){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 Bt(){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 Ut(){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 Vt(){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 zt(e,t){return new Promise(n=>{setTimeout(()=>{n({detected:!1,confidence:0,method:`${t}_timeout`})},e)})}function Ht(){try{return"object"==typeof window.chrome&&null!==window.chrome&&"object"==typeof window.chrome.runtime}catch{return!1}}function Wt(){return navigator.userAgent.includes("WebKit")&&!navigator.userAgent.includes("Chrome")}function qt(){return navigator.userAgent.includes("Gecko")&&!navigator.userAgent.includes("Chrome")}function jt(){return navigator.userAgent.includes("SamsungBrowser")||navigator.userAgent.includes("Samsung Internet")}function Zt(){return navigator.userAgent.includes("iPad")||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1}function Gt(){return navigator.userAgent.includes("Android")}function $t(e,t){const n=e.match(t);return n&&n[1]||"Unknown"}function Xt(e){const t=e.toLowerCase();return t.includes("tablet")||Zt()?Zt()?{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")||Gt()?t.includes("iphone")?{type:"mobile",vendor:"Apple",model:"iPhone"}:t.includes("ipod")?{type:"mobile",vendor:"Apple",model:"iPod"}:Gt()&&t.includes("mobile")?{type:"mobile",vendor:"Android"}:{type:"mobile"}:{type:"desktop"}}var Kt=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 i=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}}();i||(t+=.15,e.push("indexedDB_blocked"));const r=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}}();r||(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 i=localStorage.getItem(n)===o;localStorage.removeItem(n),i||(t+=.2,e.push("localStorage_not_persistent"))}}catch{}try{if(navigator.storage?.estimate){const n=await navigator.storage.estimate(),o=n?.quota||0,i=n?.usage||0;0===o?(t+=.3,e.push("storage_quota_zero")):o>0&&o<125829120&&(t+=.25,e.push("storage_quota_low")),0===i&&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,i,r].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 Jt(){try{if("deviceMemory"in navigator){const e=navigator.deviceMemory;return"number"==typeof e?e:null}return null}catch{return null}}function Yt(){try{if("hardwareConcurrency"in navigator){const e=navigator.hardwareConcurrency;return"number"==typeof e?e:null}return null}catch{return null}}function Qt(){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 en(){try{return navigator.maxTouchPoints||0}catch{return 0}}var tn=Object.freeze({__proto__:null,getArchitecture:Qt,getDeviceMemory:Jt,getHardwareConcurrency:Yt,getHardwareFingerprint:function(){return{deviceMemory:Jt(),hardwareConcurrency:Yt(),architecture:Qt(),maxTouchPoints:en(),platform:navigator.platform||"unknown"}},getMaxTouchPoints:en,isHardwareDetectionAvailable:function(){return"undefined"!=typeof navigator}});function nn(){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 on(){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 rn(){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 an(){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 sn=Object.freeze({__proto__:null,getDateTimeLocale:rn,getLanguages:on,getPlatformExtended:an,getSystemFingerprint:function(){return{timezone:nn(),languages:on(),dateTimeLocale:rn(),platform:an(),cookiesEnabled:navigator.cookieEnabled||!1}},getTimezone:nn,isSystemDetectionAvailable:function(){return"undefined"!=typeof navigator}});function cn(){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 ln(){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 un(){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 i=t=>{o||(o=!0,e(t))};setTimeout(()=>i("blocked"),1e3),n.onerror=()=>i("blocked"),n.onsuccess=()=>{try{n.result.close();const e=indexedDB.deleteDatabase(t);e.onsuccess=()=>i(!0),e.onerror=()=>i(!0)}catch{i("blocked")}},n.onupgradeneeded=()=>{try{const e=n.result;e.objectStoreNames.contains("test")||e.createObjectStore("test")}catch{i("blocked")}}}catch{e("blocked")}})}function dn(){try{return"openDatabase"in window&&"function"==typeof window.openDatabase}catch{return!1}}async function hn(){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 mn=Object.freeze({__proto__:null,getIndexedDBSupport:un,getLocalStorageSupport:cn,getSessionStorageSupport:ln,getStorageFingerprint:async function(){const[e,t]=await Promise.all([un(),hn()]);return{localStorage:cn(),sessionStorage:ln(),indexedDB:e,webSQL:dn(),quota:t}},getStorageQuota:hn,getWebSQLSupport:dn,isStorageDetectionAvailable:function(){return"undefined"!=typeof window}});function gn(){const e=Math,t=()=>0,n=e.acos||t,o=e.acosh||t,i=e.asin||t,r=e.asinh||t,a=e.atanh||t,s=e.atan||t,c=e.sin||t,l=e.sinh||t,u=e.cos||t,d=e.cosh||t,h=e.tan||t,m=e.tanh||t,g=e.exp||t,p=e.expm1||t,f=e.log1p||t,w=t=>e.pow(e.PI,t),y=t=>e.log(t+e.sqrt(t*t+1)),v=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,k=t=>e.exp(t)-1,E=t=>(e.exp(2*t)-1)/(e.exp(2*t)+1),_=t=>e.log(1+t);try{return{acos:n(.12312423423423424),asin:i(.12312423423423424),atan:s(.5),cos:u(10.000000000123),sin:c(-1e300),tan:h(-1e300),acosh:o(1e308),acoshPf:(A=1e154,e.log(A+e.sqrt(A*A-1))),asinh:r(1),asinhPf:y(1),atanh:a(.5),atanhPf:v(.5),cosh:d(1),coshPf:S(1),sinh:l(1),sinhPf:b(1),tanh:m(1),tanhPf:E(1),exp:g(1),expm1:p(1),expm1Pf:k(1),log1p:f(10),log1pPf:_(10),powPI:w(-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 pn(){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 fn(){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 wn=Object.freeze({__proto__:null,getCompleteMathFingerprint:function(){return{operations:gn(),constants:pn(),floatingPoint:fn()}},getFloatingPointBehavior:fn,getMathConstants:pn,getMathFingerprint:gn,isMathDetectionAvailable:function(){return"undefined"!=typeof Math}});function yn(){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 vn(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,i]=n;"*="===o?t.setAttribute(e,`test-${i}-test`):t.setAttribute(e,i)}}catch{t.className="test-element"}else t.className=e.replace(/[^a-zA-Z0-9-_]/g,"");return t}function bn(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 Sn(e){return new Promise(t=>setTimeout(t,e))}async function kn(e){const t=document,n=t.createElement("div"),o=new Array(e.length),i={};bn(n);const r=t.createDocumentFragment();for(let n=0;n<e.length;n++){const i=e[n];if(i)try{const e=vn(i),a=t.createElement("div");"DIALOG"===e.tagName&&e.show?.(),bn(a),a.appendChild(e),r.appendChild(a),o[n]=e}catch(e){o[n]=void 0}}n.appendChild(r);let a=0;for(;!t.body&&a<100;)await Sn(50),a++;if(!t.body)throw new Error("Document body not available for DOM blockers detection");t.body.appendChild(n);try{await Sn(50),await new Promise(t=>{requestAnimationFrame(()=>{for(let t=0;t<e.length;t++){const n=o[t],r=e[t];n&&r&&!n.offsetParent&&(i[r]=!0)}t()})})}finally{try{n.parentNode&&n.parentNode.removeChild(n)}catch(e){setTimeout(()=>{try{n.parentNode&&n.parentNode.removeChild(n)}catch{}},0)}}return i}async function En(e={}){const{debug:t=!1,timeout:n=5e3}=e;try{if(!_n())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=yn(),o=Object.keys(e),i=[].concat(...o.map(t=>e[t]||[])),r=new Promise((e,t)=>{setTimeout(()=>t(new Error("DOM blockers detection timeout")),n)}),a=await Promise.race([kn(i),r]);return t&&console.log("[RabbitTracker] DOM Blockers Debug:",{totalSelectors:i.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 _n(){return F().canRunDOMBlockers}var An=Object.freeze({__proto__:null,getBlockedSelectors:kn,getBlockerFilters:yn,getDomBlockers:En,getDomBlockersFingerprint:async function(e={}){const t=await En(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:_n});function Mn(){try{return M()?navigator.pdfViewerEnabled??null:null}catch{return null}}function Tn(){try{if(!x())return-1;const{ApplePaySession:e}=window;if("function"!=typeof e?.canMakePayments)return-1;if(!R())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 Cn(){try{return"attributionReporting"in window||"privateClickMeasurement"in window||null}catch{return null}}function xn(){const e={enabled:!1,sameSiteSupport:!1,secureSupport:!1,partitionedSupport:!1};try{if(e.enabled=navigator.cookieEnabled,!e.enabled)return e;e.sameSiteSupport=Rn("__rb_test_samesite","SameSite=Strict"),R()&&(e.secureSupport=Rn("__rb_test_secure","Secure")),R()&&M()&&(e.partitionedSupport=Rn("__rb_test_partitioned","Partitioned; Secure; SameSite=None"))}catch{}return e}function Rn(e,t){try{const n="1",o=`${e}=${n}; ${t}; path=/`;document.cookie=o;const i=document.cookie.includes(`${e}=${n}`);return Dn(e),i}catch{return Dn(e),!1}}function Dn(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 In(){try{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");return t?(t.getSupportedExtensions()||[]).sort():[]}catch{return[]}}function Pn(){try{const e=performance.memory;return e?{usedJSHeapSize:e.usedJSHeapSize,totalJSHeapSize:e.totalJSHeapSize,jsHeapSizeLimit:e.jsHeapSizeLimit}:null}catch{return null}}function Ln(){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 On(){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 Nn=Object.freeze({__proto__:null,getApplePayState:Tn,getBrowserApisFingerprint:function(){const e=Mn(),t=Tn(),n=Cn(),o=xn(),i=In(),r=Pn(),a=Ln(),s=On();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||r||a),u=[null!==e,-1!==t,null!==n,o.enabled,i.length>0,null!==r,null!==a,Object.keys(s).length>0];return{pdfViewerEnabled:e,applePayState:t,privateClickMeasurement:n,cookieCapabilities:o,webglExtensions:i,performanceMemory:r,connectionInfo:a,vendorProperties:s,browserVendor:c,hasNativeFeatures:l,apiScore:Math.round(u.filter(Boolean).length/u.length*100)}},getConnectionInfo:Ln,getCookieCapabilities:xn,getPdfViewerEnabled:Mn,getPerformanceMemory:Pn,getPrivateClickMeasurement:Cn,getVendorProperties:On,getWebGLExtensions:In,isBrowserApisDetectionAvailable:function(){return"undefined"!=typeof window&&"undefined"!=typeof navigator}});function Fn(){try{if(!$n())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 i=[];if(o.length>0)for(let e=0;e<o.length;e++){const t=o[e];t&&t.type&&i.push(t.type)}t.push({name:o.name||"",filename:o.filename||"",description:o.description||"",version:o.version||void 0,mimeTypes:i})}return t.sort((e,t)=>e.name.localeCompare(t.name))}catch(e){return"SecurityError"===e.name?"SECURITY_RESTRICTED":[]}}function Bn(){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 Un(){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 Vn(){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 zn(){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 Hn(){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 Wn(){try{if(!T())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 qn(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 jn(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 Zn(e,t,n,o){let i=50;return i+=10*e.length,i+=5*t.length,n&&(i-=15),o&&(i-=10),Math.max(0,Math.min(100,i))}function Gn(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 $n(){return F().canRunBrowserAPIs&&"undefined"!=typeof navigator}var Xn=Object.freeze({__proto__:null,calculateSecurityScore:Zn,detectChromeExtensionsBlocked:Hn,detectFirefoxExtensionsBlocked:Wn,generatePluginSignature:Gn,getEnhancedPluginFingerprint:function(){const e=Fn(),t=Array.isArray(e)?e:[],n=Bn(),o=Array.isArray(n)?n:[],i=Un(),r=Vn(),a=zn(),s=Hn(),c="boolean"==typeof s&&s,l=Wn(),u="boolean"==typeof l&&l,d=qn(t),h=jn(t),m=Gn(t,o),g=Zn(d,h,i,r);return{plugins:t,pluginCount:t.length,mimeTypes:o,mimeTypeCount:o.length,flashEnabled:i,javaEnabled:r,silverLightEnabled:a,chromeExtensionsBlocked:c,firefoxExtensionsBlocked:u,securityPlugins:d,adBlockerPlugins:h,pluginSignature:m,securityScore:g}},getMimeTypes:Bn,getNavigatorPlugins:Fn,identifyAdBlockerPlugins:jn,identifySecurityPlugins:qn,isEnhancedPluginDetectionAvailable:$n,testFlashEnabled:Un,testJavaEnabled:Vn,testSilverlightEnabled:zn});const Kn={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}},Jn={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 Yn(e){const t=Kn[e]||Jn[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 Qn=Object.freeze({__proto__:null,ADVANCED_COMPONENT_CHARACTERISTICS:Jn,COMPONENT_CHARACTERISTICS:Kn,calculateComponentWeight:Yn,calculateConfidence:function(e,t={}){const{requireMinimumComponents:n=4,penalizeMissingCore:o=!0,adjustForIncognito:i=!0}=t,r=e.filter(e=>e.success),a=[];r.length<n&&a.push(`Collect at least ${n} components for reliable identification`);let s=0,c=0,l=0,u=0,d=0;const h=["canvas","webgl","audio","hardware"].filter(e=>!r.some(t=>t.component===e));for(const e of r){const t=Yn(e.component),n=Kn[e.component]||Jn[e.component];n&&(s+=t,c+=n.stability*t,l+=n.entropy*t,u+=n.uniqueness*t,d+=n.spoofResistance*t)}const m=s>0?c/s:0,g=s>0?l/s:0,p=s>0?d/s:0;let f,w,y=.35*m+.25*g+.25*(s>0?u/s:0)+.15*p,v=y;return o&&h.length>0&&(v-=.1*h.length,a.push(`Missing core components: ${h.join(", ")}`)),r.length<6&&(v-=.05*(6-r.length)),i&&r.some(e=>"incognito"===e.component)&&(v+=.02),r.filter(e=>["domBlockers","accessibility","browserApis","math"].includes(e.component)).length>=2&&(v+=.05),v=Math.max(0,Math.min(1,v)),v>=.995?(f=.995,w="Very High"):v>=.99?(f=.99,w="High"):v>=.95?(f=.95,w="Medium"):v>=.8?(f=.8,w="Low"):(f=.5,w="Very Low",a.push("Consider implementing additional fingerprinting techniques")),v<.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:w,factors:{componentCount:r.length,weightedScore:Math.round(1e3*y)/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 eo(){try{const e=screen,t=e.availTop??0,n=e.availLeft??0,o=e.availWidth??e.width,i=e.availHeight??e.height,r=t||null,a=e.width-o-n||null,s=e.height-i-t||null,c=n||null;if(null===r&&null===a&&null===s&&null===c)return null;const l=e=>null===e?null:10*Math.round(e/10);return{top:l(r),right:l(a),bottom:l(s),left:l(c)}}catch{return null}}function to(){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 no(){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 oo(){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 io(){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 ro(){try{return screen.colorDepth||void 0}catch{return}}function ao(){try{for(const e of["rec2020","p3","srgb"])if(window.matchMedia(`(color-gamut: ${e})`).matches)return e;return}catch{return}}var so=Object.freeze({__proto__:null,collectDeviceSignals:function(){return{screenFrame:eo(),hardwareConcurrency:navigator.hardwareConcurrency||void 0,deviceMemory:io(),architecture:to(),touchSupport:no(),vendorFlavors:oo(),cpuClass:navigator.cpuClass||void 0,colorDepth:ro(),colorGamut:ao()}}});return e.Zaplier=St,e.ZaplierSDK=vt,e.analyzeUserAgent=function(e){const t=e||navigator.userAgent||"",n=function(e){const t=e.toLowerCase();if(t.includes("edg/")){const t=$t(e,/edg\/([0-9.]+)/i);return{name:"Edge",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("edge/")){const t=$t(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=$t(e,/chrome\/([0-9.]+)/i);return{name:"Brave",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(jt()){const t=$t(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=$t(e,/chrome\/([0-9.]+)/i);return{name:"Chrome",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("firefox/")){const t=$t(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=$t(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=$t(e,/(?:opr|opera)\/([0-9.]+)/i);return{name:"Opera",version:t,major:t.split(".")[0]||"Unknown",engine:Ht()?"chromium":"unknown"}}if(t.includes("vivaldi/")){const t=$t(e,/vivaldi\/([0-9.]+)/i);return{name:"Vivaldi",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("yabrowser/")){const t=$t(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=$t(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=$t(e,/ucbrowser\/([0-9.]+)/i);return{name:"UC Browser",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("qqbrowser/")){const t=$t(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=$t(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:$t(e,/mac os x ([0-9._]+)/i).replace(/_/g,"."),family:"macos"}:t.includes("iphone")||t.includes("ipad")||t.includes("ipod")||Zt()?{name:"iOS",version:$t(e,/os ([0-9._]+)/i).replace(/_/g,"."),family:"ios"}:Gt()?{name:"Android",version:$t(e,/android ([0-9.]+)/i),family:"android"}:t.includes("linux")?{name:"Linux",version:"Unknown",family:"linux"}:t.includes("cros")?{name:"Chrome OS",version:$t(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),i=Xt(t),r=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 i of o)e.toLowerCase().includes(i)&&(t.push(i),["bot","crawler","spider","scraper"].some(e=>i.includes(e))?n="crawler":["selenium","webdriver","automation"].some(e=>i.includes(e))?n="automation":["headless","phantom"].some(e=>i.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:i.type,vendor:i.vendor,model:i.model},suspicious:{isBot:r.isBot,patterns:r.patterns,category:r.category},isMobile:"mobile"===i.type,isTablet:"tablet"===i.type,isDesktop:"desktop"===i.type,isBot:r.isBot,raw:t}},e.autoInitializeFromScript=kt,e.clearFingerprintCache=function(){rt.clear()},e.collectFingerprint=lt,e.default=vt,e.detectBot=async function(){const e={webDriver:At(),headlessBrowser:Mt(),automationTools:Tt(),domBlockers:Ct(),missingLanguages:xt(),inconsistentEval:Rt(),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=Dt(),n=Object.values(e).filter(e=>e.detected),o=n.reduce((e,t)=>e+t.confidence,0),i=n.length>0?o/n.length:0,r=n.length>=2||n.some(e=>e.confidence>=90)||(t.suspicious?.isBot??!1);let a="low";return i>=70?a="high":(i>=40||n.length>=2)&&(a="medium"),{isBot:r,confidence:Math.round(Math.min(i,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),i=/Edg/.test(e),r=2e3,[a,s,c,l,u,d,h,m,g]=await Promise.allSettled([Promise.race([It(),zt(r,"localStorage")]),Promise.race([Pt(),zt(r,"sessionStorage")]),Promise.race([Lt(),zt(r,"indexedDB")]),Promise.race([Ot(),zt(r,"permissions")]),Promise.race([Nt(),zt(r,"quotaManagement")]),Promise.race([Ut(),zt(r,"filesystem")]),Promise.race([Vt(),zt(r,"cacheDetection")]),Promise.race([Ft(),zt(r,"chromeSpecific")]),Promise.race([Bt(),zt(r,"safariSpecific")])]),p=[];[{name:"localStorage",result:a},{name:"sessionStorage",result:s},{name:"indexedDB",result:c},{name:"permissions",result:l},{name:"quotaManagement",result:u},{name:"filesystem",result:d},{name:"cacheDetection",result:h},{name:"chromeSpecific",result:m},{name:"safariSpecific",result:g}].forEach(({name:e,result:r})=>{if("fulfilled"===r.status&&r.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:i},r.value.confidence);p.push({method:r.value.method,confidence:r.value.confidence,weight:a})}});const f=p.reduce((e,t)=>e+t.weight,0),w=p.reduce((e,t)=>e+t.confidence*t.weight/100,0);let y;y=n?35:t||i?45:o?40:50;const v=f>=y,b=f>0?Math.min(95,w/f*100):0,S="fulfilled"===a.status?a.value:{detected:!1},k="fulfilled"===s.status?s.value:{detected:!1},E="fulfilled"===c.status?c.value:{detected:!1},_="fulfilled"===l.status?l.value:{},A="fulfilled"===u.status?u.value:{detected:!1};return"fulfilled"===d.status&&d.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:i},detectedSignals:p,totalWeight:f,minWeightThreshold:y,finalConfidence:b,isDetected:v}),{isIncognito:v,confidence:Math.round(b),detectionMethods:p.map(e=>e.method),details:{localStorage:S?.detected??!1,sessionStorage:k?.detected??!1,indexedDB:E?.detected??!1,cookiesEnabled:!1,quota:A?.detected?0:null,permissions:_?.details||{}}}},e.generateVisitorId=l,e.generateVisitorIdFromFingerprint=function(e){return l(e.hash)},e.getAvailableComponents=function(){const e=[];return q()&&e.push("canvas"),fe()&&e.push("webgl"),y()&&e.push("audio"),J()&&e.push("fonts"),ee()&&e.push("screen"),U()&&e.push("browser"),e},e.getBrowserEngine=function(){return Ht()?"chromium":Wt()?"webkit":qt()?"gecko":navigator.userAgent.toLowerCase().includes("trident")?"trident":"unknown"},e.getCompleteFingerprint=dt,e.getLightweightFingerprint=ut,e.hash32=s,e.hashFingerprint=c,e.isAndroid=Gt,e.isChromium=Ht,e.isDesktop=function(){return"desktop"===Xt(navigator.userAgent).type},e.isFingerprintingAvailable=function(){return ee()&&U()},e.isGecko=qt,e.isIPad=Zt,e.isMobile=function(){return"mobile"===Xt(navigator.userAgent).type},e.isSamsungInternet=jt,e.isTablet=function(){return"tablet"===Xt(navigator.userAgent).type},e.isWebKit=Wt,e.quickBotDetection=async function(){const e=At(),t=Dt();return e.detected||(t.suspicious?.isBot??!1)},e.quickIncognitoDetection=async function(){try{const[e,t]=await Promise.all([It(),Lt()]);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],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}),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}({});