@anker-in/headless-ui 1.1.18 → 1.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
  2. package/dist/cjs/biz-components/FooterNavigation/index.js.map +3 -3
  3. package/dist/cjs/biz-components/FooterNavigation/types.d.ts +3 -0
  4. package/dist/cjs/biz-components/FooterNavigation/types.js +1 -1
  5. package/dist/cjs/biz-components/FooterNavigation/types.js.map +2 -2
  6. package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
  7. package/dist/cjs/biz-components/HeaderNavigation/index.js.map +3 -3
  8. package/dist/cjs/biz-components/MediaPlayerSticky/index.js +1 -1
  9. package/dist/cjs/biz-components/MediaPlayerSticky/index.js.map +2 -2
  10. package/dist/cjs/biz-components/NavigationSearch/index.js +2 -2
  11. package/dist/cjs/biz-components/NavigationSearch/index.js.map +2 -2
  12. package/dist/cjs/biz-components/SearchPage/index.js +1 -1
  13. package/dist/cjs/biz-components/SearchPage/index.js.map +2 -2
  14. package/dist/cjs/biz-components/Slogan/index.js +1 -1
  15. package/dist/cjs/biz-components/Slogan/index.js.map +3 -3
  16. package/dist/cjs/biz-components/Slogan/types.d.ts +1 -0
  17. package/dist/cjs/biz-components/Slogan/types.js +1 -1
  18. package/dist/cjs/biz-components/Slogan/types.js.map +1 -1
  19. package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
  20. package/dist/esm/biz-components/FooterNavigation/index.js.map +3 -3
  21. package/dist/esm/biz-components/FooterNavigation/types.d.ts +3 -0
  22. package/dist/esm/biz-components/FooterNavigation/types.js +1 -1
  23. package/dist/esm/biz-components/FooterNavigation/types.js.map +2 -2
  24. package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
  25. package/dist/esm/biz-components/HeaderNavigation/index.js.map +3 -3
  26. package/dist/esm/biz-components/MediaPlayerSticky/index.js +1 -1
  27. package/dist/esm/biz-components/MediaPlayerSticky/index.js.map +2 -2
  28. package/dist/esm/biz-components/NavigationSearch/index.js +2 -2
  29. package/dist/esm/biz-components/NavigationSearch/index.js.map +2 -2
  30. package/dist/esm/biz-components/SearchPage/index.js +1 -1
  31. package/dist/esm/biz-components/SearchPage/index.js.map +2 -2
  32. package/dist/esm/biz-components/Slogan/index.js +1 -1
  33. package/dist/esm/biz-components/Slogan/index.js.map +3 -3
  34. package/dist/esm/biz-components/Slogan/types.d.ts +1 -0
  35. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";var B=Object.create;var k=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var D=(t,l)=>{for(var i in l)k(t,i,{get:l[i],enumerable:!0})},b=(t,l,i,a)=>{if(l&&typeof l=="object"||typeof l=="function")for(let o of C(l))!A.call(t,o)&&o!==i&&k(t,o,{get:()=>l[o],enumerable:!(a=M(l,o))||a.enumerable});return t};var L=(t,l,i)=>(i=t!=null?B(F(t)):{},b(l||!t||!t.__esModule?k(i,"default",{value:t,enumerable:!0}):i,t)),E=t=>b(k({},"__esModule",{value:!0}),t);var j={};D(j,{default:()=>O});module.exports=E(j);var e=require("react/jsx-runtime"),c=require("react"),s=require("../../components/index.js"),y=L(require("../Subscribe/index.js")),h=require("./types.js"),x=require("./icons/index.js"),v=require("react-responsive"),f=require("../../helpers/utils.js"),w=require("../../shared/Styles.js");const S=({data:{footerNavigation:t}={},currentCountry:l,event:i,subscribeLoading:a})=>{const[o,m]=(0,c.useState)(!1),p=(0,v.useMediaQuery)({query:"(max-width: 1439px)"});(0,c.useEffect)(()=>{m(p)},[p]);const r=(0,c.useMemo)(()=>t?.footerBlocks?.find(d=>d?.blockType===h.FooterNavigationBlockType.Brand)?.country||{},[t]);return(0,e.jsxs)(s.Container,{childClassName:"bg-black py-8 laptop:py-16 flex flex-col desktop:gap-16 gap-8",children:[(0,e.jsx)(s.Text,{html:t?.story,className:"desktop:text-sm text-xs font-bold text-[#6D6D6F]"}),t?.footerBlocks?.map(d=>{if(d?.blockType===h.FooterNavigationBlockType.Signup)return(0,e.jsx)(T,{subscribeLoading:a,data:d,onSubmit:i?.signup},d.id);if(d?.blockType===h.FooterNavigationBlockType.Brand)return(0,e.jsx)(z,{data:d,isMobile:o,event:i,currentCountry:l},d?.id);if(d?.blockType===h.FooterNavigationBlockType.Main)return(0,e.jsx)($,{data:{...d,country:r},event:i,isMobile:o,currentCountry:l},d.id)})]})},T=({data:t,onSubmit:l,subscribeLoading:i})=>(0,e.jsxs)("div",{className:"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#080A0F] px-4 py-8",children:[(0,e.jsx)(y.default,{subscribeMetadata:t?.signup,className:"desktop:flex-[744]",onSubmit:l,loading:i}),(0,e.jsx)("div",{className:"desktop:hidden h-px w-full bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(s.Text,{html:t?.enjoy?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.enjoy?.enjoys?.map(a=>(0,e.jsxs)("div",{className:"flex-start flex gap-2",children:[(0,e.jsx)(s.Picture,{source:a?.icon?.url,alt:a?.icon?.alt,className:"size-5 shrink-0"}),(0,e.jsx)(s.Text,{html:a?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})]},a?.id))})]}),(0,e.jsx)("div",{className:"desktop:block hidden w-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(s.Text,{html:t?.benefit?.title,className:"text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.benefit?.benefits?.map(a=>(0,e.jsx)(s.Link,{href:`${a?.link}?ref=footer`,asChild:!a?.link,className:"no-underline",children:(0,e.jsx)(s.Text,{html:a?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},a?.id))})]})]})]}),$=({data:t,event:l,isMobile:i,currentCountry:a})=>{const[o,m]=(0,c.useState)(!1),{services:p,mainNav:r,country:d}=t;return(0,e.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,e.jsxs)("div",{className:(0,f.cn)({"desktop:gap-16 flex":p?.download?.title}),children:[(0,e.jsxs)("div",{className:(0,f.cn)("w-full",{"desktop:flex-[1260]":p?.download?.title}),children:[(0,e.jsx)(s.Text,{html:p?.storeBenefits?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:(0,f.cn)("laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2",{"desktop:max-w-[648px]":p?.download?.title}),children:p?.storeBenefits?.reasons?.map(n=>(0,e.jsxs)("div",{className:"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2",children:[(0,e.jsx)(s.Picture,{source:n?.icon?.url,alt:n?.icon?.alt,className:"size-5 shrink-0"}),(0,e.jsx)(s.Link,{href:`${n?.link}?ref=footer`,asChild:!n?.link,className:"no-underline",children:(0,e.jsx)(s.Text,{html:n?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})})]},n?.id))})]}),(0,e.jsx)(N,{className:(0,f.cn)({"desktop:flex-[404] hidden desktop:block":p?.download?.title}),title:p?.download?.title,apps:p?.download?.apps})]}),(0,e.jsx)("div",{className:"desktop:block hidden h-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"desktop:grid grid-cols-4 gap-4",children:[(0,e.jsx)(u,{title:r?.products?.title,lists:r?.products?.products}),(0,e.jsx)(u,{title:r?.explore?.title,lists:r?.explore?.explores}),(0,e.jsx)(u,{title:r?.support?.title,lists:r?.support?.supports}),(0,e.jsxs)("div",{className:"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4",children:[(0,e.jsxs)("div",{className:"desktop:pb-0 flex items-center justify-between pb-4",children:[(0,e.jsx)(s.Text,{as:"p",html:r?.contact?.title,className:"text-xl font-bold leading-[1.2] text-white"}),i&&(0,e.jsx)("button",{onClick:()=>m(!o),children:o?(0,e.jsx)(x.SubtractIcon,{width:20,height:20}):(0,e.jsx)(x.AddIcon,{width:20,height:20})})]}),(o&&i||!i)&&(0,e.jsx)("div",{className:"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2",children:r?.contact?.contacts?.map(n=>(0,e.jsxs)("div",{className:"flex items-start gap-2",children:[(0,e.jsx)(s.Picture,{source:n?.icon?.url,alt:n?.icon?.alt,className:"size-5 shrink-0"}),(0,e.jsx)(s.Link,{href:n?.link,className:"no-underline",children:(0,e.jsx)(s.Text,{html:n?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})})]},n?.id))}),(0,e.jsx)(g,{country:a||d,className:"desktop:hidden border-b border-[#3D3E3F]",isMobile:i,onChangeCountry:l?.country}),(0,e.jsx)("div",{className:"desktop:hidden mt-8",children:(0,e.jsx)(N,{title:p?.download?.title,apps:p?.download?.apps})}),!!r?.socials?.length&&(0,e.jsx)("div",{className:"mt-8 flex items-center gap-2",children:r?.socials?.map(n=>(0,e.jsx)(s.Link,{href:`${n?.link}?ref=footer`,children:(0,e.jsx)(s.Picture,{source:n?.icon?.url,alt:n?.icon?.alt,className:"size-8 shrink-0"})},n?.id))}),(0,e.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",children:r?.payment?.map(n=>(0,e.jsx)(s.Link,{href:n?.link,children:(0,e.jsx)(s.Picture,{source:n?.icon?.url,alt:n?.icon?.alt,className:"h-[28px] w-[44px] shrink-0"})},n?.id))})]})]})]})},z=({data:t,isMobile:l,event:i,currentCountry:a})=>(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"desktop:items-center desktop:flex desktop:gap-4",children:[(0,e.jsxs)("div",{className:"laptop:flex-row laptop:items-center desktop:flex-[980] flex flex-col items-start gap-4",children:[(0,e.jsx)(s.Text,{html:t?.brand?.currentBrand,className:"text-[#B6B6BA]"}),(0,e.jsx)("div",{className:"laptop:block laptop:mb-[10px] hidden h-[20px] w-px bg-[#B6B6BA]"}),(0,e.jsx)("div",{className:"desktop:gap-6 flex flex-wrap items-center gap-4",children:t?.brand?.brands?.map(o=>(0,e.jsx)(s.Link,{href:`${o?.link}?ref=footer`,children:(0,e.jsx)(s.Text,{html:o?.icon,className:"text-[#B6B6BA] hover:text-white"})},o?.id))})]}),(0,e.jsx)(g,{country:a||t?.country,className:"desktop:flex-[316] desktop:block hidden",isMobile:l,onChangeCountry:i?.country})]}),(0,e.jsx)("div",{className:"h-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1",children:[(0,e.jsx)(s.Text,{html:t?.copyright?.label,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsx)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:t?.policy?.policies?.map(o=>(0,e.jsx)(s.Link,{href:`${o?.link}?ref=footer`,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white",children:o?.label},o?.id))})]})]}),u=({title:t,lists:l,className:i})=>{const[a,o]=(0,c.useState)(!1),[m,p]=(0,c.useState)(!1),r=(0,v.useMediaQuery)({query:"(max-width: 1439px)"});return(0,c.useEffect)(()=>{p(r)},[r]),(0,e.jsxs)("div",{className:(0,f.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",i),children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",onClick:()=>o(!a),children:[(0,e.jsx)(s.Text,{as:"p",html:t,className:"text-xl font-bold leading-[1.2] text-white"}),m&&(0,e.jsx)(e.Fragment,{children:a?(0,e.jsx)(x.SubtractIcon,{width:20,height:20}):(0,e.jsx)(x.AddIcon,{width:20,height:20})})]}),(a&&m||!m)&&(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:l?.map(d=>(0,e.jsx)(s.Link,{href:`${d?.link}?ref=footer`,className:"no-underline",children:(0,e.jsx)(s.Text,{html:d?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},d?.id))})]})},N=({title:t,apps:l,className:i})=>l?.length?(0,e.jsxs)("div",{className:i,children:[(0,e.jsx)(s.Text,{html:t,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex items-center gap-4",children:l?.map(a=>(0,e.jsxs)("div",{className:"flex flex-col items-center gap-[6px]",children:[(0,e.jsx)(s.Link,{href:a?.link,children:(0,e.jsx)(s.Picture,{source:a?.icon?.url,alt:a?.icon?.alt,className:"size-10 shrink-0"})}),a?.label&&(0,e.jsx)(s.Text,{html:a?.label,className:"text-xs font-bold text-[#999999]"})]},a?.id))})]}):null,g=({country:t,isMobile:l,className:i,onChangeCountry:a})=>(0,e.jsx)("div",{className:(0,f.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",i),onClick:()=>a?.(),children:(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,e.jsx)(x.CountryIcon,{width:20,height:20,className:"shrink-0"}),(0,e.jsx)(s.Text,{as:"p",html:t?.countryName||t?.country,className:"desktop:text-[#B6B6BA] text-base font-bold leading-[1.4] text-white hover:text-white"})]}),l&&(0,e.jsx)("button",{children:(0,e.jsx)(x.ArrowRightIcon,{width:20,height:20})})]})});var O=(0,w.withLayout)(S);
1
+ "use strict";var B=Object.create;var h=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var D=(t,o)=>{for(var i in o)h(t,i,{get:o[i],enumerable:!0})},v=(t,o,i,l)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of C(o))!A.call(t,n)&&n!==i&&h(t,n,{get:()=>o[n],enumerable:!(l=M(o,n))||l.enumerable});return t};var L=(t,o,i)=>(i=t!=null?B(F(t)):{},v(o||!t||!t.__esModule?h(i,"default",{value:t,enumerable:!0}):i,t)),E=t=>v(h({},"__esModule",{value:!0}),t);var j={};D(j,{default:()=>O});module.exports=E(j);var e=require("react/jsx-runtime"),p=require("react"),s=require("../../components/index.js"),y=L(require("../Subscribe/index.js")),k=require("./types.js"),c=require("./icons/index.js"),u=require("react-responsive"),x=require("../../helpers/utils.js"),w=require("../../shared/Styles.js");const S=({data:{footer:t}={},currentCountry:o,event:i,subscribeLoading:l,classNames:n})=>{const[m,r]=(0,p.useState)(!1),d=(0,u.useMediaQuery)({query:"(max-width: 1439px)"});(0,p.useEffect)(()=>{r(d)},[d]);const f=(0,p.useMemo)(()=>t?.blocks?.find(a=>a?.blockType===k.FooterNavigationBlockType.Brand)?.country||{},[t]);return(0,e.jsxs)(s.Container,{className:(0,x.cn)(n?.root),childClassName:(0,x.cn)("laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8",n?.child),children:[(0,e.jsx)(s.Text,{html:t?.story,className:"desktop:text-sm text-xs font-bold text-[#6D6D6F]"}),t?.blocks?.map(a=>{if(a?.blockType===k.FooterNavigationBlockType.Signup)return(0,e.jsx)(T,{subscribeLoading:l,data:a,onSubmit:i?.signup},a.id);if(a?.blockType===k.FooterNavigationBlockType.Brand)return(0,e.jsx)(z,{data:a,isMobile:m,event:i,currentCountry:o},a?.id);if(a?.blockType===k.FooterNavigationBlockType.Main)return(0,e.jsx)($,{data:{...a,country:f},event:i,isMobile:m,currentCountry:o},a.id)})]})},T=({data:t,onSubmit:o,subscribeLoading:i})=>(0,e.jsxs)("div",{className:"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#080A0F] px-4 py-8",children:[(0,e.jsx)(y.default,{subscribeMetadata:t?.signup,className:"desktop:flex-[744]",onSubmit:o,loading:i}),(0,e.jsx)("div",{className:"desktop:hidden h-px w-full bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(s.Text,{html:t?.enjoy?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.enjoy?.enjoys?.map(l=>(0,e.jsxs)("div",{className:"flex-start flex gap-2",children:[(0,e.jsx)(s.Picture,{source:l?.icon?.url,alt:l?.icon?.alt,className:"size-5 shrink-0"}),(0,e.jsx)(s.Text,{html:l?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})]},l?.id))})]}),(0,e.jsx)("div",{className:"desktop:block hidden w-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(s.Text,{html:t?.benefit?.title,className:"text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.benefit?.benefits?.map(l=>(0,e.jsx)(s.Link,{href:`${l?.link}?ref=footer`,asChild:!l?.link,className:"no-underline",children:(0,e.jsx)(s.Text,{html:l?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},l?.id))})]})]})]}),$=({data:t,event:o,isMobile:i,currentCountry:l})=>{const[n,m]=(0,p.useState)(!1),{services:r,mainNav:d,country:f}=t;return(0,e.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,e.jsxs)("div",{className:(0,x.cn)({"desktop:gap-16 flex":r?.download?.title}),children:[(0,e.jsxs)("div",{className:(0,x.cn)("w-full",{"desktop:flex-[1260]":r?.download?.title}),children:[(0,e.jsx)(s.Text,{html:r?.storeBenefits?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:(0,x.cn)("laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2",{"desktop:max-w-[648px]":r?.download?.title}),children:r?.storeBenefits?.reasons?.map(a=>(0,e.jsxs)("div",{className:"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2",children:[(0,e.jsx)(s.Picture,{source:a?.icon?.url,alt:a?.icon?.alt,className:"size-5 shrink-0"}),(0,e.jsx)(s.Link,{href:`${a?.link}?ref=footer`,asChild:!a?.link,className:"no-underline",children:(0,e.jsx)(s.Text,{html:a?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})})]},a?.id))})]}),(0,e.jsx)(N,{className:(0,x.cn)({"desktop:flex-[404] hidden desktop:block":r?.download?.title}),title:r?.download?.title,apps:r?.download?.apps})]}),(0,e.jsx)("div",{className:"desktop:block hidden h-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"desktop:grid grid-cols-4 gap-4",children:[(0,e.jsx)(b,{title:d?.products?.title,lists:d?.products?.products}),(0,e.jsx)(b,{title:d?.explore?.title,lists:d?.explore?.explores}),(0,e.jsx)(b,{title:d?.support?.title,lists:d?.support?.supports}),(0,e.jsxs)("div",{className:"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4",children:[(0,e.jsxs)("div",{className:"desktop:pb-0 flex items-center justify-between pb-4",children:[(0,e.jsx)(s.Text,{as:"p",html:d?.contact?.title,className:"text-xl font-bold leading-[1.2] text-white"}),i&&(0,e.jsx)("button",{onClick:()=>m(!n),children:n?(0,e.jsx)(c.SubtractIcon,{width:20,height:20}):(0,e.jsx)(c.AddIcon,{width:20,height:20})})]}),(n&&i||!i)&&(0,e.jsx)("div",{className:"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2",children:d?.contact?.contacts?.map(a=>(0,e.jsxs)("div",{className:"flex items-start gap-2",children:[(0,e.jsx)(s.Picture,{source:a?.icon?.url,alt:a?.icon?.alt,className:"size-5 shrink-0"}),(0,e.jsx)(s.Link,{href:a?.link,className:"no-underline",children:(0,e.jsx)(s.Text,{html:a?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})})]},a?.id))}),(0,e.jsx)(g,{country:l||f,className:"desktop:hidden border-b border-[#3D3E3F]",isMobile:i,onChangeCountry:o?.country}),(0,e.jsx)("div",{className:"desktop:hidden mt-8",children:(0,e.jsx)(N,{title:r?.download?.title,apps:r?.download?.apps})}),!!d?.socials?.length&&(0,e.jsx)("div",{className:"mt-8 flex items-center gap-2",children:d?.socials?.map(a=>(0,e.jsx)(s.Link,{href:`${a?.link}?ref=footer`,children:(0,e.jsx)(s.Picture,{source:a?.icon?.url,alt:a?.icon?.alt,className:"size-8 shrink-0"})},a?.id))}),(0,e.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",children:d?.payment?.map(a=>(0,e.jsx)(s.Link,{href:a?.link,children:(0,e.jsx)(s.Picture,{source:a?.icon?.url,alt:a?.icon?.alt,className:"h-[28px] w-[44px] shrink-0"})},a?.id))})]})]})]})},z=({data:t,isMobile:o,event:i,currentCountry:l})=>(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"desktop:items-center desktop:flex desktop:gap-4",children:[(0,e.jsxs)("div",{className:"laptop:flex-row laptop:items-center desktop:flex-[980] flex flex-col items-start gap-4",children:[(0,e.jsx)(s.Text,{html:t?.brand?.currentBrand,className:"text-[#B6B6BA]"}),(0,e.jsx)("div",{className:"laptop:block laptop:mb-[10px] hidden h-[20px] w-px bg-[#B6B6BA]"}),(0,e.jsx)("div",{className:"desktop:gap-6 flex flex-wrap items-center gap-4",children:t?.brand?.brands?.map(n=>(0,e.jsx)(s.Link,{href:`${n?.link}?ref=footer`,children:(0,e.jsx)(s.Text,{html:n?.icon,className:"text-[#B6B6BA] hover:text-white"})},n?.id))})]}),(0,e.jsx)(g,{country:l||t?.country,className:"desktop:flex-[316] desktop:block hidden",isMobile:o,onChangeCountry:i?.country})]}),(0,e.jsx)("div",{className:"h-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1",children:[(0,e.jsx)(s.Text,{html:t?.copyright?.label,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[t?.policy?.policies?.map(n=>(0,e.jsx)(s.Link,{href:`${n?.link}?ref=footer`,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white",children:n?.label},n?.id)),t?.policy?.cookies&&(0,e.jsx)("button",{"data-cc":"show-preferencesModal",onClick:i?.cookiesSet,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white",children:t?.policy?.cookies})]})]})]}),b=({title:t,lists:o,className:i})=>{const[l,n]=(0,p.useState)(!1),[m,r]=(0,p.useState)(!1),d=(0,u.useMediaQuery)({query:"(max-width: 1439px)"});return(0,p.useEffect)(()=>{r(d)},[d]),(0,e.jsxs)("div",{className:(0,x.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",i),children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",onClick:()=>n(!l),children:[(0,e.jsx)(s.Text,{as:"p",html:t,className:"text-xl font-bold leading-[1.2] text-white"}),m&&(0,e.jsx)(e.Fragment,{children:l?(0,e.jsx)(c.SubtractIcon,{width:20,height:20}):(0,e.jsx)(c.AddIcon,{width:20,height:20})})]}),(l&&m||!m)&&(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:o?.map(f=>(0,e.jsx)(s.Link,{href:`${f?.link}?ref=footer`,className:"no-underline",children:(0,e.jsx)(s.Text,{html:f?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},f?.id))})]})},N=({title:t,apps:o,className:i})=>o?.length?(0,e.jsxs)("div",{className:i,children:[(0,e.jsx)(s.Text,{html:t,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex items-center gap-4",children:o?.map(l=>(0,e.jsxs)("div",{className:"flex flex-col items-center gap-[6px]",children:[(0,e.jsx)(s.Link,{href:l?.link,children:(0,e.jsx)(s.Picture,{source:l?.icon?.url,alt:l?.icon?.alt,className:"size-10 shrink-0"})}),l?.label&&(0,e.jsx)(s.Text,{html:l?.label,className:"text-xs font-bold text-[#999999]"})]},l?.id))})]}):null,g=({country:t,isMobile:o,className:i,onChangeCountry:l})=>(0,e.jsx)("div",{className:(0,x.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",i),onClick:()=>l?.(),children:(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,e.jsx)(c.CountryIcon,{width:20,height:20,className:"shrink-0"}),(0,e.jsx)(s.Text,{as:"p",html:t?.countryName||t?.country,className:"desktop:text-[#B6B6BA] text-base font-bold leading-[1.4] text-white hover:text-white"})]}),o&&(0,e.jsx)("button",{children:(0,e.jsx)(c.ArrowRightIcon,{width:20,height:20})})]})});var O=(0,w.withLayout)(S);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/FooterNavigation/index.tsx"],
4
- "sourcesContent": ["import { useEffect, useMemo, useState } from 'react'\nimport { Picture, Text, Container, Link } from '../../components/index.js'\nimport Subscribe from '../Subscribe/index.js'\nimport type { FooterNavigationProps } from './types.js'\nimport { FooterNavigationBlockType } from './types.js'\nimport { AddIcon, SubtractIcon, ArrowRightIcon, CountryIcon } from './icons/index.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nconst FooterNavigation = ({\n data: { footerNavigation } = {},\n currentCountry,\n event,\n subscribeLoading,\n}: FooterNavigationProps) => {\n const [isMobile, setIsMobile] = useState(false)\n\n const mediaQuery = useMediaQuery({ query: '(max-width: 1439px)' })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const country = useMemo(() => {\n return (\n footerNavigation?.footerBlocks?.find((block: any) => block?.blockType === FooterNavigationBlockType.Brand)\n ?.country || {}\n )\n }, [footerNavigation])\n\n return (\n <Container childClassName=\"bg-black py-8 laptop:py-16 flex flex-col desktop:gap-16 gap-8\">\n <Text html={footerNavigation?.story} className=\"desktop:text-sm text-xs font-bold text-[#6D6D6F]\" />\n {footerNavigation?.footerBlocks?.map((block: any) => {\n if (block?.blockType === FooterNavigationBlockType.Signup) {\n return (\n <MarketingConversion\n key={block.id}\n subscribeLoading={subscribeLoading}\n data={block}\n onSubmit={event?.signup}\n />\n )\n }\n if (block?.blockType === FooterNavigationBlockType.Brand) {\n return (\n <FooterBrand\n key={block?.id}\n data={block}\n isMobile={isMobile}\n event={event}\n currentCountry={currentCountry}\n />\n )\n }\n if (block?.blockType === FooterNavigationBlockType.Main) {\n return (\n <MainServices\n key={block.id}\n data={{ ...block, country }}\n event={event}\n isMobile={isMobile}\n currentCountry={currentCountry}\n />\n )\n }\n })}\n </Container>\n )\n}\n\n/**\n * MarketingConversion \u8425\u9500\u8F6C\u5316\u6A21\u5757\n * @param data\n * @param onSubmit signup\u63D0\u4EA4\u4E8B\u4EF6\n * @returns\n */\nconst MarketingConversion = ({\n data,\n onSubmit,\n subscribeLoading,\n}: {\n data: any\n onSubmit?: (_params: any) => void\n subscribeLoading?: boolean\n}) => {\n return (\n <div className=\"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#080A0F] px-4 py-8\">\n <Subscribe\n subscribeMetadata={data?.signup}\n className=\"desktop:flex-[744]\"\n onSubmit={onSubmit}\n loading={subscribeLoading}\n />\n <div className=\"desktop:hidden h-px w-full bg-[#3D3E3F]\" />\n <div className=\"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4\">\n <div className=\"flex-1\">\n <Text html={data?.enjoy?.title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex flex-col gap-2\">\n {data?.enjoy?.enjoys?.map((enjoyItem: any) => (\n <div key={enjoyItem?.id} className=\"flex-start flex gap-2\">\n <Picture source={enjoyItem?.icon?.url} alt={enjoyItem?.icon?.alt} className=\"size-5 shrink-0\" />\n <Text\n html={enjoyItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]\"\n />\n </div>\n ))}\n </div>\n </div>\n <div className=\"desktop:block hidden w-px bg-[#3D3E3F]\" />\n <div className=\"flex-1\">\n <Text html={data?.benefit?.title} className=\"text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex flex-col gap-2\">\n {data?.benefit?.benefits?.map((benefitItem: any) => (\n <Link\n href={`${benefitItem?.link}?ref=footer`}\n asChild={!benefitItem?.link}\n key={benefitItem?.id}\n className=\"no-underline\"\n >\n <Text\n html={benefitItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white\"\n />\n </Link>\n ))}\n </div>\n </div>\n </div>\n </div>\n )\n}\n\n/**\n * MainServices \u4E3B\u5BFC\u822A\u4E0E\u670D\u52A1\u6A21\u5757\n * @param services \u670D\u52A1\n * @param mainNav \u4E3B\u5BFC\u822A\n * @param event \u4E8B\u4EF6\n * @param isMobile \u662F\u5426\u662F\u79FB\u52A8\u7AEF\n * @param currentCountry \u5F53\u524D\u56FD\u5BB6\n * @returns\n */\nconst MainServices = ({\n data,\n event,\n isMobile,\n currentCountry,\n}: {\n data: any\n event: any\n isMobile: boolean\n currentCountry: any\n}) => {\n const [mainNavMenuOpen, setMainNavMenuOpen] = useState<boolean>(false)\n const { services, mainNav, country } = data\n return (\n <div className=\"flex flex-col gap-8\">\n <div\n className={cn({\n 'desktop:gap-16 flex': services?.download?.title,\n })}\n >\n <div\n className={cn('w-full', {\n 'desktop:flex-[1260]': services?.download?.title,\n })}\n >\n <Text html={services?.storeBenefits?.title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div\n className={cn('laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2', {\n 'desktop:max-w-[648px]': services?.download?.title,\n })}\n >\n {services?.storeBenefits?.reasons?.map((reasonItem: any) => (\n <div key={reasonItem?.id} className=\"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2\">\n <Picture source={reasonItem?.icon?.url} alt={reasonItem?.icon?.alt} className=\"size-5 shrink-0\" />\n <Link href={`${reasonItem?.link}?ref=footer`} asChild={!reasonItem?.link} className=\"no-underline\">\n <Text\n html={reasonItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]\"\n />\n </Link>\n </div>\n ))}\n </div>\n </div>\n <DownloadApp\n className={cn({\n 'desktop:flex-[404] hidden desktop:block': services?.download?.title,\n })}\n title={services?.download?.title}\n apps={services?.download?.apps}\n />\n </div>\n <div className=\"desktop:block hidden h-px bg-[#3D3E3F]\" />\n <div className=\"desktop:grid grid-cols-4 gap-4\">\n <MainNavMenu title={mainNav?.products?.title} lists={mainNav?.products?.products} />\n <MainNavMenu title={mainNav?.explore?.title} lists={mainNav?.explore?.explores} />\n <MainNavMenu title={mainNav?.support?.title} lists={mainNav?.support?.supports} />\n <div className=\"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4\">\n <div className=\"desktop:pb-0 flex items-center justify-between pb-4\">\n <Text as=\"p\" html={mainNav?.contact?.title} className=\"text-xl font-bold leading-[1.2] text-white\" />\n {isMobile && (\n <button onClick={() => setMainNavMenuOpen(!mainNavMenuOpen)}>\n {mainNavMenuOpen ? <SubtractIcon width={20} height={20} /> : <AddIcon width={20} height={20} />}\n </button>\n )}\n </div>\n {((mainNavMenuOpen && isMobile) || !isMobile) && (\n <div className=\"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2\">\n {mainNav?.contact?.contacts?.map((contactItem: any) => (\n <div key={contactItem?.id} className=\"flex items-start gap-2\">\n <Picture source={contactItem?.icon?.url} alt={contactItem?.icon?.alt} className=\"size-5 shrink-0\" />\n <Link href={contactItem?.link} className=\"no-underline\">\n <Text\n html={contactItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white\"\n />\n </Link>\n </div>\n ))}\n </div>\n )}\n <ChangeCountry\n country={currentCountry || country}\n className=\"desktop:hidden border-b border-[#3D3E3F]\"\n isMobile={isMobile}\n onChangeCountry={event?.country}\n />\n <div className=\"desktop:hidden mt-8\">\n <DownloadApp title={services?.download?.title} apps={services?.download?.apps} />\n </div>\n {!!mainNav?.socials?.length && (\n <div className=\"mt-8 flex items-center gap-2\">\n {mainNav?.socials?.map((socialItem: any) => (\n <Link href={`${socialItem?.link}?ref=footer`} key={socialItem?.id}>\n <Picture source={socialItem?.icon?.url} alt={socialItem?.icon?.alt} className=\"size-8 shrink-0\" />\n </Link>\n ))}\n </div>\n )}\n <div className=\"mt-4 flex flex-wrap gap-2\">\n {mainNav?.payment?.map((paymentItem: any) => (\n <Link href={paymentItem?.link} key={paymentItem?.id}>\n <Picture\n source={paymentItem?.icon?.url}\n alt={paymentItem?.icon?.alt}\n className=\"h-[28px] w-[44px] shrink-0\"\n />\n </Link>\n ))}\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nconst FooterBrand = ({\n data,\n isMobile,\n event,\n currentCountry,\n}: {\n data: any\n isMobile: boolean\n event: any\n currentCountry: any\n}) => {\n return (\n <div className=\"flex flex-col gap-4\">\n <div className=\"desktop:items-center desktop:flex desktop:gap-4\">\n <div className=\"laptop:flex-row laptop:items-center desktop:flex-[980] flex flex-col items-start gap-4\">\n <Text html={data?.brand?.currentBrand} className=\"text-[#B6B6BA]\" />\n <div className=\"laptop:block laptop:mb-[10px] hidden h-[20px] w-px bg-[#B6B6BA]\" />\n <div className=\"desktop:gap-6 flex flex-wrap items-center gap-4\">\n {data?.brand?.brands?.map((brandItem: any) => (\n <Link href={`${brandItem?.link}?ref=footer`} key={brandItem?.id}>\n <Text html={brandItem?.icon} className=\"text-[#B6B6BA] hover:text-white\" />\n </Link>\n ))}\n </div>\n </div>\n <ChangeCountry\n country={currentCountry || data?.country}\n className=\"desktop:flex-[316] desktop:block hidden\"\n isMobile={isMobile}\n onChangeCountry={event?.country}\n />\n </div>\n <div className=\"h-px bg-[#3D3E3F]\" />\n <div className=\"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1\">\n <Text\n html={data?.copyright?.label}\n className=\"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n <div className=\"flex flex-wrap items-center gap-x-2 gap-y-1\">\n {data?.policy?.policies?.map((policyItem: any) => (\n <Link\n href={`${policyItem?.link}?ref=footer`}\n key={policyItem?.id}\n className=\"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white\"\n >\n {policyItem?.label}\n </Link>\n ))}\n </div>\n </div>\n </div>\n )\n}\n\nconst MainNavMenu = ({ title, lists, className }: { title: string; lists: any[]; className?: string }) => {\n const [mainNavMenuOpen, setMainNavMenuOpen] = useState<boolean>(false)\n const [isMobile, setIsMobile] = useState(false)\n\n const mediaQuery = useMediaQuery({ query: '(max-width: 1439px)' })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n return (\n <div className={cn('desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4', className)}>\n <div className=\"flex items-center justify-between\" onClick={() => setMainNavMenuOpen(!mainNavMenuOpen)}>\n <Text as=\"p\" html={title} className=\"text-xl font-bold leading-[1.2] text-white\" />\n {isMobile && (\n <>{mainNavMenuOpen ? <SubtractIcon width={20} height={20} /> : <AddIcon width={20} height={20} />}</>\n )}\n </div>\n {((mainNavMenuOpen && isMobile) || !isMobile) && (\n <div className=\"mt-4 flex flex-col gap-2\">\n {lists?.map((item: any) => (\n <Link href={`${item?.link}?ref=footer`} key={item?.id} className=\"no-underline\">\n <Text\n html={item?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white\"\n />\n </Link>\n ))}\n </div>\n )}\n </div>\n )\n}\n\n/**\n * DownloadApp \u4E0B\u8F7D\u5E94\u7528\u6A21\u5757\n * @param title\n * @param apps\n * @param className\n * @returns\n */\nconst DownloadApp = ({ title, apps, className }: { title: string; apps: any[]; className?: string }) => {\n if (!apps?.length) return null\n return (\n <div className={className}>\n <Text html={title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex items-center gap-4\">\n {apps?.map((appItem: any) => (\n <div key={appItem?.id} className=\"flex flex-col items-center gap-[6px]\">\n <Link href={appItem?.link}>\n <Picture source={appItem?.icon?.url} alt={appItem?.icon?.alt} className=\"size-10 shrink-0\" />\n </Link>\n {appItem?.label && <Text html={appItem?.label} className=\"text-xs font-bold text-[#999999]\" />}\n </div>\n ))}\n </div>\n </div>\n )\n}\n\n/**\n * ChangeCountry \u5207\u6362\u56FD\u5BB6\u6A21\u5757\n * @param data \u6570\u636E\n * @param isMobile \u662F\u5426\u662F\u79FB\u52A8\u7AEF\n * @returns\n */\nconst ChangeCountry = ({\n country,\n isMobile,\n className,\n onChangeCountry,\n}: {\n country: any\n isMobile: boolean\n className?: string\n onChangeCountry?: () => void\n}) => {\n return (\n <div\n className={cn('desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4', className)}\n onClick={() => onChangeCountry?.()}\n >\n <div className=\"flex items-center justify-between\">\n <div className=\"flex cursor-pointer items-center gap-2\">\n <CountryIcon width={20} height={20} className=\"shrink-0\" />\n <Text\n as=\"p\"\n html={country?.countryName || country?.country}\n className=\"desktop:text-[#B6B6BA] text-base font-bold leading-[1.4] text-white hover:text-white\"\n />\n </div>\n {isMobile && (\n <button>\n <ArrowRightIcon width={20} height={20} />\n </button>\n )}\n </div>\n </div>\n )\n}\n\nexport default withLayout(FooterNavigation)\n"],
5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BACZ,SAAA2B,GAAO,IAAKE,MACX,OAAC,QAAK,KAAM,GAAGA,GAAM,IAAI,cAA8B,UAAU,eAC/D,mBAAC,QACC,KAAMA,GAAM,MACZ,UAAU,oFACZ,GAJ2CA,GAAM,EAKnD,CACD,EACH,GAEJ,CAEJ,EASMX,EAAc,CAAC,CAAE,MAAAQ,EAAO,KAAAI,EAAM,UAAAF,CAAU,IACvCE,GAAM,UAET,QAAC,OAAI,UAAWF,EACd,oBAAC,QAAK,KAAMF,EAAO,UAAU,8CAA8C,KAC3E,OAAC,OAAI,UAAU,+BACZ,SAAAI,GAAM,IAAKC,MACV,QAAC,OAAsB,UAAU,uCAC/B,oBAAC,QAAK,KAAMA,GAAS,KACnB,mBAAC,WAAQ,OAAQA,GAAS,MAAM,IAAK,IAAKA,GAAS,MAAM,IAAK,UAAU,mBAAmB,EAC7F,EACCA,GAAS,UAAS,OAAC,QAAK,KAAMA,GAAS,MAAO,UAAU,oCAAoC,IAJrFA,GAAS,EAKnB,CACD,EACH,GACF,EAdwB,KAwBtBV,EAAgB,CAAC,CACrB,QAAAlB,EACA,SAAAH,EACA,UAAA4B,EACA,gBAAAI,CACF,OAOI,OAAC,OACC,aAAW,MAAG,kEAAmEJ,CAAS,EAC1F,QAAS,IAAMI,IAAkB,EAEjC,oBAAC,OAAI,UAAU,oCACb,qBAAC,OAAI,UAAU,yCACb,oBAAC,eAAY,MAAO,GAAI,OAAQ,GAAI,UAAU,WAAW,KACzD,OAAC,QACC,GAAG,IACH,KAAM7B,GAAS,aAAeA,GAAS,QACvC,UAAU,uFACZ,GACF,EACCH,MACC,OAAC,UACC,mBAAC,kBAAe,MAAO,GAAI,OAAQ,GAAI,EACzC,GAEJ,EACF,EAIJ,IAAOhB,KAAQ,cAAWW,CAAgB",
6
- "names": ["FooterNavigation_exports", "__export", "FooterNavigation_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_Subscribe", "import_types", "import_icons", "import_react_responsive", "import_utils", "import_Styles", "FooterNavigation", "footerNavigation", "currentCountry", "event", "subscribeLoading", "isMobile", "setIsMobile", "mediaQuery", "country", "block", "MarketingConversion", "FooterBrand", "MainServices", "data", "onSubmit", "Subscribe", "enjoyItem", "benefitItem", "mainNavMenuOpen", "setMainNavMenuOpen", "services", "mainNav", "reasonItem", "DownloadApp", "MainNavMenu", "contactItem", "ChangeCountry", "socialItem", "paymentItem", "brandItem", "policyItem", "title", "lists", "className", "item", "apps", "appItem", "onChangeCountry"]
4
+ "sourcesContent": ["import { useEffect, useMemo, useState } from 'react'\nimport { Picture, Text, Container, Link } from '../../components/index.js'\nimport Subscribe from '../Subscribe/index.js'\nimport type { FooterNavigationProps } from './types.js'\nimport { FooterNavigationBlockType } from './types.js'\nimport { AddIcon, SubtractIcon, ArrowRightIcon, CountryIcon } from './icons/index.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nconst FooterNavigation = ({\n data: { footer } = {},\n currentCountry,\n event,\n subscribeLoading,\n classNames,\n}: FooterNavigationProps) => {\n const [isMobile, setIsMobile] = useState(false)\n\n const mediaQuery = useMediaQuery({ query: '(max-width: 1439px)' })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const country = useMemo(() => {\n return footer?.blocks?.find((block: any) => block?.blockType === FooterNavigationBlockType.Brand)?.country || {}\n }, [footer])\n\n return (\n <Container\n className={cn(classNames?.root)}\n childClassName={cn('laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8', classNames?.child)}\n >\n <Text html={footer?.story} className=\"desktop:text-sm text-xs font-bold text-[#6D6D6F]\" />\n {footer?.blocks?.map((block: any) => {\n if (block?.blockType === FooterNavigationBlockType.Signup) {\n return (\n <MarketingConversion\n key={block.id}\n subscribeLoading={subscribeLoading}\n data={block}\n onSubmit={event?.signup}\n />\n )\n }\n if (block?.blockType === FooterNavigationBlockType.Brand) {\n return (\n <FooterBrand\n key={block?.id}\n data={block}\n isMobile={isMobile}\n event={event}\n currentCountry={currentCountry}\n />\n )\n }\n if (block?.blockType === FooterNavigationBlockType.Main) {\n return (\n <MainServices\n key={block.id}\n data={{ ...block, country }}\n event={event}\n isMobile={isMobile}\n currentCountry={currentCountry}\n />\n )\n }\n })}\n </Container>\n )\n}\n\n/**\n * MarketingConversion \u8425\u9500\u8F6C\u5316\u6A21\u5757\n * @param data\n * @param onSubmit signup\u63D0\u4EA4\u4E8B\u4EF6\n * @returns\n */\nconst MarketingConversion = ({\n data,\n onSubmit,\n subscribeLoading,\n}: {\n data: any\n onSubmit?: (_params: any) => void\n subscribeLoading?: boolean\n}) => {\n return (\n <div className=\"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#080A0F] px-4 py-8\">\n <Subscribe\n subscribeMetadata={data?.signup}\n className=\"desktop:flex-[744]\"\n onSubmit={onSubmit}\n loading={subscribeLoading}\n />\n <div className=\"desktop:hidden h-px w-full bg-[#3D3E3F]\" />\n <div className=\"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4\">\n <div className=\"flex-1\">\n <Text html={data?.enjoy?.title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex flex-col gap-2\">\n {data?.enjoy?.enjoys?.map((enjoyItem: any) => (\n <div key={enjoyItem?.id} className=\"flex-start flex gap-2\">\n <Picture source={enjoyItem?.icon?.url} alt={enjoyItem?.icon?.alt} className=\"size-5 shrink-0\" />\n <Text\n html={enjoyItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]\"\n />\n </div>\n ))}\n </div>\n </div>\n <div className=\"desktop:block hidden w-px bg-[#3D3E3F]\" />\n <div className=\"flex-1\">\n <Text html={data?.benefit?.title} className=\"text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex flex-col gap-2\">\n {data?.benefit?.benefits?.map((benefitItem: any) => (\n <Link\n href={`${benefitItem?.link}?ref=footer`}\n asChild={!benefitItem?.link}\n key={benefitItem?.id}\n className=\"no-underline\"\n >\n <Text\n html={benefitItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white\"\n />\n </Link>\n ))}\n </div>\n </div>\n </div>\n </div>\n )\n}\n\n/**\n * MainServices \u4E3B\u5BFC\u822A\u4E0E\u670D\u52A1\u6A21\u5757\n * @param services \u670D\u52A1\n * @param mainNav \u4E3B\u5BFC\u822A\n * @param event \u4E8B\u4EF6\n * @param isMobile \u662F\u5426\u662F\u79FB\u52A8\u7AEF\n * @param currentCountry \u5F53\u524D\u56FD\u5BB6\n * @returns\n */\nconst MainServices = ({\n data,\n event,\n isMobile,\n currentCountry,\n}: {\n data: any\n event: any\n isMobile: boolean\n currentCountry: any\n}) => {\n const [mainNavMenuOpen, setMainNavMenuOpen] = useState<boolean>(false)\n const { services, mainNav, country } = data\n return (\n <div className=\"flex flex-col gap-8\">\n <div\n className={cn({\n 'desktop:gap-16 flex': services?.download?.title,\n })}\n >\n <div\n className={cn('w-full', {\n 'desktop:flex-[1260]': services?.download?.title,\n })}\n >\n <Text html={services?.storeBenefits?.title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div\n className={cn('laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2', {\n 'desktop:max-w-[648px]': services?.download?.title,\n })}\n >\n {services?.storeBenefits?.reasons?.map((reasonItem: any) => (\n <div key={reasonItem?.id} className=\"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2\">\n <Picture source={reasonItem?.icon?.url} alt={reasonItem?.icon?.alt} className=\"size-5 shrink-0\" />\n <Link href={`${reasonItem?.link}?ref=footer`} asChild={!reasonItem?.link} className=\"no-underline\">\n <Text\n html={reasonItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]\"\n />\n </Link>\n </div>\n ))}\n </div>\n </div>\n <DownloadApp\n className={cn({\n 'desktop:flex-[404] hidden desktop:block': services?.download?.title,\n })}\n title={services?.download?.title}\n apps={services?.download?.apps}\n />\n </div>\n <div className=\"desktop:block hidden h-px bg-[#3D3E3F]\" />\n <div className=\"desktop:grid grid-cols-4 gap-4\">\n <MainNavMenu title={mainNav?.products?.title} lists={mainNav?.products?.products} />\n <MainNavMenu title={mainNav?.explore?.title} lists={mainNav?.explore?.explores} />\n <MainNavMenu title={mainNav?.support?.title} lists={mainNav?.support?.supports} />\n <div className=\"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4\">\n <div className=\"desktop:pb-0 flex items-center justify-between pb-4\">\n <Text as=\"p\" html={mainNav?.contact?.title} className=\"text-xl font-bold leading-[1.2] text-white\" />\n {isMobile && (\n <button onClick={() => setMainNavMenuOpen(!mainNavMenuOpen)}>\n {mainNavMenuOpen ? <SubtractIcon width={20} height={20} /> : <AddIcon width={20} height={20} />}\n </button>\n )}\n </div>\n {((mainNavMenuOpen && isMobile) || !isMobile) && (\n <div className=\"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2\">\n {mainNav?.contact?.contacts?.map((contactItem: any) => (\n <div key={contactItem?.id} className=\"flex items-start gap-2\">\n <Picture source={contactItem?.icon?.url} alt={contactItem?.icon?.alt} className=\"size-5 shrink-0\" />\n <Link href={contactItem?.link} className=\"no-underline\">\n <Text\n html={contactItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white\"\n />\n </Link>\n </div>\n ))}\n </div>\n )}\n <ChangeCountry\n country={currentCountry || country}\n className=\"desktop:hidden border-b border-[#3D3E3F]\"\n isMobile={isMobile}\n onChangeCountry={event?.country}\n />\n <div className=\"desktop:hidden mt-8\">\n <DownloadApp title={services?.download?.title} apps={services?.download?.apps} />\n </div>\n {!!mainNav?.socials?.length && (\n <div className=\"mt-8 flex items-center gap-2\">\n {mainNav?.socials?.map((socialItem: any) => (\n <Link href={`${socialItem?.link}?ref=footer`} key={socialItem?.id}>\n <Picture source={socialItem?.icon?.url} alt={socialItem?.icon?.alt} className=\"size-8 shrink-0\" />\n </Link>\n ))}\n </div>\n )}\n <div className=\"mt-4 flex flex-wrap gap-2\">\n {mainNav?.payment?.map((paymentItem: any) => (\n <Link href={paymentItem?.link} key={paymentItem?.id}>\n <Picture\n source={paymentItem?.icon?.url}\n alt={paymentItem?.icon?.alt}\n className=\"h-[28px] w-[44px] shrink-0\"\n />\n </Link>\n ))}\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nconst FooterBrand = ({\n data,\n isMobile,\n event,\n currentCountry,\n}: {\n data: any\n isMobile: boolean\n event: any\n currentCountry: any\n}) => {\n return (\n <div className=\"flex flex-col gap-4\">\n <div className=\"desktop:items-center desktop:flex desktop:gap-4\">\n <div className=\"laptop:flex-row laptop:items-center desktop:flex-[980] flex flex-col items-start gap-4\">\n <Text html={data?.brand?.currentBrand} className=\"text-[#B6B6BA]\" />\n <div className=\"laptop:block laptop:mb-[10px] hidden h-[20px] w-px bg-[#B6B6BA]\" />\n <div className=\"desktop:gap-6 flex flex-wrap items-center gap-4\">\n {data?.brand?.brands?.map((brandItem: any) => (\n <Link href={`${brandItem?.link}?ref=footer`} key={brandItem?.id}>\n <Text html={brandItem?.icon} className=\"text-[#B6B6BA] hover:text-white\" />\n </Link>\n ))}\n </div>\n </div>\n <ChangeCountry\n country={currentCountry || data?.country}\n className=\"desktop:flex-[316] desktop:block hidden\"\n isMobile={isMobile}\n onChangeCountry={event?.country}\n />\n </div>\n <div className=\"h-px bg-[#3D3E3F]\" />\n <div className=\"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1\">\n <Text\n html={data?.copyright?.label}\n className=\"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n <div className=\"flex flex-wrap items-center gap-x-2 gap-y-1\">\n {data?.policy?.policies?.map((policyItem: any) => (\n <Link\n href={`${policyItem?.link}?ref=footer`}\n key={policyItem?.id}\n className=\"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white\"\n >\n {policyItem?.label}\n </Link>\n ))}\n {data?.policy?.cookies && (\n <button\n data-cc=\"show-preferencesModal\"\n onClick={event?.cookiesSet}\n className=\"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white\"\n >\n {data?.policy?.cookies}\n </button>\n )}\n </div>\n </div>\n </div>\n )\n}\n\nconst MainNavMenu = ({ title, lists, className }: { title: string; lists: any[]; className?: string }) => {\n const [mainNavMenuOpen, setMainNavMenuOpen] = useState<boolean>(false)\n const [isMobile, setIsMobile] = useState(false)\n\n const mediaQuery = useMediaQuery({ query: '(max-width: 1439px)' })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n return (\n <div className={cn('desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4', className)}>\n <div className=\"flex items-center justify-between\" onClick={() => setMainNavMenuOpen(!mainNavMenuOpen)}>\n <Text as=\"p\" html={title} className=\"text-xl font-bold leading-[1.2] text-white\" />\n {isMobile && (\n <>{mainNavMenuOpen ? <SubtractIcon width={20} height={20} /> : <AddIcon width={20} height={20} />}</>\n )}\n </div>\n {((mainNavMenuOpen && isMobile) || !isMobile) && (\n <div className=\"mt-4 flex flex-col gap-2\">\n {lists?.map((item: any) => (\n <Link href={`${item?.link}?ref=footer`} key={item?.id} className=\"no-underline\">\n <Text\n html={item?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white\"\n />\n </Link>\n ))}\n </div>\n )}\n </div>\n )\n}\n\n/**\n * DownloadApp \u4E0B\u8F7D\u5E94\u7528\u6A21\u5757\n * @param title\n * @param apps\n * @param className\n * @returns\n */\nconst DownloadApp = ({ title, apps, className }: { title: string; apps: any[]; className?: string }) => {\n if (!apps?.length) return null\n return (\n <div className={className}>\n <Text html={title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex items-center gap-4\">\n {apps?.map((appItem: any) => (\n <div key={appItem?.id} className=\"flex flex-col items-center gap-[6px]\">\n <Link href={appItem?.link}>\n <Picture source={appItem?.icon?.url} alt={appItem?.icon?.alt} className=\"size-10 shrink-0\" />\n </Link>\n {appItem?.label && <Text html={appItem?.label} className=\"text-xs font-bold text-[#999999]\" />}\n </div>\n ))}\n </div>\n </div>\n )\n}\n\n/**\n * ChangeCountry \u5207\u6362\u56FD\u5BB6\u6A21\u5757\n * @param data \u6570\u636E\n * @param isMobile \u662F\u5426\u662F\u79FB\u52A8\u7AEF\n * @returns\n */\nconst ChangeCountry = ({\n country,\n isMobile,\n className,\n onChangeCountry,\n}: {\n country: any\n isMobile: boolean\n className?: string\n onChangeCountry?: () => void\n}) => {\n return (\n <div\n className={cn('desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4', className)}\n onClick={() => onChangeCountry?.()}\n >\n <div className=\"flex items-center justify-between\">\n <div className=\"flex cursor-pointer items-center gap-2\">\n <CountryIcon width={20} height={20} className=\"shrink-0\" />\n <Text\n as=\"p\"\n html={country?.countryName || country?.country}\n className=\"desktop:text-[#B6B6BA] text-base font-bold leading-[1.4] text-white hover:text-white\"\n />\n </div>\n {isMobile && (\n <button>\n <ArrowRightIcon width={20} height={20} />\n </button>\n )}\n </div>\n </div>\n )\n}\n\nexport default withLayout(FooterNavigation)\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA8BI,IAAAI,EAAA,6BA9BJC,EAA6C,iBAC7CC,EAA+C,qCAC/CC,EAAsB,oCAEtBC,EAA0C,sBAC1CC,EAAmE,4BACnEC,EAA8B,4BAC9BC,EAAmB,kCACnBC,EAA2B,kCAE3B,MAAMC,EAAmB,CAAC,CACxB,KAAM,CAAE,OAAAC,CAAO,EAAI,CAAC,EACpB,eAAAC,EACA,MAAAC,EACA,iBAAAC,EACA,WAAAC,CACF,IAA6B,CAC3B,KAAM,CAACC,EAAUC,CAAW,KAAI,YAAS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,UAAAF,CAAU,IACvCE,GAAM,UAET,QAAC,OAAI,UAAWF,EACd,oBAAC,QAAK,KAAMF,EAAO,UAAU,8CAA8C,KAC3E,OAAC,OAAI,UAAU,+BACZ,SAAAI,GAAM,IAAKC,MACV,QAAC,OAAsB,UAAU,uCAC/B,oBAAC,QAAK,KAAMA,GAAS,KACnB,mBAAC,WAAQ,OAAQA,GAAS,MAAM,IAAK,IAAKA,GAAS,MAAM,IAAK,UAAU,mBAAmB,EAC7F,EACCA,GAAS,UAAS,OAAC,QAAK,KAAMA,GAAS,MAAO,UAAU,oCAAoC,IAJrFA,GAAS,EAKnB,CACD,EACH,GACF,EAdwB,KAwBtBV,EAAgB,CAAC,CACrB,QAAAlB,EACA,SAAAH,EACA,UAAA4B,EACA,gBAAAI,CACF,OAOI,OAAC,OACC,aAAW,MAAG,kEAAmEJ,CAAS,EAC1F,QAAS,IAAMI,IAAkB,EAEjC,oBAAC,OAAI,UAAU,oCACb,qBAAC,OAAI,UAAU,yCACb,oBAAC,eAAY,MAAO,GAAI,OAAQ,GAAI,UAAU,WAAW,KACzD,OAAC,QACC,GAAG,IACH,KAAM7B,GAAS,aAAeA,GAAS,QACvC,UAAU,uFACZ,GACF,EACCH,MACC,OAAC,UACC,mBAAC,kBAAe,MAAO,GAAI,OAAQ,GAAI,EACzC,GAEJ,EACF,EAIJ,IAAOjB,KAAQ,cAAWW,CAAgB",
6
+ "names": ["FooterNavigation_exports", "__export", "FooterNavigation_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_Subscribe", "import_types", "import_icons", "import_react_responsive", "import_utils", "import_Styles", "FooterNavigation", "footer", "currentCountry", "event", "subscribeLoading", "classNames", "isMobile", "setIsMobile", "mediaQuery", "country", "block", "MarketingConversion", "FooterBrand", "MainServices", "data", "onSubmit", "Subscribe", "enjoyItem", "benefitItem", "mainNavMenuOpen", "setMainNavMenuOpen", "services", "mainNav", "reasonItem", "DownloadApp", "MainNavMenu", "contactItem", "ChangeCountry", "socialItem", "paymentItem", "brandItem", "policyItem", "title", "lists", "className", "item", "apps", "appItem", "onChangeCountry"]
7
7
  }
@@ -1,3 +1,4 @@
1
+ export type FooterNavigationSemanticName = 'root' | 'child';
1
2
  export interface FooterNavigationProps {
2
3
  data: any;
3
4
  currentCountry?: any;
@@ -6,7 +7,9 @@ export interface FooterNavigationProps {
6
7
  signup?: (_params: any) => void;
7
8
  download?: () => void;
8
9
  country?: () => void;
10
+ cookiesSet?: () => void;
9
11
  };
12
+ classNames?: Partial<Record<FooterNavigationSemanticName, string>>;
10
13
  }
11
14
  export declare enum FooterNavigationBlockType {
12
15
  Signup = "ipc-footer-signup",
@@ -1,2 +1,2 @@
1
- "use strict";var d=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var t=Object.prototype.hasOwnProperty;var s=(r,n)=>{for(var o in n)d(r,o,{get:n[o],enumerable:!0})},b=(r,n,o,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of p(n))!t.call(r,i)&&i!==o&&d(r,i,{get:()=>n[i],enumerable:!(a=u(n,i))||a.enumerable});return r};var c=r=>b(d({},"__esModule",{value:!0}),r);var f={};s(f,{FooterNavigationBlockType:()=>e});module.exports=c(f);var e=(a=>(a.Signup="ipc-footer-signup",a.Main="ipc-footer-main",a.Brand="ipc-footer-brand",a))(e||{});
1
+ "use strict";var r=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var p=(o,a)=>{for(var e in a)r(o,e,{get:a[e],enumerable:!0})},m=(o,a,e,n)=>{if(a&&typeof a=="object"||typeof a=="function")for(let i of s(a))!c.call(o,i)&&i!==e&&r(o,i,{get:()=>a[i],enumerable:!(n=d(a,i))||n.enumerable});return o};var u=o=>m(r({},"__esModule",{value:!0}),o);var g={};p(g,{FooterNavigationBlockType:()=>t});module.exports=u(g);var t=(n=>(n.Signup="ipc-footer-signup",n.Main="ipc-footer-main",n.Brand="ipc-footer-brand",n))(t||{});
2
2
  //# sourceMappingURL=types.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/FooterNavigation/types.ts"],
4
- "sourcesContent": ["export interface FooterNavigationProps {\n data: any\n currentCountry?: any\n subscribeLoading?: boolean\n event?: {\n signup?: (_params: any) => void\n download?: () => void\n country?: () => void\n }\n}\n\nexport enum FooterNavigationBlockType {\n Signup = 'ipc-footer-signup',\n Main = 'ipc-footer-main',\n Brand = 'ipc-footer-brand',\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,+BAAAE,IAAA,eAAAC,EAAAH,GAWO,IAAKE,OACVA,EAAA,OAAS,oBACTA,EAAA,KAAO,kBACPA,EAAA,MAAQ,mBAHEA,OAAA",
4
+ "sourcesContent": ["export type FooterNavigationSemanticName = 'root' | 'child'\n\nexport interface FooterNavigationProps {\n data: any\n currentCountry?: any\n subscribeLoading?: boolean\n event?: {\n signup?: (_params: any) => void\n download?: () => void\n country?: () => void\n cookiesSet?: () => void\n }\n classNames?: Partial<Record<FooterNavigationSemanticName, string>>\n}\n\nexport enum FooterNavigationBlockType {\n Signup = 'ipc-footer-signup',\n Main = 'ipc-footer-main',\n Brand = 'ipc-footer-brand',\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,+BAAAE,IAAA,eAAAC,EAAAH,GAeO,IAAKE,OACVA,EAAA,OAAS,oBACTA,EAAA,KAAO,kBACPA,EAAA,MAAQ,mBAHEA,OAAA",
6
6
  "names": ["types_exports", "__export", "FooterNavigationBlockType", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var ve=Object.create;var K=Object.defineProperty;var ge=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var he=Object.getPrototypeOf,xe=Object.prototype.hasOwnProperty;var Ne=(t,l)=>{for(var o in l)K(t,o,{get:l[o],enumerable:!0})},ee=(t,l,o,c)=>{if(l&&typeof l=="object"||typeof l=="function")for(let s of ye(l))!xe.call(t,s)&&s!==o&&K(t,s,{get:()=>l[s],enumerable:!(c=ge(l,s))||c.enumerable});return t};var J=(t,l,o)=>(o=t!=null?ve(he(t)):{},ee(l||!t||!t.__esModule?K(o,"default",{value:t,enumerable:!0}):o,t)),ke=t=>ee(K({},"__esModule",{value:!0}),t);var Be={};Ne(Be,{default:()=>He});module.exports=ke(Be);var e=require("react/jsx-runtime"),a=J(require("react")),n=require("../../components/index.js"),ue=require("../../shared/Styles.js"),N=require("../../helpers/utils.js"),E=J(require("./NavProvider.js")),y=require("./types.js"),me=require("es-toolkit"),pe=J(require("jump.js")),V=require("@gsap/react"),q=require("gsap"),T=require("./withCategory.js"),L=require("./icons/index.js"),be=J(require("../NavigationSearch/index.js"));const te=(0,a.forwardRef)((t,l)=>{const{data:{headerNavigation:o}={},buildProps:c,event:s,profile:p,theme:v="light",isTop:d=!1,searchResult:b,onSearch:k,isSearching:i,keywords:C,onPrimaryNavClick:w,onSeriesProductClick:u,onSidebarNavClick:x,headerId:f,cartCount:m,menuData:r}=t,g=(0,a.useRef)(null),[S,D]=(0,a.useState)(!1),[P,M]=(0,a.useState)(!1),[O,F]=(0,a.useState)(!1),[_,z]=(0,a.useState)(!1),$=(0,a.useRef)(null),A=()=>{const j=document?.querySelector("body")?.offsetWidth||0;z(j<=1440)};(0,a.useEffect)(()=>(A(),window.addEventListener("resize",A),()=>{window.removeEventListener("resize",A)}),[]),(0,a.useImperativeHandle)(l,()=>$.current),(0,a.useEffect)(()=>{$.current&&d&&(0,pe.default)($.current,{duration:0,offset:$.current?.getBoundingClientRect()?.bottom||0})},[d]),(0,a.useEffect)(()=>{s&&(s.search=()=>D(!0))},[s]),(0,V.useGSAP)(()=>{g?.current&&S&&q.gsap.fromTo(g.current,{height:0},{height:"auto",duration:.3})},[S]),(0,a.useEffect)(()=>{document.documentElement.style.overflow=S?"hidden":"auto"},[S]);const Q=(0,a.useMemo)(()=>o?.headerBar?.actions?.find(j=>j?.blockType===y.HeaderNavigationActionBlockType.Search)?.searchBar?.[0]||{},[o]);return(0,e.jsx)(E.default,{buildProps:c,profile:p,isMobile:_,event:s,payloadData:o,onSidebarNavClick:x,onSeriesProductClick:u,cartCount:m,children:(0,e.jsx)("header",{id:f||"header","data-ui-component-id":"HeaderNavigation",className:"relative z-[100] bg-white",ref:$,children:(0,e.jsxs)("div",{className:(0,N.cn)("hover:bg-white hover:text-black",v==="light"?"text-black":"text-white",{}),onClick:()=>F(!0),children:[(0,e.jsx)(ae,{data:o,className:"desktop:block hidden !bg-white",theme:v,onNavItemClick:()=>F(!0),onPrimaryNavClick:w}),(0,e.jsx)(re,{data:o,menuData:r,className:"desktop:hidden block !bg-white",onPrimaryNavClick:w}),S&&(0,e.jsxs)("div",{className:"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70",style:{height:`calc(100dvh - ${$?.current?.getBoundingClientRect()?.top}px)`},children:[(0,e.jsx)("div",{ref:g,className:(0,N.cn)("overflow-y-auto",{}),children:(0,e.jsx)(be.default,{data:Q,keywords:C,isSearching:i,searchResult:b,onSearch:j=>{k?.(j)},onClose:()=>{k?.(),D(!1)}})}),(0,e.jsx)("div",{className:"flex-1 bg-transparent",onClick:()=>D(!1)})]})]})})})}),ae=(0,a.forwardRef)((t,l)=>{const{data:o,onNavItemClick:c,className:s,theme:p,onPrimaryNavClick:v}=t,{event:d,profile:b}=(0,E.useNavContext)(),[k,i]=(0,a.useState)(!1),C=(0,a.useMemo)(()=>(0,T.WithGroupCategory)(o?.categories?.filter(h=>h?.pcShow)),[o]),[w,u]=(0,a.useState)(null),[x,f]=(0,a.useState)([]),m=(0,a.useRef)(null),[r,g]=(0,a.useState)(!1),S=(0,a.useRef)(null),D=(0,a.useRef)(null),P=(0,a.useRef)(C.map(h=>Array(h?.length||0).fill(null)));(0,a.useEffect)(()=>{C?.length&&f(C?.map((h,H)=>h?.map((B,R)=>({groupIndex:H,index:R,open:!1}))))},[C]);const M=(0,a.useMemo)(()=>{let h=null;for(const H of x){for(const B of H)if(B.open){h=B;break}if(h)break}return h},[x]);(0,a.useEffect)(()=>{document.documentElement.style.overflow=M?.open||r?"hidden":"auto"},[M?.open,r]);const O=(h,H,B)=>{if(g(!1),w?.components?.[0]?.blockType===y.HeaderNavigationBlockType.Links)w?.components?.[0]?.url&&window.open(w?.components?.[0]?.url);else{const R=C?.flat()||[],W=R?.findIndex(Y=>Y?.id===C[H][B]?.id);h.stopPropagation(),c?.(),v?.(R[W],W),u(C[H][B]),f(Y=>Y.map(fe=>fe.map(U=>U.groupIndex===H&&U.index===B?{...U,open:!U.open}:{...U,open:!1})))}},F=()=>{f(h=>h.map(H=>H.map(B=>({...B,open:!1}))))},_=(0,a.useMemo)(()=>{if(w)return w?.components?.[0]?.blockType},[w]),z=(0,T.WithSidebar)(ne,w),$=(0,T.WithMulticol)(we,w),A=(0,T.WithSupports)(Ce,{categoriesItem:w,currentNavItemRef:P.current?.[M?.groupIndex||0]?.[M?.index||0]}),Q=(0,a.useMemo)(()=>{switch(_){case y.HeaderNavigationBlockType.Sidebar:return(0,e.jsx)(z,{});case y.HeaderNavigationBlockType.Supports:return(0,e.jsx)(A,{});case y.HeaderNavigationBlockType.Multicol:return(0,e.jsx)($,{});default:return null}},[_,w]),j=(0,a.useMemo)(()=>o?.headerBar?.actions?.filter(h=>h?.pcShow),[o]),I=(0,a.useMemo)(()=>j?.find(h=>h?.blockType===y.HeaderNavigationActionBlockType.Profile),[j]),X=(0,a.useCallback)(()=>{g(h=>!h)},[]);return(0,a.useEffect)(()=>{if(m?.current){const h=m.current;return h.addEventListener("click",X),()=>{h.removeEventListener("click",X)}}},[X]),(0,V.useGSAP)(()=>{M?.open&&q.gsap.fromTo(D?.current,{height:0},{height:"auto"})},[M?.open]),(0,e.jsxs)(n.Container,{className:(0,N.cn)("relative h-[96px]",s),children:[(0,e.jsxs)("div",{ref:S,onClick:F,className:"flex h-full flex-col justify-end gap-4",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)(ce,{}),(0,e.jsx)(Z,{ref:m,actions:j,activeStatus:r})]}),(0,e.jsx)("div",{className:"flex justify-between",children:C?.map((h,H)=>(0,e.jsx)("div",{className:"flex gap-3",children:h?.map((B,R)=>(0,e.jsx)("div",{ref:W=>{P.current[H][R]=W},className:"group cursor-pointer",children:(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1 pb-4",onClick:W=>O(W,H,R),children:[(0,e.jsx)(n.Text,{html:B.text,className:"text-sm font-bold leading-[1.4]"}),(0,e.jsx)(L.DownArrow,{className:(0,N.cn)("size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100",{"rotate-180":M?.groupIndex===H&&M?.index===R,"opacity-100":k&&M?.groupIndex===H&&M?.index===R})})]}),(0,e.jsx)("div",{className:(0,N.cn)("absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500",{"w-[calc(100%-20px)]":M?.groupIndex===H&&M?.index===R},p==="dark"?"bg-white":"bg-[#080A0F]")})]})},B.id))},`groupCategory-${H}`))})]}),(0,e.jsxs)("div",{className:(0,N.cn)("absolute left-0 top-full z-[999] flex w-full flex-col overflow-hidden border-t border-b-[#E4E5E6] bg-black/70 text-black",{hidden:!(M?.open&&w)}),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{height:`calc(100dvh - ${S?.current?.getBoundingClientRect()?.bottom}px)`},children:[(0,e.jsx)("div",{ref:D,className:(0,N.cn)("relative z-50",{"overflow-hidden":_!==y.HeaderNavigationBlockType.Supports}),children:Q}),(0,e.jsx)("div",{className:"flex-1 bg-transparent",onClick:F})]}),r&&(0,e.jsxs)("div",{className:"absolute left-0 top-full z-[999] flex h-dvh w-full bg-black/70",children:[(0,e.jsx)("div",{className:"absolute w-[272px] bg-white p-4",style:{right:`calc(100% - ${m?.current?.getBoundingClientRect()?.right}px)`,top:"-36px"},children:b?.email?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(n.Text,{html:b?.nick_name||I?.welcome,className:"text-sm font-bold"}),(0,e.jsx)("div",{className:"mt-2 h-px bg-[#D9D9D9]"}),(0,e.jsx)("div",{className:"mt-2",children:I?.profiles?.map(h=>(0,e.jsx)(G,{className:"py-2",label:h?.title,href:h?.url},h.id))})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(L.Polygon,{className:"absolute -top-2 right-[46px] z-30 text-white"}),(0,e.jsx)(n.Text,{html:I?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),(0,e.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:I?.benefits?.map(h=>(0,e.jsxs)("div",{className:"flex items-center gap-[6px]",children:[(0,e.jsx)(n.Picture,{source:h.benefitIcon?.url,className:"size-4",alt:h.benefit,width:16,height:16}),(0,e.jsx)(n.Text,{html:h.benefit,className:"text-sm font-bold leading-[1.4]"})]},h.id))}),(0,e.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[(0,e.jsx)(n.Button,{variant:"secondary",size:"lg",onClick:()=>d?.join?.(),children:(0,e.jsx)(n.Text,{html:I?.primaryButton||"Join Now",className:"font-bold"})}),(0,e.jsx)(n.Button,{variant:"primary",size:"lg",onClick:()=>d?.login?.(),children:(0,e.jsx)(n.Text,{html:I?.secondaryButton||"Log In",className:"font-bold"})})]})]})}),(0,e.jsx)("div",{className:"flex-1 bg-transparent",onClick:()=>g(!1)})]})]})}),ne=a.default.memo(({sidebarCategoriesMetadata:t,seriesMetadata:l})=>{const{buildProps:o,onSidebarNavClick:c}=(0,E.useNavContext)(),[s,p]=(0,a.useState)([]),[v,d]=(0,a.useState)(-1),b=(0,a.useRef)(null),k=(0,a.useCallback)(()=>{const u=t?.subcategories;if(!u?.length)return;const x=u.findIndex(r=>!!r?.subSubCategories),f=u.findIndex(r=>!r?.subSubCategories),m=u.map((r,g)=>({index:g,open:x===g||f===g}));p(m)},[t]);(0,a.useEffect)(()=>{k()},[k]);const i=(0,a.useMemo)(()=>{const u=t?.subcategories?.[s?.find(f=>f.open)?.index||0],x=l?.find(f=>f?.label?.toLowerCase()===u?.label?.toLowerCase())||{};if(u?.collections){const f=o?.categories?.[u?.collections]||{};return{label:x?.label,isCollection:!0,banner:x?.banner,primary:x?.primary,series:[{products:f?.products}]}}else if(u?.subSubCategories){const f=u?.subSubCategories?.[v],m=l?.find(r=>r?.label?.toLowerCase()===f?.label?.toLowerCase())||{};if(f?.collections){const r=o?.categories?.[f?.collections]||{};return{label:m?.label,isCollection:!0,banner:m?.banner,primary:m?.primary,series:[{products:r?.products}]}}else return m}else return x},[t,s,v,l]),C=(0,a.useCallback)((u,x)=>{if(x?.subSubCategories?.length>0?d(0):d(-1),x?.subSubCategories?.length>0)p(f=>f.map(m=>m.index===u?{...m,open:!0}:{...m,open:!1}));else{const m=t?.subcategories?.findIndex(r=>!!r?.subSubCategories);p(r=>r.map(g=>({...g,open:g.index===u||g.index===m})))}},[t,k]),w=(u,x)=>{p(f=>f.map(m=>m.index===u?{...m,open:!0}:{...m,open:!1})),d(x)};return(0,e.jsxs)(n.Container,{childClassName:"lg-desktop:gap-12 flex bg-white gap-8",children:[(0,e.jsxs)("div",{className:"lg-desktop:basis-[356px] flex basis-[284px] flex-col gap-4 py-4",style:{userSelect:"none"},ref:b,children:[(0,e.jsx)("div",{className:"desktop:h-[416px] flex flex-col overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t?.subcategories?.map((u,x)=>{const f=Array.isArray(u?.subSubCategories)&&u?.subSubCategories?.length>0;return(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:(0,N.cn)("flex cursor-pointer items-center justify-between",{"bg-[#F5F5F7]":!f&&s?.find(m=>m.index===x)?.open}),onClick:()=>{C(x,u),c?.(u,x)},children:[(0,e.jsx)(n.Text,{html:u.label,className:"p-4 text-sm font-bold leading-[1.4]"}),f&&(0,e.jsx)(L.DownArrow,{className:(0,N.cn)("size-4",{"rotate-180":s?.find(m=>m.index===x)?.open})})]}),s?.find(m=>m.index===x)?.open&&(0,e.jsx)("div",{className:"flex flex-col",children:u.subSubCategories?.map((m,r)=>(0,e.jsx)(n.Text,{html:m.label,onClick:()=>{w(x,r),c?.(m,r)},className:(0,N.cn)("cursor-pointer px-6 py-4 text-sm font-bold leading-[1.4] text-[#6D6D6F] hover:bg-[#F5F5F7]",{"bg-[#F5F5F7]":v===r})},`subSubItem-${x}-${r}`))})]},`subcategoryItem-${x}`)})}),t&&(0,e.jsx)("div",{className:"flex",children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[t?.primary&&(0,e.jsx)(n.Button,{as:"a",href:`${t?.primary?.url}?ref=${t?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"lg-desktop:text-base text-sm",children:t?.primary?.label}),t?.secondary&&(0,e.jsx)(n.Button,{as:"a",href:t?.secondary?.url,variant:"link",size:"lg",className:"lg-desktop:text-base justify-start !p-0 text-sm",children:t?.secondary?.label})]})})]}),(0,e.jsxs)("div",{className:"flex-1 py-4",children:[Reflect.ownKeys(i).length>0&&(0,e.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(n.Text,{html:i?.label,className:"lg-desktop:text-2xl text-xl font-bold leading-[1.4]"}),i?.primary&&!i?.primary?.hide&&(0,e.jsx)(n.Button,{as:"a",href:`${i?.primary?.url}?ref=${i?.label}_viewmore`,variant:"link",size:"lg",className:"lg-desktop:text-base justify-start !p-0 text-sm font-bold leading-[1.2] no-underline",children:i?.primary?.label})]}),(0,e.jsx)(n.Link,{href:i?.guide?.url,className:"lg-desktop:text-base text-sm leading-[1.2] text-[#6D6D6F]",children:i?.guide?.label})]}),(0,e.jsx)("div",{className:"flex h-[426px] flex-col gap-4 overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:i?.series?.map((u,x)=>(0,e.jsxs)("div",{children:[u.label&&(0,e.jsx)(n.Text,{html:u.label,className:"mb-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[!!i?.banner&&(0,e.jsx)(n.Link,{asChild:!i?.banner?.href,href:i?.banner?.href,children:(0,e.jsxs)("div",{className:"[&_img]:hover:duration-600 relative [&_img]:hover:scale-110 [&_img]:hover:transition-all",children:[(0,e.jsx)(n.Picture,{source:i?.banner?.imageUrl,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(n.Heading,{size:2,html:i?.banner?.title||"Buy in Guide",className:"font-bold text-white"}),(0,e.jsx)(n.Text,{html:i?.banner?.desc||"20.000mAh",className:"text-sm font-bold text-white"})]})]})}),u.products?.map((f,m)=>(0,e.jsx)(le,{seriesLabel:i?.label,product:f,isCollection:i?.isCollection},`seriesProductItem-${m}`))]})]},`seriesItem-${x}`))})]})]})}),we=({multicolMetadata:t})=>{const l=(0,a.useRef)(null);return(0,e.jsx)("div",{ref:l,children:(0,e.jsx)(n.Container,{childClassName:"bg-white",className:"h-full",children:(0,e.jsx)("div",{className:"flex gap-4 py-4",children:t?.map((o,c)=>(0,e.jsx)("div",{className:"w-1/4",children:(0,e.jsx)(oe,{item:o})},`multicolItem-${o?.label}-${c}`))})})})},Ce=({supportsMetadata:t,currentNavItemRef:l})=>{const o=(0,a.useRef)(null),[c,s]=(0,a.useState)(null),[p,v]=(0,a.useState)(0);(0,a.useEffect)(()=>{if(o?.current){const b=o?.current?.getBoundingClientRect();v(b.height)}},[o]);const d=(0,me.debounce)(()=>{if(l){const b=l.getBoundingClientRect();s(b)}},500);return(0,a.useEffect)(()=>(d(),window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}),[d]),(0,a.useEffect)(()=>{if(l){const b=l.getBoundingClientRect();s(b)}},[l]),(0,e.jsx)("div",{className:"absolute top-0 h-full overflow-hidden bg-white transition-all duration-500",style:{right:`calc(100% - ${c?.right}px)`,height:p},children:(0,e.jsx)("div",{ref:o,className:"p-4",children:t?.map(b=>(0,e.jsx)("div",{className:"py-2",children:(0,e.jsx)(n.Link,{href:b.url,className:"text-sm font-bold leading-[1.4] no-underline",children:b.label})},b.id))})})},le=({product:t,isCollection:l,position:o,seriesLabel:c})=>{const{buildProps:s,onSeriesProductClick:p}=(0,E.useNavContext)();let v=l?t:s?.products?.find(i=>i.handle===t.handle);const d=v?.variants?.find(i=>i.sku===t.sku)||v?.variants?.[0],b=(0,a.useMemo)(()=>`/products/${v?.handle}?variant=${(0,N.atobID)(d?.id)}`,[v?.handle,d?.id]),k=(0,a.useMemo)(()=>v?.tags?.filter?.(i=>i?.startsWith?.("CLtag"))?.map?.(i=>i?.replace?.("CLtag:",""))?.slice?.(0,2),[v?.tags]);return d?.availableForSale?(0,e.jsx)(n.Link,{href:b,onClick:i=>{i.preventDefault(),window.open(b),p?.(v,o||0,c)},className:"no-underline hover:text-current",children:(0,e.jsxs)("div",{className:"flex shrink-0 items-center gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110",children:[(0,e.jsx)("div",{className:"shrink-0",children:(0,e.jsx)(n.Picture,{source:`${d?.image?.url||t?.images?.[0]?.url}}`,width:90,height:90,className:"size-[96px]",imgClassName:"object-contain h-full"})}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)("div",{className:"flex gap-1",children:Array.isArray(k)&&k?.map((i,C)=>(0,e.jsx)(n.Text,{as:"p",html:i,className:"text-brand-0 mb-1 inline-block h-[24px] whitespace-nowrap rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[22px]"},C))}),(0,e.jsx)(n.Text,{className:"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]",html:v?.title||t?.name}),t?.desc&&(0,e.jsx)(n.Text,{as:"p",html:t?.desc,className:"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]"})]})]})}):null},oe=({item:t,allPicture:l})=>(0,e.jsxs)(e.Fragment,{children:[t?.columns&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(n.Text,{html:t.label,as:"div",className:"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsx)("div",{className:"mt-2 flex flex-col",children:t.columns?.map(o=>(0,e.jsxs)("div",{className:"flex items-center gap-1 py-2",children:[(0,e.jsx)(n.Link,{href:`${o.url}?ref=navMenu`,asChild:!o.url,className:"text-sm font-bold leading-[1.4] no-underline",children:o.label}),o?.badge&&(0,e.jsx)(n.Text,{as:"p",html:o?.badge||"badge",className:"text-brand-0 h-[24px] rounded-full border-[1.6px] border-[var(--brand-color-0)] px-[6px] text-sm font-bold !leading-[22px]"})]},o.label))})]}),t?.imageUrl&&(0,e.jsx)("div",{className:(0,N.cn)("laptop:h-[280px] desktop:h-[224px] lg-desktop:h-[280px] tablet:max-w-[346px] laptop:max-w-[440px] desktop:w-full relative h-[240px] max-w-[358px] overflow-hidden",{"tablet:max-w-none laptop:max-w-none":l}),children:(0,e.jsxs)(n.Link,{href:`${t.url}?ref=navMenu`,asChild:!t.url,children:[(0,e.jsx)(n.Picture,{source:t.imageUrl,width:404,height:280,className:"size-full",imgClassName:"object-cover h-full hover:scale-105 transition-all duration-300"}),(0,e.jsxs)("div",{className:"absolute bottom-4 left-4 z-10 flex flex-col justify-end no-underline",children:[(0,e.jsx)(n.Text,{html:t.title,className:(0,N.cn)("lg-desktop:text-2xl text-xl font-bold leading-[1.2] text-white",{"text-black":t?.theme==="dark"})}),t.subtitle&&(0,e.jsx)(n.Text,{html:t.subtitle,className:(0,N.cn)("text-sm font-bold leading-[1.4] text-white",{"text-black":t?.theme==="dark"})}),t?.primary?.label&&(0,e.jsx)(n.Button,{as:"a",href:t?.primary?.url,variant:"link",size:"lg",className:(0,N.cn)("mr-auto !p-0 text-sm font-bold leading-[1.4] text-white",{"text-black":t?.theme==="dark"}),children:t?.primary?.label||"more"})]})]})})]}),re=(0,a.forwardRef)(({data:t,menuData:l,className:o,onPrimaryNavClick:c},s)=>{const p=(0,a.useMemo)(()=>(0,T.WithGroupCategory)(t?.categories?.filter(z=>z?.mobileShow)),[t]),{currentMenu:v,setCurrentMenu:d,subSubCategory:b}=(0,E.useNavContext)(),[k,i]=(0,a.useState)(!1),[C,w]=(0,a.useState)(0),[u,x]=(0,a.useState)(null),f=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(f?.current&&k){const z=f?.current?.getBoundingClientRect();w(window?.innerHeight-(z?.bottom||0))}},[k]),(0,V.useGSAP)(()=>{q.gsap.fromTo(f.current,{height:0},{height:C,duration:.3})},[C]),(0,a.useEffect)(()=>{document.documentElement.style.overflow=k?"hidden":"auto"},[k]);const m=(0,a.useMemo)(()=>u?.components?.[0]?.blockType,[u]),r=(0,T.WithSupports)(Me,{categoriesItem:u}),g=(0,T.WithSidebar)(De,u),S=(0,T.WithMulticol)(Le,u),D=(0,a.useMemo)(()=>{switch(m){case y.HeaderNavigationBlockType.Sidebar:return(0,e.jsx)(g,{});case y.HeaderNavigationBlockType.Supports:return(0,e.jsx)(r,{});case y.HeaderNavigationBlockType.Multicol:return(0,e.jsx)(S,{});default:return null}},[m,u,r]),P=(0,a.useCallback)(()=>{i(!1),w(0),d&&d(y.HeaderNavigationMenu.Primary)},[i,w,d]),M=(0,a.useMemo)(()=>t?.headerBar?.actions?.filter(z=>z?.mobileShow&&z?.blockType!==y.HeaderNavigationActionBlockType.Profile),[t]),O=(0,a.useMemo)(()=>t?.headerBar?.actions?.find(z=>z?.mobileShow&&z?.blockType===y.HeaderNavigationActionBlockType.Profile)||{},[t]),F=(0,a.useMemo)(()=>{switch(v){case y.HeaderNavigationMenu.Primary:return(0,e.jsx)(ze,{actions:M,menuOpen:k,onMenuOpenClose:()=>{i(!1),w(0)},onMenuOpenClick:()=>i(!0)});case y.HeaderNavigationMenu.Secondary:return(0,e.jsx)(de,{title:u?.text,onMenuOpenClose:P,onMenuBackClick:()=>d?.(y.HeaderNavigationMenu.Primary)});case y.HeaderNavigationMenu.Third:return(0,e.jsx)(de,{title:b?.label,onMenuOpenClose:P,onMenuBackClick:()=>d?.(y.HeaderNavigationMenu.Secondary)});default:return null}},[k,v,d,u,M,b,P]),_=(0,a.useCallback)((z,$)=>{const A=Array.isArray(p)?Array.isArray(p[z])?p[z][$]:{}:{};x(A),A?.components?.[0]?.blockType===y.HeaderNavigationBlockType.Links?A?.components?.[0]?.url&&window.open(A?.components?.[0]?.url):d?.(y.HeaderNavigationMenu.Secondary)},[p,d]);return(0,e.jsxs)(n.Container,{className:(0,N.cn)("relative h-[52px]",o),children:[F,k&&(0,e.jsxs)("div",{ref:f,className:"absolute left-0 top-full z-[999] w-full overflow-y-auto border-t border-[#E4E5E6] bg-white text-black",style:{height:C},children:[v===y.HeaderNavigationMenu.Primary?(0,e.jsx)("div",{className:"pt-4",children:(0,e.jsx)(n.BrandStrip,{data:l})}):null,v===y.HeaderNavigationMenu.Primary?(0,e.jsx)(Se,{categories:p,onPrimaryMenuClick:_,onPrimaryNavClick:c,profileAction:O}):D]})]})}),Se=({categories:t,onPrimaryMenuClick:l,profileAction:o,onPrimaryNavClick:c})=>{const{onSidebarNavClick:s}=(0,E.useNavContext)();return(0,e.jsxs)("div",{className:"flex h-full flex-col justify-between",children:[(0,e.jsx)("div",{className:"tablet:px-8 laptop:px-16 p-4",children:t?.map((p,v)=>(0,e.jsxs)("div",{className:"",children:[(0,e.jsx)("div",{className:(0,N.cn)("my-2 h-px w-full bg-[#E5E5E7]")}),p?.map((d,b)=>(0,e.jsx)(G,{label:d.text,onClick:()=>{const i=(t?.flat()||[])?.findIndex(C=>C?.id===t[v][b]?.id);l(v,b),c?.(d,i)},icon:d.components?.[0]?.icon},d.id))]},`groupCategory-${v}`))}),(0,e.jsx)(Pe,{profileAction:o})]})},De=({sidebarCategoriesMetadata:t,seriesMetadata:l})=>{const{currentMenu:o,setCurrentMenu:c,subSubCategory:s,setSubSubCategory:p,setCurrentSeriesMetadata:v,currentSeriesMetadata:d,buildProps:b,onSidebarNavClick:k}=(0,E.useNavContext)(),[i,C]=(0,a.useState)([]),[w,u]=(0,a.useState)([]);(0,a.useEffect)(()=>{t?.subcategories?.length&&C(t?.subcategories?.map((r,g)=>({index:g,open:!1})))},[t]),(0,a.useEffect)(()=>{s?.subSubCategories?.length&&u(s?.subSubCategories?.map((r,g)=>({index:g,open:g===0})))},[s]);const x=(0,a.useCallback)((r,g)=>{c&&c(y.HeaderNavigationMenu.Third),p?.(r);const S=l?.find(D=>g!==void 0?r?.subSubCategories?.[g]?.label?.toLowerCase()===D.label?.toLowerCase():r?.label?.toLowerCase()===D.label?.toLowerCase())||{};if(r?.collections){const D=b?.categories?.[r?.collections]||{};v?.({label:S?.label,isCollection:!0,banner:S?.banner,primary:S?.primary,series:[{products:D?.products}]})}else v?.(S)},[l,t,c,p,v]),f=(0,a.useMemo)(()=>l?.find(r=>!!r?.guide)?.guide,[l,t]);return(0,a.useMemo)(()=>{switch(o){case y.HeaderNavigationMenu.Secondary:return(0,e.jsxs)("div",{className:"tablet:px-8 laptop:px-16 tablet:justify-start tablet:gap-16 flex h-full flex-col justify-between p-4",children:[(0,e.jsx)("div",{children:t?.subcategories?.map((r,g)=>(0,e.jsx)("div",{children:(0,e.jsx)(G,{label:r?.label,active:i.find(S=>S.index===g)?.open,onClick:()=>{x(r),k?.(r,g)}})},`${r.label}-${g}`))}),(0,e.jsxs)("div",{className:"tablet:items-start flex flex-col items-center gap-4",children:[t?.primary&&(0,e.jsx)(n.Button,{as:"a",href:`${t?.primary?.url}?ref=${t?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"tablet:w-auto w-full text-base",children:t?.primary?.label}),t?.secondary&&(0,e.jsx)(n.Button,{as:"a",href:t?.secondary?.url,variant:"link",size:"lg",className:"tablet:w-auto tablet:px-0 w-full py-0 text-base",children:t?.secondary?.label})]})]});case y.HeaderNavigationMenu.Third:return(0,e.jsxs)("div",{className:"tablet:px-8 laptop:px-16 p-4",children:[s?.subSubCategories?s?.subSubCategories?.map((r,g)=>{const S=l?.find(P=>P.label.toLowerCase()===r?.label?.toLowerCase())||{};let D={};if(r?.collections){const P=b?.categories?.[r?.collections]||{};D={label:S?.label,isCollection:!0,banner:S?.banner,primary:S?.primary,series:[{products:P?.products}]}}else D=S;return(0,e.jsxs)("div",{children:[Reflect.ownKeys(r).length>0&&(0,e.jsx)(se,{matchSeriesMetadata:D,onSubSubCategoryItemClick:()=>{k?.(r,g),u(P=>P.map((M,O)=>({...M,open:O===g?!M.open:M.open})))},expanded:!!w?.find(P=>P.index===g)?.open}),w?.find(P=>P.index===g)?.open&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ie,{matchSeriesMetadata:D}),D?.primary&&(0,e.jsx)("div",{className:"my-4 text-center",children:(0,e.jsx)(n.Button,{as:"a",href:D?.primary?.url,className:"text-base leading-[1.2] no-underline",variant:"secondary",size:"base",children:D?.primary?.label})})]})]},`${r.label}-${g}`)}):(0,e.jsxs)(e.Fragment,{children:[Reflect.ownKeys(d).length>0&&(0,e.jsx)(se,{matchSeriesMetadata:d}),(0,e.jsx)(ie,{matchSeriesMetadata:d}),d?.primary&&(0,e.jsx)("div",{className:"my-4 text-center ",children:(0,e.jsx)(n.Button,{as:"a",href:`${d?.primary?.url}?ref=${d?.label}_viewmore`,variant:"secondary",size:"base",className:"text-base leading-[1.2] no-underline",children:d?.primary?.label})})]}),f&&(0,e.jsx)(n.Link,{href:f?.url,children:(0,e.jsx)("div",{className:"mt-4",children:(0,e.jsx)(n.Text,{html:f?.label,className:"text-sm font-bold leading-[1.2] text-[#6D6D6F]"})})})]});default:return null}},[o,t,c,l,i,w,p,s,v,d])},se=({matchSeriesMetadata:t,onSubSubCategoryItemClick:l,expanded:o})=>(0,e.jsxs)("div",{className:"tablet:pt-0 flex items-center justify-between py-4",onClick:l,children:[t?.label&&(0,e.jsx)(n.Text,{html:t?.label,className:"text-sm font-bold leading-[1.4]"}),l&&(0,e.jsx)(L.DownArrow,{className:(0,N.cn)("size-5",{"rotate-180":o})})]}),ie=({matchSeriesMetadata:t})=>(0,e.jsx)("div",{className:"laptop:gap-3 flex flex-col gap-2",children:!!t?.series?.length&&t?.series?.map((l,o)=>(0,e.jsxs)("div",{children:[l.label&&(0,e.jsx)(n.Text,{html:l.label,className:"mb-2 text-sm font-bold leading-[1.4] text-[#3D3D3F]"}),(0,e.jsxs)("div",{className:"laptop:grid-cols-3 laptop:gap-4 tablet:grid tablet:grid-cols-2 tablet:gap-3 flex flex-col gap-2",children:[!!t?.banner&&(0,e.jsx)(n.Link,{asChild:!t?.banner?.href,href:t?.banner?.href,children:(0,e.jsxs)("div",{className:"[&_img]:hover:duration-600 relative [&_img]:hover:scale-110 [&_img]:hover:transition-all",children:[(0,e.jsx)(n.Picture,{source:t?.banner?.imageUrl,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(n.Heading,{size:2,html:t?.banner?.title||"Buy in Guide",className:(0,N.cn)("font-bold text-white",{"text-black":t?.banner?.theme==="dark"})}),(0,e.jsx)(n.Text,{html:t?.banner?.desc||"20.000mAh",className:(0,N.cn)("text-sm font-bold text-white",{"text-black":t?.banner?.theme==="dark"})})]})]})}),l.products?.map((c,s)=>(0,e.jsx)(le,{position:s,product:c,seriesLabel:t?.label,isCollection:t?.isCollection},`seriesProductItem-${o}-${s}`))]})]},`seriesItem-${o}`))}),Me=({supportsMetadata:t})=>(0,e.jsx)("div",{className:"tablet:px-8 laptop:px-16 p-4",children:t?.map(l=>(0,e.jsx)(G,{href:l.url,label:l.label,onClick:()=>{}},l.id))}),Le=({multicolMetadata:t})=>{const l=(0,a.useMemo)(()=>!t?.some(o=>!!o.columns),[t]);return(0,e.jsx)("div",{className:(0,N.cn)("tablet:py-4 tablet:px-8 laptop:px-16 tablet:gap-6 flex flex-col gap-4 p-4",{"tablet:grid tablet:grid-cols-2 tablet:gap-3 laptop:gap-4":l}),children:t?.map((o,c)=>(0,e.jsx)("div",{children:(0,e.jsx)(oe,{item:o,allPicture:l})},`multicolItem-${o?.label}-${c}`))})},Pe=({profileAction:t})=>{const[l,o]=(0,a.useState)(!1),{profile:c,event:s}=(0,E.useNavContext)();return(0,e.jsxs)("div",{className:(0,N.cn)("tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6",{"p-4":l}),children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",onClick:()=>o(!l),children:[(0,e.jsxs)("div",{className:"flex items-center gap-[14px]",children:[(0,e.jsx)("div",{className:"flex size-[40px] shrink-0 items-center justify-center rounded-full bg-white",children:(0,e.jsx)(L.User,{})}),(0,e.jsx)(n.Text,{html:c?.nick_name||t?.welcome,className:"text-base font-bold leading-[1.4]"})]}),!c?.email&&(0,e.jsx)(L.DownArrow,{className:(0,N.cn)("laptop:size-4 size-5",{"rotate-180":l})})]}),c?.email&&(0,e.jsx)("div",{className:"mt-4",children:t?.profiles?.map(p=>(0,e.jsx)(G,{label:p?.title,href:p?.url},p.id))}),l&&!c?.email&&(0,e.jsxs)("div",{className:"mt-4",children:[(0,e.jsx)(n.Text,{html:t?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),(0,e.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:t?.benefits?.map(p=>(0,e.jsxs)("div",{className:"flex items-center gap-[6px]",children:[(0,e.jsx)(n.Picture,{source:p.benefitIcon?.url,className:"size-4",alt:p.benefit,width:16,height:16}),(0,e.jsx)(n.Text,{html:p.benefit,className:"text-sm font-bold leading-[1.4]"})]},p.id))})]}),!c?.email&&(0,e.jsxs)("div",{className:"mt-4 flex items-center gap-3",children:[(0,e.jsx)(n.Button,{className:"tablet:flex-none flex-1",variant:"secondary",size:"base",onClick:()=>s?.join?.(),children:(0,e.jsx)(n.Text,{html:t?.primaryButton||"Join Now",className:"text-sm font-bold leading-[1.4]"})}),(0,e.jsx)(n.Button,{className:"tablet:flex-none flex-1",variant:"primary",size:"base",onClick:()=>s?.login?.(),children:(0,e.jsx)(n.Text,{html:t?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]})},ze=({menuOpen:t,onMenuOpenClose:l,onMenuOpenClick:o,actions:c})=>(0,e.jsxs)("div",{className:"flex h-full items-center justify-between gap-4",children:[(0,e.jsx)(ce,{}),(0,e.jsxs)("div",{className:"desktop:gap-6 flex items-center gap-4",children:[(0,e.jsx)(Z,{actions:c}),t?(0,e.jsx)(L.Close,{className:"size-5",onClick:()=>l()}):(0,e.jsx)(L.Menu,{className:"size-5",onClick:()=>o()})]})]}),ce=()=>{const{payloadData:t,isMobile:l}=(0,E.useNavContext)();return(0,e.jsx)("div",{className:"hover:text-brand-0 cursor-pointer [&>svg]:w-full",onClick:()=>{window.location.href="/"},dangerouslySetInnerHTML:{__html:l?t?.headerBar?.mobileLogo:t?.headerBar?.desktopLogo}})},Z=(0,a.forwardRef)(({actions:t,activeStatus:l=!1},o)=>{const{event:c,cartCount:s}=(0,E.useNavContext)(),[p,v]=(0,a.useState)(null),d=(0,a.useCallback)((b,k)=>{switch(v(k),b?.blockType){case y.HeaderNavigationActionBlockType.Search:c?.search?.();break;case y.HeaderNavigationActionBlockType.Cart:c?.cart?.();break;case y.HeaderNavigationActionBlockType.Profile:c?.profile?.();break;case y.HeaderNavigationActionBlockType.Livestream:c?.livestream?.();break;default:return()=>{}}},[c]);return(0,e.jsx)("div",{className:"desktop:gap-6 flex items-center gap-4",children:Array.isArray(t)&&t?.map((b,k)=>(0,e.jsxs)("div",{className:"relative",ref:b.blockType===y.HeaderNavigationActionBlockType.Profile?o:null,onClick:()=>d(b,k),children:[(0,e.jsx)(n.Text,{html:b.icon,className:(0,N.cn)("size-5 cursor-pointer",{"text-brand-0":l&&p===k})}),b.blockType===y.HeaderNavigationActionBlockType.Cart&&s>0&&(0,e.jsx)("div",{className:"bg-brand-0 absolute right-[-12px] top-[calc(100%-16px)] z-[1] flex min-h-5 min-w-5 items-center justify-center rounded-full px-[2px]",children:(0,e.jsx)(n.Text,{html:s?.toString(),className:"text-sm font-bold leading-[1.2] text-white"})})]},b.id))})}),de=({title:t,onMenuOpenClose:l,onMenuBackClick:o})=>(0,e.jsxs)("div",{className:"flex h-full items-center gap-3",children:[(0,e.jsx)(L.LeftArrow,{className:"size-5",onClick:()=>o()}),(0,e.jsx)(n.Text,{html:t,className:"flex-1 text-center text-base font-bold leading-[1.4]"}),(0,e.jsx)(L.Close,{className:"size-5",onClick:()=>l()})]}),G=({label:t,href:l,onClick:o,active:c,icon:s,className:p})=>(0,e.jsx)("div",{className:(0,N.cn)("flex cursor-pointer items-center justify-between py-4",p),onClick:o,children:(0,e.jsxs)(n.Link,{href:l,asChild:!l,className:"flex w-full items-center justify-between no-underline",children:[(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[(0,e.jsx)(n.Text,{html:t,className:(0,N.cn)("text-sm font-bold leading-[1.4]",{underline:s})}),s&&(0,e.jsx)(n.Text,{html:s})]}),(0,e.jsx)(L.RightArrow,{className:(0,N.cn)("laptop:size-4 size-5",{"rotate-90":c})})]})});re.displayName="MobileNavigation",Z.displayName="Actions",te.displayName="HeaderNavigation",ae.displayName="DesktopNavigation",ne.displayName="SidebarDropdown";var He=(0,ue.withLayout)(te);
1
+ "use strict";"use client";var ge=Object.create;var U=Object.defineProperty;var ye=Object.getOwnPropertyDescriptor;var he=Object.getOwnPropertyNames;var xe=Object.getPrototypeOf,Ne=Object.prototype.hasOwnProperty;var ke=(t,n)=>{for(var r in n)U(t,r,{get:n[r],enumerable:!0})},Z=(t,n,r,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let d of he(n))!Ne.call(t,d)&&d!==r&&U(t,d,{get:()=>n[d],enumerable:!(s=ye(n,d))||s.enumerable});return t};var G=(t,n,r)=>(r=t!=null?ge(xe(t)):{},Z(n||!t||!t.__esModule?U(r,"default",{value:t,enumerable:!0}):r,t)),we=t=>Z(U({},"__esModule",{value:!0}),t);var Be={};ke(Be,{default:()=>He});module.exports=we(Be);var e=require("react/jsx-runtime"),a=G(require("react")),l=require("../../components/index.js"),de=require("../../shared/Styles.js"),N=require("../../helpers/utils.js"),$=G(require("./NavProvider.js")),g=require("./types.js"),ue=require("es-toolkit"),pe=G(require("jump.js")),J=require("@gsap/react"),V=require("gsap"),T=require("./withCategory.js"),z=require("./icons/index.js"),me=G(require("../NavigationSearch/index.js"));const ee=(0,a.forwardRef)((t,n)=>{const{data:{header:r}={},buildProps:s,event:d,profile:m,theme:f="light",isTop:u=!1,searchResult:x,onSearch:y,isSearching:o,keywords:M,onPrimaryNavClick:C,onSeriesProductClick:p,onSidebarNavClick:k,headerId:v,cartCount:h,menuData:c}=t,[b,D]=(0,a.useState)(!1),[L,P]=(0,a.useState)(!1),S=(0,a.useRef)(null),B=(0,a.useRef)(null),F=()=>{const w=document?.querySelector("body")?.offsetWidth||0;P(w<=1440)};(0,a.useEffect)(()=>(F(),window.addEventListener("resize",F),()=>{window.removeEventListener("resize",F)}),[]),(0,a.useImperativeHandle)(n,()=>B.current),(0,a.useEffect)(()=>{B.current&&u&&(0,pe.default)(B.current,{duration:0,offset:B.current?.getBoundingClientRect()?.bottom||0})},[u]),(0,a.useEffect)(()=>{d&&(d.search=()=>D(!0))},[d]),(0,J.useGSAP)(()=>{S?.current&&b&&V.gsap.fromTo(S.current,{height:0},{height:"auto",duration:.3})},[b]),(0,a.useEffect)(()=>{document.documentElement.style.overflow=b?"hidden":"auto"},[b]);const j=(0,a.useMemo)(()=>r?.bar?.actions?.find(w=>w?.blockType===g.HeaderNavigationActionBlockType.Search)?.searchBar?.[0]||{},[r]);return(0,e.jsx)($.default,{buildProps:s,profile:m,isMobile:L,event:d,payloadData:r,onSidebarNavClick:k,onSeriesProductClick:p,cartCount:h,children:(0,e.jsx)("header",{id:v||"header","data-ui-component-id":"HeaderNavigation",className:"relative z-[100] bg-white",ref:B,children:(0,e.jsxs)("div",{className:(0,N.cn)("hover:bg-white hover:text-black",f==="light"?"text-black":"text-white",{}),children:[(0,e.jsx)(te,{data:r,className:"desktop:block hidden !bg-white",theme:f,onPrimaryNavClick:C}),(0,e.jsx)(re,{menuData:c,data:r,className:"desktop:hidden block !bg-white",onPrimaryNavClick:C}),b&&(0,e.jsxs)("div",{className:"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70",style:{height:`calc(100dvh - ${B?.current?.getBoundingClientRect()?.top}px)`},role:"dialog","aria-modal":"true","aria-label":"Search",children:[(0,e.jsx)("div",{ref:S,className:(0,N.cn)("overflow-y-auto",{}),children:(0,e.jsx)(me.default,{data:j,keywords:M,isSearching:o,searchResult:x,onSearch:w=>{y?.(w)},onClose:()=>{y?.(),D(!1)}})}),(0,e.jsx)("div",{className:"flex-1 bg-transparent",onClick:()=>D(!1),role:"button",tabIndex:0,"aria-label":"Close search",onKeyDown:w=>{(w.key==="Enter"||w.key===" "||w.key==="Escape")&&(w.preventDefault(),D(!1))}})]})]})})})}),te=(0,a.forwardRef)((t,n)=>{const{data:r,onNavItemClick:s,className:d,theme:m,onPrimaryNavClick:f}=t,{event:u,profile:x}=(0,$.useNavContext)(),[y,o]=(0,a.useState)(!1),M=(0,a.useMemo)(()=>(0,T.WithGroupCategory)(r?.categories?.filter(i=>i?.pcShow)),[r]),[C,p]=(0,a.useState)(null),[k,v]=(0,a.useState)([]),h=(0,a.useRef)(null),[c,b]=(0,a.useState)(!1),D=(0,a.useRef)(null),L=(0,a.useRef)(null),P=(0,a.useRef)(M.map(i=>Array(i?.length||0).fill(null)));(0,a.useEffect)(()=>{M?.length&&v(M?.map((i,E)=>i?.map((H,A)=>({groupIndex:E,index:A,open:!1}))))},[M]);const S=(0,a.useMemo)(()=>{let i=null;for(const E of k){for(const H of E)if(H.open){i=H;break}if(i)break}return i},[k]);(0,a.useEffect)(()=>{document.documentElement.style.overflow=S?.open||c?"hidden":"auto"},[S?.open,c]);const B=(i,E,H)=>{if(b(!1),C?.components?.[0]?.blockType===g.HeaderNavigationBlockType.Links)C?.components?.[0]?.url&&window.open(C?.components?.[0]?.url);else{const A=M?.flat()||[],_=A?.findIndex(R=>R?.id===M[E][H]?.id);i.stopPropagation(),s?.(),f?.(A[_],_),p(M[E][H]),v(R=>R.map(ve=>ve.map(W=>W.groupIndex===E&&W.index===H?{...W,open:!W.open}:{...W,open:!1})))}},F=(i,E,H)=>{i.key==="Enter"||i.key===" "?(i.preventDefault(),B(i,E,H)):i.key==="Escape"&&S?.groupIndex===E&&S?.index===H&&(i.preventDefault(),j())},j=()=>{v(i=>i.map(E=>E.map(H=>({...H,open:!1}))))},w=(0,a.useMemo)(()=>{if(C)return C?.components?.[0]?.blockType},[C]),q=(0,T.WithSidebar)(ae,C),O=(0,T.WithMulticol)(Ce,C),be=(0,T.WithSupports)(Se,{categoriesItem:C,currentNavItemRef:P.current?.[S?.groupIndex||0]?.[S?.index||0]}),fe=(0,a.useMemo)(()=>{switch(w){case g.HeaderNavigationBlockType.Sidebar:return(0,e.jsx)(q,{});case g.HeaderNavigationBlockType.Supports:return(0,e.jsx)(be,{});case g.HeaderNavigationBlockType.Multicol:return(0,e.jsx)(O,{});default:return null}},[w,C]),Q=(0,a.useMemo)(()=>r?.bar?.actions?.filter(i=>i?.pcShow),[r]),I=(0,a.useMemo)(()=>Q?.find(i=>i?.blockType===g.HeaderNavigationActionBlockType.Profile),[Q]),X=(0,a.useCallback)(()=>{b(i=>!i)},[]);return(0,a.useEffect)(()=>{if(h?.current){const i=h.current;return i.addEventListener("click",X),()=>{i.removeEventListener("click",X)}}},[X]),(0,J.useGSAP)(()=>{S?.open&&V.gsap.fromTo(L?.current,{height:0},{height:"auto"})},[S?.open]),(0,e.jsxs)(l.Container,{className:(0,N.cn)("relative h-[96px]",d),children:[(0,e.jsxs)("div",{ref:D,onClick:j,className:"flex h-full flex-col justify-end gap-4",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)(se,{}),(0,e.jsx)(Y,{ref:h,actions:Q,activeStatus:c})]}),(0,e.jsx)("nav",{className:"flex justify-between",role:"navigation","aria-label":"Primary navigation",children:M?.map((i,E)=>(0,e.jsx)("div",{className:"flex gap-3",children:i?.map((H,A)=>{const _=S?.groupIndex===E&&S?.index===A;return(0,e.jsx)("div",{ref:R=>{P.current[E][A]=R},className:"group cursor-pointer",children:(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("button",{className:"flex cursor-pointer items-center gap-1 border-0 bg-transparent pb-4",onClick:R=>B(R,E,A),onKeyDown:R=>F(R,E,A),"aria-expanded":_,"aria-haspopup":"true","aria-label":H.text,children:[(0,e.jsx)(l.Text,{html:H.text,className:"text-sm font-bold leading-[1.4]"}),(0,e.jsx)(z.DownArrow,{"aria-hidden":"true",className:(0,N.cn)("size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100",{"rotate-180":_,"opacity-100":y&&_})})]}),(0,e.jsx)("div",{className:(0,N.cn)("absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500",{"w-[calc(100%-20px)]":_},m==="dark"?"bg-white":"bg-[#080A0F]"),"aria-hidden":"true"})]})},H.id)})},`groupCategory-${E}`))})]}),(0,e.jsxs)("div",{role:"menu","aria-hidden":!(S?.open&&C),className:(0,N.cn)("absolute left-0 top-full z-[999] flex w-full flex-col overflow-hidden border-t border-b-[#E4E5E6] bg-black/70 text-black",{hidden:!(S?.open&&C)}),onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{height:`calc(100dvh - ${D?.current?.getBoundingClientRect()?.bottom}px)`},children:[(0,e.jsx)("div",{ref:L,className:(0,N.cn)("relative z-50",{"overflow-hidden":w!==g.HeaderNavigationBlockType.Supports}),children:fe}),(0,e.jsx)("div",{className:"flex-1 bg-transparent",onClick:j,role:"button",tabIndex:0,"aria-label":"Close menu",onKeyDown:i=>{(i.key==="Enter"||i.key===" "||i.key==="Escape")&&(i.preventDefault(),j())}})]}),c&&(0,e.jsxs)("div",{className:"absolute left-0 top-full z-[999] flex h-dvh w-full bg-black/70",role:"dialog","aria-modal":"true","aria-label":"User profile menu",children:[(0,e.jsx)("div",{className:"absolute w-[272px] bg-white p-4",style:{right:`calc(100% - ${h?.current?.getBoundingClientRect()?.right}px)`,top:"-36px"},children:x?.email?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.Text,{html:x?.nick_name||I?.welcome,className:"text-sm font-bold"}),(0,e.jsx)("div",{className:"mt-2 h-px bg-[#D9D9D9]","aria-hidden":"true"}),(0,e.jsx)("nav",{className:"mt-2",role:"navigation","aria-label":"Profile navigation",children:I?.profiles?.map(i=>(0,e.jsx)(K,{className:"py-2",label:i?.title,href:i?.url},i.id))})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(z.Polygon,{className:"absolute -top-2 right-[46px] z-30 text-white","aria-hidden":"true"}),(0,e.jsx)(l.Text,{html:I?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),(0,e.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:I?.benefits?.map(i=>(0,e.jsxs)("div",{className:"flex items-center gap-[6px]",children:[(0,e.jsx)(l.Picture,{source:i.benefitIcon?.url,className:"size-4",alt:i.benefit,width:16,height:16}),(0,e.jsx)(l.Text,{html:i.benefit,className:"text-sm font-bold leading-[1.4]"})]},i.id))}),(0,e.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[(0,e.jsx)(l.Button,{variant:"secondary",size:"lg",onClick:()=>u?.join?.(),children:(0,e.jsx)(l.Text,{html:I?.primaryButton||"Join Now",className:"font-bold"})}),(0,e.jsx)(l.Button,{variant:"primary",size:"lg",onClick:()=>u?.login?.(),children:(0,e.jsx)(l.Text,{html:I?.secondaryButton||"Log In",className:"font-bold"})})]})]})}),(0,e.jsx)("div",{className:"flex-1 bg-transparent",onClick:()=>b(!1),role:"button",tabIndex:0,"aria-label":"Close profile menu",onKeyDown:i=>{(i.key==="Enter"||i.key===" "||i.key==="Escape")&&(i.preventDefault(),b(!1))}})]})]})}),ae=a.default.memo(({sidebarCategoriesMetadata:t,seriesMetadata:n})=>{const{buildProps:r,onSidebarNavClick:s}=(0,$.useNavContext)(),[d,m]=(0,a.useState)([]),[f,u]=(0,a.useState)(-1),x=(0,a.useRef)(null),y=(0,a.useCallback)(()=>{const p=t?.subcategories;if(!p?.length)return;const k=p.findIndex(c=>!!c?.subSubCategories),v=p.findIndex(c=>!c?.subSubCategories),h=p.map((c,b)=>({index:b,open:k===b||v===b}));m(h)},[t]);(0,a.useEffect)(()=>{y()},[y]);const o=(0,a.useMemo)(()=>{const p=t?.subcategories?.[d?.find(v=>v.open)?.index||0],k=n?.find(v=>v?.label?.toLowerCase()===p?.label?.toLowerCase())||{};if(p?.collections){const v=r?.categories?.[p?.collections]||{};return{label:k?.label,isCollection:!0,banner:k?.banner,primary:k?.primary,series:[{products:v?.products}]}}else if(p?.subSubCategories){const v=p?.subSubCategories?.[f],h=n?.find(c=>c?.label?.toLowerCase()===v?.label?.toLowerCase())||{};if(v?.collections){const c=r?.categories?.[v?.collections]||{};return{label:h?.label,isCollection:!0,banner:h?.banner,primary:h?.primary,series:[{products:c?.products}]}}else return h}else return k},[t,d,f,n,r]),M=(0,a.useCallback)((p,k)=>{k?.subSubCategories?.length>0?u(0):u(-1),m(v=>v.map((h,c)=>({...h,open:c===p?!h.open:!1})))},[]),C=(p,k)=>{m(v=>v.map(h=>h.index===p?{...h,open:!0}:{...h,open:!1})),u(k)};return(0,e.jsxs)(l.Container,{childClassName:"lg-desktop:gap-12 flex bg-white gap-8",children:[(0,e.jsxs)("div",{className:"lg-desktop:basis-[356px] flex basis-[284px] flex-col gap-4 py-4",style:{userSelect:"none"},ref:x,children:[(0,e.jsx)("div",{className:"desktop:h-[416px] flex flex-col overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t?.subcategories?.map((p,k)=>{const v=Array.isArray(p?.subSubCategories)&&p?.subSubCategories?.length>0,h=d?.find(c=>c.index===k)?.open;return(0,e.jsxs)("div",{children:[(0,e.jsxs)("button",{className:(0,N.cn)("flex w-full cursor-pointer items-center justify-between border-0 bg-transparent text-left",{"bg-[#F5F5F7]":!v&&h}),onClick:()=>{M(k,p),s?.(p,k)},"aria-expanded":v?h:void 0,"aria-haspopup":v?"true":void 0,children:[(0,e.jsx)(l.Text,{html:p.label,className:"p-4 text-sm font-bold leading-[1.4]"}),v&&(0,e.jsx)(z.DownArrow,{"aria-hidden":"true",className:(0,N.cn)("size-4",{"rotate-180":h})})]}),h&&(0,e.jsx)("div",{className:"flex flex-col",role:"menu",children:p.subSubCategories?.map((c,b)=>(0,e.jsx)("button",{onClick:()=>{C(k,b),s?.(c,b)},className:(0,N.cn)("w-full cursor-pointer border-0 bg-transparent px-6 py-4 text-left hover:bg-[#F5F5F7]",{"bg-[#F5F5F7]":f===b}),role:"menuitem","aria-label":c.label,children:(0,e.jsx)(l.Text,{html:c.label,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"})},`subSubItem-${k}-${b}`))})]},`subcategoryItem-${k}`)})}),t&&(0,e.jsx)("div",{className:"flex",children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[t?.primary&&(0,e.jsx)(l.Button,{as:"a",href:`${t?.primary?.url}?ref=${t?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"lg-desktop:text-base text-sm",children:t?.primary?.label}),t?.secondary&&(0,e.jsx)(l.Button,{as:"a",href:t?.secondary?.url,variant:"link",size:"lg",className:"lg-desktop:text-base justify-start !p-0 text-sm",children:t?.secondary?.label})]})})]}),(0,e.jsxs)("div",{className:"flex-1 py-4",children:[Reflect.ownKeys(o).length>0&&(0,e.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(l.Text,{html:o?.label,className:"lg-desktop:text-2xl text-xl font-bold leading-[1.4]"}),o?.primary&&!o?.primary?.hide&&(0,e.jsx)(l.Button,{as:"a",href:`${o?.primary?.url}?ref=${o?.label}_viewmore`,variant:"link",size:"lg",className:"lg-desktop:text-base justify-start !p-0 text-sm font-bold leading-[1.2] no-underline",children:o?.primary?.label})]}),(0,e.jsx)(l.Link,{href:o?.guide?.url,className:"lg-desktop:text-base text-sm leading-[1.2] text-[#6D6D6F]",children:o?.guide?.label})]}),(0,e.jsx)("div",{className:"flex h-[426px] flex-col gap-4 overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:o?.series?.map((p,k)=>(0,e.jsxs)("div",{children:[p.label&&(0,e.jsx)(l.Text,{html:p.label,className:"mb-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[!!o?.banner&&(0,e.jsx)(l.Link,{asChild:!o?.banner?.href,href:o?.banner?.href,children:(0,e.jsxs)("div",{className:"relative [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[(0,e.jsx)(l.Picture,{source:o?.banner?.imageUrl,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(l.Heading,{size:2,html:o?.banner?.title||"Buy in Guide",className:"font-bold text-white"}),(0,e.jsx)(l.Text,{html:o?.banner?.desc||"20.000mAh",className:"text-sm font-bold text-white"})]})]})}),p.products?.map((v,h)=>(0,e.jsx)(ne,{seriesLabel:o?.label,product:v,isCollection:o?.isCollection},`seriesProductItem-${h}`))]})]},`seriesItem-${k}`))})]})]})}),Ce=({multicolMetadata:t})=>{const n=(0,a.useRef)(null);return(0,e.jsx)("div",{ref:n,children:(0,e.jsx)(l.Container,{childClassName:"bg-white",className:"h-full",children:(0,e.jsx)("div",{className:"flex gap-4 py-4",children:t?.map((r,s)=>(0,e.jsx)("div",{className:"w-1/4",children:(0,e.jsx)(le,{item:r})},`multicolItem-${r?.label}-${s}`))})})})},Se=({supportsMetadata:t,currentNavItemRef:n})=>{const r=(0,a.useRef)(null),[s,d]=(0,a.useState)(null),[m,f]=(0,a.useState)(0);(0,a.useEffect)(()=>{if(r?.current){const x=r?.current?.getBoundingClientRect();f(x.height)}},[r]);const u=(0,ue.debounce)(()=>{if(n){const x=n.getBoundingClientRect();d(x)}},500);return(0,a.useEffect)(()=>(u(),window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u)}),[u]),(0,a.useEffect)(()=>{if(n){const x=n.getBoundingClientRect();d(x)}},[n]),(0,e.jsx)("div",{className:"absolute top-0 h-full overflow-hidden bg-white transition-all duration-500",style:{right:`calc(100% - ${s?.right}px)`,height:m},children:(0,e.jsx)("div",{ref:r,className:"p-4",children:t?.map(x=>(0,e.jsx)("div",{className:"py-2",children:(0,e.jsx)(l.Link,{href:x.url,className:"text-sm font-bold leading-[1.4] no-underline",children:x.label})},x.id))})})},ne=({product:t,isCollection:n,position:r,seriesLabel:s})=>{const{buildProps:d,onSeriesProductClick:m}=(0,$.useNavContext)();let f=n?t:d?.products?.find(o=>o.handle===t.handle);const u=f?.variants?.find(o=>o.sku===t.sku)||f?.variants?.[0],x=(0,a.useMemo)(()=>`/products/${f?.handle}?variant=${(0,N.atobID)(u?.id)}`,[f?.handle,u?.id]),y=(0,a.useMemo)(()=>f?.tags?.filter?.(o=>o?.startsWith?.("CLtag"))?.map?.(o=>o?.replace?.("CLtag:",""))?.slice?.(0,2),[f?.tags]);return u?.availableForSale?(0,e.jsx)(l.Link,{href:x,onClick:o=>{o.preventDefault(),window.open(x,"_self"),m?.(f,r||0,s)},className:"no-underline hover:text-current",children:(0,e.jsxs)("div",{className:"flex shrink-0 items-center gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110 [&_img]:hover:duration-500",children:[(0,e.jsx)("div",{className:"shrink-0",children:(0,e.jsx)(l.Picture,{source:`${u?.image?.url||t?.images?.[0]?.url}}`,width:90,height:90,className:"size-[96px]",imgClassName:"object-contain h-full"})}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)("div",{className:"flex gap-1",children:Array.isArray(y)&&y?.map((o,M)=>(0,e.jsx)(l.Text,{as:"p",html:o,className:"text-brand-0 mb-1 inline-block h-[24px] whitespace-nowrap rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[22px]"},M))}),(0,e.jsx)(l.Text,{className:"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]",html:f?.title||t?.name}),t?.desc&&(0,e.jsx)(l.Text,{as:"p",html:t?.desc,className:"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]"})]})]})}):null},le=({item:t,allPicture:n})=>(0,e.jsxs)(e.Fragment,{children:[t?.columns&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.Text,{html:t.label,as:"div",className:"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsx)("div",{className:"mt-2 flex flex-col",children:t.columns?.map(r=>(0,e.jsxs)("div",{className:"flex items-center gap-1 py-2",children:[(0,e.jsx)(l.Link,{href:`${r.url}?ref=navMenu`,asChild:!r.url,className:"text-sm font-bold leading-[1.4] no-underline",children:r.label}),r?.badge&&(0,e.jsx)(l.Text,{as:"p",html:r?.badge||"badge",className:"text-brand-0 h-[24px] rounded-full border-[1.6px] border-[var(--brand-color-0)] px-[6px] text-sm font-bold !leading-[22px]"})]},r.label))})]}),t?.imageUrl&&(0,e.jsx)("div",{className:(0,N.cn)("laptop:h-[280px] desktop:h-[224px] lg-desktop:h-[280px] tablet:max-w-[346px] laptop:max-w-[440px] desktop:w-full relative h-[240px] max-w-[358px] overflow-hidden",{"tablet:max-w-none laptop:max-w-none":n}),children:(0,e.jsxs)(l.Link,{href:`${t.url}?ref=navMenu`,asChild:!t.url,children:[(0,e.jsx)(l.Picture,{source:t.imageUrl,width:404,height:280,className:"size-full",imgClassName:"object-cover h-full hover:scale-105 transition-all duration-300"}),(0,e.jsxs)("div",{className:"absolute bottom-4 left-4 z-10 flex flex-col justify-end no-underline",children:[(0,e.jsx)(l.Text,{html:t.title,className:(0,N.cn)("lg-desktop:text-2xl text-xl font-bold leading-[1.2] text-white",{"text-black":t?.theme==="dark"})}),t.subtitle&&(0,e.jsx)(l.Text,{html:t.subtitle,className:(0,N.cn)("text-sm font-bold leading-[1.4] text-white",{"text-black":t?.theme==="dark"})}),t?.primary?.label&&(0,e.jsx)(l.Button,{as:"a",href:t?.primary?.url,variant:"link",size:"lg",className:(0,N.cn)("mr-auto !p-0 text-sm font-bold leading-[1.4] text-white",{"text-black":t?.theme==="dark"}),children:t?.primary?.label||"more"})]})]})})]}),re=(0,a.forwardRef)(({data:t,menuData:n,className:r,onPrimaryNavClick:s},d)=>{const m=(0,a.useMemo)(()=>(0,T.WithGroupCategory)(t?.categories?.filter(w=>w?.mobileShow)),[t]),{currentMenu:f,setCurrentMenu:u,subSubCategory:x}=(0,$.useNavContext)(),[y,o]=(0,a.useState)(!1),[M,C]=(0,a.useState)(0),[p,k]=(0,a.useState)(null),v=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(v?.current&&y){const w=v?.current?.getBoundingClientRect();C(window?.innerHeight-(w?.bottom||0))}},[y]),(0,J.useGSAP)(()=>{V.gsap.fromTo(v.current,{height:0},{height:M,duration:.3})},[M]),(0,a.useEffect)(()=>{document.documentElement.style.overflow=y?"hidden":"auto"},[y]);const h=(0,a.useMemo)(()=>p?.components?.[0]?.blockType,[p]),c=(0,T.WithSupports)(Le,{categoriesItem:p}),b=(0,T.WithSidebar)(Me,p),D=(0,T.WithMulticol)(Pe,p),L=(0,a.useMemo)(()=>{switch(h){case g.HeaderNavigationBlockType.Sidebar:return(0,e.jsx)(b,{});case g.HeaderNavigationBlockType.Supports:return(0,e.jsx)(c,{});case g.HeaderNavigationBlockType.Multicol:return(0,e.jsx)(D,{});default:return null}},[h,p,c]),P=(0,a.useCallback)(()=>{o(!1),C(0),u&&u(g.HeaderNavigationMenu.Primary)},[o,C,u]),S=(0,a.useMemo)(()=>t?.bar?.actions?.filter(w=>w?.mobileShow&&w?.blockType!==g.HeaderNavigationActionBlockType.Profile),[t]),B=(0,a.useMemo)(()=>t?.bar?.actions?.find(w=>w?.mobileShow&&w?.blockType===g.HeaderNavigationActionBlockType.Profile)||{},[t]),F=(0,a.useMemo)(()=>{switch(f){case g.HeaderNavigationMenu.Primary:return(0,e.jsx)(ze,{actions:S,menuOpen:y,onMenuOpenClose:()=>{o(!1),C(0)},onMenuOpenClick:()=>o(!0)});case g.HeaderNavigationMenu.Secondary:return(0,e.jsx)(ce,{title:p?.text,onMenuOpenClose:P,onMenuBackClick:()=>u?.(g.HeaderNavigationMenu.Primary)});case g.HeaderNavigationMenu.Third:return(0,e.jsx)(ce,{title:x?.label,onMenuOpenClose:P,onMenuBackClick:()=>u?.(g.HeaderNavigationMenu.Secondary)});default:return null}},[y,f,u,p,S,x,P]),j=(0,a.useCallback)((w,q)=>{const O=Array.isArray(m)?Array.isArray(m[w])?m[w][q]:{}:{};k(O),O?.components?.[0]?.blockType===g.HeaderNavigationBlockType.Links?O?.components?.[0]?.url&&window.open(O?.components?.[0]?.url):u?.(g.HeaderNavigationMenu.Secondary)},[m,u]);return(0,e.jsxs)(l.Container,{className:(0,N.cn)("relative h-[52px]",r),children:[F,y&&(0,e.jsxs)("nav",{ref:v,className:"absolute left-0 top-full z-[999] w-full overflow-y-auto border-t border-[#E4E5E6] bg-white text-black",style:{height:M},role:"navigation","aria-label":"Mobile navigation menu",children:[f===g.HeaderNavigationMenu.Primary?(0,e.jsx)("div",{className:"pt-4",children:(0,e.jsx)(l.BrandStrip,{data:n})}):null,f===g.HeaderNavigationMenu.Primary?(0,e.jsx)(De,{categories:m,onPrimaryMenuClick:j,onPrimaryNavClick:s,profileAction:B}):L]})]})}),De=({categories:t,onPrimaryMenuClick:n,profileAction:r,onPrimaryNavClick:s})=>(0,e.jsxs)("div",{className:"flex h-full flex-col justify-between",children:[(0,e.jsx)("div",{className:"tablet:px-8 laptop:px-16 p-4",children:t?.map((d,m)=>(0,e.jsxs)("div",{className:"",children:[(0,e.jsx)("div",{className:(0,N.cn)("my-2 h-px w-full bg-[#E5E5E7]")}),d?.map((f,u)=>(0,e.jsx)(K,{label:f.text,onClick:()=>{const y=(t?.flat()||[])?.findIndex(o=>o?.id===t[m][u]?.id);n(m,u),s?.(f,y)},icon:f.components?.[0]?.icon},f.id))]},`groupCategory-${m}`))}),(0,e.jsx)(Ee,{profileAction:r})]}),Me=({sidebarCategoriesMetadata:t,seriesMetadata:n})=>{const{currentMenu:r,setCurrentMenu:s,subSubCategory:d,setSubSubCategory:m,setCurrentSeriesMetadata:f,currentSeriesMetadata:u,buildProps:x,onSidebarNavClick:y}=(0,$.useNavContext)(),[o,M]=(0,a.useState)([]),[C,p]=(0,a.useState)([]);(0,a.useEffect)(()=>{t?.subcategories?.length&&M(t?.subcategories?.map((c,b)=>({index:b,open:!1})))},[t]),(0,a.useEffect)(()=>{d?.subSubCategories?.length&&p(d?.subSubCategories?.map((c,b)=>({index:b,open:b===0})))},[d]);const k=(0,a.useCallback)((c,b)=>{s&&s(g.HeaderNavigationMenu.Third),m?.(c);const D=n?.find(L=>b!==void 0?c?.subSubCategories?.[b]?.label?.toLowerCase()===L.label?.toLowerCase():c?.label?.toLowerCase()===L.label?.toLowerCase())||{};if(c?.collections){const L=x?.categories?.[c?.collections]||{};f?.({label:D?.label,isCollection:!0,banner:D?.banner,primary:D?.primary,series:[{products:L?.products}]})}else f?.(D)},[n,s,m,f,x?.categories]),v=(0,a.useMemo)(()=>n?.find(c=>!!c?.guide)?.guide,[n]);return(0,a.useMemo)(()=>{switch(r){case g.HeaderNavigationMenu.Secondary:return(0,e.jsxs)("div",{className:"tablet:px-8 laptop:px-16 tablet:justify-start tablet:gap-16 flex h-full flex-col justify-between p-4",children:[(0,e.jsx)("div",{children:t?.subcategories?.map((c,b)=>(0,e.jsx)("div",{children:(0,e.jsx)(K,{label:c?.label,active:o.find(D=>D.index===b)?.open,onClick:()=>{k(c),y?.(c,b)}})},`${c.label}-${b}`))}),(0,e.jsxs)("div",{className:"tablet:items-start flex flex-col items-center gap-4",children:[t?.primary&&(0,e.jsx)(l.Button,{as:"a",href:`${t?.primary?.url}?ref=${t?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"tablet:w-auto w-full text-base",children:t?.primary?.label}),t?.secondary&&(0,e.jsx)(l.Button,{as:"a",href:t?.secondary?.url,variant:"link",size:"lg",className:"tablet:w-auto tablet:px-0 w-full py-0 text-base",children:t?.secondary?.label})]})]});case g.HeaderNavigationMenu.Third:return(0,e.jsxs)("div",{className:"tablet:px-8 laptop:px-16 p-4",children:[d?.subSubCategories?d?.subSubCategories?.map((c,b)=>{const D=n?.find(P=>P.label.toLowerCase()===c?.label?.toLowerCase())||{};let L={};if(c?.collections){const P=x?.categories?.[c?.collections]||{};L={label:D?.label,isCollection:!0,banner:D?.banner,primary:D?.primary,series:[{products:P?.products}]}}else L=D;return(0,e.jsxs)("div",{children:[Reflect.ownKeys(c).length>0&&(0,e.jsx)(oe,{matchSeriesMetadata:L,onSubSubCategoryItemClick:()=>{y?.(c,b),p(P=>P.map((S,B)=>({...S,open:B===b?!S.open:S.open})))},expanded:!!C?.find(P=>P.index===b)?.open}),C?.find(P=>P.index===b)?.open&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ie,{matchSeriesMetadata:L}),L?.primary&&(0,e.jsx)("div",{className:"my-4 text-center",children:(0,e.jsx)(l.Button,{as:"a",href:L?.primary?.url,className:"text-base leading-[1.2] no-underline",variant:"secondary",size:"base",children:L?.primary?.label})})]})]},`${c.label}-${b}`)}):(0,e.jsxs)(e.Fragment,{children:[Reflect.ownKeys(u).length>0&&(0,e.jsx)(oe,{matchSeriesMetadata:u}),(0,e.jsx)(ie,{matchSeriesMetadata:u}),u?.primary&&(0,e.jsx)("div",{className:"my-4 text-center ",children:(0,e.jsx)(l.Button,{as:"a",href:`${u?.primary?.url}?ref=${u?.label}_viewmore`,variant:"secondary",size:"base",className:"text-base leading-[1.2] no-underline",children:u?.primary?.label})})]}),v&&(0,e.jsx)(l.Link,{href:v?.url,children:(0,e.jsx)("div",{className:"mt-4",children:(0,e.jsx)(l.Text,{html:v?.label,className:"text-sm font-bold leading-[1.2] text-[#6D6D6F]"})})})]});default:return null}},[r,t,n,o,C,d,u,x?.categories,v,k,y])},oe=({matchSeriesMetadata:t,onSubSubCategoryItemClick:n,expanded:r})=>{const s=(0,e.jsxs)(e.Fragment,{children:[t?.label&&(0,e.jsx)(l.Text,{html:t?.label,className:"text-sm font-bold leading-[1.4]"}),n&&(0,e.jsx)(z.DownArrow,{"aria-hidden":"true",className:(0,N.cn)("size-5",{"rotate-180":r})})]});return n?(0,e.jsx)("button",{className:"tablet:pt-0 flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",onClick:n,"aria-expanded":r,children:s}):(0,e.jsx)("div",{className:"tablet:pt-0 flex items-center justify-between py-4",children:s})},ie=({matchSeriesMetadata:t})=>(0,e.jsx)("div",{className:"laptop:gap-3 flex flex-col gap-2",children:!!t?.series?.length&&t?.series?.map((n,r)=>(0,e.jsxs)("div",{children:[n.label&&(0,e.jsx)(l.Text,{html:n.label,className:"mb-2 text-sm font-bold leading-[1.4] text-[#3D3D3F]"}),(0,e.jsxs)("div",{className:"laptop:grid-cols-3 laptop:gap-4 tablet:grid tablet:grid-cols-2 tablet:gap-3 flex flex-col gap-2",children:[!!t?.banner&&(0,e.jsx)(l.Link,{asChild:!t?.banner?.href,href:t?.banner?.href,children:(0,e.jsxs)("div",{className:"relative [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[(0,e.jsx)(l.Picture,{source:t?.banner?.imageUrl,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(l.Heading,{size:2,html:t?.banner?.title||"Buy in Guide",className:(0,N.cn)("font-bold text-white",{"text-black":t?.banner?.theme==="dark"})}),(0,e.jsx)(l.Text,{html:t?.banner?.desc||"20.000mAh",className:(0,N.cn)("text-sm font-bold text-white",{"text-black":t?.banner?.theme==="dark"})})]})]})}),n.products?.map((s,d)=>(0,e.jsx)(ne,{position:d,product:s,seriesLabel:t?.label,isCollection:t?.isCollection},`seriesProductItem-${r}-${d}`))]})]},`seriesItem-${r}`))}),Le=({supportsMetadata:t})=>(0,e.jsx)("div",{className:"tablet:px-8 laptop:px-16 p-4",children:t?.map(n=>(0,e.jsx)(K,{href:n.url,label:n.label,onClick:()=>{}},n.id))}),Pe=({multicolMetadata:t})=>{const n=(0,a.useMemo)(()=>!t?.some(r=>!!r.columns),[t]);return(0,e.jsx)("div",{className:(0,N.cn)("tablet:py-4 tablet:px-8 laptop:px-16 tablet:gap-6 flex flex-col gap-4 p-4",{"tablet:grid tablet:grid-cols-2 tablet:gap-3 laptop:gap-4":n}),children:t?.map((r,s)=>(0,e.jsx)("div",{children:(0,e.jsx)(le,{item:r,allPicture:n})},`multicolItem-${r?.label}-${s}`))})},Ee=({profileAction:t})=>{const[n,r]=(0,a.useState)(!1),{profile:s,event:d}=(0,$.useNavContext)();return(0,e.jsxs)("div",{className:(0,N.cn)("tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6",{"p-4":n}),children:[(0,e.jsxs)("button",{className:"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent",onClick:()=>r(!n),"aria-expanded":n,"aria-label":s?.nick_name||t?.welcome,children:[(0,e.jsxs)("div",{className:"flex items-center gap-[14px]",children:[(0,e.jsx)("div",{className:"flex size-[40px] shrink-0 items-center justify-center rounded-full bg-white",children:(0,e.jsx)(z.User,{"aria-hidden":"true"})}),(0,e.jsx)(l.Text,{html:s?.nick_name||t?.welcome,className:"text-base font-bold leading-[1.4]"})]}),!s?.email&&(0,e.jsx)(z.DownArrow,{"aria-hidden":"true",className:(0,N.cn)("laptop:size-4 size-5",{"rotate-180":n})})]}),s?.email&&(0,e.jsx)("nav",{className:"mt-4",role:"navigation","aria-label":"Profile menu",children:t?.profiles?.map(m=>(0,e.jsx)(K,{label:m?.title,href:m?.url},m.id))}),n&&!s?.email&&(0,e.jsxs)("div",{className:"mt-4",children:[(0,e.jsx)(l.Text,{html:t?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),(0,e.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:t?.benefits?.map(m=>(0,e.jsxs)("div",{className:"flex items-center gap-[6px]",children:[(0,e.jsx)(l.Picture,{source:m.benefitIcon?.url,className:"size-4",alt:m.benefit,width:16,height:16}),(0,e.jsx)(l.Text,{html:m.benefit,className:"text-sm font-bold leading-[1.4]"})]},m.id))})]}),!s?.email&&(0,e.jsxs)("div",{className:"mt-4 flex items-center gap-3",children:[(0,e.jsx)(l.Button,{className:"tablet:flex-none flex-1",variant:"secondary",size:"base",onClick:()=>d?.join?.(),children:(0,e.jsx)(l.Text,{html:t?.primaryButton||"Join Now",className:"text-sm font-bold leading-[1.4]"})}),(0,e.jsx)(l.Button,{className:"tablet:flex-none flex-1",variant:"primary",size:"base",onClick:()=>d?.login?.(),children:(0,e.jsx)(l.Text,{html:t?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]})},ze=({menuOpen:t,onMenuOpenClose:n,onMenuOpenClick:r,actions:s})=>(0,e.jsxs)("div",{className:"flex h-full items-center justify-between gap-4",children:[(0,e.jsx)(se,{}),(0,e.jsxs)("div",{className:"desktop:gap-6 flex items-center gap-4",children:[(0,e.jsx)(Y,{actions:s}),t?(0,e.jsx)("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>n(),"aria-label":"Close menu","aria-expanded":"true",children:(0,e.jsx)(z.Close,{className:"size-5","aria-hidden":"true"})}):(0,e.jsx)("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>r(),"aria-label":"Open menu","aria-expanded":"false","aria-haspopup":"true",children:(0,e.jsx)(z.Menu,{className:"size-5","aria-hidden":"true"})})]})]}),se=()=>{const{payloadData:t,isMobile:n}=(0,$.useNavContext)();return(0,e.jsx)("a",{href:"/",className:"hover:text-brand-0 [&>svg]:w-full","aria-label":"Home",dangerouslySetInnerHTML:{__html:n?t?.bar?.mobileLogo:t?.bar?.desktopLogo}})},Y=(0,a.forwardRef)(({actions:t,activeStatus:n=!1},r)=>{const{event:s,cartCount:d}=(0,$.useNavContext)(),[m,f]=(0,a.useState)(null),u=y=>{switch(y){case g.HeaderNavigationActionBlockType.Search:return"Search";case g.HeaderNavigationActionBlockType.Cart:return`Shopping cart${d>0?` (${d} items)`:""}`;case g.HeaderNavigationActionBlockType.Profile:return"User profile";case g.HeaderNavigationActionBlockType.Livestream:return"Livestream";default:return"Action"}},x=(0,a.useCallback)((y,o)=>{switch(f(o),y?.blockType){case g.HeaderNavigationActionBlockType.Search:s?.search?.();break;case g.HeaderNavigationActionBlockType.Cart:s?.cart?.();break;case g.HeaderNavigationActionBlockType.Profile:s?.profile?.();break;case g.HeaderNavigationActionBlockType.Livestream:s?.livestream?.();break;default:return()=>{}}},[s]);return(0,e.jsx)("div",{className:"desktop:gap-6 flex items-center gap-4",children:Array.isArray(t)&&t?.map((y,o)=>(0,e.jsxs)("button",{className:"relative cursor-pointer border-0 bg-transparent p-0",ref:y.blockType===g.HeaderNavigationActionBlockType.Profile?r:null,onClick:()=>x(y,o),"aria-label":u(y.blockType),"aria-pressed":n&&m===o,children:[(0,e.jsx)(l.Text,{html:y.icon,className:(0,N.cn)("size-5",{"text-brand-0":n&&m===o}),"aria-hidden":"true"}),y.blockType===g.HeaderNavigationActionBlockType.Cart&&d>0&&(0,e.jsx)("div",{className:"bg-brand-0 absolute right-[-12px] top-[calc(100%-16px)] z-[1] flex min-h-5 min-w-5 items-center justify-center rounded-full px-[2px]","aria-hidden":"true",children:(0,e.jsx)(l.Text,{html:d?.toString(),className:"text-sm font-bold leading-[1.2] text-white"})})]},y.id))})}),ce=({title:t,onMenuOpenClose:n,onMenuBackClick:r})=>(0,e.jsxs)("div",{className:"flex h-full items-center gap-3",children:[(0,e.jsx)("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>r(),"aria-label":"Back to previous menu",children:(0,e.jsx)(z.LeftArrow,{className:"size-5","aria-hidden":"true"})}),(0,e.jsx)(l.Text,{html:t,className:"flex-1 text-center text-base font-bold leading-[1.4]"}),(0,e.jsx)("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>n(),"aria-label":"Close menu",children:(0,e.jsx)(z.Close,{className:"size-5","aria-hidden":"true"})})]}),K=({label:t,href:n,onClick:r,active:s,icon:d,className:m})=>{const f=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[(0,e.jsx)(l.Text,{html:t,className:(0,N.cn)("text-sm font-bold leading-[1.4]",{underline:d})}),d&&(0,e.jsx)(l.Text,{html:d,"aria-hidden":"true"})]}),(0,e.jsx)(z.RightArrow,{className:(0,N.cn)("laptop:size-4 size-5",{"rotate-90":s}),"aria-hidden":"true"})]});return n?(0,e.jsx)(l.Link,{href:n,className:(0,N.cn)("flex cursor-pointer items-center justify-between py-4 no-underline",m),children:f}):(0,e.jsx)("button",{className:(0,N.cn)("flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",m),onClick:r,"aria-expanded":s,children:f})};re.displayName="MobileNavigation",Y.displayName="Actions",ee.displayName="HeaderNavigation",te.displayName="DesktopNavigation",ae.displayName="SidebarDropdown";var He=(0,de.withLayout)(ee);
2
2
  //# sourceMappingURL=index.js.map