@npm-pipl/device-intelligence 1.1.1 → 1.1.3
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/device-intelligence.cjs.js +144 -50
- package/dist/device-intelligence.cjs.js.map +1 -1
- package/dist/device-intelligence.esm.js +144 -50
- package/dist/device-intelligence.esm.js.map +1 -1
- package/dist/device-intelligence.esm.min.js +2 -2
- package/dist/device-intelligence.esm.min.js.map +1 -1
- package/dist/device-intelligence.js +144 -50
- package/dist/device-intelligence.js.map +1 -1
- package/dist/device-intelligence.min.js +2 -2
- package/dist/device-intelligence.min.js.map +1 -1
- package/dist/device-intelligence.umd.js +144 -50
- package/dist/device-intelligence.umd.js.map +1 -1
- package/dist/device-intelligence.umd.min.js +2 -2
- package/dist/device-intelligence.umd.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Device Intelligence SDK v1.1.
|
|
2
|
+
* Device Intelligence SDK v1.1.3
|
|
3
3
|
* (c) 2026 Your Company
|
|
4
4
|
* Released under the MIT License
|
|
5
5
|
*/
|
|
6
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).DeviceIntelligence={})}(this,function(e){"use strict";const t="local_elephant_device",n="elephant_device",o="sent_payloads",r=18e6,i={debug:!1,endpoint:"https://device.pipl.com/device/collect",apiKey:null,siteId:null,timeout:1e4,collectionTiming:"immediate",attributeCacheTtl:3e5,trafficType:null,minSendIntervalMs:r,skipSend:!1};function a(e,t){let n=0,o=0,r=0,i=0;i+=(65535&e[1])+(65535&t[1]),r+=i>>>16,i&=65535,r+=(e[1]>>>16)+(t[1]>>>16),o+=r>>>16,r&=65535,o+=(65535&e[0])+(65535&t[0]),n+=o>>>16,o&=65535,n+=(e[0]>>>16)+(t[0]>>>16),n&=65535,e[0]=n<<16|o,e[1]=r<<16|i}function c(e,t){const n=65535&e[0],o=e[1]>>>16,r=65535&e[1],i=65535&t[0],a=t[1]>>>16,c=65535&t[1];let s=0,l=0,u=0,d=0;d+=r*c,u+=d>>>16,d&=65535,u+=o*c,l+=u>>>16,u&=65535,u+=r*a,l+=u>>>16,u&=65535,l+=n*c,s+=l>>>16,l&=65535,l+=o*a,s+=l>>>16,l&=65535,l+=r*i,s+=l>>>16,l&=65535,s+=(e[0]>>>16)*c+n*a+o*i+r*(t[0]>>>16),s&=65535,e[0]=s<<16|l,e[1]=u<<16|d}function s(e,t){const n=e[0];32===(t%=64)?(e[0]=e[1],e[1]=n):32>t?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(e[0]=e[1]<<(t-=32)|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function l(e,t){0!==(t%=64)&&(32>t?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function u(e,t){e[0]^=t[0],e[1]^=t[1]}const d=[4283543511,3981806797],p=[3301882366,444984403];function m(e){const t=[0,e[0]>>>1];u(e,t),c(e,d),t[1]=e[0]>>>1,u(e,t),c(e,p),t[1]=e[0]>>>1,u(e,t)}const y=[2277735313,289559509],h=[1291169091,658871167],g=[0,5],_=[0,1390208809],f=[0,944331445];const v=function(e,t){const n=function(e){const t=new Uint8Array(e.length);for(let n=0;e.length>n;n++){const o=e.charCodeAt(n);if(o>127)return(new TextEncoder).encode(e);t[n]=o}return t}(e),o=[0,n.length],r=o[1]%16,i=o[1]-r,d=[0,t=t||0],p=[0,t],v=[0,0],w=[0,0];let b;for(b=0;i>b;b+=16)v[0]=n[b+4]|n[b+5]<<8|n[b+6]<<16|n[b+7]<<24,v[1]=n[b]|n[b+1]<<8|n[b+2]<<16|n[b+3]<<24,w[0]=n[b+12]|n[b+13]<<8|n[b+14]<<16|n[b+15]<<24,w[1]=n[b+8]|n[b+9]<<8|n[b+10]<<16|n[b+11]<<24,c(v,y),s(v,31),c(v,h),u(d,v),s(d,27),a(d,p),c(d,g),a(d,_),c(w,h),s(w,33),c(w,y),u(p,w),s(p,31),a(p,d),c(p,g),a(p,f);v[0]=0,v[1]=0,w[0]=0,w[1]=0;const k=[0,0];switch(r){case 15:k[1]=n[b+14],l(k,48),u(w,k);case 14:k[1]=n[b+13],l(k,40),u(w,k);case 13:k[1]=n[b+12],l(k,32),u(w,k);case 12:k[1]=n[b+11],l(k,24),u(w,k);case 11:k[1]=n[b+10],l(k,16),u(w,k);case 10:k[1]=n[b+9],l(k,8),u(w,k);case 9:k[1]=n[b+8],u(w,k),c(w,h),s(w,33),c(w,y),u(p,w);case 8:k[1]=n[b+7],l(k,56),u(v,k);case 7:k[1]=n[b+6],l(k,48),u(v,k);case 6:k[1]=n[b+5],l(k,40),u(v,k);case 5:k[1]=n[b+4],l(k,32),u(v,k);case 4:k[1]=n[b+3],l(k,24),u(v,k);case 3:k[1]=n[b+2],l(k,16),u(v,k);case 2:k[1]=n[b+1],l(k,8),u(v,k);case 1:k[1]=n[b],u(v,k),c(v,y),s(v,31),c(v,h),u(d,v)}return u(d,o),u(p,o),a(d,p),a(p,d),m(d),m(p),a(d,p),a(p,d),("00000000"+(d[0]>>>0).toString(16)).slice(-8)+("00000000"+(d[1]>>>0).toString(16)).slice(-8)+("00000000"+(p[0]>>>0).toString(16)).slice(-8)+("00000000"+(p[1]>>>0).toString(16)).slice(-8)};function w(e,t){const n={...e};for(const e of Object.keys(t)){const o=t[e];void 0!==o&&(n[e]=o)}return n}function b(e,t){return(...n)=>{t&&console.log(e,...n)}}function k(e){const t=new Uint8Array(e);let n="";for(let e=0;t.byteLength>e;e++)n+=String.fromCharCode(t[e]);return btoa(n)}async function x(e){const t=await async function(e){const t=e.replace(/-----BEGIN PUBLIC KEY-----/,"").replace(/-----END PUBLIC KEY-----/,"").replace(/\s/g,""),n=Uint8Array.from(atob(t),e=>e.charCodeAt(0));return await crypto.subtle.importKey("spki",n.buffer,{name:"RSA-OAEP",hash:"SHA-256"},!1,["encrypt"])}("-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1DV8em/rKKXLkNE+5uKK\nHRb8nt46DaQrHrzK1GAi2ZcPQQHPT/Iiy/TCI3HCGGXeSl8/ZFHlT9Xuc+g4Wuce\njE5mNAHwJrbUqZgJKSfkK0KwbTz84U0Bic3HWpjW7E2I+cEbdjnGuQfI8ZNqw19g\ns7Zo6xVYArdd57nbInF7dh/kRVnYxmbqtpt3SpyqtaBPouLDsSTkjHefXKBA0uNM\nU7ix5OlOHFsUGTjsbWoQbiMRDrcozp1KtVJN7n0d095gJW+bsBSBMd3/LMIbVPox\nrfokGe0h+6z0RLxSSu3178r8Cug01xz9D4pXWpugTJvJNN4boMeOV5rItLdqyNq0\nZwIDAQAB\n-----END PUBLIC KEY-----"),n=await async function(){return await crypto.subtle.generateKey({name:"AES-GCM",length:256},!0,["encrypt"])}(),{ciphertext:o,iv:r}=await async function(e,t){const n=(new TextEncoder).encode(JSON.stringify(t)),o=crypto.getRandomValues(new Uint8Array(12));return{ciphertext:k(await crypto.subtle.encrypt({name:"AES-GCM",iv:o},e,n)),iv:k(o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength))}}(n,e),i=await async function(e,t){const n=await crypto.subtle.exportKey("raw",e);return k(await crypto.subtle.encrypt({name:"RSA-OAEP"},t,n))}(n,t);return{payload:o,key:i,iv:r,version:"1.0"}}function S(){return"undefined"!=typeof performance&&"function"==typeof performance.now?performance.now():Date.now()}async function T(e,t){const n=Array(e.length);let o=0;const r=Array.from({length:Math.max(1,t)},()=>async function(){for(;;){const t=o++;if(t>=e.length)return;n[t]=await e[t]()}}());return await Promise.all(r),n}class M{constructor(e){this.collectors=e.collectors,this.ctx={debug:e.debug,log:e.log,now:S,cache:new Map},this.concurrency=e.concurrency??8,this.collectorKeys=new Set;for(const e of this.collectors)this.collectorKeys.has(e.key)&&this.ctx.log("[AttributeEngine] Duplicate collector key detected:",e.key),this.collectorKeys.add(e.key)}async collectAll(e){const t=e??(new AbortController).signal,n=this.collectors.map(e=>async()=>{const n=this.ctx.now(),o=e.category??"system";try{const c=this.collectors.filter(t=>t.key===e.key).length;if(c>1)return{category:o,key:e.key,version:e.version,status:"error",error:{name:"DuplicateKeyError",message:`Duplicate collector key "${e.key}"`,retryable:!1},durationMs:Math.max(0,this.ctx.now()-n)};if(e.isSupported&&!e.isSupported(this.ctx))return{category:o,key:e.key,version:e.version,status:"skipped",durationMs:Math.max(0,this.ctx.now()-n)};const s=`${(a=e).key}:v${a.version}`,l=this.ctx.cache.get(s);if(l&&l.expiresAt>Date.now())return{category:o,key:e.key,version:e.version,status:"ok",value:l.value,durationMs:Math.max(0,this.ctx.now()-n)};const{signal:u,clear:d}=function(e,t){if(!t||0>=t)return{signal:e,clear:()=>{}};const n=new AbortController,o=setTimeout(()=>n.abort(),t),r=()=>n.abort();e.addEventListener("abort",r,{once:!0});const i=AbortSignal.any;return{signal:i?i([e,n.signal]):n.signal,clear:()=>{clearTimeout(o),e.removeEventListener("abort",r)}}}(t,e.timeoutMs);try{const t=e.timeoutMs??5e3,a=Promise.resolve(e.collect(this.ctx,u)),c=await(r=a,i=t,Promise.race([r,new Promise((e,t)=>setTimeout(()=>t(Object.assign(Error("Timed out"),{name:"AbortError"})),i))]));return e.cacheTtlMs&&e.cacheTtlMs>0&&this.ctx.cache.set(s,{value:c,expiresAt:Date.now()+e.cacheTtlMs}),{category:o,key:e.key,version:e.version,status:"ok",value:c,durationMs:Math.max(0,this.ctx.now()-n)}}finally{d()}}catch(t){const r=t instanceof Error&&"AbortError"===t.name,i=function(e){return e instanceof Error?{name:e.name||"Error",message:e.message||"Unknown error"}:{name:"Error",message:"Unknown error"}}(t);return r&&(i.name="TimeoutError",i.message="Timed out",i.retryable=!0),{category:o,key:e.key,version:e.version,status:"error",error:i,durationMs:Math.max(0,this.ctx.now()-n)}}var r,i,a});return T(n,this.concurrency)}}function E(e,t){try{return e()}catch{return t}}function A(e,t){try{const n=document.createElement("canvas");n.width=e,n.height=t;const o=n.getContext("2d");return o?{canvas:n,ctx:o}:null}catch{return null}}function C(e){try{return e.getContext("webgl")||e.getContext("experimental-webgl")}catch{return null}}function P(e){try{return e.getContext("webgl2")}catch{return null}}const D=["alpha","antialias","depth","desynchronized","failIfMajorPerformanceCaveat","powerPreference","premultipliedAlpha","preserveDrawingBuffer","stencil","xrCompatible"],I={category:"graphics",key:"webgpu_adapter",version:1,cacheTtlMs:3e5,timeoutMs:3e3,collect:async()=>{const e=navigator.gpu;if(!e||"function"!=typeof e.requestAdapter)return null;try{const t=await e.requestAdapter();if(!t)return{available:!1};let n="",o="",r="",i="";if(t.info)n=t.info.vendor||"",o=t.info.architecture||"",r=t.info.device||"",i=t.info.description||"";else if("function"==typeof t.requestAdapterInfo)try{const e=await t.requestAdapterInfo();n=e.vendor||"",o=e.architecture||"",r=e.device||"",i=e.description||""}catch{}const a=[];t.features&&t.features.forEach(e=>{a.push(e)});const c=[{api:"maxTextureDimension1D",key:"max_texture_dimension_1d"},{api:"maxTextureDimension2D",key:"max_texture_dimension_2d"},{api:"maxTextureDimension3D",key:"max_texture_dimension_3d"},{api:"maxTextureArrayLayers",key:"max_texture_array_layers"},{api:"maxBindGroups",key:"max_bind_groups"},{api:"maxBindGroupsPlusVertexBuffers",key:"max_bind_groups_plus_vertex_buffers"},{api:"maxBindingsPerBindGroup",key:"max_bindings_per_bind_group"},{api:"maxDynamicUniformBuffersPerPipelineLayout",key:"max_dynamic_uniform_buffers_per_pipeline_layout"},{api:"maxDynamicStorageBuffersPerPipelineLayout",key:"max_dynamic_storage_buffers_per_pipeline_layout"},{api:"maxSampledTexturesPerShaderStage",key:"max_sampled_textures_per_shader_stage"},{api:"maxSamplersPerShaderStage",key:"max_samplers_per_shader_stage"},{api:"maxStorageBuffersPerShaderStage",key:"max_storage_buffers_per_shader_stage"},{api:"maxStorageTexturesPerShaderStage",key:"max_storage_textures_per_shader_stage"},{api:"maxUniformBuffersPerShaderStage",key:"max_uniform_buffers_per_shader_stage"},{api:"maxUniformBufferBindingSize",key:"max_uniform_buffer_binding_size"},{api:"maxStorageBufferBindingSize",key:"max_storage_buffer_binding_size"},{api:"maxVertexBuffers",key:"max_vertex_buffers"},{api:"maxBufferSize",key:"max_buffer_size"},{api:"maxVertexAttributes",key:"max_vertex_attributes"},{api:"maxVertexBufferArrayStride",key:"max_vertex_buffer_array_stride"},{api:"maxComputeWorkgroupStorageSize",key:"max_compute_workgroup_storage_size"},{api:"maxComputeInvocationsPerWorkgroup",key:"max_compute_invocations_per_workgroup"},{api:"maxComputeWorkgroupSizeX",key:"max_compute_workgroup_size_x"},{api:"maxComputeWorkgroupSizeY",key:"max_compute_workgroup_size_y"},{api:"maxComputeWorkgroupSizeZ",key:"max_compute_workgroup_size_z"},{api:"maxComputeWorkgroupsPerDimension",key:"max_compute_workgroups_per_dimension"}],s={};if(t.limits)for(const e of c){const n=t.limits[e.api];"number"==typeof n&&(s[e.key]=n)}return{available:!0,vendor:n,architecture:o,device:r,description:i,features:a.sort(),limits:s,is_fallback_adapter:t.isFallbackAdapter||!1}}catch{return null}}},R=[{category:"graphics",key:"canvas_fingerprint",version:1,cacheTtlMs:3e5,collect:()=>{const e=A(300,150);if(!e)return null;const{canvas:t,ctx:n}=e;n.fillStyle="#f0f0f0",n.fillRect(0,0,t.width,t.height),n.textBaseline="alphabetic",n.fillStyle="#f60",n.font='18px "Times New Roman"',n.fillText("DeviceIntelligence",10,30),n.fillStyle="#069",n.font="16px Arial",n.fillText("Fingerprint 🔐😃",10,55),n.globalCompositeOperation="multiply",n.fillStyle="rgba(255, 0, 0, 0.5)",n.beginPath(),n.arc(100,100,40,0,2*Math.PI),n.fill(),n.fillStyle="rgba(0, 255, 0, 0.5)",n.beginPath(),n.arc(130,100,40,0,2*Math.PI),n.fill(),n.fillStyle="rgba(0, 0, 255, 0.5)",n.beginPath(),n.arc(115,70,40,0,2*Math.PI),n.fill(),n.globalCompositeOperation="source-over";const o=n.createLinearGradient(200,0,300,0);return o.addColorStop(0,"#ff0000"),o.addColorStop(.5,"#00ff00"),o.addColorStop(1,"#0000ff"),n.fillStyle=o,n.fillRect(200,80,90,50),n.strokeStyle="#333",n.lineWidth=2,n.beginPath(),n.moveTo(200,20),n.bezierCurveTo(230,10,270,50,290,20),n.stroke(),E(()=>v(t.toDataURL()),null)}},{category:"graphics",key:"canvas_winding",version:1,cacheTtlMs:3e5,collect:()=>{const e=A(10,10);if(!e)return!1;const{ctx:t}=e;return t.rect(0,0,10,10),t.rect(2,2,6,6),E(()=>!t.isPointInPath(5,5,"evenodd"),!1)}},{category:"graphics",key:"canvas_geometry",version:1,cacheTtlMs:3e5,collect:()=>{const e=A(200,200);if(!e)return null;const{canvas:t,ctx:n}=e;n.beginPath(),n.moveTo(50,50),n.lineTo(150,50),n.quadraticCurveTo(175,100,150,150),n.lineTo(50,150),n.bezierCurveTo(25,125,25,75,50,50),n.closePath(),n.fillStyle="#4a7c59",n.fill(),n.strokeStyle="#2d4a35",n.lineWidth=3,n.stroke();for(let e=0;5>e;e++)n.beginPath(),n.arc(100,100,20+15*e,0,2*Math.PI),n.strokeStyle=`hsl(${30*e}, 70%, 50%)`,n.stroke();return n.beginPath(),n.moveTo(160,30),n.lineTo(190,80),n.lineTo(130,80),n.closePath(),n.fillStyle="#e67e22",n.fill(),E(()=>v(t.toDataURL()),null)}},{category:"graphics",key:"canvas_text",version:1,cacheTtlMs:3e5,collect:()=>{const e=A(400,100);if(!e)return null;const{canvas:t,ctx:n}=e;n.fillStyle="#ffffff",n.fillRect(0,0,t.width,t.height);const o=[{text:"Cwm fjord",font:"16px Arial",x:10,y:20},{text:"Quick zephyrs",font:'14px "Times New Roman"',x:10,y:40},{text:"Sphinx of black",font:"12px Courier",x:10,y:60},{text:"Pack my box",font:"18px Georgia",x:10,y:80},{text:"W1lm",font:"20px monospace",x:200,y:30},{text:"illIlI1|",font:"16px sans-serif",x:200,y:55},{text:"mmwwMM",font:"14px serif",x:200,y:80}];n.fillStyle="#000000",n.textBaseline="top";for(const{text:e,font:t,x:r,y:i}of o)n.font=t,n.fillText(e,r,i);return E(()=>v(t.toDataURL()),null)}},{category:"graphics",key:"svg_fingerprint",version:1,cacheTtlMs:3e5,collect:()=>{const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("width","200"),e.setAttribute("height","200");const t=document.createElementNS("http://www.w3.org/2000/svg","rect");t.setAttribute("x","10"),t.setAttribute("y","10"),t.setAttribute("width","80"),t.setAttribute("height","80"),t.setAttribute("fill","#4a7c59"),t.setAttribute("stroke","#2d4a35"),t.setAttribute("stroke-width","2"),e.appendChild(t);const n=document.createElementNS("http://www.w3.org/2000/svg","circle");n.setAttribute("cx","150"),n.setAttribute("cy","50"),n.setAttribute("r","40"),n.setAttribute("fill","#e67e22"),e.appendChild(n);const o=document.createElementNS("http://www.w3.org/2000/svg","path");o.setAttribute("d","M 100 150 Q 125 100 150 150 T 200 150"),o.setAttribute("stroke","#3498db"),o.setAttribute("stroke-width","3"),o.setAttribute("fill","none"),e.appendChild(o);const r=document.createElementNS("http://www.w3.org/2000/svg","text");r.setAttribute("x","10"),r.setAttribute("y","180"),r.setAttribute("font-size","14"),r.textContent="SVG fingerprint",e.appendChild(r);const i=(new XMLSerializer).serializeToString(e);return v(i)}},{category:"graphics",key:"client_rects",version:1,cacheTtlMs:3e5,collect:()=>{const e=document.createElement("div");e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",document.body.appendChild(e);try{const t={},n=[{tag:"div",content:"test",style:"font: 16px Arial"},{tag:"span",content:"mmmmm",style:"font: 14px monospace"},{tag:"span",content:"iiiii",style:"font: 14px serif"},{tag:"div",content:"Wwww",style:"font: 18px sans-serif"}];for(const{tag:o,content:r,style:i}of n){const n=document.createElement(o);n.style.cssText=i,n.textContent=r,e.appendChild(n);const a=n.getBoundingClientRect();t[`${o}_${r}`]=[Math.round(1e3*a.width)/1e3,Math.round(1e3*a.height)/1e3]}return t}finally{document.body.removeChild(e)}}},{category:"graphics",key:"webgl_fingerprint",version:1,cacheTtlMs:3e5,collect:()=>{const e=document.createElement("canvas");e.width=256,e.height=256;const t=C(e);if(!t)return null;const n=t.createShader(t.VERTEX_SHADER),o=t.createShader(t.FRAGMENT_SHADER);if(!n||!o)return null;t.shaderSource(n,"\n attribute vec2 position;\n varying vec2 vPosition;\n void main() {\n vPosition = position;\n gl_Position = vec4(position, 0.0, 1.0);\n }\n "),t.compileShader(n),t.shaderSource(o,"\n precision mediump float;\n varying vec2 vPosition;\n void main() {\n float r = sin(vPosition.x * 10.0) * 0.5 + 0.5;\n float g = cos(vPosition.y * 10.0) * 0.5 + 0.5;\n float b = sin(vPosition.x * vPosition.y * 20.0) * 0.5 + 0.5;\n gl_FragColor = vec4(r, g, b, 1.0);\n }\n "),t.compileShader(o);const r=t.createProgram();if(!r)return null;t.attachShader(r,n),t.attachShader(r,o),t.linkProgram(r),t.useProgram(r);const i=new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),a=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,a),t.bufferData(t.ARRAY_BUFFER,i,t.STATIC_DRAW);const c=t.getAttribLocation(r,"position");t.enableVertexAttribArray(c),t.vertexAttribPointer(c,2,t.FLOAT,!1,0,0),t.viewport(0,0,e.width,e.height),t.clearColor(0,0,0,1),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLES,0,6);const s=new Uint8Array(e.width*e.height*4);t.readPixels(0,0,e.width,e.height,t.RGBA,t.UNSIGNED_BYTE,s);const l=[];for(let e=0;s.length>e;e+=97)l.push(s[e]);return v(l.join(","))}},{category:"graphics",key:"gpu_vendor",version:1,cacheTtlMs:3e5,collect:()=>{const e=C(document.createElement("canvas"));if(!e)return null;const t=e.getExtension("WEBGL_debug_renderer_info");return t?E(()=>e.getParameter(t.UNMASKED_VENDOR_WEBGL),null):null}},{category:"graphics",key:"gpu_renderer",version:1,cacheTtlMs:3e5,collect:()=>{const e=C(document.createElement("canvas"));if(!e)return null;const t=e.getExtension("WEBGL_debug_renderer_info");return t?E(()=>e.getParameter(t.UNMASKED_RENDERER_WEBGL),null):null}},{category:"graphics",key:"webgl_vendor",version:1,cacheTtlMs:3e5,collect:()=>{const e=C(document.createElement("canvas"));return e?E(()=>e.getParameter(e.VENDOR),null):null}},{category:"graphics",key:"webgl_renderer",version:1,cacheTtlMs:3e5,collect:()=>{const e=C(document.createElement("canvas"));return e?E(()=>e.getParameter(e.RENDERER),null):null}},{category:"graphics",key:"webgl_version",version:1,cacheTtlMs:3e5,collect:()=>{const e=document.createElement("canvas"),t=P(e);if(t)return E(()=>t.getParameter(t.VERSION),null);const n=C(e);return n?E(()=>n.getParameter(n.VERSION),null):null}},{category:"graphics",key:"webgl_shading_language_version",version:1,cacheTtlMs:3e5,collect:()=>{const e=document.createElement("canvas"),t=C(e)||P(e);return t?E(()=>t.getParameter(t.SHADING_LANGUAGE_VERSION),null):null}},{category:"graphics",key:"webgl_extensions",version:1,cacheTtlMs:3e5,collect:()=>{const e=C(document.createElement("canvas"));if(!e)return null;const t=e.getSupportedExtensions();return t?t.sort():null}},{category:"graphics",key:"webgl_context_attributes",version:1,cacheTtlMs:3e5,collect:()=>{const e=C(document.createElement("canvas"));if(!e)return null;const t=e.getContextAttributes();if(!t)return null;const n={},o=t;for(const e of D)e in o&&(n[e]=o[e]);return n}},{category:"graphics",key:"webgl_parameters",version:1,cacheTtlMs:3e5,collect:()=>{const e=C(document.createElement("canvas"));if(!e)return null;const t={MAX_COMBINED_TEXTURE_IMAGE_UNITS:e.MAX_COMBINED_TEXTURE_IMAGE_UNITS,MAX_CUBE_MAP_TEXTURE_SIZE:e.MAX_CUBE_MAP_TEXTURE_SIZE,MAX_FRAGMENT_UNIFORM_VECTORS:e.MAX_FRAGMENT_UNIFORM_VECTORS,MAX_RENDERBUFFER_SIZE:e.MAX_RENDERBUFFER_SIZE,MAX_TEXTURE_IMAGE_UNITS:e.MAX_TEXTURE_IMAGE_UNITS,MAX_TEXTURE_SIZE:e.MAX_TEXTURE_SIZE,MAX_VARYING_VECTORS:e.MAX_VARYING_VECTORS,MAX_VERTEX_ATTRIBS:e.MAX_VERTEX_ATTRIBS,MAX_VERTEX_TEXTURE_IMAGE_UNITS:e.MAX_VERTEX_TEXTURE_IMAGE_UNITS,MAX_VERTEX_UNIFORM_VECTORS:e.MAX_VERTEX_UNIFORM_VECTORS},n={};for(const[o,r]of Object.entries(t))n[o]=E(()=>e.getParameter(r),null);return n.MAX_VIEWPORT_DIMS=E(()=>Array.from(e.getParameter(e.MAX_VIEWPORT_DIMS)),null),n}},{category:"graphics",key:"webgl_shader_precisions",version:1,cacheTtlMs:3e5,collect:()=>{const e=C(document.createElement("canvas"));if(!e)return null;const t=[{name:"VERTEX_SHADER",type:e.VERTEX_SHADER},{name:"FRAGMENT_SHADER",type:e.FRAGMENT_SHADER}],n=[{name:"LOW_FLOAT",precision:e.LOW_FLOAT},{name:"MEDIUM_FLOAT",precision:e.MEDIUM_FLOAT},{name:"HIGH_FLOAT",precision:e.HIGH_FLOAT},{name:"LOW_INT",precision:e.LOW_INT},{name:"MEDIUM_INT",precision:e.MEDIUM_INT},{name:"HIGH_INT",precision:e.HIGH_INT}],o={};for(const r of t)for(const t of n){const n=`${r.name}_${t.name}`,i=E(()=>e.getShaderPrecisionFormat(r.type,t.precision),null);i&&(o[n]={range_min:i.rangeMin,range_max:i.rangeMax,precision:i.precision})}return o}},{category:"graphics",key:"webgl_extension_params",version:1,cacheTtlMs:3e5,collect:()=>{const e=C(document.createElement("canvas"));if(!e)return null;const t={},n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic");n&&(t.MAX_TEXTURE_MAX_ANISOTROPY=E(()=>e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT),null));const o=e.getExtension("WEBGL_draw_buffers");return o&&(t.MAX_COLOR_ATTACHMENTS=E(()=>e.getParameter(o.MAX_COLOR_ATTACHMENTS_WEBGL),null),t.MAX_DRAW_BUFFERS=E(()=>e.getParameter(o.MAX_DRAW_BUFFERS_WEBGL),null)),Object.keys(t).length>0?t:null}},{category:"graphics",key:"webgl_unsupported_exts",version:1,cacheTtlMs:3e5,collect:()=>{const e=C(document.createElement("canvas"));if(!e)return null;const t=new Set(e.getSupportedExtensions()||[]),n=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_color_buffer_half_float","EXT_disjoint_timer_query","EXT_float_blend","EXT_frag_depth","EXT_shader_texture_lod","EXT_sRGB","EXT_texture_compression_bptc","EXT_texture_compression_rgtc","EXT_texture_filter_anisotropic","OES_element_index_uint","OES_fbo_render_mipmap","OES_standard_derivatives","OES_texture_float","OES_texture_float_linear","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_compressed_texture_astc","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_pvrtc","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_debug_renderer_info","WEBGL_debug_shaders","WEBGL_depth_texture","WEBGL_draw_buffers","WEBGL_lose_context","WEBGL_multi_draw"].filter(e=>!t.has(e));return n.length>0?n:null}},I];const O=[{category:"audio",key:"audio_fingerprint",version:1,cacheTtlMs:3e5,timeoutMs:2e3,isSupported:()=>"undefined"!=typeof OfflineAudioContext||void 0!==window.webkitOfflineAudioContext,collect:async()=>{const e=OfflineAudioContext||window.webkitOfflineAudioContext;if(!e)return null;try{const o=new e(1,44100,44100),r=o.createOscillator();r.type="triangle",r.frequency.setValueAtTime(1e4,o.currentTime);const i=o.createDynamicsCompressor();i.threshold.setValueAtTime(-50,o.currentTime),i.knee.setValueAtTime(40,o.currentTime),i.ratio.setValueAtTime(12,o.currentTime),i.attack.setValueAtTime(0,o.currentTime),i.release.setValueAtTime(.25,o.currentTime),r.connect(i),i.connect(o.destination),r.start(0);const a=await(t=o.startRendering(),n=1500,Promise.race([t,new Promise(e=>setTimeout(()=>e(null),n))]));if(!a)return null;const c=a.getChannelData(0),s=[];for(let e=0;Math.min(500,c.length)>e;e++)s.push(Math.round(1e6*c[e]));return v(s.join(","))}catch{return null}var t,n}},{category:"audio",key:"audio_base_latency",version:1,cacheTtlMs:6e4,isSupported:()=>"undefined"!=typeof AudioContext,collect:()=>{try{const e=new AudioContext;if("suspended"===e.state)return e.close(),null;const t=e.baseLatency??null;return e.close(),"number"==typeof t?t:null}catch{return null}}},{category:"audio",key:"audio_max_channels",version:1,cacheTtlMs:6e4,isSupported:()=>"undefined"!=typeof AudioContext,collect:()=>{try{const e=new AudioContext;if("suspended"===e.state)return e.close(),null;const t=e.destination.maxChannelCount??null;return e.close(),t}catch{return null}}},{category:"audio",key:"audio_channel_mode",version:1,cacheTtlMs:6e4,isSupported:()=>"undefined"!=typeof AudioContext,collect:()=>{try{const e=new AudioContext;if("suspended"===e.state)return e.close(),null;const t=e.destination.channelCountMode??null;return e.close(),t}catch{return null}}}];function L(e,t){try{return e()}catch{return t}}function B(e){try{if("function"!=typeof window.matchMedia)return null;return window.matchMedia(e).matches}catch{return null}}const N=[{category:"screen",key:"screen_resolution",version:1,cacheTtlMs:6e4,collect:()=>{const e=L(()=>screen.width,0),t=L(()=>screen.height,0);return[Math.max(e,t),Math.min(e,t)]}},{category:"screen",key:"device_pixel_ratio",version:1,cacheTtlMs:6e4,collect:()=>L(()=>"number"==typeof window.devicePixelRatio?Math.round(100*window.devicePixelRatio)/100:null,null)},{category:"screen",key:"color_depth",version:1,cacheTtlMs:6e4,collect:()=>L(()=>screen.colorDepth??null,null)},{category:"screen",key:"screen_frame",version:1,cacheTtlMs:6e4,collect:()=>L(()=>{const{width:e,height:t,availWidth:n,availHeight:o,availLeft:r,availTop:i}=screen,a=r??0,c=i??0,s=e-n-a,l=t-o-c;return[Math.max(0,c),Math.max(0,s),Math.max(0,l),Math.max(0,a)]},null)},{category:"screen",key:"pixel_depth",version:1,cacheTtlMs:6e4,collect:()=>L(()=>screen.pixelDepth??null,null)},{category:"screen",key:"hdr_support",version:1,cacheTtlMs:6e4,collect:()=>B("(dynamic-range: high)")},{category:"screen",key:"color_gamut",version:1,cacheTtlMs:6e4,collect:()=>B("(color-gamut: rec2020)")?"rec2020":B("(color-gamut: p3)")?"p3":B("(color-gamut: srgb)")?"srgb":null},{category:"screen",key:"monochrome_depth",version:1,cacheTtlMs:6e4,collect:()=>{for(const e of[0,1,2,4,8])if(B(`(monochrome: ${e})`))return e;return null}},{category:"screen",key:"screen_orientation",version:1,isSupported:()=>"undefined"!=typeof screen&&"orientation"in screen,collect:()=>{try{const e=screen.orientation;return{type:e?.type??null,angle:e?.angle??null}}catch{return{type:null,angle:null}}}},{category:"screen",key:"media_matches",version:1,cacheTtlMs:6e4,collect:()=>{const e={print:"(print)",screen:"(screen)",portrait:"(orientation: portrait)",landscape:"(orientation: landscape)",fine_pointer:"(pointer: fine)",coarse_pointer:"(pointer: coarse)",no_pointer:"(pointer: none)",can_hover:"(hover: hover)",no_hover:"(hover: none)",any_fine_pointer:"(any-pointer: fine)",any_coarse_pointer:"(any-pointer: coarse)",any_hover:"(any-hover: hover)",standalone:"(display-mode: standalone)",fullscreen:"(display-mode: fullscreen)",minimal_ui:"(display-mode: minimal-ui)",browser:"(display-mode: browser)",dark_mode:"(prefers-color-scheme: dark)",light_mode:"(prefers-color-scheme: light)",reduced_motion:"(prefers-reduced-motion: reduce)",more_contrast:"(prefers-contrast: more)",less_contrast:"(prefers-contrast: less)",reduced_transparency:"(prefers-reduced-transparency: reduce)",forced_colors:"(forced-colors: active)",inverted_colors:"(inverted-colors: inverted)",slow_update:"(update: slow)",fast_update:"(update: fast)",overflow_block:"(overflow-block: scroll)",overflow_inline:"(overflow-inline: scroll)",scripting_enabled:"(scripting: enabled)"},t={};for(const[n,o]of Object.entries(e))t[n]=B(o);return t}},{category:"screen",key:"available_resolution",version:1,cacheTtlMs:6e4,collect:()=>({avail_width:L(()=>screen.availWidth,0),avail_height:L(()=>screen.availHeight,0),avail_left:L(()=>screen.availLeft??0,0),avail_top:L(()=>screen.availTop??0,0)})},{category:"screen",key:"scrollbar_width",version:1,collect:()=>{try{const e=document.createElement("div");e.style.cssText="position:absolute;top:-9999px;width:100px;height:100px;overflow:scroll;",document.body.appendChild(e);const t=document.createElement("div");t.style.cssText="width:100%;height:200px;",e.appendChild(t);const n=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),n}catch{return 0}}},{category:"screen",key:"browser_zoom",version:1,collect:()=>{try{const e=window.outerWidth||0,t=window.innerWidth||0,n=window.outerHeight||0,o=window.innerHeight||0;return{ratio:Math.round(100*(t>0?e/t:1))/100,device_pixel_ratio:window.devicePixelRatio||1,outer_width:e,inner_width:t,outer_height:n,inner_height:o}}catch{return{ratio:1,device_pixel_ratio:1,outer_width:0,inner_width:0,outer_height:0,inner_height:0}}}}];function U(e,t){try{return e()}catch{return t}}const G=[{category:"hardware",key:"hardware_concurrency",version:1,cacheTtlMs:6e4,collect:()=>U(()=>navigator.hardwareConcurrency??null,null)},{category:"hardware",key:"device_memory",version:1,cacheTtlMs:6e4,collect:()=>U(()=>{const e=navigator.deviceMemory;return"number"==typeof e&&Number.isFinite(e)?Math.round(e):null},null)},{category:"hardware",key:"max_touch_points",version:1,cacheTtlMs:6e4,collect:()=>U(()=>navigator.maxTouchPoints??null,null)},{category:"hardware",key:"touch_event",version:1,cacheTtlMs:6e4,collect:()=>{try{return document.createEvent("TouchEvent"),!0}catch{}return"ontouchstart"in window||(navigator.maxTouchPoints??0)>0}},{category:"hardware",key:"touch_start",version:1,cacheTtlMs:6e4,collect:()=>U(()=>"ontouchstart"in window||"ontouchstart"in document.documentElement||(navigator.maxTouchPoints??0)>0,!1)},{category:"hardware",key:"battery_status",version:1,cacheTtlMs:3e4,timeoutMs:2e3,isSupported:()=>"getBattery"in navigator,collect:async()=>{try{const e=await navigator.getBattery();return{charging:e.charging,level:e.level,charging_time:e.chargingTime===1/0?null:e.chargingTime,discharging_time:e.dischargingTime===1/0?null:e.dischargingTime}}catch{return null}}},{category:"hardware",key:"accelerometer_support",version:1,cacheTtlMs:3e5,timeoutMs:2e3,collect:async()=>{const e="DeviceMotionEvent"in window,t="function"==typeof DeviceMotionEvent.requestPermission;let n=null;if(navigator.permissions&&navigator.permissions.query)try{n=(await navigator.permissions.query({name:"accelerometer"})).state}catch{}return{supported:e,permission_required:t,permission_state:n}}},{category:"hardware",key:"gyroscope_support",version:1,cacheTtlMs:3e5,timeoutMs:2e3,collect:async()=>{const e="DeviceOrientationEvent"in window,t="DeviceOrientationAbsoluteEvent"in window||"ondeviceorientationabsolute"in window,n="function"==typeof DeviceOrientationEvent.requestPermission;let o=null;if(navigator.permissions&&navigator.permissions.query)try{o=(await navigator.permissions.query({name:"gyroscope"})).state}catch{}return{supported:e,permission_required:n,permission_state:o,absolute_supported:t}}},{category:"hardware",key:"sensor_api_support",version:1,collect:()=>{const e=window;return{accelerometer:"Accelerometer"in e,gyroscope:"Gyroscope"in e,magnetometer:"Magnetometer"in e,gravity_sensor:"GravitySensor"in e,absolute_orientation_sensor:"AbsoluteOrientationSensor"in e,relative_orientation_sensor:"RelativeOrientationSensor"in e,linear_acceleration_sensor:"LinearAccelerationSensor"in e,ambient_light_sensor:"AmbientLightSensor"in e,proximity_sensor:"ondeviceproximity"in e||"ProximitySensor"in e}}},{category:"hardware",key:"media_devices",version:1,cacheTtlMs:3e5,timeoutMs:2e3,collect:async()=>{if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return null;try{const e=await navigator.mediaDevices.enumerateDevices(),t=[],n=[],o=[],r=new Set;for(const i of e){const e={device_id:v(i.deviceId||"unknown"),group_id:v(i.groupId||"unknown"),kind:i.kind,label:i.label||""};switch(r.add(i.groupId),i.kind){case"audioinput":t.push(e);break;case"audiooutput":n.push(e);break;case"videoinput":o.push(e)}}return{audioinput:t,audiooutput:n,videoinput:o,counts:{audioinput:t.length,audiooutput:n.length,videoinput:o.length},group_ids:Array.from(r).map(e=>v(e))}}catch{return null}}},{category:"hardware",key:"media_device_counts",version:1,cacheTtlMs:3e5,timeoutMs:2e3,collect:async()=>{if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return null;try{const e=await navigator.mediaDevices.enumerateDevices(),t={audioinput:0,audiooutput:0,videoinput:0,total:0};for(const n of e)t.total++,"audioinput"===n.kind?t.audioinput++:"audiooutput"===n.kind?t.audiooutput++:"videoinput"===n.kind&&t.videoinput++;return t}catch{return null}}},{category:"hardware",key:"keyboard_layout_map",version:1,cacheTtlMs:3e5,timeoutMs:2e3,collect:async()=>{const e=navigator.keyboard;if(!e||"function"!=typeof e.getLayoutMap)return null;try{const t=await e.getLayoutMap(),n={},o=["KeyQ","KeyW","KeyE","KeyR","KeyT","KeyY","KeyU","KeyI","KeyO","KeyP","KeyA","KeyS","KeyD","KeyF","KeyG","KeyH","KeyJ","KeyK","KeyL","KeyZ","KeyX","KeyC","KeyV","KeyB","KeyN","KeyM","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","Digit0","Minus","Equal","BracketLeft","BracketRight","Backslash","Semicolon","Quote","Comma","Period","Slash","Backquote"];for(const e of o){const o=t.get(e);o&&(n[e]=o)}const r=Object.entries(n).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`${e}:${t}`).join("|");return{layout:n,layout_hash:v(r),key_count:Object.keys(n).length}}catch{return null}}}];function F(e,t){try{return e()}catch{return t}}const X={category:"platform",key:"cpu_architecture",version:1,cacheTtlMs:6e4,timeoutMs:2e3,collect:async()=>{const e=navigator.userAgentData;if(e&&"function"==typeof e.getHighEntropyValues)try{const t=await e.getHighEntropyValues(["architecture"]);if(t.architecture)return t.architecture}catch{}const t=navigator.platform?.toLowerCase()??"";return t.includes("arm")?"arm":t.includes("aarch64")?"arm64":t.includes("x86_64")||t.includes("win64")?"x86_64":t.includes("win32")||t.includes("x86")?"x86":t.includes("mac")&&navigator.maxTouchPoints>0?"arm64":t.includes("mac")?"x86_64":null}},j=[{category:"platform",key:"user_agent",version:1,cacheTtlMs:6e4,collect:()=>F(()=>navigator.userAgent??null,null)},{category:"platform",key:"user_agent_data",version:1,cacheTtlMs:6e4,timeoutMs:2e3,isSupported:()=>"function"==typeof navigator.userAgentData?.getHighEntropyValues,collect:async()=>{try{const e=navigator.userAgentData,t=await e.getHighEntropyValues(["architecture","bitness","brands","fullVersionList","model","platform","platformVersion","uaFullVersion","wow64"]);return{brands:t.brands??e.brands,mobile:t.mobile??e.mobile,platform:t.platform??e.platform,architecture:t.architecture,bitness:t.bitness,full_version_list:t.fullVersionList,model:t.model,platform_version:t.platformVersion,ua_full_version:t.uaFullVersion,wow64:t.wow64}}catch{const e=navigator.userAgentData;return e?{brands:e.brands,mobile:e.mobile,platform:e.platform}:null}}},X,{category:"platform",key:"platform",version:1,cacheTtlMs:6e4,collect:()=>F(()=>navigator.platform??null,null)},{category:"platform",key:"os_cpu",version:1,cacheTtlMs:6e4,collect:()=>F(()=>navigator.oscpu??null,null)},{category:"platform",key:"cpu_class",version:1,cacheTtlMs:6e4,collect:()=>F(()=>navigator.cpuClass??null,null)},{category:"platform",key:"vendor",version:1,cacheTtlMs:6e4,collect:()=>F(()=>navigator.vendor??null,null)},{category:"platform",key:"system_mobile",version:1,cacheTtlMs:6e4,collect:()=>{const e=navigator.userAgentData;return e&&"boolean"==typeof e.mobile?e.mobile:F(()=>{const e=(navigator.maxTouchPoints??0)>0||"ontouchstart"in window,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);return e&&t},null)}},{category:"platform",key:"system_product",version:1,cacheTtlMs:6e4,collect:()=>F(()=>navigator.product??null,null)},{category:"platform",key:"navigator_product_sub",version:1,cacheTtlMs:6e4,collect:()=>F(()=>navigator.productSub??null,null)},{category:"platform",key:"languages",version:1,cacheTtlMs:6e4,collect:()=>F(()=>navigator.languages&&navigator.languages.length>0?[...navigator.languages]:navigator.language?[navigator.language]:[],[])},{category:"platform",key:"timezone",version:1,cacheTtlMs:6e4,collect:()=>F(()=>Intl.DateTimeFormat().resolvedOptions().timeZone??null,null)},{category:"platform",key:"timezone_offset",version:1,cacheTtlMs:6e4,collect:()=>(new Date).getTimezoneOffset()},{category:"platform",key:"date_time_locale",version:1,cacheTtlMs:6e4,collect:()=>F(()=>{const e=new Date(2e3,0,1,12,0,0),t=Intl.DateTimeFormat().resolvedOptions();return{locale:t.locale,calendar:t.calendar,numbering_system:t.numberingSystem,time_zone:t.timeZone,formatted:e.toLocaleString()}},null)},{category:"platform",key:"intl_list_format",version:1,collect:()=>{try{if("undefined"==typeof Intl||!("ListFormat"in Intl))return{supported:!1,conjunction:null,disjunction:null};const e=["A","B","C"],t=new Intl.ListFormat("en",{style:"long",type:"conjunction"}),n=new Intl.ListFormat("en",{style:"long",type:"disjunction"});return{supported:!0,conjunction:t.format(e),disjunction:n.format(e)}}catch{return{supported:!1,conjunction:null,disjunction:null}}}},{category:"platform",key:"intl_collator",version:1,collect:()=>{try{if("undefined"==typeof Intl||!("Collator"in Intl))return{locale:null,collation:null,usage:null,sensitivity:null,case_first:null,numeric:null};const e=(new Intl.Collator).resolvedOptions();return{locale:e.locale??null,collation:e.collation??null,usage:e.usage??null,sensitivity:e.sensitivity??null,case_first:e.caseFirst??null,numeric:e.numeric??null}}catch{return{locale:null,collation:null,usage:null,sensitivity:null,case_first:null,numeric:null}}}},{category:"platform",key:"intl_plural_rules",version:1,collect:()=>{try{if("undefined"==typeof Intl||!("PluralRules"in Intl))return{locale:null,type:null,plural_categories:null};const e=(new Intl.PluralRules).resolvedOptions();return{locale:e.locale??null,type:e.type??null,plural_categories:e.pluralCategories??null}}catch{return{locale:null,type:null,plural_categories:null}}}},{category:"platform",key:"intl_relative_time_format",version:1,collect:()=>{try{if("undefined"==typeof Intl||!("RelativeTimeFormat"in Intl))return{supported:!1,locale:null,numbering_system:null,style:null,numeric:null};const e=(new Intl.RelativeTimeFormat).resolvedOptions();return{supported:!0,locale:e.locale??null,numbering_system:e.numberingSystem??null,style:e.style??null,numeric:e.numeric??null}}catch{return{supported:!1,locale:null,numbering_system:null,style:null,numeric:null}}}}];function z(e,t){try{return e()}catch{return t}}const W={category:"runtime",key:"math_primitives",version:1,cacheTtlMs:3e5,collect:()=>{const e=Math;return{acos:e.acos(.123456789),acosh:e.acosh(1e308),acosh_pf:e.log(1e154+e.sqrt(1e308)),asin:e.asin(.123456789),asinh:e.asinh(1),asinh_pf:e.log(1+e.sqrt(2)),atanh:e.atanh(.5),atanh_pf:e.log(3)/2,atan:e.atan(.5),sin:e.sin(-1e300),sinh:e.sinh(1),sinh_pf:e.exp(1)-1/e.exp(1)/2,cos:e.cos(10.000000000123),cosh:e.cosh(1),cosh_pf:(e.exp(1)+1/e.exp(1))/2,tan:e.tan(-1e300),tanh:e.tanh(1),tanh_pf:(e.exp(2)-1)/(e.exp(2)+1),exp:e.exp(1),expm1:e.expm1(1),expm1_pf:e.exp(1)-1,log1p:e.log1p(10),log1p_pf:e.log(11),pow_pi:e.pow(e.PI,-100),large_cos:e.cos(1e20),large_sin:e.sin(1e20),large_tan:e.tan(1e20),cbrt:e.cbrt(27),hypot:e.hypot(3,4),log10:e.log10(100),log2:e.log2(8),sqrt:e.sqrt(2),E:e.E,LN2:e.LN2,LN10:e.LN10,LOG2E:e.LOG2E,LOG10E:e.LOG10E,PI:e.PI,SQRT1_2:e.SQRT1_2,SQRT2:e.SQRT2}}},V={category:"runtime",key:"math_fingerprint",version:1,cacheTtlMs:3e5,collect:()=>{const e=Math,t=[e.acos(.5),e.acosh(1e308),e.asin(.5),e.asinh(1),e.atanh(.5),e.atan(.5),e.sin(-1e300),e.sinh(1),e.cos(10.000000000123),e.cosh(1),e.tan(-1e300),e.tanh(1),e.exp(1),e.expm1(1),e.log1p(10),e.pow(e.PI,-100)];return v(t.join(","))}},H=[W,V,{category:"runtime",key:"worker_diffs",version:1,cacheTtlMs:3e5,timeoutMs:3e3,isSupported:()=>"undefined"!=typeof Worker&&"undefined"!=typeof Blob,collect:async(e,t)=>new Promise(e=>{const n=["navigator.userAgent","navigator.platform","navigator.language","navigator.hardwareConcurrency","navigator.deviceMemory"],o=new Blob(["\n self.onmessage = function(e) {\n const results = {};\n const props = e.data;\n for (const prop of props) {\n try {\n const parts = prop.split('.');\n let value = self;\n for (const part of parts) {\n value = value[part];\n }\n results[prop] = value;\n } catch (err) {\n results[prop] = null;\n }\n }\n self.postMessage(results);\n };\n "],{type:"application/javascript"}),r=URL.createObjectURL(o),i=new Worker(r),a=()=>{i.terminate(),URL.revokeObjectURL(r)};if(t.aborted)return a(),void e(null);t.addEventListener("abort",()=>{a(),e(null)});const c={};for(const e of n)try{const t=e.split(".");let n=window;for(const e of t)n=n[e];c[e]=n}catch{c[e]=null}i.onmessage=t=>{a();const o=t.data,r={};for(const e of n)c[e]!==o[e]&&(r[e]={main:c[e],worker:o[e]});e(Object.keys(r).length>0?r:null)},i.onerror=()=>{a(),e(null)},i.postMessage(n)})},{category:"runtime",key:"js_heap_size_limit",version:1,cacheTtlMs:6e4,collect:()=>z(()=>{const e=performance.memory;return e?.jsHeapSizeLimit??null},null)},{category:"runtime",key:"native_code_format",version:1,cacheTtlMs:3e5,collect:()=>{const e=z(()=>{const e=Object.getOwnPropertyDescriptor(Function.prototype,"toString");return!0===e?.configurable||!e?.value?.toString().includes("[native code]")},!1),t={},n=[{name:"alert",fn:window.alert},{name:"console.log",fn:console.log},{name:"eval",fn:eval},{name:"Array.isArray",fn:Array.isArray}];for(const{name:e,fn:o}of n)if("function"==typeof o)try{t[e]=""+o}catch{t[e]="error"}const o=Object.values(t).find(e=>e.includes("[native code]"))||"";let r="unknown",i="unknown";if(o)if(o.includes("{\n")&&o.includes("\n}"))r="spidermonkey",i="SpiderMonkey";else if(o.includes("{ [native code] }")){const e=z(()=>{const e=Error();return e.stack?.includes(" at ")??!1},!1);r=e?"v8":"jsc",i=e?"V8":"JavaScriptCore"}return{sample:o.substring(0,100),format:r,engine:i,to_string_overridden:e}}},{category:"runtime",key:"max_stack_size",version:1,cacheTtlMs:3e5,collect:()=>{let e=0,t=!1,n=null;const o=()=>{e++,o()};try{o()}catch(e){e instanceof RangeError?(t=!0,n=e.message):e instanceof Error&&(n=e.message)}return{depth:e,range_error:t,error_message:n}}},{category:"runtime",key:"error_stack_format",version:1,cacheTtlMs:3e5,collect:()=>{try{const e=(Error("fingerprint").stack||"").split("\n").filter(e=>e.trim()),t=e.length>1?e[1].trim():e[0]?.trim()||"";let n="unknown",o="unknown";return t.includes(" at ")?(n="v8",o="V8"):t.includes("@")?(n="spidermonkey",o="SpiderMonkey"):t.match(/^\s*\w+\s*$/)&&(n="jsc",o="JavaScriptCore"),{format:n,sample:t.substring(0,100),engine:o}}catch{return{format:"error",sample:"",engine:"unknown"}}}},{category:"runtime",key:"time_resolution",version:1,cacheTtlMs:3e5,collect:()=>{const e=[];let t=performance.now();for(let n=0;1e4>n&&10>e.length;n++){const n=performance.now();n!==t&&(e.push(n-t),t=n)}const n=e.length>0?Math.min(...e.filter(e=>e>0)):1;let o=n;return.9>n||n>1.1?n>=.09&&.2>n?o=.1:.01>n&&(o=.005):o=1,{resolution:Math.round(1e6*n)/1e6,precision_ms:o,cross_origin_isolated:z(()=>!0===window.crossOriginIsolated,!1)}}},{category:"runtime",key:"stack_trace_limit",version:1,collect:()=>{try{return Error.stackTraceLimit??null}catch{return null}}},{category:"runtime",key:"eval_to_string_length",version:1,collect:()=>{try{return(""+eval).length}catch{return null}}},{category:"runtime",key:"performance_memory",version:1,collect:()=>{try{const e=performance;return e.memory?{supported:!0,js_heap_size_limit:e.memory.jsHeapSizeLimit??null,total_js_heap_size:e.memory.totalJSHeapSize??null,used_js_heap_size:e.memory.usedJSHeapSize??null}:{supported:!1,js_heap_size_limit:null,total_js_heap_size:null,used_js_heap_size:null}}catch{return{supported:!1,js_heap_size_limit:null,total_js_heap_size:null,used_js_heap_size:null}}}}],K=["monospace","sans-serif","serif"],q=["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","Andale Mono","Apple Chancery","Apple Color Emoji","Apple SD Gothic Neo","Arial Hebrew","Arial Rounded MT Bold","Avenir","Avenir Next","Baskerville","Big Caslon","Brush Script MT","Chalkboard","Chalkboard SE","Cochin","Copperplate","Courier","Didot","Futura","Geneva","Gill Sans","Helvetica","Helvetica Neue","Herculanum","Hoefler Text","Lucida Grande","Marker Felt","Menlo","Monaco","Noteworthy","Optima","Palatino","Papyrus","Phosphate","Rockwell","San Francisco","Savoye LET","SignPainter","Skia","Snell Roundhand","Times","Trattatello","Zapfino","Cantarell","DejaVu Sans","DejaVu Sans Mono","DejaVu Serif","Droid Sans","Droid Sans Mono","Droid Serif","FreeMono","FreeSans","FreeSerif","Liberation Mono","Liberation Sans","Liberation Serif","Noto Sans","Noto Serif","Ubuntu","Ubuntu Mono","Open Sans","Roboto","Lato","Source Code Pro","Source Sans Pro","Fira Code","JetBrains Mono"];function $(e,t,n){const o=document.createElement("div");o.style.position="absolute",o.style.left="-9999px",o.style.top="-9999px",o.style.visibility="hidden";const r=document.createElement("span");r.style.fontSize=n,r.style.fontFamily=t,r.style.whiteSpace="nowrap",r.textContent=e,o.appendChild(r),document.body.appendChild(o);try{return r.offsetWidth}finally{document.body.removeChild(o)}}const J=[{category:"fonts",key:"installed_fonts",version:1,cacheTtlMs:3e5,collect:()=>{const e="mmmmmmmmmmlli",t="72px",n={};for(const o of K){const r=$(e,o,t);null!==r&&(n[o]=r)}const o=[];for(const r of q){let i=!1;for(const o of K){const a=$(e,`'${r}', ${o}`,t);if(null!==a&&a!==n[o]){i=!0;break}}i&&o.push(r)}return o.sort()}},{category:"fonts",key:"font_preferences_default",version:1,cacheTtlMs:3e5,collect:()=>$("mmmmmmmmmmlli","undefined","72px")},{category:"fonts",key:"font_preferences_apple",version:1,cacheTtlMs:3e5,collect:()=>$("mmmmmmmmmmlli","-apple-system","72px")},{category:"fonts",key:"font_preferences_serif",version:1,cacheTtlMs:3e5,collect:()=>$("mmmmmmmmmmlli","serif","72px")},{category:"fonts",key:"font_preferences_sans",version:1,cacheTtlMs:3e5,collect:()=>$("mmmmmmmmmmlli","sans-serif","72px")},{category:"fonts",key:"font_preferences_mono",version:1,cacheTtlMs:3e5,collect:()=>$("mmmmmmmmmmlli","monospace","72px")},{category:"fonts",key:"font_preferences_min",version:1,cacheTtlMs:3e5,collect:()=>$("mmmmmmmmmmlli","serif","1px")},{category:"fonts",key:"font_preferences_system",version:1,cacheTtlMs:3e5,collect:()=>$("mmmmmmmmmmlli","system-ui","72px")},{category:"fonts",key:"font_smoothing",version:1,collect:()=>{try{const e=document.createElement("canvas");e.width=50,e.height=20;const t=e.getContext("2d");if(!t)return{detected:!1,type:null,subpixel_rendering:!1};t.fillStyle="#000",t.fillRect(0,0,50,20),t.fillStyle="#fff",t.font="12px Arial",t.fillText("Mm",5,15);const n=t.getImageData(0,0,50,20).data;let o=!1,r=!1;for(let e=0;n.length>e;e+=4){const t=n[e],i=n[e+1],a=n[e+2];t===i&&i===a||t>0&&i>0&&a>0&&255>t&&255>i&&255>a&&(Math.abs(t-i)>10||Math.abs(i-a)>10?o=!0:r=!0)}let i=null;return i=o?"subpixel":r?"grayscale":"none",{detected:!0,type:i,subpixel_rendering:o}}catch{return{detected:!1,type:null,subpixel_rendering:!1}}}}];function Z(e,t){try{return e()}catch{return t}}const Q=[{category:"browser",key:"navigator_vendor_sub",version:1,cacheTtlMs:6e4,collect:()=>Z(()=>navigator.vendorSub??null,null)},{category:"browser",key:"navigator_app_code_name",version:1,cacheTtlMs:6e4,collect:()=>Z(()=>navigator.appCodeName??null,null)},{category:"browser",key:"navigator_app_name",version:1,collect:()=>Z(()=>navigator.appName??null,null)},{category:"browser",key:"java_enabled",version:1,collect:()=>{try{return"function"==typeof navigator.javaEnabled?navigator.javaEnabled():null}catch{return null}}},{category:"browser",key:"plugins_list",version:1,cacheTtlMs:6e4,collect:()=>Z(()=>{const e=navigator.plugins,t=[];for(let n=0;e.length>n;n++){const o=e[n];t.push({name:o.name,filename:o.filename,description:o.description})}return t},[])},{category:"browser",key:"mime_types",version:1,cacheTtlMs:6e4,collect:()=>Z(()=>{const e=navigator.mimeTypes,t=[];for(let n=0;e.length>n;n++){const o=e[n];t.push({type:o.type,description:o.description,suffixes:o.suffixes})}return t},[])},{category:"browser",key:"vendor_flavors",version:1,cacheTtlMs:6e4,collect:()=>{const e=[],t=window;return t.chrome&&e.push("chrome"),"object"==typeof t.safari&&e.push("safari"),void 0!==t.InstallTrigger&&e.push("firefox"),void 0!==t.opr&&e.push("opera"),t.StyleMedia&&e.push("edge_legacy"),t.chrome&&navigator.userAgent.includes("Edg/")&&e.push("edge_chromium"),t.navigator?.brave?.isBrave&&e.push("brave"),navigator.userAgent.includes("Vivaldi")&&e.push("vivaldi"),navigator.userAgent.includes("YaBrowser")&&e.push("yandex"),navigator.userAgent.includes("SamsungBrowser")&&e.push("samsung"),navigator.userAgent.includes("UCBrowser")&&e.push("uc"),e}},{category:"browser",key:"pdf_viewer_enabled",version:1,cacheTtlMs:6e4,collect:()=>Z(()=>navigator.pdfViewerEnabled??null,null)},{category:"browser",key:"apple_pay_status",version:1,cacheTtlMs:6e4,isSupported:()=>"ApplePaySession"in window,collect:()=>{try{const e=window.ApplePaySession;return e?"function"!=typeof e.canMakePayments?1:e.canMakePayments()?2:1:0}catch{return null}}},{category:"browser",key:"private_click_measure",version:1,cacheTtlMs:6e4,collect:()=>Z(()=>void 0!==HTMLAnchorElement.prototype.attributionSourceId,null)},{category:"browser",key:"document_referrer",version:1,cacheTtlMs:3e4,collect:()=>Z(()=>document.referrer||null,null)},{category:"browser",key:"speech_synthesis",version:1,cacheTtlMs:3e5,timeoutMs:2e3,isSupported:()=>"speechSynthesis"in window,collect:async()=>new Promise(e=>{const t=window.speechSynthesis,n=()=>{const e=t.getVoices();if(0===e.length)return null;const n=e.map(e=>({name:e.name,lang:e.lang,default:e.default,localService:e.localService}));return v(JSON.stringify(n))},o=n();o?e(o):(t.addEventListener("voiceschanged",()=>{e(n())},{once:!0}),setTimeout(()=>e(n()),1e3))})},{category:"browser",key:"mathml_rendering",version:1,cacheTtlMs:3e5,collect:()=>{const e=document.createElement("div");e.style.cssText="position:absolute;left:-9999px;top:-9999px;",e.innerHTML='\n <math xmlns="http://www.w3.org/1998/Math/MathML">\n <mrow>\n <msup>\n <mi>x</mi>\n <mn>2</mn>\n </msup>\n <mo>+</mo>\n <msup>\n <mi>y</mi>\n <mn>2</mn>\n </msup>\n </mrow>\n </math>\n ',document.body.appendChild(e);try{const t=e.querySelector("math");if(!t)return null;const n=t.getBoundingClientRect();return{width:Math.round(100*n.width)/100,height:Math.round(100*n.height)/100,supported:n.width>10&&n.height>5}}catch{return null}finally{document.body.removeChild(e)}}},{category:"browser",key:"css_computed",version:1,cacheTtlMs:3e5,collect:()=>{const e={},t=document.createElement("div"),n=document.createElement("span"),o=document.createElement("input"),r=document.createElement("button"),i=document.createElement("textarea");t.style.cssText="position:absolute;left:-9999px;top:-9999px;visibility:hidden;",t.appendChild(n),t.appendChild(o),t.appendChild(r),t.appendChild(i),n.textContent="Test",r.textContent="Button",document.body.appendChild(t);try{const a=getComputedStyle(t),c=getComputedStyle(n),s=getComputedStyle(o),l=getComputedStyle(r),u=getComputedStyle(i);return e.font_family=a.fontFamily,e.font_size=parseFloat(a.fontSize)||null,e.font_smoothing=a.webkitFontSmoothing||null,e.text_rendering=a.textRendering,e.input_height=parseFloat(s.height)||null,e.button_height=parseFloat(l.height)||null,e.textarea_height=parseFloat(u.height)||null,e.button_padding=l.padding,e.input_padding=s.padding,e.input_border_width=s.borderWidth,e.button_border_radius=l.borderRadius,e.system_background=a.getPropertyValue("background-color")||null,e.box_sizing=a.boxSizing,e.line_height=c.lineHeight,e.span_display=c.display,e.div_display=a.display,e.button_outline=l.outline,e.input_outline=s.outline,e.button_cursor=l.cursor,e.writing_mode=a.writingMode,e}catch{return{}}finally{document.body.removeChild(t)}}},{category:"browser",key:"window_features",version:1,cacheTtlMs:3e5,collect:()=>{const e=window,t=navigator;return{request_idle_callback:"requestIdleCallback"in window,request_animation_frame:"requestAnimationFrame"in window,cancel_animation_frame:"cancelAnimationFrame"in window,intersection_observer:"IntersectionObserver"in window,mutation_observer:"MutationObserver"in window,resize_observer:"ResizeObserver"in window,performance_observer:"PerformanceObserver"in window,reporting_observer:"ReportingObserver"in window,indexed_db:"indexedDB"in window,caches:"caches"in window,broadcast_channel:"BroadcastChannel"in window,message_channel:"MessageChannel"in window,shared_worker:"SharedWorker"in window,fetch_api:"fetch"in window,abort_controller:"AbortController"in window,headers:"Headers"in window,crypto:"crypto"in window,crypto_key:"CryptoKey"in window,subtle_crypto:"SubtleCrypto"in window,media_source:"MediaSource"in window,media_recorder:"MediaRecorder"in window,media_stream:"MediaStream"in window,audio_context:"AudioContext"in window||"webkitAudioContext"in window,offline_audio_context:"OfflineAudioContext"in window,speech_recognition:"SpeechRecognition"in window||"webkitSpeechRecognition"in window,speech_synthesis:"speechSynthesis"in window,webgl_rendering_context:"WebGLRenderingContext"in window,webgl2_rendering_context:"WebGL2RenderingContext"in window,offscreen_canvas:"OffscreenCanvas"in window,image_bitmap:"ImageBitmap"in window,bluetooth:"Bluetooth"in window||!!t.bluetooth,usb:"USB"in window||!!t.usb,serial:"Serial"in window||!!t.serial,hid:"HID"in window||!!t.hid,gamepad:"Gamepad"in window||"getGamepads"in navigator,vr_display:"VRDisplay"in window||"getVRDisplays"in navigator,xr_system:"XRSystem"in window||!!t.xr,notification:"Notification"in window,push_manager:"PushManager"in window,payment_request:"PaymentRequest"in window,credentials_container:"CredentialsContainer"in window,public_key_credential:"PublicKeyCredential"in window,password_credential:"PasswordCredential"in window,performance_entry:"PerformanceEntry"in window,performance_navigation_timing:"PerformanceNavigationTiming"in window,performance_resource_timing:"PerformanceResourceTiming"in window,readable_stream:"ReadableStream"in window,writable_stream:"WritableStream"in window,transform_stream:"TransformStream"in window,worker:"Worker"in window,service_worker:"serviceWorker"in navigator,intl:"Intl"in window,proxy:"Proxy"in window,reflect:"Reflect"in window,symbol:"Symbol"in window,big_int:"BigInt"in window,weak_ref:"WeakRef"in window,finalization_registry:"FinalizationRegistry"in window,queue_microtask:"queueMicrotask"in window,structured_clone:"structuredClone"in window,ontouchstart:"ontouchstart"in window,touch_event:"TouchEvent"in window,pointer_event:"PointerEvent"in window,fullscreen_enabled:!!document.fullscreenEnabled,clipboard_item:"ClipboardItem"in window,show_open_file_picker:"showOpenFilePicker"in window,show_save_file_picker:"showSaveFilePicker"in window,show_directory_picker:"showDirectoryPicker"in window,get_screen_details:"getScreenDetails"in window,screen_left:"screenLeft"in window,screen_top:"screenTop"in window,scheduler:"scheduler"in window||!!e.scheduler,custom_elements:"customElements"in window,html_template_element:"HTMLTemplateElement"in window,shadow_root:"ShadowRoot"in window}}},{category:"browser",key:"video_codec_support",version:1,cacheTtlMs:3e5,collect:()=>{const e=document.createElement("video");if(!e.canPlayType)return{};const t={h264_baseline:'video/mp4; codecs="avc1.42E01E"',h264_main:'video/mp4; codecs="avc1.4D401E"',h264_high:'video/mp4; codecs="avc1.64001E"',hevc_main:'video/mp4; codecs="hvc1.1.6.L93.B0"',hevc_main10:'video/mp4; codecs="hvc1.2.4.L93.B0"',hevc_hev1:'video/mp4; codecs="hev1.1.6.L93.B0"',vp8:'video/webm; codecs="vp8"',vp9:'video/webm; codecs="vp9"',vp9_profile0:'video/webm; codecs="vp09.00.10.08"',vp9_profile2:'video/webm; codecs="vp09.02.10.10"',av1:'video/mp4; codecs="av01.0.00M.08"',av1_main:'video/mp4; codecs="av01.0.01M.08"',av1_high:'video/mp4; codecs="av01.0.08M.10"',av1_webm:'video/webm; codecs="av01.0.00M.08"',theora:'video/ogg; codecs="theora"',mpeg4:'video/mp4; codecs="mp4v.20.8"',mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg"},n={};for(const[o,r]of Object.entries(t))n[o]=Z(()=>e.canPlayType(r),"");return n}},{category:"browser",key:"audio_codec_support",version:1,cacheTtlMs:3e5,collect:()=>{const e=document.createElement("audio");if(!e.canPlayType)return{};const t={aac:'audio/mp4; codecs="mp4a.40.2"',aac_he:'audio/mp4; codecs="mp4a.40.5"',aac_eld:'audio/mp4; codecs="mp4a.40.39"',mp3:"audio/mpeg",mp3_codec:'audio/mpeg; codecs="mp3"',opus:'audio/ogg; codecs="opus"',opus_webm:'audio/webm; codecs="opus"',vorbis:'audio/ogg; codecs="vorbis"',flac:"audio/flac",flac_ogg:'audio/ogg; codecs="flac"',wav:"audio/wav",pcm:'audio/wav; codecs="1"',ac3:'audio/mp4; codecs="ac-3"',eac3:'audio/mp4; codecs="ec-3"',alac:'audio/mp4; codecs="alac"'},n={};for(const[o,r]of Object.entries(t))n[o]=Z(()=>e.canPlayType(r),"");return n}},{category:"browser",key:"permissions_state",version:1,cacheTtlMs:6e4,timeoutMs:3e3,isSupported:()=>"function"==typeof navigator.permissions?.query,collect:async()=>{const e=[{api:"geolocation",key:"geolocation"},{api:"notifications",key:"notifications"},{api:"push",key:"push"},{api:"camera",key:"camera"},{api:"microphone",key:"microphone"},{api:"background-fetch",key:"background_fetch"},{api:"background-sync",key:"background_sync"},{api:"persistent-storage",key:"persistent_storage"},{api:"accelerometer",key:"accelerometer"},{api:"gyroscope",key:"gyroscope"},{api:"magnetometer",key:"magnetometer"},{api:"clipboard-read",key:"clipboard_read"},{api:"clipboard-write",key:"clipboard_write"},{api:"payment-handler",key:"payment_handler"},{api:"midi",key:"midi"}],t={};for(const n of e)try{const e=await navigator.permissions.query({name:n.api});t[n.key]=e.state}catch{t[n.key]=null}return t}},{category:"browser",key:"subtle_crypto_support",version:1,cacheTtlMs:3e5,timeoutMs:2e3,collect:async()=>{if(!window.crypto||!window.crypto.subtle)return null;const e=window.crypto.subtle,t={},n={},o=["AES-CBC","AES-GCM","AES-CTR","AES-KW"];for(const n of o)try{await e.generateKey({name:n,length:256},!1,["encrypt"]),t[n]=!0}catch{t[n]=!1}const r=["SHA-1","SHA-256","SHA-384","SHA-512"];for(const n of r)try{await e.digest(n,new Uint8Array([1,2,3])),t[n]=!0}catch{t[n]=!1}try{await e.generateKey({name:"HMAC",hash:"SHA-256"},!1,["sign"]),t.HMAC=!0}catch{t.HMAC=!1}const i=["RSA-OAEP","RSA-PSS","RSASSA-PKCS1-v1_5"];for(const n of i)try{await e.generateKey({name:n,modulusLength:1024,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-256"},!1,"RSA-OAEP"===n?["encrypt"]:["sign"]),t[n]=!0}catch{t[n]=!1}const a=["P-256","P-384","P-521"];for(const t of a)try{await e.generateKey({name:"ECDSA",namedCurve:t},!1,["sign"]),n[t]=!0}catch{n[t]=!1}try{await e.generateKey({name:"Ed25519"},!1,["sign"]),t.Ed25519=!0}catch{t.Ed25519=!1}try{await e.generateKey({name:"X25519"},!1,["deriveBits"]),t.X25519=!0}catch{t.X25519=!1}return{available:!0,algorithms:t,curves:n}}},{category:"browser",key:"drm_support",version:1,timeoutMs:3e3,collect:async()=>{const e={widevine:!1,playready:!1,fairplay:!1,clearkey:!1,primetime:!1};if("undefined"==typeof navigator||!navigator.requestMediaKeySystemAccess)return e;const t=[{initDataTypes:["cenc"],videoCapabilities:[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],audioCapabilities:[{contentType:'audio/mp4; codecs="mp4a.40.2"'},{contentType:'audio/webm; codecs="opus"'}]}],n=Object.entries({widevine:["com.widevine.alpha"],playready:["com.microsoft.playready","com.microsoft.playready.hardware"],fairplay:["com.apple.fps","com.apple.fps.1_0","com.apple.fps.2_0"],clearkey:["org.w3.clearkey"],primetime:["com.adobe.primetime"]}).map(async([n,o])=>{for(const r of o)try{await navigator.requestMediaKeySystemAccess(r,t),e[n]=!0;break}catch{}});return await Promise.all(n),e}},{category:"browser",key:"navigator_features",version:1,collect:()=>{const e=navigator;return{vibrate:"function"==typeof e.vibrate,share:"function"==typeof e.share,can_share:"function"==typeof e.canShare,wake_lock:"wakeLock"in e,bluetooth:"bluetooth"in e,usb:"usb"in e,serial:"serial"in e,hid:"hid"in e,presentation:"presentation"in e,xr:"xr"in e,media_session:"mediaSession"in e,media_capabilities:"mediaCapabilities"in e,permissions:"permissions"in e,clipboard:"clipboard"in e,credentials:"credentials"in e,locks:"locks"in e,storage:"storage"in e,service_worker:"serviceWorker"in e,geolocation:"geolocation"in e,get_battery:"function"==typeof e.getBattery,send_beacon:"function"==typeof e.sendBeacon,request_midi_access:"function"==typeof e.requestMIDIAccess,get_gamepads:"function"==typeof e.getGamepads,max_touch_points:e.maxTouchPoints??0,pdf_viewer_enabled:e.pdfViewerEnabled??!1,webdriver:e.webdriver??!1,device_memory:e.deviceMemory??null,hardware_concurrency:e.hardwareConcurrency??null,cookie_enabled:e.cookieEnabled??!1,on_line:e.onLine??!1,language:e.language??null}}},{category:"browser",key:"document_features",version:1,collect:()=>{const e=document;return{picture_in_picture_enabled:e.pictureInPictureEnabled??!1,fullscreen_enabled:e.fullscreenEnabled??!1,design_mode:e.designMode??null,hidden:e.hidden??!1,visibility_state:e.visibilityState??null,adopted_style_sheets:"adoptedStyleSheets"in e,timeline:"timeline"in e,fragment_directive:"fragmentDirective"in e,feature_policy:"featurePolicy"in e,permissions_policy:"permissionsPolicy"in e}}},{category:"browser",key:"css_feature_support",version:1,collect:()=>{const e=(e,t)=>{try{return!("undefined"==typeof CSS||!CSS.supports)&&(t?CSS.supports(e,t):CSS.supports(e))}catch{return!1}};return{supported:"undefined"!=typeof CSS&&"function"==typeof CSS.supports,variables:e("--a","0"),grid:e("display","grid"),subgrid:e("grid-template-columns","subgrid"),flexbox:e("display","flex"),container_queries:e("container-type","inline-size"),has:e("selector(:has(*))"),backdrop_filter:e("backdrop-filter","blur(1px)"),mask_image:e("mask-image","none"),scroll_snap_type:e("scroll-snap-type","x mandatory"),aspect_ratio:e("aspect-ratio","1/1"),gap:e("gap","1px"),inset:e("inset","0"),color_mix:e("color","color-mix(in srgb, red, blue)"),lch:e("color","lch(50% 50 50)"),oklch:e("color","oklch(50% 0.2 50)"),paint_worklet:"undefined"!=typeof CSS&&"paintWorklet"in CSS,register_property:"undefined"!=typeof CSS&&"registerProperty"in CSS,layer_rule:e("@layer test { }"),nesting_selector:e("selector(&)"),view_transitions:"undefined"!=typeof document&&"startViewTransition"in document,anchor_positioning:e("anchor-name","--a"),scroll_timeline:e("animation-timeline","scroll()"),touch_action:e("touch-action","pan-y")}}},{category:"browser",key:"dom_blockers",version:1,cacheTtlMs:3e5,collect:()=>{const e={},t=[{id:"ad_banner",className:"ad-banner",name:"ad_banner"},{id:"ads",className:"ads",name:"ads"},{id:"advertisement",className:"advertisement",name:"advertisement"},{id:"sponsor",className:"sponsor-link",name:"sponsor"},{id:"google_ads",className:"google-ad",name:"google_ads"},{id:"adsbox",className:"adsbox",name:"ads_box"},{id:"ad_unit",className:"ad-unit",name:"ad_unit"},{id:"banner_ad",className:"banner_ad",name:"banner_ad"}],n=document.createElement("div");n.style.position="absolute",n.style.left="-9999px",n.style.top="-9999px";const o=[];for(const e of t){const t=document.createElement("div");t.id=e.id,t.className=e.className,t.style.width="1px",t.style.height="1px",t.innerHTML=" ",n.appendChild(t),o.push(t)}document.body.appendChild(n);try{for(let n=0;t.length>n;n++){const r=o[n],i=t[n],a=getComputedStyle(r);e[i.name]="none"===a.display||"hidden"===a.visibility||0===r.offsetHeight||0===r.offsetWidth||"0"===a.opacity||null===r.offsetParent}}finally{document.body.removeChild(n)}return e}},{category:"browser",key:"iframe_sandbox_support",version:1,collect:()=>{try{const e=document.createElement("iframe");if(!("sandbox"in e))return{supported:!1,tokens:[]};const t=["allow-downloads","allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-popups-to-escape-sandbox","allow-presentation","allow-same-origin","allow-scripts","allow-storage-access-by-user-activation","allow-top-navigation","allow-top-navigation-by-user-activation","allow-top-navigation-to-custom-protocols"],n=[];for(const o of t)try{e.sandbox.add(o),e.sandbox.contains(o)&&n.push(o),e.sandbox.remove(o)}catch{}return{supported:!0,tokens:n}}catch{return{supported:!1,tokens:[]}}}},{category:"browser",key:"system_colors",version:1,collect:()=>{try{const e=[{css:"Canvas",key:"canvas"},{css:"CanvasText",key:"canvas_text"},{css:"LinkText",key:"link_text"},{css:"VisitedText",key:"visited_text"},{css:"ActiveText",key:"active_text"},{css:"ButtonFace",key:"button_face"},{css:"ButtonText",key:"button_text"},{css:"ButtonBorder",key:"button_border"},{css:"Field",key:"field"},{css:"FieldText",key:"field_text"},{css:"Highlight",key:"highlight"},{css:"HighlightText",key:"highlight_text"},{css:"SelectedItem",key:"selected_item"},{css:"SelectedItemText",key:"selected_item_text"},{css:"Mark",key:"mark"},{css:"MarkText",key:"mark_text"},{css:"GrayText",key:"gray_text"},{css:"AccentColor",key:"accent_color"},{css:"AccentColorText",key:"accent_color_text"}],t=document.createElement("div");t.style.cssText="position:absolute;left:-9999px;",document.body.appendChild(t);const n={};for(const o of e)try{t.style.color=o.css;const e=getComputedStyle(t).color;n[o.key]=e||null}catch{n[o.key]=null}return document.body.removeChild(t),n}catch{return{}}}}];const Y=[{category:"network",key:"network_connection",version:1,cacheTtlMs:3e4,isSupported:()=>"connection"in navigator,collect:()=>{const e=navigator.connection;return e?{effective_type:e.effectiveType??null,downlink:e.downlink??null,downlink_max:e.downlinkMax??null,rtt:e.rtt??null,save_data:e.saveData??!1,type:e.type??null}:null}},{category:"network",key:"webrtc_ip_handling",version:1,cacheTtlMs:6e4,timeoutMs:2e3,isSupported:()=>"undefined"!=typeof RTCPeerConnection||void 0!==window.webkitRTCPeerConnection,collect:async()=>{const e=RTCPeerConnection||window.webkitRTCPeerConnection;if(!e)return null;const t=function(e,t){try{return e()}catch{return t}}(()=>{const t=new e({iceServers:[]}),n="function"==typeof t.createDataChannel;return t.close(),n},!1),n=!!navigator.mediaDevices&&!!navigator.mediaDevices.getUserMedia;let o=null;try{const t=new e({iceServers:[],iceCandidatePoolSize:0});t.createDataChannel("");const n=new Promise(e=>{const n=setTimeout(()=>e(!1),1e3);t.onicecandidate=t=>{t.candidate&&(clearTimeout(n),e(!0))},t.createOffer().then(e=>t.setLocalDescription(e)).catch(()=>e(!1))}),r=await n;t.close(),o=r?"default":"disabled"}catch{o="error"}return{peer_connection_supported:!0,rtc_data_channel_supported:t,media_devices_supported:n,ip_handling_policy:o}}}];function ee(e,t){try{return e()}catch{return t}}async function te(e,t,n){return Promise.race([e,new Promise(e=>setTimeout(()=>e(n),t))])}const ne=[{category:"storage",key:"cookies_enabled",version:1,cacheTtlMs:6e4,collect:()=>ee(()=>navigator.cookieEnabled??null,null)},{category:"storage",key:"storage_availability",version:1,cacheTtlMs:3e5,collect:()=>({local_storage:(()=>{try{const e="__fp_test_ls__";return localStorage.setItem(e,"1"),localStorage.removeItem(e),!0}catch{return!1}})(),session_storage:(()=>{try{const e="__fp_test_ss__";return sessionStorage.setItem(e,"1"),sessionStorage.removeItem(e),!0}catch{return!1}})(),indexed_db:!!window.indexedDB,web_sql:!!window.openDatabase,cache_api:"caches"in window,service_worker:"serviceWorker"in navigator,file_system_access:"showOpenFilePicker"in window||"showDirectoryPicker"in window,cookie_store:"cookieStore"in window,cookies_enabled:ee(()=>navigator.cookieEnabled,!1),storage_manager:"storage"in navigator,persistent_storage:!!navigator.storage?.persist})},{category:"storage",key:"storage_persistence",version:1,cacheTtlMs:6e4,timeoutMs:2e3,collect:async()=>{if(!navigator.storage)return null;let e=!1;try{e=await te(navigator.storage.persisted(),1e3,!1)}catch{}let t=null,n=null,o=null;try{const e=await te(navigator.storage.estimate(),1e3,{quota:void 0,usage:void 0});t=e.quota??null,n=e.usage??null,null!==t&&null!==n&&t>0&&(o=Math.round(n/t*1e4)/100)}catch{}return{persisted:e,quota_bytes:t,usage_bytes:n,usage_percentage:o}}}];function oe(e){try{if("function"!=typeof window.matchMedia)return null;return window.matchMedia(e).matches}catch{return null}}const re={category:"accessibility",key:"screen_reader_hints",version:1,cacheTtlMs:3e5,collect:()=>{const e=!0===oe("(forced-colors: active)"),t=!0===oe("(prefers-contrast: more)")||!0===oe("(-ms-high-contrast: active)"),n=!0===oe("(prefers-reduced-motion: reduce)"),o="speechSynthesis"in window;return{forced_colors:e,high_contrast:t,reduced_motion:n,speech_synthesis:o,aria_live:document.querySelectorAll('[aria-live="polite"], [aria-live="assertive"], [role="alert"], [role="status"]').length>0,possible_screen_reader:(e||t)&&(n||o)}}},ie=[{category:"accessibility",key:"dark_mode",version:1,cacheTtlMs:6e4,collect:()=>oe("(prefers-color-scheme: dark)")?"dark":oe("(prefers-color-scheme: light)")?"light":"no-preference"},{category:"accessibility",key:"contrast_preference",version:1,cacheTtlMs:6e4,collect:()=>oe("(prefers-contrast: more)")?"more":oe("(prefers-contrast: less)")?"less":oe("(prefers-contrast: custom)")?"custom":oe("(prefers-contrast: no-preference)")?"no-preference":null},{category:"accessibility",key:"reduced_motion",version:1,cacheTtlMs:6e4,collect:()=>oe("(prefers-reduced-motion: reduce)")},{category:"accessibility",key:"reduced_transparency",version:1,cacheTtlMs:6e4,collect:()=>oe("(prefers-reduced-transparency: reduce)")},{category:"accessibility",key:"forced_colors",version:1,cacheTtlMs:6e4,collect:()=>oe("(forced-colors: active)")},{category:"accessibility",key:"inverted_colors",version:1,cacheTtlMs:6e4,collect:()=>oe("(inverted-colors: inverted)")},{category:"accessibility",key:"do_not_track",version:1,cacheTtlMs:6e4,collect:()=>{try{return(navigator.doNotTrack||window.doNotTrack||navigator.msDoNotTrack)??null}catch{return null}}},re,{category:"accessibility",key:"text_scaling",version:1,cacheTtlMs:6e4,collect:()=>{try{const e=16,t=document.createElement("div");t.style.cssText="position:absolute;left:-9999px;font-size:1rem;width:1em;height:1em;",document.body.appendChild(t);const n=parseFloat(getComputedStyle(t).fontSize);document.body.removeChild(t);const o=Math.round(n/e*100)/100;return{font_size:n,scale_factor:o,possible_zoom:1!==o}}catch{return{font_size:16,scale_factor:1,possible_zoom:!1}}}}];function ae(e,t){try{return e()}catch{return t}}function ce(e,t){return Promise.race([e,new Promise(e=>setTimeout(()=>e(null),t))])}const se=[{category:"risk",key:"automation_detected",version:1,cacheTtlMs:3e5,collect:()=>{const e=navigator,t=window;if(!0===e.webdriver)return!0;const n=["__selenium_unwrapped","__webdriver_evaluate","__webdriver_unwrapped","__driver_evaluate","__driver_unwrapped","__webdriver_script_fn","__webdriver_script_func","__webdriver_script_function","__fxdriver_evaluate","__fxdriver_unwrapped","_Selenium_IDE_Recorder","_selenium","calledSelenium","$cdc_asdjflasutopfhvcZLmcfl_","$chrome_asyncScriptInfo","__nightmare","__puppeteer_evaluation_script__","__playwright_evaluation_script__"];for(const e of n)if(e in t||e in document)return!0;if("callPhantom"in t||"_phantom"in t||"phantom"in t)return!0;const o=e.userAgent?.toLowerCase()||"";return!(!o.includes("headless")&&!o.includes("phantomjs"))}},{category:"risk",key:"automation_signals",version:1,cacheTtlMs:3e5,collect:()=>{const e=navigator,t=window,n=e.userAgent?.toLowerCase()||"";return{webdriver:!0===e.webdriver,headless_user_agent:n.includes("headless")||n.includes("phantomjs"),phantom_js:"callPhantom"in t||"_phantom"in t||"phantom"in t,selenium:["__selenium_unwrapped","_Selenium_IDE_Recorder","_selenium","calledSelenium"].some(e=>e in t||e in document),playwright:"__playwright_evaluation_script__"in t,puppeteer:"__puppeteer_evaluation_script__"in t,nightmare:"__nightmare"in t,cdc_properties:"$cdc_asdjflasutopfhvcZLmcfl_"in t||"$chrome_asyncScriptInfo"in t||Object.keys(t).some(e=>e.startsWith("$cdc_")),languages_inconsistent:ae(()=>!e.languages||0===e.languages.length||!(!e.language||e.languages.includes(e.language.split("-")[0])),!1),plugins_inconsistent:ae(()=>{const t=e.plugins;return!t||0===t.length&&!n.includes("firefox")},!1),permissions_inconsistent:ae(()=>"permissions"in e&&void 0===e.permissions.query,!1),screen_inconsistent:ae(()=>0===screen.width||0===screen.height||0===screen.availWidth||0===screen.availHeight,!1),chrome_inconsistent:ae(()=>!(!n.includes("chrome")||"chrome"in t)||!(!t.chrome||t.chrome.runtime||t.chrome.csi),!1),notification_permission_inconsistent:ae(()=>!1,!1)}}},{category:"risk",key:"debugger_detected",version:1,cacheTtlMs:1e4,collect:()=>{let e=!1,t=null;return ae(()=>{const n=window.outerWidth-window.innerWidth>160,o=window.outerHeight-window.innerHeight>160;(n||o)&&(e=!0,t="dimension")},void 0),ae(()=>{window.Firebug?.chrome?.isInitialized&&(e=!0,t="firebug")},void 0),{dev_tools_open:e,method:t}}},{category:"risk",key:"incognito_mode",version:1,cacheTtlMs:3e5,timeoutMs:2e3,collect:async()=>{try{const e=await ce(navigator.storage.estimate(),1e3);if(e&&void 0!==e.quota&&12e7>e.quota)return{is_private:!0,confidence:"high",method:"storage_quota"}}catch{}try{await ce(new Promise((e,t)=>{const n=indexedDB.open("test");n.onerror=()=>t(Error("IndexedDB error")),n.onsuccess=()=>{n.result.close(),e(!0)}}),1e3)}catch{return{is_private:!0,confidence:"medium",method:"indexeddb"}}try{const e=window.webkitRequestFileSystem;if(e){await ce(new Promise((t,n)=>{e(0,1,()=>t(!0),()=>n(Error("FileSystem error")))}),1e3)}}catch{return{is_private:!0,confidence:"medium",method:"filesystem"}}return{is_private:!1,confidence:"low",method:"none"}}},{category:"risk",key:"disabled_cookie_flag",version:1,cacheTtlMs:6e4,collect:()=>{const e=navigator.cookieEnabled??!1;let t=!1;try{document.cookie="__fp_test_cookie=1; SameSite=Strict",t=document.cookie.includes("__fp_test_cookie"),document.cookie="__fp_test_cookie=; expires=Thu, 01 Jan 1970 00:00:00 GMT"}catch{t=!1}return{cookie_enabled:e,can_set_cookie:t,third_party_cookies:null}}}];function le(){return[...R,...J,...j,...G,...N,...H,...Q,...ie,...se,...ne,...Y,...O]}var ue="1.1.1";function de(){try{return localStorage.getItem(n)}catch{return null}}function pe(){try{return`${window.location.host}${window.location.pathname}`}catch{return""}}function me(e){if(null===e)return null;if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return e;if("bigint"==typeof e)return""+e;if(void 0===e)return null;if("function"==typeof e||"symbol"==typeof e)return null;if(Array.isArray(e))return e.map(e=>me(e));if(e&&"object"==typeof e){const t=e,n={};for(const e of Object.keys(t).sort()){const o=me(t[e]);void 0!==o&&(n[e]=o)}return n}return null}function ye(e){const t={};for(const[n,o]of Object.entries(e))t[n]={value:o.value,status:o.status,version:o.version,category:o.category};return t}function he(){try{const e=localStorage.getItem(o);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}const ge=new class{constructor(){this.state="idle",this.cachedCollection=null,this.cachedElephantDevice=null,this.collectionAndSendPromise=null,this.localElephantDevice=null,this.isInitialized=!1,this.lastSendSucceeded=!1,this.pendingUserData=null}async init(e={}){if(this.isInitialized&&this.lastSendSucceeded)return this.log("Agent already initialized, ignoring duplicate init call"),this.getDebugInfo();if(this.isInitialized&&!this.lastSendSucceeded)return this.options=w(i,e),this.log=b("[DeviceIntelligence]",this.options.debug),this.log("Retrying send after previous failure"),this.collectAndSend();this.options=w(i,e),this.log=b("[DeviceIntelligence]",this.options.debug),this.attributeEngine=new M({collectors:le(),debug:this.options.debug,log:this.log,concurrency:8}),this.localElephantDevice=function(){try{let e=localStorage.getItem(t);return e||(e=crypto.randomUUID(),localStorage.setItem(t,e)),e}catch{return crypto.randomUUID()}}(),this.cachedElephantDevice=de(),this.isInitialized=!0,this.log("DeviceIntelligenceAgent initialized");const{collectionTiming:n}=this.options;switch(n){case"immediate":return this.log("Starting immediate collection"),this.collectAndSend();case"onLoad":return this.log("Scheduling collection for page load"),"complete"===document.readyState?this.collectAndSend():new Promise((e,t)=>{window.addEventListener("load",()=>{this.collectAndSend().then(e).catch(t)},{once:!0})});case"manual":return this.log("Manual collection mode - waiting for explicit trigger"),this.getDebugInfo();default:return this.getDebugInfo()}}async addUserData(e){return this.collectAndSend(e)}getElephantDevice(){return this.cachedElephantDevice}getDebugInfo(){return this.isInitialized&&this.options.debug&&this.cachedCollection?{attributes:this.cachedCollection.attributes,collectedAt:this.cachedCollection.collectedAt,state:this.state,sdkType:"web",sdkVersion:ue,schemaVersion:1}:null}async collectAndSend(e){if(!this.isInitialized)throw Error("DeviceIntelligence SDK not initialized. Call DeviceIntelligence.init() first.");if(this.log("collectAndSend called",e?"with user data":"without user data"),"collecting"===this.state&&this.collectionAndSendPromise)return this.log("Collection in progress, merging user data into pending request"),e&&(this.pendingUserData={...this.pendingUserData,...e}),await this.collectionAndSendPromise,this.getDebugInfo();this.state="collecting",this.collectionAndSendPromise=(async()=>{this.cachedCollection&&this.isCacheValid()||await this.collectAttributes();const t={...this.pendingUserData,...e};this.pendingUserData=null,this.options.skipSend?(this.log("skipSend mode enabled - skipping server send"),this.lastSendSucceeded=!0):await this.buildAndSendPayload(Object.keys(t).length>0?t:void 0)})();try{await this.collectionAndSendPromise,this.state="collected"}catch(e){throw this.state="error",e}return this.getDebugInfo()}isCacheValid(){if(!this.cachedCollection)return!1;const e=Date.now()-this.cachedCollection.collectedAt;return this.options.attributeCacheTtl>e}async collectAttributes(){this.log("Collecting device attributes...");const e=new AbortController,t=setTimeout(()=>e.abort(),Math.max(1,this.options.timeout));let n;try{n=await this.attributeEngine.collectAll(e.signal)}finally{clearTimeout(t)}const o=this.toAttributes(n);return this.cachedCollection={attributes:o,results:n,collectedAt:Date.now()},this.log("Collection complete, attributes count:",Object.keys(o).length),this.cachedCollection}async buildAndSendPayload(e){if(!this.cachedCollection)return void this.log("No cached collection available, skipping send");const t=await async function(e,t){if("undefined"==typeof crypto||!crypto.subtle)return"";const n={attributes:me(ye(e)),userData:t?me(t):null},o=JSON.stringify(n),r=(new TextEncoder).encode(o),i=await crypto.subtle.digest("SHA-256",r);return Array.from(new Uint8Array(i)).map(e=>e.toString(16).padStart(2,"0")).join("")}(this.cachedCollection.attributes,e);if(!function(e,t){if(!e)return!0;if(0>=t)return!0;try{const n=he(),o=Date.now(),r=n.find(t=>t.hash===e);return!r||o-r.timestamp>=t}catch{return!0}}(t,this.options.minSendIntervalMs))return this.log("Skipping send - payload unchanged and within minSendIntervalMs"),void(this.lastSendSucceeded=!0);const n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}),i=Date.now(),a=de(),c={referer:pe(),site_id:this.options.siteId,timestamp:i,local_elephant_device:this.localElephantDevice,elephant_device:a,user_data:e||{},sdk_type:"web",sdk_version:ue,schema_version:1,attributes:this.cachedCollection.attributes,...this.options.trafficType&&{traffic_type:this.options.trafficType}};if(this.log("Payload prepared, requestId:",n),!this.options.endpoint)return this.log("No endpoint configured, skipping server request"),void(this.lastSendSucceeded=!0);const s=await this.sendToServer(c);this.lastSendSucceeded=s,s&&(!function(e,t){if(e)try{const n=he(),i=Date.now(),a=Math.max(t,r),c=n.filter(t=>t.hash===e||a>i-t.timestamp),s=c.find(t=>t.hash===e);s?s.timestamp=i:c.push({hash:e,timestamp:i}),localStorage.setItem(o,JSON.stringify(c))}catch{}}(t,this.options.minSendIntervalMs),this.log("Payload sent successfully"))}toAttributes(e){const t={};for(const n of e)t[n.key]={value:null,duration:n.durationMs,status:n.status,version:n.version,category:n.category,error:n.error},"ok"===n.status&&(t[n.key].value=n.value);return t}async sendToServer(e){const{endpoint:t,apiKey:o,timeout:r}=this.options;this.log("Sending to server:",t);const i=new AbortController,a=setTimeout(()=>i.abort(),r);try{const r={"Content-Type":"application/json"};let c;if(o&&(r["X-API-Key"]=o),"undefined"!=typeof crypto&&crypto.subtle){const t=await x(e);c=JSON.stringify(t),r["pipl-encrypted"]="true",this.log("Payload encrypted")}else c=JSON.stringify(e),this.log("Web Crypto not supported, sending unencrypted");const s=await fetch(t,{method:"POST",headers:r,body:c,signal:i.signal});if(clearTimeout(a),!s.ok){const e=await s.text().catch(()=>"");throw Error(`Server responded with ${s.status}${e?": "+e:""}`)}const l=await s.json();return this.log("Server response:",l),l.elephantDevice&&(this.cachedElephantDevice=l.elephantDevice,function(e){try{localStorage.setItem(n,e)}catch{}}(l.elephantDevice)),!0}catch(e){clearTimeout(a);if(this.log("Server request failed:",e instanceof Error?"AbortError"===e.name?"Request timeout":e.message:"Unknown error"),this.options.debug)throw e;return!1}}};function _e(e={}){return ge.init(e)}async function fe(e){return ge.addUserData(e)}function ve(){return ge.getElephantDevice()}const we={init:_e,addUserData:fe,getElephantDevice:ve};e.addUserData=fe,e.default=we,e.getElephantDevice=ve,e.init=_e,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
6
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).DeviceIntelligence={})}(this,function(e){"use strict";const t="local_elephant_device",n="elephant_device",o="sent_payloads",r=18e6,i={debug:!1,endpoint:"https://device.pipl.com/device/collect",apiKey:null,siteId:null,timeout:1e4,collectionTiming:"immediate",attributeCacheTtl:3e5,trafficType:null,minSendIntervalMs:r,skipSend:!1};function a(e,t){let n=0,o=0,r=0,i=0;i+=(65535&e[1])+(65535&t[1]),r+=i>>>16,i&=65535,r+=(e[1]>>>16)+(t[1]>>>16),o+=r>>>16,r&=65535,o+=(65535&e[0])+(65535&t[0]),n+=o>>>16,o&=65535,n+=(e[0]>>>16)+(t[0]>>>16),n&=65535,e[0]=n<<16|o,e[1]=r<<16|i}function c(e,t){const n=65535&e[0],o=e[1]>>>16,r=65535&e[1],i=65535&t[0],a=t[1]>>>16,c=65535&t[1];let s=0,l=0,u=0,d=0;d+=r*c,u+=d>>>16,d&=65535,u+=o*c,l+=u>>>16,u&=65535,u+=r*a,l+=u>>>16,u&=65535,l+=n*c,s+=l>>>16,l&=65535,l+=o*a,s+=l>>>16,l&=65535,l+=r*i,s+=l>>>16,l&=65535,s+=(e[0]>>>16)*c+n*a+o*i+r*(t[0]>>>16),s&=65535,e[0]=s<<16|l,e[1]=u<<16|d}function s(e,t){const n=e[0];32===(t%=64)?(e[0]=e[1],e[1]=n):32>t?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(e[0]=e[1]<<(t-=32)|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function l(e,t){0!==(t%=64)&&(32>t?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function u(e,t){e[0]^=t[0],e[1]^=t[1]}const d=[4283543511,3981806797],p=[3301882366,444984403];function m(e){const t=[0,e[0]>>>1];u(e,t),c(e,d),t[1]=e[0]>>>1,u(e,t),c(e,p),t[1]=e[0]>>>1,u(e,t)}const h=[2277735313,289559509],y=[1291169091,658871167],g=[0,5],_=[0,1390208809],f=[0,944331445];const v=function(e,t){const n=function(e){const t=new Uint8Array(e.length);for(let n=0;e.length>n;n++){const o=e.charCodeAt(n);if(o>127)return(new TextEncoder).encode(e);t[n]=o}return t}(e),o=[0,n.length],r=o[1]%16,i=o[1]-r,d=[0,t=t||0],p=[0,t],v=[0,0],w=[0,0];let b;for(b=0;i>b;b+=16)v[0]=n[b+4]|n[b+5]<<8|n[b+6]<<16|n[b+7]<<24,v[1]=n[b]|n[b+1]<<8|n[b+2]<<16|n[b+3]<<24,w[0]=n[b+12]|n[b+13]<<8|n[b+14]<<16|n[b+15]<<24,w[1]=n[b+8]|n[b+9]<<8|n[b+10]<<16|n[b+11]<<24,c(v,h),s(v,31),c(v,y),u(d,v),s(d,27),a(d,p),c(d,g),a(d,_),c(w,y),s(w,33),c(w,h),u(p,w),s(p,31),a(p,d),c(p,g),a(p,f);v[0]=0,v[1]=0,w[0]=0,w[1]=0;const k=[0,0];switch(r){case 15:k[1]=n[b+14],l(k,48),u(w,k);case 14:k[1]=n[b+13],l(k,40),u(w,k);case 13:k[1]=n[b+12],l(k,32),u(w,k);case 12:k[1]=n[b+11],l(k,24),u(w,k);case 11:k[1]=n[b+10],l(k,16),u(w,k);case 10:k[1]=n[b+9],l(k,8),u(w,k);case 9:k[1]=n[b+8],u(w,k),c(w,y),s(w,33),c(w,h),u(p,w);case 8:k[1]=n[b+7],l(k,56),u(v,k);case 7:k[1]=n[b+6],l(k,48),u(v,k);case 6:k[1]=n[b+5],l(k,40),u(v,k);case 5:k[1]=n[b+4],l(k,32),u(v,k);case 4:k[1]=n[b+3],l(k,24),u(v,k);case 3:k[1]=n[b+2],l(k,16),u(v,k);case 2:k[1]=n[b+1],l(k,8),u(v,k);case 1:k[1]=n[b],u(v,k),c(v,h),s(v,31),c(v,y),u(d,v)}return u(d,o),u(p,o),a(d,p),a(p,d),m(d),m(p),a(d,p),a(p,d),("00000000"+(d[0]>>>0).toString(16)).slice(-8)+("00000000"+(d[1]>>>0).toString(16)).slice(-8)+("00000000"+(p[0]>>>0).toString(16)).slice(-8)+("00000000"+(p[1]>>>0).toString(16)).slice(-8)};function w(e,t){const n={...e};for(const e of Object.keys(t)){const o=t[e];void 0!==o&&(n[e]=o)}return n}function b(e,t){return(...n)=>{t&&console.log(e,...n)}}function k(e){const t=new Uint8Array(e);let n="";for(let e=0;t.byteLength>e;e++)n+=String.fromCharCode(t[e]);return btoa(n)}async function x(e){const t=await async function(e){const t=e.replace(/-----BEGIN PUBLIC KEY-----/,"").replace(/-----END PUBLIC KEY-----/,"").replace(/\s/g,""),n=Uint8Array.from(atob(t),e=>e.charCodeAt(0));return await crypto.subtle.importKey("spki",n.buffer,{name:"RSA-OAEP",hash:"SHA-256"},!1,["encrypt"])}("-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1DV8em/rKKXLkNE+5uKK\nHRb8nt46DaQrHrzK1GAi2ZcPQQHPT/Iiy/TCI3HCGGXeSl8/ZFHlT9Xuc+g4Wuce\njE5mNAHwJrbUqZgJKSfkK0KwbTz84U0Bic3HWpjW7E2I+cEbdjnGuQfI8ZNqw19g\ns7Zo6xVYArdd57nbInF7dh/kRVnYxmbqtpt3SpyqtaBPouLDsSTkjHefXKBA0uNM\nU7ix5OlOHFsUGTjsbWoQbiMRDrcozp1KtVJN7n0d095gJW+bsBSBMd3/LMIbVPox\nrfokGe0h+6z0RLxSSu3178r8Cug01xz9D4pXWpugTJvJNN4boMeOV5rItLdqyNq0\nZwIDAQAB\n-----END PUBLIC KEY-----"),n=await async function(){return await crypto.subtle.generateKey({name:"AES-GCM",length:256},!0,["encrypt"])}(),{ciphertext:o,iv:r}=await async function(e,t){const n=(new TextEncoder).encode(JSON.stringify(t)),o=crypto.getRandomValues(new Uint8Array(12));return{ciphertext:k(await crypto.subtle.encrypt({name:"AES-GCM",iv:o},e,n)),iv:k(o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength))}}(n,e),i=await async function(e,t){const n=await crypto.subtle.exportKey("raw",e);return k(await crypto.subtle.encrypt({name:"RSA-OAEP"},t,n))}(n,t);return{payload:o,key:i,iv:r,version:"1.0"}}function S(){return"undefined"!=typeof performance&&"function"==typeof performance.now?performance.now():Date.now()}async function T(e,t){const n=Array(e.length);let o=0;const r=Array.from({length:Math.max(1,t)},()=>async function(){for(;;){const t=o++;if(t>=e.length)return;n[t]=await e[t]()}}());return await Promise.all(r),n}class M{constructor(e){this.collectors=e.collectors,this.ctx={debug:e.debug,log:e.log,now:S,cache:new Map},this.concurrency=e.concurrency??8,this.collectorKeys=new Set;for(const e of this.collectors)this.collectorKeys.has(e.key)&&this.ctx.log("[AttributeEngine] Duplicate collector key detected:",e.key),this.collectorKeys.add(e.key)}async collectAll(e){const t=e??(new AbortController).signal,n=this.collectors.map(e=>async()=>{const n=this.ctx.now(),o=e.category??"system";try{const c=this.collectors.filter(t=>t.key===e.key).length;if(c>1)return{category:o,key:e.key,version:e.version,status:"error",error:{name:"DuplicateKeyError",message:`Duplicate collector key "${e.key}"`,retryable:!1},durationMs:Math.max(0,this.ctx.now()-n)};if(e.isSupported&&!e.isSupported(this.ctx))return{category:o,key:e.key,version:e.version,status:"skipped",durationMs:Math.max(0,this.ctx.now()-n)};const s=`${(a=e).key}:v${a.version}`,l=this.ctx.cache.get(s);if(l&&l.expiresAt>Date.now())return{category:o,key:e.key,version:e.version,status:"ok",value:l.value,durationMs:Math.max(0,this.ctx.now()-n)};const{signal:u,clear:d}=function(e,t){if(!t||0>=t)return{signal:e,clear:()=>{}};const n=new AbortController,o=setTimeout(()=>n.abort(),t),r=()=>n.abort();e.addEventListener("abort",r,{once:!0});const i=AbortSignal.any;return{signal:i?i([e,n.signal]):n.signal,clear:()=>{clearTimeout(o),e.removeEventListener("abort",r)}}}(t,e.timeoutMs);try{const t=e.timeoutMs??5e3,a=Promise.resolve(e.collect(this.ctx,u)),c=await(r=a,i=t,Promise.race([r,new Promise((e,t)=>setTimeout(()=>t(Object.assign(Error("Timed out"),{name:"AbortError"})),i))]));return e.cacheTtlMs&&e.cacheTtlMs>0&&this.ctx.cache.set(s,{value:c,expiresAt:Date.now()+e.cacheTtlMs}),{category:o,key:e.key,version:e.version,status:"ok",value:c,durationMs:Math.max(0,this.ctx.now()-n)}}finally{d()}}catch(t){const r=t instanceof Error&&"AbortError"===t.name,i=function(e){return e instanceof Error?{name:e.name||"Error",message:e.message||"Unknown error"}:{name:"Error",message:"Unknown error"}}(t);return r&&(i.name="TimeoutError",i.message="Timed out",i.retryable=!0),{category:o,key:e.key,version:e.version,status:"error",error:i,durationMs:Math.max(0,this.ctx.now()-n)}}var r,i,a});return T(n,this.concurrency)}}function E(e,t){try{return e()}catch{return t}}function A(e,t){try{const n=document.createElement("canvas");n.width=e,n.height=t;const o=n.getContext("2d");return o?{canvas:n,ctx:o}:null}catch{return null}}function C(e){try{return e.getContext("webgl")||e.getContext("experimental-webgl")}catch{return null}}function P(e){try{return e.getContext("webgl2")}catch{return null}}const D=["alpha","antialias","depth","desynchronized","failIfMajorPerformanceCaveat","powerPreference","premultipliedAlpha","preserveDrawingBuffer","stencil","xrCompatible"],I={category:"graphics",key:"webgpu_adapter",version:1,cacheTtlMs:3e5,timeoutMs:3e3,collect:async()=>{const e=navigator.gpu;if(!e||"function"!=typeof e.requestAdapter)return null;try{const t=await e.requestAdapter();if(!t)return{available:!1};let n="",o="",r="",i="";if(t.info)n=t.info.vendor||"",o=t.info.architecture||"",r=t.info.device||"",i=t.info.description||"";else if("function"==typeof t.requestAdapterInfo)try{const e=await t.requestAdapterInfo();n=e.vendor||"",o=e.architecture||"",r=e.device||"",i=e.description||""}catch{}const a=[];t.features&&t.features.forEach(e=>{a.push(e)});const c=[{api:"maxTextureDimension1D",key:"max_texture_dimension_1d"},{api:"maxTextureDimension2D",key:"max_texture_dimension_2d"},{api:"maxTextureDimension3D",key:"max_texture_dimension_3d"},{api:"maxTextureArrayLayers",key:"max_texture_array_layers"},{api:"maxBindGroups",key:"max_bind_groups"},{api:"maxBindGroupsPlusVertexBuffers",key:"max_bind_groups_plus_vertex_buffers"},{api:"maxBindingsPerBindGroup",key:"max_bindings_per_bind_group"},{api:"maxDynamicUniformBuffersPerPipelineLayout",key:"max_dynamic_uniform_buffers_per_pipeline_layout"},{api:"maxDynamicStorageBuffersPerPipelineLayout",key:"max_dynamic_storage_buffers_per_pipeline_layout"},{api:"maxSampledTexturesPerShaderStage",key:"max_sampled_textures_per_shader_stage"},{api:"maxSamplersPerShaderStage",key:"max_samplers_per_shader_stage"},{api:"maxStorageBuffersPerShaderStage",key:"max_storage_buffers_per_shader_stage"},{api:"maxStorageTexturesPerShaderStage",key:"max_storage_textures_per_shader_stage"},{api:"maxUniformBuffersPerShaderStage",key:"max_uniform_buffers_per_shader_stage"},{api:"maxUniformBufferBindingSize",key:"max_uniform_buffer_binding_size"},{api:"maxStorageBufferBindingSize",key:"max_storage_buffer_binding_size"},{api:"maxVertexBuffers",key:"max_vertex_buffers"},{api:"maxBufferSize",key:"max_buffer_size"},{api:"maxVertexAttributes",key:"max_vertex_attributes"},{api:"maxVertexBufferArrayStride",key:"max_vertex_buffer_array_stride"},{api:"maxComputeWorkgroupStorageSize",key:"max_compute_workgroup_storage_size"},{api:"maxComputeInvocationsPerWorkgroup",key:"max_compute_invocations_per_workgroup"},{api:"maxComputeWorkgroupSizeX",key:"max_compute_workgroup_size_x"},{api:"maxComputeWorkgroupSizeY",key:"max_compute_workgroup_size_y"},{api:"maxComputeWorkgroupSizeZ",key:"max_compute_workgroup_size_z"},{api:"maxComputeWorkgroupsPerDimension",key:"max_compute_workgroups_per_dimension"}],s={};if(t.limits)for(const e of c){const n=t.limits[e.api];"number"==typeof n&&(s[e.key]=n)}return{available:!0,vendor:n,architecture:o,device:r,description:i,features:a.sort(),limits:s,is_fallback_adapter:t.isFallbackAdapter||!1}}catch{return null}}},R=[{category:"graphics",key:"canvas_fingerprint",version:1,cacheTtlMs:3e5,collect:()=>{const e=A(300,150);if(!e)return null;const{canvas:t,ctx:n}=e;n.fillStyle="#f0f0f0",n.fillRect(0,0,t.width,t.height),n.textBaseline="alphabetic",n.fillStyle="#f60",n.font='18px "Times New Roman"',n.fillText("DeviceIntelligence",10,30),n.fillStyle="#069",n.font="16px Arial",n.fillText("Fingerprint 🔐😃",10,55),n.globalCompositeOperation="multiply",n.fillStyle="rgba(255, 0, 0, 0.5)",n.beginPath(),n.arc(100,100,40,0,2*Math.PI),n.fill(),n.fillStyle="rgba(0, 255, 0, 0.5)",n.beginPath(),n.arc(130,100,40,0,2*Math.PI),n.fill(),n.fillStyle="rgba(0, 0, 255, 0.5)",n.beginPath(),n.arc(115,70,40,0,2*Math.PI),n.fill(),n.globalCompositeOperation="source-over";const o=n.createLinearGradient(200,0,300,0);return o.addColorStop(0,"#ff0000"),o.addColorStop(.5,"#00ff00"),o.addColorStop(1,"#0000ff"),n.fillStyle=o,n.fillRect(200,80,90,50),n.strokeStyle="#333",n.lineWidth=2,n.beginPath(),n.moveTo(200,20),n.bezierCurveTo(230,10,270,50,290,20),n.stroke(),E(()=>v(t.toDataURL()),null)}},{category:"graphics",key:"canvas_winding",version:1,cacheTtlMs:3e5,collect:()=>{const e=A(10,10);if(!e)return!1;const{ctx:t}=e;return t.rect(0,0,10,10),t.rect(2,2,6,6),E(()=>!t.isPointInPath(5,5,"evenodd"),!1)}},{category:"graphics",key:"canvas_geometry",version:1,cacheTtlMs:3e5,collect:()=>{const e=A(200,200);if(!e)return null;const{canvas:t,ctx:n}=e;n.beginPath(),n.moveTo(50,50),n.lineTo(150,50),n.quadraticCurveTo(175,100,150,150),n.lineTo(50,150),n.bezierCurveTo(25,125,25,75,50,50),n.closePath(),n.fillStyle="#4a7c59",n.fill(),n.strokeStyle="#2d4a35",n.lineWidth=3,n.stroke();for(let e=0;5>e;e++)n.beginPath(),n.arc(100,100,20+15*e,0,2*Math.PI),n.strokeStyle=`hsl(${30*e}, 70%, 50%)`,n.stroke();return n.beginPath(),n.moveTo(160,30),n.lineTo(190,80),n.lineTo(130,80),n.closePath(),n.fillStyle="#e67e22",n.fill(),E(()=>v(t.toDataURL()),null)}},{category:"graphics",key:"canvas_text",version:1,cacheTtlMs:3e5,collect:()=>{const e=A(400,100);if(!e)return null;const{canvas:t,ctx:n}=e;n.fillStyle="#ffffff",n.fillRect(0,0,t.width,t.height);const o=[{text:"Cwm fjord",font:"16px Arial",x:10,y:20},{text:"Quick zephyrs",font:'14px "Times New Roman"',x:10,y:40},{text:"Sphinx of black",font:"12px Courier",x:10,y:60},{text:"Pack my box",font:"18px Georgia",x:10,y:80},{text:"W1lm",font:"20px monospace",x:200,y:30},{text:"illIlI1|",font:"16px sans-serif",x:200,y:55},{text:"mmwwMM",font:"14px serif",x:200,y:80}];n.fillStyle="#000000",n.textBaseline="top";for(const{text:e,font:t,x:r,y:i}of o)n.font=t,n.fillText(e,r,i);return E(()=>v(t.toDataURL()),null)}},{category:"graphics",key:"svg_fingerprint",version:1,cacheTtlMs:3e5,collect:()=>{const e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("width","200"),e.setAttribute("height","200");const t=document.createElementNS("http://www.w3.org/2000/svg","rect");t.setAttribute("x","10"),t.setAttribute("y","10"),t.setAttribute("width","80"),t.setAttribute("height","80"),t.setAttribute("fill","#4a7c59"),t.setAttribute("stroke","#2d4a35"),t.setAttribute("stroke-width","2"),e.appendChild(t);const n=document.createElementNS("http://www.w3.org/2000/svg","circle");n.setAttribute("cx","150"),n.setAttribute("cy","50"),n.setAttribute("r","40"),n.setAttribute("fill","#e67e22"),e.appendChild(n);const o=document.createElementNS("http://www.w3.org/2000/svg","path");o.setAttribute("d","M 100 150 Q 125 100 150 150 T 200 150"),o.setAttribute("stroke","#3498db"),o.setAttribute("stroke-width","3"),o.setAttribute("fill","none"),e.appendChild(o);const r=document.createElementNS("http://www.w3.org/2000/svg","text");r.setAttribute("x","10"),r.setAttribute("y","180"),r.setAttribute("font-size","14"),r.textContent="SVG fingerprint",e.appendChild(r);const i=(new XMLSerializer).serializeToString(e);return v(i)}},{category:"graphics",key:"client_rects",version:1,cacheTtlMs:3e5,collect:()=>{const e=document.createElement("div");e.style.position="absolute",e.style.left="-9999px",e.style.top="-9999px",document.body.appendChild(e);try{const t={},n=[{tag:"div",content:"test",style:"font: 16px Arial"},{tag:"span",content:"mmmmm",style:"font: 14px monospace"},{tag:"span",content:"iiiii",style:"font: 14px serif"},{tag:"div",content:"Wwww",style:"font: 18px sans-serif"}];for(const{tag:o,content:r,style:i}of n){const n=document.createElement(o);n.style.cssText=i,n.textContent=r,e.appendChild(n);const a=n.getBoundingClientRect();t[`${o}_${r}`]=[Math.round(1e3*a.width)/1e3,Math.round(1e3*a.height)/1e3]}return t}finally{document.body.removeChild(e)}}},{category:"graphics",key:"webgl_fingerprint",version:1,cacheTtlMs:3e5,collect:()=>{const e=document.createElement("canvas");e.width=256,e.height=256;const t=C(e);if(!t)return null;const n=t.createShader(t.VERTEX_SHADER),o=t.createShader(t.FRAGMENT_SHADER);if(!n||!o)return null;t.shaderSource(n,"\n attribute vec2 position;\n varying vec2 vPosition;\n void main() {\n vPosition = position;\n gl_Position = vec4(position, 0.0, 1.0);\n }\n "),t.compileShader(n),t.shaderSource(o,"\n precision mediump float;\n varying vec2 vPosition;\n void main() {\n float r = sin(vPosition.x * 10.0) * 0.5 + 0.5;\n float g = cos(vPosition.y * 10.0) * 0.5 + 0.5;\n float b = sin(vPosition.x * vPosition.y * 20.0) * 0.5 + 0.5;\n gl_FragColor = vec4(r, g, b, 1.0);\n }\n "),t.compileShader(o);const r=t.createProgram();if(!r)return null;t.attachShader(r,n),t.attachShader(r,o),t.linkProgram(r),t.useProgram(r);const i=new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),a=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,a),t.bufferData(t.ARRAY_BUFFER,i,t.STATIC_DRAW);const c=t.getAttribLocation(r,"position");t.enableVertexAttribArray(c),t.vertexAttribPointer(c,2,t.FLOAT,!1,0,0),t.viewport(0,0,e.width,e.height),t.clearColor(0,0,0,1),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLES,0,6);const s=new Uint8Array(e.width*e.height*4);t.readPixels(0,0,e.width,e.height,t.RGBA,t.UNSIGNED_BYTE,s);const l=[];for(let e=0;s.length>e;e+=97)l.push(s[e]);return v(l.join(","))}},{category:"graphics",key:"gpu_vendor",version:1,cacheTtlMs:3e5,collect:()=>{const e=C(document.createElement("canvas"));if(!e)return null;const t=e.getExtension("WEBGL_debug_renderer_info");return t?E(()=>e.getParameter(t.UNMASKED_VENDOR_WEBGL),null):null}},{category:"graphics",key:"gpu_renderer",version:1,cacheTtlMs:3e5,collect:()=>{const e=C(document.createElement("canvas"));if(!e)return null;const t=e.getExtension("WEBGL_debug_renderer_info");return t?E(()=>e.getParameter(t.UNMASKED_RENDERER_WEBGL),null):null}},{category:"graphics",key:"webgl_vendor",version:1,cacheTtlMs:3e5,collect:()=>{const e=C(document.createElement("canvas"));return e?E(()=>e.getParameter(e.VENDOR),null):null}},{category:"graphics",key:"webgl_renderer",version:1,cacheTtlMs:3e5,collect:()=>{const e=C(document.createElement("canvas"));return e?E(()=>e.getParameter(e.RENDERER),null):null}},{category:"graphics",key:"webgl_version",version:1,cacheTtlMs:3e5,collect:()=>{const e=document.createElement("canvas"),t=P(e);if(t)return E(()=>t.getParameter(t.VERSION),null);const n=C(e);return n?E(()=>n.getParameter(n.VERSION),null):null}},{category:"graphics",key:"webgl_shading_language_version",version:1,cacheTtlMs:3e5,collect:()=>{const e=document.createElement("canvas"),t=C(e)||P(e);return t?E(()=>t.getParameter(t.SHADING_LANGUAGE_VERSION),null):null}},{category:"graphics",key:"webgl_extensions",version:1,cacheTtlMs:3e5,collect:()=>{const e=C(document.createElement("canvas"));if(!e)return null;const t=e.getSupportedExtensions();return t?t.sort():null}},{category:"graphics",key:"webgl_context_attributes",version:1,cacheTtlMs:3e5,collect:()=>{const e=C(document.createElement("canvas"));if(!e)return null;const t=e.getContextAttributes();if(!t)return null;const n={},o=t;for(const e of D)e in o&&(n[e]=o[e]);return n}},{category:"graphics",key:"webgl_parameters",version:1,cacheTtlMs:3e5,collect:()=>{const e=C(document.createElement("canvas"));if(!e)return null;const t={MAX_COMBINED_TEXTURE_IMAGE_UNITS:e.MAX_COMBINED_TEXTURE_IMAGE_UNITS,MAX_CUBE_MAP_TEXTURE_SIZE:e.MAX_CUBE_MAP_TEXTURE_SIZE,MAX_FRAGMENT_UNIFORM_VECTORS:e.MAX_FRAGMENT_UNIFORM_VECTORS,MAX_RENDERBUFFER_SIZE:e.MAX_RENDERBUFFER_SIZE,MAX_TEXTURE_IMAGE_UNITS:e.MAX_TEXTURE_IMAGE_UNITS,MAX_TEXTURE_SIZE:e.MAX_TEXTURE_SIZE,MAX_VARYING_VECTORS:e.MAX_VARYING_VECTORS,MAX_VERTEX_ATTRIBS:e.MAX_VERTEX_ATTRIBS,MAX_VERTEX_TEXTURE_IMAGE_UNITS:e.MAX_VERTEX_TEXTURE_IMAGE_UNITS,MAX_VERTEX_UNIFORM_VECTORS:e.MAX_VERTEX_UNIFORM_VECTORS},n={};for(const[o,r]of Object.entries(t))n[o]=E(()=>e.getParameter(r),null);return n.MAX_VIEWPORT_DIMS=E(()=>Array.from(e.getParameter(e.MAX_VIEWPORT_DIMS)),null),n}},{category:"graphics",key:"webgl_shader_precisions",version:1,cacheTtlMs:3e5,collect:()=>{const e=C(document.createElement("canvas"));if(!e)return null;const t=[{name:"VERTEX_SHADER",type:e.VERTEX_SHADER},{name:"FRAGMENT_SHADER",type:e.FRAGMENT_SHADER}],n=[{name:"LOW_FLOAT",precision:e.LOW_FLOAT},{name:"MEDIUM_FLOAT",precision:e.MEDIUM_FLOAT},{name:"HIGH_FLOAT",precision:e.HIGH_FLOAT},{name:"LOW_INT",precision:e.LOW_INT},{name:"MEDIUM_INT",precision:e.MEDIUM_INT},{name:"HIGH_INT",precision:e.HIGH_INT}],o={};for(const r of t)for(const t of n){const n=`${r.name}_${t.name}`,i=E(()=>e.getShaderPrecisionFormat(r.type,t.precision),null);i&&(o[n]={range_min:i.rangeMin,range_max:i.rangeMax,precision:i.precision})}return o}},{category:"graphics",key:"webgl_extension_params",version:1,cacheTtlMs:3e5,collect:()=>{const e=C(document.createElement("canvas"));if(!e)return null;const t={},n=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic");n&&(t.MAX_TEXTURE_MAX_ANISOTROPY=E(()=>e.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT),null));const o=e.getExtension("WEBGL_draw_buffers");return o&&(t.MAX_COLOR_ATTACHMENTS=E(()=>e.getParameter(o.MAX_COLOR_ATTACHMENTS_WEBGL),null),t.MAX_DRAW_BUFFERS=E(()=>e.getParameter(o.MAX_DRAW_BUFFERS_WEBGL),null)),Object.keys(t).length>0?t:null}},{category:"graphics",key:"webgl_unsupported_exts",version:1,cacheTtlMs:3e5,collect:()=>{const e=C(document.createElement("canvas"));if(!e)return null;const t=new Set(e.getSupportedExtensions()||[]),n=["ANGLE_instanced_arrays","EXT_blend_minmax","EXT_color_buffer_half_float","EXT_disjoint_timer_query","EXT_float_blend","EXT_frag_depth","EXT_shader_texture_lod","EXT_sRGB","EXT_texture_compression_bptc","EXT_texture_compression_rgtc","EXT_texture_filter_anisotropic","OES_element_index_uint","OES_fbo_render_mipmap","OES_standard_derivatives","OES_texture_float","OES_texture_float_linear","OES_texture_half_float","OES_texture_half_float_linear","OES_vertex_array_object","WEBGL_color_buffer_float","WEBGL_compressed_texture_astc","WEBGL_compressed_texture_etc","WEBGL_compressed_texture_etc1","WEBGL_compressed_texture_pvrtc","WEBGL_compressed_texture_s3tc","WEBGL_compressed_texture_s3tc_srgb","WEBGL_debug_renderer_info","WEBGL_debug_shaders","WEBGL_depth_texture","WEBGL_draw_buffers","WEBGL_lose_context","WEBGL_multi_draw"].filter(e=>!t.has(e));return n.length>0?n:null}},I];const O=[{category:"audio",key:"audio_fingerprint",version:1,cacheTtlMs:3e5,timeoutMs:2e3,isSupported:()=>"undefined"!=typeof OfflineAudioContext||void 0!==window.webkitOfflineAudioContext,collect:async()=>{const e=OfflineAudioContext||window.webkitOfflineAudioContext;if(!e)return null;try{const o=new e(1,44100,44100),r=o.createOscillator();r.type="triangle",r.frequency.setValueAtTime(1e4,o.currentTime);const i=o.createDynamicsCompressor();i.threshold.setValueAtTime(-50,o.currentTime),i.knee.setValueAtTime(40,o.currentTime),i.ratio.setValueAtTime(12,o.currentTime),i.attack.setValueAtTime(0,o.currentTime),i.release.setValueAtTime(.25,o.currentTime),r.connect(i),i.connect(o.destination),r.start(0);const a=await(t=o.startRendering(),n=1500,Promise.race([t,new Promise(e=>setTimeout(()=>e(null),n))]));if(!a)return null;const c=a.getChannelData(0),s=[];for(let e=0;Math.min(500,c.length)>e;e++)s.push(Math.round(1e6*c[e]));return v(s.join(","))}catch{return null}var t,n}},{category:"audio",key:"audio_base_latency",version:1,cacheTtlMs:6e4,isSupported:()=>"undefined"!=typeof AudioContext,collect:()=>{try{const e=new AudioContext;if("suspended"===e.state)return e.close(),null;const t=e.baseLatency??null;return e.close(),"number"==typeof t?t:null}catch{return null}}},{category:"audio",key:"audio_max_channels",version:1,cacheTtlMs:6e4,isSupported:()=>"undefined"!=typeof AudioContext,collect:()=>{try{const e=new AudioContext;if("suspended"===e.state)return e.close(),null;const t=e.destination.maxChannelCount??null;return e.close(),t}catch{return null}}},{category:"audio",key:"audio_channel_mode",version:1,cacheTtlMs:6e4,isSupported:()=>"undefined"!=typeof AudioContext,collect:()=>{try{const e=new AudioContext;if("suspended"===e.state)return e.close(),null;const t=e.destination.channelCountMode??null;return e.close(),t}catch{return null}}}];function L(e,t){try{return e()}catch{return t}}function B(e){try{if("function"!=typeof window.matchMedia)return null;return window.matchMedia(e).matches}catch{return null}}const N=[{category:"screen",key:"screen_resolution",version:1,cacheTtlMs:6e4,collect:()=>{const e=L(()=>screen.width,0),t=L(()=>screen.height,0);return[Math.max(e,t),Math.min(e,t)]}},{category:"screen",key:"device_pixel_ratio",version:1,cacheTtlMs:6e4,collect:()=>L(()=>"number"==typeof window.devicePixelRatio?Math.round(100*window.devicePixelRatio)/100:null,null)},{category:"screen",key:"color_depth",version:1,cacheTtlMs:6e4,collect:()=>L(()=>screen.colorDepth??null,null)},{category:"screen",key:"screen_frame",version:1,cacheTtlMs:6e4,collect:()=>L(()=>{const{width:e,height:t,availWidth:n,availHeight:o,availLeft:r,availTop:i}=screen,a=r??0,c=i??0,s=e-n-a,l=t-o-c;return[Math.max(0,c),Math.max(0,s),Math.max(0,l),Math.max(0,a)]},null)},{category:"screen",key:"pixel_depth",version:1,cacheTtlMs:6e4,collect:()=>L(()=>screen.pixelDepth??null,null)},{category:"screen",key:"hdr_support",version:1,cacheTtlMs:6e4,collect:()=>B("(dynamic-range: high)")},{category:"screen",key:"color_gamut",version:1,cacheTtlMs:6e4,collect:()=>B("(color-gamut: rec2020)")?"rec2020":B("(color-gamut: p3)")?"p3":B("(color-gamut: srgb)")?"srgb":null},{category:"screen",key:"monochrome_depth",version:1,cacheTtlMs:6e4,collect:()=>{for(const e of[0,1,2,4,8])if(B(`(monochrome: ${e})`))return e;return null}},{category:"screen",key:"screen_orientation",version:1,isSupported:()=>"undefined"!=typeof screen&&"orientation"in screen,collect:()=>{try{const e=screen.orientation;return{type:e?.type??null,angle:e?.angle??null}}catch{return{type:null,angle:null}}}},{category:"screen",key:"media_matches",version:1,cacheTtlMs:6e4,collect:()=>{const e={print:"(print)",screen:"(screen)",portrait:"(orientation: portrait)",landscape:"(orientation: landscape)",fine_pointer:"(pointer: fine)",coarse_pointer:"(pointer: coarse)",no_pointer:"(pointer: none)",can_hover:"(hover: hover)",no_hover:"(hover: none)",any_fine_pointer:"(any-pointer: fine)",any_coarse_pointer:"(any-pointer: coarse)",any_hover:"(any-hover: hover)",standalone:"(display-mode: standalone)",fullscreen:"(display-mode: fullscreen)",minimal_ui:"(display-mode: minimal-ui)",browser:"(display-mode: browser)",dark_mode:"(prefers-color-scheme: dark)",light_mode:"(prefers-color-scheme: light)",reduced_motion:"(prefers-reduced-motion: reduce)",more_contrast:"(prefers-contrast: more)",less_contrast:"(prefers-contrast: less)",reduced_transparency:"(prefers-reduced-transparency: reduce)",forced_colors:"(forced-colors: active)",inverted_colors:"(inverted-colors: inverted)",slow_update:"(update: slow)",fast_update:"(update: fast)",overflow_block:"(overflow-block: scroll)",overflow_inline:"(overflow-inline: scroll)",scripting_enabled:"(scripting: enabled)"},t={};for(const[n,o]of Object.entries(e))t[n]=B(o);return t}},{category:"screen",key:"available_resolution",version:1,cacheTtlMs:6e4,collect:()=>({avail_width:L(()=>screen.availWidth,0),avail_height:L(()=>screen.availHeight,0),avail_left:L(()=>screen.availLeft??0,0),avail_top:L(()=>screen.availTop??0,0)})},{category:"screen",key:"scrollbar_width",version:1,collect:()=>{try{const e=document.createElement("div");e.style.cssText="position:absolute;top:-9999px;width:100px;height:100px;overflow:scroll;",document.body.appendChild(e);const t=document.createElement("div");t.style.cssText="width:100%;height:200px;",e.appendChild(t);const n=e.offsetWidth-e.clientWidth;return document.body.removeChild(e),n}catch{return 0}}},{category:"screen",key:"browser_zoom",version:1,collect:()=>{try{const e=window.outerWidth||0,t=window.innerWidth||0,n=window.outerHeight||0,o=window.innerHeight||0;return{ratio:Math.round(100*(t>0?e/t:1))/100,device_pixel_ratio:window.devicePixelRatio||1,outer_width:e,inner_width:t,outer_height:n,inner_height:o}}catch{return{ratio:1,device_pixel_ratio:1,outer_width:0,inner_width:0,outer_height:0,inner_height:0}}}}];function U(e,t){try{return e()}catch{return t}}const G=[{category:"hardware",key:"hardware_concurrency",version:1,cacheTtlMs:6e4,collect:()=>U(()=>navigator.hardwareConcurrency??null,null)},{category:"hardware",key:"device_memory",version:1,cacheTtlMs:6e4,collect:()=>U(()=>{const e=navigator.deviceMemory;return"number"==typeof e&&Number.isFinite(e)?Math.round(e):null},null)},{category:"hardware",key:"max_touch_points",version:1,cacheTtlMs:6e4,collect:()=>U(()=>navigator.maxTouchPoints??null,null)},{category:"hardware",key:"touch_event",version:1,cacheTtlMs:6e4,collect:()=>{try{return document.createEvent("TouchEvent"),!0}catch{}return"ontouchstart"in window||(navigator.maxTouchPoints??0)>0}},{category:"hardware",key:"touch_start",version:1,cacheTtlMs:6e4,collect:()=>U(()=>"ontouchstart"in window||"ontouchstart"in document.documentElement||(navigator.maxTouchPoints??0)>0,!1)},{category:"hardware",key:"battery_status",version:1,cacheTtlMs:3e4,timeoutMs:2e3,isSupported:()=>"getBattery"in navigator,collect:async()=>{try{const e=await navigator.getBattery();return{charging:e.charging,level:e.level,charging_time:e.chargingTime===1/0?null:e.chargingTime,discharging_time:e.dischargingTime===1/0?null:e.dischargingTime}}catch{return null}}},{category:"hardware",key:"accelerometer_support",version:1,cacheTtlMs:3e5,timeoutMs:2e3,collect:async()=>{const e="DeviceMotionEvent"in window,t="function"==typeof DeviceMotionEvent.requestPermission;let n=null;if(navigator.permissions&&navigator.permissions.query)try{n=(await navigator.permissions.query({name:"accelerometer"})).state}catch{}return{supported:e,permission_required:t,permission_state:n}}},{category:"hardware",key:"gyroscope_support",version:1,cacheTtlMs:3e5,timeoutMs:2e3,collect:async()=>{const e="DeviceOrientationEvent"in window,t="DeviceOrientationAbsoluteEvent"in window||"ondeviceorientationabsolute"in window,n="function"==typeof DeviceOrientationEvent.requestPermission;let o=null;if(navigator.permissions&&navigator.permissions.query)try{o=(await navigator.permissions.query({name:"gyroscope"})).state}catch{}return{supported:e,permission_required:n,permission_state:o,absolute_supported:t}}},{category:"hardware",key:"sensor_api_support",version:1,collect:()=>{const e=window;return{accelerometer:"Accelerometer"in e,gyroscope:"Gyroscope"in e,magnetometer:"Magnetometer"in e,gravity_sensor:"GravitySensor"in e,absolute_orientation_sensor:"AbsoluteOrientationSensor"in e,relative_orientation_sensor:"RelativeOrientationSensor"in e,linear_acceleration_sensor:"LinearAccelerationSensor"in e,ambient_light_sensor:"AmbientLightSensor"in e,proximity_sensor:"ondeviceproximity"in e||"ProximitySensor"in e}}},{category:"hardware",key:"media_devices",version:1,cacheTtlMs:3e5,timeoutMs:2e3,collect:async()=>{if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return null;try{const e=await navigator.mediaDevices.enumerateDevices(),t=[],n=[],o=[],r=new Set;for(const i of e){const e={device_id:v(i.deviceId||"unknown"),group_id:v(i.groupId||"unknown"),kind:i.kind,label:i.label||""};switch(r.add(i.groupId),i.kind){case"audioinput":t.push(e);break;case"audiooutput":n.push(e);break;case"videoinput":o.push(e)}}return{audioinput:t,audiooutput:n,videoinput:o,counts:{audioinput:t.length,audiooutput:n.length,videoinput:o.length},group_ids:Array.from(r).map(e=>v(e))}}catch{return null}}},{category:"hardware",key:"media_device_counts",version:1,cacheTtlMs:3e5,timeoutMs:2e3,collect:async()=>{if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)return null;try{const e=await navigator.mediaDevices.enumerateDevices(),t={audioinput:0,audiooutput:0,videoinput:0,total:0};for(const n of e)t.total++,"audioinput"===n.kind?t.audioinput++:"audiooutput"===n.kind?t.audiooutput++:"videoinput"===n.kind&&t.videoinput++;return t}catch{return null}}},{category:"hardware",key:"keyboard_layout_map",version:1,cacheTtlMs:3e5,timeoutMs:2e3,collect:async()=>{const e=navigator.keyboard;if(!e||"function"!=typeof e.getLayoutMap)return null;try{const t=await e.getLayoutMap(),n={},o=["KeyQ","KeyW","KeyE","KeyR","KeyT","KeyY","KeyU","KeyI","KeyO","KeyP","KeyA","KeyS","KeyD","KeyF","KeyG","KeyH","KeyJ","KeyK","KeyL","KeyZ","KeyX","KeyC","KeyV","KeyB","KeyN","KeyM","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","Digit0","Minus","Equal","BracketLeft","BracketRight","Backslash","Semicolon","Quote","Comma","Period","Slash","Backquote"];for(const e of o){const o=t.get(e);o&&(n[e]=o)}const r=Object.entries(n).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>`${e}:${t}`).join("|");return{layout:n,layout_hash:v(r),key_count:Object.keys(n).length}}catch{return null}}}];function j(e,t){try{return e()}catch{return t}}const F={category:"platform",key:"cpu_architecture",version:1,cacheTtlMs:6e4,timeoutMs:2e3,collect:async()=>{const e=navigator.userAgentData;if(e&&"function"==typeof e.getHighEntropyValues)try{const t=await e.getHighEntropyValues(["architecture"]);if(t.architecture)return t.architecture}catch{}const t=navigator.platform?.toLowerCase()??"";return t.includes("arm")?"arm":t.includes("aarch64")?"arm64":t.includes("x86_64")||t.includes("win64")?"x86_64":t.includes("win32")||t.includes("x86")?"x86":t.includes("mac")&&navigator.maxTouchPoints>0?"arm64":t.includes("mac")?"x86_64":null}},X=[{category:"platform",key:"user_agent",version:1,cacheTtlMs:6e4,collect:()=>j(()=>navigator.userAgent??null,null)},{category:"platform",key:"user_agent_data",version:1,cacheTtlMs:6e4,timeoutMs:2e3,isSupported:()=>"function"==typeof navigator.userAgentData?.getHighEntropyValues,collect:async()=>{try{const e=navigator.userAgentData,t=await e.getHighEntropyValues(["architecture","bitness","brands","fullVersionList","model","platform","platformVersion","uaFullVersion","wow64"]);return{brands:t.brands??e.brands,mobile:t.mobile??e.mobile,platform:t.platform??e.platform,architecture:t.architecture,bitness:t.bitness,full_version_list:t.fullVersionList,model:t.model,platform_version:t.platformVersion,ua_full_version:t.uaFullVersion,wow64:t.wow64}}catch{const e=navigator.userAgentData;return e?{brands:e.brands,mobile:e.mobile,platform:e.platform}:null}}},F,{category:"platform",key:"platform",version:1,cacheTtlMs:6e4,collect:()=>j(()=>navigator.platform??null,null)},{category:"platform",key:"os_cpu",version:1,cacheTtlMs:6e4,collect:()=>j(()=>navigator.oscpu??null,null)},{category:"platform",key:"cpu_class",version:1,cacheTtlMs:6e4,collect:()=>j(()=>navigator.cpuClass??null,null)},{category:"platform",key:"vendor",version:1,cacheTtlMs:6e4,collect:()=>j(()=>navigator.vendor??null,null)},{category:"platform",key:"system_mobile",version:1,cacheTtlMs:6e4,collect:()=>{const e=navigator.userAgentData;return e&&"boolean"==typeof e.mobile?e.mobile:j(()=>{const e=(navigator.maxTouchPoints??0)>0||"ontouchstart"in window,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);return e&&t},null)}},{category:"platform",key:"system_product",version:1,cacheTtlMs:6e4,collect:()=>j(()=>navigator.product??null,null)},{category:"platform",key:"navigator_product_sub",version:1,cacheTtlMs:6e4,collect:()=>j(()=>navigator.productSub??null,null)},{category:"platform",key:"languages",version:1,cacheTtlMs:6e4,collect:()=>j(()=>navigator.languages&&navigator.languages.length>0?[...navigator.languages]:navigator.language?[navigator.language]:[],[])},{category:"platform",key:"timezone",version:1,cacheTtlMs:6e4,collect:()=>j(()=>Intl.DateTimeFormat().resolvedOptions().timeZone??null,null)},{category:"platform",key:"timezone_offset",version:1,cacheTtlMs:6e4,collect:()=>(new Date).getTimezoneOffset()},{category:"platform",key:"date_time_locale",version:1,cacheTtlMs:6e4,collect:()=>j(()=>{const e=new Date(2e3,0,1,12,0,0),t=Intl.DateTimeFormat().resolvedOptions();return{locale:t.locale,calendar:t.calendar,numbering_system:t.numberingSystem,time_zone:t.timeZone,formatted:e.toLocaleString()}},null)},{category:"platform",key:"intl_list_format",version:1,collect:()=>{try{if("undefined"==typeof Intl||!("ListFormat"in Intl))return{supported:!1,conjunction:null,disjunction:null};const e=["A","B","C"],t=new Intl.ListFormat("en",{style:"long",type:"conjunction"}),n=new Intl.ListFormat("en",{style:"long",type:"disjunction"});return{supported:!0,conjunction:t.format(e),disjunction:n.format(e)}}catch{return{supported:!1,conjunction:null,disjunction:null}}}},{category:"platform",key:"intl_collator",version:1,collect:()=>{try{if("undefined"==typeof Intl||!("Collator"in Intl))return{locale:null,collation:null,usage:null,sensitivity:null,case_first:null,numeric:null};const e=(new Intl.Collator).resolvedOptions();return{locale:e.locale??null,collation:e.collation??null,usage:e.usage??null,sensitivity:e.sensitivity??null,case_first:e.caseFirst??null,numeric:e.numeric??null}}catch{return{locale:null,collation:null,usage:null,sensitivity:null,case_first:null,numeric:null}}}},{category:"platform",key:"intl_plural_rules",version:1,collect:()=>{try{if("undefined"==typeof Intl||!("PluralRules"in Intl))return{locale:null,type:null,plural_categories:null};const e=(new Intl.PluralRules).resolvedOptions();return{locale:e.locale??null,type:e.type??null,plural_categories:e.pluralCategories??null}}catch{return{locale:null,type:null,plural_categories:null}}}},{category:"platform",key:"intl_relative_time_format",version:1,collect:()=>{try{if("undefined"==typeof Intl||!("RelativeTimeFormat"in Intl))return{supported:!1,locale:null,numbering_system:null,style:null,numeric:null};const e=(new Intl.RelativeTimeFormat).resolvedOptions();return{supported:!0,locale:e.locale??null,numbering_system:e.numberingSystem??null,style:e.style??null,numeric:e.numeric??null}}catch{return{supported:!1,locale:null,numbering_system:null,style:null,numeric:null}}}}];function W(e,t){try{return e()}catch{return t}}const z={category:"runtime",key:"math_primitives",version:1,cacheTtlMs:3e5,collect:()=>{const e=Math;return{acos:e.acos(.123456789),acosh:e.acosh(1e308),acosh_pf:e.log(1e154+e.sqrt(1e308)),asin:e.asin(.123456789),asinh:e.asinh(1),asinh_pf:e.log(1+e.sqrt(2)),atanh:e.atanh(.5),atanh_pf:e.log(3)/2,atan:e.atan(.5),sin:e.sin(-1e300),sinh:e.sinh(1),sinh_pf:e.exp(1)-1/e.exp(1)/2,cos:e.cos(10.000000000123),cosh:e.cosh(1),cosh_pf:(e.exp(1)+1/e.exp(1))/2,tan:e.tan(-1e300),tanh:e.tanh(1),tanh_pf:(e.exp(2)-1)/(e.exp(2)+1),exp:e.exp(1),expm1:e.expm1(1),expm1_pf:e.exp(1)-1,log1p:e.log1p(10),log1p_pf:e.log(11),pow_pi:e.pow(e.PI,-100),large_cos:e.cos(1e20),large_sin:e.sin(1e20),large_tan:e.tan(1e20),cbrt:e.cbrt(27),hypot:e.hypot(3,4),log10:e.log10(100),log2:e.log2(8),sqrt:e.sqrt(2),E:e.E,LN2:e.LN2,LN10:e.LN10,LOG2E:e.LOG2E,LOG10E:e.LOG10E,PI:e.PI,SQRT1_2:e.SQRT1_2,SQRT2:e.SQRT2}}},V={category:"runtime",key:"math_fingerprint",version:1,cacheTtlMs:3e5,collect:()=>{const e=Math,t=[e.acos(.5),e.acosh(1e308),e.asin(.5),e.asinh(1),e.atanh(.5),e.atan(.5),e.sin(-1e300),e.sinh(1),e.cos(10.000000000123),e.cosh(1),e.tan(-1e300),e.tanh(1),e.exp(1),e.expm1(1),e.log1p(10),e.pow(e.PI,-100)];return v(t.join(","))}},K=[z,V,{category:"runtime",key:"worker_diffs",version:1,cacheTtlMs:3e5,timeoutMs:3e3,isSupported:()=>"undefined"!=typeof Worker&&"undefined"!=typeof Blob,collect:async(e,t)=>new Promise(e=>{const n=["navigator.userAgent","navigator.platform","navigator.language","navigator.hardwareConcurrency","navigator.deviceMemory"],o=new Blob(["\n self.onmessage = function(e) {\n const results = {};\n const props = e.data;\n for (const prop of props) {\n try {\n const parts = prop.split('.');\n let value = self;\n for (const part of parts) {\n value = value[part];\n }\n results[prop] = value;\n } catch (err) {\n results[prop] = null;\n }\n }\n self.postMessage(results);\n };\n "],{type:"application/javascript"}),r=URL.createObjectURL(o),i=new Worker(r),a=()=>{i.terminate(),URL.revokeObjectURL(r)};if(t.aborted)return a(),void e(null);t.addEventListener("abort",()=>{a(),e(null)});const c={};for(const e of n)try{const t=e.split(".");let n=window;for(const e of t)n=n[e];c[e]=n}catch{c[e]=null}i.onmessage=t=>{a();const o=t.data,r={};for(const e of n)c[e]!==o[e]&&(r[e]={main:c[e],worker:o[e]});e(Object.keys(r).length>0?r:null)},i.onerror=()=>{a(),e(null)},i.postMessage(n)})},{category:"runtime",key:"js_heap_size_limit",version:1,cacheTtlMs:6e4,collect:()=>W(()=>{const e=performance.memory;return e?.jsHeapSizeLimit??null},null)},{category:"runtime",key:"native_code_format",version:1,cacheTtlMs:3e5,collect:()=>{const e=W(()=>{const e=Object.getOwnPropertyDescriptor(Function.prototype,"toString");return!0===e?.configurable||!e?.value?.toString().includes("[native code]")},!1),t={},n=[{name:"alert",fn:window.alert},{name:"console.log",fn:console.log},{name:"eval",fn:eval},{name:"Array.isArray",fn:Array.isArray}];for(const{name:e,fn:o}of n)if("function"==typeof o)try{t[e]=""+o}catch{t[e]="error"}const o=Object.values(t).find(e=>e.includes("[native code]"))||"";let r="unknown",i="unknown";if(o)if(o.includes("{\n")&&o.includes("\n}"))r="spidermonkey",i="SpiderMonkey";else if(o.includes("{ [native code] }")){const e=W(()=>{const e=Error();return e.stack?.includes(" at ")??!1},!1);r=e?"v8":"jsc",i=e?"V8":"JavaScriptCore"}return{sample:o.substring(0,100),format:r,engine:i,to_string_overridden:e}}},{category:"runtime",key:"max_stack_size",version:1,cacheTtlMs:3e5,collect:()=>{let e=0,t=!1,n=null;const o=()=>{e++,o()};try{o()}catch(e){e instanceof RangeError?(t=!0,n=e.message):e instanceof Error&&(n=e.message)}return{depth:e,range_error:t,error_message:n}}},{category:"runtime",key:"error_stack_format",version:1,cacheTtlMs:3e5,collect:()=>{try{const e=(Error("fingerprint").stack||"").split("\n").filter(e=>e.trim()),t=e.length>1?e[1].trim():e[0]?.trim()||"";let n="unknown",o="unknown";return t.includes(" at ")?(n="v8",o="V8"):t.includes("@")?(n="spidermonkey",o="SpiderMonkey"):t.match(/^\s*\w+\s*$/)&&(n="jsc",o="JavaScriptCore"),{format:n,sample:t.substring(0,100),engine:o}}catch{return{format:"error",sample:"",engine:"unknown"}}}},{category:"runtime",key:"time_resolution",version:1,cacheTtlMs:3e5,collect:()=>{const e=[];let t=performance.now();for(let n=0;1e4>n&&10>e.length;n++){const n=performance.now();n!==t&&(e.push(n-t),t=n)}const n=e.length>0?Math.min(...e.filter(e=>e>0)):1;let o=n;return.9>n||n>1.1?n>=.09&&.2>n?o=.1:.01>n&&(o=.005):o=1,{resolution:Math.round(1e6*n)/1e6,precision_ms:o,cross_origin_isolated:W(()=>!0===window.crossOriginIsolated,!1)}}},{category:"runtime",key:"stack_trace_limit",version:1,collect:()=>{try{return Error.stackTraceLimit??null}catch{return null}}},{category:"runtime",key:"eval_to_string_length",version:1,collect:()=>{try{return(""+eval).length}catch{return null}}},{category:"runtime",key:"performance_memory",version:1,collect:()=>{try{const e=performance;return e.memory?{supported:!0,js_heap_size_limit:e.memory.jsHeapSizeLimit??null,total_js_heap_size:e.memory.totalJSHeapSize??null,used_js_heap_size:e.memory.usedJSHeapSize??null}:{supported:!1,js_heap_size_limit:null,total_js_heap_size:null,used_js_heap_size:null}}catch{return{supported:!1,js_heap_size_limit:null,total_js_heap_size:null,used_js_heap_size:null}}}}],H=["monospace","sans-serif","serif"],q=["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","Andale Mono","Apple Chancery","Apple Color Emoji","Apple SD Gothic Neo","Arial Hebrew","Arial Rounded MT Bold","Avenir","Avenir Next","Baskerville","Big Caslon","Brush Script MT","Chalkboard","Chalkboard SE","Cochin","Copperplate","Courier","Didot","Futura","Geneva","Gill Sans","Helvetica","Helvetica Neue","Herculanum","Hoefler Text","Lucida Grande","Marker Felt","Menlo","Monaco","Noteworthy","Optima","Palatino","Papyrus","Phosphate","Rockwell","San Francisco","Savoye LET","SignPainter","Skia","Snell Roundhand","Times","Trattatello","Zapfino","Cantarell","DejaVu Sans","DejaVu Sans Mono","DejaVu Serif","Droid Sans","Droid Sans Mono","Droid Serif","FreeMono","FreeSans","FreeSerif","Liberation Mono","Liberation Sans","Liberation Serif","Noto Sans","Noto Serif","Ubuntu","Ubuntu Mono","Open Sans","Roboto","Lato","Source Code Pro","Source Sans Pro","Fira Code","JetBrains Mono"];function $(e,t,n){const o=document.createElement("div");o.style.position="absolute",o.style.left="-9999px",o.style.top="-9999px",o.style.visibility="hidden";const r=document.createElement("span");r.style.fontSize=n,r.style.fontFamily=t,r.style.whiteSpace="nowrap",r.textContent=e,o.appendChild(r),document.body.appendChild(o);try{return r.offsetWidth}finally{document.body.removeChild(o)}}const J=[{category:"fonts",key:"installed_fonts",version:1,cacheTtlMs:3e5,collect:()=>{const e="mmmmmmmmmmlli",t="72px",n={};for(const o of H){const r=$(e,o,t);null!==r&&(n[o]=r)}const o=[];for(const r of q){let i=!1;for(const o of H){const a=$(e,`'${r}', ${o}`,t);if(null!==a&&a!==n[o]){i=!0;break}}i&&o.push(r)}return o.sort()}},{category:"fonts",key:"font_preferences_default",version:1,cacheTtlMs:3e5,collect:()=>$("mmmmmmmmmmlli","undefined","72px")},{category:"fonts",key:"font_preferences_apple",version:1,cacheTtlMs:3e5,collect:()=>$("mmmmmmmmmmlli","-apple-system","72px")},{category:"fonts",key:"font_preferences_serif",version:1,cacheTtlMs:3e5,collect:()=>$("mmmmmmmmmmlli","serif","72px")},{category:"fonts",key:"font_preferences_sans",version:1,cacheTtlMs:3e5,collect:()=>$("mmmmmmmmmmlli","sans-serif","72px")},{category:"fonts",key:"font_preferences_mono",version:1,cacheTtlMs:3e5,collect:()=>$("mmmmmmmmmmlli","monospace","72px")},{category:"fonts",key:"font_preferences_min",version:1,cacheTtlMs:3e5,collect:()=>$("mmmmmmmmmmlli","serif","1px")},{category:"fonts",key:"font_preferences_system",version:1,cacheTtlMs:3e5,collect:()=>$("mmmmmmmmmmlli","system-ui","72px")},{category:"fonts",key:"font_smoothing",version:1,collect:()=>{try{const e=document.createElement("canvas");e.width=50,e.height=20;const t=e.getContext("2d");if(!t)return{detected:!1,type:null,subpixel_rendering:!1};t.fillStyle="#000",t.fillRect(0,0,50,20),t.fillStyle="#fff",t.font="12px Arial",t.fillText("Mm",5,15);const n=t.getImageData(0,0,50,20).data;let o=!1,r=!1;for(let e=0;n.length>e;e+=4){const t=n[e],i=n[e+1],a=n[e+2];t===i&&i===a||t>0&&i>0&&a>0&&255>t&&255>i&&255>a&&(Math.abs(t-i)>10||Math.abs(i-a)>10?o=!0:r=!0)}let i=null;return i=o?"subpixel":r?"grayscale":"none",{detected:!0,type:i,subpixel_rendering:o}}catch{return{detected:!1,type:null,subpixel_rendering:!1}}}}];function Z(e,t){try{return e()}catch{return t}}const Q=[{category:"browser",key:"navigator_vendor_sub",version:1,cacheTtlMs:6e4,collect:()=>Z(()=>navigator.vendorSub??null,null)},{category:"browser",key:"navigator_app_code_name",version:1,cacheTtlMs:6e4,collect:()=>Z(()=>navigator.appCodeName??null,null)},{category:"browser",key:"navigator_app_name",version:1,collect:()=>Z(()=>navigator.appName??null,null)},{category:"browser",key:"java_enabled",version:1,collect:()=>{try{return"function"==typeof navigator.javaEnabled?navigator.javaEnabled():null}catch{return null}}},{category:"browser",key:"plugins_list",version:1,cacheTtlMs:6e4,collect:()=>Z(()=>{const e=navigator.plugins,t=[];for(let n=0;e.length>n;n++){const o=e[n];t.push({name:o.name,filename:o.filename,description:o.description})}return t},[])},{category:"browser",key:"mime_types",version:1,cacheTtlMs:6e4,collect:()=>Z(()=>{const e=navigator.mimeTypes,t=[];for(let n=0;e.length>n;n++){const o=e[n];t.push({type:o.type,description:o.description,suffixes:o.suffixes})}return t},[])},{category:"browser",key:"vendor_flavors",version:1,cacheTtlMs:6e4,collect:()=>{const e=[],t=window;return t.chrome&&e.push("chrome"),"object"==typeof t.safari&&e.push("safari"),void 0!==t.InstallTrigger&&e.push("firefox"),void 0!==t.opr&&e.push("opera"),t.StyleMedia&&e.push("edge_legacy"),t.chrome&&navigator.userAgent.includes("Edg/")&&e.push("edge_chromium"),t.navigator?.brave?.isBrave&&e.push("brave"),navigator.userAgent.includes("Vivaldi")&&e.push("vivaldi"),navigator.userAgent.includes("YaBrowser")&&e.push("yandex"),navigator.userAgent.includes("SamsungBrowser")&&e.push("samsung"),navigator.userAgent.includes("UCBrowser")&&e.push("uc"),e}},{category:"browser",key:"pdf_viewer_enabled",version:1,cacheTtlMs:6e4,collect:()=>Z(()=>navigator.pdfViewerEnabled??null,null)},{category:"browser",key:"apple_pay_status",version:1,cacheTtlMs:6e4,isSupported:()=>"ApplePaySession"in window,collect:()=>{try{const e=window.ApplePaySession;return e?"function"!=typeof e.canMakePayments?1:e.canMakePayments()?2:1:0}catch{return null}}},{category:"browser",key:"private_click_measure",version:1,cacheTtlMs:6e4,collect:()=>Z(()=>void 0!==HTMLAnchorElement.prototype.attributionSourceId,null)},{category:"browser",key:"document_referrer",version:1,cacheTtlMs:3e4,collect:()=>Z(()=>document.referrer||null,null)},{category:"browser",key:"speech_synthesis",version:1,cacheTtlMs:3e5,timeoutMs:2e3,isSupported:()=>"speechSynthesis"in window,collect:async()=>new Promise(e=>{const t=window.speechSynthesis,n=()=>{const e=t.getVoices();if(0===e.length)return null;const n=e.map(e=>({name:e.name,lang:e.lang,default:e.default,localService:e.localService}));return v(JSON.stringify(n))},o=n();o?e(o):(t.addEventListener("voiceschanged",()=>{e(n())},{once:!0}),setTimeout(()=>e(n()),1e3))})},{category:"browser",key:"mathml_rendering",version:1,cacheTtlMs:3e5,collect:()=>{const e=document.createElement("div");e.style.cssText="position:absolute;left:-9999px;top:-9999px;",e.innerHTML='\n <math xmlns="http://www.w3.org/1998/Math/MathML">\n <mrow>\n <msup>\n <mi>x</mi>\n <mn>2</mn>\n </msup>\n <mo>+</mo>\n <msup>\n <mi>y</mi>\n <mn>2</mn>\n </msup>\n </mrow>\n </math>\n ',document.body.appendChild(e);try{const t=e.querySelector("math");if(!t)return null;const n=t.getBoundingClientRect();return{width:Math.round(100*n.width)/100,height:Math.round(100*n.height)/100,supported:n.width>10&&n.height>5}}catch{return null}finally{document.body.removeChild(e)}}},{category:"browser",key:"css_computed",version:1,cacheTtlMs:3e5,collect:()=>{const e={},t=document.createElement("div"),n=document.createElement("span"),o=document.createElement("input"),r=document.createElement("button"),i=document.createElement("textarea");t.style.cssText="position:absolute;left:-9999px;top:-9999px;visibility:hidden;",t.appendChild(n),t.appendChild(o),t.appendChild(r),t.appendChild(i),n.textContent="Test",r.textContent="Button",document.body.appendChild(t);try{const a=getComputedStyle(t),c=getComputedStyle(n),s=getComputedStyle(o),l=getComputedStyle(r),u=getComputedStyle(i);return e.font_family=a.fontFamily,e.font_size=parseFloat(a.fontSize)||null,e.font_smoothing=a.webkitFontSmoothing||null,e.text_rendering=a.textRendering,e.input_height=parseFloat(s.height)||null,e.button_height=parseFloat(l.height)||null,e.textarea_height=parseFloat(u.height)||null,e.button_padding=l.padding,e.input_padding=s.padding,e.input_border_width=s.borderWidth,e.button_border_radius=l.borderRadius,e.system_background=a.getPropertyValue("background-color")||null,e.box_sizing=a.boxSizing,e.line_height=c.lineHeight,e.span_display=c.display,e.div_display=a.display,e.button_outline=l.outline,e.input_outline=s.outline,e.button_cursor=l.cursor,e.writing_mode=a.writingMode,e}catch{return{}}finally{document.body.removeChild(t)}}},{category:"browser",key:"window_features",version:1,cacheTtlMs:3e5,collect:()=>{const e=window,t=navigator;return{request_idle_callback:"requestIdleCallback"in window,request_animation_frame:"requestAnimationFrame"in window,cancel_animation_frame:"cancelAnimationFrame"in window,intersection_observer:"IntersectionObserver"in window,mutation_observer:"MutationObserver"in window,resize_observer:"ResizeObserver"in window,performance_observer:"PerformanceObserver"in window,reporting_observer:"ReportingObserver"in window,indexed_db:"indexedDB"in window,caches:"caches"in window,broadcast_channel:"BroadcastChannel"in window,message_channel:"MessageChannel"in window,shared_worker:"SharedWorker"in window,fetch_api:"fetch"in window,abort_controller:"AbortController"in window,headers:"Headers"in window,crypto:"crypto"in window,crypto_key:"CryptoKey"in window,subtle_crypto:"SubtleCrypto"in window,media_source:"MediaSource"in window,media_recorder:"MediaRecorder"in window,media_stream:"MediaStream"in window,audio_context:"AudioContext"in window||"webkitAudioContext"in window,offline_audio_context:"OfflineAudioContext"in window,speech_recognition:"SpeechRecognition"in window||"webkitSpeechRecognition"in window,speech_synthesis:"speechSynthesis"in window,webgl_rendering_context:"WebGLRenderingContext"in window,webgl2_rendering_context:"WebGL2RenderingContext"in window,offscreen_canvas:"OffscreenCanvas"in window,image_bitmap:"ImageBitmap"in window,bluetooth:"Bluetooth"in window||!!t.bluetooth,usb:"USB"in window||!!t.usb,serial:"Serial"in window||!!t.serial,hid:"HID"in window||!!t.hid,gamepad:"Gamepad"in window||"getGamepads"in navigator,vr_display:"VRDisplay"in window||"getVRDisplays"in navigator,xr_system:"XRSystem"in window||!!t.xr,notification:"Notification"in window,push_manager:"PushManager"in window,payment_request:"PaymentRequest"in window,credentials_container:"CredentialsContainer"in window,public_key_credential:"PublicKeyCredential"in window,password_credential:"PasswordCredential"in window,performance_entry:"PerformanceEntry"in window,performance_navigation_timing:"PerformanceNavigationTiming"in window,performance_resource_timing:"PerformanceResourceTiming"in window,readable_stream:"ReadableStream"in window,writable_stream:"WritableStream"in window,transform_stream:"TransformStream"in window,worker:"Worker"in window,service_worker:"serviceWorker"in navigator,intl:"Intl"in window,proxy:"Proxy"in window,reflect:"Reflect"in window,symbol:"Symbol"in window,big_int:"BigInt"in window,weak_ref:"WeakRef"in window,finalization_registry:"FinalizationRegistry"in window,queue_microtask:"queueMicrotask"in window,structured_clone:"structuredClone"in window,ontouchstart:"ontouchstart"in window,touch_event:"TouchEvent"in window,pointer_event:"PointerEvent"in window,fullscreen_enabled:!!document.fullscreenEnabled,clipboard_item:"ClipboardItem"in window,show_open_file_picker:"showOpenFilePicker"in window,show_save_file_picker:"showSaveFilePicker"in window,show_directory_picker:"showDirectoryPicker"in window,get_screen_details:"getScreenDetails"in window,screen_left:"screenLeft"in window,screen_top:"screenTop"in window,scheduler:"scheduler"in window||!!e.scheduler,custom_elements:"customElements"in window,html_template_element:"HTMLTemplateElement"in window,shadow_root:"ShadowRoot"in window}}},{category:"browser",key:"video_codec_support",version:1,cacheTtlMs:3e5,collect:()=>{const e=document.createElement("video");if(!e.canPlayType)return{};const t={h264_baseline:'video/mp4; codecs="avc1.42E01E"',h264_main:'video/mp4; codecs="avc1.4D401E"',h264_high:'video/mp4; codecs="avc1.64001E"',hevc_main:'video/mp4; codecs="hvc1.1.6.L93.B0"',hevc_main10:'video/mp4; codecs="hvc1.2.4.L93.B0"',hevc_hev1:'video/mp4; codecs="hev1.1.6.L93.B0"',vp8:'video/webm; codecs="vp8"',vp9:'video/webm; codecs="vp9"',vp9_profile0:'video/webm; codecs="vp09.00.10.08"',vp9_profile2:'video/webm; codecs="vp09.02.10.10"',av1:'video/mp4; codecs="av01.0.00M.08"',av1_main:'video/mp4; codecs="av01.0.01M.08"',av1_high:'video/mp4; codecs="av01.0.08M.10"',av1_webm:'video/webm; codecs="av01.0.00M.08"',theora:'video/ogg; codecs="theora"',mpeg4:'video/mp4; codecs="mp4v.20.8"',mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg"},n={};for(const[o,r]of Object.entries(t))n[o]=Z(()=>e.canPlayType(r),"");return n}},{category:"browser",key:"audio_codec_support",version:1,cacheTtlMs:3e5,collect:()=>{const e=document.createElement("audio");if(!e.canPlayType)return{};const t={aac:'audio/mp4; codecs="mp4a.40.2"',aac_he:'audio/mp4; codecs="mp4a.40.5"',aac_eld:'audio/mp4; codecs="mp4a.40.39"',mp3:"audio/mpeg",mp3_codec:'audio/mpeg; codecs="mp3"',opus:'audio/ogg; codecs="opus"',opus_webm:'audio/webm; codecs="opus"',vorbis:'audio/ogg; codecs="vorbis"',flac:"audio/flac",flac_ogg:'audio/ogg; codecs="flac"',wav:"audio/wav",pcm:'audio/wav; codecs="1"',ac3:'audio/mp4; codecs="ac-3"',eac3:'audio/mp4; codecs="ec-3"',alac:'audio/mp4; codecs="alac"'},n={};for(const[o,r]of Object.entries(t))n[o]=Z(()=>e.canPlayType(r),"");return n}},{category:"browser",key:"permissions_state",version:1,cacheTtlMs:6e4,timeoutMs:3e3,isSupported:()=>"function"==typeof navigator.permissions?.query,collect:async()=>{const e=[{api:"geolocation",key:"geolocation"},{api:"notifications",key:"notifications"},{api:"push",key:"push"},{api:"camera",key:"camera"},{api:"microphone",key:"microphone"},{api:"background-fetch",key:"background_fetch"},{api:"background-sync",key:"background_sync"},{api:"persistent-storage",key:"persistent_storage"},{api:"accelerometer",key:"accelerometer"},{api:"gyroscope",key:"gyroscope"},{api:"magnetometer",key:"magnetometer"},{api:"clipboard-read",key:"clipboard_read"},{api:"clipboard-write",key:"clipboard_write"},{api:"payment-handler",key:"payment_handler"},{api:"midi",key:"midi"}],t={};for(const n of e)try{const e=await navigator.permissions.query({name:n.api});t[n.key]=e.state}catch{t[n.key]=null}return t}},{category:"browser",key:"subtle_crypto_support",version:1,cacheTtlMs:3e5,timeoutMs:2e3,collect:async()=>{if(!window.crypto||!window.crypto.subtle)return null;const e=window.crypto.subtle,t={},n={},o=["AES-CBC","AES-GCM","AES-CTR","AES-KW"];for(const n of o)try{await e.generateKey({name:n,length:256},!1,["encrypt"]),t[n]=!0}catch{t[n]=!1}const r=["SHA-1","SHA-256","SHA-384","SHA-512"];for(const n of r)try{await e.digest(n,new Uint8Array([1,2,3])),t[n]=!0}catch{t[n]=!1}try{await e.generateKey({name:"HMAC",hash:"SHA-256"},!1,["sign"]),t.HMAC=!0}catch{t.HMAC=!1}const i=["RSA-OAEP","RSA-PSS","RSASSA-PKCS1-v1_5"];for(const n of i)try{await e.generateKey({name:n,modulusLength:1024,publicExponent:new Uint8Array([1,0,1]),hash:"SHA-256"},!1,"RSA-OAEP"===n?["encrypt"]:["sign"]),t[n]=!0}catch{t[n]=!1}const a=["P-256","P-384","P-521"];for(const t of a)try{await e.generateKey({name:"ECDSA",namedCurve:t},!1,["sign"]),n[t]=!0}catch{n[t]=!1}try{await e.generateKey({name:"Ed25519"},!1,["sign"]),t.Ed25519=!0}catch{t.Ed25519=!1}try{await e.generateKey({name:"X25519"},!1,["deriveBits"]),t.X25519=!0}catch{t.X25519=!1}return{available:!0,algorithms:t,curves:n}}},{category:"browser",key:"drm_support",version:1,timeoutMs:3e3,collect:async()=>{const e={widevine:!1,playready:!1,fairplay:!1,clearkey:!1,primetime:!1};if("undefined"==typeof navigator||!navigator.requestMediaKeySystemAccess)return e;const t=[{initDataTypes:["cenc"],videoCapabilities:[{contentType:'video/mp4; codecs="avc1.42E01E"'},{contentType:'video/webm; codecs="vp8"'}],audioCapabilities:[{contentType:'audio/mp4; codecs="mp4a.40.2"'},{contentType:'audio/webm; codecs="opus"'}]}],n=Object.entries({widevine:["com.widevine.alpha"],playready:["com.microsoft.playready","com.microsoft.playready.hardware"],fairplay:["com.apple.fps","com.apple.fps.1_0","com.apple.fps.2_0"],clearkey:["org.w3.clearkey"],primetime:["com.adobe.primetime"]}).map(async([n,o])=>{for(const r of o)try{await navigator.requestMediaKeySystemAccess(r,t),e[n]=!0;break}catch{}});return await Promise.all(n),e}},{category:"browser",key:"navigator_features",version:1,collect:()=>{const e=navigator;return{vibrate:"function"==typeof e.vibrate,share:"function"==typeof e.share,can_share:"function"==typeof e.canShare,wake_lock:"wakeLock"in e,bluetooth:"bluetooth"in e,usb:"usb"in e,serial:"serial"in e,hid:"hid"in e,presentation:"presentation"in e,xr:"xr"in e,media_session:"mediaSession"in e,media_capabilities:"mediaCapabilities"in e,permissions:"permissions"in e,clipboard:"clipboard"in e,credentials:"credentials"in e,locks:"locks"in e,storage:"storage"in e,service_worker:"serviceWorker"in e,geolocation:"geolocation"in e,get_battery:"function"==typeof e.getBattery,send_beacon:"function"==typeof e.sendBeacon,request_midi_access:"function"==typeof e.requestMIDIAccess,get_gamepads:"function"==typeof e.getGamepads,max_touch_points:e.maxTouchPoints??0,pdf_viewer_enabled:e.pdfViewerEnabled??!1,webdriver:e.webdriver??!1,device_memory:e.deviceMemory??null,hardware_concurrency:e.hardwareConcurrency??null,cookie_enabled:e.cookieEnabled??!1,on_line:e.onLine??!1,language:e.language??null}}},{category:"browser",key:"document_features",version:1,collect:()=>{const e=document;return{picture_in_picture_enabled:e.pictureInPictureEnabled??!1,fullscreen_enabled:e.fullscreenEnabled??!1,design_mode:e.designMode??null,hidden:e.hidden??!1,visibility_state:e.visibilityState??null,adopted_style_sheets:"adoptedStyleSheets"in e,timeline:"timeline"in e,fragment_directive:"fragmentDirective"in e,feature_policy:"featurePolicy"in e,permissions_policy:"permissionsPolicy"in e}}},{category:"browser",key:"css_feature_support",version:1,collect:()=>{const e=(e,t)=>{try{return!("undefined"==typeof CSS||!CSS.supports)&&(t?CSS.supports(e,t):CSS.supports(e))}catch{return!1}};return{supported:"undefined"!=typeof CSS&&"function"==typeof CSS.supports,variables:e("--a","0"),grid:e("display","grid"),subgrid:e("grid-template-columns","subgrid"),flexbox:e("display","flex"),container_queries:e("container-type","inline-size"),has:e("selector(:has(*))"),backdrop_filter:e("backdrop-filter","blur(1px)"),mask_image:e("mask-image","none"),scroll_snap_type:e("scroll-snap-type","x mandatory"),aspect_ratio:e("aspect-ratio","1/1"),gap:e("gap","1px"),inset:e("inset","0"),color_mix:e("color","color-mix(in srgb, red, blue)"),lch:e("color","lch(50% 50 50)"),oklch:e("color","oklch(50% 0.2 50)"),paint_worklet:"undefined"!=typeof CSS&&"paintWorklet"in CSS,register_property:"undefined"!=typeof CSS&&"registerProperty"in CSS,layer_rule:e("@layer test { }"),nesting_selector:e("selector(&)"),view_transitions:"undefined"!=typeof document&&"startViewTransition"in document,anchor_positioning:e("anchor-name","--a"),scroll_timeline:e("animation-timeline","scroll()"),touch_action:e("touch-action","pan-y")}}},{category:"browser",key:"dom_blockers",version:1,cacheTtlMs:3e5,collect:()=>{const e={},t=[{id:"ad_banner",className:"ad-banner",name:"ad_banner"},{id:"ads",className:"ads",name:"ads"},{id:"advertisement",className:"advertisement",name:"advertisement"},{id:"sponsor",className:"sponsor-link",name:"sponsor"},{id:"google_ads",className:"google-ad",name:"google_ads"},{id:"adsbox",className:"adsbox",name:"ads_box"},{id:"ad_unit",className:"ad-unit",name:"ad_unit"},{id:"banner_ad",className:"banner_ad",name:"banner_ad"}],n=document.createElement("div");n.style.position="absolute",n.style.left="-9999px",n.style.top="-9999px";const o=[];for(const e of t){const t=document.createElement("div");t.id=e.id,t.className=e.className,t.style.width="1px",t.style.height="1px",t.innerHTML=" ",n.appendChild(t),o.push(t)}document.body.appendChild(n);try{for(let n=0;t.length>n;n++){const r=o[n],i=t[n],a=getComputedStyle(r);e[i.name]="none"===a.display||"hidden"===a.visibility||0===r.offsetHeight||0===r.offsetWidth||"0"===a.opacity||null===r.offsetParent}}finally{document.body.removeChild(n)}return e}},{category:"browser",key:"iframe_sandbox_support",version:1,collect:()=>{try{const e=document.createElement("iframe");if(!("sandbox"in e))return{supported:!1,tokens:[]};const t=["allow-downloads","allow-forms","allow-modals","allow-orientation-lock","allow-pointer-lock","allow-popups","allow-popups-to-escape-sandbox","allow-presentation","allow-same-origin","allow-scripts","allow-storage-access-by-user-activation","allow-top-navigation","allow-top-navigation-by-user-activation","allow-top-navigation-to-custom-protocols"],n=[];for(const o of t)try{e.sandbox.add(o),e.sandbox.contains(o)&&n.push(o),e.sandbox.remove(o)}catch{}return{supported:!0,tokens:n}}catch{return{supported:!1,tokens:[]}}}},{category:"browser",key:"system_colors",version:1,collect:()=>{try{const e=[{css:"Canvas",key:"canvas"},{css:"CanvasText",key:"canvas_text"},{css:"LinkText",key:"link_text"},{css:"VisitedText",key:"visited_text"},{css:"ActiveText",key:"active_text"},{css:"ButtonFace",key:"button_face"},{css:"ButtonText",key:"button_text"},{css:"ButtonBorder",key:"button_border"},{css:"Field",key:"field"},{css:"FieldText",key:"field_text"},{css:"Highlight",key:"highlight"},{css:"HighlightText",key:"highlight_text"},{css:"SelectedItem",key:"selected_item"},{css:"SelectedItemText",key:"selected_item_text"},{css:"Mark",key:"mark"},{css:"MarkText",key:"mark_text"},{css:"GrayText",key:"gray_text"},{css:"AccentColor",key:"accent_color"},{css:"AccentColorText",key:"accent_color_text"}],t=document.createElement("div");t.style.cssText="position:absolute;left:-9999px;",document.body.appendChild(t);const n={};for(const o of e)try{t.style.color=o.css;const e=getComputedStyle(t).color;n[o.key]=e||null}catch{n[o.key]=null}return document.body.removeChild(t),n}catch{return{}}}}];const Y=[{category:"network",key:"network_connection",version:1,cacheTtlMs:3e4,isSupported:()=>"connection"in navigator,collect:()=>{const e=navigator.connection;return e?{effective_type:e.effectiveType??null,downlink:e.downlink??null,downlink_max:e.downlinkMax??null,rtt:e.rtt??null,save_data:e.saveData??!1,type:e.type??null}:null}},{category:"network",key:"webrtc_ip_handling",version:1,cacheTtlMs:6e4,timeoutMs:2e3,isSupported:()=>"undefined"!=typeof RTCPeerConnection||void 0!==window.webkitRTCPeerConnection,collect:async()=>{const e=RTCPeerConnection||window.webkitRTCPeerConnection;if(!e)return null;const t=function(e,t){try{return e()}catch{return t}}(()=>{const t=new e({iceServers:[]}),n="function"==typeof t.createDataChannel;return t.close(),n},!1),n=!!navigator.mediaDevices&&!!navigator.mediaDevices.getUserMedia;let o=null;try{const t=new e({iceServers:[],iceCandidatePoolSize:0});t.createDataChannel("");const n=new Promise(e=>{const n=setTimeout(()=>e(!1),1e3);t.onicecandidate=t=>{t.candidate&&(clearTimeout(n),e(!0))},t.createOffer().then(e=>t.setLocalDescription(e)).catch(()=>e(!1))}),r=await n;t.close(),o=r?"default":"disabled"}catch{o="error"}return{peer_connection_supported:!0,rtc_data_channel_supported:t,media_devices_supported:n,ip_handling_policy:o}}}];function ee(e,t){try{return e()}catch{return t}}async function te(e,t,n){return Promise.race([e,new Promise(e=>setTimeout(()=>e(n),t))])}const ne=[{category:"storage",key:"cookies_enabled",version:1,cacheTtlMs:6e4,collect:()=>ee(()=>navigator.cookieEnabled??null,null)},{category:"storage",key:"storage_availability",version:1,cacheTtlMs:3e5,collect:()=>({local_storage:(()=>{try{const e="__fp_test_ls__";return localStorage.setItem(e,"1"),localStorage.removeItem(e),!0}catch{return!1}})(),session_storage:(()=>{try{const e="__fp_test_ss__";return sessionStorage.setItem(e,"1"),sessionStorage.removeItem(e),!0}catch{return!1}})(),indexed_db:!!window.indexedDB,web_sql:!!window.openDatabase,cache_api:"caches"in window,service_worker:"serviceWorker"in navigator,file_system_access:"showOpenFilePicker"in window||"showDirectoryPicker"in window,cookie_store:"cookieStore"in window,cookies_enabled:ee(()=>navigator.cookieEnabled,!1),storage_manager:"storage"in navigator,persistent_storage:!!navigator.storage?.persist})},{category:"storage",key:"storage_persistence",version:1,cacheTtlMs:6e4,timeoutMs:2e3,collect:async()=>{if(!navigator.storage)return null;let e=!1;try{e=await te(navigator.storage.persisted(),1e3,!1)}catch{}let t=null,n=null,o=null;try{const e=await te(navigator.storage.estimate(),1e3,{quota:void 0,usage:void 0});t=e.quota??null,n=e.usage??null,null!==t&&null!==n&&t>0&&(o=Math.round(n/t*1e4)/100)}catch{}return{persisted:e,quota_bytes:t,usage_bytes:n,usage_percentage:o}}}];function oe(e){try{if("function"!=typeof window.matchMedia)return null;return window.matchMedia(e).matches}catch{return null}}const re={category:"accessibility",key:"screen_reader_hints",version:1,cacheTtlMs:3e5,collect:()=>{const e=!0===oe("(forced-colors: active)"),t=!0===oe("(prefers-contrast: more)")||!0===oe("(-ms-high-contrast: active)"),n=!0===oe("(prefers-reduced-motion: reduce)"),o="speechSynthesis"in window;return{forced_colors:e,high_contrast:t,reduced_motion:n,speech_synthesis:o,aria_live:document.querySelectorAll('[aria-live="polite"], [aria-live="assertive"], [role="alert"], [role="status"]').length>0,possible_screen_reader:(e||t)&&(n||o)}}},ie=[{category:"accessibility",key:"dark_mode",version:1,cacheTtlMs:6e4,collect:()=>oe("(prefers-color-scheme: dark)")?"dark":oe("(prefers-color-scheme: light)")?"light":"no-preference"},{category:"accessibility",key:"contrast_preference",version:1,cacheTtlMs:6e4,collect:()=>oe("(prefers-contrast: more)")?"more":oe("(prefers-contrast: less)")?"less":oe("(prefers-contrast: custom)")?"custom":oe("(prefers-contrast: no-preference)")?"no-preference":null},{category:"accessibility",key:"reduced_motion",version:1,cacheTtlMs:6e4,collect:()=>oe("(prefers-reduced-motion: reduce)")},{category:"accessibility",key:"reduced_transparency",version:1,cacheTtlMs:6e4,collect:()=>oe("(prefers-reduced-transparency: reduce)")},{category:"accessibility",key:"forced_colors",version:1,cacheTtlMs:6e4,collect:()=>oe("(forced-colors: active)")},{category:"accessibility",key:"inverted_colors",version:1,cacheTtlMs:6e4,collect:()=>oe("(inverted-colors: inverted)")},{category:"accessibility",key:"do_not_track",version:1,cacheTtlMs:6e4,collect:()=>{try{return(navigator.doNotTrack||window.doNotTrack||navigator.msDoNotTrack)??null}catch{return null}}},re,{category:"accessibility",key:"text_scaling",version:1,cacheTtlMs:6e4,collect:()=>{try{const e=16,t=document.createElement("div");t.style.cssText="position:absolute;left:-9999px;font-size:1rem;width:1em;height:1em;",document.body.appendChild(t);const n=parseFloat(getComputedStyle(t).fontSize);document.body.removeChild(t);const o=Math.round(n/e*100)/100;return{font_size:n,scale_factor:o,possible_zoom:1!==o}}catch{return{font_size:16,scale_factor:1,possible_zoom:!1}}}}];function ae(e,t){try{return e()}catch{return t}}function ce(e,t){return Promise.race([e,new Promise(e=>setTimeout(()=>e(null),t))])}const se=[{category:"risk",key:"automation_detected",version:1,cacheTtlMs:3e5,collect:()=>{const e=navigator,t=window;if(!0===e.webdriver)return!0;try{const e=Object.getOwnPropertyDescriptor(Navigator.prototype,"webdriver");if(e?.get){const t=Function.prototype.toString.call(e.get);if(!/\[native code\]/.test(t))return!0}}catch{}const n=["__selenium_unwrapped","__webdriver_evaluate","__webdriver_unwrapped","__driver_evaluate","__driver_unwrapped","__webdriver_script_fn","__webdriver_script_func","__webdriver_script_function","__fxdriver_evaluate","__fxdriver_unwrapped","_Selenium_IDE_Recorder","_selenium","calledSelenium","$cdc_asdjflasutopfhvcZLmcfl_","$chrome_asyncScriptInfo","__nightmare","__puppeteer_evaluation_script__","__playwright_evaluation_script__","__playwright","__pw_manual"];for(const e of n)if(e in t||e in document)return!0;try{if(Object.keys(t).some(e=>e.startsWith("$cdc_")))return!0}catch{}if("callPhantom"in t||"_phantom"in t||"phantom"in t)return!0;const o=e.userAgent?.toLowerCase()||"";if(o.includes("headless")||o.includes("phantomjs"))return!0;try{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl");if(t){const e=t.getExtension("WEBGL_debug_renderer_info");if(e){const n=t.getParameter(e.UNMASKED_RENDERER_WEBGL);if("string"==typeof n&&/swiftshader/i.test(n))return!0}}}catch{}try{if(e.plugins&&0===e.plugins.length&&!o.includes("firefox"))return!0}catch{}try{if(o.includes("chrome")&&!("chrome"in t))return!0;if(t.chrome&&!t.chrome.runtime&&!t.chrome.csi)return!0}catch{}return!1}},{category:"risk",key:"automation_signals",version:1,cacheTtlMs:3e5,collect:()=>{const e=navigator,t=window,n=e.userAgent?.toLowerCase()||"";return{webdriver:!0===e.webdriver,headless_user_agent:n.includes("headless")||n.includes("phantomjs"),phantom_js:"callPhantom"in t||"_phantom"in t||"phantom"in t,selenium:["__selenium_unwrapped","_Selenium_IDE_Recorder","_selenium","calledSelenium"].some(e=>e in t||e in document),playwright:"__playwright_evaluation_script__"in t,puppeteer:"__puppeteer_evaluation_script__"in t,nightmare:"__nightmare"in t,cdc_properties:"$cdc_asdjflasutopfhvcZLmcfl_"in t||"$chrome_asyncScriptInfo"in t||Object.keys(t).some(e=>e.startsWith("$cdc_")),languages_inconsistent:ae(()=>!e.languages||0===e.languages.length||!(!e.language||e.languages.includes(e.language.split("-")[0])),!1),plugins_inconsistent:ae(()=>{const t=e.plugins;return!t||0===t.length&&!n.includes("firefox")},!1),permissions_inconsistent:ae(()=>"permissions"in e&&void 0===e.permissions.query,!1),screen_inconsistent:ae(()=>0===screen.width||0===screen.height||0===screen.availWidth||0===screen.availHeight,!1),chrome_inconsistent:ae(()=>!(!n.includes("chrome")||"chrome"in t)||!(!t.chrome||t.chrome.runtime||t.chrome.csi),!1),notification_permission_inconsistent:ae(()=>!1,!1)}}},{category:"risk",key:"debugger_detected",version:1,cacheTtlMs:1e4,collect:()=>{let e=!1,t=null;return ae(()=>{const n=window.outerWidth-window.innerWidth>160,o=window.outerHeight-window.innerHeight>160;(n||o)&&(e=!0,t="dimension")},void 0),ae(()=>{window.Firebug?.chrome?.isInitialized&&(e=!0,t="firebug")},void 0),{dev_tools_open:e,method:t}}},{category:"risk",key:"incognito_mode",version:2,cacheTtlMs:3e5,timeoutMs:3e3,collect:async()=>{const e=(navigator.userAgent||"").toLowerCase(),t=e.includes("chrome")||e.includes("chromium"),n=e.includes("firefox");try{const e=await ce(navigator.storage.estimate(),1500);if(e&&void 0!==e.quota){const n=e.quota;if(2e8>n)return{is_private:!0,confidence:"high",method:"storage_quota"};if(t){const e=navigator.deviceMemory;if(e&&3*e*1024*1024*1024>n)return{is_private:!0,confidence:"medium",method:"storage_quota_vs_memory"};if(!e&&16e9>n)return{is_private:!0,confidence:"medium",method:"storage_quota_chrome"}}}}catch{}try{const e=navigator.webkitTemporaryStorage;if(e?.queryUsageAndQuota){const t=await ce(new Promise((t,n)=>{e.queryUsageAndQuota((e,n)=>t(n),()=>n(Error("quota query failed")))}),1e3);if(null!==t&&2e8>t)return{is_private:!0,confidence:"medium",method:"webkit_temporary_storage"}}}catch{}try{await ce(new Promise((e,t)=>{const n=indexedDB.open("_di_priv_check");n.onerror=()=>t(Error("blocked")),n.onsuccess=()=>{n.result.close(),e(!0)}}),1e3)}catch{return{is_private:!0,confidence:n?"medium":"low",method:"indexeddb"}}return{is_private:!1,confidence:"low",method:"none"}}},{category:"risk",key:"disabled_cookie_flag",version:1,cacheTtlMs:6e4,collect:()=>{const e=navigator.cookieEnabled??!1;let t=!1;try{document.cookie="__fp_test_cookie=1; SameSite=Strict",t=document.cookie.includes("__fp_test_cookie"),document.cookie="__fp_test_cookie=; expires=Thu, 01 Jan 1970 00:00:00 GMT"}catch{t=!1}return{cookie_enabled:e,can_set_cookie:t,third_party_cookies:null}}}];function le(){return[...R,...J,...X,...G,...N,...K,...Q,...ie,...se,...ne,...Y,...O]}var ue="1.1.3";function de(){try{return localStorage.getItem(n)}catch{return null}}function pe(){try{return`${window.location.host}${window.location.pathname}`}catch{return""}}function me(e){if(null===e)return null;if("string"==typeof e||"number"==typeof e||"boolean"==typeof e)return e;if("bigint"==typeof e)return""+e;if(void 0===e)return null;if("function"==typeof e||"symbol"==typeof e)return null;if(Array.isArray(e))return e.map(e=>me(e));if(e&&"object"==typeof e){const t=e,n={};for(const e of Object.keys(t).sort()){const o=me(t[e]);void 0!==o&&(n[e]=o)}return n}return null}function he(e){const t={};for(const[n,o]of Object.entries(e))t[n]={value:o.value,status:o.status,version:o.version,category:o.category};return t}function ye(){try{const e=localStorage.getItem(o);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}const ge=new class{constructor(){this.state="idle",this.cachedCollection=null,this.cachedElephantDevice=null,this.collectionAndSendPromise=null,this.localElephantDevice=null,this.isInitialized=!1,this.lastSendSucceeded=!1,this.pendingUserData=null}async init(e={}){if(this.isInitialized&&this.lastSendSucceeded)return this.log("Agent already initialized, ignoring duplicate init call"),this.getDebugInfo();if(this.isInitialized&&!this.lastSendSucceeded)return this.options=w(i,e),this.log=b("[DeviceIntelligence]",this.options.debug),this.log("Retrying send after previous failure"),this.collectAndSend();this.options=w(i,e),this.log=b("[DeviceIntelligence]",this.options.debug),this.attributeEngine=new M({collectors:le(),debug:this.options.debug,log:this.log,concurrency:8}),this.localElephantDevice=function(){try{let e=localStorage.getItem(t);return e||(e=crypto.randomUUID(),localStorage.setItem(t,e)),e}catch{return crypto.randomUUID()}}(),this.cachedElephantDevice=de(),this.isInitialized=!0,this.log("DeviceIntelligenceAgent initialized");const{collectionTiming:n}=this.options;switch(n){case"immediate":return this.log("Starting immediate collection"),this.collectAndSend();case"onLoad":return this.log("Scheduling collection for page load"),"complete"===document.readyState?this.collectAndSend():new Promise((e,t)=>{window.addEventListener("load",()=>{this.collectAndSend().then(e).catch(t)},{once:!0})});case"manual":return this.log("Manual collection mode - waiting for explicit trigger"),this.getDebugInfo();default:return this.getDebugInfo()}}async addUserData(e){return this.collectAndSend(e)}getElephantDevice(){return this.cachedElephantDevice}getDebugInfo(){return this.isInitialized&&this.options.debug&&this.cachedCollection?{attributes:this.cachedCollection.attributes,collectedAt:this.cachedCollection.collectedAt,state:this.state,sdkType:"web",sdkVersion:ue,schemaVersion:1}:null}async collectAndSend(e){if(!this.isInitialized)throw Error("DeviceIntelligence SDK not initialized. Call DeviceIntelligence.init() first.");if(this.log("collectAndSend called",e?"with user data":"without user data"),"collecting"===this.state&&this.collectionAndSendPromise)return this.log("Collection in progress, merging user data into pending request"),e&&(this.pendingUserData={...this.pendingUserData,...e}),await this.collectionAndSendPromise,this.getDebugInfo();this.state="collecting",this.collectionAndSendPromise=(async()=>{this.cachedCollection&&this.isCacheValid()||await this.collectAttributes();const t={...this.pendingUserData,...e};this.pendingUserData=null,this.options.skipSend?(this.log("skipSend mode enabled - skipping server send"),this.lastSendSucceeded=!0):await this.buildAndSendPayload(Object.keys(t).length>0?t:void 0)})();try{await this.collectionAndSendPromise,this.state="collected"}catch(e){throw this.state="error",e}return this.getDebugInfo()}isCacheValid(){if(!this.cachedCollection)return!1;const e=Date.now()-this.cachedCollection.collectedAt;return this.options.attributeCacheTtl>e}async collectAttributes(){this.log("Collecting device attributes...");const e=new AbortController,t=setTimeout(()=>e.abort(),Math.max(1,this.options.timeout));let n;try{n=await this.attributeEngine.collectAll(e.signal)}finally{clearTimeout(t)}const o=this.toAttributes(n);return this.cachedCollection={attributes:o,results:n,collectedAt:Date.now()},this.log("Collection complete, attributes count:",Object.keys(o).length),this.cachedCollection}async buildAndSendPayload(e){if(!this.cachedCollection)return void this.log("No cached collection available, skipping send");const t=await async function(e,t){if("undefined"==typeof crypto||!crypto.subtle)return"";const n={attributes:me(he(e)),userData:t?me(t):null},o=JSON.stringify(n),r=(new TextEncoder).encode(o),i=await crypto.subtle.digest("SHA-256",r);return Array.from(new Uint8Array(i)).map(e=>e.toString(16).padStart(2,"0")).join("")}(this.cachedCollection.attributes,e);if(!function(e,t){if(!e)return!0;if(0>=t)return!0;try{const n=ye(),o=Date.now(),r=n.find(t=>t.hash===e);return!r||o-r.timestamp>=t}catch{return!0}}(t,this.options.minSendIntervalMs))return this.log("Skipping send - payload unchanged and within minSendIntervalMs"),void(this.lastSendSucceeded=!0);const n="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}),i=Date.now(),a=de(),c={referer:pe(),site_id:this.options.siteId,timestamp:i,local_elephant_device:this.localElephantDevice,elephant_device:a,user_data:e||{},sdk_type:"web",sdk_version:ue,schema_version:1,attributes:this.cachedCollection.attributes,...this.options.trafficType&&{traffic_type:this.options.trafficType}};if(this.log("Payload prepared, requestId:",n),!this.options.endpoint)return this.log("No endpoint configured, skipping server request"),void(this.lastSendSucceeded=!0);const s=await this.sendToServer(c);this.lastSendSucceeded=s,s&&(!function(e,t){if(e)try{const n=ye(),i=Date.now(),a=Math.max(t,r),c=n.filter(t=>t.hash===e||a>i-t.timestamp),s=c.find(t=>t.hash===e);s?s.timestamp=i:c.push({hash:e,timestamp:i}),localStorage.setItem(o,JSON.stringify(c))}catch{}}(t,this.options.minSendIntervalMs),this.log("Payload sent successfully"))}toAttributes(e){const t={};for(const n of e)t[n.key]={value:null,duration:n.durationMs,status:n.status,version:n.version,category:n.category,error:n.error},"ok"===n.status&&(t[n.key].value=n.value);return t}async sendToServer(e){const{endpoint:t,apiKey:o,timeout:r}=this.options;this.log("Sending to server:",t);const i=new AbortController,a=setTimeout(()=>i.abort(),r);try{const r={"Content-Type":"application/json"};let c;if(o&&(r["X-API-Key"]=o),"undefined"!=typeof crypto&&crypto.subtle){const t=await x(e);c=JSON.stringify(t),r["pipl-encrypted"]="true",this.log("Payload encrypted")}else c=JSON.stringify(e),this.log("Web Crypto not supported, sending unencrypted");const s=await fetch(t,{method:"POST",headers:r,body:c,signal:i.signal});if(clearTimeout(a),!s.ok){const e=await s.text().catch(()=>"");throw Error(`Server responded with ${s.status}${e?": "+e:""}`)}const l=await s.json();return this.log("Server response:",l),l.elephantDevice&&(this.cachedElephantDevice=l.elephantDevice,function(e){try{localStorage.setItem(n,e)}catch{}}(l.elephantDevice)),!0}catch(e){clearTimeout(a);if(this.log("Server request failed:",e instanceof Error?"AbortError"===e.name?"Request timeout":e.message:"Unknown error"),this.options.debug)throw e;return!1}}};function _e(e={}){return ge.init(e)}async function fe(e){return ge.addUserData(e)}function ve(){return ge.getElephantDevice()}const we={init:_e,addUserData:fe,getElephantDevice:ve};e.addUserData=fe,e.default=we,e.getElephantDevice=ve,e.init=_e,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
7
7
|
//# sourceMappingURL=device-intelligence.umd.min.js.map
|