1document.addEventListener("DOMContentLoaded",function(){const t=document.querySelectorAll(".glossary-term");let e=null,n=null,s=!1,o=!1;function i(t){if(e){const n=e.dataset.termId===t.dataset.glossaryId;if(a(e),n)return}const n=t.dataset.glossaryId;n?fetch(`${glossaryData.restUrl}term/${n}`).then(t=>{if(!t.ok)throw new Error("Network response was not ok");return t.json()}).then(e=>{r(t,e)}).catch(e=>{console.error("Error loading glossary term:",e),r(t,{id:n,title:"Virhe",description:"<p>Selitteen lataaminen epäonnistui.</p>"})}):console.error("No glossary ID found")}function r(t,n){const i=document.createElement("div");i.className="glossary-tooltip",i.dataset.termId=n.id,i.setAttribute("role","tooltip"),i.setAttribute("aria-live","polite"),i.innerHTML=`\n <div class="glossary-tooltip-content">\n \n <div class="glossary-tooltip-description">${n.description}</div>\n </div>\n `,t.appendChild(i),t.setAttribute("aria-expanded","true"),e=i,function(t,e){const n=t.getBoundingClientRect(),s=t.getClientRects(),o=e.getBoundingClientRect();let i=t.offsetHeight+12,r=t.offsetWidth/2-o.width/2;if(s.length>1){const t=s[0],e=s[1];r=e.left-t.right-n.left-o.width,i=e.bottom-n.top+12}const a=window.innerWidth,d=n.left,l=d+r;l<10&&(r+=10-l);const c=d+r+o.width;c>a-10&&(r-=c-(a-10));n.bottom+12+o.height>window.innerHeight-10?(i=-(o.height+12),e.classList.add("tooltip-above")):e.classList.remove("tooltip-above"),e.style.top=`${i}px`,e.style.left=`${r}px`}(t,i),setTimeout(()=>i.classList.add("is-visible"),10),i.querySelectorAll("a").forEach(t=>{t.setAttribute("tabindex","0")}),i.addEventListener("mouseenter",()=>{o=!0}),i.addEventListener("mouseleave",()=>{o=!1,setTimeout(()=>{s||o||e!==i||a(i)},200)}),i.addEventListener("click",t=>{t.stopPropagation()}),i.addEventListener("keydown",e=>{if("Escape"===e.key&&(e.stopPropagation(),a(i),t.focus()),"Tab"===e.key){const n=i.querySelectorAll('a[href], button, [tabindex]:not([tabindex="-1"])'),s=n[0],o=n[n.length-1];e.shiftKey&&document.activeElement===s?(a(i),t.focus(),e.preventDefault()):e.shiftKey||document.activeElement!==o||a(i)}}),document.addEventListener("keydown",d)}function a(t){if(!t)return;const n=t.closest(".glossary-term");n&&n.setAttribute("aria-expanded","false"),t.classList.remove("is-visible"),setTimeout(()=>{t.parentNode&&t.remove(),e===t&&(e=null)},200),document.removeEventListener("keydown",d)}function d(t){if("Escape"===t.key&&e){const t=e.closest(".glossary-term");a(e),t&&t.focus()}}t.forEach(t=>{t.setAttribute("tabindex","0"),t.setAttribute("role","button"),t.setAttribute("aria-haspopup","true"),t.addEventListener("mouseenter",function(t){s=!0,n=setTimeout(()=>{s&&i(this)},300)}),t.addEventListener("mouseleave",function(t){s=!1,n&&(clearTimeout(n),n=null),setTimeout(()=>{s||o||!e||a(e)},200)}),t.addEventListener("focus",function(t){s||i(this)}),t.addEventListener("blur",function(t){const n=t.relatedTarget,s=n&&e&&e.contains(n),o=n&&n.classList.contains("glossary-term");s||o||setTimeout(()=>{e&&e.dataset.termId===this.dataset.glossaryId&&a(e)},100)}),t.addEventListener("keydown",function(t){if("Enter"===t.key||" "===t.key){if(e&&e.contains(document.activeElement))return;t.preventDefault(),e&&e.dataset.termId===this.dataset.glossaryId?a(e):i(this)}"Escape"===t.key&&e&&(a(e),this.focus())}),t.addEventListener("click",function(t){t.preventDefault()})}),document.addEventListener("click",function(t){if(!e)return;const n=e.contains(t.target),s=t.target.classList.contains("glossary-term")?t.target:t.target.closest(".glossary-term");n||s||a(e)})});
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.