PageSourceSearch

https://media.optibus.com/file/minifiles/js/b31c2665f47f2602.js

js optibus.com collected 2026-09-24 11:49:05 UTC 3,762 bytes, 25 lines download raw bytes

1(function(){'use strict';var SETTLE_MS=1500;var HEADER_CLEARANCE=140;function focusField(field){field.focus({preventScroll:!0});var rect=field.getBoundingClientRect();if(rect.top<HEADER_CLEARANCE||rect.bottom>window.innerHeight){var target=window.pageYOffset+rect.top-HEADER_CLEARANCE;window.scrollTo({top:Math.max(0,target),behavior:window.matchMedia('(prefers-reduced-motion: reduce)').matches?'auto':'smooth',})}}
2var errorIdSeq=0;function luminance(colour){var parts=(colour||'').match(/\d+/g);if(!parts||parts.length<3){return 0}
3var channels=parts.slice(0,3).map(function(value){var v=value/255;return v<=0.03928?v/12.92:Math.pow((v+0.055)/1.055,2.4)});return 0.2126*channels[0]+0.7152*channels[1]+0.0722*channels[2]}
4function markBackgroundBrightness(form){var node=form;var background='';while(node&&node!==document.documentElement){var candidate=window.getComputedStyle(node).backgroundColor;if(candidate&&'rgba(0, 0, 0, 0)'!==candidate&&'transparent'!==candidate){background=candidate;break}
5node=node.parentElement}
6if(!background){return}
7var isLight=luminance(background)>0.4;if(isLight!==form.classList.contains('ob-a11y-on-light')){form.classList.toggle('ob-a11y-on-light',isLight)}}
8function enhanceLegacyForm(form){var wrappers=form.querySelectorAll('.hs-form-field');for(var i=0;i<wrappers.length;i++){var wrapper=wrappers[i];var field=wrapper.querySelector('input, select, textarea');if(!field){continue}
9var list=wrapper.querySelector('.hs-error-msgs');if(!list){if(field.hasAttribute('aria-invalid')){field.removeAttribute('aria-invalid')}
10continue}
11if(!list.id){errorIdSeq+=1;list.id='ob-a11y-error-'+errorIdSeq}
12if('true'!==field.getAttribute('aria-invalid')){field.setAttribute('aria-invalid','true')}
13var describedBy=field.getAttribute('aria-describedby')||'';if(-1===describedBy.split(/\s+/).indexOf(list.id)){field.setAttribute('aria-describedby',describedBy?describedBy+' '+list.id:list.id)}}
14var rollup=form.querySelector('.hs_error_rollup');if(rollup&&!rollup.getAttribute('role')){rollup.setAttribute('role','alert');rollup.setAttribute('aria-live','polite')}}
15function firstInvalid(root){var candidates=root.querySelectorAll('[aria-invalid="true"]');for(var i=0;i<candidates.length;i++){var el=candidates[i];if(null!==el.offsetParent&&!el.disabled){return el}}
16return null}
17function watch(root){if(root.dataset.obA11yWatched){return}
18root.dataset.obA11yWatched='1';var pending=!1;var timer=null;function arm(){pending=!0;window.clearTimeout(timer);timer=window.setTimeout(function(){pending=!1},SETTLE_MS)}
19root.addEventListener('click',function(event){if(event.target.closest('button[type="submit"], input[type="submit"]')){arm()}},!0);root.addEventListener('submit',arm,!0);root.addEventListener('keydown',function(event){if('Enter'===event.key&&'TEXTAREA'!==event.target.tagName){arm()}},!0);var isLegacy=root.classList.contains('hs-form');var observer=new window.MutationObserver(function(){if(isLegacy){enhanceLegacyForm(root)}
20if(!pending){return}
21var field=firstInvalid(root);if(!field){return}
22pending=!1;window.clearTimeout(timer);focusField(field)});observer.observe(root,{childList:!0,subtree:!0,attributes:!0,attributeFilter:['aria-invalid','class'],});if(isLegacy){enhanceLegacyForm(root);markBackgroundBrightness(root)}}
23function init(){var SELECTOR=['[data-hsfc-id="Renderer"]','.hsfc-Form','form.hs-form','.gform_wrapper',].join(', ');function scan(){var roots=document.querySelectorAll(SELECTOR);for(var i=0;i<roots.length;i++){watch(roots[i])}}
24scan();new window.MutationObserver(scan).observe(document.body,{childList:!0,subtree:!0,});if(window.jQuery){window.jQuery(document).on('gform_post_render',scan)}}
25if('loading'===document.readyState){document.addEventListener('DOMContentLoaded',init)}else{init()}})()

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.