1!function(e,t){"function"==typeof define&&define.amd?define(["exports"],t):"undefined"!=typeof exports?t(exports):(t(t={}),e.TabbedSection=t)}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:this,(function(e){"use strict";function o(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(i="Object"===i&&e.constructor?e.constructor.name:i)||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function r(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var t=function(){function i(e){var r=this,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"vertical";!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),this.el=e,this.direction=t,this.navigationItems=e.querySelectorAll('[role="tab"]'),this.activeNav=null,this.lastFocusedNav=null,this.bodies=e.querySelectorAll('[role="tabpanel"]'),this.activeBody=null,this.el.addEventListener("keydown",(function(e){if(!e.defaultPrevented&&Array.from(r.navigationItems).includes(document.activeElement)){var t=Array.from(r.bodies).indexOf(r.activeBody),i=null,n="vertical"===r.direction?"ArrowDown":"ArrowRight",o="vertical"===r.direction?"ArrowUp":"ArrowLeft";switch(e.code){case n:i=r.activeBody===r.bodies[r.bodies.length-1]?r.bodies[0]:r.bodies[t+1];break;case o:i=r.activeBody===r.bodies[0]?r.bodies[r.bodies.length-1]:r.bodies[t-1];break;case"Home":i=r.bodies[0];break;case"End":i=r.bodies[r.bodies.length-1]}i&&(e.preventDefault(),r.makeActive(i),Array.from(r.navigationItems).find((function(e){return null!==e.offsetParent&&Array.from(r.activeNav).includes(e)})).focus())}})),this.navigationItems.forEach((function(e){var t=r.getBody(e);e.addEventListener("click",(function(e){e.defaultPrevented||r.makeActive(t)}))})),e=o(this.bodies).find((function(e){return e.classList.contains("active")})),this.makeActive(e||this.bodies[0],!1)}var e,t;return e=i,(t=[{key:"makeActive",value:function(e){var i=this,t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],n=e!==this.activeBody,o=this.getNav(e);this.activeBody=e,this.activeNav=o,this.bodies.forEach((function(e){var t=i.activeBody===e;e.classList.toggle("active",t),i.getNav(e).forEach((function(e){e.classList.toggle("active",t),e.setAttribute("aria-selected",t),e.setAttribute("tabindex",t?0:-1)}))})),t&&window.requestAnimationFrame((function(){80<=i.activeBody.getBoundingClientRect().top||i.activeBody.scrollIntoView()})),n&&(o=new CustomEvent("tabbed-section.change",{detail:{body:e,navItems:o}}),this.el.dispatchEvent(o))}},{key:"bodyAndNavMatch",value:function(e,t){return e.id===t.getAttribute("aria-controls")}},{key:"getNav",value:function(t){var i=this;return Array.from(this.navigationItems).filter((function(e){return i.bodyAndNavMatch(t,e)}))}},{key:"getBody",value:function(t){var i=this;return Array.from(this.bodies).find((function(e){return i.bodyAndNavMatch(e,t)}))}}])&&r(e.prototype,t),i}();e.default=t,window.dispatchEvent(new CustomEvent("tabs.ready",{detail:{TabbedSection:t}}))})); 2//# sourceURL=https://cdn2.hubspot.net/hub/6850012/hub_generated/template_assets/98119834519/1693582812209/selerant-migration/horizon/assets/js/components/TabbedSection.js
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.