@zaplier/sdk 1.0.1 → 1.0.2

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].toString(16).padStart(8,"0")+l[1].toString(16).padStart(8,"0")+(u[0].toString(16).padStart(8,"0")+u[1].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){return a(JSON.stringify(e,Object.keys(e).sort()))}function l(e){return"vis_"+e.substring(0,16)}function u(e){if(null==e)return null;if(Array.isArray(e))return e.map(e=>u(e)).filter(e=>null!==e).sort((e,t)=>JSON.stringify(e).localeCompare(JSON.stringify(t)));if("object"==typeof e){const t=Object.keys(e).sort(),n={};for(const o of t){const t=u(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}function d(e){return a(JSON.stringify(u(e)))}function h(){try{const e=window.OfflineAudioContext||window.webkitOfflineAudioContext;if(!e)return null;const t=44100,n=.1;return new e(1,Math.floor(t*n),t)}catch{return null}}async function m(e){try{const t=e.createOscillator(),n=e.createDynamicsCompressor();t.type="triangle",t.frequency.setValueAtTime(1e3,e.currentTime),n.threshold.setValueAtTime(-50,e.currentTime),n.knee.setValueAtTime(40,e.currentTime),n.ratio.setValueAtTime(12,e.currentTime),n.attack.setValueAtTime(.003,e.currentTime),n.release.setValueAtTime(.25,e.currentTime),t.connect(n),n.connect(e.destination),t.start(),t.stop(.1);const o=(await e.startRendering()).getChannelData(0);return s([o[0]||0,o[Math.floor(.33*o.length)]||0,o[Math.floor(.66*o.length)]||0,o[o.length-1]||0].join(","))}catch(e){return s("oscillator_error")}}async function g(e){try{const t=e.createOscillator(),n=e.createDynamicsCompressor();t.type="triangle",t.frequency.setValueAtTime(1e3,e.currentTime),n.threshold.setValueAtTime(-50,e.currentTime),n.knee.setValueAtTime(40,e.currentTime),n.ratio.setValueAtTime(12,e.currentTime),n.attack.setValueAtTime(.003,e.currentTime),n.release.setValueAtTime(.25,e.currentTime),t.connect(n),n.connect(e.destination),t.start(),t.stop(.1);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 f(){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=h();if(!n)throw new Error("OfflineAudioContext not available");const o=h();if(!o)throw new Error("OfflineAudioContext not available for compressor");const[i,r]=await Promise.all([m(n).catch(()=>"oscillator_error"),g(o).catch(()=>"compressor_error")]);return{value:{oscillator:i,compressor:r,sampleRate:t,maxChannelCount:2},duration:performance.now()-e}}catch(t){return{value:{oscillator:"error",compressor:"error",sampleRate:0,maxChannelCount:0},duration:performance.now()-e,error:t instanceof Error?t.message:"Audio fingerprinting failed"}}}function p(){try{return"function"==typeof(window.OfflineAudioContext||window.webkitOfflineAudioContext)||"function"==typeof(window.AudioContext||window.webkitAudioContext)}catch{return!1}}async function w(){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=performance.now(),l={language:t.language,languages:t.languages,timezone:n.timezone,timezoneOffset:n.timezoneOffset,platform:o.platform,userAgent:o.userAgent,hardwareConcurrency:i.hardwareConcurrency,cookieEnabled:r.cookieEnabled,doNotTrack:r.doNotTrack,plugins:a,touchSupport:s};return void 0!==i.deviceMemory&&(l.deviceMemory=i.deviceMemory),{value:l,duration:c-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 y(){try{return"object"==typeof navigator&&null!==navigator}catch{return!1}}async function v(){const e=performance.now();try{const t=document.createElement("canvas");t.width=200,t.height=250;const n=t.getContext("2d");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");!function(e){e.textBaseline="top",e.font="14px Arial, sans-serif",e.fillStyle="#000",e.fillText("RabbitTracker Canvas 🎨 🔒 2024",4,140),e.font="12px Georgia, serif",e.fillStyle="#666",e.fillText("Georgia Font Test",4,160),e.font="bold 16px Helvetica",e.fillStyle="#333",e.fillText("Bold Helvetica",4,180),e.save(),e.scale(1.2,.8),e.font="10px Courier New",e.fillStyle="#999",e.fillText("Transformed Text",4,220),e.restore()}(n);const i=t.toDataURL();n.clearRect(0,0,t.width,t.height),function(e){e.fillStyle="rgb(102, 204, 0)",e.fillRect(10,10,50,50),e.fillStyle="#f60",e.fillRect(70,10,50,50),e.beginPath(),e.arc(50,80,20,0,2*Math.PI,!0),e.closePath(),e.fill(),e.beginPath(),e.moveTo(100,80),e.lineTo(120,120),e.lineTo(80,120),e.closePath(),e.stroke();const t=e.createLinearGradient(0,0,150,150);t.addColorStop(0,"red"),t.addColorStop(1,"blue"),e.fillStyle=t,e.fillRect(130,10,50,50)}(n);const r=t.toDataURL(),a=function(e,t,n){try{return n.getImageData(0,0,1,1),e.length<100||t.length<100||!(e.includes("data:image/png")&&t.includes("data:image/png"))}catch(e){return!0}}(i,r,n),c=performance.now();return{value:{text:s(i),geometry:s(r),winding:o,isInconsistent:a},duration:c-e}}catch(t){return{value:{text:"error",geometry:"error",winding:!1,isInconsistent:!0},duration:performance.now()-e,error:t instanceof Error?t.message:"Canvas fingerprinting failed"}}}function b(){try{const e=document.createElement("canvas").getContext("2d");return null!==e&&"function"==typeof e.fillText}catch{return!1}}const k=["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"],S=["monospace","sans-serif","serif"],E="mmMwWLliI0O&1 ※";function M(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 _(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 C(e,t="canvas"){const n="canvas"===t?M:_,o=S.map(e=>n(E,e)),i=S.map(t=>n(E,`${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 T(){try{const e=document.createElement("span");return e&&"object"==typeof e.style}catch{return!1}}function A(e){return 10*Math.round(e/10)}async function D(){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:A(screen.width||0),height:A(screen.height||0)}:{width:A(e),height:A(t)}}catch{return{width:A(screen.width||0),height:A(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:A(t),height:A(n)}}catch{const e=window.innerWidth||0,t=window.innerHeight||0;return{width:A(e),height:A(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 x(){try{return"object"==typeof screen&&"number"==typeof screen.width&&"number"==typeof screen.height}catch{return!1}}let I=null,R=0,P=0;function L(){try{const e=Date.now();if(I&&I.isValid)if(e-I.timestamp<18e5){if(I.context&&!I.context.isContextLost())return I.usageCount++,I.lastUsed=e,I.context;N()}else N();if(R>=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?(R++,P++,I={context:n,canvas:t,timestamp:e,isValid:!0,usageCount:1,lastUsed:e},n):null}catch(e){return N(),null}}function N(){if(I){try{if(I.context){const e=I.context.getExtension("WEBGL_lose_context");e&&e.loseContext()}I.canvas&&(I.canvas.width=0,I.canvas.height=0),R>0&&R--}catch{R>0&&R--}I.isValid=!1,I=null}}function O(){if(!I||!I.context)return!1;try{return!I.context.isContextLost()}catch{return!1}}function B(){const e=L();if(!e)return[];try{const t=e.getSupportedExtensions();return t?Array.from(t).sort():[]}catch{return[]}}function F(){const e=L();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 z(){try{N(),R=0,P=0}catch(e){console.warn("[WebGL Cache] Cleanup error:",e)}}if("undefined"!=typeof window&&(window.addEventListener("beforeunload",z),window.addEventListener("pagehide",z),window.addEventListener("unload",z),document.addEventListener("visibilitychange",()=>{}),"memory"in performance&&"function"==typeof performance.memory.addEventListener))try{performance.memory.addEventListener("memorypressure",z)}catch(e){}var U=Object.freeze({__proto__:null,cleanupWebGLCache:z,forceCleanupWebGL:function(){N(),R=0},getCachedWebGLContext:L,getCachedWebGLExtensions:B,getCachedWebGLParameters:F,invalidateWebGLCache:N,isWebGLContextValid:O});const j={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};async function V(){const e=performance.now();try{if(!W())throw new Error("WebGL not supported in this browser");const t=L();if(!t)throw new Error("WebGL context not available");if(!O())throw new Error("WebGL context lost");const n=function(){try{return F()}catch{return{}}}(),o=n.VENDOR||"unknown",i=n.RENDERER||"unknown",r=n.VERSION||"unknown";let a=o,s=i;try{const e=t.getExtension("WEBGL_debug_renderer_info");e&&(a=t.getParameter(e.UNMASKED_VENDOR_WEBGL)||o,s=t.getParameter(e.UNMASKED_RENDERER_WEBGL)||i)}catch{}const c=function(){try{return B()}catch{return[]}}(),l=function(e){const t={};return Object.entries(j).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);return{value:{vendor:a,renderer:s,version:r,extensions:c,parameters:l,shaderPrecision:u},duration:performance.now()-e}}catch(t){return{value:{vendor:"unknown",renderer:"unknown",version:"unknown",extensions:[],parameters:{},shaderPrecision:{vertex:"",fragment:""}},duration:performance.now()-e,error:t instanceof Error?t.message:"WebGL fingerprinting failed"}}}let q=null;function W(){if(null!==q)return q;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,q=n,n}catch{return q=!1,!1}}function H(){try{return"WebKitAppearance"in document.documentElement.style||"webkitRequestFileSystem"in window||"webkitResolveLocalFileSystemURL"in window||Boolean(window.safari)}catch{return!1}}function Z(){try{return"ontouchstart"in window&&("orientation"in window||"onorientationchange"in window)&&/android/i.test(navigator.userAgent)}catch{return!1}}function $(){try{return Boolean(window.chrome&&(window.chrome.webstore||window.chrome.runtime))}catch{return!1}}function G(){try{return"InstallTrigger"in window||"mozInnerScreenX"in window||"mozPaintCount"in window||Boolean(navigator.mozApps)}catch{return!1}}function X(){try{return"msCredentials"in navigator||Boolean(window.StyleMedia)||$()&&/edg/i.test(navigator.userAgent)}catch{return!1}}function K(){try{return window.isSecureContext||"https:"===location.protocol}catch{return!1}}function J(){try{return"webkitTemporaryStorage"in navigator||navigator.storage&&navigator.storage.estimate&&navigator.storage.estimate().then(e=>(e.quota||0)<104857600),!1}catch{return!1}}function Y(){try{return"undefined"!=typeof document&&"function"==typeof document.createElement&&void 0!==document.body}catch{return!1}}function Q(){try{if(!Y())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);return Boolean(o&&"string"==typeof o)}catch{return!1}}function ee(){try{return!(!window.AudioContext&&!window.webkitAudioContext)}catch{return!1}}function te(){const e=Y(),t=function(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia}catch{return!1}}();return{engine:$()?"Blink":G()?"Gecko":H()?"WebKit":X()?"EdgeHTML/Blink":"Unknown",supportsDOM:e,supportsMediaQueries:t,supportsWebGL:Q(),supportsAudio:ee(),isSecure:K(),isPrivateMode:J(),canRunDOMBlockers:(H()||Z())&&e,canRunAccessibility:t,canRunBrowserAPIs:e&&"undefined"!=typeof navigator}}function ne(){try{for(const e of["rec2020","p3","srgb"]){const t=ge(`(color-gamut: ${e})`);if(t?.matches)return e}return"unknown"}catch{return"unknown"}}function oe(){try{const e=ge("(forced-colors: active)");if(e?.matches)return!0;const t=ge("(forced-colors: none)");return!t?.matches&&null}catch{return null}}function ie(){try{const e=["no-preference","high","more","low","less","forced"];for(const t of e){const e=ge(`(prefers-contrast: ${t})`);if(e?.matches)return"high"===t?"more":"low"===t?"less":t}return"unknown"}catch{return"unknown"}}function re(){try{const e=ge("(prefers-reduced-motion: reduce)");if(e?.matches)return!0;const t=ge("(prefers-reduced-motion: no-preference)");return!t?.matches&&null}catch{return null}}function ae(){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 ce(){try{return!!matchMedia("(inverted-colors: inverted)").matches||!matchMedia("(inverted-colors: none)").matches&&null}catch{return null}}function le(){try{return!!matchMedia("(dynamic-range: high)").matches||!matchMedia("(dynamic-range: standard)").matches&&null}catch{return null}}function ue(){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 de(){try{return matchMedia("(hover: hover)").matches?"hover":matchMedia("(hover: none)").matches?"none":"unknown"}catch{return"unknown"}}function he(){try{return matchMedia("(pointer: fine)").matches?"fine":matchMedia("(pointer: coarse)").matches?"coarse":matchMedia("(pointer: none)").matches?"none":"unknown"}catch{return"unknown"}}function me(){return te().canRunAccessibility}function ge(e){try{return me()?matchMedia(e):null}catch(e){return null}}function fe(){try{return!!matchMedia("(prefers-reduced-data: reduce)").matches||!matchMedia("(prefers-reduced-data: no-preference)").matches&&null}catch{return null}}function pe(){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 we(){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 ye(){try{return!!matchMedia("(any-hover: hover)").matches||!matchMedia("(any-hover: none)").matches&&null}catch{return null}}function ve(){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 be(){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 ke(){const e=ne(),t=oe(),n=ie(),o=re(),i=ae(),r=se(),a=ce(),s=le(),c=ue(),l=de(),u=he(),d=fe(),h=pe(),m=we(),g=ye(),f=ve(),p=be(),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 Se(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 Ee=Object.freeze({__proto__:null,analyzeAccessibilityFingerprint:Se,getAccessibilityFingerprint:ke,getAnyHover:ye,getAnyPointer:ve,getColorGamut:ne,getColorScheme:be,getContrastPreference:ie,getDisplayMode:pe,getEnhancedColorDepth:ue,getEnvironmentBlending:we,getForcedColors:oe,getHDRSupport:le,getHoverCapability:de,getInvertedColors:ce,getMonochromeDepth:se,getPointerCapability:he,getReducedData:fe,getReducedMotion:re,getReducedTransparency:ae,isAccessibilityDetectionAvailable:me});function Me(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 _e="mmMwWLliI0fiflO&1",Ce={default:{text:_e},serif:{style:{fontFamily:"serif"},text:_e},sans:{style:{fontFamily:"sans-serif"},text:_e},mono:{style:{fontFamily:"monospace"},text:_e},apple:{style:{font:"-apple-system-body"},text:_e},system:{style:{fontFamily:"system-ui"},text:_e},min:{style:{fontSize:"1px"},text:_e},large:{style:{fontSize:"72px"},text:_e},ui:{style:{fontFamily:"ui-serif"},text:_e},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:_e},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 Te(e,t,n){const o=e.createElement("span"),{style:i={},text:r=_e}=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 Ae(e){const t=Object.values(e),n=t.some(e=>e>0),o=t.filter(e=>e>0).length,i=t.length;let r=n?o/i:0;const a=e.apple>0||e.system>0,s=[e.subpixel,e.kerning,e.ligatures,e.emoji,e.math].some(e=>e>0),c=t.reduce((e,t)=>e+t,0)/t.length,l=t.reduce((e,t)=>e+Math.pow(t-c,2),0)/t.length,u=Math.min(l/100,1);return{confidence:Math.round(100*r)/100,uniqueness:Math.round(100*u)/100,hasSystemFonts:a,hasAdvancedFeatures:s}}const De=["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"],xe="mmMwWLliI0O&1",Ie="48px",Re=["monospace","sans-serif","serif"];function Pe(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=Ie,n.style.whiteSpace="nowrap",n.textContent=xe,n}function Le(e,t,n){return Pe(e,`'${t}',${n}`)}function Ne(e,t){return Re.some((n,o)=>{const i=e[o],r=t[n];return!(!i||!r||i.offsetWidth===r.width&&i.offsetHeight===r.height)})}function Oe(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 Be=Math,Fe=()=>0;function ze(){const e=Be.acos||Fe,t=Be.acosh||Fe,n=Be.asin||Fe,o=Be.asinh||Fe,i=Be.atanh||Fe,r=Be.atan||Fe,a=Be.sin||Fe,s=Be.sinh||Fe,c=Be.cos||Fe,l=Be.cosh||Fe,u=Be.tan||Fe,d=Be.tanh||Fe,h=Be.exp||Fe,m=Be.expm1||Fe,g=Be.log1p||Fe,f=Be.cbrt||Fe,p=Be.hypot||Fe,w=Be.log10||Fe,y=Be.log2||Fe;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:Be.pow(Be.PI,-100),cbrt:f(27),hypot:p(3,4),log10:w(100),log2:y(8),acoshPf:(v=1e154,Be.log(v+Be.sqrt(v*v-1))),asinhPf:Be.log(1+Be.sqrt(2)),atanhPf:Be.log(3)/2,sinhPf:(Be.exp(1)-Be.exp(-1))/2,coshPf:(Be.exp(1)+Be.exp(-1))/2,expm1Pf:Be.exp(1)-1,tanhPf:(Be.exp(2)-1)/(Be.exp(2)+1),log1pPf:Be.log(11),precision:{float32:Be.abs(0),float64:Be.abs(2-2.0000000000000004),bigNumbers:Be.abs(1),smallNumbers:Be.abs(1e-15+2e-15-3e-15)}};var v}function Ue(){try{const e=ze();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 je(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 Ve={gdprMode:!1,includeInvasive:!0,timeout:5e3,debug:!1,excludeComponents:[]},qe=new Map;function We(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 He(e,t){qe.set(e,t)}async function Ze(e,t,n){const o=`${e}_${n.gdprMode}`,i=(r=o,qe.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 He(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 U});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 $e(e={}){const t=performance.now(),n={...Ve,...e},o=[],i=[],r={collectionTime:t,gdprMode:n.gdprMode,components:[]};if(We("canvas",n)&&b()){const e=await Ze("canvas",v,n);e?(r.canvas=e,o.push("canvas")):i.push({component:"canvas",error:"Collection failed or timeout"})}if(We("webgl",n)&&W()){const e=await Ze("webgl",V,n);e?(r.webgl=e,o.push("webgl")):i.push({component:"webgl",error:"Collection failed or timeout"})}if(We("audio",n)&&p()){const e=await Ze("audio",f,n);e?(r.audio=e,o.push("audio")):i.push({component:"audio",error:"Collection failed or timeout"})}if(We("fonts",n)&&T()){const e=await Ze("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 k)try{const o=M(E,n);t[n]=o,C(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 k)try{C(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(We("screen",n)&&x()){const e=await Ze("screen",D,n);e?(r.screen=e,o.push("screen")):i.push({component:"screen",error:"Collection failed or timeout"})}if(We("browser",n)&&y()){const e=await Ze("browser",w,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 Nt}),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(We("hardware",n))try{const{getHardwareFingerprint:e,isHardwareDetectionAvailable:t}=await Promise.resolve().then(function(){return Ut});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(We("system",n))try{const{getSystemFingerprint:e,isSystemDetectionAvailable:t}=await Promise.resolve().then(function(){return Ht});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(We("storage",n))try{const{getStorageFingerprint:e,isStorageDetectionAvailable:t}=await Promise.resolve().then(function(){return Jt});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(We("math",n))try{const{getCompleteMathFingerprint:e,isMathDetectionAvailable:t}=await Promise.resolve().then(function(){return tn});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(We("domBlockers",n))try{const{getDomBlockersFingerprint:e,isDomBlockersDetectionAvailable:t}=await Promise.resolve().then(function(){return un});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(We("accessibility",n))try{const{getAccessibilityFingerprint:e,isAccessibilityDetectionAvailable:t}=await Promise.resolve().then(function(){return Ee});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(We("browserApis",n))try{const{getBrowserApisFingerprint:e,isBrowserApisDetectionAvailable:t}=await Promise.resolve().then(function(){return kn});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(We("pluginsEnhanced",n))try{const{getEnhancedPluginFingerprint:e,isEnhancedPluginDetectionAvailable:t}=await Promise.resolve().then(function(){return Ln});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(We("mathFingerprint",n)&&function(){try{return"undefined"!=typeof Math&&"function"==typeof Math.sin}catch{return!1}}())try{const e=performance.now(),t=ze(),n=performance.now()-e;t&&(r.mathFingerprint={value:t,duration:n,analysis:je(t),hash:Ue()},o.push("mathFingerprint"))}catch(e){i.push({component:"mathFingerprint",error:e instanceof Error?e.message:"Math fingerprinting failed"})}if(We("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;$()?r.style.zoom=""+1/i.devicePixelRatio:H()&&(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(Ce))try{o[n]=Te(e,t,i)}catch(e){o[n]=0}return n(),o}catch(e){return Object.keys(Ce).reduce((e,t)=>(e[t]=0,e),{})}}(),n=performance.now()-e;t&&(r.fontPreferences={value:t,duration:n,analysis:Ae(t),hash:(a=t,Object.values(a).map(e=>Math.round(e)).join(","))},o.push("fontPreferences"))}catch(e){i.push({component:"fontPreferences",error:e instanceof Error?e.message:"Font preferences detection failed"})}var a,s,l;if(We("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:Me(t),hash:(l=t,"number"==typeof l?`status-${l}`:[l.locale,l.calendar,l.numberingSystem,l.timeZone,l.hourCycle,l.hour12?"1":"0",l.localeMatch?"1":"0",Object.values(l.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(We("accessibilityEnhanced",n)&&me())try{const e=performance.now(),t=ke(),n=performance.now()-e;t&&(r.accessibilityEnhanced={value:t,duration:n,analysis:Se(t)},o.push("accessibilityEnhanced"))}catch(e){i.push({component:"accessibilityEnhanced",error:e instanceof Error?e.message:"Enhanced accessibility detection failed"})}if(We("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=Ie,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=Re.map(e=>Pe(t,e));i.forEach(e=>o.appendChild(e));const r={};for(const e of De)r[e]=Re.map(n=>Le(t,e,n)),r[e].forEach(e=>o.appendChild(e));n.appendChild(o);const a={};Re.forEach((e,t)=>{const n=i[t];n&&(a[e]={width:n.offsetWidth,height:n.offsetHeight})});const s=[],c={};for(const e of De){const t=r[e];t&&(Ne(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:De.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={};Re.forEach(t=>{const n=document.createElement("span");n.style.fontFamily=t,n.style.fontSize=Ie,n.style.whiteSpace="nowrap",n.textContent=xe,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 De){let r=!1;for(const t of Re){const a=document.createElement("span");a.style.fontFamily=`'${i}',${t}`,a.style.fontSize=Ie,a.style.whiteSpace="nowrap",a.textContent=xe,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:De.length,detectionTime:o}}(e)}}(),n=performance.now()-e;t&&(r.enhancedFonts={value:t,duration:n,analysis:Oe(t),hash:(s=t,`${s.available.sort().join(",")}|${s.method}|${s.precision.toFixed(2)}`)},o.push("enhancedFonts"))}catch(e){i.push({component:"enhancedFonts",error:e instanceof Error?e.message:"Enhanced font detection failed"})}const u={};let h;o.forEach(e=>{const t=r[e];t&&t.value&&(u[e]=t.value)});try{const{calculateConfidence:e}=await Promise.resolve().then(function(){return Fn});h=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:h.score,level:h.level,factors:h.factors,recommendations:h.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 m={...r,hash:"",components:o,collectionTime:performance.now()-t},g={success:o.length>0,collectedComponents:o,failedComponents:i,confidence:h||r.confidence};if(o.length>0){const e=m.browser?.value,t=m.screen?.value,r=e?.userAgent||"",a=(()=>{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 s={};try{const{collectDeviceSignals:e}=await Promise.resolve().then(function(){return Zn});s=e()}catch(e){}const l={ua:(()=>{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:a,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>=2560?"4k":e>=1920?"fhd":e>=1600?"hd+":e>=1366?"hd":e>=1024?"xga":e>=768?"tablet":"mobile")(n),ratio:o>0?Math.round(n/o*10)/10:0}})():{bucket:"unknown",ratio:0},hardware:(()=>{const e=s.hardwareConcurrency,t=s.deviceMemory;if(e||t)return{cores:e?(e=>e>=16?"high":e>=8?"mid":e>=4?"normal":"low")(e):void 0,memory:t?(e=>e>=16?"high":e>=8?"mid":e>=4?"normal":"low")(t):void 0}})(),arch:s.architecture||void 0,colorBucket:(()=>{const e=s.colorDepth;if(e)return e>=32?"high":e>=24?"normal":"low"})()},f=[l.ua||"",l.platform||"",l.deviceType||"",l.screen?.bucket||"",l.timezone||""].filter(Boolean);if(f.length>=3){const e=f.join("|");let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)&4294967295;l._entropy=Math.abs(t).toString(36).substring(0,8)}const p=d(l),w={...u,_stableCore:l},y=c(w);m.hash=y,n.debug&&console.log("[RabbitTracker] Ultra-stable core vector:",{components:Object.keys(l),entropy:l._entropy,stableCoreHash:p.substring(0,16),enhancedFingerprintHash:y.substring(0,16),ua:l.ua,deviceType:l.deviceType,platform:l.platform,screenBucket:l.screen?.bucket,totalComponentsInHash:Object.keys(w).length}),g.data={...m,stableCoreHash:p,stableCoreVector:l},n.debug&&(console.log("[RabbitTracker] Fingerprint collection completed:",{collected:o.length,failed:i.length,duration:m.collectionTime,enhancedFingerprintHash:m.hash,stableCoreHash:p,confidence:h?.level||"Unknown",score:h?.score||0,collisionResistance:"Enhanced with stable + unstable components (no temporal entropy)"}),h?.recommendations.length&&console.log("[RabbitTracker] Confidence recommendations:",h.recommendations))}else g.error="No components could be collected";return g}async function Ge(){return $e({gdprMode:!0,includeInvasive:!1,excludeComponents:["canvas","webgl","audio"],timeout:2e3})}async function Xe(){return $e({gdprMode:!1,includeInvasive:!0,timeout:5e3})}class Ke{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 Je{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 Ye{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 Qe{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 et{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 Ke,websocket:()=>new Je(this.baseUrl),resource:()=>new Ye(this.baseUrl),webrtc:()=>new Qe};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 tt{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 nt{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 ot={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 it{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 tt(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 nt(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 nt(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={...ot,...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 nt(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 tt(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 et(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 Ge():await Xe();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=await fetch(o,i);if(!r.ok)throw new Error(`HTTP ${r.status}: ${r.statusText}`);const a=await r.json();return this.antiAdblockManager&&"POST"===n&&this.antiAdblockManager.send(t,e).catch(()=>{}),a}catch(o){if(this.antiAdblockManager&&"POST"===n)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")}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 rt=null;const at={init:e=>rt?(console.warn("[Zaplier] SDK already initialized"),rt):(rt=new it(e),rt),getInstance:()=>rt,track:(e,t)=>{rt?rt.track(e,t):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackPageView:e=>{rt?rt.trackPageView(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackEvent:(e,t)=>rt?rt.trackCustomEvent(e,t):(console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first"),!1),trackConversion:(e,t,n,o)=>{rt?rt.trackConversion(e,t,n,o):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackPurchase:e=>{rt?rt.trackPurchase(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackAddToCart:e=>{rt?rt.trackAddToCart(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},identify:e=>{rt?rt.identify(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},getVisitorId:()=>rt?rt.getVisitorId():null,getVisitorInfo:()=>rt?rt.getVisitorInfo():Promise.resolve(null),getUserData:()=>rt?rt.getUserData():null,enableEnhancedTracking:()=>rt?rt.enableEnhancedTracking():(console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first"),!1),disableEnhancedTracking:()=>{rt?rt.disableEnhancedTracking():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},isEnhancedMode:()=>!!rt&&rt.isEnhancedMode(),heatmap:{enable:()=>{rt?rt.heatmap.enable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},disable:()=>{rt?rt.heatmap.disable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},enableMouseTracking:()=>{rt?rt.heatmap.enableMouseTracking():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},disableMouseTracking:()=>{rt?rt.heatmap.disableMouseTracking():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},getStats:()=>rt?rt.heatmap.getStats():null,isRecording:()=>!!rt&&rt.heatmap.isRecording()},replay:{enable:()=>{rt?rt.replay.enable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},disable:()=>{rt?rt.replay.disable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},start:()=>rt?rt.replay.start():(console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first"),!1),stop:()=>{rt?rt.replay.stop():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},isRecording:()=>!!rt&&rt.replay.isRecording(),getEventCount:()=>rt?rt.replay.getEventCount():0,addFunnelStep:e=>{rt?rt.replay.addFunnelStep(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},markConversion:e=>{rt?rt.replay.markConversion(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")}},debug:{getStats:()=>rt&&rt.antiAdblockManager?rt.antiAdblockManager.getStats():null,getSuccessRates:()=>rt&&rt.antiAdblockManager?rt.antiAdblockManager.getSuccessRates():null,testTransports:()=>rt&&rt.antiAdblockManager?rt.antiAdblockManager.testTransports():Promise.resolve(null)},version:"3.0.0"};function st(){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{at.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=at,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",st):st());const ct=[/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],lt=[/^Mozilla\/5\.0$/,/Headless/i,/automated/i,/testing/i,/^$/];function ut(){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 dt(){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 ht(){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 mt(){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 gt(){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 ft(){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 pt(){const e=navigator.userAgent,t=ct.filter(t=>t.test(e)),n=lt.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 wt(){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 yt(){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 vt(){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 bt(){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 kt(){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 St(){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 Et(){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 Mt(){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 _t(){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 Ct(e,t){return new Promise(n=>{setTimeout(()=>{n({detected:!1,confidence:0,method:`${t}_timeout`})},e)})}function Tt(){try{return"object"==typeof window.chrome&&null!==window.chrome&&"object"==typeof window.chrome.runtime}catch{return!1}}function At(){return navigator.userAgent.includes("WebKit")&&!navigator.userAgent.includes("Chrome")}function Dt(){return navigator.userAgent.includes("Gecko")&&!navigator.userAgent.includes("Chrome")}function xt(){return navigator.userAgent.includes("SamsungBrowser")||navigator.userAgent.includes("Samsung Internet")}function It(){return navigator.userAgent.includes("iPad")||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1}function Rt(){return navigator.userAgent.includes("Android")}function Pt(e,t){const n=e.match(t);return n&&n[1]||"Unknown"}function Lt(e){const t=e.toLowerCase();return t.includes("tablet")||It()?It()?{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")||Rt()?t.includes("iphone")?{type:"mobile",vendor:"Apple",model:"iPhone"}:t.includes("ipod")?{type:"mobile",vendor:"Apple",model:"iPod"}:Rt()&&t.includes("mobile")?{type:"mobile",vendor:"Android"}:{type:"mobile"}:{type:"desktop"}}var Nt=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 Ot(){try{if("deviceMemory"in navigator){const e=navigator.deviceMemory;return"number"==typeof e?e:null}return null}catch{return null}}function Bt(){try{if("hardwareConcurrency"in navigator){const e=navigator.hardwareConcurrency;return"number"==typeof e?e:null}return null}catch{return null}}function Ft(){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 zt(){try{return navigator.maxTouchPoints||0}catch{return 0}}var Ut=Object.freeze({__proto__:null,getArchitecture:Ft,getDeviceMemory:Ot,getHardwareConcurrency:Bt,getHardwareFingerprint:function(){return{deviceMemory:Ot(),hardwareConcurrency:Bt(),architecture:Ft(),maxTouchPoints:zt(),platform:navigator.platform||"unknown"}},getMaxTouchPoints:zt,isHardwareDetectionAvailable:function(){return"undefined"!=typeof navigator}});function jt(){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 Vt(){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 qt(){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 Wt(){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 Ht=Object.freeze({__proto__:null,getDateTimeLocale:qt,getLanguages:Vt,getPlatformExtended:Wt,getSystemFingerprint:function(){return{timezone:jt(),languages:Vt(),dateTimeLocale:qt(),platform:Wt(),cookiesEnabled:navigator.cookieEnabled||!1}},getTimezone:jt,isSystemDetectionAvailable:function(){return"undefined"!=typeof navigator}});function Zt(){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 $t(){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 Gt(){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 Xt(){try{return"openDatabase"in window&&"function"==typeof window.openDatabase}catch{return!1}}async function Kt(){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 Jt=Object.freeze({__proto__:null,getIndexedDBSupport:Gt,getLocalStorageSupport:Zt,getSessionStorageSupport:$t,getStorageFingerprint:async function(){const[e,t]=await Promise.all([Gt(),Kt()]);return{localStorage:Zt(),sessionStorage:$t(),indexedDB:e,webSQL:Xt(),quota:t}},getStorageQuota:Kt,getWebSQLSupport:Xt,isStorageDetectionAvailable:function(){return"undefined"!=typeof window}});function Yt(){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,k=t=>(e.exp(t)+1/e.exp(t))/2,S=t=>e.exp(t)-1,E=t=>(e.exp(2*t)-1)/(e.exp(2*t)+1),M=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:(_=1e154,e.log(_+e.sqrt(_*_-1))),asinh:r(1),asinhPf:y(1),atanh:a(.5),atanhPf:v(.5),cosh:d(1),coshPf:k(1),sinh:l(1),sinhPf:b(1),tanh:m(1),tanhPf:E(1),exp:g(1),expm1:f(1),expm1Pf:S(1),log1p:p(10),log1pPf:M(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 _}function Qt(){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 en(){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 tn=Object.freeze({__proto__:null,getCompleteMathFingerprint:function(){return{operations:Yt(),constants:Qt(),floatingPoint:en()}},getFloatingPointBehavior:en,getMathConstants:Qt,getMathFingerprint:Yt,isMathDetectionAvailable:function(){return"undefined"!=typeof Math}});function nn(){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 on(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 rn(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 an(e){return new Promise(t=>setTimeout(t,e))}async function sn(e){const t=document,n=t.createElement("div"),o=new Array(e.length),i={};rn(n);const r=t.createDocumentFragment();for(let n=0;n<e.length;n++){const i=e[n];if(i)try{const e=on(i),a=t.createElement("div");"DIALOG"===e.tagName&&e.show?.(),rn(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 an(50),a++;if(!t.body)throw new Error("Document body not available for DOM blockers detection");t.body.appendChild(n);try{await an(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 cn(e={}){const{debug:t=!1,timeout:n=5e3}=e;try{if(!ln())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=nn(),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([sn(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 ln(){return te().canRunDOMBlockers}var un=Object.freeze({__proto__:null,getBlockedSelectors:sn,getBlockerFilters:nn,getDomBlockers:cn,getDomBlockersFingerprint:async function(e={}){const t=await cn(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:ln});function dn(){try{return $()?navigator.pdfViewerEnabled??null:null}catch{return null}}function hn(){try{if(!function(){try{return H()&&!$()&&!X()&&Boolean(window.safari)&&/safari/i.test(navigator.userAgent)}catch{return!1}}())return-1;const{ApplePaySession:e}=window;if("function"!=typeof e?.canMakePayments)return-1;if(!K())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 mn(){try{return"attributionReporting"in window||"privateClickMeasurement"in window||null}catch{return null}}function gn(){const e={enabled:!1,sameSiteSupport:!1,secureSupport:!1,partitionedSupport:!1};try{if(e.enabled=navigator.cookieEnabled,!e.enabled)return e;e.sameSiteSupport=fn("__rb_test_samesite","SameSite=Strict"),K()&&(e.secureSupport=fn("__rb_test_secure","Secure")),K()&&$()&&(e.partitionedSupport=fn("__rb_test_partitioned","Partitioned; Secure; SameSite=None"))}catch{}return e}function fn(e,t){try{const n="1",o=`${e}=${n}; ${t}; path=/`;document.cookie=o;const i=document.cookie.includes(`${e}=${n}`);return pn(e),i}catch{return pn(e),!1}}function pn(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 wn(){try{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");return t?(t.getSupportedExtensions()||[]).sort():[]}catch{return[]}}function yn(){try{const e=performance.memory;return e?{usedJSHeapSize:e.usedJSHeapSize,totalJSHeapSize:e.totalJSHeapSize,jsHeapSizeLimit:e.jsHeapSizeLimit}:null}catch{return null}}function vn(){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 bn(){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 kn=Object.freeze({__proto__:null,getApplePayState:hn,getBrowserApisFingerprint:function(){const e=dn(),t=hn(),n=mn(),o=gn(),i=wn(),r=yn(),a=vn(),s=bn();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:vn,getCookieCapabilities:gn,getPdfViewerEnabled:dn,getPerformanceMemory:yn,getPrivateClickMeasurement:mn,getVendorProperties:bn,getWebGLExtensions:wn,isBrowserApisDetectionAvailable:function(){return"undefined"!=typeof window&&"undefined"!=typeof navigator}});function Sn(){try{if(!Pn())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 En(){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 Mn(){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 _n(){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 Cn(){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 Tn(){try{if(!$())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 An(){try{if(!G())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 Dn(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 xn(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 In(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 Rn(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 Pn(){return te().canRunBrowserAPIs&&"undefined"!=typeof navigator}var Ln=Object.freeze({__proto__:null,calculateSecurityScore:In,detectChromeExtensionsBlocked:Tn,detectFirefoxExtensionsBlocked:An,generatePluginSignature:Rn,getEnhancedPluginFingerprint:function(){const e=Sn(),t=Array.isArray(e)?e:[],n=En(),o=Array.isArray(n)?n:[],i=Mn(),r=_n(),a=Cn(),s=Tn(),c="boolean"==typeof s&&s,l=An(),u="boolean"==typeof l&&l,d=Dn(t),h=xn(t),m=Rn(t,o),g=In(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:En,getNavigatorPlugins:Sn,identifyAdBlockerPlugins:xn,identifySecurityPlugins:Dn,isEnhancedPluginDetectionAvailable:Pn,testFlashEnabled:Mn,testJavaEnabled:_n,testSilverlightEnabled:Cn});const Nn={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}},On={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 Bn(e){const t=Nn[e]||On[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 Fn=Object.freeze({__proto__:null,ADVANCED_COMPONENT_CHARACTERISTICS:On,COMPONENT_CHARACTERISTICS:Nn,calculateComponentWeight:Bn,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=Bn(e.component),n=Nn[e.component]||On[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 zn(){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 Un(){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 jn(){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 Vn(){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 qn(){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 Wn(){try{return screen.colorDepth||void 0}catch{return}}function Hn(){try{for(const e of["rec2020","p3","srgb"])if(window.matchMedia(`(color-gamut: ${e})`).matches)return e;return}catch{return}}var Zn=Object.freeze({__proto__:null,collectDeviceSignals:function(){return{screenFrame:zn(),hardwareConcurrency:navigator.hardwareConcurrency||void 0,deviceMemory:qn(),architecture:Un(),touchSupport:jn(),vendorFlavors:Vn(),cpuClass:navigator.cpuClass||void 0,colorDepth:Wn(),colorGamut:Hn()}}});return e.Zaplier=at,e.ZaplierSDK=it,e.analyzeUserAgent=function(e){const t=e||navigator.userAgent||"",n=function(e){const t=e.toLowerCase();if(t.includes("edg/")){const t=Pt(e,/edg\/([0-9.]+)/i);return{name:"Edge",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("edge/")){const t=Pt(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=Pt(e,/chrome\/([0-9.]+)/i);return{name:"Brave",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(xt()){const t=Pt(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=Pt(e,/chrome\/([0-9.]+)/i);return{name:"Chrome",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("firefox/")){const t=Pt(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=Pt(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=Pt(e,/(?:opr|opera)\/([0-9.]+)/i);return{name:"Opera",version:t,major:t.split(".")[0]||"Unknown",engine:Tt()?"chromium":"unknown"}}if(t.includes("vivaldi/")){const t=Pt(e,/vivaldi\/([0-9.]+)/i);return{name:"Vivaldi",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("yabrowser/")){const t=Pt(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=Pt(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=Pt(e,/ucbrowser\/([0-9.]+)/i);return{name:"UC Browser",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("qqbrowser/")){const t=Pt(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=Pt(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:Pt(e,/mac os x ([0-9._]+)/i).replace(/_/g,"."),family:"macos"}:t.includes("iphone")||t.includes("ipad")||t.includes("ipod")||It()?{name:"iOS",version:Pt(e,/os ([0-9._]+)/i).replace(/_/g,"."),family:"ios"}:Rt()?{name:"Android",version:Pt(e,/android ([0-9.]+)/i),family:"android"}:t.includes("linux")?{name:"Linux",version:"Unknown",family:"linux"}:t.includes("cros")?{name:"Chrome OS",version:Pt(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=Lt(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=st,e.clearFingerprintCache=function(){qe.clear()},e.collectFingerprint=$e,e.default=it,e.detectBot=async function(){const e={webDriver:ut(),headlessBrowser:dt(),automationTools:ht(),domBlockers:mt(),missingLanguages:gt(),inconsistentEval:ft(),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=pt(),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([wt(),Ct(r,"localStorage")]),Promise.race([yt(),Ct(r,"sessionStorage")]),Promise.race([vt(),Ct(r,"indexedDB")]),Promise.race([bt(),Ct(r,"permissions")]),Promise.race([kt(),Ct(r,"quotaManagement")]),Promise.race([Mt(),Ct(r,"filesystem")]),Promise.race([_t(),Ct(r,"cacheDetection")]),Promise.race([St(),Ct(r,"chromeSpecific")]),Promise.race([Et(),Ct(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,k="fulfilled"===a.status?a.value:{detected:!1},S="fulfilled"===s.status?s.value:{detected:!1},E="fulfilled"===c.status?c.value:{detected:!1},M="fulfilled"===l.status?l.value:{},_="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:k?.detected??!1,sessionStorage:S?.detected??!1,indexedDB:E?.detected??!1,cookiesEnabled:!1,quota:_?.detected?0:null,permissions:M?.details||{}}}},e.generateVisitorId=l,e.generateVisitorIdFromFingerprint=function(e){return l(e.hash)},e.getAvailableComponents=function(){const e=[];return b()&&e.push("canvas"),W()&&e.push("webgl"),p()&&e.push("audio"),T()&&e.push("fonts"),x()&&e.push("screen"),y()&&e.push("browser"),e},e.getBrowserEngine=function(){return Tt()?"chromium":At()?"webkit":Dt()?"gecko":navigator.userAgent.toLowerCase().includes("trident")?"trident":"unknown"},e.getCompleteFingerprint=Xe,e.getLightweightFingerprint=Ge,e.hash32=s,e.hashFingerprint=c,e.isAndroid=Rt,e.isChromium=Tt,e.isDesktop=function(){return"desktop"===Lt(navigator.userAgent).type},e.isFingerprintingAvailable=function(){return x()&&y()},e.isGecko=Dt,e.isIPad=It,e.isMobile=function(){return"mobile"===Lt(navigator.userAgent).type},e.isSamsungInternet=xt,e.isTablet=function(){return"tablet"===Lt(navigator.userAgent).type},e.isWebKit=At,e.quickBotDetection=async function(){const e=ut(),t=pt();return e.detected||(t.suspicious?.isBot??!1)},e.quickIncognitoDetection=async function(){try{const[e,t]=await Promise.all([wt(),vt()]);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].toString(16).padStart(8,"0")+l[1].toString(16).padStart(8,"0")+(u[0].toString(16).padStart(8,"0")+u[1].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){return a(JSON.stringify(e,Object.keys(e).sort()))}function l(e){return"vis_"+e.substring(0,16)}function u(e){if(null==e)return null;if(Array.isArray(e))return e.map(e=>u(e)).filter(e=>null!==e).sort((e,t)=>JSON.stringify(e).localeCompare(JSON.stringify(t)));if("object"==typeof e){const t=Object.keys(e).sort(),n={};for(const o of t){const t=u(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}function d(e){return a(JSON.stringify(u(e)))}function h(){try{const e=window.OfflineAudioContext||window.webkitOfflineAudioContext;if(!e)return null;const t=44100,n=.1;return new e(1,Math.floor(t*n),t)}catch{return null}}async function m(e){try{const t=e.createOscillator(),n=e.createDynamicsCompressor();t.type="triangle",t.frequency.setValueAtTime(1e3,e.currentTime),n.threshold.setValueAtTime(-50,e.currentTime),n.knee.setValueAtTime(40,e.currentTime),n.ratio.setValueAtTime(12,e.currentTime),n.attack.setValueAtTime(.003,e.currentTime),n.release.setValueAtTime(.25,e.currentTime),t.connect(n),n.connect(e.destination),t.start(),t.stop(.1);const o=(await e.startRendering()).getChannelData(0);return s([o[0]||0,o[Math.floor(.33*o.length)]||0,o[Math.floor(.66*o.length)]||0,o[o.length-1]||0].join(","))}catch(e){return s("oscillator_error")}}async function g(e){try{const t=e.createOscillator(),n=e.createDynamicsCompressor();t.type="triangle",t.frequency.setValueAtTime(1e3,e.currentTime),n.threshold.setValueAtTime(-50,e.currentTime),n.knee.setValueAtTime(40,e.currentTime),n.ratio.setValueAtTime(12,e.currentTime),n.attack.setValueAtTime(.003,e.currentTime),n.release.setValueAtTime(.25,e.currentTime),t.connect(n),n.connect(e.destination),t.start(),t.stop(.1);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 f(){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=h();if(!n)throw new Error("OfflineAudioContext not available");const o=h();if(!o)throw new Error("OfflineAudioContext not available for compressor");const[i,r]=await Promise.all([m(n).catch(()=>"oscillator_error"),g(o).catch(()=>"compressor_error")]);return{value:{oscillator:i,compressor:r,sampleRate:t,maxChannelCount:2},duration:performance.now()-e}}catch(t){return{value:{oscillator:"error",compressor:"error",sampleRate:0,maxChannelCount:0},duration:performance.now()-e,error:t instanceof Error?t.message:"Audio fingerprinting failed"}}}function p(){try{return"function"==typeof(window.OfflineAudioContext||window.webkitOfflineAudioContext)||"function"==typeof(window.AudioContext||window.webkitAudioContext)}catch{return!1}}async function w(){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=performance.now(),l={language:t.language,languages:t.languages,timezone:n.timezone,timezoneOffset:n.timezoneOffset,platform:o.platform,userAgent:o.userAgent,hardwareConcurrency:i.hardwareConcurrency,cookieEnabled:r.cookieEnabled,doNotTrack:r.doNotTrack,plugins:a,touchSupport:s};return void 0!==i.deviceMemory&&(l.deviceMemory=i.deviceMemory),{value:l,duration:c-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 y(){try{return"object"==typeof navigator&&null!==navigator}catch{return!1}}async function v(){const e=performance.now();try{const t=document.createElement("canvas");t.width=200,t.height=250;const n=t.getContext("2d");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");!function(e){e.textBaseline="top",e.font="14px Arial, sans-serif",e.fillStyle="#000",e.fillText("RabbitTracker Canvas 🎨 🔒 2024",4,140),e.font="12px Georgia, serif",e.fillStyle="#666",e.fillText("Georgia Font Test",4,160),e.font="bold 16px Helvetica",e.fillStyle="#333",e.fillText("Bold Helvetica",4,180),e.save(),e.scale(1.2,.8),e.font="10px Courier New",e.fillStyle="#999",e.fillText("Transformed Text",4,220),e.restore()}(n);const i=t.toDataURL();n.clearRect(0,0,t.width,t.height),function(e){e.fillStyle="rgb(102, 204, 0)",e.fillRect(10,10,50,50),e.fillStyle="#f60",e.fillRect(70,10,50,50),e.beginPath(),e.arc(50,80,20,0,2*Math.PI,!0),e.closePath(),e.fill(),e.beginPath(),e.moveTo(100,80),e.lineTo(120,120),e.lineTo(80,120),e.closePath(),e.stroke();const t=e.createLinearGradient(0,0,150,150);t.addColorStop(0,"red"),t.addColorStop(1,"blue"),e.fillStyle=t,e.fillRect(130,10,50,50)}(n);const r=t.toDataURL(),a=function(e,t,n){try{return n.getImageData(0,0,1,1),e.length<100||t.length<100||!(e.includes("data:image/png")&&t.includes("data:image/png"))}catch(e){return!0}}(i,r,n),c=performance.now();return{value:{text:s(i),geometry:s(r),winding:o,isInconsistent:a},duration:c-e}}catch(t){return{value:{text:"error",geometry:"error",winding:!1,isInconsistent:!0},duration:performance.now()-e,error:t instanceof Error?t.message:"Canvas fingerprinting failed"}}}function b(){try{const e=document.createElement("canvas").getContext("2d");return null!==e&&"function"==typeof e.fillText}catch{return!1}}const k=["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"],S=["monospace","sans-serif","serif"],E="mmMwWLliI0O&1 ※";function M(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 _(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 T(e,t="canvas"){const n="canvas"===t?M:_,o=S.map(e=>n(E,e)),i=S.map(t=>n(E,`${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 C(){try{const e=document.createElement("span");return e&&"object"==typeof e.style}catch{return!1}}function A(e){return 10*Math.round(e/10)}async function D(){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:A(screen.width||0),height:A(screen.height||0)}:{width:A(e),height:A(t)}}catch{return{width:A(screen.width||0),height:A(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:A(t),height:A(n)}}catch{const e=window.innerWidth||0,t=window.innerHeight||0;return{width:A(e),height:A(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 x(){try{return"object"==typeof screen&&"number"==typeof screen.width&&"number"==typeof screen.height}catch{return!1}}let I=null,R=0,P=0;function L(){try{const e=Date.now();if(I&&I.isValid)if(e-I.timestamp<18e5){if(I.context&&!I.context.isContextLost())return I.usageCount++,I.lastUsed=e,I.context;N()}else N();if(R>=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?(R++,P++,I={context:n,canvas:t,timestamp:e,isValid:!0,usageCount:1,lastUsed:e},n):null}catch(e){return N(),null}}function N(){if(I){try{if(I.context){const e=I.context.getExtension("WEBGL_lose_context");e&&e.loseContext()}I.canvas&&(I.canvas.width=0,I.canvas.height=0),R>0&&R--}catch{R>0&&R--}I.isValid=!1,I=null}}function O(){if(!I||!I.context)return!1;try{return!I.context.isContextLost()}catch{return!1}}function B(){const e=L();if(!e)return[];try{const t=e.getSupportedExtensions();return t?Array.from(t).sort():[]}catch{return[]}}function F(){const e=L();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 z(){try{N(),R=0,P=0}catch(e){console.warn("[WebGL Cache] Cleanup error:",e)}}if("undefined"!=typeof window&&(window.addEventListener("beforeunload",z),window.addEventListener("pagehide",z),window.addEventListener("unload",z),document.addEventListener("visibilitychange",()=>{}),"memory"in performance&&"function"==typeof performance.memory.addEventListener))try{performance.memory.addEventListener("memorypressure",z)}catch(e){}var U=Object.freeze({__proto__:null,cleanupWebGLCache:z,forceCleanupWebGL:function(){N(),R=0},getCachedWebGLContext:L,getCachedWebGLExtensions:B,getCachedWebGLParameters:F,invalidateWebGLCache:N,isWebGLContextValid:O});const j={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};async function V(){const e=performance.now();try{if(!W())throw new Error("WebGL not supported in this browser");const t=L();if(!t)throw new Error("WebGL context not available");if(!O())throw new Error("WebGL context lost");const n=function(){try{return F()}catch{return{}}}(),o=n.VENDOR||"unknown",i=n.RENDERER||"unknown",r=n.VERSION||"unknown";let a=o,s=i;try{const e=t.getExtension("WEBGL_debug_renderer_info");e&&(a=t.getParameter(e.UNMASKED_VENDOR_WEBGL)||o,s=t.getParameter(e.UNMASKED_RENDERER_WEBGL)||i)}catch{}const c=function(){try{return B()}catch{return[]}}(),l=function(e){const t={};return Object.entries(j).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);return{value:{vendor:a,renderer:s,version:r,extensions:c,parameters:l,shaderPrecision:u},duration:performance.now()-e}}catch(t){return{value:{vendor:"unknown",renderer:"unknown",version:"unknown",extensions:[],parameters:{},shaderPrecision:{vertex:"",fragment:""}},duration:performance.now()-e,error:t instanceof Error?t.message:"WebGL fingerprinting failed"}}}let q=null;function W(){if(null!==q)return q;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,q=n,n}catch{return q=!1,!1}}function Z(){try{return"WebKitAppearance"in document.documentElement.style||"webkitRequestFileSystem"in window||"webkitResolveLocalFileSystemURL"in window||Boolean(window.safari)}catch{return!1}}function H(){try{return"ontouchstart"in window&&("orientation"in window||"onorientationchange"in window)&&/android/i.test(navigator.userAgent)}catch{return!1}}function $(){try{return Boolean(window.chrome&&(window.chrome.webstore||window.chrome.runtime))}catch{return!1}}function G(){try{return"InstallTrigger"in window||"mozInnerScreenX"in window||"mozPaintCount"in window||Boolean(navigator.mozApps)}catch{return!1}}function X(){try{return"msCredentials"in navigator||Boolean(window.StyleMedia)||$()&&/edg/i.test(navigator.userAgent)}catch{return!1}}function K(){try{return window.isSecureContext||"https:"===location.protocol}catch{return!1}}function J(){try{return"webkitTemporaryStorage"in navigator||navigator.storage&&navigator.storage.estimate&&navigator.storage.estimate().then(e=>(e.quota||0)<104857600),!1}catch{return!1}}function Y(){try{return"undefined"!=typeof document&&"function"==typeof document.createElement&&void 0!==document.body}catch{return!1}}function Q(){try{if(!Y())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);return Boolean(o&&"string"==typeof o)}catch{return!1}}function ee(){try{return!(!window.AudioContext&&!window.webkitAudioContext)}catch{return!1}}function te(){const e=Y(),t=function(){try{return"undefined"!=typeof window&&"function"==typeof window.matchMedia}catch{return!1}}();return{engine:$()?"Blink":G()?"Gecko":Z()?"WebKit":X()?"EdgeHTML/Blink":"Unknown",supportsDOM:e,supportsMediaQueries:t,supportsWebGL:Q(),supportsAudio:ee(),isSecure:K(),isPrivateMode:J(),canRunDOMBlockers:(Z()||H())&&e,canRunAccessibility:t,canRunBrowserAPIs:e&&"undefined"!=typeof navigator}}function ne(){try{for(const e of["rec2020","p3","srgb"]){const t=ge(`(color-gamut: ${e})`);if(t?.matches)return e}return"unknown"}catch{return"unknown"}}function oe(){try{const e=ge("(forced-colors: active)");if(e?.matches)return!0;const t=ge("(forced-colors: none)");return!t?.matches&&null}catch{return null}}function ie(){try{const e=["no-preference","high","more","low","less","forced"];for(const t of e){const e=ge(`(prefers-contrast: ${t})`);if(e?.matches)return"high"===t?"more":"low"===t?"less":t}return"unknown"}catch{return"unknown"}}function re(){try{const e=ge("(prefers-reduced-motion: reduce)");if(e?.matches)return!0;const t=ge("(prefers-reduced-motion: no-preference)");return!t?.matches&&null}catch{return null}}function ae(){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 ce(){try{return!!matchMedia("(inverted-colors: inverted)").matches||!matchMedia("(inverted-colors: none)").matches&&null}catch{return null}}function le(){try{return!!matchMedia("(dynamic-range: high)").matches||!matchMedia("(dynamic-range: standard)").matches&&null}catch{return null}}function ue(){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 de(){try{return matchMedia("(hover: hover)").matches?"hover":matchMedia("(hover: none)").matches?"none":"unknown"}catch{return"unknown"}}function he(){try{return matchMedia("(pointer: fine)").matches?"fine":matchMedia("(pointer: coarse)").matches?"coarse":matchMedia("(pointer: none)").matches?"none":"unknown"}catch{return"unknown"}}function me(){return te().canRunAccessibility}function ge(e){try{return me()?matchMedia(e):null}catch(e){return null}}function fe(){try{return!!matchMedia("(prefers-reduced-data: reduce)").matches||!matchMedia("(prefers-reduced-data: no-preference)").matches&&null}catch{return null}}function pe(){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 we(){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 ye(){try{return!!matchMedia("(any-hover: hover)").matches||!matchMedia("(any-hover: none)").matches&&null}catch{return null}}function ve(){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 be(){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 ke(){const e=ne(),t=oe(),n=ie(),o=re(),i=ae(),r=se(),a=ce(),s=le(),c=ue(),l=de(),u=he(),d=fe(),h=pe(),m=we(),g=ye(),f=ve(),p=be(),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 Se(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 Ee=Object.freeze({__proto__:null,analyzeAccessibilityFingerprint:Se,getAccessibilityFingerprint:ke,getAnyHover:ye,getAnyPointer:ve,getColorGamut:ne,getColorScheme:be,getContrastPreference:ie,getDisplayMode:pe,getEnhancedColorDepth:ue,getEnvironmentBlending:we,getForcedColors:oe,getHDRSupport:le,getHoverCapability:de,getInvertedColors:ce,getMonochromeDepth:se,getPointerCapability:he,getReducedData:fe,getReducedMotion:re,getReducedTransparency:ae,isAccessibilityDetectionAvailable:me});function Me(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 _e="mmMwWLliI0fiflO&1",Te={default:{text:_e},serif:{style:{fontFamily:"serif"},text:_e},sans:{style:{fontFamily:"sans-serif"},text:_e},mono:{style:{fontFamily:"monospace"},text:_e},apple:{style:{font:"-apple-system-body"},text:_e},system:{style:{fontFamily:"system-ui"},text:_e},min:{style:{fontSize:"1px"},text:_e},large:{style:{fontSize:"72px"},text:_e},ui:{style:{fontFamily:"ui-serif"},text:_e},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:_e},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 Ce(e,t,n){const o=e.createElement("span"),{style:i={},text:r=_e}=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 Ae(e){const t=Object.values(e),n=t.some(e=>e>0),o=t.filter(e=>e>0).length,i=t.length;let r=n?o/i:0;const a=e.apple>0||e.system>0,s=[e.subpixel,e.kerning,e.ligatures,e.emoji,e.math].some(e=>e>0),c=t.reduce((e,t)=>e+t,0)/t.length,l=t.reduce((e,t)=>e+Math.pow(t-c,2),0)/t.length,u=Math.min(l/100,1);return{confidence:Math.round(100*r)/100,uniqueness:Math.round(100*u)/100,hasSystemFonts:a,hasAdvancedFeatures:s}}const De=["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"],xe="mmMwWLliI0O&1",Ie="48px",Re=["monospace","sans-serif","serif"];function Pe(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=Ie,n.style.whiteSpace="nowrap",n.textContent=xe,n}function Le(e,t,n){return Pe(e,`'${t}',${n}`)}function Ne(e,t){return Re.some((n,o)=>{const i=e[o],r=t[n];return!(!i||!r||i.offsetWidth===r.width&&i.offsetHeight===r.height)})}function Oe(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 Be=Math,Fe=()=>0;function ze(){const e=Be.acos||Fe,t=Be.acosh||Fe,n=Be.asin||Fe,o=Be.asinh||Fe,i=Be.atanh||Fe,r=Be.atan||Fe,a=Be.sin||Fe,s=Be.sinh||Fe,c=Be.cos||Fe,l=Be.cosh||Fe,u=Be.tan||Fe,d=Be.tanh||Fe,h=Be.exp||Fe,m=Be.expm1||Fe,g=Be.log1p||Fe,f=Be.cbrt||Fe,p=Be.hypot||Fe,w=Be.log10||Fe,y=Be.log2||Fe;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:Be.pow(Be.PI,-100),cbrt:f(27),hypot:p(3,4),log10:w(100),log2:y(8),acoshPf:(v=1e154,Be.log(v+Be.sqrt(v*v-1))),asinhPf:Be.log(1+Be.sqrt(2)),atanhPf:Be.log(3)/2,sinhPf:(Be.exp(1)-Be.exp(-1))/2,coshPf:(Be.exp(1)+Be.exp(-1))/2,expm1Pf:Be.exp(1)-1,tanhPf:(Be.exp(2)-1)/(Be.exp(2)+1),log1pPf:Be.log(11),precision:{float32:Be.abs(0),float64:Be.abs(2-2.0000000000000004),bigNumbers:Be.abs(1),smallNumbers:Be.abs(1e-15+2e-15-3e-15)}};var v}function Ue(){try{const e=ze();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 je(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 Ve={gdprMode:!1,includeInvasive:!0,timeout:5e3,debug:!1,excludeComponents:[]},qe=new Map;function We(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 Ze(e,t){qe.set(e,t)}async function He(e,t,n){const o=`${e}_${n.gdprMode}`,i=(r=o,qe.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 Ze(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 U});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 $e(e={}){const t=performance.now(),n={...Ve,...e},o=[],i=[],r={collectionTime:t,gdprMode:n.gdprMode,components:[]};if(We("canvas",n)&&b()){const e=await He("canvas",v,n);e?(r.canvas=e,o.push("canvas")):i.push({component:"canvas",error:"Collection failed or timeout"})}if(We("webgl",n)&&W()){const e=await He("webgl",V,n);e?(r.webgl=e,o.push("webgl")):i.push({component:"webgl",error:"Collection failed or timeout"})}if(We("audio",n)&&p()){const e=await He("audio",f,n);e?(r.audio=e,o.push("audio")):i.push({component:"audio",error:"Collection failed or timeout"})}if(We("fonts",n)&&C()){const e=await He("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 k)try{const o=M(E,n);t[n]=o,T(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 k)try{T(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(We("screen",n)&&x()){const e=await He("screen",D,n);e?(r.screen=e,o.push("screen")):i.push({component:"screen",error:"Collection failed or timeout"})}if(We("browser",n)&&y()){const e=await He("browser",w,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 Nt}),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(We("hardware",n))try{const{getHardwareFingerprint:e,isHardwareDetectionAvailable:t}=await Promise.resolve().then(function(){return Ut});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(We("system",n))try{const{getSystemFingerprint:e,isSystemDetectionAvailable:t}=await Promise.resolve().then(function(){return Zt});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(We("storage",n))try{const{getStorageFingerprint:e,isStorageDetectionAvailable:t}=await Promise.resolve().then(function(){return Jt});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(We("math",n))try{const{getCompleteMathFingerprint:e,isMathDetectionAvailable:t}=await Promise.resolve().then(function(){return tn});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(We("domBlockers",n))try{const{getDomBlockersFingerprint:e,isDomBlockersDetectionAvailable:t}=await Promise.resolve().then(function(){return un});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(We("accessibility",n))try{const{getAccessibilityFingerprint:e,isAccessibilityDetectionAvailable:t}=await Promise.resolve().then(function(){return Ee});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(We("browserApis",n))try{const{getBrowserApisFingerprint:e,isBrowserApisDetectionAvailable:t}=await Promise.resolve().then(function(){return kn});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(We("pluginsEnhanced",n))try{const{getEnhancedPluginFingerprint:e,isEnhancedPluginDetectionAvailable:t}=await Promise.resolve().then(function(){return Ln});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(We("mathFingerprint",n)&&function(){try{return"undefined"!=typeof Math&&"function"==typeof Math.sin}catch{return!1}}())try{const e=performance.now(),t=ze(),n=performance.now()-e;t&&(r.mathFingerprint={value:t,duration:n,analysis:je(t),hash:Ue()},o.push("mathFingerprint"))}catch(e){i.push({component:"mathFingerprint",error:e instanceof Error?e.message:"Math fingerprinting failed"})}if(We("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;$()?r.style.zoom=""+1/i.devicePixelRatio:Z()&&(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(Te))try{o[n]=Ce(e,t,i)}catch(e){o[n]=0}return n(),o}catch(e){return Object.keys(Te).reduce((e,t)=>(e[t]=0,e),{})}}(),n=performance.now()-e;t&&(r.fontPreferences={value:t,duration:n,analysis:Ae(t),hash:(a=t,Object.values(a).map(e=>Math.round(e)).join(","))},o.push("fontPreferences"))}catch(e){i.push({component:"fontPreferences",error:e instanceof Error?e.message:"Font preferences detection failed"})}var a,s,l;if(We("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:Me(t),hash:(l=t,"number"==typeof l?`status-${l}`:[l.locale,l.calendar,l.numberingSystem,l.timeZone,l.hourCycle,l.hour12?"1":"0",l.localeMatch?"1":"0",Object.values(l.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(We("accessibilityEnhanced",n)&&me())try{const e=performance.now(),t=ke(),n=performance.now()-e;t&&(r.accessibilityEnhanced={value:t,duration:n,analysis:Se(t)},o.push("accessibilityEnhanced"))}catch(e){i.push({component:"accessibilityEnhanced",error:e instanceof Error?e.message:"Enhanced accessibility detection failed"})}if(We("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=Ie,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=Re.map(e=>Pe(t,e));i.forEach(e=>o.appendChild(e));const r={};for(const e of De)r[e]=Re.map(n=>Le(t,e,n)),r[e].forEach(e=>o.appendChild(e));n.appendChild(o);const a={};Re.forEach((e,t)=>{const n=i[t];n&&(a[e]={width:n.offsetWidth,height:n.offsetHeight})});const s=[],c={};for(const e of De){const t=r[e];t&&(Ne(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:De.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={};Re.forEach(t=>{const n=document.createElement("span");n.style.fontFamily=t,n.style.fontSize=Ie,n.style.whiteSpace="nowrap",n.textContent=xe,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 De){let r=!1;for(const t of Re){const a=document.createElement("span");a.style.fontFamily=`'${i}',${t}`,a.style.fontSize=Ie,a.style.whiteSpace="nowrap",a.textContent=xe,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:De.length,detectionTime:o}}(e)}}(),n=performance.now()-e;t&&(r.enhancedFonts={value:t,duration:n,analysis:Oe(t),hash:(s=t,`${s.available.sort().join(",")}|${s.method}|${s.precision.toFixed(2)}`)},o.push("enhancedFonts"))}catch(e){i.push({component:"enhancedFonts",error:e instanceof Error?e.message:"Enhanced font detection failed"})}const u={};let h;o.forEach(e=>{const t=r[e];t&&t.value&&(u[e]=t.value)});try{const{calculateConfidence:e}=await Promise.resolve().then(function(){return Fn});h=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:h.score,level:h.level,factors:h.factors,recommendations:h.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 m={...r,hash:"",components:o,collectionTime:performance.now()-t},g={success:o.length>0,collectedComponents:o,failedComponents:i,confidence:h||r.confidence};if(o.length>0){const e=m.browser?.value,t=m.screen?.value,r=e?.userAgent||"",a=(()=>{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 s={};try{const{collectDeviceSignals:e}=await Promise.resolve().then(function(){return Hn});s=e()}catch(e){}const l={ua:(()=>{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:a,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>=2560?"4k":e>=1920?"fhd":e>=1600?"hd+":e>=1366?"hd":e>=1024?"xga":e>=768?"tablet":"mobile")(n),ratio:o>0?Math.round(n/o*10)/10:0}})():{bucket:"unknown",ratio:0},hardware:(()=>{const e=s.hardwareConcurrency,t=s.deviceMemory;if(e||t)return{cores:e?(e=>e>=16?"high":e>=8?"mid":e>=4?"normal":"low")(e):void 0,memory:t?(e=>e>=16?"high":e>=8?"mid":e>=4?"normal":"low")(t):void 0}})(),arch:s.architecture||void 0,colorBucket:(()=>{const e=s.colorDepth;if(e)return e>=32?"high":e>=24?"normal":"low"})()},f=[l.ua||"",l.platform||"",l.deviceType||"",l.screen?.bucket||"",l.timezone||""].filter(Boolean);if(f.length>=3){const e=f.join("|");let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n)&4294967295;l._entropy=Math.abs(t).toString(36).substring(0,8)}const p=d(l),w={...u,_stableCore:l},y=c(w);m.hash=y,n.debug&&console.log("[RabbitTracker] Ultra-stable core vector:",{components:Object.keys(l),entropy:l._entropy,stableCoreHash:p.substring(0,16),enhancedFingerprintHash:y.substring(0,16),ua:l.ua,deviceType:l.deviceType,platform:l.platform,screenBucket:l.screen?.bucket,totalComponentsInHash:Object.keys(w).length}),g.data={...m,stableCoreHash:p,stableCoreVector:l},n.debug&&(console.log("[RabbitTracker] Fingerprint collection completed:",{collected:o.length,failed:i.length,duration:m.collectionTime,enhancedFingerprintHash:m.hash,stableCoreHash:p,confidence:h?.level||"Unknown",score:h?.score||0,collisionResistance:"Enhanced with stable + unstable components (no temporal entropy)"}),h?.recommendations.length&&console.log("[RabbitTracker] Confidence recommendations:",h.recommendations))}else g.error="No components could be collected";return g}async function Ge(){return $e({gdprMode:!0,includeInvasive:!1,excludeComponents:["canvas","webgl","audio"],timeout:2e3})}async function Xe(){return $e({gdprMode:!1,includeInvasive:!0,timeout:5e3})}class Ke{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 Je{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 Ye{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 Qe{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 et{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 Ke,websocket:()=>new Je(this.baseUrl),resource:()=>new Ye(this.baseUrl),webrtc:()=>new Qe};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 tt{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 nt{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 ot={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 it{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 tt(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 nt(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 nt(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={...ot,...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 nt(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 tt(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 et(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 Ge():await Xe();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 rt=null;const at={init:e=>rt?(console.warn("[Zaplier] SDK already initialized"),rt):(rt=new it(e),rt),getInstance:()=>rt,track:(e,t)=>{rt?rt.track(e,t):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackPageView:e=>{rt?rt.trackPageView(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackEvent:(e,t)=>rt?rt.trackCustomEvent(e,t):(console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first"),!1),trackConversion:(e,t,n,o)=>{rt?rt.trackConversion(e,t,n,o):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackPurchase:e=>{rt?rt.trackPurchase(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},trackAddToCart:e=>{rt?rt.trackAddToCart(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},identify:e=>{rt?rt.identify(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},getVisitorId:()=>rt?rt.getVisitorId():null,getVisitorInfo:()=>rt?rt.getVisitorInfo():Promise.resolve(null),getUserData:()=>rt?rt.getUserData():null,enableEnhancedTracking:()=>rt?rt.enableEnhancedTracking():(console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first"),!1),disableEnhancedTracking:()=>{rt?rt.disableEnhancedTracking():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},isEnhancedMode:()=>!!rt&&rt.isEnhancedMode(),heatmap:{enable:()=>{rt?rt.heatmap.enable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},disable:()=>{rt?rt.heatmap.disable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},enableMouseTracking:()=>{rt?rt.heatmap.enableMouseTracking():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},disableMouseTracking:()=>{rt?rt.heatmap.disableMouseTracking():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},getStats:()=>rt?rt.heatmap.getStats():null,isRecording:()=>!!rt&&rt.heatmap.isRecording()},replay:{enable:()=>{rt?rt.replay.enable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},disable:()=>{rt?rt.replay.disable():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},start:()=>rt?rt.replay.start():(console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first"),!1),stop:()=>{rt?rt.replay.stop():console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},isRecording:()=>!!rt&&rt.replay.isRecording(),getEventCount:()=>rt?rt.replay.getEventCount():0,addFunnelStep:e=>{rt?rt.replay.addFunnelStep(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")},markConversion:e=>{rt?rt.replay.markConversion(e):console.warn("[Zaplier] SDK not initialized. Call Zaplier.init() first")}},debug:{getStats:()=>rt&&rt.antiAdblockManager?rt.antiAdblockManager.getStats():null,getSuccessRates:()=>rt&&rt.antiAdblockManager?rt.antiAdblockManager.getSuccessRates():null,testTransports:()=>rt&&rt.antiAdblockManager?rt.antiAdblockManager.testTransports():Promise.resolve(null)},version:"3.0.0"};function st(){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{at.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=at,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",st):st());const ct=[/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],lt=[/^Mozilla\/5\.0$/,/Headless/i,/automated/i,/testing/i,/^$/];function ut(){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 dt(){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 ht(){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 mt(){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 gt(){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 ft(){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 pt(){const e=navigator.userAgent,t=ct.filter(t=>t.test(e)),n=lt.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 wt(){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 yt(){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 vt(){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 bt(){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 kt(){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 St(){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 Et(){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 Mt(){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 _t(){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 Tt(e,t){return new Promise(n=>{setTimeout(()=>{n({detected:!1,confidence:0,method:`${t}_timeout`})},e)})}function Ct(){try{return"object"==typeof window.chrome&&null!==window.chrome&&"object"==typeof window.chrome.runtime}catch{return!1}}function At(){return navigator.userAgent.includes("WebKit")&&!navigator.userAgent.includes("Chrome")}function Dt(){return navigator.userAgent.includes("Gecko")&&!navigator.userAgent.includes("Chrome")}function xt(){return navigator.userAgent.includes("SamsungBrowser")||navigator.userAgent.includes("Samsung Internet")}function It(){return navigator.userAgent.includes("iPad")||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1}function Rt(){return navigator.userAgent.includes("Android")}function Pt(e,t){const n=e.match(t);return n&&n[1]||"Unknown"}function Lt(e){const t=e.toLowerCase();return t.includes("tablet")||It()?It()?{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")||Rt()?t.includes("iphone")?{type:"mobile",vendor:"Apple",model:"iPhone"}:t.includes("ipod")?{type:"mobile",vendor:"Apple",model:"iPod"}:Rt()&&t.includes("mobile")?{type:"mobile",vendor:"Android"}:{type:"mobile"}:{type:"desktop"}}var Nt=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 Ot(){try{if("deviceMemory"in navigator){const e=navigator.deviceMemory;return"number"==typeof e?e:null}return null}catch{return null}}function Bt(){try{if("hardwareConcurrency"in navigator){const e=navigator.hardwareConcurrency;return"number"==typeof e?e:null}return null}catch{return null}}function Ft(){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 zt(){try{return navigator.maxTouchPoints||0}catch{return 0}}var Ut=Object.freeze({__proto__:null,getArchitecture:Ft,getDeviceMemory:Ot,getHardwareConcurrency:Bt,getHardwareFingerprint:function(){return{deviceMemory:Ot(),hardwareConcurrency:Bt(),architecture:Ft(),maxTouchPoints:zt(),platform:navigator.platform||"unknown"}},getMaxTouchPoints:zt,isHardwareDetectionAvailable:function(){return"undefined"!=typeof navigator}});function jt(){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 Vt(){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 qt(){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 Wt(){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 Zt=Object.freeze({__proto__:null,getDateTimeLocale:qt,getLanguages:Vt,getPlatformExtended:Wt,getSystemFingerprint:function(){return{timezone:jt(),languages:Vt(),dateTimeLocale:qt(),platform:Wt(),cookiesEnabled:navigator.cookieEnabled||!1}},getTimezone:jt,isSystemDetectionAvailable:function(){return"undefined"!=typeof navigator}});function Ht(){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 $t(){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 Gt(){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 Xt(){try{return"openDatabase"in window&&"function"==typeof window.openDatabase}catch{return!1}}async function Kt(){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 Jt=Object.freeze({__proto__:null,getIndexedDBSupport:Gt,getLocalStorageSupport:Ht,getSessionStorageSupport:$t,getStorageFingerprint:async function(){const[e,t]=await Promise.all([Gt(),Kt()]);return{localStorage:Ht(),sessionStorage:$t(),indexedDB:e,webSQL:Xt(),quota:t}},getStorageQuota:Kt,getWebSQLSupport:Xt,isStorageDetectionAvailable:function(){return"undefined"!=typeof window}});function Yt(){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,k=t=>(e.exp(t)+1/e.exp(t))/2,S=t=>e.exp(t)-1,E=t=>(e.exp(2*t)-1)/(e.exp(2*t)+1),M=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:(_=1e154,e.log(_+e.sqrt(_*_-1))),asinh:r(1),asinhPf:y(1),atanh:a(.5),atanhPf:v(.5),cosh:d(1),coshPf:k(1),sinh:l(1),sinhPf:b(1),tanh:m(1),tanhPf:E(1),exp:g(1),expm1:f(1),expm1Pf:S(1),log1p:p(10),log1pPf:M(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 _}function Qt(){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 en(){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 tn=Object.freeze({__proto__:null,getCompleteMathFingerprint:function(){return{operations:Yt(),constants:Qt(),floatingPoint:en()}},getFloatingPointBehavior:en,getMathConstants:Qt,getMathFingerprint:Yt,isMathDetectionAvailable:function(){return"undefined"!=typeof Math}});function nn(){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 on(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 rn(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 an(e){return new Promise(t=>setTimeout(t,e))}async function sn(e){const t=document,n=t.createElement("div"),o=new Array(e.length),i={};rn(n);const r=t.createDocumentFragment();for(let n=0;n<e.length;n++){const i=e[n];if(i)try{const e=on(i),a=t.createElement("div");"DIALOG"===e.tagName&&e.show?.(),rn(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 an(50),a++;if(!t.body)throw new Error("Document body not available for DOM blockers detection");t.body.appendChild(n);try{await an(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 cn(e={}){const{debug:t=!1,timeout:n=5e3}=e;try{if(!ln())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=nn(),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([sn(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 ln(){return te().canRunDOMBlockers}var un=Object.freeze({__proto__:null,getBlockedSelectors:sn,getBlockerFilters:nn,getDomBlockers:cn,getDomBlockersFingerprint:async function(e={}){const t=await cn(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:ln});function dn(){try{return $()?navigator.pdfViewerEnabled??null:null}catch{return null}}function hn(){try{if(!function(){try{return Z()&&!$()&&!X()&&Boolean(window.safari)&&/safari/i.test(navigator.userAgent)}catch{return!1}}())return-1;const{ApplePaySession:e}=window;if("function"!=typeof e?.canMakePayments)return-1;if(!K())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 mn(){try{return"attributionReporting"in window||"privateClickMeasurement"in window||null}catch{return null}}function gn(){const e={enabled:!1,sameSiteSupport:!1,secureSupport:!1,partitionedSupport:!1};try{if(e.enabled=navigator.cookieEnabled,!e.enabled)return e;e.sameSiteSupport=fn("__rb_test_samesite","SameSite=Strict"),K()&&(e.secureSupport=fn("__rb_test_secure","Secure")),K()&&$()&&(e.partitionedSupport=fn("__rb_test_partitioned","Partitioned; Secure; SameSite=None"))}catch{}return e}function fn(e,t){try{const n="1",o=`${e}=${n}; ${t}; path=/`;document.cookie=o;const i=document.cookie.includes(`${e}=${n}`);return pn(e),i}catch{return pn(e),!1}}function pn(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 wn(){try{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");return t?(t.getSupportedExtensions()||[]).sort():[]}catch{return[]}}function yn(){try{const e=performance.memory;return e?{usedJSHeapSize:e.usedJSHeapSize,totalJSHeapSize:e.totalJSHeapSize,jsHeapSizeLimit:e.jsHeapSizeLimit}:null}catch{return null}}function vn(){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 bn(){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 kn=Object.freeze({__proto__:null,getApplePayState:hn,getBrowserApisFingerprint:function(){const e=dn(),t=hn(),n=mn(),o=gn(),i=wn(),r=yn(),a=vn(),s=bn();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:vn,getCookieCapabilities:gn,getPdfViewerEnabled:dn,getPerformanceMemory:yn,getPrivateClickMeasurement:mn,getVendorProperties:bn,getWebGLExtensions:wn,isBrowserApisDetectionAvailable:function(){return"undefined"!=typeof window&&"undefined"!=typeof navigator}});function Sn(){try{if(!Pn())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 En(){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 Mn(){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 _n(){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 Tn(){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 Cn(){try{if(!$())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 An(){try{if(!G())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 Dn(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 xn(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 In(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 Rn(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 Pn(){return te().canRunBrowserAPIs&&"undefined"!=typeof navigator}var Ln=Object.freeze({__proto__:null,calculateSecurityScore:In,detectChromeExtensionsBlocked:Cn,detectFirefoxExtensionsBlocked:An,generatePluginSignature:Rn,getEnhancedPluginFingerprint:function(){const e=Sn(),t=Array.isArray(e)?e:[],n=En(),o=Array.isArray(n)?n:[],i=Mn(),r=_n(),a=Tn(),s=Cn(),c="boolean"==typeof s&&s,l=An(),u="boolean"==typeof l&&l,d=Dn(t),h=xn(t),m=Rn(t,o),g=In(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:En,getNavigatorPlugins:Sn,identifyAdBlockerPlugins:xn,identifySecurityPlugins:Dn,isEnhancedPluginDetectionAvailable:Pn,testFlashEnabled:Mn,testJavaEnabled:_n,testSilverlightEnabled:Tn});const Nn={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}},On={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 Bn(e){const t=Nn[e]||On[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 Fn=Object.freeze({__proto__:null,ADVANCED_COMPONENT_CHARACTERISTICS:On,COMPONENT_CHARACTERISTICS:Nn,calculateComponentWeight:Bn,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=Bn(e.component),n=Nn[e.component]||On[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 zn(){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 Un(){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 jn(){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 Vn(){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 qn(){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 Wn(){try{return screen.colorDepth||void 0}catch{return}}function Zn(){try{for(const e of["rec2020","p3","srgb"])if(window.matchMedia(`(color-gamut: ${e})`).matches)return e;return}catch{return}}var Hn=Object.freeze({__proto__:null,collectDeviceSignals:function(){return{screenFrame:zn(),hardwareConcurrency:navigator.hardwareConcurrency||void 0,deviceMemory:qn(),architecture:Un(),touchSupport:jn(),vendorFlavors:Vn(),cpuClass:navigator.cpuClass||void 0,colorDepth:Wn(),colorGamut:Zn()}}});return e.Zaplier=at,e.ZaplierSDK=it,e.analyzeUserAgent=function(e){const t=e||navigator.userAgent||"",n=function(e){const t=e.toLowerCase();if(t.includes("edg/")){const t=Pt(e,/edg\/([0-9.]+)/i);return{name:"Edge",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("edge/")){const t=Pt(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=Pt(e,/chrome\/([0-9.]+)/i);return{name:"Brave",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(xt()){const t=Pt(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=Pt(e,/chrome\/([0-9.]+)/i);return{name:"Chrome",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("firefox/")){const t=Pt(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=Pt(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=Pt(e,/(?:opr|opera)\/([0-9.]+)/i);return{name:"Opera",version:t,major:t.split(".")[0]||"Unknown",engine:Ct()?"chromium":"unknown"}}if(t.includes("vivaldi/")){const t=Pt(e,/vivaldi\/([0-9.]+)/i);return{name:"Vivaldi",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("yabrowser/")){const t=Pt(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=Pt(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=Pt(e,/ucbrowser\/([0-9.]+)/i);return{name:"UC Browser",version:t,major:t.split(".")[0]||"Unknown",engine:"chromium"}}if(t.includes("qqbrowser/")){const t=Pt(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=Pt(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:Pt(e,/mac os x ([0-9._]+)/i).replace(/_/g,"."),family:"macos"}:t.includes("iphone")||t.includes("ipad")||t.includes("ipod")||It()?{name:"iOS",version:Pt(e,/os ([0-9._]+)/i).replace(/_/g,"."),family:"ios"}:Rt()?{name:"Android",version:Pt(e,/android ([0-9.]+)/i),family:"android"}:t.includes("linux")?{name:"Linux",version:"Unknown",family:"linux"}:t.includes("cros")?{name:"Chrome OS",version:Pt(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=Lt(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=st,e.clearFingerprintCache=function(){qe.clear()},e.collectFingerprint=$e,e.default=it,e.detectBot=async function(){const e={webDriver:ut(),headlessBrowser:dt(),automationTools:ht(),domBlockers:mt(),missingLanguages:gt(),inconsistentEval:ft(),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=pt(),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([wt(),Tt(r,"localStorage")]),Promise.race([yt(),Tt(r,"sessionStorage")]),Promise.race([vt(),Tt(r,"indexedDB")]),Promise.race([bt(),Tt(r,"permissions")]),Promise.race([kt(),Tt(r,"quotaManagement")]),Promise.race([Mt(),Tt(r,"filesystem")]),Promise.race([_t(),Tt(r,"cacheDetection")]),Promise.race([St(),Tt(r,"chromeSpecific")]),Promise.race([Et(),Tt(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,k="fulfilled"===a.status?a.value:{detected:!1},S="fulfilled"===s.status?s.value:{detected:!1},E="fulfilled"===c.status?c.value:{detected:!1},M="fulfilled"===l.status?l.value:{},_="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:k?.detected??!1,sessionStorage:S?.detected??!1,indexedDB:E?.detected??!1,cookiesEnabled:!1,quota:_?.detected?0:null,permissions:M?.details||{}}}},e.generateVisitorId=l,e.generateVisitorIdFromFingerprint=function(e){return l(e.hash)},e.getAvailableComponents=function(){const e=[];return b()&&e.push("canvas"),W()&&e.push("webgl"),p()&&e.push("audio"),C()&&e.push("fonts"),x()&&e.push("screen"),y()&&e.push("browser"),e},e.getBrowserEngine=function(){return Ct()?"chromium":At()?"webkit":Dt()?"gecko":navigator.userAgent.toLowerCase().includes("trident")?"trident":"unknown"},e.getCompleteFingerprint=Xe,e.getLightweightFingerprint=Ge,e.hash32=s,e.hashFingerprint=c,e.isAndroid=Rt,e.isChromium=Ct,e.isDesktop=function(){return"desktop"===Lt(navigator.userAgent).type},e.isFingerprintingAvailable=function(){return x()&&y()},e.isGecko=Dt,e.isIPad=It,e.isMobile=function(){return"mobile"===Lt(navigator.userAgent).type},e.isSamsungInternet=xt,e.isTablet=function(){return"tablet"===Lt(navigator.userAgent).type},e.isWebKit=At,e.quickBotDetection=async function(){const e=ut(),t=pt();return e.detected||(t.suspicious?.isBot??!1)},e.quickIncognitoDetection=async function(){try{const[e,t]=await Promise.all([wt(),vt()]);return e.detected||t.detected}catch{return!1}},e.x64hash128=a,Object.defineProperty(e,"__esModule",{value:!0}),e}({});