1import{formatMoney,throttle,debounce}from"./theme.js";(()=>{"use strict";const onReady=fn=>document.readyState==="loading"?document.addEventListener("DOMContentLoaded",fn,{once:!0}):fn();function waitForElm(selector){return new Promise(resolve=>{const found=document.querySelector(selector);if(found)return resolve(found);const observer=new MutationObserver(()=>{const el=document.querySelector(selector);el&&(resolve(el),observer.disconnect())});observer.observe(document.body,{childList:!0,subtree:!0})})}function initSizeGuideAccordionAnchors(){const accordionIds=new Set(["arm-cuffs-sg","anklets-sg","bracelets-sg","rings-sg","chokers-sg","belts-sg"]);let observer,observerTimeout,openRetryTimer,scrollTimer;const getAnchoredAccordionId=()=>decodeURIComponent(window.location.hash.slice(1)),stopWatchingForAccordion=()=>{observer?.disconnect(),observer=void 0,clearTimeout(observerTimeout),observerTimeout=void 0},ensureAccordionIsOpen=(trigger,attempt=0)=>{const id=getAnchoredAccordionId();if(trigger.id!==id)return;const accordion=trigger.closest("[data-replo-collapsible]");if(accordion){if(accordion.dataset.state==="open"){scrollTimer=window.setTimeout(()=>{trigger.scrollIntoView({behavior:"smooth",block:"center"}),trigger.blur()},150);return}trigger.click(),attempt<40&&(openRetryTimer=window.setTimeout(()=>{ensureAccordionIsOpen(trigger,attempt+1)},250))}},openAccordionFromHash=()=>{stopWatchingForAccordion(),clearTimeout(openRetryTimer),clearTimeout(scrollTimer);const id=getAnchoredAccordionId();if(!accordionIds.has(id))return;const trigger=document.getElementById(id);if(!trigger){observer=new MutationObserver(openAccordionFromHash),observer.observe(document.documentElement,{childList:!0,subtree:!0}),observerTimeout=window.setTimeout(stopWatchingForAccordion,1e4);return}ensureAccordionIsOpen(trigger)};openAccordionFromHash(),window.addEventListener("hashchange",()=>openAccordionFromHash())}function initCartToast(){const toast=document.querySelector("cart-toast");if(!toast||toast.dataset.initialized==="true")return;toast.dataset.initialized="true";const image=toast.querySelector(".cart-toast__image"),productTitle=toast.querySelector(".cart-toast__product-title"),variant=toast.querySelector(".cart-toast__variant"),price=toast.querySelector(".cart-toast__price"),comparePrice=toast.querySelector(".cart-toast__compare-price");let dismissTimer,latestDisplayRequest=0;const compareAtPriceCache=new Map,currencyCode=window.Shopify?.currency?.active||"CAD",currencyCodePattern=new RegExp(`\\s*${currencyCode}\\b`,"gi"),formatPrice=amount=>formatMoney(amount,window.themeVariables.settings.moneyFormat).replace(currencyCodePattern,"").trim(),formatPriceWithCurrency=amount=>{const formattedPrice=formatMoney(amount,window.themeVariables.settings.moneyWithCurrencyFormat);return formattedPrice.toUpperCase().includes(currencyCode.toUpperCase())?formattedPrice:`${formattedPrice} ${currencyCode}`},setText=(element,value)=>{element.textContent=value||"",element.hidden=!value},getCompareAtPrice=async item=>{const directCompareAtPrice=Number(item.compare_at_price);if(Number.isFinite(directCompareAtPrice)&&directCompareAtPrice>0)return directCompareAtPrice;const handle=item.handle||item.product_handle,variantId=Number(item.variant_id||item.id);if(!handle||!Number.isFinite(variantId))return null;const cacheKey=`${handle}-${variantId}`;if(!compareAtPriceCache.has(cacheKey))try{const productVariant=(await fetch(`${Shopify.routes.root}products/${handle}.js`).then(response=>response.ok?response.json():null))?.variants?.find(variant2=>Number(variant2.id)===variantId);compareAtPriceCache.set(cacheKey,Number(productVariant?.compare_at_price)||null)}catch{compareAtPriceCache.set(cacheKey,null)}return compareAtPriceCache.get(cacheKey)},dismiss=()=>{clearTimeout(dismissTimer),toast.classList.remove("cart-toast--visible"),toast.classList.add("cart-toast--leaving"),window.setTimeout(()=>{toast.classList.contains("cart-toast--visible")||(toast.hidden=!0,toast.classList.remove("cart-toast--leaving"))},300)},show=async(item,requestId)=>{const itemImage=item.featured_image?.url||item.featured_image?.src||item.image||"",itemTitle=item.product_title||item.title||"",itemVariant=item.variant_title&&item.variant_title!=="Default Title"?item.variant_title:"",priceAmount=Number(item.final_price??item.price),comparePriceAmount=await getCompareAtPrice(item);if(requestId!==latestDisplayRequest)return;const showComparePrice=Number.isFinite(comparePriceAmount)&&comparePriceAmount>priceAmount;itemImage?image.src=itemImage:image.removeAttribute("src"),image.alt=itemTitle,image.hidden=!itemImage,setText(productTitle,itemTitle),setText(variant,itemVariant),setText(price,Number.isFinite(priceAmount)?showComparePrice?formatPrice(priceAmount):formatPriceWithCurrency(priceAmount):""),setText(comparePrice,showComparePrice?formatPriceWithCurrency(comparePriceAmount):""),toast.classList.toggle("cart-toast--on-sale",showComparePrice),clearTimeout(dismissTimer),toast.hidden=!1,toast.classList.remove("cart-toast--leaving","cart-toast--visible"),toast.offsetWidth,toast.classList.add("cart-toast--visible"),dismissT
1imer=window.setTimeout(dismiss,3e3)};document.addEventListener("variant:add",event=>{if(window.themeVariables.settings.cartType!=="message")return;const item=event.detail?.items?.[0];item&&show(item,++latestDisplayRequest)})}function getCookie(name){const matches=document.cookie.match(new RegExp("(?:^|; )"+name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return matches?decodeURIComponent(matches[1]):void 0}(function(){const name="nostojs";window[name]||(window[name]=function(cb){(window[name].q=window[name].q||[]).push(cb)})})(),(function(){const prefersMotion=()=>window.matchMedia("(prefers-reduced-motion: no-preference)").matches,waitForImage=image=>!image||image.complete?Promise.resolve():new Promise(resolve=>{image.addEventListener("load",resolve,{once:!0}),image.addEventListener("error",resolve,{once:!0})});class RevealableOverlay extends HTMLElement{connectedCallback(){if(this.getAttribute("reveal-on-scroll")!=="true"||!prefersMotion())return;const observer=new IntersectionObserver(entries=>{entries.forEach(entry=>{entry.isIntersecting&&(observer.unobserve(this),this.reveal())})},{threshold:.05});observer.observe(this)}async reveal(){const media=this.querySelector("picture img, svg, video-media, video"),content=this.querySelector(".content");await waitForImage(media),this.style.opacity="1",media?.animate({opacity:[0,1],transform:["scale(1.1)","scale(1)"]},{duration:800,easing:"cubic-bezier(0.215, 0.61, 0.355, 1)",fill:"both"}),content?.animate({opacity:[0,1]},{duration:800,easing:"ease",fill:"both"})}}class MediaWithTextOverlay extends RevealableOverlay{}class TwoColumnWithTextOverlay extends RevealableOverlay{}customElements.get("media-with-text-overlay")||customElements.define("media-with-text-overlay",MediaWithTextOverlay),customElements.get("two-column-with-text-overlay")||customElements.define("two-column-with-text-overlay",TwoColumnWithTextOverlay)})();function initCartNoteCharacterCounter(){const drawer=document.querySelector(".cart-drawer__order-note"),remaining=document.getElementById("remainingC"),updateCount=ta=>{if(!remaining||!ta)return;const len=(ta.value||"").length,left=Math.max(0,140-len);remaining.textContent=`${left} character${left===1?"":"s"} left`},wireTextarea=()=>{const ta=drawer&&drawer.querySelector('textarea[name="note"]')||document.querySelector('textarea[name="note"]');if(ta){if(!ta.__jbCountWired){ta.setAttribute("maxlength",String(140));const handler=debounce(()=>updateCount(ta),100);ta.addEventListener("input",handler),ta.addEventListener("change",handler),ta.__jbCountWired=!0,ta.__jbCountHandler=handler}updateCount(ta)}};drawer&&(drawer.addEventListener("dialog:after-show",wireTextarea),drawer.addEventListener("dialog:after-hide",async()=>{const giftNoteButton=document.querySelector(".gift-note-button");try{const cart=await(await fetch(`${Shopify?.routes?.root||"/"}cart.js`)).json();giftNoteButton&&(giftNoteButton.textContent=cart?.note?"Edit gift note":"Add gift note")}catch{}})),wireTextarea()}function initChatMenuNudges(){const applyPositions=()=>{const productStickyBar=document.querySelector(".product-sticky-bar"),chatMenu=document.querySelector(".chat-menu"),abraPopup=document.querySelector(".abra-popup");if(!chatMenu||!abraPopup)return;const cookieUnset=getCookie("_pandectes_gdpr")===void 0;productStickyBar?.classList.contains("is-visible")?window.innerWidth<778&&(chatMenu.style.bottom="80px",abraPopup.style.bottom="92px"):cookieUnset?window.innerWidth<778?(chatMenu.style.bottom="55px",abraPopup.style.bottom="72px"):(chatMenu.style.bottom="0px",abraPopup.style.bottom="67px"):(chatMenu.style.bottom="0px",abraPopup.style.bottom="12px")};window.addEventListener("scroll",throttle(applyPositions,150)),window.addEventListener("resize",throttle(applyPositions,150)),applyPositions(),document.addEventListener("click",e=>{const cn=e.target?.className||"",productStickyBar=document.querySelector(".product-sticky-bar"),chatMenu=document.querySelector(".chat-menu"),abraPopup=document.querySelector(".abra-popup");!chatMenu||!abraPopup||(cn==="cc-btn cc-btn-decision cc-allow"||cn==="pd-cp-btn pd-cp-ui-save")&&(productStickyBar&&productStickyBar.classList.contains("is-visible")||(chatMenu.style.bottom="0px",abraPopup.style.bottom="12px"))})}function initRelocateSizeGuide(){const sizeGuide=document.querySelector('.product-info__block-item[data-block-type="size-guide"]');if(!sizeGuide)return;const variantPicker=document.querySelector('.product-info__block-item[data-block-type="variant-picker"] .variant-picker .variant-picker__option'),productVariations=document.querySelector('.product-info__block-item[data-block-type="product-variations"]');variantPicker?variantPicker.querySelector(".variant-picker__option-info")?.append(sizeGuide):productVariations&&productVariations.querySelector(".variant-picker__option div.h-stack")?.append(sizeGuide)}function initCountrySelector(){let currentUrl=window.location.pathname+window.location.search;currentUrl==="/"&&(currentUrl=""),document.querySelectorAll(".country-selector")?.forEach(item=>{item.addEventListener("click",()=>{window.location.assign("https://jenny-bird.ca"+currentUrl)})})}function initMobileNavDropdowns(){const sidebar=document.getElementById("sidebar-menu");if(!sidebar)return;const mobileMedia=window.matchMedia("(max-width: 999px)"),primaryItems=sidebar.querySelectorAll(".header-sidebar__mobile-primary-item");
1primaryItems.forEach(item=>{item.__jbMobileNavBound||(item.addEventListener("toggle",()=>{!mobileMedia.matches||!item.open||primaryItems.forEach(otherItem=>{otherItem===item||!otherItem.open||(otherItem.open=!1,otherItem.querySelectorAll(".header-sidebar__mobile-secondary-item[open]").forEach(nestedItem=>{nestedItem.open=!1}))})}),item.__jbMobileNavBound=!0)})}function initMobileNavInstantReveal(){if(window.__jbMobileNavInstantRevealPatched)return;const HeaderSidebarElement=window.customElements?.get("header-sidebar");if(!HeaderSidebarElement?.prototype?.revealItems)return;const originalRevealItems=HeaderSidebarElement.prototype.revealItems;HeaderSidebarElement.prototype.revealItems=function(withDelay=!1){if(!window.matchMedia("(max-width: 999px)").matches)return originalRevealItems.call(this,withDelay);const mainPanel=this.querySelector(".header-sidebar__main-panel"),listItems=this.querySelectorAll(".header-sidebar__main-panel .header-sidebar__linklist li"),footer=this.querySelector(".header-sidebar__footer");return mainPanel&&(mainPanel.style.opacity="1",mainPanel.style.transform="translateX(0)"),listItems.forEach(item=>{item.style.opacity="1",item.style.transform="translateY(0)"}),footer&&(footer.style.opacity="1",footer.style.transform="translateY(0)"),Promise.resolve()},window.__jbMobileNavInstantRevealPatched=!0}function initDesktopSlideshowGestures(){const desktopMedia=window.matchMedia("(min-width: 1000px) and (pointer: fine)"),interactiveSelector='a, button, input, select, textarea, label, summary, [role="button"], [data-action]';document.querySelectorAll("slideshow-carousel.allow-desktop-gestures, slideshow-carousel.slideshow").forEach(carousel=>{if(carousel.__jbDesktopGesturesBound)return;carousel.__jbDesktopGesturesBound=!0;let dragState=null,suppressClick=!1;const moveByDirection=direction=>{!desktopMedia.matches||carousel.__jbGestureLocked||(carousel.__jbGestureLocked=!0,window.setTimeout(()=>{carousel.__jbGestureLocked=!1},450),direction==="next"?carousel.next():carousel.previous())};carousel.addEventListener("pointerdown",event=>{desktopMedia.matches&&(event.pointerType&&event.pointerType!=="mouse"||event.button===0&&(event.target.closest(interactiveSelector)||(dragState={startX:event.clientX,startY:event.clientY,moved:!1},carousel.classList.add("is-pointer-down"),carousel.style.cursor="grabbing")))});const handlePointerMove=event=>{if(!dragState)return;const dx=event.clientX-dragState.startX,dy=event.clientY-dragState.startY;(Math.abs(dx)>8||Math.abs(dy)>8)&&(dragState.moved=!0)},endPointerGesture=event=>{if(!dragState)return;const dx=event.clientX-dragState.startX,dy=event.clientY-dragState.startY;dragState.moved&&Math.abs(dx)>45&&Math.abs(dx)>Math.abs(dy)&&(suppressClick=!0,moveByDirection(dx<0?"next":"previous"),window.setTimeout(()=>{suppressClick=!1},250)),dragState=null,carousel.classList.remove("is-pointer-down"),carousel.style.removeProperty("cursor")};window.addEventListener("pointermove",handlePointerMove),window.addEventListener("pointerup",endPointerGesture),window.addEventListener("pointercancel",endPointerGesture),carousel.addEventListener("click",event=>{suppressClick&&(event.preventDefault(),event.stopPropagation())},!0)})}function initSlideClickThroughLinks(){if(document.documentElement.__jbSlideClickLinksBound)return;document.documentElement.__jbSlideClickLinksBound=!0;const interactiveSelector='a, button, input, select, textarea, summary, label, [role="button"], [data-action]';let pointerState=null,clickIntent=null;document.addEventListener("pointerdown",event=>{const slide=event.target.closest(".slideshow__slide[data-slide-link]");slide&&(event.target.closest(interactiveSelector)||(pointerState={pointerId:event.pointerId,slide,startX:event.clientX,startY:event.clientY,moved:!1},clickIntent={pointerId:event.pointerId,slide,moved:!1,startedAt:Date.now()}))},!0),document.addEventListener("pointermove",event=>{pointerState&&event.pointerId===pointerState.pointerId&&(Math.abs(event.clientX-pointerState.startX)>8||Math.abs(event.clientY-pointerState.startY)>8)&&(pointerState.moved=!0,clickIntent&&clickIntent.pointerId===event.pointerId&&(clickIntent.moved=!0))},!0),document.addEventListener("pointerup",event=>{pointerState&&event.pointerId===pointerState.pointerId&&(pointerState=null)},!0),document.addEventListener("pointercancel",event=>{clickIntent&&clickIntent.pointerId===event.pointerId&&(clickIntent.moved=!0),pointerState=null},!0),document.addEventListener("click",event=>{if(event.defaultPrevented)return;
1const slide=event.target.closest(".slideshow__slide[data-slide-link]");if(!slide||event.target.closest(interactiveSelector)||!clickIntent||clickIntent.slide!==slide||clickIntent.moved||Date.now()-clickIntent.startedAt>1200)return;const href=slide.getAttribute("data-slide-link");href&&(clickIntent=null,window.location.assign(href))}),document.addEventListener("pointerdown",event=>{event.target.closest(".slideshow__slide[data-slide-link]")||(clickIntent=null)},!0)}function initStickyHeaderSolidFallback(){const header=document.querySelector("x-header.header");if(!header||header.__jbSolidFallbackBound||window.CSS?.supports?.("selector(:has(.foo))")&&document.querySelector(":has(.shopify-section:first-child [allow-transparent-header]):not(:has(.shopify-section--header + .shopify-section-group-header-group))"))return;header.__jbSolidFallbackBound=!0;const getOffset=()=>{const previousSibling=header.closest(".shopify-section")?.previousElementSibling;if(previousSibling?.classList.contains("shopify-section--announcement-bar")){const computedStyles=getComputedStyle(document.documentElement);return parseInt(computedStyles.getPropertyValue("--announcement-bar-is-sticky")||"0",10)===1?10:previousSibling.clientHeight}return 10},syncSolidState=throttle(()=>{header.classList.toggle("is-solid",window.scrollY>getOffset())},50);window.addEventListener("scroll",syncSolidState,{passive:!0}),window.addEventListener("resize",syncSolidState),syncSolidState()}function initReloadCartForNosto(){document.addEventListener("cart:change",()=>{const Nosto=window.Nosto;Nosto?.reloadCart&&Nosto.reloadCart()})}function initHidePerfectPairingIfEmpty(){!document.getElementById("productpage-nosto-4")||!window.nostojs||window.nostojs(api=>{api.listen("postrender",event=>{event?.filledElements?.includes("productpage-nosto-4")})})}function initKlaviyoATCEvent(){document.addEventListener("variant:add",event=>{const items=event?.detail?.items||[];if(!items.length)return;const i0=items[0],item={Name:i0.title,ProductID:i0.product_id,Categories:i0.product_type,ImageURL:i0.image,URL:"https://jenny-bird.com"+i0.url,Brand:i0.vendor,Price:formatMoney(i0.final_price)};window.klaviyo?.push?.(["track","Added to Cart",item])})}function initOnlineStoreCartAttribute(){fetch(`${Shopify?.routes?.root||"/"}cart.js`).then(response=>response.ok?response.json():null).then(cart=>{if(!(!cart||cart.attributes?.channel==="online-store"))return fetch(`${Shopify?.routes?.root||"/"}cart/update.js`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attributes:{channel:"online-store"}})})}).catch(()=>{})}function initProductCardImageToggles(){const offBtn=document.getElementById("off-fig-toggle"),onBtn=document.getElementById("on-fig-toggle"),primaryMedia=document.getElementsByClassName("product-card__image--primary"),productCards=document.getElementsByClassName("product-card");if(!onBtn||!offBtn||!primaryMedia.length)return;onBtn.disabled=!0,onBtn.classList.add("is-active"),onBtn.firstElementChild&&(onBtn.firstElementChild.src=primaryMedia[0].src),primaryMedia[0].nextElementSibling?offBtn.firstElementChild&&(offBtn.firstElementChild.src=primaryMedia[0].nextElementSibling.src):offBtn.firstElementChild&&(offBtn.firstElementChild.src=primaryMedia[0].src);const saveScrollPosition=cards=>{const currentPageEl=document.querySelector(".pagination [aria-current=page]");
1Array.from(cards).forEach(card=>{card.addEventListener("click",()=>{localStorage.setItem("historyPositionX",String(window.scrollY)),currentPageEl&&localStorage.setItem("historyPositionPage",parseInt(currentPageEl.textContent.trim(),10))})})},swapImages=(cards,offButton)=>{Array.from(cards).forEach(productCard=>{const badges=productCard.querySelectorAll(".badge-list"),primaryImage=productCard.querySelector(".product-card__image--primary");primaryImage&&(offButton?.disabled===!0&&primaryImage.nextElementSibling?(primaryImage.classList.replace("product-card__image--primary","product-card__image--secondary"),primaryImage.nextElementSibling.classList.replace("product-card__image--secondary","product-card__image--primary"),badges?.forEach(b=>b.style.display="none")):offButton?.disabled===!1&&primaryImage.previousElementSibling&&(primaryImage.classList.replace("product-card__image--primary","product-card__image--secondary"),primaryImage.previousElementSibling.classList.replace("product-card__image--secondary","product-card__image--primary"),badges?.forEach(b=>b.style.display="flex")),productCard.addEventListener("mouseenter",()=>{badges?.forEach(badge=>{badge.style.display==="none"&&offButton?.disabled===!0?badge.style.display="flex":badge.style.display==="flex"&&offButton?.disabled===!1&&(badge.style.display="none")})}),productCard.addEventListener("mouseleave",()=>{badges?.forEach(badge=>{badge.style.display==="flex"&&offButton?.disabled===!0?badge.style.display="none":badge.style.display==="none"&&offButton?.disabled===!1&&(badge.style.display="flex")})}))})};saveScrollPosition(productCards),offBtn.addEventListener("click",()=>{offBtn.disabled=!0,onBtn.disabled=!1,offBtn.classList.add("is-active"),onBtn.classList.remove("is-active"),swapImages(productCards,offBtn)}),onBtn.addEventListener("click",()=>{onBtn.disabled=!0,offBtn.disabled=!1,onBtn.classList.add("is-active"),offBtn.classList.remove("is-active"),swapImages(productCards,offBtn)}),document.addEventListener("facet:update",()=>{setTimeout(initProductCardImageToggles,2e3)})}(function(){const KEY="collection:returnTarget";try{"scrollRestoration"in history&&(history.scrollRestoration="manual")}catch{}["pointerdown","click"].forEach(evt=>{document.addEventListener(evt,e=>{const a=e.target.closest?.('a[href*="/products/"]');if(a)try{const m=new URL(a.href,location.origin).pathname.match(/\/products\/([^\/?#]+)/);m&&sessionStorage.setItem(KEY,JSON.stringify({handle:decodeURIComponent(m[1]),ts:Date.now()}))}catch{}},{capture:!0})})})();function initCollectionInfiniteAndRestore(){if(document.documentElement.__jbInfiniteRestoreWired)return;document.documentElement.__jbInfiniteRestoreWired=!0;const RESTORE_KEY="collection:returnTarget",esc=window.CSS&&CSS.escape?CSS.escape:s=>String(s).replace(/["\\]/g,"\\$&");function findCardByHandle(handle){if(!handle)return null;let link=document.querySelector(`a[href*="/products/${esc(handle)}"]`);return link?link.closest("product-card, .product-card"):document.querySelector(`product-card[handle="${esc(handle)}"], .product-card[handle="${esc(handle)}"]`)||null}function getHeaderOffset(){return(document.querySelector("x-header")?.offsetHeight||0)+(document.querySelector(".shopify-section--announcement-bar")?.offsetHeight||0)}function scrollToCard(card){const top=card.getBoundingClientRect().top+window.pageYOffset-getHeaderOffset()-8;window.scrollTo({top,left:0,behavior:"auto"})}function extractNextHrefFromHTML(html){try{return new DOMParser().parseFromString(html,"text/html").querySelector(".pagination [aria-current=page] + a")?.href||null}catch{return null}}function extractProductListHTML(html){const start=html.indexOf("<product-list");if(start>=0){let inner=html.substring(start);const end=inner.indexOf('<div class="load-more');return end>=0?inner.substring(0,end):inner}const list=new DOMParser().parseFromString(html,"text/html").querySelector("product-list");return list?list.outerHTML:""}const waitForElmLocal=sel=>new Promise(resolve=>{if(document.querySelector(sel))return resolve(!0);const mo=new MutationObserver(()=>{document.querySelector(sel)&&(mo.disconnect(),resolve(!0))});mo.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>{mo.disconnect(),resolve(!1)},8e3)});
1function swapImages(cards,offButton){Array.from(cards).forEach(productCard=>{const badges=productCard.querySelectorAll(".badge-list"),primaryImage=productCard.querySelector(".product-card__image--primary");primaryImage&&(offButton?.disabled===!0&&primaryImage.nextElementSibling?(primaryImage.classList.replace("product-card__image--primary","product-card__image--secondary"),primaryImage.nextElementSibling.classList.replace("product-card__image--secondary","product-card__image--primary"),badges?.forEach(b=>b.style.display="none")):offButton?.disabled===!1&&primaryImage.previousElementSibling&&(primaryImage.classList.replace("product-card__image--primary","product-card__image--secondary"),primaryImage.previousElementSibling.classList.replace("product-card__image--secondary","product-card__image--primary"),badges?.forEach(b=>b.style.display="flex")))})}let nextHref=document.querySelector(".pagination [aria-current=page] + a")?.href||null;const loadMoreBtn=document.querySelector(".load-more"),offBtn=document.getElementById("off-fig-toggle"),reduceData=window.matchMedia&&window.matchMedia("(prefers-reduced-data: reduce)").matches,hasPagination=!!(nextHref&&loadMoreBtn);let restorePayload=null;try{restorePayload=JSON.parse(sessionStorage.getItem(RESTORE_KEY)||"null")}catch{}const enableChrome=()=>document.documentElement.classList.add("infinite-enabled"),disableChrome=()=>document.documentElement.classList.remove("infinite-enabled");if(hasPagination){let loadNextPage=function(){return isLoading||!nextHref?Promise.resolve(!1):(isLoading=!0,loadMoreBtn.classList.add("is-loading"),fetch(nextHref).then(res=>res.text()).then(html=>{nextHref=extractNextHrefFromHTML(html);const newListEl=new DOMParser().parseFromString(html,"text/html").querySelector("product-list, .product-list, #ProductGridContainer product-list");if(newListEl){const liveList=document.querySelector("product-list, .product-list, #ProductGridContainer product-list");liveList&&(newListEl.querySelectorAll(".product-card, product-card").forEach(card=>{if(card.hasAttribute("data-disruptor"))return;const clone=card.cloneNode(!0);liveList.appendChild(clone)}),swapImages(liveList.querySelectorAll(".product-card, product-card"),offBtn))}return document.querySelector(".pagination")?.remove(),loadMoreBtn.classList.remove("is-loading"),isLoading=!1,nextHref||(io&&io.disconnect(),sentinel.remove(),loadMoreBtn.remove()),!0}).catch(err=>(console.warn("Load more failed.",err),loadMoreBtn.classList.remove("is-loading"),isLoading=!1,disableChrome(),!1)))}
1,isLoading=!1,io=null,sentinel=document.querySelector(".infinite-sentinel");sentinel||(sentinel=document.createElement("div"),sentinel.className="infinite-sentinel",sentinel.setAttribute("aria-hidden","true"),loadMoreBtn.parentNode.insertBefore(sentinel,loadMoreBtn));async function maybeRestoreToTarget(){if(!restorePayload?.handle)return;io&&io.disconnect();let tries=0;const MAX_TRIES=20;for(;tries<=MAX_TRIES;){const card=findCardByHandle(restorePayload.handle);if(card){requestAnimationFrame(()=>{scrollToCard(card),sessionStorage.removeItem(RESTORE_KEY),sentinel.isConnected&&nextHref&&io.observe(sentinel)});return}if(!nextHref||!await loadNextPage())break;tries++}sentinel.isConnected&&nextHref&&io.observe(sentinel)}loadMoreBtn.__jbClickBound||(loadMoreBtn.addEventListener("click",()=>{loadNextPage()}),loadMoreBtn.__jbClickBound=!0),"IntersectionObserver"in window&&!reduceData?(io=new IntersectionObserver(entries=>{entries.forEach(entry=>{entry.isIntersecting&&loadNextPage()})},{root:null,rootMargin:"800px 0px",threshold:0}),io.observe(sentinel),enableChrome()):disableChrome(),restorePayload?.handle&&setTimeout(maybeRestoreToTarget,0),document.addEventListener("facet:update",()=>{document.documentElement.__jbInfiniteRestoreWired=!1,setTimeout(initCollectionInfiniteAndRestore,2e3)}),window.addEventListener("pageshow",evt=>{evt.persisted&&restorePayload?.handle&&setTimeout(maybeRestoreToTarget,0)});return}(async()=>{if(!restorePayload?.handle)return;await(typeof window.waitForElm=="function"?window.waitForElm:waitForElmLocal)("product-card, .product-card, product-list, .product-grid, #ProductGridContainer");let card=findCardByHandle(restorePayload.handle);if(card){requestAnimationFrame(()=>{scrollToCard(card),sessionStorage.removeItem(RESTORE_KEY)});return}const mo=new MutationObserver(()=>{card=findCardByHandle(restorePayload.handle),card&&(mo.disconnect(),requestAnimationFrame(()=>{scrollToCard(card),sessionStorage.removeItem(RESTORE_KEY)}))});mo.observe(document.body,{childList:!0,subtree:!0}),setTimeout(()=>mo.disconnect(),8e3)})()}function initReloadNostoDisruptorsOnGiftGuide(){document.addEventListener("facet:update",evt=>{let path="";const raw=evt?.detail?.url;try{path=raw?new URL(raw,location.origin).pathname:""}catch{path=""}path.includes("gift")&&setTimeout(()=>{window.nostojs&&window.nostojs(api=>{try{api.defaultSession().setResponseMode("HTML").viewCategory(document.querySelector(".nosto_category > .category_string")?.textContent.trim()||"").setPlacements(["giftguidedisruptor-nosto-1","giftguidedisruptor-nosto-2","giftcarddisruptor-nosto-1"]).update().then(response=>api.placements.injectCampaigns(response.recommendations))}catch{}})},1e3)})}function initAutoplayPauseVideosByView(){const SELECTOR=".product-gallery__media video",WIRED=new WeakSet,observer=new IntersectionObserver(entries=>{entries.forEach(({target:video,isIntersecting,intersectionRatio})=>{isIntersecting&&intersectionRatio>=.2?video.play().catch(()=>{}):video.pause()})},{threshold:[0,.2,.5,1]});function wire(video){!video||WIRED.has(video)||(WIRED.add(video),video.muted=!0,video.setAttribute("playsinline",""),video.parentElement&&video.parentElement.setAttribute("loaded",""),observer.observe(video),video.play().catch(()=>{}))}function scan(){document.querySelectorAll(SELECTOR).forEach(wire)}scan(),document.addEventListener("shopify:section:load",scan),document.addEventListener("variant:change",()=>setTimeout(scan,0)),new MutationObserver(()=>scan()).observe(document.documentElement,{childList:!0,subtree:!0})}function initVariantChangeUI(){document.addEventListener("variant:change",event=>{const form=event?.target,variant=event?.detail?.variant;if(!form||!variant)return;const submitBtn=form.querySelector('button[type="submit"]'),atc=form.querySelector(".buy-buttons button.w-full"),klaviyoBis=form.querySelector(".klaviyo-bis-trigger");atc?.disabled&&klaviyoBis&&setTimeout(()=>{atc&&(atc.style.display="none")},500),window.themeVariables?.settings?.showInventoryRemaining&&submitBtn&&(variant.available&&variant.inventory_policy==="deny"&&(variant.product?.handle==="portia-convertible-belt-gold"||variant.product?.handle==="portia-convertible-belt-silver")||variant.available&&variant.inventory_quantity<36&&variant.inventory_policy==="deny"&&(submitBtn.innerHTML="Add to bag - Final Few"))})}function initResponsiveVideoWithMutePersistence(){const mq=window.matchMedia("(max-width: 999px)"),KEY=sectionId=>`videoMute:${sectionId}`;function getSectionId(node){const wrap=node.closest?.('[id^="shopify-section"]')||node.closest?.(".shopify-section--video");return wrap&&(wrap.id||wrap.dataset.sectionId||wrap.getAttribute("data-section-id"))||""}function getPref(sectionId){try{const v=localStorage.getItem(KEY(sectionId));return v===null?null:v==="true"}catch{return null}}function setPref(sectionId,mutedBool){try{localStorage.setItem(KEY(sectionId),String(!!mutedBool))}catch{}}function primeVideo(video){if(video.__primed)return;const mobile=video.querySelector("source.mobile_source"),desktop=video.querySelector("source.desktop_source");!mobile||!desktop||(mobile.dataset.src||(mobile.dataset.src=mobile.getAttribute("src")||""),desktop.dataset.src||(desktop.dataset.src=desktop.getAttribute("src")||""),mobile.removeAttribute("src"),desktop.removeAttribute("src"),video.__primed=!0)}function applyMutePreference(video){const sectionId=getSectionId(video),pref=getPref(sectionId),desired=pref!==null?pref:video.autoplay||video.hasAttribute("autoplay");video.muted=!!desired,video.setAttribute("playsinline","")}function updateOneVideo(video){const isMobile=mq.matches,mobile=video.querySelector("source.mobile_source"),desktop=video.querySelector("source.desktop_source");if(!mobile||!desktop)return;const wantSrc=isMobile?mobile.dataset.src:desktop.dataset.src,currentSourceEl=isMobile?mobile:desktop,otherSourceEl=isMobile?desktop:mobile,currentHas=currentSourceEl.getAttribute("src")===wantSrc,otherHas=otherSourceEl.hasAttribute("src");if(currentHas&&!otherHas){applyMutePreference(video),(video.autoplay||video.hasAttribute("autoplay"))&&video.play().catch(()=>{});return}
1try{video.pause(),currentSourceEl.setAttribute("src",wantSrc||""),otherSourceEl.removeAttribute("src"),video.load(),applyMutePreference(video),(video.autoplay||video.hasAttribute("autoplay"))&&video.play().catch(()=>{})}catch{}}function wireMuteButtons(){document.querySelectorAll(".shopify-section--video").forEach(section=>{const video=section.querySelector("video.section-video"),btn=section.querySelector(".mute_video_button");if(!video||!btn||btn.__wired)return;const sectionId=getSectionId(section),onIcon=btn.querySelector(".icon-sound_on"),offIcon=btn.querySelector(".icon-sound_off"),initialPref=getPref(sectionId);initialPref!==null&&(video.muted=initialPref);const reflect=()=>{video.muted?(onIcon&&onIcon.classList.add("hidden"),offIcon&&offIcon.classList.remove("hidden")):(onIcon&&onIcon.classList.remove("hidden"),offIcon&&offIcon.classList.add("hidden"))};btn.addEventListener("click",()=>{video.muted=!video.muted,setPref(sectionId,video.muted),reflect(),!video.muted&&video.paused&&video.play().catch(()=>{})}),video.addEventListener("volumechange",()=>{setPref(sectionId,video.muted),reflect()}),reflect(),btn.__wired=!0})}function updateAll(){document.querySelectorAll("video.section-video").forEach(v=>{primeVideo(v),updateOneVideo(v)}),wireMuteButtons()}updateAll(),mq.addEventListener?mq.addEventListener("change",updateAll):mq.addListener&&mq.addListener(updateAll);let t;window.addEventListener("resize",()=>{clearTimeout(t),t=setTimeout(updateAll,150)}),document.addEventListener("shopify:section:load",updateAll),document.addEventListener("variant:change",()=>setTimeout(updateAll,0))}function initCollectionVideoDisruptorMute(){document.querySelectorAll(".collection-video-disruptor-toggle").forEach(toggle=>{if(toggle.__wired)return;const video=toggle.querySelector("video.collection-video-disruptor");if(!video)return;const mutedIcon=toggle.querySelector(".collection-video-disruptor-toggle__icon-muted"),unmutedIcon=toggle.querySelector(".collection-video-disruptor-toggle__icon-unmuted"),reflect=()=>{video.muted?(mutedIcon&&(mutedIcon.hidden=!1),unmutedIcon&&(unmutedIcon.hidden=!0),toggle.setAttribute("aria-label","Unmute video")):(mutedIcon&&(mutedIcon.hidden=!0),unmutedIcon&&(unmutedIcon.hidden=!1),toggle.setAttribute("aria-label","Mute video"))};toggle.addEventListener("click",()=>{video.muted=!video.muted,reflect(),!video.muted&&video.paused&&video.play().catch(()=>{})}),video.addEventListener("volumechange",reflect),reflect(),toggle.__wired=!0})}function initKlaviyoLeadEvent(){window.addEventListener("klaviyoForms",e=>{e?.detail?.type==="submit"&&typeof fbq=="function"&&fbq("track","Lead")})}function initAbraCartRefresh(){window.addEventListener("abra:cart:changed",()=>{document.documentElement.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0}))})}function initMiscClickTracking(){document.addEventListener("click",e=>{(e.target?.className||"")==="auglio-tryon-btn auglio-tryon-btn-product"?window.dataLayer?.push?.({event:"virtual_tryon_click"}):e.target?.id==="auglio-jennybird-buy-button"&&window.dataLayer?.push?.({event:"virtual_add_to_cart"})})}function jbInitStickyHeader(){function init(){const header=document.querySelector("x-header");if(!header||header.__jbEnhanced)return;header.__jbEnhanced=!0;const attrT=parseInt(header.getAttribute("data-solid-threshold")||"0",10),cssVar=getComputedStyle(header).getPropertyValue("--header-solid-threshold").trim(),threshold=attrT||(cssVar?parseInt(cssVar,10):0)||50;if(header.hasAttribute("data-jb-always-solid")){header.toggleAttribute("data-jb-solid",!0);return}const headerSection=header.closest(".shopify-section--header"),prev=headerSection&&headerSection.previousElementSibling,hasAnnounce=!!prev&&prev.classList.contains("shopify-section--announcement-bar"),sOn=document.createElement("div"),sOff=document.createElement("div");sOn.setAttribute("data-jb-sentinel-on",""),sOff.setAttribute("data-jb-sentinel-off",""),[sOn,sOff].forEach(el=>{Object.assign(el.style,{display:"block",height:"1px",marginTop:"-1px",pointerEvents:"none"}),document.body.insertBefore(el,document.body.firstChild)});const placeSentinels=()=>{const base=(hasAnnounce&&prev.offsetHeight||0)+threshold;sOn.style.transform=`translateY(${base+24}px)`,sOff.style.transform=`translateY(${Math.max(0,base-24)}px)`},setSolid=v=>header.toggleAttribute("data-jb-solid",!!v),io=new IntersectionObserver(entries=>{let solid=header.hasAttribute("data-jb-solid");for(const e of entries)e.target===sOn&&e.isIntersecting===!1&&(solid=!0),e.target===sOff&&e.isIntersecting===!0&&(solid=!1);setSolid(solid)},{root:null,threshold:0});io.observe(sOn),io.observe(sOff),placeSentinels();const base0=(hasAnnounce&&prev.offsetHeight||0)+threshold,y0=Math.max(0,window.scrollY||0);setSolid(y0>base0+24);let lastVW=window.innerWidth;if(window.addEventListener("resize",()=>{const vw=window.innerWidth;vw!==lastVW&&(lastVW=vw,placeSentinels())},{passive:!0}),window.addEventListener("orientationchange",()=>setTimeout(placeSentinels,0),{passive:!0}),"ResizeObserver"in window&&hasAnnounce){const ro=new ResizeObserver(placeSentinels);ro.observe(prev),header.__jbRO=ro}}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",init,{once:!0}):init()}function initOkendoPlacement(){if(!(document.body.classList.contains("template-product")||/\/products\//.test(location.pathname)))return;var THRESHOLD=30,SELECTORS={topStar:'div[id*="okendo_star_rating_KfM49m"]',topSummary:'div[id*="okendo_reviews_summary_nTnjdP"]',defaultStar:'div[id*="okendo_star_rating_adK6bm"]'};function cssFor(count){let css="";return count>=THRESHOLD?css+=` 2 .okeReviews[data-oke-container] .oke-reviewsSummary-heading, div.okeReviews .oke-reviewsSummary-heading{display:none !important;} 3 [data-oke-reviews-summary] .okeReviews[data-oke-container] .oke-reviewsSummary{text-align:left;} 4 [data-oke-star-rating]{margin-block-end:12px;} 5 .okeReviews[data-oke-container] .oke-bodyText, div.okeReviews .oke-bodyText{font-family:"Avenir Light";} 6 [data-oke-reviews-summary] .okeReviews[data-oke-container] .oke-reviewsSummary-readMore{font-family:"Avenir Light"; text-align:left;} 7 .okeReviews.oke-sr{text-align:left;} 8 ${SELECTORS.defaultStar}{display:none !important;}`:css+=` 9 ${SELECTORS.topStar}, 10 ${SELECTORS.topSummary}{display:none !important;} 11 [data-oke-star-rating]{margin-block-end:0 !important;}`,css}function apply(){const count=Number(window.__OKENDO_REVIEW_COUNT||0),STYLE_ID="okendo-placement-style";let tag=document.getElementById(STYLE_ID);tag||(tag=document.createElement("style"),tag.id=STYLE_ID,document.head.appendChild(tag)),tag.textContent=cssFor(count)}apply(),new MutationObserver(muts=>{for(const m of muts)for(const n of m.addedNodes||[])if(n.nodeType===1&&(n.matches?.("[data-oke-container],[data-oke-star-rating],[data-oke-reviews-summary]")||n.querySelector?.("[data-oke-container],[data-oke-star-rating],[data-oke-reviews-summary]"))){apply();return}}).observe(document.documentElement,{childList:!0,subtree:!0})}function initOkendoSoldCountSpacing(){const SELECTORS={okendoSummary:'[data-oke-reviews-summary], div[id*="okendo_reviews_summary"]',soldWidget:'div[id*="sold_count_product_sale_proof_widget_count_block"]'};function applySpacingIfNeeded(){const summary=document.querySelector(SELECTORS.okendoSummary);if(!summary)return;const soldWidget=document.querySelector(SELECTORS.soldWidget);if(!soldWidget)return;const summaryRect=summary.getBoundingClientRect();soldWidget.getBoundingClientRect().top>summaryRect.bottom-5?summary.style.marginBlockEnd="16px":summary.style.marginBlockEnd=""}applySpacingIfNeeded(),new MutationObserver(()=>{applySpacingIfNeeded()}).observe(document.body,{childList:!0,subtree:!0})}function initCountdownHoursOnlyCompact(){customElements.whenDefined("countdown-timer-flip").then(()=>{const Flip=customElements.get("countdown-timer-flip");if(!Flip||Flip.prototype.__jbHoursOnlyCompactPatched)return;const origUpdate=Flip.prototype.updateValue;Flip.prototype.updateValue=function(value){if(this.getAttribute("type")==="hours"){const timer=this.closest("countdown-timer");let days=0;if(timer){const daysFlip=timer.querySelector('countdown-timer-flip[type="days"]');if(daysFlip){const raw=(daysFlip.textContent||"").replace(/[^\d]/g,"");days=raw&&parseInt(raw,10)||0}}const totalHours=(Number(value)||0)+days*24;origUpdate.call(this,totalHours);const firstDigit=this.shadowRoot?.children?.[0];firstDigit&&(firstDigit.style.display=totalHours<10?"none":"inline-block");return}return origUpdate.call(this,value)},Flip.prototype.__jbHoursOnlyCompactPatched=!0;const STYLE_ID="jb-hide-countdown-days";if(!document.getElementById(STYLE_ID)){const style=document.createElement("style");style.id=STYLE_ID,style.textContent=` 12 .countdown-condensed .days, 13 .countdown-condensed .days-separator { display: none !important; } 14 `,document.head.appendChild(style)}})}function refreshNotifyMeIndicator(picker){const eligibilityData=picker.querySelector("[data-notify-me-variants]");if(!eligibilityData)return;let variants;try{variants=Object.values(JSON.parse(eligibilityData.textContent))}catch{return}const selectors=Array.from(picker.querySelectorAll("[data-option-selector]")),selectedOptions=selectors.map(selector=>selector.querySelector('input[name^="option"]:checked, input[name^="option"][type="hidden"], select[name^="option"]')?.value);
14selectors.forEach((selector,optionIndex)=>{selector.querySelectorAll("[data-option-value]").forEach(optionValue=>{if(!optionValue.querySelector(".notify-me-indicator"))return;const proposedValue=document.getElementById(optionValue.getAttribute("for"))?.value,matchingVariants=variants.filter(variant=>variant.options.every((value,index)=>value===(index===optionIndex?proposedValue:selectedOptions[index]))),isEligible=matchingVariants.length>0&&matchingVariants.every(variant=>variant.eligible===!0);optionValue.classList.toggle("has-notify-me-indicator",isEligible)})})}function initNotifyMeIndicators(){document.querySelectorAll("variant-picker").forEach(refreshNotifyMeIndicator)}document.addEventListener("change",event=>{const picker=event.target.closest?.("variant-picker");picker&&refreshNotifyMeIndicator(picker)}),document.addEventListener("variant:change",event=>{const picker=event.target.closest?.("variant-picker")||document.querySelector(`variant-picker[form="${event.target.id}"]`);picker&&refreshNotifyMeIndicator(picker)});function initCollectionFilterGrids(root=document){(root.matches?.(".shopify-section--collection-filter-grid")?[root]:Array.from(root.querySelectorAll(".shopify-section--collection-filter-grid"))).forEach(section=>{if(section.dataset.collectionFilterGridInitialized==="true")return;const cards=Array.from(section.querySelectorAll(".collection-filter-grid__card")),carousel=section.querySelector(".collection-filter-grid__filters");if(!cards.length)return;section.dataset.collectionFilterGridInitialized="true";const getFilterEntries=url=>Array.from(url.searchParams.entries()).filter(([key])=>key.startsWith("filter.")).sort(([keyA,valueA],[keyB,valueB])=>keyA===keyB?valueA.localeCompare(valueB):keyA.localeCompare(keyB)),getMatchingCard=(search=window.location.search)=>{const currentUrl=new URL(window.location.href);currentUrl.search=search;const currentPath=currentUrl.pathname.replace(/\/$/,""),currentFilters=getFilterEntries(currentUrl);return cards.find(card=>{const filterUrlValue=card.dataset.filterUrl;if(!filterUrlValue)return!1;const filterUrl=new URL(filterUrlValue,window.location.origin);if(filterUrl.pathname.replace(/\/$/,"")!==currentPath)return!1;const filterEntries=getFilterEntries(filterUrl);return filterEntries.length===currentFilters.length&&filterEntries.every(([key,value],index)=>{const currentEntry=currentFilters[index];return currentEntry&¤tEntry[0]===key&¤tEntry[1]===value})})||cards[0]},syncSelectedCard=search=>{const selectedCard=getMatchingCard(search);cards.forEach(card=>card.classList.toggle("is-selected",card===selectedCard));const selectedIndex=cards.indexOf(selectedCard);selectedIndex>=0&&carousel&&typeof carousel.select=="function"&&carousel.select(selectedIndex,{instant:!1})};syncSelectedCard(),document.addEventListener("facet:update",event=>syncSelectedCard(event.target?.search))})}function initCollectionListMobileArrows(root=document){(root.matches?.(".shopify-section--collection-list")?[root]:Array.from(root.querySelectorAll(".shopify-section--collection-list"))).forEach(section=>{if(section.dataset.customMobileArrowInitialized==="true")return;const arrows=Array.from(section.querySelectorAll(".custom-mobile-next-arrow")),carousel=section.querySelector("scroll-carousel.collection-list");if(!arrows.length||!carousel)return;section.dataset.customMobileArrowInitialized="true";const setVisible=visible=>arrows.forEach(arrow=>{arrow.style.opacity=visible?"1":"0",arrow.style.pointerEvents=visible?"":"none"});setVisible(!0),carousel.addEventListener("scroll:edge-nearing",event=>{setVisible(event.detail.position!=="end")}),carousel.addEventListener("scroll:edge-leaving",event=>{event.detail.position==="start"&&setVisible(!1)})})}(function(){const HIDE_CLASS="is-hidden";function setupBadgeController(gallery){if(!gallery||gallery.__badgeInit)return;const badge=gallery.querySelector(".pdp-image-badge"),carousel=gallery.querySelector(".product-gallery__carousel"),firstSlide=gallery.querySelector(".product-gallery__media:not([hidden])");if(!badge||!carousel||!firstSlide){gallery.__badgeInit=!0;return}function visibleRatio(){const a=firstSlide.getBoundingClientRect(),b=carousel.getBoundingClientRect(),overlap=Math.min(a.right,b.right)-Math.max(a.left,b.left);return Math.max(0,Math.min(1,overlap/Math.max(1,a.width||1)))}
14function update(){badge.classList.toggle(HIDE_CLASS,visibleRatio()<.75)}const io=new IntersectionObserver(update,{root:carousel,threshold:[0,.25,.5,.75,1]});io.observe(firstSlide);let raf=0;const onScroll=()=>{raf||(raf=requestAnimationFrame(()=>{raf=0,update()}))};carousel.addEventListener("scroll",onScroll,{passive:!0}),carousel.addEventListener("select",update),window.addEventListener("resize",update),update(),gallery.__badgeInit=!0,gallery.__badgeCleanup=()=>{io.disconnect(),carousel.removeEventListener("scroll",onScroll),carousel.removeEventListener("select",update),window.removeEventListener("resize",update)}}document.querySelectorAll(".product-gallery").forEach(setupBadgeController),new MutationObserver(muts=>{muts.forEach(m=>{m.addedNodes&&m.addedNodes.forEach(node=>{node instanceof Element&&(node.matches?.(".product-gallery")&&setupBadgeController(node),node.querySelectorAll?.(".product-gallery").forEach(setupBadgeController))}),m.removedNodes&&m.removedNodes.forEach(node=>{node.__badgeCleanup&&node.__badgeCleanup()})})}).observe(document.documentElement,{childList:!0,subtree:!0})})(),(function(){const pageYTop=el=>el.getBoundingClientRect().top+window.pageYOffset;function measureFixedOffset(stickyEl){if(!stickyEl)return 0;const topCss=parseFloat(getComputedStyle(stickyEl).top)||0,list=stickyEl.querySelector(".sticky-nav-list"),h=list?list.getBoundingClientRect().height:stickyEl.getBoundingClientRect().height;return Math.round(topCss+h)}function enableStickyClicks(el){el&&(el.style.pointerEvents="auto")}function disableStickyClicks(el){el&&(el.style.pointerEvents="none")}function nearestOverlayAbove(listEl){const overlays=Array.from(document.querySelectorAll(".shopify-section--image-with-text-overlay, .shopify-section--video"));if(!overlays.length)return null;const listTop=pageYTop(listEl);let best=null,bestTop=-1/0;return overlays.forEach(o=>{const t=pageYTop(o);t<listTop&&t>bestTop&&(best=o,bestTop=t)}),best}function nudgeValues(){return{ENTER_MARGIN:14,LEAVE_MARGIN:14,STICK_BAND:22,LIST_NUDGE_MOBILE:26,LIST_NUDGE_DESKTOP:28,OVERLAY_NUDGE_MOBILE:0,OVERLAY_NUDGE_DESKTOP:30,isDesktop:matchMedia("(min-width: 1000px)").matches}}function centerIn(container,idx){const pills=container.pills;if(!pills[idx])return;const carousel=container.carousel;if(carousel&&typeof carousel.select=="function"){carousel.select(idx,{instant:!1});return}const scroller=container.scroller;if(!scroller)return;const pill=pills[idx],target=pill.offsetLeft+pill.offsetWidth/2-scroller.clientWidth/2;scroller.scrollTo({left:Math.max(0,target),behavior:"smooth"})}function centerStickyById(id){const sticky=containers.find(c=>c.type==="sticky");if(!sticky)return;const idx=sticky.pills.findIndex(a=>(a.getAttribute("href")||"").replace("#","")===id);idx>=0&¢erIn(sticky,idx)}const containers=[],stickyEls=Array.from(document.querySelectorAll(".shopify-section--sticky-nav"));if(stickyEls.forEach(root=>{const pills=Array.from(root.querySelectorAll('.sticky-nav-list a[href^="#"]'));pills.length&&containers.push({root,pills,type:"sticky",clickTarget:"list",carousel:root.querySelector("scroll-carousel#carousel-"+root.id?.replace("shopify-section-",""))||root.querySelector("scroll-carousel"),scroller:root.querySelector(".sticky-nav-list")})}),document.querySelectorAll(".button-list-wrap").forEach(root=>{const pills=Array.from(root.querySelectorAll('a[href^="#"], span[href^="#"]'));pills.length&&containers.push({root,pills,type:"inline",clickTarget:"overlay",carousel:root.querySelector("scroll-carousel"),scroller:root.querySelector(".button-list")||root.querySelector(".collection-list")||root})}),!containers.length)return;const primarySticky=stickyEls[0]||null;let isStickyShown=!1,GLOBAL_OFFSET=0;const SHOW_OFFSET=100,HIDE_OFFSET=140;let hideLockUntil=0;function showStickyFor(ms=800){primarySticky&&(isStickyShown=!0,primarySticky.classList.add("is-visible"),enableStickyClicks(primarySticky),hideLockUntil=performance.now()+ms)}function maybeHideSticky(shouldShow){if(primarySticky)if(shouldShow)isStickyShown||(isStickyShown=!0,primarySticky.classList.add("is-visible"),enableStickyClicks(primarySticky));else{if(performance.now()<hideLockUntil)return;isStickyShown&&(isStickyShown=!1,primarySticky.classList.remove("is-visible"),disableStickyClicks(primarySticky))}}let zones=[],idToZoneIdx={},lastActive=-1,lastScrollY=window.pageYOffset,suppressAuto=!1;function buildZones(){GLOBAL_OFFSET=measureFixedOffset(primarySticky);const ids=new Set;
14containers.forEach(c=>c.pills.forEach(a=>{const h=(a.getAttribute("href")||"").trim();h.startsWith("#")&&h.length>1&&ids.add(h.slice(1))})),zones=[],idToZoneIdx={};const{LIST_NUDGE_DESKTOP,LIST_NUDGE_MOBILE,isDesktop}=nudgeValues(),extra=isDesktop?LIST_NUDGE_DESKTOP:LIST_NUDGE_MOBILE;ids.forEach(id=>{const list=document.getElementById(id);if(!list)return;const overlay=nearestOverlayAbove(list);if(!overlay)return;let s=overlay.querySelector(`:scope > .sticky-sentinel[data-for="${id}"]`);s||(s=document.createElement("div"),s.className="sticky-sentinel",s.dataset.for=id,s.style.position="relative",s.style.width="1px",s.style.height="1px",s.style.pointerEvents="none",overlay.insertBefore(s,overlay.firstChild)),s.style.scrollMarginTop=GLOBAL_OFFSET+"px",list.style.scrollMarginTop=GLOBAL_OFFSET+extra+"px",zones.push({id,list,overlay,sentinel:s,get top(){return pageYTop(s)}})}),zones.sort((a,b)=>a.top-b.top),zones.forEach((z,i)=>idToZoneIdx[z.id]=i)}function setActive(idx,{centerSticky=!0}={}){idx!==lastActive&&(containers.forEach(c=>{if(c.pills.forEach(p=>p.classList.remove("active")),idx>=0&&idx<zones.length){const id=zones[idx].id,pill=c.pills.find(a=>(a.getAttribute("href")||"").replace("#","")===id);pill&&(pill.classList.add("active"),c.type==="sticky"&¢erSticky&¢erIn(c,c.pills.indexOf(pill)))}}),lastActive=idx)}function updateStickyVisibility(){if(!zones.length||!primarySticky)return;const firstTop=zones[0].top,lineY=window.pageYOffset+GLOBAL_OFFSET,shouldShow=lineY>=firstTop+SHOW_OFFSET,shouldHide=lineY<firstTop-HIDE_OFFSET;!isStickyShown&&shouldShow?(isStickyShown=!0,primarySticky.classList.add("is-visible")):isStickyShown&&shouldHide&&maybeHideSticky(!1)}function chooseActiveByScroll(){if(!zones.length)return;const currY=window.pageYOffset,dir=Math.sign(currY-lastScrollY);lastScrollY=currY;const{ENTER_MARGIN,LEAVE_MARGIN,STICK_BAND}=nudgeValues(),lineY=currY+GLOBAL_OFFSET,firstTop=zones[0].top;if(lineY<firstTop){setActive(-1,{centerSticky:!1}),updateStickyVisibility();return}updateStickyVisibility();const testLine=lineY+(dir<0?+LEAVE_MARGIN:-ENTER_MARGIN);let idx=0;for(let i=0;i<zones.length&&zones[i].top<=testLine;i++)idx=i;if(lastActive>=0){const currTop=zones[lastActive].top;Math.abs(lineY-currTop)<=STICK_BAND&&(idx=lastActive)}suppressAuto||setActive(idx)}function onPillClick(container,pill,e){const href=(pill.getAttribute("href")||"").trim();if(!href.startsWith("#"))return;const id=href.slice(1),idx=idToZoneIdx[id],z=zones[idx];if(!z)return;e.preventDefault();const{LIST_NUDGE_MOBILE,LIST_NUDGE_DESKTOP,OVERLAY_NUDGE_MOBILE,OVERLAY_NUDGE_DESKTOP,ENTER_MARGIN,STICK_BAND,isDesktop}=nudgeValues(),targetIsList=container.clickTarget==="list",baseTarget=targetIsList?z.list:z.sentinel,rawExtra=targetIsList?isDesktop?LIST_NUDGE_DESKTOP:LIST_NUDGE_MOBILE:isDesktop?OVERLAY_NUDGE_DESKTOP:OVERLAY_NUDGE_MOBILE,minIntoZone=ENTER_MARGIN+STICK_BAND+8,extra=Math.max(rawExtra,minIntoZone),baseTop=pageYTop(baseTarget),targetY=targetIsList?baseTop-(GLOBAL_OFFSET+extra):baseTop-GLOBAL_OFFSET+extra;showStickyFor(1e3),suppressAuto=!0,setActive(idx),container.type==="sticky"?centerIn(container,container.pills.indexOf(pill)):requestAnimationFrame(()=>{requestAnimationFrame(()=>{centerStickyById(z.id)})}),window.scrollTo({top:targetY,behavior:"smooth"}),history.pushState(null,"","#"+id);const deadline=performance.now()+1600;(function wait(){if(Math.abs(window.pageYOffset-targetY)<=1||performance.now()>deadline){suppressAuto=!1,lastScrollY=window.pageYOffset,setActive(idx,{centerSticky:!1}),centerStickyById(z.id),enableStickyClicks(primarySticky);return}requestAnimationFrame(wait)})()}containers.forEach(c=>{c.pills.forEach(p=>p.addEventListener("click",e=>onPillClick(c,p,e)))});function initAll(){buildZones(),updateStickyVisibility(),chooseActiveByScroll()}document.readyState==="complete"?initAll():window.addEventListener("load",initAll),window.addEventListener("scroll",chooseActiveByScroll,{passive:!0}),window.addEventListener("resize",()=>{clearTimeout(window.__jbNavRz),window.__jbNavRz=setTimeout(()=>{buildZones(),chooseActiveByScroll()},150)},{passive:!0}),window.addEventListener("orientationchange",()=>
14{buildZones(),chooseActiveByScroll()})})(),document.addEventListener("DOMContentLoaded",function(){new MutationObserver(()=>{document.querySelectorAll(".sc-count__product-item").forEach(widget=>{if(widget.dataset.customSvgReplaced==="true")return;const iconSpan=widget.querySelector(".sc-count__product-icon");iconSpan&&(iconSpan.innerHTML=` 15 <svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"> 16 <path d="M7 0C10.862 0 14 3.13803 14 7C14 10.862 10.862 14 7 14C3.13803 14 0 10.862 0 7C0 3.13803 3.13803 0 7 0ZM7 0.736842C3.53666 0.736842 0.736842 3.53666 0.736842 7C0.736842 10.4633 3.53666 13.2632 7 13.2632C10.4633 13.2632 13.2632 10.4633 13.2632 7C13.2632 3.53666 10.4633 0.736842 7 0.736842ZM7 2.21053C7.20364 2.21053 7.36842 2.37531 7.36842 2.57895V7C7.35979 7.15039 7.29502 7.22091 7.20724 7.30509L4.39232 10.1257C4.2484 10.2696 4.01815 10.2696 3.87422 10.1257C3.7303 9.98181 3.73031 9.75155 3.87422 9.60763L6.63167 6.85018V2.57871C6.63167 2.37506 6.79645 2.21029 7.00009 2.21029L7 2.21053Z" fill="#6A6A6A"/> 17 </svg> 18 `,widget.dataset.customSvgReplaced="true")})}).observe(document.body,{childList:!0,subtree:!0})});function bootAll(){initSizeGuideAccordionAnchors(),initCartToast(),initOnlineStoreCartAttribute(),initCartNoteCharacterCounter(),initChatMenuNudges(),initRelocateSizeGuide(),initCountrySelector(),initDesktopSlideshowGestures(),initSlideClickThroughLinks(),initReloadCartForNosto(),initHidePerfectPairingIfEmpty(),initKlaviyoATCEvent(),initProductCardImageToggles(),initCollectionInfiniteAndRestore(),initReloadNostoDisruptorsOnGiftGuide(),initAutoplayPauseVideosByView(),initResponsiveVideoWithMutePersistence(),initCollectionVideoDisruptorMute(),initVariantChangeUI(),initKlaviyoLeadEvent(),initAbraCartRefresh(),initMiscClickTracking(),initOkendoPlacement(),initOkendoSoldCountSpacing(),initCountdownHoursOnlyCompact(),initCollectionFilterGrids(),initCollectionListMobileArrows();try{typeof window.customized_video_section=="function"&&window.customized_video_section()}catch{}}onReady(bootAll),onReady(initNotifyMeIndicators),document.addEventListener("shopify:section:load",event=>{initRelocateSizeGuide(),initDesktopSlideshowGestures(),initSlideClickThroughLinks(),initProductCardImageToggles(),initCollectionInfiniteAndRestore(),initAutoplayPauseVideosByView(),initResponsiveVideoWithMutePersistence(),initCollectionVideoDisruptorMute(),initOkendoPlacement(),initOkendoSoldCountSpacing(),initCountdownHoursOnlyCompact(),initNotifyMeIndicators(),initCollectionFilterGrids(event.target),initCollectionListMobileArrows(event.target)}),window.addEventListener("pageshow",e=>{e.persisted&&initCollectionInfiniteAndRestore()})})(); 19//# sourceMappingURL=/cdn/shop/t/59/assets/custom.js.map?v=64561660839201487141790732381
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.