PageSourceSearch

https://www.allbirds.co.uk/cdn/shop/t/3608/assets/category-row.js

js allbirds.co.uk collected 2026-09-24 19:57:01 UTC 3,863 bytes, 1 lines download raw bytes

1import{g as n,a as d,e as I}from"./ScrollTrigger.js";import{c as F,o as P,a as b,r as p}from"./vue.esm-bundler.js";import{u as q}from"./use-viewport-size.js";import{B as k,A as s,a as h}from"./animations.js";import{i as D}from"./swiper.js";import{h as H}from"./analytics-data.js";import{B as G}from"./base-section.js";import"./swiper-core.js";import"./wunderkind-api.js";import"./validator.js";import"./cookies.js";import"./_commonjsHelpers.js";n.registerPlugin(d);const Y={breakpoints:{768:{enabled:!1,slidesOffsetAfter:0,slidesOffsetBefore:0,spaceBetween:0}},centeredSlides:!0,centeredSlidesBounds:!0,slidesPerView:1.4,spaceBetween:10},z=h.ELEMENT.HOVER.DELAY,C="category-row";class j extends G{constructor(){super(`[data-section-type="${C}"]`)}init(o){const t=o.container,u=this;if(!t){I("[Allbirds section] - Category Row - init - Container not found",{},new Error("Container not found"));return}this.setupInViewAnimation(o),F({name:"CategoryRowSection",setup(){let a=null;const i=p(null),f=p([]),l=p([]),c={},T=p(!1),{isDesktop:w,isSmall:O,isTouch:R}=q();let S=null;const N=()=>{a=D(t,{...Y,on:{slideChange:({activeIndex:e})=>{g(e)}}}),a||I("[Allbirds section] - Category Row - setupCarousel - Failed to initialize Swiper",{sectionId:t.id})},g=e=>{i.value!==null&&i.value!==e&&l.value[i.value]?.reverse(),l.value[e]?.play(),i.value=e},M=()=>{f.value.forEach((r,U)=>{if(!r)return;const v=r.querySelector(".category-row-item-hover-image"),A=r.querySelector(".category-row-item-title"),m=r.querySelector(".category-row-item-cta-buttons"),E=r.querySelector("[data-text-content]");if(!v||!A||!m||!E)return;n.set(v,{opacity:0}),n.set(m,{opacity:0}),n.set(E,{yPercent:30}),n.set(A,{opacity:0}),n.set(r,{borderRadius:k.DEFAULT});const _=n.timeline({defaults:{overwrite:"auto"},onComplete:()=>{m.querySelectorAll("a").forEach(y=>{y.style.pointerEvents="auto"})},onReverseComplete:()=>{m.querySelectorAll("a").forEach(y=>y.style.pointerEvents="none")},paused:!0});_.to(r,s.BORDER_RADIUS_PILL,0).to(v,s.FADE_IN_IMAGE,0).to(A,s.FADE_OUT_BORDER_OPACITY,0).to(E,s.MOVE_UP_IN_OUT,0).to(m,s.FADE_IN_CTA,0),l.value[U]=_});const e=t.querySelectorAll(".category-row-item-title");e.length&&n.to(e,{...s.STAGGERED_FADE_IN,onComplete:()=>{T.value=!0},scrollTrigger:{start:"top 75%",trigger:t}},0)},B=e=>{i.value!==null&&i.value!==e&&l.value[i.value]?.reverse(),c[e]=setTimeout(()=>{const r=l.value[e];r&&(r.play(),i.value=e)},z*1e3)},V=e=>{!R.value||w.value||O.value||!l.value[e]||i.value!==e&&g(e)},L=e=>{if(!T.value)return;c[e]&&(clearTimeout(c[e]),c[e]=null);const r=l.value[e];r&&(r.reverse(),i.value===e&&(i.value=null))};return P(()=>{N(),S=n.context(()=>{f.value=Array.from(t.querySelectorAll(".category-row-item")),M()},t),w.value||g(0),d.refresh(),u.isHomePageTemplate()&&H({sectionName:C})}),b(()=>{a?.destroy(),a=null,S?.revert(),Object.values(c).forEach(e=>clearTimeout(e))}),{activeItem:i,categoryItems:f,handleClick:V,handleMouseEnter:B,handleMouseLeave:L}}}).mount(t)}onUnload(o){const t=o.container.__vue_app__;o.animation&&o.animation.scrollTrigger&&o.animation.scrollTrigger.kill(),o.animation&&(o.animation.kill(),o.animation=null),t&&t.unmount()}setupInViewAnimation(o){if(o.animation)o.animation.paused(!1),d.refresh();else{const t=this.setupAnimation(o,()=>this.setupInViewAnimationTimeline(o));t&&t.scrollTrigger&&(o.scrollTrigger=t.scrollTrigger)}}setupInViewAnimationTimeline(o){const t=o.container;if(!t)return I("[Allbirds section] - Category Row - setupInViewAnimationTimeline - Missing elements for in-view animation",{},new Error("Missing elements for in-view animation")),null;const u=n.timeline({paused:!0,scrollTrigger:{...this.getInViewAnimationOptions(),start:"top 100%",trigger:t}});if(!u)return null;const a=this.isHomePageTemplate()?h.SECTION.FADE_IN:0;return u.to(t,s.FADE_IN,a),u}}document.addEventListener("DOMContentLoaded",()=>{new j});

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.