/* Terms stage: the accept checkbox unlocks only once the terms box has been * scrolled to the end (or immediately when the text fits without scrolling). */'use strict';(()=>{constbox=document.getElementById('terms-box');constaccept=document.getElementById('accept-box');consthint=document.getElementById('terms-hint');if(!box||!accept)return;functionunlock(){accept.disabled=false;if(hint)hint.hidden=true;box.removeEventListener('scroll',onScroll);}functionatEnd(){returnbox.scrollTop+box.clientHeight>=box.scrollHeight-4;}functiononScroll(){if(atEnd())unlock();}if(atEnd())unlock();// fits without scrollingelsebox.addEventListener('scroll',onScroll,{passive:true});})();