@zaplier/sdk 1.0.7 → 1.0.9

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 f=[0,0],p=[0,0];return g>=12&&(p=i(p,[s[m+3]||0,0])),g>=8&&(p=i(p,[0,s[m+2]||0]),p=n(p,h),p=o(p,33),p=n(p,d),u=i(u,p)),g>=4&&(f=i(f,[s[m+1]||0,0])),g>=1&&(f=i(f,[0,s[m]||0]),f=n(f,d),f=o(f,31),f=n(f,h),l=i(l,f)),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)?Number(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 f=0;for(let e=0;e<Math.min(u.length,16);e++){const t=u[e];void 0!==t&&(f+=e*Math.abs(t))}return s([...u,d,m,g,f].join(","))}catch(e){return s("multi_oscillator_error")}}async function f(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 p(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"),p(o.compressor).catch(()=>"compressor_error"),f(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).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).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 q(){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;for(let e=0;e<n.length;e+=4)if(o+=n[e]||0,i+=n[e+1]||0,r+=n[e+2]||0,e>0){const t=n[e-4]||0,o=n[e]||0;a+=Math.abs(o-t)}const s=n.length/4;return`${Math.round(o/s)}-${Math.round(i/s)}-${Math.round(r/s)}-${Math.round(a/s)}`}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 j(){try{const e=document.createElement("canvas").getContext("2d");return null!==e&&"function"==typeof e.fillText}catch{return!1}}const W=["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=Date.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}async function me(){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"";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"";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(e){return""}}(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 ge=null;function fe(){if(null!==ge)return ge;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,ge=n,n}catch{return ge=!1,!1}}function pe(){try{for(const e of["rec2020","p3","srgb"]){const t=Ce(`(color-gamut: ${e})`);if(t?.matches)return e}return"unknown"}catch{return"unknown"}}function we(){try{const e=Ce("(forced-colors: active)");if(e?.matches)return!0;const t=Ce("(forced-colors: none)");return!t?.matches&&null}catch{return null}}function ye(){try{const e=["no-preference","high","more","low","less","forced"];for(const t of e){const e=Ce(`(prefers-contrast: ${t})`);if(e?.matches)return"high"===t?"more":"low"===t?"less":t}return"unknown"}catch{return"unknown"}}function ve(){try{const e=Ce("(prefers-reduced-motion: reduce)");if(e?.matches)return!0;const t=Ce("(prefers-reduced-motion: no-preference)");return!t?.matches&&null}catch{return null}}function be(){try{return!!matchMedia("(prefers-reduced-transparency: reduce)").matches||!matchMedia("(prefers-reduced-transparency: no-preference)").matches&&null}catch{return null}}function Se(){try{for(let e=8;e>=0;e--)if(matchMedia(`(monochrome: ${e})`).matches)return e;return 0}catch{return 0}}function ke(){try{return!!matchMedia("(inverted-colors: inverted)").matches||!matchMedia("(inverted-colors: none)").matches&&null}catch{return null}}function Ee(){try{return!!matchMedia("(dynamic-range: high)").matches||!matchMedia("(dynamic-range: standard)").matches&&null}catch{return null}}function _e(){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 Ae(){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 F().canRunAccessibility}function Ce(e){try{return Te()?matchMedia(e):null}catch(e){return null}}function xe(){try{return!!matchMedia("(prefers-reduced-data: reduce)").matches||!matchMedia("(prefers-reduced-data: no-preference)").matches&&null}catch{return null}}function Re(){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 Ie(){try{return!!matchMedia("(any-hover: hover)").matches||!matchMedia("(any-hover: none)").matches&&null}catch{return null}}function Pe(){try{return matchMedia("(any-pointer: fine)").matches?"fine":matchMedia("(any-pointer: coarse)").matches?"coarse":matchMedia("(any-pointer: none)").matches?"none":"unknown"}catch{return"unknown"}}function Le(){try{return matchMedia("(prefers-color-scheme: dark)").matches?"dark":matchMedia("(prefers-color-scheme: light)").matches?"light":matchMedia("(prefers-color-scheme: no-preference)").matches?"no-preference":"unknown"}catch{return"unknown"}}function Oe(){const e=pe(),t=we(),n=ye(),o=ve(),i=be(),r=Se(),a=ke(),s=Ee(),c=_e(),l=Ae(),u=Me(),d=xe(),h=Re(),m=De(),g=Ie(),f=Pe(),p=Le(),w=Boolean(t||o||i||a||d||"no-preference"!==n||"no-preference"!==p||r>0),y=[e,s?"hdr":"sdr",`${c}bit`,r>0?`mono${r}`:"color",p,h,m].join("-"),v=[l,u,g?"anyhover":"nohover",f].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:f,colorScheme:p,hasAccessibilityFeatures:w,displayCapabilities:y,interactionCapabilities:v}}function Ne(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 Fe=Object.freeze({__proto__:null,analyzeAccessibilityFingerprint:Ne,getAccessibilityFingerprint:Oe,getAnyHover:Ie,getAnyPointer:Pe,getColorGamut:pe,getColorScheme:Le,getContrastPreference:ye,getDisplayMode:Re,getEnhancedColorDepth:_e,getEnvironmentBlending:De,getForcedColors:we,getHDRSupport:Ee,getHoverCapability:Ae,getInvertedColors:ke,getMonochromeDepth:Se,getPointerCapability:Me,getReducedData:xe,getReducedMotion:ve,getReducedTransparency:be,isAccessibilityDetectionAvailable:Te});function Be(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 Ue="mmMwWLliI0fiflO&1",Ve={default:{text:Ue},serif:{style:{fontFamily:"serif"},text:Ue},sans:{style:{fontFamily:"sans-serif"},text:Ue},mono:{style:{fontFamily:"monospace"},text:Ue},apple:{style:{font:"-apple-system-body"},text:Ue},system:{style:{fontFamily:"system-ui"},text:Ue},min:{style:{fontSize:"1px"},text:Ue},large:{style:{fontSize:"72px"},text:Ue},ui:{style:{fontFamily:"ui-serif"},text:Ue},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:Ue},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",i=He(e,t,{style:{fontFamily:n},text:o}),r=He(e,t,{style:{fontFamily:"monospace"},text:o});if(Math.abs(i-r)<1)return"monospace-fallback";const a=He(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 He(e,t,n){const o=e.createElement("span"),{style:i={},text:r=Ue}=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"],We="mmMwWLliI0O&1",Ze="48px",Ge=["monospace","sans-serif","serif"];function $e(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=Ze,n.style.whiteSpace="nowrap",n.textContent=We,n}function Xe(e,t,n){return $e(e,`'${t}',${n}`)}function Ke(e,t){return Ge.some((n,o)=>{const i=e[o],r=t[n];return!(!i||!r||i.offsetWidth===r.width&&i.offsetHeight===r.height)})}function Je(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)),f=Math.min(g.length/10,1);return{confidence:Math.round(100*a)/100,uniqueness:Math.round(100*f)/100,osSignature:d,browserCapabilities:Math.round(100*h)/100}}const Ye=Math,Qe=()=>0;function et(){const e=Ye.acos||Qe,t=Ye.acosh||Qe,n=Ye.asin||Qe,o=Ye.asinh||Qe,i=Ye.atanh||Qe,r=Ye.atan||Qe,a=Ye.sin||Qe,s=Ye.sinh||Qe,c=Ye.cos||Qe,l=Ye.cosh||Qe,u=Ye.tan||Qe,d=Ye.tanh||Qe,h=Ye.exp||Qe,m=Ye.expm1||Qe,g=Ye.log1p||Qe,f=Ye.cbrt||Qe,p=Ye.hypot||Qe,w=Ye.log10||Qe,y=Ye.log2||Qe;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:Ye.pow(Ye.PI,-100),cbrt:f(27),hypot:p(3,4),log10:w(100),log2:y(8),acoshPf:(v=1e154,Ye.log(v+Ye.sqrt(v*v-1))),asinhPf:Ye.log(1+Ye.sqrt(2)),atanhPf:Ye.log(3)/2,sinhPf:(Ye.exp(1)-Ye.exp(-1))/2,coshPf:(Ye.exp(1)+Ye.exp(-1))/2,expm1Pf:Ye.exp(1)-1,tanhPf:(Ye.exp(2)-1)/(Ye.exp(2)+1),log1pPf:Ye.log(11),precision:{float32:Ye.abs(0),float64:Ye.abs(2-2.0000000000000004),bigNumbers:Ye.abs(1),smallNumbers:Ye.abs(1e-15+2e-15-3e-15)}};var v}function tt(){try{const e=et();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 nt(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 ot={gdprMode:!1,includeInvasive:!0,timeout:5e3,debug:!1,excludeComponents:[]},it=new Map;function rt(e,t){return!(t.excludeComponents.includes(e)||t.gdprMode&&!t.includeInvasive&&["canvas","webgl","audio","fontPreferences","enhancedFonts"].includes(e)||(["mathFingerprint","dateTimeLocale","accessibilityEnhanced","fontPreferences","enhancedFonts"].includes(e),0))}function at(e,t){it.set(e,t)}async function st(e,t,n){const o=`${e}_${n.gdprMode}`,i=(r=o,it.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 at(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 ct(e={}){const t=performance.now(),n={...ot,...e},o=[],i=[],r={collectionTime:t,gdprMode:n.gdprMode,components:[]};if(rt("canvas",n)&&j()){const e=await st("canvas",q,n);e?(r.canvas=e,o.push("canvas")):i.push({component:"canvas",error:"Collection failed or timeout"})}if(rt("webgl",n)&&fe()){const e=await st("webgl",me,n);e?(r.webgl=e,o.push("webgl")):i.push({component:"webgl",error:"Collection failed or timeout"})}if(rt("audio",n)&&y()){const e=await st("audio",w,n);e?(r.audio=e,o.push("audio")):i.push({component:"audio",error:"Collection failed or timeout"})}if(rt("fonts",n)&&J()){const e=await st("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 W)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 W)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);e?(r.fonts=e,o.push("fonts")):i.push({component:"fonts",error:"Collection failed or timeout"})}if(rt("screen",n)&&ee()){const e=await st("screen",Q,n);e?(r.screen=e,o.push("screen")):i.push({component:"screen",error:"Collection failed or timeout"})}if(rt("browser",n)&&U()){const e=await st("browser",B,n);e?(r.browser=e,o.push("browser")):i.push({component:"browser",error:"Collection failed or timeout"})}if(!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(rt("hardware",n))try{const{getHardwareFingerprint:e,isHardwareDetectionAvailable:t}=await Promise.resolve().then(function(){return tn});if(t()){const t=e();t&&(r.hardware={value:t,duration:0},o.push("hardware"))}}catch(e){i.push({component:"hardware",error:e instanceof Error?e.message:"Hardware detection failed"})}if(rt("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(rt("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(rt("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(rt("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(rt("accessibility",n))try{const{getAccessibilityFingerprint:e,isAccessibilityDetectionAvailable:t}=await Promise.resolve().then(function(){return Fe});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(rt("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(rt("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(rt("mathFingerprint",n)&&function(){try{return"undefined"!=typeof Math&&"function"==typeof Math.sin}catch{return!1}}())try{const e=performance.now(),t=et(),n=performance.now()-e;t&&(r.mathFingerprint={value:t,duration:n,analysis:nt(t),hash:tt()},o.push("mathFingerprint"))}catch(e){i.push({component:"mathFingerprint",error:e instanceof Error?e.message:"Math fingerprinting failed"})}if(rt("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(Ve))try{o[n]=He(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]=ze(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(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&&(r.fontPreferences={value:t,duration:n,analysis:qe(t),hash:(l=t,l.isolatedHash&&"error"!==l.isolatedHash?l.isolatedHash:[...[l.default,l.serif,l.sans,l.mono,l.apple,l.system,l.min,l.large,l.ui,l.emoji,l.math,l.cjk,l.arabic,l.hebrew,l.subpixel,l.kerning,l.ligatures].map(e=>Math.round(e)),l.antiAliasing.enabled?1:0,l.systemFontHints.clearType?1:0,l.systemFontHints.hintingLevel,Math.round(l.antiAliasing.smoothingLevel)].join(","))},o.push("fontPreferences"))}catch(e){i.push({component:"fontPreferences",error:e instanceof Error?e.message:"Font preferences detection failed"})}var l,u,h;if(rt("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:Be(t),hash:(u=t,"number"==typeof u?`status-${u}`:[u.locale,u.calendar,u.numberingSystem,u.timeZone,u.hourCycle,u.hour12?"1":"0",u.localeMatch?"1":"0",Object.values(u.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(rt("accessibilityEnhanced",n)&&Te())try{const e=performance.now(),t=Oe(),n=performance.now()-e;t&&(r.accessibilityEnhanced={value:t,duration:n,analysis:Ne(t)},o.push("accessibilityEnhanced"))}catch(e){i.push({component:"accessibilityEnhanced",error:e instanceof Error?e.message:"Enhanced accessibility detection failed"})}if(rt("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=Ze,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=Ge.map(e=>$e(t,e));i.forEach(e=>o.appendChild(e));const r={};for(const e of je)r[e]=Ge.map(n=>Xe(t,e,n)),r[e].forEach(e=>o.appendChild(e));n.appendChild(o);const a={};Ge.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&&(Ke(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={};Ge.forEach(t=>{const n=document.createElement("span");n.style.fontFamily=t,n.style.fontSize=Ze,n.style.whiteSpace="nowrap",n.textContent=We,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 Ge){const a=document.createElement("span");a.style.fontFamily=`'${i}',${t}`,a.style.fontSize=Ze,a.style.whiteSpace="nowrap",a.textContent=We,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:Je(t),hash:(h=t,`${h.available.sort().join(",")}|${h.method}|${h.precision.toFixed(2)}`)},o.push("enhancedFonts"))}catch(e){i.push({component:"enhancedFonts",error:e instanceof Error?e.message:"Enhanced font detection failed"})}const m={};let g;o.forEach(e=>{const t=r[e];t&&t.value&&(m[e]=t.value)});try{const{calculateConfidence:e}=await Promise.resolve().then(function(){return Qn});g=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:g.score,level:g.level,factors:g.factors,recommendations:g.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},p={success:o.length>0,collectedComponents:o,failedComponents:i,confidence:g||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:Array.isArray(e?.languages)&&e.languages.length>0&&e.languages[0]?e.languages[0].toLowerCase().split("-")[0]:"unknown",platform:(e?.platform||"unknown").toLowerCase(),deviceType:s,screen:t?(()=>{const e=[t.width,t.height].sort((e,t)=>t-e),n=e[0]||0,o=e[1]||0;return{bucket:(e=>e>=7680?"8k":e>=5120?"5k":e>=4096?"4k_cinema":e>=3840?"4k_uhd":e>=3440?"ultrawide":e>=2880?"retina_4k":e>=2560?"qhd":e>=2048?"qxga":e>=1920?"fhd":e>=1680?"wsxga+":e>=1600?"uxga":e>=1440?"wxga++":e>=1366?"hd":e>=1280?"sxga":e>=1024?"xga":e>=768?"svga":e>=640?"vga":e>=480?"hvga":e>=320?"qvga":"minimal")(n),aspectClass:((e,t)=>{if(0===t)return"unknown";const n=e/t;return n>=3?"super_ultrawide":n>=2.3?"ultrawide":n>=2?"wide":n>=1.7&&n<=1.8?"standard":n>=1.6&&n<=1.67?"classic":n>=1.3&&n<=1.35?"traditional":n>=.5&&n<=.8?"mobile_portrait":n>=.4&&n<=.5?"tall_mobile":"custom"})(n,o),densityClass:(i=t.pixelRatio||window.devicePixelRatio,i?i>=3?"ultra_high":i>=2?"high":i>=1.5?"medium":i>=1.25?"enhanced":"standard":"standard"),ratio:o>0?Math.round(n/o*100)/100:0,sizeCategory:n>=2560?"large":n>=1920?"desktop":n>=1024?"laptop":n>=768?"tablet":"mobile"};var i})():{bucket:"unknown",aspectClass:"unknown",densityClass:"unknown",ratio:0,sizeCategory:"unknown"},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"}})(),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.screen?.bucket||"",u.timezone||""].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)}const w=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),y={...m,_stableCore:u},v=c(y,n.debug);f.hash=v,n.debug&&console.log("[RabbitTracker] Ultra-stable core vector:",{components:Object.keys(u),entropy:u._entropy,stableCoreHash:w.substring(0,16),enhancedFingerprintHash:v.substring(0,16),ua:u.ua,deviceType:u.deviceType,platform:u.platform,screenBucket:u.screen?.bucket,totalComponentsInHash:Object.keys(y).length}),p.data={...f,stableCoreHash:w,stableCoreVector:u},n.debug&&(console.log("[RabbitTracker] Fingerprint collection completed:",{collected:o.length,failed:i.length,duration:f.collectionTime,enhancedFingerprintHash:f.hash,stableCoreHash:w,confidence:g?.level||"Unknown",score:g?.score||0,collisionResistance:"Enhanced with stable + unstable components (no temporal entropy)"}),g?.recommendations.length&&console.log("[RabbitTracker] Confidence recommendations:",g.recommendations))}else p.error="No components could be collected";return p}async function lt(){return ct({gdprMode:!0,includeInvasive:!1,excludeComponents:["canvas","webgl","audio"],timeout:2e3})}async function ut(){return ct({gdprMode:!1,includeInvasive:!0,timeout:5e3})}class dt{constructor(){this.name="fetch",this.available="undefined"!=typeof fetch}async send(e,t){const n=Date.now();try{const 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 ht{constructor(e){this.name="websocket",this.available="undefined"!=typeof WebSocket,this.connected=!1,this.messageQueue=[],this.baseUrl=e.replace(/^http/,"ws")}async connect(){if(!this.connected&&this.available)return new Promise((e,t)=>{try{this.ws=new WebSocket(`${this.baseUrl}/ws/track`),this.ws.onopen=()=>{this.connected=!0,this.processQueue(),e()},this.ws.onerror=()=>{t(new Error("WebSocket connection failed"))},this.ws.onclose=()=>{this.connected=!1,setTimeout(()=>this.connect().catch(()=>{}),5e3)}}catch(e){t(e)}})}processQueue(){for(;this.messageQueue.length>0&&this.connected;){const e=this.messageQueue.shift();if(e&&this.ws)try{this.ws.send(JSON.stringify(e.data)),e.resolve({success:!0,method:this.name})}catch(t){e.resolve({success:!1,method:this.name,error:t instanceof Error?t.message:String(t)})}}}async send(e,t){const n=Date.now();if(!this.available)return{success:!1,method:this.name,error:"WebSocket not available"};if(!this.connected)try{await this.connect()}catch(e){return{success:!1,method:this.name,error:e instanceof Error?e.message:String(e)}}return new Promise(t=>{if(this.connected&&this.ws)try{this.ws.send(JSON.stringify(e)),t({success:!0,method:this.name,latency:Date.now()-n})}catch(e){t({success:!1,method:this.name,error:e instanceof Error?e.message:String(e)})}else this.messageQueue.push({data:e,resolve:e=>t({...e,latency:Date.now()-n})})})}destroy(){this.ws&&(this.ws.close(),this.connected=!1)}}class mt{constructor(e){this.name="resource",this.available="undefined"!=typeof fetch,this.baseUrl=e}async send(e,t){const n=Date.now();try{const t=this.encodeData(e),o=[{path:"/assets/styles.css",type:"text/css"},{path:"/images/pixel.gif",type:"image/gif"},{path:"/fonts/roboto.woff2",type:"font/woff2"},{path:"/js/analytics.js",type:"application/javascript"}],i=o[Math.floor(Math.random()*o.length)],r=`${this.baseUrl}${i.path}?d=${t}&t=${Date.now()}`;return await fetch(r,{method:"GET",headers:{Accept:i.type,"Cache-Control":"no-cache","User-Agent":navigator.userAgent}}),{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)}}}encodeData(e){try{const t=JSON.stringify(e);return btoa(encodeURIComponent(t)).replace(/[+/=]/g,e=>({"+":"-","/":"_","=":""}[e]||e))}catch(e){return""}}}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 ft{constructor(e,t={}){this.transports=[],this.stats={totalRequests:0,successfulRequests:0,methodSuccess:new Map,methodFailures:new Map},this.baseUrl=e,this.config={enabled:!0,methods:["fetch","websocket","resource"],fallbackDelay:100,maxRetries:2,debug:!1,...t},this.initializeTransports()}initializeTransports(){const e={fetch:()=>new dt,websocket:()=>new ht(this.baseUrl),resource:()=>new mt(this.baseUrl),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){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}`,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 pt{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)}async sendToBackend(e){try{(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:5e3,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;const e=[...this.events];this.events=[];const t={sessionId:this.sessionId,events:e,metadata:{userAgent:navigator.userAgent,timestamp:Date.now(),compression:this.config.compressionEnabled}};this.sendToBackend(t)}async sendToBackend(e){try{(await fetch("/api/replay/record",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok||console.warn("[Zaplier] Session replay batch failed to send")}catch(e){console.warn("[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="3.0.0",this.isInitialized=!1,this.eventQueue=[],this.heatmap={enable:()=>{if(this.config.heatmap=!0,!this.heatmapEngine&&this.isInitialized){const e=this.sessionId||this.generateSessionId();this.heatmapEngine=new pt(e,{trackClicks:!0,trackScrollDepth:!0,trackRageClicks:!0,trackMouseMoves:!1}),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){const e=this.sessionId||this.generateSessionId();this.replayEngine=new wt(e,{sampleRate:this.config.replaySampling,maskSensitiveFields:this.config.replayMaskInputs,compressionEnabled:!0}),this.replayEngine.start()}this.config.debug&&console.log("[Zaplier] Replay enabled")},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){const e=this.sessionId||this.generateSessionId();return this.replayEngine=new wt(e,{sampleRate:1,maskSensitiveFields:this.config.replayMaskInputs,compressionEnabled:!0}),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.initializeTrackingEngines(),this.initializeAntiAdblock(),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{this.sessionId||(this.sessionId=this.generateSessionId()),this.config.replay&&(this.replayEngine=new wt(this.sessionId,{sampleRate:this.config.replaySampling,maskSensitiveFields:this.config.replayMaskInputs,compressionEnabled:!0}),this.replayEngine.start(),this.config.debug&&console.log("[Zaplier] Session Replay started")),this.config.heatmap&&(this.heatmapEngine=new pt(this.sessionId,{trackClicks:!0,trackScrollDepth:!0,trackRageClicks:!0,trackMouseMoves:!1}),this.heatmapEngine.start(),this.config.debug&&console.log("[Zaplier] Heatmap tracking started"))}catch(e){console.error("[Zaplier] Failed to initialize tracking engines:",e)}}generateSessionId(){return Date.now().toString(36)+Math.random().toString(36).substr(2)}initializeAntiAdblock(){try{this.antiAdblockManager=new ft(this.config.apiEndpoint,{enabled:!0,methods:["fetch","websocket","resource"],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 lt():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).getTimezoneOffset(),navigator.hardwareConcurrency||0,navigator.deviceMemory||0,navigator.maxTouchPoints||0,performance.now(),Date.now(),1e6*Math.random(),1e6*Math.random(),performance.memory?.usedJSHeapSize||1e6*Math.random(),performance.memory?.totalJSHeapSize||1e6*Math.random(),navigator.connection?.effectiveType||"",navigator.connection?.downlink||100*Math.random(),window.outerHeight||0,window.outerWidth||0,window.devicePixelRatio||1,sessionStorage.length||100*Math.random()].join("|")+"|"+Math.random().toString(36);let t="";if(window.crypto&&window.crypto.getRandomValues){const e=new Uint32Array(4);window.crypto.getRandomValues(e),t=Array.from(e).join("")}let n=0;const o=e+t;for(let e=0;e<o.length;e++)n=(n<<5)-n+o.charCodeAt(e)&4294967295,n^=n>>>16;this.fingerprint||(this.fingerprint={}),this.fingerprint.fallbackEntropy=Math.abs(n).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 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 r=Promise.race([fetch(o,i),new Promise((e,t)=>setTimeout(()=>t(new Error("Fetch timeout - possibly blocked")),5e3))]),a=await r;if(!a.ok)throw new Error(`HTTP ${a.status}: ${a.statusText}`);const s=await a.json();return this.antiAdblockManager&&"POST"===n&&this.antiAdblockManager.send(t,e).catch(()=>{}),s}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 qt(){return navigator.userAgent.includes("WebKit")&&!navigator.userAgent.includes("Chrome")}function jt(){return navigator.userAgent.includes("Gecko")&&!navigator.userAgent.includes("Chrome")}function Wt(){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).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,f=e.expm1||t,p=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:f(1),expm1Pf:k(1),log1p:p(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 fn(){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 pn(){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:fn(),floatingPoint:pn()}},getFloatingPointBehavior:pn,getMathConstants:fn,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 qn(){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 jn(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 Wn(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:qn,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=qn(),u="boolean"==typeof l&&l,d=jn(t),h=Wn(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:Wn,identifySecurityPlugins:jn,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,f=s>0?d/s:0;let p,w,y=.35*m+.25*g+.25*(s>0?u/s:0)+.15*f,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?(p=.995,w="Very High"):v>=.99?(p=.99,w="High"):v>=.95?(p=.95,w="Medium"):v>=.8?(p=.8,w="Low"):(p=.5,w="Very Low",a.push("Consider implementing additional fingerprinting techniques")),v<.95&&a.push("Enable all available fingerprinting components for better accuracy"),f<.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:p,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*f)/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=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}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(Wt()){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(){it.clear()},e.collectFingerprint=ct,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")])]),f=[];[{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);f.push({method:r.value.method,confidence:r.value.confidence,weight:a})}});const p=f.reduce((e,t)=>e+t.weight,0),w=f.reduce((e,t)=>e+t.confidence*t.weight/100,0);let y;y=n?35:t||i?45:o?40:50;const v=p>=y,b=p>0?Math.min(95,w/p*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:f,totalWeight:p,minWeightThreshold:y,finalConfidence:b,isDetected:v}),{isIncognito:v,confidence:Math.round(b),detectionMethods:f.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 j()&&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":qt()?"webkit":jt()?"gecko":navigator.userAgent.toLowerCase().includes("trident")?"trident":"unknown"},e.getCompleteFingerprint=ut,e.getLightweightFingerprint=lt,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=jt,e.isIPad=Zt,e.isMobile=function(){return"mobile"===Xt(navigator.userAgent).type},e.isSamsungInternet=Wt,e.isTablet=function(){return"tablet"===Xt(navigator.userAgent).type},e.isWebKit=qt,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,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 f=[0,0],p=[0,0];return g>=12&&(p=i(p,[s[m+3]||0,0])),g>=8&&(p=i(p,[0,s[m+2]||0]),p=n(p,h),p=o(p,33),p=n(p,d),u=i(u,p)),g>=4&&(f=i(f,[s[m+1]||0,0])),g>=1&&(f=i(f,[0,s[m]||0]),f=n(f,d),f=o(f,31),f=n(f,h),l=i(l,f)),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)?Number(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 f=0;for(let e=0;e<Math.min(u.length,16);e++){const t=u[e];void 0!==t&&(f+=e*Math.abs(t))}return s([...u,d,m,g,f].join(","))}catch(e){return s("multi_oscillator_error")}}async function f(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 p(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"),p(o.compressor).catch(()=>"compressor_error"),f(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).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).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 q(){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;for(let e=0;e<n.length;e+=4)if(o+=n[e]||0,i+=n[e+1]||0,r+=n[e+2]||0,e>0){const t=n[e-4]||0,o=n[e]||0;a+=Math.abs(o-t)}const s=n.length/4;return`${Math.round(o/s)}-${Math.round(i/s)}-${Math.round(r/s)}-${Math.round(a/s)}`}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 j(){try{const e=document.createElement("canvas").getContext("2d");return null!==e&&"function"==typeof e.fillText}catch{return!1}}const W=["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=Date.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}async function me(){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"";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"";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(e){return""}}(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 ge=null;function fe(){if(null!==ge)return ge;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,ge=n,n}catch{return ge=!1,!1}}function pe(){try{for(const e of["rec2020","p3","srgb"]){const t=Ce(`(color-gamut: ${e})`);if(t?.matches)return e}return"unknown"}catch{return"unknown"}}function we(){try{const e=Ce("(forced-colors: active)");if(e?.matches)return!0;const t=Ce("(forced-colors: none)");return!t?.matches&&null}catch{return null}}function ye(){try{const e=["no-preference","high","more","low","less","forced"];for(const t of e){const e=Ce(`(prefers-contrast: ${t})`);if(e?.matches)return"high"===t?"more":"low"===t?"less":t}return"unknown"}catch{return"unknown"}}function ve(){try{const e=Ce("(prefers-reduced-motion: reduce)");if(e?.matches)return!0;const t=Ce("(prefers-reduced-motion: no-preference)");return!t?.matches&&null}catch{return null}}function be(){try{return!!matchMedia("(prefers-reduced-transparency: reduce)").matches||!matchMedia("(prefers-reduced-transparency: no-preference)").matches&&null}catch{return null}}function Se(){try{for(let e=8;e>=0;e--)if(matchMedia(`(monochrome: ${e})`).matches)return e;return 0}catch{return 0}}function ke(){try{return!!matchMedia("(inverted-colors: inverted)").matches||!matchMedia("(inverted-colors: none)").matches&&null}catch{return null}}function Ee(){try{return!!matchMedia("(dynamic-range: high)").matches||!matchMedia("(dynamic-range: standard)").matches&&null}catch{return null}}function _e(){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 Ae(){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 F().canRunAccessibility}function Ce(e){try{return Te()?matchMedia(e):null}catch(e){return null}}function xe(){try{return!!matchMedia("(prefers-reduced-data: reduce)").matches||!matchMedia("(prefers-reduced-data: no-preference)").matches&&null}catch{return null}}function Re(){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 Ie(){try{return!!matchMedia("(any-hover: hover)").matches||!matchMedia("(any-hover: none)").matches&&null}catch{return null}}function Pe(){try{return matchMedia("(any-pointer: fine)").matches?"fine":matchMedia("(any-pointer: coarse)").matches?"coarse":matchMedia("(any-pointer: none)").matches?"none":"unknown"}catch{return"unknown"}}function Le(){try{return matchMedia("(prefers-color-scheme: dark)").matches?"dark":matchMedia("(prefers-color-scheme: light)").matches?"light":matchMedia("(prefers-color-scheme: no-preference)").matches?"no-preference":"unknown"}catch{return"unknown"}}function Oe(){const e=pe(),t=we(),n=ye(),o=ve(),i=be(),r=Se(),a=ke(),s=Ee(),c=_e(),l=Ae(),u=Me(),d=xe(),h=Re(),m=De(),g=Ie(),f=Pe(),p=Le(),w=Boolean(t||o||i||a||d||"no-preference"!==n||"no-preference"!==p||r>0),y=[e,s?"hdr":"sdr",`${c}bit`,r>0?`mono${r}`:"color",p,h,m].join("-"),v=[l,u,g?"anyhover":"nohover",f].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:f,colorScheme:p,hasAccessibilityFeatures:w,displayCapabilities:y,interactionCapabilities:v}}function Ne(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 Fe=Object.freeze({__proto__:null,analyzeAccessibilityFingerprint:Ne,getAccessibilityFingerprint:Oe,getAnyHover:Ie,getAnyPointer:Pe,getColorGamut:pe,getColorScheme:Le,getContrastPreference:ye,getDisplayMode:Re,getEnhancedColorDepth:_e,getEnvironmentBlending:De,getForcedColors:we,getHDRSupport:Ee,getHoverCapability:Ae,getInvertedColors:ke,getMonochromeDepth:Se,getPointerCapability:Me,getReducedData:xe,getReducedMotion:ve,getReducedTransparency:be,isAccessibilityDetectionAvailable:Te});function Be(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 Ue="mmMwWLliI0fiflO&1",Ve={default:{text:Ue},serif:{style:{fontFamily:"serif"},text:Ue},sans:{style:{fontFamily:"sans-serif"},text:Ue},mono:{style:{fontFamily:"monospace"},text:Ue},apple:{style:{font:"-apple-system-body"},text:Ue},system:{style:{fontFamily:"system-ui"},text:Ue},min:{style:{fontSize:"1px"},text:Ue},large:{style:{fontSize:"72px"},text:Ue},ui:{style:{fontFamily:"ui-serif"},text:Ue},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:Ue},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",i=He(e,t,{style:{fontFamily:n},text:o}),r=He(e,t,{style:{fontFamily:"monospace"},text:o});if(Math.abs(i-r)<1)return"monospace-fallback";const a=He(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 He(e,t,n){const o=e.createElement("span"),{style:i={},text:r=Ue}=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"],We="mmMwWLliI0O&1",Ze="48px",Ge=["monospace","sans-serif","serif"];function $e(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=Ze,n.style.whiteSpace="nowrap",n.textContent=We,n}function Xe(e,t,n){return $e(e,`'${t}',${n}`)}function Ke(e,t){return Ge.some((n,o)=>{const i=e[o],r=t[n];return!(!i||!r||i.offsetWidth===r.width&&i.offsetHeight===r.height)})}function Je(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)),f=Math.min(g.length/10,1);return{confidence:Math.round(100*a)/100,uniqueness:Math.round(100*f)/100,osSignature:d,browserCapabilities:Math.round(100*h)/100}}const Ye=Math,Qe=()=>0;function et(){const e=Ye.acos||Qe,t=Ye.acosh||Qe,n=Ye.asin||Qe,o=Ye.asinh||Qe,i=Ye.atanh||Qe,r=Ye.atan||Qe,a=Ye.sin||Qe,s=Ye.sinh||Qe,c=Ye.cos||Qe,l=Ye.cosh||Qe,u=Ye.tan||Qe,d=Ye.tanh||Qe,h=Ye.exp||Qe,m=Ye.expm1||Qe,g=Ye.log1p||Qe,f=Ye.cbrt||Qe,p=Ye.hypot||Qe,w=Ye.log10||Qe,y=Ye.log2||Qe;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:Ye.pow(Ye.PI,-100),cbrt:f(27),hypot:p(3,4),log10:w(100),log2:y(8),acoshPf:(v=1e154,Ye.log(v+Ye.sqrt(v*v-1))),asinhPf:Ye.log(1+Ye.sqrt(2)),atanhPf:Ye.log(3)/2,sinhPf:(Ye.exp(1)-Ye.exp(-1))/2,coshPf:(Ye.exp(1)+Ye.exp(-1))/2,expm1Pf:Ye.exp(1)-1,tanhPf:(Ye.exp(2)-1)/(Ye.exp(2)+1),log1pPf:Ye.log(11),precision:{float32:Ye.abs(0),float64:Ye.abs(2-2.0000000000000004),bigNumbers:Ye.abs(1),smallNumbers:Ye.abs(1e-15+2e-15-3e-15)}};var v}function tt(){try{const e=et();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 nt(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 ot={gdprMode:!1,includeInvasive:!0,timeout:5e3,debug:!1,excludeComponents:[]},it=new Map;function rt(e,t){return!(t.excludeComponents.includes(e)||t.gdprMode&&!t.includeInvasive&&["canvas","webgl","audio","fontPreferences","enhancedFonts"].includes(e)||(["mathFingerprint","dateTimeLocale","accessibilityEnhanced","fontPreferences","enhancedFonts"].includes(e),0))}function at(e,t){it.set(e,t)}async function st(e,t,n){const o=`${e}_${n.gdprMode}`,i=(r=o,it.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 at(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 ct(e={}){const t=performance.now(),n={...ot,...e},o=[],i=[],r={collectionTime:t,gdprMode:n.gdprMode,components:[]};if(rt("canvas",n)&&j()){const e=await st("canvas",q,n);e?(r.canvas=e,o.push("canvas")):i.push({component:"canvas",error:"Collection failed or timeout"})}if(rt("webgl",n)&&fe()){const e=await st("webgl",me,n);e?(r.webgl=e,o.push("webgl")):i.push({component:"webgl",error:"Collection failed or timeout"})}if(rt("audio",n)&&y()){const e=await st("audio",w,n);e?(r.audio=e,o.push("audio")):i.push({component:"audio",error:"Collection failed or timeout"})}if(rt("fonts",n)&&J()){const e=await st("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 W)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 W)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);e?(r.fonts=e,o.push("fonts")):i.push({component:"fonts",error:"Collection failed or timeout"})}if(rt("screen",n)&&ee()){const e=await st("screen",Q,n);e?(r.screen=e,o.push("screen")):i.push({component:"screen",error:"Collection failed or timeout"})}if(rt("browser",n)&&U()){const e=await st("browser",B,n);e?(r.browser=e,o.push("browser")):i.push({component:"browser",error:"Collection failed or timeout"})}if(!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(rt("hardware",n))try{const{getHardwareFingerprint:e,isHardwareDetectionAvailable:t}=await Promise.resolve().then(function(){return tn});if(t()){const t=e();t&&(r.hardware={value:t,duration:0},o.push("hardware"))}}catch(e){i.push({component:"hardware",error:e instanceof Error?e.message:"Hardware detection failed"})}if(rt("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(rt("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(rt("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(rt("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(rt("accessibility",n))try{const{getAccessibilityFingerprint:e,isAccessibilityDetectionAvailable:t}=await Promise.resolve().then(function(){return Fe});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(rt("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(rt("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(rt("mathFingerprint",n)&&function(){try{return"undefined"!=typeof Math&&"function"==typeof Math.sin}catch{return!1}}())try{const e=performance.now(),t=et(),n=performance.now()-e;t&&(r.mathFingerprint={value:t,duration:n,analysis:nt(t),hash:tt()},o.push("mathFingerprint"))}catch(e){i.push({component:"mathFingerprint",error:e instanceof Error?e.message:"Math fingerprinting failed"})}if(rt("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(Ve))try{o[n]=He(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]=ze(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(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&&(r.fontPreferences={value:t,duration:n,analysis:qe(t),hash:(l=t,l.isolatedHash&&"error"!==l.isolatedHash?l.isolatedHash:[...[l.default,l.serif,l.sans,l.mono,l.apple,l.system,l.min,l.large,l.ui,l.emoji,l.math,l.cjk,l.arabic,l.hebrew,l.subpixel,l.kerning,l.ligatures].map(e=>Math.round(e)),l.antiAliasing.enabled?1:0,l.systemFontHints.clearType?1:0,l.systemFontHints.hintingLevel,Math.round(l.antiAliasing.smoothingLevel)].join(","))},o.push("fontPreferences"))}catch(e){i.push({component:"fontPreferences",error:e instanceof Error?e.message:"Font preferences detection failed"})}var l,u,h;if(rt("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:Be(t),hash:(u=t,"number"==typeof u?`status-${u}`:[u.locale,u.calendar,u.numberingSystem,u.timeZone,u.hourCycle,u.hour12?"1":"0",u.localeMatch?"1":"0",Object.values(u.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(rt("accessibilityEnhanced",n)&&Te())try{const e=performance.now(),t=Oe(),n=performance.now()-e;t&&(r.accessibilityEnhanced={value:t,duration:n,analysis:Ne(t)},o.push("accessibilityEnhanced"))}catch(e){i.push({component:"accessibilityEnhanced",error:e instanceof Error?e.message:"Enhanced accessibility detection failed"})}if(rt("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=Ze,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=Ge.map(e=>$e(t,e));i.forEach(e=>o.appendChild(e));const r={};for(const e of je)r[e]=Ge.map(n=>Xe(t,e,n)),r[e].forEach(e=>o.appendChild(e));n.appendChild(o);const a={};Ge.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&&(Ke(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={};Ge.forEach(t=>{const n=document.createElement("span");n.style.fontFamily=t,n.style.fontSize=Ze,n.style.whiteSpace="nowrap",n.textContent=We,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 Ge){const a=document.createElement("span");a.style.fontFamily=`'${i}',${t}`,a.style.fontSize=Ze,a.style.whiteSpace="nowrap",a.textContent=We,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:Je(t),hash:(h=t,`${h.available.sort().join(",")}|${h.method}|${h.precision.toFixed(2)}`)},o.push("enhancedFonts"))}catch(e){i.push({component:"enhancedFonts",error:e instanceof Error?e.message:"Enhanced font detection failed"})}const m={};let g;o.forEach(e=>{const t=r[e];t&&t.value&&(m[e]=t.value)});try{const{calculateConfidence:e}=await Promise.resolve().then(function(){return Qn});g=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:g.score,level:g.level,factors:g.factors,recommendations:g.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},p={success:o.length>0,collectedComponents:o,failedComponents:i,confidence:g||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:Array.isArray(e?.languages)&&e.languages.length>0&&e.languages[0]?e.languages[0].toLowerCase().split("-")[0]:"unknown",platform:(e?.platform||"unknown").toLowerCase(),deviceType:s,screen:t?(()=>{const e=[t.width,t.height].sort((e,t)=>t-e),n=e[0]||0,o=e[1]||0;return{bucket:(e=>e>=7680?"8k":e>=5120?"5k":e>=4096?"4k_cinema":e>=3840?"4k_uhd":e>=3440?"ultrawide":e>=2880?"retina_4k":e>=2560?"qhd":e>=2048?"qxga":e>=1920?"fhd":e>=1680?"wsxga+":e>=1600?"uxga":e>=1440?"wxga++":e>=1366?"hd":e>=1280?"sxga":e>=1024?"xga":e>=768?"svga":e>=640?"vga":e>=480?"hvga":e>=320?"qvga":"minimal")(n),aspectClass:((e,t)=>{if(0===t)return"unknown";const n=e/t;return n>=3?"super_ultrawide":n>=2.3?"ultrawide":n>=2?"wide":n>=1.7&&n<=1.8?"standard":n>=1.6&&n<=1.67?"classic":n>=1.3&&n<=1.35?"traditional":n>=.5&&n<=.8?"mobile_portrait":n>=.4&&n<=.5?"tall_mobile":"custom"})(n,o),densityClass:(i=t.pixelRatio||window.devicePixelRatio,i?i>=3?"ultra_high":i>=2?"high":i>=1.5?"medium":i>=1.25?"enhanced":"standard":"standard"),ratio:o>0?Math.round(n/o*100)/100:0,sizeCategory:n>=2560?"large":n>=1920?"desktop":n>=1024?"laptop":n>=768?"tablet":"mobile"};var i})():{bucket:"unknown",aspectClass:"unknown",densityClass:"unknown",ratio:0,sizeCategory:"unknown"},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.screen?.bucket||"",u.timezone||""].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)}const w=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),y=["canvas","webgl","audio","mathFingerprint","fontPreferences","enhancedFonts","dateTimeLocale","accessibilityEnhanced","domBlockers","pluginsEnhanced"],v={};for(const[e,t]of Object.entries(m))y.includes(e)||(v[e]=t);const b={...v,_stableCore:u},S=c(b,n.debug);f.hash=S,n.debug&&console.log("[RabbitTracker] Ultra-stable core vector:",{components:Object.keys(u),entropy:u._entropy,stableCoreHash:w.substring(0,16),enhancedFingerprintHash:S.substring(0,16),ua:u.ua,deviceType:u.deviceType,platform:u.platform,screenBucket:u.screen?.bucket,totalComponentsInHash:Object.keys(b).length}),p.data={...f,stableCoreHash:w,stableCoreVector:u},n.debug&&(console.log("[RabbitTracker] Fingerprint collection completed:",{collected:o.length,failed:i.length,duration:f.collectionTime,enhancedFingerprintHash:f.hash,stableCoreHash:w,confidence:g?.level||"Unknown",score:g?.score||0,collisionResistance:"Enhanced with stable + unstable components (no temporal entropy)"}),g?.recommendations.length&&console.log("[RabbitTracker] Confidence recommendations:",g.recommendations))}else p.error="No components could be collected";return p}async function lt(){return ct({gdprMode:!0,includeInvasive:!1,excludeComponents:["canvas","webgl","audio"],timeout:2e3})}async function ut(){return ct({gdprMode:!1,includeInvasive:!0,timeout:5e3})}class dt{constructor(){this.name="fetch",this.available="undefined"!=typeof fetch}async send(e,t){const n=Date.now();try{const 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 ht{constructor(e){this.name="websocket",this.available="undefined"!=typeof WebSocket,this.connected=!1,this.messageQueue=[],this.baseUrl=e.replace(/^http/,"ws")}async connect(){if(!this.connected&&this.available)return new Promise((e,t)=>{try{this.ws=new WebSocket(`${this.baseUrl}/ws/track`),this.ws.onopen=()=>{this.connected=!0,this.processQueue(),e()},this.ws.onerror=()=>{t(new Error("WebSocket connection failed"))},this.ws.onclose=()=>{this.connected=!1,setTimeout(()=>this.connect().catch(()=>{}),5e3)}}catch(e){t(e)}})}processQueue(){for(;this.messageQueue.length>0&&this.connected;){const e=this.messageQueue.shift();if(e&&this.ws)try{this.ws.send(JSON.stringify(e.data)),e.resolve({success:!0,method:this.name})}catch(t){e.resolve({success:!1,method:this.name,error:t instanceof Error?t.message:String(t)})}}}async send(e,t){const n=Date.now();if(!this.available)return{success:!1,method:this.name,error:"WebSocket not available"};if(!this.connected)try{await this.connect()}catch(e){return{success:!1,method:this.name,error:e instanceof Error?e.message:String(e)}}return new Promise(t=>{if(this.connected&&this.ws)try{this.ws.send(JSON.stringify(e)),t({success:!0,method:this.name,latency:Date.now()-n})}catch(e){t({success:!1,method:this.name,error:e instanceof Error?e.message:String(e)})}else this.messageQueue.push({data:e,resolve:e=>t({...e,latency:Date.now()-n})})})}destroy(){this.ws&&(this.ws.close(),this.connected=!1)}}class mt{constructor(e){this.name="resource",this.available="undefined"!=typeof fetch,this.baseUrl=e}async send(e,t){const n=Date.now();try{const t=this.encodeData(e),o=[{path:"/assets/styles.css",type:"text/css"},{path:"/images/pixel.gif",type:"image/gif"},{path:"/fonts/roboto.woff2",type:"font/woff2"},{path:"/js/analytics.js",type:"application/javascript"}],i=o[Math.floor(Math.random()*o.length)],r=`${this.baseUrl}${i.path}?d=${t}&t=${Date.now()}`;return await fetch(r,{method:"GET",headers:{Accept:i.type,"Cache-Control":"no-cache","User-Agent":navigator.userAgent}}),{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)}}}encodeData(e){try{const t=JSON.stringify(e);return btoa(encodeURIComponent(t)).replace(/[+/=]/g,e=>({"+":"-","/":"_","=":""}[e]||e))}catch(e){return""}}}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 ft{constructor(e,t={}){this.transports=[],this.stats={totalRequests:0,successfulRequests:0,methodSuccess:new Map,methodFailures:new Map},this.baseUrl=e,this.config={enabled:!0,methods:["fetch","websocket","resource"],fallbackDelay:100,maxRetries:2,debug:!1,...t},this.initializeTransports()}initializeTransports(){const e={fetch:()=>new dt,websocket:()=>new ht(this.baseUrl),resource:()=>new mt(this.baseUrl),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){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}`,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 pt{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)}async sendToBackend(e){try{(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:5e3,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;const e=[...this.events];this.events=[];const t={sessionId:this.sessionId,events:e,metadata:{userAgent:navigator.userAgent,timestamp:Date.now(),compression:this.config.compressionEnabled}};this.sendToBackend(t)}async sendToBackend(e){try{(await fetch("/api/replay/record",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok||console.warn("[Zaplier] Session replay batch failed to send")}catch(e){console.warn("[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="3.0.0",this.isInitialized=!1,this.eventQueue=[],this.heatmap={enable:()=>{if(this.config.heatmap=!0,!this.heatmapEngine&&this.isInitialized){const e=this.sessionId||this.generateSessionId();this.heatmapEngine=new pt(e,{trackClicks:!0,trackScrollDepth:!0,trackRageClicks:!0,trackMouseMoves:!1}),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){const e=this.sessionId||this.generateSessionId();this.replayEngine=new wt(e,{sampleRate:this.config.replaySampling,maskSensitiveFields:this.config.replayMaskInputs,compressionEnabled:!0}),this.replayEngine.start()}this.config.debug&&console.log("[Zaplier] Replay enabled")},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){const e=this.sessionId||this.generateSessionId();return this.replayEngine=new wt(e,{sampleRate:1,maskSensitiveFields:this.config.replayMaskInputs,compressionEnabled:!0}),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.initializeTrackingEngines(),this.initializeAntiAdblock(),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{this.sessionId||(this.sessionId=this.generateSessionId()),this.config.replay&&(this.replayEngine=new wt(this.sessionId,{sampleRate:this.config.replaySampling,maskSensitiveFields:this.config.replayMaskInputs,compressionEnabled:!0}),this.replayEngine.start(),this.config.debug&&console.log("[Zaplier] Session Replay started")),this.config.heatmap&&(this.heatmapEngine=new pt(this.sessionId,{trackClicks:!0,trackScrollDepth:!0,trackRageClicks:!0,trackMouseMoves:!1}),this.heatmapEngine.start(),this.config.debug&&console.log("[Zaplier] Heatmap tracking started"))}catch(e){console.error("[Zaplier] Failed to initialize tracking engines:",e)}}generateSessionId(){return Date.now().toString(36)+Math.random().toString(36).substr(2)}initializeAntiAdblock(){try{this.antiAdblockManager=new ft(this.config.apiEndpoint,{enabled:!0,methods:["fetch","websocket","resource"],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 lt():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).getTimezoneOffset(),navigator.hardwareConcurrency||0,navigator.deviceMemory||0,navigator.maxTouchPoints||0,performance.now(),Date.now(),1e6*Math.random(),1e6*Math.random(),performance.memory?.usedJSHeapSize||1e6*Math.random(),performance.memory?.totalJSHeapSize||1e6*Math.random(),navigator.connection?.effectiveType||"",navigator.connection?.downlink||100*Math.random(),window.outerHeight||0,window.outerWidth||0,window.devicePixelRatio||1,sessionStorage.length||100*Math.random()].join("|")+"|"+Math.random().toString(36);let t="";if(window.crypto&&window.crypto.getRandomValues){const e=new Uint32Array(4);window.crypto.getRandomValues(e),t=Array.from(e).join("")}let n=0;const o=e+t;for(let e=0;e<o.length;e++)n=(n<<5)-n+o.charCodeAt(e)&4294967295,n^=n>>>16;this.fingerprint||(this.fingerprint={}),this.fingerprint.fallbackEntropy=Math.abs(n).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 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 r=Promise.race([fetch(o,i),new Promise((e,t)=>setTimeout(()=>t(new Error("Fetch timeout - possibly blocked")),5e3))]),a=await r;if(!a.ok)throw new Error(`HTTP ${a.status}: ${a.statusText}`);const s=await a.json();return this.antiAdblockManager&&"POST"===n&&this.antiAdblockManager.send(t,e).catch(()=>{}),s}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 qt(){return navigator.userAgent.includes("WebKit")&&!navigator.userAgent.includes("Chrome")}function jt(){return navigator.userAgent.includes("Gecko")&&!navigator.userAgent.includes("Chrome")}function Wt(){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).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,f=e.expm1||t,p=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:f(1),expm1Pf:k(1),log1p:p(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 fn(){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 pn(){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:fn(),floatingPoint:pn()}},getFloatingPointBehavior:pn,getMathConstants:fn,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 qn(){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 jn(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 Wn(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:qn,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=qn(),u="boolean"==typeof l&&l,d=jn(t),h=Wn(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:Wn,identifySecurityPlugins:jn,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,f=s>0?d/s:0;let p,w,y=.35*m+.25*g+.25*(s>0?u/s:0)+.15*f,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?(p=.995,w="Very High"):v>=.99?(p=.99,w="High"):v>=.95?(p=.95,w="Medium"):v>=.8?(p=.8,w="Low"):(p=.5,w="Very Low",a.push("Consider implementing additional fingerprinting techniques")),v<.95&&a.push("Enable all available fingerprinting components for better accuracy"),f<.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:p,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*f)/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=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]}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(Wt()){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(){it.clear()},e.collectFingerprint=ct,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")])]),f=[];[{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);f.push({method:r.value.method,confidence:r.value.confidence,weight:a})}});const p=f.reduce((e,t)=>e+t.weight,0),w=f.reduce((e,t)=>e+t.confidence*t.weight/100,0);let y;y=n?35:t||i?45:o?40:50;const v=p>=y,b=p>0?Math.min(95,w/p*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:f,totalWeight:p,minWeightThreshold:y,finalConfidence:b,isDetected:v}),{isIncognito:v,confidence:Math.round(b),detectionMethods:f.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 j()&&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":qt()?"webkit":jt()?"gecko":navigator.userAgent.toLowerCase().includes("trident")?"trident":"unknown"},e.getCompleteFingerprint=ut,e.getLightweightFingerprint=lt,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=jt,e.isIPad=Zt,e.isMobile=function(){return"mobile"===Xt(navigator.userAgent).type},e.isSamsungInternet=Wt,e.isTablet=function(){return"tablet"===Xt(navigator.userAgent).type},e.isWebKit=qt,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}({});