1function initializeDropdown(dropdownId){const button=document.getElementById(`${dropdownId}-button`);const dropdown=document.getElementById(`${dropdownId}-dropdown`);const selectedSpan=document.getElementById(`${dropdownId}-selected`);const hiddenInput=document.getElementById(dropdownId);if(!button||!dropdown)return;button.addEventListener("click",()=>{const isExpanded=dropdown.classList.contains("hidden");dropdown.classList.toggle("hidden",!isExpanded);button.setAttribute("aria-expanded",!isExpanded);});document.addEventListener("click",function(event){if(!button.contains(event.target)&&!dropdown.contains(event.target)){dropdown.classList.add("hidden");button.setAttribute("aria-expanded","false");}});const options=dropdown.querySelectorAll("button");options.forEach((option)=>{option.addEventListener("click",function(event){event.preventDefault();const selectedValue=option.getAttribute("data-value");const selectedText=option.textContent;if(selectedSpan)selectedSpan.textContent=selectedText;if(hiddenInput)hiddenInput.value=selectedValue;dropdown.classList.add("hidden");button.setAttribute("aria-expanded","false");});});};document.addEventListener("DOMContentLoaded",()=>{initializeDropdown("interest");if(window.botProtection){window.botProtection.addProtectionToForm('talentpool-form');} 2const successMessage=document.getElementById("success-message");const formFields=document.getElementById("form-fields");document.getElementById("talentpool-form").addEventListener("submit",async(e)=>{e.preventDefault();const firstNameValue=document.getElementById("first-name").value.trim();const lastNameValue=document.getElementById("last-name").value.trim();const emailValue=document.getElementById("email").value.trim();const phoneValue=document.getElementById("phone").value.trim();const interestValue=document.getElementById("interest").value.trim();const graduationDateValue=document.getElementById("graduation-date").value.trim();const linkedinValue=document.getElementById("linkedin").value.trim();window._sqzl.push({event:"Inschrijving talentpool",email:emailValue||"",firstname:firstNameValue||"",lastname:lastNameValue||"",custom_interesse:interestValue||"",custom_afstudeerdatum:graduationDateValue||"",phone:phoneValue||"",custom_linkedin:linkedinValue||""});const form=e.target;const url=form.action;const formData=new FormData(form);try{const response=await fetch(url,{method:"POST",headers:{"X-CSRFToken":form.querySelector("[name=csrfmiddlewaretoken]").value},body:formData});if(response.ok){form.reset();const data=await response.json();formFields.classList.add("opacity-0","pointer-events-none");successMessage.classList.remove("hidden");}else{alert("Er is iets misgegaan bij het versturen van het formulier.");}}catch(error){console.error("Network error:",error);alert("Er is een netwerkfout opgetreden.");}});});;class BotProtection{constructor(){this.startTime=Date.now();this.mouseMovements=0;this.keystrokes=0;this.focusEvents=0;this.scrollEvents=0;this.fingerprint=null;this.keystrokeTiming=[];this.clickEvents=0;this.tabEvents=0;this.backspaceCount=0;this.pasteEvents=0;this.mousePath=[];this.fieldInteractions=new Map();this.deviceMotionEvents=0;this.audioFingerprint=null;this.fontList=[];this.batteryInfo=null;this.connectionInfo=null;this.init();} 3init(){this.trackUserInteractions();this.generateFingerprint();} 4trackUserInteractions(){const trackingStartTime=Date.now();document.addEventListener('mousemove',(e)=>{this.mouseMovements++;if(this.mousePath.length<50){this.mousePath.push({x:e.clientX,y:e.clientY,time:Date.now()-trackingStartTime});}});let lastKeystrokeTime=0;document.addEventListener('keydown',(e)=>{const currentTime=Date.now();this.keystrokes++;if(lastKeystrokeTime>0&&this.keystrokeTiming.length<20){this.keystrokeTiming.push(currentTime-lastKeystrokeTime);} 5lastKeystrokeTime=currentTime;if(e.key==='Backspace')this.backspaceCount++;
5if(e.key==='Tab')this.tabEvents++;});document.addEventListener('paste',()=>{this.pasteEvents++;});document.addEventListener('click',()=>{this.clickEvents++;});document.addEventListener('focusin',(e)=>{this.focusEvents++;if(e.target.name||e.target.id){const fieldId=e.target.name||e.target.id;const interaction=this.fieldInteractions.get(fieldId)||{focuses:0,timeSpent:0,startTime:Date.now()};interaction.focuses++;interaction.startTime=Date.now();this.fieldInteractions.set(fieldId,interaction);}});document.addEventListener('focusout',(e)=>{if(e.target.name||e.target.id){const fieldId=e.target.name||e.target.id;const interaction=this.fieldInteractions.get(fieldId);if(interaction){interaction.timeSpent+=Date.now()-interaction.startTime;}}});document.addEventListener('scroll',()=>{this.scrollEvents++;});if(window.DeviceMotionEvent){window.addEventListener('devicemotion',()=>{this.deviceMotionEvents++;},{once:false,passive:true});}} 6generateFingerprint(){const canvas=document.createElement('canvas');const ctx=canvas.getContext('2d');ctx.textBaseline='top';ctx.font='14px Arial';ctx.fillText('Bot protection fingerprint',2,2);this.generateAudioFingerprint();this.detectFonts();this.getBatteryInfo();this.getConnectionInfo();const fingerprint={userAgent:navigator.userAgent,language:navigator.language,languages:navigator.languages?navigator.languages.join(','):'',platform:navigator.platform,screenResolution:`${screen.width}x${screen.height}`,availScreenResolution:`${screen.availWidth}x${screen.availHeight}`,colorDepth:screen.colorDepth,pixelDepth:screen.pixelDepth,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,timezoneOffset:new Date().getTimezoneOffset(),canvas:canvas.toDataURL(),plugins:Array.from(navigator.plugins).map(p=>p.name).join(','),mimeTypes:Array.from(navigator.mimeTypes).map(m=>m.type).join(','),cookieEnabled:navigator.cookieEnabled,doNotTrack:navigator.doNotTrack,hardwareConcurrency:navigator.hardwareConcurrency,maxTouchPoints:navigator.maxTouchPoints,webglVendor:this.getWebGLVendor(),webglRenderer:this.getWebGLRenderer(),audioFingerprint:this.audioFingerprint,fonts:this.fontList.join(','),localStorage:this.checkLocalStorage(),sessionStorage:this.checkSessionStorage(),indexedDB:this.checkIndexedDB(),webGL:this.getWebGLInfo(),touchSupport:this.getTouchSupport(),deviceMemory:navigator.deviceMemory||'unknown',cpuClass:navigator.cpuClass||'unknown'};this.fingerprint=btoa(JSON.stringify(fingerprint));} 7getWebGLVendor(){try{const canvas=document.createElement('canvas');const gl=canvas.getContext('webgl')||canvas.getContext('experimental-webgl');const debugInfo=gl.getExtension('WEBGL_debug_renderer_info');return debugInfo?gl.getParameter(debugInfo.UNMASKED_VENDOR_WEBGL):'Unknown';}catch(e){return'Unknown';}} 8getWebGLRenderer(){try{const canvas=document.createElement('canvas');const gl=canvas.getContext('webgl')||canvas.getContext('experimental-webgl');const debugInfo=gl.getExtension('WEBGL_debug_renderer_info');return debugInfo?gl.getParameter(debugInfo.UNMASKED_RENDERER_WEBGL):'Unknown';}catch(e){return'Unknown';}} 9generateAudioFingerprint(){try{const audioContext=new(window.AudioContext||window.webkitAudioContext)();const oscillator=audioContext.createOscillator();const analyser=audioContext.createAnalyser();const gainNode=audioContext.createGain();const scriptProcessor=audioContext.createScriptProcessor(4096,1,1);oscillator.type='triangle';oscillator.frequency.setValueAtTime(10000,audioContext.currentTime);gainNode.gain.setValueAtTime(0,audioContext.currentTime);oscillator.connect(analyser);analyser.connect(scriptProcessor);scriptProcessor.connect(gainNode);gainNode.connect(audioContext.destination);scriptProcessor.onaudioprocess=(e)=>{const data=new Float32Array(analyser.frequencyBinCount);analyser.getFloatFrequencyData(data);this.audioFingerprint=Array.from(data.slice(0,30)).join(',');oscillator.disconnect();scriptProcessor.disconnect();audioContext.close();};oscillator.start(0);oscillator.stop(audioContext.currentTime+0.1);}catch(e){this.audioFingerprint='unavailable';}} 10detectFonts(){const baseFonts=['monospace','sans-serif','serif'];const testFonts=['Arial','Helvetica','Times New Roman','Courier New','Verdana','Georgia','Palatino','Garamond','Bookman','Trebuchet MS','Arial Black','Impact','Comic Sans MS','Lucida Console'];const testString='mmmmmmmmmmlli';const testSize='72px';const canvas=document.createElement('canvas');const context=canvas.getContext('2d');canvas.width=60;canvas.height=20;const baseSizes={};
10baseFonts.forEach(baseFont=>{context.font=testSize+' '+baseFont;const metrics=context.measureText(testString);baseSizes[baseFont]=metrics.width;});testFonts.forEach(font=>{let detected=false;baseFonts.forEach(baseFont=>{context.font=testSize+' '+font+', '+baseFont;const metrics=context.measureText(testString);if(metrics.width!==baseSizes[baseFont]){detected=true;}});if(detected){this.fontList.push(font);}});} 11getBatteryInfo(){if('getBattery'in navigator){navigator.getBattery().then(battery=>{this.batteryInfo={charging:battery.charging,level:Math.round(battery.level*100),chargingTime:battery.chargingTime,dischargingTime:battery.dischargingTime};}).catch(()=>{this.batteryInfo='unavailable';});}else{this.batteryInfo='unavailable';}} 12getConnectionInfo(){if('connection'in navigator){const conn=navigator.connection;this.connectionInfo={effectiveType:conn.effectiveType||'unknown',downlink:conn.downlink||0,rtt:conn.rtt||0,saveData:conn.saveData||false};}else{this.connectionInfo='unavailable';}} 13checkLocalStorage(){try{localStorage.setItem('test','test');localStorage.removeItem('test');return true;}catch(e){return false;}} 14checkSessionStorage(){try{sessionStorage.setItem('test','test');sessionStorage.removeItem('test');return true;}catch(e){return false;}} 15checkIndexedDB(){try{return!!window.indexedDB;}catch(e){return false;}} 16getWebGLInfo(){try{const canvas=document.createElement('canvas');const gl=canvas.getContext('webgl')||canvas.getContext('experimental-webgl');if(!gl)return'unavailable';return{version:gl.getParameter(gl.VERSION),shadingLanguageVersion:gl.getParameter(gl.SHADING_LANGUAGE_VERSION),maxTextureSize:gl.getParameter(gl.MAX_TEXTURE_SIZE),maxVertexAttribs:gl.getParameter(gl.MAX_VERTEX_ATTRIBS),maxViewportDims:gl.getParameter(gl.MAX_VIEWPORT_DIMS).join('x')};}catch(e){return'unavailable';}} 17getTouchSupport(){return{maxTouchPoints:navigator.maxTouchPoints||0,touchEvent:'ontouchstart'in window,touchPoints:'TouchEvent'in window};} 18getBehaviorScore(){const timeSpent=Date.now()-this.startTime;let keystrokeVariability=0;if(this.keystrokeTiming.length>1){const avg=this.keystrokeTiming.reduce((a,b)=>a+b,0)/this.keystrokeTiming.length;const variance=this.keystrokeTiming.reduce((acc,timing)=>acc+Math.pow(timing-avg,2),0)/this.keystrokeTiming.length;keystrokeVariability=Math.sqrt(variance);} 19let mouseMoveEntropy=0;if(this.mousePath.length>2){const distances=[];for(let i=1;i<this.mousePath.length;i++){const dx=this.mousePath[i].x-this.mousePath[i-1].x;const dy=this.mousePath[i].y-this.mousePath[i-1].y;distances.push(Math.sqrt(dx*dx+dy*dy));} 20const avgDistance=distances.reduce((a,b)=>a+b,0)/distances.length;mouseMoveEntropy=distances.filter(d=>d>avgDistance).length/distances.length;}
21const score={timeSpent:timeSpent,mouseMovements:this.mouseMovements,keystrokes:this.keystrokes,focusEvents:this.focusEvents,scrollEvents:this.scrollEvents,clickEvents:this.clickEvents,tabEvents:this.tabEvents,backspaceCount:this.backspaceCount,pasteEvents:this.pasteEvents,keystrokeVariability:Math.round(keystrokeVariability),mouseMoveEntropy:Math.round(mouseMoveEntropy*100)/100,deviceMotionEvents:this.deviceMotionEvents,fieldInteractions:Object.fromEntries(this.fieldInteractions),fingerprint:this.fingerprint};let humanScore=0;if(timeSpent>3000&&timeSpent<1800000)humanScore+=20;else if(timeSpent>1000)humanScore+=10;if(this.mouseMovements>20)humanScore+=20;else if(this.mouseMovements>5)humanScore+=10;if(mouseMoveEntropy>0.3)humanScore+=15;else if(mouseMoveEntropy>0.1)humanScore+=8;if(this.keystrokes>10)humanScore+=15;else if(this.keystrokes>3)humanScore+=8;if(keystrokeVariability>50)humanScore+=15;else if(keystrokeVariability>20)humanScore+=8;if(this.focusEvents>3)humanScore+=10;else if(this.focusEvents>1)humanScore+=5;if(this.clickEvents>2)humanScore+=10;else if(this.clickEvents>0)humanScore+=5;if(this.backspaceCount>0)humanScore+=8;if(this.pasteEvents>0&&this.pasteEvents<10)humanScore+=5;if(this.deviceMotionEvents>0)humanScore+=5;if(this.scrollEvents>0)humanScore+=5;score.humanScore=Math.min(humanScore,100);return score;} 22addProtectionToForm(formId){const form=document.getElementById(formId);if(!form)return;const protectionFields=[{name:'bot_protection_fingerprint',value:()=>this.fingerprint},{name:'bot_protection_behavior',value:()=>JSON.stringify(this.getBehaviorScore())},{name:'bot_protection_timestamp',value:()=>Date.now().toString()}];protectionFields.forEach(field=>{const input=document.createElement('input');input.type='hidden';input.name=field.name;input.value=field.value();form.appendChild(input);});this.addHoneypotFields(form);form.addEventListener('submit',(e)=>{protectionFields.forEach(field=>{const input=form.querySelector(`input[name="${field.name}"]`);if(input){input.value=field.value();}});});} 23addHoneypotFields(form){const honeypots=[{name:'website_url',type:'text',style:{position:'absolute',left:'-9999px',top:'-9999px',opacity:'0',pointerEvents:'none'},tabIndex:-1,ariaHidden:true},{name:'company_website',type:'email',style:{display:'none'},tabIndex:-1},{name:'phone_number',type:'tel',className:'time-trap',style:{position:'absolute',left:'-9999px',opacity:'0'},tabIndex:-1},{name:'confirm_email',type:'text',placeholder:'Leave this field empty',style:{position:'absolute',left:'-9999px',opacity:'0'},tabIndex:-1,ariaHidden:true},{name:'math_challenge',type:'hidden',value:''}];if(!document.getElementById('honeypot-styles')){const style=document.createElement('style');style.id='honeypot-styles';style.textContent=` 24 .time-trap { 25 animation: showHoneypot 0.1s ease-in-out 5s forwards; 26 } 27 @keyframes showHoneypot { 28 to { opacity: 1; left: 0; } 29 } 30 `;document.head.appendChild(style);} 31honeypots.forEach(config=>{const input=document.createElement('input');input.name=config.name;input.type=config.type;if(config.placeholder)input.placeholder=config.placeholder;if(config.value!==undefined)input.value=config.value;if(config.tabIndex)input.tabIndex=config.tabIndex;if(config.className)input.className=config.className;if(config.ariaHidden)input.setAttribute('aria-hidden','true');if(config.style){Object.assign(input.style,config.style);} 32form.appendChild(input);});setTimeout(()=>{const mathField=form.querySelector('input[name="math_challenge"]');if(mathField){const a=Math.floor(Math.random()*10)+1;const b=Math.floor(Math.random()*10)+1;mathField.value=(a+b).toString();mathField.dataset.expected=(a+b).toString();}},1000);}} 33document.addEventListener('DOMContentLoaded',function(){window.botProtection=new BotProtection();});;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.