1var m=Object.defineProperty;var f=(h,a,t)=>a in h?m(h,a,{enumerable:!0,configurable:!0,writable:!0,value:t}):h[a]=t;var i=(h,a,t)=>f(h,typeof a!="symbol"?a+"":a,t);import{i as $}from"./component-manager.modern-D6dkbpDa.js";import{c as b}from"./focus-trap.esm-BcIBZGDc.js";import{g as c}from"./index-5B9hMlRm.js";import{$ as w}from"./scroll-B-NtrwPX.js";import{a as y}from"./screen-DnVIF3Jm.js";import{S as u}from"./Scroll-Oyywjts5.js";import{$ as g}from"./dom-D-2hUXOQ.js";import"./index-B_r9C59b.js";import"./animations-DiDraIfW.js";const d="/dist/sprite.svg#",T=.2,v={ease:"expo.out",duration:.6};class A extends HTMLElement{constructor(){super();i(this,"$tabs",[]);i(this,"$prevBtn",null);i(this,"$nextBtn",null);i(this,"$details",[]);i(this,"$brandTitles",[]);i(this,"$titleInner",null);i(this,"$counterInner",null);i(this,"$overview",null);i(this,"$viewAllBtn",null);i(this,"$brandSections",[]);i(this,"$brandLearnMoreContent",[]);i(this,"$brandLearnMoreBtn",[]);i(this,"learnMoreHandlers",[]);i(this,"detailFocusHandlers",[]);i(this,"current",1);i(this,"total",0);i(this,"isViewAllOpen",!1);i(this,"isInSection",!1);i(this,"programmaticTarget",null);i(this,"focusTrap",null);i(this,"tl",null);i(this,"unsubscribeScroll",null);i(this,"programmaticTimeout",0);i(this,"userScrollTimeout",0);i(this,"isUserScrolling",!1);i(this,"onProgressEnter",t=>{if(this.isViewAllOpen)return;const{progress:e}=t.detail,r=Math.round(e*(this.total-1))+1;if(e<=0||e>=1){this.isInSection=!1;return}if(this.isInSection=!0,this.programmaticTarget!==null){r===this.programmaticTarget&&(this.programmaticTarget=null);return}r!==this.current&&this.setCurrentIndex(r)});i(this,"onUserScroll",()=>{this.isUserScrolling=!0,clearTimeout(this.userScrollTimeout),this.userScrollTimeout=window.setTimeout(()=>{this.isUserScrolling=!1},150)});i(this,"onKeyDown",t=>{!this.isInSection||this.isViewAllOpen||(t.key==="ArrowDown"?this.current<this.total&&(t.preventDefault(),this.onNextClick()):t.key==="ArrowUp"&&this.current>1&&(t.preventDefault(),this.onPrevClick()))});i(this,"onViewAllClick",()=>{this.isViewAllOpen?this.closeOverview():this.openOverview()});i(this,"onLearnMoreClick",(t,e)=>{const r=this.$brandLearnMoreContent[e],n=t.currentTarget,s=!(n.getAttribute("aria-expanded")==="true");c.to(r,{height:s?"auto":0,...v}),n.setAttribute("aria-expanded",String(s));const l=n.querySelector('[data-brands="button-label"]');l&&(l.textContent=s?"Close":"Learn more"),n.querySelectorAll('[data-brands="button-icon"] use').forEach(p=>{p.setAttribute("href",s?`${d}minus`:`${d}plus`)})});i(this,"onTabClick",t=>{const e=t.currentTarget,r=Number(e.dataset.index);this.isViewAllOpen?this.closeOverview(()=>this.navigateTo(r)):this.navigateTo(r)});i(this,"onPrevClick",()=>{if(this.current<=1)return;const t=this.current-1;this.isViewAllOpen?this.closeOverview(()=>this.navigateTo(t)):this.navigateTo(t)});i(this,"onNextClick",()=>{if(this.current>=this.total)return;const t=this.current+1;this.isViewAllOpen?this.closeOverview(()=>this.navigateTo(t)):this.navigateTo(t)});this.$tabs=Array.from(this.querySelectorAll('[data-brands="tab"]')),this.$details=Array.from(this.querySelectorAll('[data-brands="detail"]')),this.$overview=this.querySelector('[data-brands="overview"]'),this.$viewAllBtn=this.querySelector('[data-brands="view-all"]'),this.$prevBtn=this.querySelector('[data-brands="previous"]'),this.$nextBtn=this.querySelector('[data-brands="next"]'),this.$titleInner=this.querySelector('[data-brands="current-title-inner"]'),this.$counterInner=this.querySelector('[data-brands="current-index-inner"]'),this.$brandTitles=Array.from(this.querySelectorAll('[data-brands="title"]')),this.$brandLearnMoreContent=Array.from(this.querySelectorAll('[data-brands="learn-more-content"]')),this.$brandLearnMoreBtn=Array.from(this.querySelectorAll('[data-brands="learn-more-btn"]')),this.$brandSections=Array.from(this.querySelectorAll('[data-brands="brand"]')),this.total=this.$brandSections.length,c.set(this.$details,{opacity:t=>t===0?1:0,pointerEvents:t=>t===0?"auto":"none"})}connectedCallback(){this.$overview&&(this.focusTrap=b(this.$overview,{clickOutsideDeactivates:t=>{var e;return t.target!==this.$viewAllBtn&&!((e=this.$viewAllBtn)!=null&&e.contains(t.target))},allowOutsideClick:!0,onDeactivate:()=>{this.isViewAllOpen&&this.closeOverview()}})),this.bindEvents(),this.setCurrentIndex(this.current)}disconnectedCallback(){var t;(t=this.focusTrap)==null||t.deactivate({returnFocus:!1}),g.classList.remove("brands-in-view"),clearTimeout(this.programmaticT
1imeout),clearTimeout(this.userScrollTimeout),this.unbindEvents()}bindEvents(){var t,e,r;window.addEventListener("brands:scrollProgress",this.onProgressEnter),document.addEventListener("keydown",this.onKeyDown),window.addEventListener("wheel",this.onUserScroll,{passive:!0}),window.addEventListener("touchmove",this.onUserScroll,{passive:!0}),(t=this.$prevBtn)==null||t.addEventListener("click",this.onPrevClick),(e=this.$nextBtn)==null||e.addEventListener("click",this.onNextClick),(r=this.$viewAllBtn)==null||r.addEventListener("click",this.onViewAllClick),this.$tabs.forEach(n=>n.addEventListener("click",this.onTabClick)),this.learnMoreHandlers=this.$brandLearnMoreBtn.map((n,o)=>{const s=l=>this.onLearnMoreClick(l,o);return n.addEventListener("click",s),s}),this.detailFocusHandlers=this.$details.map((n,o)=>{const s=()=>{const l=o+1;l!==this.current&&this.navigateTo(l)};return n.addEventListener("focusin",s),s}),this.unsubscribeScroll=w.listen(({scroll:n,velocity:o})=>{!this.isUserScrolling&&Math.abs(o)<T&&this.snapToNearestBrand(n)})}unbindEvents(){var t,e,r,n,o;window.removeEventListener("brands:scrollProgress",this.onProgressEnter),document.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("wheel",this.onUserScroll),window.removeEventListener("touchmove",this.onUserScroll),(t=this.$prevBtn)==null||t.removeEventListener("click",this.onPrevClick),(e=this.$nextBtn)==null||e.removeEventListener("click",this.onNextClick),(r=this.$viewAllBtn)==null||r.removeEventListener("click",this.onViewAllClick),this.$tabs.forEach(s=>s.removeEventListener("click",this.onTabClick)),this.$brandLearnMoreBtn.forEac
1h((s,l)=>{s.removeEventListener("click",this.learnMoreHandlers[l])}),this.$details.forEach((s,l)=>{s.removeEventListener("focusin",this.detailFocusHandlers[l])}),(n=this.tl)==null||n.kill(),(o=this.unsubscribeScroll)==null||o.call(this)}snapToNearestBrand(t){if(this.programmaticTarget!==null||!this.isInSection)return;const e=this.getBoundingClientRect(),r=t+e.top,n=r+this.offsetHeight-y.get().height/2;t<r||t>n||u.scrollTo(this.$brandSections[this.current-1],{force:!0})}setCurrentIndex(t){const e=t>this.current?1:-1;if(!this.isViewAllOpen){const o=this.$details[this.current-1],s=this.$details[t-1];c.killTweensOf([o,s]),c.timeline({defaults:v}).to(o,{opacity:0,pointerEvents:"none",yPercent:-20*e}).fromTo(s,{opacity:0,yPercent:20*e},{opacity:1,pointerEvents:"auto",yPercent:0},0)}this.current=t;const r=this.$brandTitles[t-1],n={ease:"expo.out",duration:.3};r&&this.$titleInner&&c.timeline({defaults:n}).to(this.$titleInner,{yPercent:-100*e,duration:.2}).call(()=>{this.$titleInner.textContent=r.textContent}).set(this.$titleInner,{yPercent:100*e}).to(this.$titleInner,{yPercent:0}),this.$counterInner&&c.timeline({defaults:n}).to(this.$counterInner,{yPercent:-100*e,duration:.2}).call(()=>{this.$counterInner.textContent=`${t}`}).set(this.$counterInner,{yPercent:100*e}).to(this.$counterInner,{yPercent:0}),this.$tabs.forEach((o,s)=>{o.setAttribute("aria-current",String(s===t-1))}),this.$prevBtn&&this.$prevBtn.toggleAttribute("disabled",t<=1),this.$nextBtn&&this.$nextBtn.toggleAttribute("disabled",t>=this.total)}navigateTo(t){this.programmaticTarget=t,this.setCurrentIndex(t),u.scrollTo(this.$brandSections[t-1],{force:!0}),clearTimeout(this.programmaticTimeout),this.programmaticTimeout=window.setTimeout(()=>{this.programmaticTarget=null},400)}openOverview(){var e;this.isViewAllOpen=!0,u.stop();const t=this.$details[this.current-1];this.tl&&((e=this.tl)==null||e.kill()),this.tl=c.timeline({defaults:v}),this.tl.to(t,{opacity:0,pointerEvents:"none",yPercent:20}).fromTo(this.$overview,{display:"none",opacity:0,yPercent:-10},{display:"flex",opacity:1,yPercent:0,onComplete:()=>{var r;(r=this.focusTrap)==null||r.activate()}}),this.updateViewAllBtn(!0)}closeOverview(t){var e,r;if(this.isViewAllOpen){if(this.isViewAllOpen=!1,u.start(),(e=this.tl)==null||e.kill(),this.tl=c.timeline({defaults:v}),t)this.tl.to(this.$overview,{opacity:0,yPercent:10}).set(this.$overview,{display:"none"}).call(t);else{const n=this.$details[this.current-1];this.tl.to(this.$overview,{opacity:0,yPercent:10}).set(this.$overview,{display:"none"}).fromTo(n,{opacity:0,yPercent:-20},{opacity:1,pointerEvents:"auto",yPercent:0})}this.updateViewAllBtn(!1),(r=this.focusTrap)!=null&&r.active&&this.focusTrap.deactivate({returnFocus:!1})}}updateViewAllBtn(t){var n,o,s;(n=this.$viewAllBtn)==null||n.setAttribute("aria-expanded",String(t));const e=(o=this.$viewAllBtn)==null?void 0:o.querySelector("span:last-child"),r=(s=this.$viewAllBtn)==null?void 0:s.querySelector("use");e&&(e.textContent=t?"Close":"View All"),r&&r.setAttribute("href",t?`${d}close-sm`:`${d}expand`)}}customElements.define("c-brands",$(A,"Brands"));
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.