1import{cW as ve,cV as I,cQ as W,a3 as pe,dd as B,ae as N,c3 as h,as as Z,bR as v,ak as b,ap as L,dg as E,g as M,c4 as z,j as oe,ai as $,ao as ne,cn as x,ah as T,aj as S,cO as xe,bz as P,dh as Pe,da as Ie,di as se,dj as ie,ct as e,bp as le,bL as j,by as re,de as K,Y as q,bJ as he,X as Fe,r as Re,c$ as U,cP as Ue,M as _,bb as He,c9 as V,bB as ce,az as De,d1 as O,_ as Ae,b_ as Ke}from"./C9Z41gEb.js";import{_ as Ve}from"./B4OfqlYQ.js";import{_ as ue}from"./L57nwihP.js";import{_ as de}from"./Z1SdP72k.js";import{u as Oe}from"./DTnk00bX.js";const ze=()=>{const a=ve(),l=I(),{$webView:c,$requestSlideTransition:t}=W();return{navigateBack:()=>{if(c.isEnabled&&l.meta.webviewNativeBack){const i=pe();if(i?.popView){i.popView();return}}globalThis.history.length>1?(t?.("back"),a.back()):a.push("/")}}},We=()=>{const a=h("collapsed"),l=I(),c=N(()=>a.value==="expanded"),t=i=>{a.value="expanded",i&&i.focus({preventScroll:!0})},r=()=>{a.value="collapsed"};return B(()=>l.path,()=>{l.meta.keepSearchExpanded?a.value="expanded":r()}),{searchState:a,isExpanded:c,expand:t,collapse:r}},Ze={class:"ws-notifications","data-test":"notifications"},je=["onClick"],qe=Z({__name:"notifications",props:{notificationProvider:{},topDown:{type:Boolean,default:!1}},setup(a){return(l,c)=>(v(),b("div",Ze,[L(de,null,{default:E(()=>[(v(!0),b(M,null,z(a.notificationProvider.persistentNotifications.value,t=>(v(),b(M,null,[!(l._.provides[oe]||l.$route).name||!t.ignoreRouteNames?.includes((l._.provides[oe]||l.$route).name)?(v(),$(ue,{key:t.key,class:"ws-notifications__message pr-0 d-flex","aria-live":"polite","aria-atomic":"true",role:"alert","hide-icon":"",type:t.type},{default:E(()=>[ne(x(t.message)+" ",1),T("button",{class:"ws-notifications__close-button ws-btn ws-btn--icon mx-2 text-base-color3",onClick:r=>a.notificationProvider.removeMessage(t.key)},[...c[0]||(c[0]=[T("span",{class:"ws-notifications__icon ws-icon notranslate","aria-hidden":"true"}," cancel ",-1)])],8,je)]),_:2},1032,["type"])):S("",!0)],64))),256))]),_:1}),L(de,null,{default:E(()=>[(v(!0),b(M,null,z(a.notificationProvider.notifications.value,t=>(v(),$(ue,{key:t.key,class:"ws-notifications__message","aria-live":"polite","aria-atomic":"true",role:"alert","hide-icon":"",type:t.type},{default:E(()=>[ne(x(t.message),1)]),_:2},1032,["type"]))),128))]),_:1})]))}}),Ge=Symbol("isWebviewNavigation"),Je=["placeholder","aria-label"],Qe={class:"ws-top-navigation-search__actions"},Xe=["aria-label"],Ye=Z({__name:"top-navigation-search",props:le({isExpanded:{type:Boolean},showPlaceholder:{type:Boolean},showButtonIcon:{type:Boolean},skipSearchTransition:{type:Boolean},showSearchBar:{type:Boolean}},{searchTerm:{required:!0},searchTermModifiers:{}}),emits:le(["search-click","input-mousedown","submit","escape","clear"],["update:searchTerm"]),setup(a,{expose:l}){const{$componentConfigs:{searchConfig:c}}=W(),t=xe(a,"searchTerm"),r=h(null),i=h(null);return l({searchContainerRef:r,searchInputRef:i}),(u,o)=>(v(),b("div",{ref_key:"searchContainerRef",ref:r,class:P(["ws-top-navigation-search",{"ws-top-navigation-search--expanded":a.isExpanded,"ws-top-navigation-search--no-transition":a.skipSearchTransition}]),onClick:o[6]||(o[6]=n=>u.$emit("search-click"))},[Pe(T("input",{ref_key:"searchInputRef",ref:i,"onUpdate:modelValue":o[0]||(o[0]=n=>t.value=n),type:"search",class:"ws-top-navigation-search__input",placeholder:a.showPlaceholder||a.showSearchBar?e(c).settingsSearchPlaceholder:"","aria-label":a.isExpanded?e(c).settingsSearchLabelExpanded:e(c).settingsSearchLabelCollapsed,autocomplete:"off",enterkeyhint:"search",onMousedown:o[1]||(o[1]=n=>u.$emit("input-mousedown",n)),onTouchstart:o[2]||(o[2]=n=>u.$emit("input-mousedown",n)),onKeydown:[o[3]||(o[3]=se(ie(n=>u.$emit("submit"),["prevent"]),["enter"])),o[4]||(o[4]=se(n=>u.$emit("escape"),["escape"]))]},null,40,Je),[[Ie,t.value]]),T("span",{class:P(["ws-top-navigation-search__icon ws-icon ws-icon--medium notranslate",{"ws-top-navigation-search__icon--visible":a.isExpanded&&a.showPlaceholder&&t.value.length===0||!a.isExpanded&&a.showButtonIcon}]),"aria-hidden":"true"}," search ",2),T("div",Qe,[a.isExpanded&&t.value.length>0?(v(),b("button",{key:0,class:"ws-top-navigation-search__clear-btn ws-btn ws-btn--icon",type:"button","aria-label":u.$t("button.reset"),onClick:o[5]||(o[5]=ie(n=>u.$emit("clear"),["stop"]))},[...o[7]||(o[7]=[T("span",{class:"ws-icon notranslate text-base-color2","aria-hidden":"true"}," clear ",-1)])],8,Xe)):S("",!0)])],2))}}),et=a=>{const l=I(),c=Oe(),t=h(""),r=h("");return B(()=>l.params.slug,async(i,u,o)=>{let n=!1;if(o(()=>{n=!0}),t.value="",r.value="",c&&typeof i=="string"&&i&&l.meta.hasCategoryTitle)try{const m=await c.fetchCategoryData(i,a);if(n)return;t.value=m.name??"",r.value=m?.imageUrl??""}catch{}},{immediate:!0}),{title:t,imageSrc:r}},tt=({topNavigationRef:a,topNavigationWrapperRef:l,searchContainerRef:c,isExpanded:t,isScrolledPastThreshold:r,navBarHeight:i,showPlaceholder:u,showButtonIcon:o})=>{const n=h(0),m=h(0),g=()=>{const p=a.value;p&&(n.value=p.getBoundingClientRect().bottom);const s=l.value;s&&(m.value=Math.floor(s.getBoundingClientRect().height))};return j(async()=>{await re(),g()}),K(p=>{const s=a.value;if(!s)return;const d=f=>{f.propertyName==="padding"&&g()};s.addEventListener("transitionend",d),p(()=>s.removeEventListener("transitionend",d))}),K(p=>{const s=c.value;if(!s)return;const d=f=>{f.propertyName==="flex-grow"&&(t.value?u.value=!0:o.value=!0)};s.addEventListener("transitionend",d),p(()=>s.removeEventListener("transitionend",d))}),K(p=>{const s=l.value;if(!s)return;const d=new ResizeObserver(q(()=>{g()}));d.observe(s),p(()=>d.disconnect())}),B([r,t,i],()=>{re(g)}),{flapoutTop:n,topNavigationHeight:m}}
1,at=(a=1)=>{const l=h(!1),c=h(0),t=h(!1);{let r=0,i=0;const u=q(()=>{const o=window.scrollY,n=document.documentElement.scrollHeight;n===i&&(t.value=o<r),r=o,i=n,c.value=o,l.value=o>e(a)});j(()=>{i=document.documentElement.scrollHeight,window.addEventListener("scroll",u,{passive:!0}),u()}),he(()=>{window.removeEventListener("scroll",u)})}return{isScrolledPastThreshold:l,isScrollingUp:t,scrollY:c}},ot=({searchInputRef:a,isExpanded:l,expand:c,collapse:t})=>{const r=I(),i=h(""),u=h(!1),o=h(!0),n=h(!1);let m=!1,g;const p=()=>{m=!0,clearTimeout(g),g=setTimeout(()=>{m=!1},400)};B(i,p);{const w=q(()=>{!n.value&&!m&&a.value?.matches(":focus")&&a.value.blur()});j(()=>{window.addEventListener("scroll",w,{passive:!0})}),he(()=>{clearTimeout(g),window.removeEventListener("scroll",w)})}B(()=>r.fullPath,()=>{n.value=!0,l.value?u.value=!0:o.value=!0,Fe(()=>{n.value=!1})});const s=()=>{l.value||(p(),c(a.value??void 0))},d=w=>{l.value&&(a.value?.matches(":focus")||(w.preventDefault(),p(),a.value?.focus({preventScroll:!0})))},f=()=>{a.value?.blur()},y=()=>{i.value="",a.value?.focus()},C=()=>{r.meta.keepSearchExpanded?(i.value="",a.value?.blur()):t()};return B(l,w=>{n.value?(o.value=!w,u.value=!!w):(o.value=!1,w||(u.value=!1)),!w&&r.name!==Re&&(i.value="")}),{searchTerm:i,showPlaceholder:u,showButtonIcon:o,skipSearchTransition:n,onSearchClick:s,onSearchInputMousedown:d,onSearchSubmit:f,clearSearch:y,onEscapeKey:C}},nt=()=>{const a=U("categoryBannerHeight",()=>0),l=U("categoryBannerRevealed",()=>!1),c=U("categoryBannerTranslateY",()=>0),t=U("categoryBannerElHeight",()=>0);return{categoryBannerHeight:a,categoryBannerRevealed:l,categoryBannerTranslateY:c,categoryBannerElHeight:t}},st=({scrollY:a,isScrollingUp:l,categoryBannerHeight:c,categoryBannerElHeight:t,categoryBannerRevealed:r,categoryBannerTranslateY:i,topNavigationHeight:u})=>{const o=h(!0);{let n=window.scrollY,m=null;const g=(s,d)=>{if(o.value=!0,s<=5)r.value=!1,i.value=0;else if(s<=d)r.value=!0,i.value=0;else{const y=n-s;if(r.value=y>30,y<=30)i.value=-100;else{const C=t.value||60,w=Math.min((y-30)/C,1);i.value=-(1-w)*100}}},p=(s,d)=>{if(!r.value)s>d&&(o.value=!1);else if(s>d){const f=s-n,y=t.value||60,C=Math.min(f/y,1);i.value=-C*100,C>=1&&(r.value=!1,o.value=!1)}else o.value=!1,r.value=!1};B(a,s=>{const d=c.value-u.value,f=l.value,y=f?"up":"down";if(d<=0){o.value=f||s<=0;return}y!==m&&(n=s,m=y),f?g(s,d):p(s,d)},{flush:"sync"}),B(c,s=>{i.value=0,s>0?(o.value=a.value<=s-u.value,r.value=!1):(o.value=!0,r.value=!1)})}return{bannerFullBleedLatch:o}},it={class:"ws-icon notranslate","aria-hidden":"true"},lt=["src"],rt={key:1,class:"h6"},ct={key:2,"data-test":"top-navigation",class:"ws-top-navigation__title ws-top-navigation__title--centered h6"},ut={class:"ws-top-navigation-notifications"},ft=Z({__name:"top-navigation",emits:["top-navigation-height"],setup(a,{emit:l}){const{navigateBack:c}=ze(),t=I(),r=ve(),{$ofetch:i,$usage:u,$webView:o}=W(),{isExpanded:n,expand:m,collapse:g}=We(),p=Ue(),{categoryBannerHeight:s,categoryBannerRevealed:d,categoryBannerTranslateY:f,categoryBannerElHeight:y}=nt(),{isScrolledPastThreshold:C,isScrollingUp:w,scrollY:me}=at(0),{bannerFullBleedLatch:G}=st({scrollY:me,isScrollingUp:w,categoryBannerHeight:s,categoryBannerElHeight:y,categoryBannerRevealed:d,categoryBannerTranslateY:f,topNavigationHeight:N(()=>ae.value)}),fe=N(()=>o.isEnabled?G.value:!C.value),J=N(()=>t.meta.topNavigationFullBleed||n.value||(s.value>0?G.value:fe.value)),ge=()=>{if(n.value&&!t.meta.keepSearchExpanded){g();return}const k=pe();if(o.isEnabled&&t.meta.webviewNativeBack&&k?.popCheckout){k.popCheckout();return}if(t.meta.backTo){r.push(t.meta.backTo);return}c()},Q=O("topNavigationRef"),X=O("topNavigationWrapperRef"),H=O("searchRef"),we=N(()=>H.value?.searchInputRef??null),be=N(()=>H.value?.searchContainerRef??null),{title:Y,imageSrc:ee}=et(i),{searchTerm:F,showPlaceholder:te,showButtonIcon:D,skipSearchTransition:ye,onSearchClick:ke,onSearchInputMousedown:_e,onSearchSubmit:Se,clearSearch:Te,onEscapeKey:Be}=ot({searchInputRef:we,isExpanded:n,expand:m,collapse:g}),Ce=N(()=>!t.meta.topNavigationFullBleed),Ne=()=>{window.scrollTo({top:0,behavior:u?.reducedMotion?"auto":"smooth"})},{flapoutTop:Ee,topNavigationHeight:ae}=tt({topNavigationRef:Q,topNavigationWrapperRef:X,searchContainerRef:be,isExpanded:n,isScrolledPastThreshold:J,navBarHeight:p,showPlaceholder:te,showButtonIcon:D}),$e=l;return B(ae,k=>$e("top-navigation-height",k),{immediate:!0}),Ke(Ge,!0),(k,R)=>{const Le=Ae;return v(),b("div",{ref_key:"topNavigationWrapperRef",ref:X,class:P(["ws-top-navigation-wrapper",{"ws-top-navigation-wrapper--android":e(u)?.isAndroid},{"ws-top-navigation-wrapper--has-banner":e(s)>0}]),style:ce({"--flapout-top":`${e(Ee)}px`})},[R[1]||(R[1]=T("div",{class:"ws-top-navigation-backdrop","aria-hidden":"true"},null,-1)),T("header",{ref_key:"topNavigationRef",ref:Q,class:P(["ws-top-navigation",{"ws-top-navigation--search-expanded":e(n),"ws-top-navigation--back-navigation-only":e(t).meta.topNavigationMode===e(_).BACK_ONLY,"ws-top-navigation--full-bleed":e(J),"ws-top-navigation--show-search-bar":e(t).meta.topNavigationFullBleed,"ws-top-navigation--hide-search":e(t).meta.topNavigationMode===e(_).TITLE||e(t).meta.topNavigationMode===e(_).TITLE_BACK}]),style:ce({"--nav-bar-height":`${e(p)}px`})},[e(t).meta.topNavigationMode!==e(_).TITLE?(v(),$(Ve,{key:0,"data-test":"top-navigation-back-button",class:P(["ws-btn--icon ws-btn--rounded ws-top-navigation__back-btn",{"d-none":!e(n)&&!e(Ce)}]),size:"large",variant:"tertiary",onClick:ge},{default:E(()=>
1[T("span",it,x(e(n)&&!e(t).meta.keepSearchExpanded?"close":e(u)?.isAndroid?"arrow_back":"arrow_back_ios_new"),1)]),_:1},8,["class"])):S("",!0),e(t).meta.topNavigationMode!==e(_).BACK_ONLY&&e(t).meta.topNavigationMode!==e(_).TITLE&&e(t).meta.topNavigationMode!==e(_).TITLE_BACK?(v(),b(M,{key:1},[!e(n)&&e(D)&&!e(t).meta.topNavigationFullBleed?(v(),b("div",{key:0,class:"ws-top-navigation__title d-flex align-center",onClick:Ne},[e(ee)?(v(),b("img",{key:0,class:"ws-top-navigation-title__image",alt:"","aria-hidden":"true",src:e(ee)},null,8,lt)):S("",!0),e(Y)?(v(),b("p",rt,x(e(Y)),1)):S("",!0)])):S("",!0),L(Ye,{ref_key:"searchRef",ref:H,"search-term":e(F),"onUpdate:searchTerm":R[0]||(R[0]=A=>He(F)?F.value=A:null),"is-expanded":e(n),"show-placeholder":e(te),"show-button-icon":e(D),"skip-search-transition":e(ye),"show-search-bar":!!e(t).meta.topNavigationFullBleed,onSearchClick:e(ke),onInputMousedown:e(_e),onSubmit:e(Se),onEscape:e(Be),onClear:e(Te)},null,8,["search-term","is-expanded","show-placeholder","show-button-icon","skip-search-transition","show-search-bar","onSearchClick","onInputMousedown","onSubmit","onEscape","onClear"])],64)):S("",!0),e(t).meta.topNavigationMode===e(_).TITLE||e(t).meta.topNavigationMode===e(_).TITLE_BACK?(v(),b("p",ct,x(e(t).meta.topNavigationTitle),1)):S("",!0),e(t).meta.topNavigationMode===e(_).TITLE&&k.$extensions.coreUiLibrary.topNavigation.trailingContent?(v(),$(V(k.$extensions.coreUiLibrary.topNavigation.trailingContent),{key:3})):S("",!0)],6),L(Le,null,{default:E(()=>[T("div",ut,[L(qe,{"notification-provider":k.$notifications},null,8,["notification-provider"]),(v(!0),b(M,null,z(e(De)(k.$extensions.coreUiLibrary.topNavigation.notifications),(A,Me)=>(v(),$(V(A.loaderFn),{key:`notification-${Me}`}))),128))])]),_:1}),k.$extensions.coreUiLibrary.topNavigation.searchFlapout&&e(n)?(v(),$(V(k.$extensions.coreUiLibrary.topNavigation.searchFlapout),{key:0,displayed:e(n),"search-term":e(F)},null,8,["displayed","search-term"])):S("",!0)],6)}}});
1export{ft as _,qe as a};
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.