@anker-in/headless-ui 1.3.34 → 1.3.35

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 (85) hide show
  1. package/dist/cjs/biz-components/HeaderNavigation/MulticolDropdown.js +1 -1
  2. package/dist/cjs/biz-components/HeaderNavigation/MulticolDropdown.js.map +3 -3
  3. package/dist/cjs/biz-components/HeaderNavigation/NavProvider.d.ts +2 -1
  4. package/dist/cjs/biz-components/HeaderNavigation/NavProvider.js +1 -1
  5. package/dist/cjs/biz-components/HeaderNavigation/NavProvider.js.map +2 -2
  6. package/dist/cjs/biz-components/HeaderNavigation/SidebarDropdown.js +1 -1
  7. package/dist/cjs/biz-components/HeaderNavigation/SidebarDropdown.js.map +3 -3
  8. package/dist/cjs/biz-components/HeaderNavigation/SupportsDropdown.js +1 -1
  9. package/dist/cjs/biz-components/HeaderNavigation/SupportsDropdown.js.map +2 -2
  10. package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
  11. package/dist/cjs/biz-components/HeaderNavigation/index.js.map +3 -3
  12. package/dist/cjs/biz-components/HeaderNavigation/types.d.ts +12 -0
  13. package/dist/cjs/biz-components/HeaderNavigation/types.js +1 -1
  14. package/dist/cjs/biz-components/HeaderNavigation/types.js.map +2 -2
  15. package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
  16. package/dist/cjs/biz-components/ImageWithText/ImageWithText.js.map +2 -2
  17. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  18. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  19. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +0 -1
  20. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  21. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
  22. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlockCarousel.js +1 -1
  23. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlockCarousel.js.map +3 -3
  24. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/types.d.ts +1 -2
  25. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/types.js +1 -1
  26. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/types.js.map +1 -1
  27. package/dist/cjs/biz-components/NavigationSearch/index.js +2 -2
  28. package/dist/cjs/biz-components/NavigationSearch/index.js.map +3 -3
  29. package/dist/cjs/biz-components/SearchPage/index.d.ts +1 -1
  30. package/dist/cjs/biz-components/SearchPage/index.js +1 -1
  31. package/dist/cjs/biz-components/SearchPage/index.js.map +3 -3
  32. package/dist/cjs/biz-components/SearchPage/types.d.ts +2 -0
  33. package/dist/cjs/biz-components/SearchPage/types.js +1 -1
  34. package/dist/cjs/biz-components/SearchPage/types.js.map +2 -2
  35. package/dist/cjs/biz-components/ShelfDisplay/index.js +1 -1
  36. package/dist/cjs/biz-components/ShelfDisplay/index.js.map +3 -3
  37. package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
  38. package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +2 -2
  39. package/dist/cjs/biz-components/Title/index.js +1 -1
  40. package/dist/cjs/biz-components/Title/index.js.map +2 -2
  41. package/dist/cjs/components/link.js +1 -1
  42. package/dist/cjs/components/link.js.map +2 -2
  43. package/dist/esm/biz-components/HeaderNavigation/MulticolDropdown.js +1 -1
  44. package/dist/esm/biz-components/HeaderNavigation/MulticolDropdown.js.map +3 -3
  45. package/dist/esm/biz-components/HeaderNavigation/NavProvider.d.ts +2 -1
  46. package/dist/esm/biz-components/HeaderNavigation/NavProvider.js +1 -1
  47. package/dist/esm/biz-components/HeaderNavigation/NavProvider.js.map +2 -2
  48. package/dist/esm/biz-components/HeaderNavigation/SidebarDropdown.js +1 -1
  49. package/dist/esm/biz-components/HeaderNavigation/SidebarDropdown.js.map +3 -3
  50. package/dist/esm/biz-components/HeaderNavigation/SupportsDropdown.js +1 -1
  51. package/dist/esm/biz-components/HeaderNavigation/SupportsDropdown.js.map +2 -2
  52. package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
  53. package/dist/esm/biz-components/HeaderNavigation/index.js.map +3 -3
  54. package/dist/esm/biz-components/HeaderNavigation/types.d.ts +12 -0
  55. package/dist/esm/biz-components/HeaderNavigation/types.js +1 -1
  56. package/dist/esm/biz-components/HeaderNavigation/types.js.map +2 -2
  57. package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
  58. package/dist/esm/biz-components/ImageWithText/ImageWithText.js.map +2 -2
  59. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  60. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  61. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +0 -1
  62. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  63. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
  64. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlockCarousel.js +1 -1
  65. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlockCarousel.js.map +3 -3
  66. package/dist/esm/biz-components/MultiLayoutGraphicBlock/types.d.ts +1 -2
  67. package/dist/esm/biz-components/NavigationSearch/index.js +2 -2
  68. package/dist/esm/biz-components/NavigationSearch/index.js.map +3 -3
  69. package/dist/esm/biz-components/SearchPage/index.d.ts +1 -1
  70. package/dist/esm/biz-components/SearchPage/index.js +1 -1
  71. package/dist/esm/biz-components/SearchPage/index.js.map +3 -3
  72. package/dist/esm/biz-components/SearchPage/types.d.ts +2 -0
  73. package/dist/esm/biz-components/SearchPage/types.js +1 -1
  74. package/dist/esm/biz-components/SearchPage/types.js.map +2 -2
  75. package/dist/esm/biz-components/ShelfDisplay/index.js +1 -1
  76. package/dist/esm/biz-components/ShelfDisplay/index.js.map +3 -3
  77. package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
  78. package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +2 -2
  79. package/dist/esm/biz-components/Title/index.js +1 -1
  80. package/dist/esm/biz-components/Title/index.js.map +2 -2
  81. package/dist/esm/components/link.js +1 -1
  82. package/dist/esm/components/link.js.map +2 -2
  83. package/dist/tokens/oneAnker.css +14 -0
  84. package/package.json +1 -1
  85. package/style.css +9 -20
@@ -1,2 +1,2 @@
1
- "use strict";var f=Object.create;var i=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var N=(e,l)=>{for(var t in l)i(e,t,{get:l[t],enumerable:!0})},d=(e,l,t,s)=>{if(l&&typeof l=="object"||typeof l=="function")for(let r of h(l))!g.call(e,r)&&r!==t&&i(e,r,{get:()=>l[r],enumerable:!(s=b(l,r))||s.enumerable});return e};var k=(e,l,t)=>(t=e!=null?f(v(e)):{},d(l||!e||!e.__esModule?i(t,"default",{value:e,enumerable:!0}):t,e)),w=e=>d(i({},"__esModule",{value:!0}),e);var C={};N(C,{MulticolDropdown:()=>y,MulticolItem:()=>c});module.exports=w(C);var a=require("react/jsx-runtime"),p=require("react"),o=require("../../components/index.js"),m=k(require("./CompanyStatsBanner/index.js")),n=require("../../helpers/utils.js"),x=require("../AiuiProvider/index.js");const y=({multicolMetadata:e,showStatsBanner:l,statsBannerData:t})=>{const s=(0,p.useRef)(null);return(0,a.jsx)("div",{ref:s,className:"bg-white py-4",children:(0,a.jsx)(o.Container,{childClassName:"bg-white",className:"h-full",children:(0,a.jsxs)("div",{className:"laptop:gap-4 flex flex-col gap-3",children:[l&&(0,a.jsx)(m.default,{data:t}),(0,a.jsx)("div",{className:"flex gap-4",children:e?.map((r,u)=>(0,a.jsx)("div",{className:"w-1/4",children:(0,a.jsx)(c,{item:r})},`multicolItem-${r?.label}-${u}`))})]})})})},c=({item:e,allPicture:l})=>{const{locale:t="us"}=(0,x.useAiuiContext)();return(0,a.jsxs)(a.Fragment,{children:[e?.columns&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.Text,{html:e.label,as:"div",className:"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,a.jsx)("div",{className:"mt-2 flex flex-col",children:e.columns?.map(s=>(0,a.jsxs)("div",{className:"flex items-center gap-1 py-2",children:[(0,a.jsx)(o.Link,{href:`${(0,n.getLocalizedPath)(s.url,t)}?ref=navMenu`,asChild:!s.url,className:"text-sm font-bold leading-[1.4] no-underline",children:s.label}),s?.badge&&(0,a.jsx)(o.Text,{as:"p",html:s?.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]"})]},s.label))})]}),e?.imageUrl&&(0,a.jsx)("div",{className:(0,n.cn)("rounded-image-text 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,a.jsx)(o.Link,{href:`${(0,n.getLocalizedPath)(e.url,t)}?ref=navMenu`,asChild:!e.url,children:(0,a.jsxs)("div",{className:"size-full",children:[(0,a.jsx)(o.Picture,{source:e.imageUrl,width:404,height:280,className:"size-full",imgClassName:"object-cover h-full hover:scale-105 transition-all duration-300"}),(0,a.jsxs)("div",{className:"absolute bottom-4 left-4 z-10 flex flex-col justify-end no-underline",children:[(0,a.jsx)(o.Text,{html:e.title,className:(0,n.cn)("lg-desktop:text-2xl text-xl font-bold leading-[1.2] text-white",{"text-black":e?.theme==="dark"})}),e.subtitle&&(0,a.jsx)(o.Text,{html:e.subtitle,className:(0,n.cn)("text-sm font-bold leading-[1.4] text-white",{"text-black":e?.theme==="dark"})}),e?.primary?.label&&(0,a.jsx)(o.Button,{as:"a",href:(0,n.getLocalizedPath)(e?.primary?.url,t),variant:"link",size:"lg",iconClassName:"size-4 lg-desktop:size-5",className:(0,n.cn)("mr-auto !p-0 text-sm font-bold leading-[1.4] text-white",{"text-black":e?.theme==="dark"}),children:e?.primary?.label||"more"})]})]})})})]})};
1
+ "use strict";var b=Object.create;var d=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var k=(e,l)=>{for(var o in l)d(e,o,{get:l[o],enumerable:!0})},m=(e,l,o,r)=>{if(l&&typeof l=="object"||typeof l=="function")for(let s of h(l))!N.call(e,s)&&s!==o&&d(e,s,{get:()=>l[s],enumerable:!(r=v(l,s))||r.enumerable});return e};var w=(e,l,o)=>(o=e!=null?b(g(e)):{},m(l||!e||!e.__esModule?d(o,"default",{value:e,enumerable:!0}):o,e)),y=e=>m(d({},"__esModule",{value:!0}),e);var z={};k(z,{MulticolDropdown:()=>C,MulticolItem:()=>f});module.exports=y(z);var a=require("react/jsx-runtime"),p=require("react"),t=require("../../components/index.js"),c=w(require("./CompanyStatsBanner/index.js")),n=require("../../helpers/utils.js"),x=require("../AiuiProvider/index.js"),u=require("./NavProvider.js");const C=({multicolMetadata:e,showStatsBanner:l,statsBannerData:o})=>{const r=(0,p.useRef)(null);return(0,a.jsx)("div",{ref:r,className:"bg-white py-4",children:(0,a.jsx)(t.Container,{childClassName:"bg-white",className:"h-full",children:(0,a.jsxs)("div",{className:"laptop:gap-4 flex flex-col gap-3",children:[l&&(0,a.jsx)(c.default,{data:o}),(0,a.jsx)("div",{className:"flex gap-4",children:e?.map((s,i)=>(0,a.jsx)("div",{className:"w-1/4",children:(0,a.jsx)(f,{item:s})},`multicolItem-${s?.label}-${i}`))})]})})})},f=({item:e,allPicture:l})=>{const{locale:o="us"}=(0,x.useAiuiContext)(),{componentOverrides:r}=(0,u.useNavContext)(),s=r?.badge?.variant;return(0,a.jsxs)(a.Fragment,{children:[e?.columns&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.Text,{html:e.label,as:"div",className:"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,a.jsx)("div",{className:"mt-2 flex flex-col",children:e.columns?.map(i=>(0,a.jsxs)("div",{className:"flex items-center gap-1 py-2",children:[(0,a.jsx)(t.Link,{href:`${(0,n.getLocalizedPath)(i.url,o)}?ref=navMenu`,asChild:!i.url,className:"text-sm font-bold leading-[1.4] no-underline",children:i.label}),i?.badge&&(0,a.jsx)(t.Badge,{size:"sm",variant:s,children:i?.badge||"badge"})]},i.label))})]}),e?.imageUrl&&(0,a.jsx)("div",{className:(0,n.cn)("rounded-image-text 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,a.jsx)(t.Link,{href:`${(0,n.getLocalizedPath)(e.url,o)}?ref=navMenu`,asChild:!e.url,children:(0,a.jsxs)("div",{className:"size-full",children:[(0,a.jsx)(t.Picture,{source:e.imageUrl,width:404,height:280,className:"size-full",imgClassName:"object-cover h-full hover:scale-105 transition-all duration-300"}),(0,a.jsxs)("div",{className:"absolute bottom-4 left-4 z-10 flex flex-col justify-end no-underline",children:[(0,a.jsx)(t.Text,{html:e.title,className:(0,n.cn)("lg-desktop:text-2xl text-xl font-bold leading-[1.2] text-white",{"text-black":e?.theme==="dark"})}),e.subtitle&&(0,a.jsx)(t.Text,{html:e.subtitle,className:(0,n.cn)("text-sm font-bold leading-[1.4] text-white",{"text-black":e?.theme==="dark"})}),e?.primary?.label&&(0,a.jsx)(t.Button,{as:"a",href:(0,n.getLocalizedPath)(e?.primary?.url,o),variant:"link",size:"lg",iconClassName:"size-4 lg-desktop:size-5",className:(0,n.cn)("mr-auto !p-0 text-sm font-bold leading-[1.4] text-white",{"text-black":e?.theme==="dark"}),children:e?.primary?.label||"more"})]})]})})})]})};
2
2
  //# sourceMappingURL=MulticolDropdown.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeaderNavigation/MulticolDropdown.tsx"],
4
- "sourcesContent": ["import React, { useRef } from 'react'\nimport { Container, Text, Link, Picture, Button } from '../../components/index.js'\nimport CompanyStatsBanner from './CompanyStatsBanner/index.js'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\n\n/**\n * \u591A\u5217\u4E0B\u62C9\n * @param categoriesItem \u5206\u7C7B\u9879\n */\nexport const MulticolDropdown = ({\n multicolMetadata,\n showStatsBanner,\n statsBannerData,\n}: {\n multicolMetadata: any\n showStatsBanner: boolean\n statsBannerData: any\n}) => {\n const multicolDropdownRef = useRef<HTMLDivElement>(null)\n\n return (\n <div ref={multicolDropdownRef} className=\"bg-white py-4\">\n <Container childClassName=\"bg-white\" className=\"h-full\">\n <div className=\"laptop:gap-4 flex flex-col gap-3\">\n {showStatsBanner && <CompanyStatsBanner data={statsBannerData} />}\n <div className=\"flex gap-4\">\n {multicolMetadata?.map((item: any, index: number) => (\n <div key={`multicolItem-${item?.label}-${index}`} className=\"w-1/4\">\n <MulticolItem item={item} />\n </div>\n ))}\n </div>\n </div>\n </Container>\n </div>\n )\n}\n\n/**\n * \u591A\u5217\u4E0B\u62C9\u9879\n * @param item \u591A\u5217\u4E0B\u62C9\u9879\n */\nexport const MulticolItem = ({ item, allPicture }: { item: any; allPicture?: boolean }) => {\n const { locale = 'us' } = useAiuiContext()\n return (\n <>\n {item?.columns && (\n <>\n <Text html={item.label} as=\"div\" className=\"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"mt-2 flex flex-col\">\n {item.columns?.map((columnItem: any) => (\n <div key={columnItem.label} className=\"flex items-center gap-1 py-2\">\n <Link\n href={`${getLocalizedPath(columnItem.url, locale)}?ref=navMenu`}\n asChild={!columnItem.url}\n className=\"text-sm font-bold leading-[1.4] no-underline\"\n >\n {columnItem.label}\n </Link>\n {columnItem?.badge && (\n <Text\n as=\"p\"\n html={columnItem?.badge || 'badge'}\n className=\"text-brand-0 h-[24px] rounded-full border-[1.6px] border-[var(--brand-color-0)] px-[6px] text-sm font-bold !leading-[22px]\"\n />\n )}\n </div>\n ))}\n </div>\n </>\n )}\n {item?.imageUrl && (\n <div\n className={cn(\n 'rounded-image-text 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',\n {\n ['tablet:max-w-none laptop:max-w-none']: allPicture,\n }\n )}\n >\n <Link href={`${getLocalizedPath(item.url, locale)}?ref=navMenu`} asChild={!item.url}>\n <div className=\"size-full\">\n <Picture\n source={item.imageUrl}\n width={404}\n height={280}\n className=\"size-full\"\n imgClassName=\"object-cover h-full hover:scale-105 transition-all duration-300\"\n />\n <div className=\"absolute bottom-4 left-4 z-10 flex flex-col justify-end no-underline\">\n <Text\n html={item.title}\n className={cn('lg-desktop:text-2xl text-xl font-bold leading-[1.2] text-white', {\n 'text-black': item?.theme === 'dark',\n })}\n />\n {item.subtitle && (\n <Text\n html={item.subtitle}\n className={cn('text-sm font-bold leading-[1.4] text-white', {\n 'text-black': item?.theme === 'dark',\n })}\n />\n )}\n {item?.primary?.label && (\n <Button\n as=\"a\"\n href={getLocalizedPath(item?.primary?.url, locale)}\n variant=\"link\"\n size=\"lg\"\n iconClassName=\"size-4 lg-desktop:size-5\"\n className={cn('mr-auto !p-0 text-sm font-bold leading-[1.4] text-white', {\n 'text-black': item?.theme === 'dark',\n })}\n >\n {item?.primary?.label || 'more'}\n </Button>\n )}\n </div>\n </div>\n </Link>\n </div>\n )}\n </>\n )\n}\n"],
5
- "mappings": "0jBAAA,IAAAA,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AAW,MACT,uLACA,CACG,sCAAwCE,CAC3C,CACF,EAEA,mBAAC,QAAK,KAAM,MAAG,oBAAiBF,EAAK,IAAKG,CAAM,CAAC,eAAgB,QAAS,CAACH,EAAK,IAC9E,oBAAC,OAAI,UAAU,YACb,oBAAC,WACC,OAAQA,EAAK,SACb,MAAO,IACP,OAAQ,IACR,UAAU,YACV,aAAa,kEACf,KACA,QAAC,OAAI,UAAU,uEACb,oBAAC,QACC,KAAMA,EAAK,MACX,aAAW,MAAG,iEAAkE,CAC9E,aAAcA,GAAM,QAAU,MAChC,CAAC,EACH,EACCA,EAAK,aACJ,OAAC,QACC,KAAMA,EAAK,SACX,aAAW,MAAG,6CAA8C,CAC1D,aAAcA,GAAM,QAAU,MAChC,CAAC,EACH,EAEDA,GAAM,SAAS,UACd,OAAC,UACC,GAAG,IACH,QAAM,oBAAiBA,GAAM,SAAS,IAAKG,CAAM,EACjD,QAAQ,OACR,KAAK,KACL,cAAc,2BACd,aAAW,MAAG,0DAA2D,CACvE,aAAcH,GAAM,QAAU,MAChC,CAAC,EAEA,SAAAA,GAAM,SAAS,OAAS,OAC3B,GAEJ,GACF,EACF,EACF,GAEJ,CAEJ",
6
- "names": ["MulticolDropdown_exports", "__export", "MulticolDropdown", "MulticolItem", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_CompanyStatsBanner", "import_utils", "import_AiuiProvider", "multicolMetadata", "showStatsBanner", "statsBannerData", "multicolDropdownRef", "CompanyStatsBanner", "item", "index", "allPicture", "locale", "columnItem"]
4
+ "sourcesContent": ["import React, { useRef } from 'react'\nimport { Container, Text, Link, Picture, Button, Badge } from '../../components/index.js'\nimport CompanyStatsBanner from './CompanyStatsBanner/index.js'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { useNavContext } from './NavProvider.js'\n\n/**\n * \u591A\u5217\u4E0B\u62C9\n * @param categoriesItem \u5206\u7C7B\u9879\n */\nexport const MulticolDropdown = ({\n multicolMetadata,\n showStatsBanner,\n statsBannerData,\n}: {\n multicolMetadata: any\n showStatsBanner: boolean\n statsBannerData: any\n}) => {\n const multicolDropdownRef = useRef<HTMLDivElement>(null)\n\n return (\n <div ref={multicolDropdownRef} className=\"bg-white py-4\">\n <Container childClassName=\"bg-white\" className=\"h-full\">\n <div className=\"laptop:gap-4 flex flex-col gap-3\">\n {showStatsBanner && <CompanyStatsBanner data={statsBannerData} />}\n <div className=\"flex gap-4\">\n {multicolMetadata?.map((item: any, index: number) => (\n <div key={`multicolItem-${item?.label}-${index}`} className=\"w-1/4\">\n <MulticolItem item={item} />\n </div>\n ))}\n </div>\n </div>\n </Container>\n </div>\n )\n}\n\n/**\n * \u591A\u5217\u4E0B\u62C9\u9879\n * @param item \u591A\u5217\u4E0B\u62C9\u9879\n */\nexport const MulticolItem = ({ item, allPicture }: { item: any; allPicture?: boolean }) => {\n const { locale = 'us' } = useAiuiContext()\n const { componentOverrides } = useNavContext()\n const badgeVariant = componentOverrides?.badge?.variant\n return (\n <>\n {item?.columns && (\n <>\n <Text html={item.label} as=\"div\" className=\"my-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"mt-2 flex flex-col\">\n {item.columns?.map((columnItem: any) => (\n <div key={columnItem.label} className=\"flex items-center gap-1 py-2\">\n <Link\n href={`${getLocalizedPath(columnItem.url, locale)}?ref=navMenu`}\n asChild={!columnItem.url}\n className=\"text-sm font-bold leading-[1.4] no-underline\"\n >\n {columnItem.label}\n </Link>\n {columnItem?.badge && (\n <Badge size=\"sm\" variant={badgeVariant}>\n {columnItem?.badge || 'badge'}\n </Badge>\n )}\n </div>\n ))}\n </div>\n </>\n )}\n {item?.imageUrl && (\n <div\n className={cn(\n 'rounded-image-text 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',\n {\n ['tablet:max-w-none laptop:max-w-none']: allPicture,\n }\n )}\n >\n <Link href={`${getLocalizedPath(item.url, locale)}?ref=navMenu`} asChild={!item.url}>\n <div className=\"size-full\">\n <Picture\n source={item.imageUrl}\n width={404}\n height={280}\n className=\"size-full\"\n imgClassName=\"object-cover h-full hover:scale-105 transition-all duration-300\"\n />\n <div className=\"absolute bottom-4 left-4 z-10 flex flex-col justify-end no-underline\">\n <Text\n html={item.title}\n className={cn('lg-desktop:text-2xl text-xl font-bold leading-[1.2] text-white', {\n 'text-black': item?.theme === 'dark',\n })}\n />\n {item.subtitle && (\n <Text\n html={item.subtitle}\n className={cn('text-sm font-bold leading-[1.4] text-white', {\n 'text-black': item?.theme === 'dark',\n })}\n />\n )}\n {item?.primary?.label && (\n <Button\n as=\"a\"\n href={getLocalizedPath(item?.primary?.url, locale)}\n variant=\"link\"\n size=\"lg\"\n iconClassName=\"size-4 lg-desktop:size-5\"\n className={cn('mr-auto !p-0 text-sm font-bold leading-[1.4] text-white', {\n 'text-black': item?.theme === 'dark',\n })}\n >\n {item?.primary?.label || 'more'}\n </Button>\n )}\n </div>\n </div>\n </Link>\n </div>\n )}\n </>\n )\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,EAAA,iBAAAC,IAAA,eAAAC,EAAAJ,GAyBQ,IAAAK,EAAA,6BAzBRC,EAA8B,iBAC9BC,EAA8D,qCAC9DC,EAA+B,4CAC/BC,EAAqC,kCACrCC,EAA+B,oCAC/BC,EAA8B,4BAMvB,MAAMT,EAAmB,CAAC,CAC/B,iBAAAU,EACA,gBAAAC,EACA,gBAAAC,CACF,IAIM,CACJ,MAAMC,KAAsB,UAAuB,IAAI,EAEvD,SACE,OAAC,OAAI,IAAKA,EAAqB,UAAU,gBACvC,mBAAC,aAAU,eAAe,WAAW,UAAU,SAC7C,oBAAC,OAAI,UAAU,mCACZ,UAAAF,MAAmB,OAAC,EAAAG,QAAA,CAAmB,KAAMF,EAAiB,KAC/D,OAAC,OAAI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aAAW,MAAG,6CAA8C,CAC1D,aAAcA,GAAM,QAAU,MAChC,CAAC,EACH,EAEDA,GAAM,SAAS,UACd,OAAC,UACC,GAAG,IACH,QAAM,oBAAiBA,GAAM,SAAS,IAAKG,CAAM,EACjD,QAAQ,OACR,KAAK,KACL,cAAc,2BACd,aAAW,MAAG,0DAA2D,CACvE,aAAcH,GAAM,QAAU,MAChC,CAAC,EAEA,SAAAA,GAAM,SAAS,OAAS,OAC3B,GAEJ,GACF,EACF,EACF,GAEJ,CAEJ",
6
+ "names": ["MulticolDropdown_exports", "__export", "MulticolDropdown", "MulticolItem", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_CompanyStatsBanner", "import_utils", "import_AiuiProvider", "import_NavProvider", "multicolMetadata", "showStatsBanner", "statsBannerData", "multicolDropdownRef", "CompanyStatsBanner", "item", "index", "allPicture", "locale", "componentOverrides", "badgeVariant", "columnItem"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import type { Product } from '../../cpn-components/CpnProductCard/types.js';
3
3
  import { HeaderNavigationMenu } from './types.js';
4
- import type { UserProfile } from './types.js';
4
+ import type { UserProfile, NavigationComponentOverrides } from './types.js';
5
5
  interface NavContextType {
6
6
  buildProps: {
7
7
  products?: Product[];
@@ -29,6 +29,7 @@ interface NavContextType {
29
29
  setCurrentResourceMetadata?: (_metadata: any) => void;
30
30
  onSeriesProductClick?: (_seriesProduct: any, _position: number, _seriesLabel?: string) => void;
31
31
  onSidebarNavClick?: (_series: any, _index: number, _subSubindex?: number) => void;
32
+ componentOverrides?: NavigationComponentOverrides;
32
33
  }
33
34
  export declare const NavContext: React.Context<NavContextType>;
34
35
  export declare const useNavContext: () => NavContextType;
@@ -1,2 +1,2 @@
1
- "use strict";var i=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var p=(t,e)=>{for(var n in e)i(t,n,{get:e[n],enumerable:!0})},M=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of R(e))!T.call(t,o)&&o!==n&&i(t,o,{get:()=>e[o],enumerable:!(a=S(e,o))||a.enumerable});return t};var l=t=>M(i({},"__esModule",{value:!0}),t);var m={};p(m,{NavContext:()=>s,default:()=>U,useNavContext:()=>N});module.exports=l(m);var y=require("react/jsx-runtime"),r=require("react"),c=require("./types.js");const v={isMobile:!1,payloadData:{},buildProps:{products:[],categories:{}},currentMenu:c.HeaderNavigationMenu.Primary,setCurrentMenu:()=>{},currentSeriesMetadata:{},setCurrentSeriesMetadata:()=>{},currentResourceMetadata:{},setCurrentResourceMetadata:()=>{},onSeriesProductClick:(t,e,n)=>{},onSidebarNavClick:t=>{},cartCount:0},s=(0,r.createContext)(v),N=()=>{if(!(0,r.useContext)(s))throw new Error("useNavContext must be used in <NavProvider>");return(0,r.useContext)(s)},b=(t,e)=>{switch(e.type){case"SET_CURRENT_MENU":return{...t,currentMenu:e.value};case"SET_CURRENT_SERIES_METADATA":return{...t,currentSeriesMetadata:e.value};case"SET_SUB_SUB_CATEGORY":return{...t,subSubCategory:e.value};case"SET_CURRENT_RESOURCE_METADATA":return{...t,currentResourceMetadata:e.value}}},A=({children:t,...e})=>{const[n,a]=(0,r.useReducer)(b,{...v,currentMenu:c.HeaderNavigationMenu.Primary,setCurrentMenu:()=>{}}),o=(0,r.useCallback)(u=>a({type:"SET_CURRENT_MENU",value:u}),[a]),d=(0,r.useCallback)(u=>a({type:"SET_CURRENT_SERIES_METADATA",value:u}),[a]),C=(0,r.useCallback)(u=>a({type:"SET_SUB_SUB_CATEGORY",value:u}),[a]),_=(0,r.useCallback)(u=>a({type:"SET_CURRENT_RESOURCE_METADATA",value:u}),[a]),E=(0,r.useMemo)(()=>({...n,setCurrentMenu:o,setCurrentSeriesMetadata:d,setSubSubCategory:C,setCurrentResourceMetadata:_}),[o,d,C,_,n]);return(0,y.jsx)(s.Provider,{value:{...E,...e},children:t})};var U=A;
1
+ "use strict";var s=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var T=(t,e)=>{for(var n in e)s(t,n,{get:e[n],enumerable:!0})},M=(t,e,n,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of p(e))!R.call(t,o)&&o!==n&&s(t,o,{get:()=>e[o],enumerable:!(a=S(e,o))||a.enumerable});return t};var l=t=>M(s({},"__esModule",{value:!0}),t);var U={};T(U,{NavContext:()=>i,default:()=>A,useNavContext:()=>N});module.exports=l(U);var y=require("react/jsx-runtime"),r=require("react"),c=require("./types.js");const _={isMobile:!1,payloadData:{},buildProps:{products:[],categories:{}},currentMenu:c.HeaderNavigationMenu.Primary,setCurrentMenu:()=>{},currentSeriesMetadata:{},setCurrentSeriesMetadata:()=>{},currentResourceMetadata:{},setCurrentResourceMetadata:()=>{},onSeriesProductClick:(t,e,n)=>{},onSidebarNavClick:t=>{},cartCount:0,componentOverrides:void 0},i=(0,r.createContext)(_),N=()=>{if(!(0,r.useContext)(i))throw new Error("useNavContext must be used in <NavProvider>");return(0,r.useContext)(i)},b=(t,e)=>{switch(e.type){case"SET_CURRENT_MENU":return{...t,currentMenu:e.value};case"SET_CURRENT_SERIES_METADATA":return{...t,currentSeriesMetadata:e.value};case"SET_SUB_SUB_CATEGORY":return{...t,subSubCategory:e.value};case"SET_CURRENT_RESOURCE_METADATA":return{...t,currentResourceMetadata:e.value}}},m=({children:t,...e})=>{const[n,a]=(0,r.useReducer)(b,{..._,currentMenu:c.HeaderNavigationMenu.Primary,setCurrentMenu:()=>{}}),o=(0,r.useCallback)(u=>a({type:"SET_CURRENT_MENU",value:u}),[a]),d=(0,r.useCallback)(u=>a({type:"SET_CURRENT_SERIES_METADATA",value:u}),[a]),v=(0,r.useCallback)(u=>a({type:"SET_SUB_SUB_CATEGORY",value:u}),[a]),C=(0,r.useCallback)(u=>a({type:"SET_CURRENT_RESOURCE_METADATA",value:u}),[a]),E=(0,r.useMemo)(()=>({...n,setCurrentMenu:o,setCurrentSeriesMetadata:d,setSubSubCategory:v,setCurrentResourceMetadata:C}),[o,d,v,C,n]);return(0,y.jsx)(i.Provider,{value:{...E,...e},children:t})};var A=m;
2
2
  //# sourceMappingURL=NavProvider.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeaderNavigation/NavProvider.tsx"],
4
- "sourcesContent": ["import React, { createContext, useCallback, useContext, useMemo, useReducer } from 'react'\nimport type { Product } from '../../cpn-components/CpnProductCard/types.js'\nimport { HeaderNavigationMenu } from './types.js'\nimport type { UserProfile } from './types.js'\n\ninterface NavContextType {\n buildProps: {\n products?: Product[] // \u4EA7\u54C1\u6570\u636E\n categories?: Record<string, any> // \u5206\u7C7B\u6570\u636E\n }\n cartCount: number\n event?: {\n search?: () => void\n cart?: () => void\n profile?: () => void\n livestream?: () => void\n join?: () => void\n login?: () => void\n }\n profile?: UserProfile // \u7528\u6237\u4FE1\u606F\n isMobile?: boolean\n payloadData: any\n currentMenu?: HeaderNavigationMenu // \u5F53\u524D\u83DC\u5355\n setCurrentMenu?: (_menu: HeaderNavigationMenu) => void // \u8BBE\u7F6E\u5F53\u524D\u83DC\u5355\n currentSeriesMetadata?: any // \u5F53\u524D\u7CFB\u5217\u5143\u6570\u636E\n setCurrentSeriesMetadata?: (_metadata: any) => void // \u8BBE\u7F6E\u5F53\u524D\u7CFB\u5217\u5143\u6570\u636E\n subSubCategory?: any // \u5B50\u5B50\u5206\u7C7B\n setSubSubCategory?: (_category: any) => void // \u8BBE\u7F6E\u5B50\u5B50\u5206\u7C7B\n currentResourceMetadata?: any // \u5F53\u524D\u8D44\u6E90\u4F4D\u5143\u6570\u636E\n setCurrentResourceMetadata?: (_metadata: any) => void // \u8BBE\u7F6E\u5F53\u524D\u8D44\u6E90\u4F4D\u5143\u6570\u636E\n onSeriesProductClick?: (_seriesProduct: any, _position: number, _seriesLabel?: string) => void // \u8BBE\u7F6E\u7CFB\u5217\u4EA7\u54C1\u70B9\u51FB\n onSidebarNavClick?: (_series: any, _index: number, _subSubindex?: number) => void // \u8BBE\u7F6E\u4FA7\u8FB9\u680F\u5BFC\u822A\u70B9\u51FB\n}\n\nconst initialState: NavContextType = {\n isMobile: false,\n payloadData: {},\n buildProps: {\n products: [],\n categories: {},\n },\n currentMenu: HeaderNavigationMenu.Primary,\n setCurrentMenu: () => {},\n currentSeriesMetadata: {},\n setCurrentSeriesMetadata: () => {},\n currentResourceMetadata: {},\n setCurrentResourceMetadata: () => {},\n onSeriesProductClick: (_seriesProduct: any, _position: number, _seriesLabel?: string) => {},\n onSidebarNavClick: (_series: any) => {},\n cartCount: 0,\n}\n\ntype Action =\n | {\n type: 'SET_CURRENT_MENU'\n value: HeaderNavigationMenu\n }\n | {\n type: 'SET_CURRENT_SERIES_METADATA'\n value: any\n }\n | {\n type: 'SET_SUB_SUB_CATEGORY'\n value: any\n }\n | {\n type: 'SET_CURRENT_RESOURCE_METADATA'\n value: any\n }\nexport const NavContext = createContext<NavContextType>(initialState)\n\nexport const useNavContext = () => {\n const context = useContext(NavContext)\n if (!context) {\n throw new Error('useNavContext must be used in <NavProvider>')\n }\n return useContext(NavContext)\n}\n\nconst reducer = (state: NavContextType, action: Action) => {\n switch (action.type) {\n case 'SET_CURRENT_MENU': {\n return {\n ...state,\n currentMenu: action.value,\n }\n }\n case 'SET_CURRENT_SERIES_METADATA': {\n return {\n ...state,\n currentSeriesMetadata: action.value,\n }\n }\n case 'SET_SUB_SUB_CATEGORY': {\n return {\n ...state,\n subSubCategory: action.value,\n }\n }\n case 'SET_CURRENT_RESOURCE_METADATA': {\n return {\n ...state,\n currentResourceMetadata: action.value,\n }\n }\n }\n}\n\nconst NavProvider = ({\n children,\n ...rest\n}: {\n children: React.ReactNode\n} & NavContextType) => {\n const [state, dispatch] = useReducer(reducer, {\n ...initialState,\n currentMenu: HeaderNavigationMenu.Primary,\n setCurrentMenu: () => {},\n })\n\n const setCurrentMenu = useCallback(\n (value: HeaderNavigationMenu) => {\n return dispatch({ type: 'SET_CURRENT_MENU', value })\n },\n [dispatch]\n )\n\n const setCurrentSeriesMetadata = useCallback(\n (value: any) => {\n return dispatch({ type: 'SET_CURRENT_SERIES_METADATA', value })\n },\n [dispatch]\n )\n\n const setSubSubCategory = useCallback(\n (value: any) => {\n return dispatch({ type: 'SET_SUB_SUB_CATEGORY', value })\n },\n [dispatch]\n )\n\n const setCurrentResourceMetadata = useCallback(\n (value: any) => {\n return dispatch({ type: 'SET_CURRENT_RESOURCE_METADATA', value })\n },\n [dispatch]\n )\n\n const value = useMemo(\n () => ({\n ...state,\n setCurrentMenu,\n setCurrentSeriesMetadata,\n setSubSubCategory,\n setCurrentResourceMetadata,\n }),\n [setCurrentMenu, setCurrentSeriesMetadata, setSubSubCategory, setCurrentResourceMetadata, state]\n )\n\n return <NavContext.Provider value={{ ...value, ...rest }}>{children}</NavContext.Provider>\n}\n\nexport default NavProvider\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,EAAA,YAAAC,EAAA,kBAAAC,IAAA,eAAAC,EAAAL,GA+JS,IAAAM,EAAA,6BA/JTC,EAAmF,iBAEnFC,EAAqC,sBAgCrC,MAAMC,EAA+B,CACnC,SAAU,GACV,YAAa,CAAC,EACd,WAAY,CACV,SAAU,CAAC,EACX,WAAY,CAAC,CACf,EACA,YAAa,uBAAqB,QAClC,eAAgB,IAAM,CAAC,EACvB,sBAAuB,CAAC,EACxB,yBAA0B,IAAM,CAAC,EACjC,wBAAyB,CAAC,EAC1B,2BAA4B,IAAM,CAAC,EACnC,qBAAsB,CAACC,EAAqBC,EAAmBC,IAA0B,CAAC,EAC1F,kBAAoBC,GAAiB,CAAC,EACtC,UAAW,CACb,EAmBaX,KAAa,iBAA8BO,CAAY,EAEvDL,EAAgB,IAAM,CAEjC,GAAI,IADY,cAAWF,CAAU,EAEnC,MAAM,IAAI,MAAM,6CAA6C,EAE/D,SAAO,cAAWA,CAAU,CAC9B,EAEMY,EAAU,CAACC,EAAuBC,IAAmB,CACzD,OAAQA,EAAO,KAAM,CACnB,IAAK,mBACH,MAAO,CACL,GAAGD,EACH,YAAaC,EAAO,KACtB,EAEF,IAAK,8BACH,MAAO,CACL,GAAGD,EACH,sBAAuBC,EAAO,KAChC,EAEF,IAAK,uBACH,MAAO,CACL,GAAGD,EACH,eAAgBC,EAAO,KACzB,EAEF,IAAK,gCACH,MAAO,CACL,GAAGD,EACH,wBAAyBC,EAAO,KAClC,CAEJ,CACF,EAEMC,EAAc,CAAC,CACnB,SAAAC,EACA,GAAGC,CACL,IAEuB,CACrB,KAAM,CAACJ,EAAOK,CAAQ,KAAI,cAAWN,EAAS,CAC5C,GAAGL,EACH,YAAa,uBAAqB,QAClC,eAAgB,IAAM,CAAC,CACzB,CAAC,EAEKY,KAAiB,eACpBC,GACQF,EAAS,CAAE,KAAM,mBAAoB,MAAAE,CAAM,CAAC,EAErD,CAACF,CAAQ,CACX,EAEMG,KAA2B,eAC9BD,GACQF,EAAS,CAAE,KAAM,8BAA+B,MAAAE,CAAM,CAAC,EAEhE,CAACF,CAAQ,CACX,EAEMI,KAAoB,eACvBF,GACQF,EAAS,CAAE,KAAM,uBAAwB,MAAAE,CAAM,CAAC,EAEzD,CAACF,CAAQ,CACX,EAEMK,KAA6B,eAChCH,GACQF,EAAS,CAAE,KAAM,gCAAiC,MAAAE,CAAM,CAAC,EAElE,CAACF,CAAQ,CACX,EAEME,KAAQ,WACZ,KAAO,CACL,GAAGP,EACH,eAAAM,EACA,yBAAAE,EACA,kBAAAC,EACA,2BAAAC,CACF,GACA,CAACJ,EAAgBE,EAA0BC,EAAmBC,EAA4BV,CAAK,CACjG,EAEA,SAAO,OAACb,EAAW,SAAX,CAAoB,MAAO,CAAE,GAAGoB,EAAO,GAAGH,CAAK,EAAI,SAAAD,EAAS,CACtE,EAEA,IAAOf,EAAQc",
4
+ "sourcesContent": ["import React, { createContext, useCallback, useContext, useMemo, useReducer } from 'react'\nimport type { Product } from '../../cpn-components/CpnProductCard/types.js'\nimport { HeaderNavigationMenu } from './types.js'\nimport type { UserProfile, NavigationComponentOverrides } from './types.js'\n\ninterface NavContextType {\n buildProps: {\n products?: Product[] // \u4EA7\u54C1\u6570\u636E\n categories?: Record<string, any> // \u5206\u7C7B\u6570\u636E\n }\n cartCount: number\n event?: {\n search?: () => void\n cart?: () => void\n profile?: () => void\n livestream?: () => void\n join?: () => void\n login?: () => void\n }\n profile?: UserProfile // \u7528\u6237\u4FE1\u606F\n isMobile?: boolean\n payloadData: any\n currentMenu?: HeaderNavigationMenu // \u5F53\u524D\u83DC\u5355\n setCurrentMenu?: (_menu: HeaderNavigationMenu) => void // \u8BBE\u7F6E\u5F53\u524D\u83DC\u5355\n currentSeriesMetadata?: any // \u5F53\u524D\u7CFB\u5217\u5143\u6570\u636E\n setCurrentSeriesMetadata?: (_metadata: any) => void // \u8BBE\u7F6E\u5F53\u524D\u7CFB\u5217\u5143\u6570\u636E\n subSubCategory?: any // \u5B50\u5B50\u5206\u7C7B\n setSubSubCategory?: (_category: any) => void // \u8BBE\u7F6E\u5B50\u5B50\u5206\u7C7B\n currentResourceMetadata?: any // \u5F53\u524D\u8D44\u6E90\u4F4D\u5143\u6570\u636E\n setCurrentResourceMetadata?: (_metadata: any) => void // \u8BBE\u7F6E\u5F53\u524D\u8D44\u6E90\u4F4D\u5143\u6570\u636E\n onSeriesProductClick?: (_seriesProduct: any, _position: number, _seriesLabel?: string) => void // \u8BBE\u7F6E\u7CFB\u5217\u4EA7\u54C1\u70B9\u51FB\n onSidebarNavClick?: (_series: any, _index: number, _subSubindex?: number) => void // \u8BBE\u7F6E\u4FA7\u8FB9\u680F\u5BFC\u822A\u70B9\u51FB\n componentOverrides?: NavigationComponentOverrides\n}\n\nconst initialState: NavContextType = {\n isMobile: false,\n payloadData: {},\n buildProps: {\n products: [],\n categories: {},\n },\n currentMenu: HeaderNavigationMenu.Primary,\n setCurrentMenu: () => {},\n currentSeriesMetadata: {},\n setCurrentSeriesMetadata: () => {},\n currentResourceMetadata: {},\n setCurrentResourceMetadata: () => {},\n onSeriesProductClick: (_seriesProduct: any, _position: number, _seriesLabel?: string) => {},\n onSidebarNavClick: (_series: any) => {},\n cartCount: 0,\n componentOverrides: undefined,\n}\n\ntype Action =\n | {\n type: 'SET_CURRENT_MENU'\n value: HeaderNavigationMenu\n }\n | {\n type: 'SET_CURRENT_SERIES_METADATA'\n value: any\n }\n | {\n type: 'SET_SUB_SUB_CATEGORY'\n value: any\n }\n | {\n type: 'SET_CURRENT_RESOURCE_METADATA'\n value: any\n }\nexport const NavContext = createContext<NavContextType>(initialState)\n\nexport const useNavContext = () => {\n const context = useContext(NavContext)\n if (!context) {\n throw new Error('useNavContext must be used in <NavProvider>')\n }\n return useContext(NavContext)\n}\n\nconst reducer = (state: NavContextType, action: Action) => {\n switch (action.type) {\n case 'SET_CURRENT_MENU': {\n return {\n ...state,\n currentMenu: action.value,\n }\n }\n case 'SET_CURRENT_SERIES_METADATA': {\n return {\n ...state,\n currentSeriesMetadata: action.value,\n }\n }\n case 'SET_SUB_SUB_CATEGORY': {\n return {\n ...state,\n subSubCategory: action.value,\n }\n }\n case 'SET_CURRENT_RESOURCE_METADATA': {\n return {\n ...state,\n currentResourceMetadata: action.value,\n }\n }\n }\n}\n\nconst NavProvider = ({\n children,\n ...rest\n}: {\n children: React.ReactNode\n} & NavContextType) => {\n const [state, dispatch] = useReducer(reducer, {\n ...initialState,\n currentMenu: HeaderNavigationMenu.Primary,\n setCurrentMenu: () => {},\n })\n\n const setCurrentMenu = useCallback(\n (value: HeaderNavigationMenu) => {\n return dispatch({ type: 'SET_CURRENT_MENU', value })\n },\n [dispatch]\n )\n\n const setCurrentSeriesMetadata = useCallback(\n (value: any) => {\n return dispatch({ type: 'SET_CURRENT_SERIES_METADATA', value })\n },\n [dispatch]\n )\n\n const setSubSubCategory = useCallback(\n (value: any) => {\n return dispatch({ type: 'SET_SUB_SUB_CATEGORY', value })\n },\n [dispatch]\n )\n\n const setCurrentResourceMetadata = useCallback(\n (value: any) => {\n return dispatch({ type: 'SET_CURRENT_RESOURCE_METADATA', value })\n },\n [dispatch]\n )\n\n const value = useMemo(\n () => ({\n ...state,\n setCurrentMenu,\n setCurrentSeriesMetadata,\n setSubSubCategory,\n setCurrentResourceMetadata,\n }),\n [setCurrentMenu, setCurrentSeriesMetadata, setSubSubCategory, setCurrentResourceMetadata, state]\n )\n\n return <NavContext.Provider value={{ ...value, ...rest }}>{children}</NavContext.Provider>\n}\n\nexport default NavProvider\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,EAAA,YAAAC,EAAA,kBAAAC,IAAA,eAAAC,EAAAL,GAiKS,IAAAM,EAAA,6BAjKTC,EAAmF,iBAEnFC,EAAqC,sBAiCrC,MAAMC,EAA+B,CACnC,SAAU,GACV,YAAa,CAAC,EACd,WAAY,CACV,SAAU,CAAC,EACX,WAAY,CAAC,CACf,EACA,YAAa,uBAAqB,QAClC,eAAgB,IAAM,CAAC,EACvB,sBAAuB,CAAC,EACxB,yBAA0B,IAAM,CAAC,EACjC,wBAAyB,CAAC,EAC1B,2BAA4B,IAAM,CAAC,EACnC,qBAAsB,CAACC,EAAqBC,EAAmBC,IAA0B,CAAC,EAC1F,kBAAoBC,GAAiB,CAAC,EACtC,UAAW,EACX,mBAAoB,MACtB,EAmBaX,KAAa,iBAA8BO,CAAY,EAEvDL,EAAgB,IAAM,CAEjC,GAAI,IADY,cAAWF,CAAU,EAEnC,MAAM,IAAI,MAAM,6CAA6C,EAE/D,SAAO,cAAWA,CAAU,CAC9B,EAEMY,EAAU,CAACC,EAAuBC,IAAmB,CACzD,OAAQA,EAAO,KAAM,CACnB,IAAK,mBACH,MAAO,CACL,GAAGD,EACH,YAAaC,EAAO,KACtB,EAEF,IAAK,8BACH,MAAO,CACL,GAAGD,EACH,sBAAuBC,EAAO,KAChC,EAEF,IAAK,uBACH,MAAO,CACL,GAAGD,EACH,eAAgBC,EAAO,KACzB,EAEF,IAAK,gCACH,MAAO,CACL,GAAGD,EACH,wBAAyBC,EAAO,KAClC,CAEJ,CACF,EAEMC,EAAc,CAAC,CACnB,SAAAC,EACA,GAAGC,CACL,IAEuB,CACrB,KAAM,CAACJ,EAAOK,CAAQ,KAAI,cAAWN,EAAS,CAC5C,GAAGL,EACH,YAAa,uBAAqB,QAClC,eAAgB,IAAM,CAAC,CACzB,CAAC,EAEKY,KAAiB,eACpBC,GACQF,EAAS,CAAE,KAAM,mBAAoB,MAAAE,CAAM,CAAC,EAErD,CAACF,CAAQ,CACX,EAEMG,KAA2B,eAC9BD,GACQF,EAAS,CAAE,KAAM,8BAA+B,MAAAE,CAAM,CAAC,EAEhE,CAACF,CAAQ,CACX,EAEMI,KAAoB,eACvBF,GACQF,EAAS,CAAE,KAAM,uBAAwB,MAAAE,CAAM,CAAC,EAEzD,CAACF,CAAQ,CACX,EAEMK,KAA6B,eAChCH,GACQF,EAAS,CAAE,KAAM,gCAAiC,MAAAE,CAAM,CAAC,EAElE,CAACF,CAAQ,CACX,EAEME,KAAQ,WACZ,KAAO,CACL,GAAGP,EACH,eAAAM,EACA,yBAAAE,EACA,kBAAAC,EACA,2BAAAC,CACF,GACA,CAACJ,EAAgBE,EAA0BC,EAAmBC,EAA4BV,CAAK,CACjG,EAEA,SAAO,OAACb,EAAW,SAAX,CAAoB,MAAO,CAAE,GAAGoB,EAAO,GAAGH,CAAK,EAAI,SAAAD,EAAS,CACtE,EAEA,IAAOf,EAAQc",
6
6
  "names": ["NavProvider_exports", "__export", "NavContext", "NavProvider_default", "useNavContext", "__toCommonJS", "import_jsx_runtime", "import_react", "import_types", "initialState", "_seriesProduct", "_position", "_seriesLabel", "_series", "reducer", "state", "action", "NavProvider", "children", "rest", "dispatch", "setCurrentMenu", "value", "setCurrentSeriesMetadata", "setSubSubCategory", "setCurrentResourceMetadata"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var z=Object.create;var k=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,R=Object.prototype.hasOwnProperty;var O=(t,i)=>{for(var b in i)k(t,b,{get:i[b],enumerable:!0})},F=(t,i,b,h)=>{if(i&&typeof i=="object"||typeof i=="function")for(let g of B(i))!R.call(t,g)&&g!==b&&k(t,g,{get:()=>i[g],enumerable:!(h=j(i,g))||h.enumerable});return t};var W=(t,i,b)=>(b=t!=null?z(E(t)):{},F(i||!t||!t.__esModule?k(b,"default",{value:t,enumerable:!0}):b,t)),H=t=>F(k({},"__esModule",{value:!0}),t);var T={};O(T,{SeriesProductItem:()=>D,SidebarDropdown:()=>L});module.exports=H(T);var e=require("react/jsx-runtime"),c=W(require("react")),n=require("../../components/index.js"),f=require("../../helpers/utils.js"),$=require("./icons/index.js"),C=require("./NavProvider.js"),w=require("../AiuiProvider/index.js");const L=c.default.memo(({sidebarCategoriesMetadata:t,seriesMetadata:i})=>{const{buildProps:b,onSidebarNavClick:h}=(0,C.useNavContext)(),{locale:g="us"}=(0,w.useAiuiContext)(),[y,v]=(0,c.useState)([]),[u,x]=(0,c.useState)(-1),S=(0,c.useRef)(null),N=(0,c.useRef)(null),p=(0,c.useCallback)(()=>{const l=t?.subcategories;if(!l?.length)return;const o=l.findIndex(d=>!!d?.subSubCategories),a=l.findIndex(d=>!d?.subSubCategories),r=l.map((d,m)=>({index:m,open:o===m||a===m}));v(r)},[t]);(0,c.useEffect)(()=>{p()},[p]);const s=(0,c.useMemo)(()=>{const l=t?.subcategories?.[y?.find(a=>a.open)?.index||0],o=i?.find(a=>a?.label?.toLowerCase()===l?.label?.toLowerCase())||{};if(l?.collections){const a=b?.categories?.[l?.collections]||{};return{label:o?.label,isCollection:!0,banner:o?.banner,primary:o?.primary,series:[{products:a?.products}]}}else if(l?.subSubCategories){const a=l?.subSubCategories?.[u],r=i?.find(d=>d?.label?.toLowerCase()===a?.label?.toLowerCase())||{};if(a?.collections){const d=b?.categories?.[a?.collections]||{};return{label:r?.label,isCollection:!0,banner:r?.banner,primary:r?.primary,series:[{products:d?.products}]}}else return r}else return o},[t,y,u,i,b]),P=(0,c.useCallback)((l,o)=>{const a=o?.subSubCategories?.length>0;x(a?0:-1);const r=N.current;v(d=>d.map((m,A)=>A===l?{...m,open:!m.open}:a?{...m,open:!1}:!r&&u===-1?{...m,open:!1}:r&&!r.hasSubSubCategories&&!a&&u===-1?{...m,open:!1}:m)),N.current={index:l,hasSubSubCategories:a}},[u]),_=(l,o)=>{v(a=>a.map(r=>r.index===l?{...r,open:!0}:{...r,open:!1})),x(o)};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:S,children:[(0,e.jsx)("div",{className:"desktop:h-[416px] flex flex-col overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t?.subcategories?.map((l,o)=>{const a=Array.isArray(l?.subSubCategories)&&l?.subSubCategories?.length>0,r=y?.find(d=>d.index===o)?.open;return(0,e.jsxs)("div",{children:[(0,e.jsxs)("button",{className:(0,f.cn)("rounded-sidebar-shelf flex w-full cursor-pointer items-center justify-between border-0 bg-transparent text-left",{"bg-[#F5F5F7]":!a&&r}),onClick:()=>{P(o,l),h?.(l,o)},"aria-expanded":a?r:void 0,"aria-haspopup":a?"true":void 0,children:[(0,e.jsx)(n.Text,{html:l.label,className:"p-4 text-sm font-bold leading-[1.4]"}),a&&(0,e.jsx)($.DownArrow,{"aria-hidden":"true",className:(0,f.cn)("size-4",{"rotate-180":r})})]}),r&&(0,e.jsx)("div",{className:"flex flex-col",role:"menu",children:l.subSubCategories?.map((d,m)=>(0,e.jsx)("button",{onClick:()=>{_(o,m),h?.(d,m)},className:(0,f.cn)("rounded-sidebar-shelf w-full cursor-pointer border-0 bg-transparent px-6 py-4 text-left leading-none hover:bg-[#F5F5F7]",{"bg-[#F5F5F7]":u===m}),role:"menuitem","aria-label":d.label,children:(0,e.jsx)(n.Text,{html:d.label,className:"text-sm font-bold leading-[1.4] text-[#4A4C56]"})},`subSubItem-${o}-${m}`))})]},`${l?.label||""}subcategoryItem-${o}`)})}),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:`${(0,f.getLocalizedPath)(t?.primary?.url,g)}?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",iconClassName:"size-4",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(s).length>0&&(0,e.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(()=>{const l=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(n.Text,{html:s?.label,className:"lg-desktop:text-2xl text-xl font-bold leading-[1.4]"}),s?.primary&&!s?.primary?.hide&&(0,e.jsx)(n.Text,{className:"lg-desktop:text-base text-sm font-bold leading-[1.2]",html:s?.primary?.label})]});return s?.primary?.url?(0,e.jsx)(n.Button,{as:"a",href:`${(0,f.getLocalizedPath)(s?.primary?.url,g)}?ref=${s?.label}_viewmore`,variant:"link",size:"lg",iconClassName:"size-4",className:"flex items-center justify-start gap-2 !p-0 no-underline",children:l}):(0,e.jsx)("div",{className:"flex items-center gap-2",children:l})})(),t?.guide?.label&&(0,e.jsx)(n.Link,{href:(0,f.getLocalizedPath)(t?.guide?.url,g),className:"lg-desktop:text-base text-sm leading-[1.2] text-[#6D6D6F]",children:t?.guide?.label})]}),(0,e.jsx)("div",{className:"flex h-[426px] flex-col gap-4 overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:s?.series?.map((l,o)=>(0,e.jsxs)("div",{children:[l.label&&(0,e.jsx)(n.Text,{html:l.label,as:"p",className:"mb-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[!!s?.banner&&(0,e.jsx)(n.Link,{asChild:!s?.banner?.href,href:(0,f.getLocalizedPath)(s?.banner?.href,g),children:(0,e.jsxs)("div",{className:"relative [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[(0,e.jsx)(n.Picture,{source:s?.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:s?.banner?.title||"Buy in Guide",className:(0,f.cn)("font-bold text-white",{"text-black":s?.banner?.theme==="dark"})}),(0,e.jsx)(n.Text,{html:s?.banner?.desc||"20.000mAh",className:(0,f.cn)("text-sm font-bold text-white",{"text-black":s?.banner?.theme==="dark"})})]})]})}),l.products?.map((a,r)=>(0,e.jsx)(D,{seriesLabel:s?.label,product:a,isCollection:s?.isCollection},`seriesProductItem-${l?.label||""}-${o}-${r}`))]})]},`seriesItem-${l?.label||""}-${o}`))})]})]})});L.displayName="SidebarDropdown";const D=({product:t,isCollection:i,position:b,seriesLabel:h})=>{const{locale:g="us"}=(0,w.useAiuiContext)(),{buildProps:y,onSeriesProductClick:v}=(0,C.useNavContext)();let u=i?t:y?.products?.find(p=>p.handle===t.handle);const x=u?.variants?.find(p=>p.sku===t.sku)||u?.variants?.[0],S=(0,c.useMemo)(()=>`${(0,f.getLocalizedPath)(`/products/${u?.handle}`,g)}?variant=${(0,f.atobID)(x?.id)}`,[u?.handle,x?.id,g]),N=(0,c.useMemo)(()=>u?.tags?.filter?.(p=>p?.startsWith?.("CLtag"))?.map?.(p=>p?.replace?.("CLtag:",""))?.slice?.(0,2),[u?.tags]);return x?.availableForSale?(0,e.jsx)(n.Link,{href:S,onClick:p=>{p.preventDefault(),window.open(S,"_self"),v?.(u,b||0,h)},className:"no-underline hover:text-current",children:(0,e.jsxs)("div",{className:"rounded-sidebar-shelf 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)("img",{src:`${x?.image?.url||t?.images?.[0]?.url}&width=200`,loading:"lazy",alt:u?.title||t?.name,width:90,height:90,className:"size-[96px] object-contain"})}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)("div",{className:"flex gap-1",children:Array.isArray(N)&&N?.map((p,s)=>(0,e.jsx)(n.Text,{as:"p",html:p,className:"text-brand-0 mb-1 inline-block h-[24px] whitespace-nowrap rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-xs font-bold !leading-[22px]"},s))}),(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:t?.custom_name||x?.metafields?.infos?.page_short_title||u?.title}),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};
1
+ "use strict";var A=Object.create;var C=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var R=(t,i)=>{for(var m in i)C(t,m,{get:i[m],enumerable:!0})},L=(t,i,m,x)=>{if(i&&typeof i=="object"||typeof i=="function")for(let p of j(i))!O.call(t,p)&&p!==m&&C(t,p,{get:()=>i[p],enumerable:!(x=B(i,p))||x.enumerable});return t};var V=(t,i,m)=>(m=t!=null?A(E(t)):{},L(i||!t||!t.__esModule?C(m,"default",{value:t,enumerable:!0}):m,t)),W=t=>L(C({},"__esModule",{value:!0}),t);var H={};R(H,{SeriesProductItem:()=>_,SidebarDropdown:()=>P});module.exports=W(H);var e=require("react/jsx-runtime"),c=V(require("react")),n=require("../../components/index.js"),b=require("../../helpers/utils.js"),D=require("./icons/index.js"),$=require("./NavProvider.js"),F=require("../AiuiProvider/index.js");const P=c.default.memo(({sidebarCategoriesMetadata:t,seriesMetadata:i})=>{const{buildProps:m,onSidebarNavClick:x}=(0,$.useNavContext)(),{locale:p="us"}=(0,F.useAiuiContext)(),[v,N]=(0,c.useState)([]),[h,S]=(0,c.useState)(-1),g=(0,c.useRef)(null),y=(0,c.useRef)(null),k=(0,c.useCallback)(()=>{const a=t?.subcategories;if(!a?.length)return;const o=a.findIndex(u=>!!u?.subSubCategories),l=a.findIndex(u=>!u?.subSubCategories),r=a.map((u,d)=>({index:d,open:o===d||l===d}));N(r)},[t]);(0,c.useEffect)(()=>{k()},[k]);const s=(0,c.useMemo)(()=>{const a=t?.subcategories?.[v?.find(l=>l.open)?.index||0],o=i?.find(l=>l?.label?.toLowerCase()===a?.label?.toLowerCase())||{};if(a?.collections){const l=m?.categories?.[a?.collections]||{};return{label:o?.label,isCollection:!0,banner:o?.banner,primary:o?.primary,series:[{products:l?.products}]}}else if(a?.subSubCategories){const l=a?.subSubCategories?.[h],r=i?.find(u=>u?.label?.toLowerCase()===l?.label?.toLowerCase())||{};if(l?.collections){const u=m?.categories?.[l?.collections]||{};return{label:r?.label,isCollection:!0,banner:r?.banner,primary:r?.primary,series:[{products:u?.products}]}}else return r}else return o},[t,v,h,i,m]),f=(0,c.useCallback)((a,o)=>{const l=o?.subSubCategories?.length>0;S(l?0:-1);const r=y.current;N(u=>u.map((d,z)=>z===a?{...d,open:!d.open}:l?{...d,open:!1}:!r&&h===-1?{...d,open:!1}:r&&!r.hasSubSubCategories&&!l&&h===-1?{...d,open:!1}:d)),y.current={index:a,hasSubSubCategories:l}},[h]),w=(a,o)=>{N(l=>l.map(r=>r.index===a?{...r,open:!0}:{...r,open:!1})),S(o)};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:g,children:[(0,e.jsx)("div",{className:"desktop:h-[416px] flex flex-col overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t?.subcategories?.map((a,o)=>{const l=Array.isArray(a?.subSubCategories)&&a?.subSubCategories?.length>0,r=v?.find(u=>u.index===o)?.open;return(0,e.jsxs)("div",{children:[(0,e.jsxs)("button",{className:(0,b.cn)("rounded-sidebar-shelf flex w-full cursor-pointer items-center justify-between border-0 bg-transparent text-left",{"bg-[#F5F5F7]":!l&&r}),onClick:()=>{f(o,a),x?.(a,o)},"aria-expanded":l?r:void 0,"aria-haspopup":l?"true":void 0,children:[(0,e.jsx)(n.Text,{html:a.label,className:"p-4 text-sm font-bold leading-[1.4]"}),l&&(0,e.jsx)(D.DownArrow,{"aria-hidden":"true",className:(0,b.cn)("size-4",{"rotate-180":r})})]}),r&&(0,e.jsx)("div",{className:"flex flex-col",role:"menu",children:a.subSubCategories?.map((u,d)=>(0,e.jsx)("button",{onClick:()=>{w(o,d),x?.(u,d)},className:(0,b.cn)("rounded-sidebar-shelf w-full cursor-pointer border-0 bg-transparent px-6 py-4 text-left leading-none hover:bg-[#F5F5F7]",{"bg-[#F5F5F7]":h===d}),role:"menuitem","aria-label":u.label,children:(0,e.jsx)(n.Text,{html:u.label,className:"text-sm font-bold leading-[1.4] text-[#4A4C56]"})},`subSubItem-${o}-${d}`))})]},`${a?.label||""}subcategoryItem-${o}`)})}),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:`${(0,b.getLocalizedPath)(t?.primary?.url,p)}?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",iconClassName:"size-4",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(s).length>0&&(0,e.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(()=>{const a=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(n.Text,{html:s?.label,className:"lg-desktop:text-2xl text-xl font-bold leading-[1.4]"}),s?.primary&&!s?.primary?.hide&&(0,e.jsx)(n.Text,{className:"lg-desktop:text-base text-sm font-bold leading-[1.2]",html:s?.primary?.label})]});return s?.primary?.url?(0,e.jsx)(n.Button,{as:"a",href:`${(0,b.getLocalizedPath)(s?.primary?.url,p)}?ref=${s?.label}_viewmore`,variant:"link",size:"lg",iconClassName:"size-4",className:"flex items-center justify-start gap-2 !p-0 no-underline",children:a}):(0,e.jsx)("div",{className:"flex items-center gap-2",children:a})})(),t?.guide?.label&&(0,e.jsx)(n.Link,{href:(0,b.getLocalizedPath)(t?.guide?.url,p),className:"lg-desktop:text-base text-sm leading-[1.2] text-[#6D6D6F]",children:t?.guide?.label})]}),(0,e.jsx)("div",{className:"flex h-[426px] flex-col gap-4 overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:s?.series?.map((a,o)=>(0,e.jsxs)("div",{children:[a.label&&(0,e.jsx)(n.Text,{html:a.label,as:"p",className:"mb-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[!!s?.banner&&(0,e.jsx)(n.Link,{asChild:!s?.banner?.href,href:(0,b.getLocalizedPath)(s?.banner?.href,p),children:(0,e.jsxs)("div",{className:"relative [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[(0,e.jsx)(n.Picture,{source:s?.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:s?.banner?.title||"Buy in Guide",className:(0,b.cn)("font-bold text-white",{"text-black":s?.banner?.theme==="dark"})}),(0,e.jsx)(n.Text,{html:s?.banner?.desc||"20.000mAh",className:(0,b.cn)("text-sm font-bold text-white",{"text-black":s?.banner?.theme==="dark"})})]})]})}),a.products?.map((l,r)=>(0,e.jsx)(_,{seriesLabel:s?.label,product:l,isCollection:s?.isCollection},`seriesProductItem-${a?.label||""}-${o}-${r}`))]})]},`seriesItem-${a?.label||""}-${o}`))})]})]})});P.displayName="SidebarDropdown";const _=({product:t,isCollection:i,position:m,seriesLabel:x})=>{const{locale:p="us"}=(0,F.useAiuiContext)(),{buildProps:v,onSeriesProductClick:N,componentOverrides:h}=(0,$.useNavContext)(),S=h?.badge?.variant;let g=i?t:v?.products?.find(f=>f.handle===t.handle);const y=g?.variants?.find(f=>f.sku===t.sku)||g?.variants?.[0],k=(0,c.useMemo)(()=>`${(0,b.getLocalizedPath)(`/products/${g?.handle}`,p)}?variant=${(0,b.atobID)(y?.id)}`,[g?.handle,y?.id,p]),s=(0,c.useMemo)(()=>g?.tags?.filter?.(f=>f?.startsWith?.("CLtag"))?.map?.(f=>f?.replace?.("CLtag:",""))?.slice?.(0,2),[g?.tags]);return y?.availableForSale?(0,e.jsx)(n.Link,{href:k,onClick:f=>{f.preventDefault(),window.open(k,"_self"),N?.(g,m||0,x)},className:"no-underline hover:text-current",children:(0,e.jsxs)("div",{className:"rounded-sidebar-shelf 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)("img",{src:`${y?.image?.url||t?.images?.[0]?.url}&width=200`,loading:"lazy",alt:g?.title||t?.name,width:90,height:90,className:"size-[96px] object-contain"})}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)("div",{className:"flex gap-1",children:Array.isArray(s)&&s?.map((f,w)=>(0,e.jsx)(n.Badge,{size:"sm",variant:S,className:"mb-1 whitespace-nowrap",children:f},w))}),(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:t?.custom_name||y?.metafields?.infos?.page_short_title||g?.title}),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};
2
2
  //# sourceMappingURL=SidebarDropdown.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeaderNavigation/SidebarDropdown.tsx"],
4
- "sourcesContent": ["import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { Button, Container, Text, Link, Heading, Picture } from '../../components/index.js'\nimport { cn, atobID, getLocalizedPath } from '../../helpers/utils.js'\nimport { DownArrow } from './icons/index.js'\nimport { useNavContext } from './NavProvider.js'\nimport type { Product, ProductVariant } from '../../cpn-components/CpnProductCard/types.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\n\n/**\n * \u4FA7\u8FB9\u680F\u4E0B\u62C9\n * @param categoriesItem \u5206\u7C7B\u9879\n */\nexport const SidebarDropdown = React.memo(\n ({ sidebarCategoriesMetadata, seriesMetadata }: { sidebarCategoriesMetadata: any; seriesMetadata: any }) => {\n const { buildProps, onSidebarNavClick } = useNavContext()\n const { locale = 'us' } = useAiuiContext()\n const [expandedSubcategory, setExpandedSubcategory] = useState<{ index: number; open: boolean }[]>([])\n const [activeSubSubcategoryIndex, setActiveSubSubcategoryIndex] = useState(-1)\n const sidebarDropdownRef = useRef<HTMLDivElement>(null)\n const lastClickRef = useRef<{ index: number; hasSubSubCategories: boolean } | null>(null)\n\n const initExpandedSubcategory = useCallback(() => {\n const subcategories = sidebarCategoriesMetadata?.subcategories\n if (!subcategories?.length) return\n\n const withSubSubCategoriesIndex = subcategories.findIndex((item: any) => !!item?.subSubCategories)\n const withoutSubSubCategoriesIndex = subcategories.findIndex((item: any) => !item?.subSubCategories)\n\n // \u521B\u5EFA\u5C55\u5F00\u72B6\u6001\u6570\u7EC4\n const expandedStates = subcategories.map((_: any, index: number) => ({\n index,\n open: withSubSubCategoriesIndex === index || withoutSubSubCategoriesIndex === index,\n }))\n\n setExpandedSubcategory(expandedStates)\n }, [sidebarCategoriesMetadata])\n\n useEffect(() => {\n initExpandedSubcategory()\n }, [initExpandedSubcategory])\n\n // \u901A\u8FC7categoriesMetadata\u7684subSubCategories\u7684label\u4E0Eseries\u7684label\u5339\u914D\n const matchSeriesMetadata = useMemo(() => {\n const subCategory =\n sidebarCategoriesMetadata?.subcategories?.[expandedSubcategory?.find(item => item.open)?.index || 0]\n const currentSeriesMetadata =\n seriesMetadata?.find((item: any) => item?.label?.toLowerCase() === subCategory?.label?.toLowerCase()) || {}\n if (subCategory?.collections) {\n const category = buildProps?.categories?.[subCategory?.collections] || {}\n return {\n label: currentSeriesMetadata?.label,\n isCollection: true,\n banner: currentSeriesMetadata?.banner,\n primary: currentSeriesMetadata?.primary,\n series: [\n {\n products: category?.products,\n },\n ],\n }\n } else {\n if (subCategory?.subSubCategories) {\n const activeSubSubcategory = subCategory?.subSubCategories?.[activeSubSubcategoryIndex]\n const currentActiveSeriesMetadata =\n seriesMetadata?.find(\n (item: any) => item?.label?.toLowerCase() === activeSubSubcategory?.label?.toLowerCase()\n ) || {}\n if (activeSubSubcategory?.collections) {\n const category = buildProps?.categories?.[activeSubSubcategory?.collections] || {}\n return {\n label: currentActiveSeriesMetadata?.label,\n isCollection: true,\n banner: currentActiveSeriesMetadata?.banner,\n primary: currentActiveSeriesMetadata?.primary,\n series: [\n {\n products: category?.products,\n },\n ],\n }\n } else {\n return currentActiveSeriesMetadata\n }\n } else {\n return currentSeriesMetadata\n }\n }\n }, [sidebarCategoriesMetadata, expandedSubcategory, activeSubSubcategoryIndex, seriesMetadata, buildProps])\n\n const handleSubcategoryOpen = useCallback(\n (index: number, subcategoryItem: any) => {\n const hasSubSubCategories = subcategoryItem?.subSubCategories?.length > 0\n hasSubSubCategories ? setActiveSubSubcategoryIndex(0) : setActiveSubSubcategoryIndex(-1)\n\n const lastClick = lastClickRef.current\n\n setExpandedSubcategory(prev =>\n prev.map((item, i) => {\n if (i === index) {\n return { ...item, open: !item.open }\n }\n // \u5982\u679C\u5F53\u524D\u70B9\u51FB\u7684\u9879\u6709\u5B50\u5B50\u5206\u7C7B\uFF0C\u5173\u95ED\u5176\u4ED6\u6240\u6709\u9879\n if (hasSubSubCategories) {\n return { ...item, open: false }\n }\n if (!lastClick && activeSubSubcategoryIndex === -1) {\n return { ...item, open: false }\n }\n if (\n lastClick &&\n !lastClick.hasSubSubCategories &&\n !hasSubSubCategories &&\n activeSubSubcategoryIndex === -1\n ) {\n // \u5982\u679C\u4E0A\u4E00\u6B21\u70B9\u51FB\u7684\u9879\u6CA1\u6709\u5B50\u5B50\u5206\u7C7B\uFF0C\u4E14\u8FD9\u6B21\u70B9\u51FB\u7684\u4E5F\u6CA1\u6709\u5B50\u5B50\u5206\u7C7B\uFF0C\u5E76\u4E14\u6CA1\u6709\u70B9\u51FB\u4E0A\u4E00\u6B21\u6CA1\u6709subSubCategories\u7684item \u5173\u95ED\u4E0A\u4E00\u6B21\u7684\u9879\n return { ...item, open: false }\n }\n return item\n })\n )\n\n // \u66F4\u65B0\u4E0A\u4E00\u6B21\u70B9\u51FB\u7684\u72B6\u6001\n lastClickRef.current = { index, hasSubSubCategories }\n },\n [activeSubSubcategoryIndex]\n )\n\n const handleSubSubcategoryOpen = (index: number, subSubindex: number) => {\n setExpandedSubcategory(prev =>\n prev.map(item => (item.index === index ? { ...item, open: true } : { ...item, open: false }))\n )\n setActiveSubSubcategoryIndex(subSubindex)\n }\n\n return (\n <Container childClassName=\"lg-desktop:gap-12 flex bg-white gap-8\">\n <div\n className=\"lg-desktop:basis-[356px] flex basis-[284px] flex-col gap-4 py-4\"\n style={{\n userSelect: 'none',\n }}\n ref={sidebarDropdownRef}\n >\n <div\n className=\"desktop:h-[416px] flex flex-col overflow-y-auto\"\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n >\n {sidebarCategoriesMetadata?.subcategories?.map((subItem: any, index: number) => {\n const hasSubSubCategory =\n Array.isArray(subItem?.subSubCategories) && subItem?.subSubCategories?.length > 0\n const isExpanded = expandedSubcategory?.find(item => item.index === index)?.open\n return (\n <div key={`${subItem?.label || ''}subcategoryItem-${index}`}>\n <button\n className={cn(\n 'rounded-sidebar-shelf flex w-full cursor-pointer items-center justify-between border-0 bg-transparent text-left',\n {\n 'bg-[#F5F5F7]': !hasSubSubCategory && isExpanded,\n }\n )}\n onClick={() => {\n handleSubcategoryOpen(index, subItem)\n onSidebarNavClick?.(subItem, index)\n }}\n aria-expanded={hasSubSubCategory ? isExpanded : undefined}\n aria-haspopup={hasSubSubCategory ? 'true' : undefined}\n >\n <Text html={subItem.label} className=\"p-4 text-sm font-bold leading-[1.4]\" />\n {hasSubSubCategory && (\n <DownArrow\n aria-hidden=\"true\"\n className={cn('size-4', {\n ['rotate-180']: isExpanded,\n })}\n />\n )}\n </button>\n {isExpanded && (\n <div className=\"flex flex-col\" role=\"menu\">\n {subItem.subSubCategories?.map((subSubItem: any, subSubindex: number) => (\n <button\n onClick={() => {\n handleSubSubcategoryOpen(index, subSubindex)\n onSidebarNavClick?.(subSubItem, subSubindex)\n }}\n key={`subSubItem-${index}-${subSubindex}`}\n className={cn(\n 'rounded-sidebar-shelf w-full cursor-pointer border-0 bg-transparent px-6 py-4 text-left leading-none hover:bg-[#F5F5F7]',\n {\n 'bg-[#F5F5F7]': activeSubSubcategoryIndex === subSubindex,\n }\n )}\n role=\"menuitem\"\n aria-label={subSubItem.label}\n >\n <Text html={subSubItem.label} className=\"text-sm font-bold leading-[1.4] text-[#4A4C56]\" />\n </button>\n ))}\n </div>\n )}\n </div>\n )\n })}\n </div>\n {sidebarCategoriesMetadata && (\n <div className=\"flex\">\n <div className=\"flex flex-col gap-4\">\n {sidebarCategoriesMetadata?.primary && (\n <Button\n as=\"a\"\n href={`${getLocalizedPath(sidebarCategoriesMetadata?.primary?.url, locale)}?ref=${sidebarCategoriesMetadata?.primary?.label}_shopall`}\n variant=\"primary\"\n size=\"lg\"\n className=\"lg-desktop:text-base text-sm\"\n >\n {sidebarCategoriesMetadata?.primary?.label}\n </Button>\n )}\n {sidebarCategoriesMetadata?.secondary && (\n <Button\n as=\"a\"\n href={sidebarCategoriesMetadata?.secondary?.url}\n variant=\"link\"\n size=\"lg\"\n iconClassName=\"size-4\"\n className=\"lg-desktop:text-base justify-start !p-0 text-sm\"\n >\n {sidebarCategoriesMetadata?.secondary?.label}\n </Button>\n )}\n </div>\n </div>\n )}\n </div>\n <div className=\"flex-1 py-4\">\n {Reflect.ownKeys(matchSeriesMetadata).length > 0 && (\n <div className=\"mb-4 flex items-center justify-between\">\n {(() => {\n const labelContent = (\n <>\n <Text\n html={matchSeriesMetadata?.label}\n className=\"lg-desktop:text-2xl text-xl font-bold leading-[1.4]\"\n />\n {matchSeriesMetadata?.primary && !matchSeriesMetadata?.primary?.hide && (\n <Text\n className=\"lg-desktop:text-base text-sm font-bold leading-[1.2]\"\n html={matchSeriesMetadata?.primary?.label}\n />\n )}\n </>\n )\n\n return matchSeriesMetadata?.primary?.url ? (\n <Button\n as=\"a\"\n href={`${getLocalizedPath(matchSeriesMetadata?.primary?.url, locale)}?ref=${matchSeriesMetadata?.label}_viewmore`}\n variant=\"link\"\n size=\"lg\"\n iconClassName=\"size-4\"\n className=\"flex items-center justify-start gap-2 !p-0 no-underline\"\n >\n {labelContent}\n </Button>\n ) : (\n <div className=\"flex items-center gap-2\">{labelContent}</div>\n )\n })()}\n {sidebarCategoriesMetadata?.guide?.label && (\n <Link\n href={getLocalizedPath(sidebarCategoriesMetadata?.guide?.url, locale)}\n className=\"lg-desktop:text-base text-sm leading-[1.2] text-[#6D6D6F]\"\n >\n {sidebarCategoriesMetadata?.guide?.label}\n </Link>\n )}\n </div>\n )}\n <div\n className=\"flex h-[426px] flex-col gap-4 overflow-y-auto\"\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n >\n {matchSeriesMetadata?.series?.map((seriesItem: any, seriesIndex: number) => (\n <div key={`seriesItem-${seriesItem?.label || ''}-${seriesIndex}`}>\n {seriesItem.label && (\n <Text\n html={seriesItem.label}\n as=\"p\"\n className=\"mb-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n )}\n <div className=\"grid grid-cols-3 gap-4\">\n {!!matchSeriesMetadata?.banner && (\n <Link\n asChild={!matchSeriesMetadata?.banner?.href}\n href={getLocalizedPath(matchSeriesMetadata?.banner?.href, locale)}\n >\n <div className=\"relative [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500\">\n <Picture\n source={matchSeriesMetadata?.banner?.imageUrl}\n className=\"laptop:h-[120px] h-[114px]\"\n imgClassName=\"object-cover h-full\"\n />\n <div className=\"absolute inset-x-0 bottom-0 p-4\">\n <Heading\n size={2}\n html={matchSeriesMetadata?.banner?.title || 'Buy in Guide'}\n className={cn('font-bold text-white', {\n 'text-black': matchSeriesMetadata?.banner?.theme === 'dark',\n })}\n />\n <Text\n html={matchSeriesMetadata?.banner?.desc || '20.000mAh'}\n className={cn('text-sm font-bold text-white', {\n 'text-black': matchSeriesMetadata?.banner?.theme === 'dark',\n })}\n />\n </div>\n </div>\n </Link>\n )}\n {seriesItem.products?.map((product: any, index: number) => (\n <SeriesProductItem\n seriesLabel={matchSeriesMetadata?.label}\n key={`seriesProductItem-${seriesItem?.label || ''}-${seriesIndex}-${index}`}\n product={product}\n isCollection={matchSeriesMetadata?.isCollection}\n />\n ))}\n </div>\n </div>\n ))}\n </div>\n </div>\n </Container>\n )\n }\n)\n\nSidebarDropdown.displayName = 'SidebarDropdown'\n\n/**\n * \u7CFB\u5217\u4EA7\u54C1\u9879\u7EC4\u4EF6\n */\nexport const SeriesProductItem = ({\n product,\n isCollection,\n position,\n seriesLabel,\n}: {\n product: any\n isCollection?: boolean\n position?: number\n seriesLabel?: string\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const { buildProps, onSeriesProductClick } = useNavContext()\n let productData = isCollection\n ? product\n : buildProps?.products?.find((item: Product) => item.handle === product.handle)\n const variant =\n productData?.variants?.find((item: ProductVariant) => item.sku === product.sku) || productData?.variants?.[0]\n\n const listingLink = useMemo(() => {\n return `${getLocalizedPath(`/products/${productData?.handle}`, locale)}?variant=${atobID(variant?.id as string)}`\n }, [productData?.handle, variant?.id, locale])\n\n const tags = useMemo(() => {\n return productData?.tags\n ?.filter?.((item: any) => item?.startsWith?.('CLtag'))\n ?.map?.((item: any) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, 2)\n }, [productData?.tags])\n\n if (!variant?.availableForSale) return null\n\n return (\n <Link\n href={listingLink}\n onClick={e => {\n e.preventDefault()\n window.open(listingLink, '_self')\n onSeriesProductClick?.(productData, position || 0, seriesLabel)\n }}\n className=\"no-underline hover:text-current\"\n >\n <div className=\"rounded-sidebar-shelf flex shrink-0 items-center gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110 [&_img]:hover:duration-500\">\n <div className=\"shrink-0\">\n <img\n src={`${variant?.image?.url || product?.images?.[0]?.url}&width=200`}\n loading=\"lazy\"\n alt={productData?.title || product?.name}\n width={90}\n height={90}\n className=\"size-[96px] object-contain\"\n />\n </div>\n <div className=\"relative\">\n <div className=\"flex gap-1\">\n {Array.isArray(tags) &&\n tags?.map((tag: string, index: number) => (\n <Text\n key={index}\n as=\"p\"\n html={tag}\n className=\"text-brand-0 mb-1 inline-block h-[24px] whitespace-nowrap rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-xs font-bold !leading-[22px]\"\n />\n ))}\n </div>\n <Text\n className=\"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]\"\n html={product?.custom_name || variant?.metafields?.infos?.page_short_title || productData?.title}\n />\n {product?.desc && (\n <Text\n as=\"p\"\n html={product?.desc}\n className=\"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n )}\n </div>\n </div>\n </Link>\n )\n}\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,EAAA,oBAAAC,IAAA,eAAAC,EAAAJ,GA4JkB,IAAAK,EAAA,6BA5JlBC,EAAyE,oBACzEC,EAAgE,qCAChEC,EAA6C,kCAC7CC,EAA0B,4BAC1BC,EAA8B,4BAE9BC,EAA+B,oCAMxB,MAAMR,EAAkB,EAAAS,QAAM,KACnC,CAAC,CAAE,0BAAAC,EAA2B,eAAAC,CAAe,IAA+D,CAC1G,KAAM,CAAE,WAAAC,EAAY,kBAAAC,CAAkB,KAAI,iBAAc,EAClD,CAAE,OAAAC,EAAS,IAAK,KAAI,kBAAe,EACnC,CAACC,EAAqBC,CAAsB,KAAI,YAA6C,CAAC,CAAC,EAC/F,CAACC,EAA2BC,CAA4B,KAAI,YAAS,EAAE,EACvEC,KAAqB,UAAuB,IAAI,EAChDC,KAAe,UAA+D,IAAI,EAElFC,KAA0B,eAAY,IAAM,CAChD,MAAMC,EAAgBZ,GAA2B,cACjD,GAAI,CAACY,GAAe,OAAQ,OAE5B,MAAMC,EAA4BD,EAAc,UAAWE,GAAc,CAAC,CAACA,GAAM,gBAAgB,EAC3FC,EAA+BH,EAAc,UAAWE,GAAc,CAACA,GAAM,gBAAgB,EAG7FE,EAAiBJ,EAAc,IAAI,CAACK,EAAQC,KAAmB,CACnE,MAAAA,EACA,KAAML,IAA8BK,GAASH,IAAiCG,CAChF,EAAE,EAEFZ,EAAuBU,CAAc,CACvC,EAAG,CAAChB,CAAyB,CAAC,KAE9B,aAAU,IAAM,CACdW,EAAwB,CAC1B,EAAG,CAACA,CAAuB,CAAC,EAG5B,MAAMQ,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ACF,KACA,QAAC,OAAI,UAAU,WACb,oBAAC,OAAI,UAAU,aACZ,eAAM,QAAQQ,CAAI,GACjBA,GAAM,IAAI,CAACE,EAAahC,OACtB,OAAC,QAEC,GAAG,IACH,KAAMgC,EACN,UAAU,qJAHLhC,CAIP,CACD,EACL,KACA,OAAC,QACC,UAAU,iGACV,KAAMsB,GAAS,aAAeM,GAAS,YAAY,OAAO,kBAAoBD,GAAa,MAC7F,EACCL,GAAS,SACR,OAAC,QACC,GAAG,IACH,KAAMA,GAAS,KACf,UAAU,sFACZ,GAEJ,GACF,EACF,EAhDqC,IAkDzC",
6
- "names": ["SidebarDropdown_exports", "__export", "SeriesProductItem", "SidebarDropdown", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_utils", "import_icons", "import_NavProvider", "import_AiuiProvider", "React", "sidebarCategoriesMetadata", "seriesMetadata", "buildProps", "onSidebarNavClick", "locale", "expandedSubcategory", "setExpandedSubcategory", "activeSubSubcategoryIndex", "setActiveSubSubcategoryIndex", "sidebarDropdownRef", "lastClickRef", "initExpandedSubcategory", "subcategories", "withSubSubCategoriesIndex", "item", "withoutSubSubCategoriesIndex", "expandedStates", "_", "index", "matchSeriesMetadata", "subCategory", "currentSeriesMetadata", "category", "activeSubSubcategory", "currentActiveSeriesMetadata", "handleSubcategoryOpen", "subcategoryItem", "hasSubSubCategories", "lastClick", "prev", "i", "handleSubSubcategoryOpen", "subSubindex", "subItem", "hasSubSubCategory", "isExpanded", "subSubItem", "labelContent", "seriesItem", "seriesIndex", "product", "isCollection", "position", "seriesLabel", "onSeriesProductClick", "productData", "variant", "listingLink", "tags", "e", "tag"]
4
+ "sourcesContent": ["import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { Button, Container, Text, Link, Heading, Picture, Badge } from '../../components/index.js'\nimport { cn, atobID, getLocalizedPath } from '../../helpers/utils.js'\nimport { DownArrow } from './icons/index.js'\nimport { useNavContext } from './NavProvider.js'\nimport type { Product, ProductVariant } from '../../cpn-components/CpnProductCard/types.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\n\n/**\n * \u4FA7\u8FB9\u680F\u4E0B\u62C9\n * @param categoriesItem \u5206\u7C7B\u9879\n */\nexport const SidebarDropdown = React.memo(\n ({ sidebarCategoriesMetadata, seriesMetadata }: { sidebarCategoriesMetadata: any; seriesMetadata: any }) => {\n const { buildProps, onSidebarNavClick } = useNavContext()\n const { locale = 'us' } = useAiuiContext()\n const [expandedSubcategory, setExpandedSubcategory] = useState<{ index: number; open: boolean }[]>([])\n const [activeSubSubcategoryIndex, setActiveSubSubcategoryIndex] = useState(-1)\n const sidebarDropdownRef = useRef<HTMLDivElement>(null)\n const lastClickRef = useRef<{ index: number; hasSubSubCategories: boolean } | null>(null)\n\n const initExpandedSubcategory = useCallback(() => {\n const subcategories = sidebarCategoriesMetadata?.subcategories\n if (!subcategories?.length) return\n\n const withSubSubCategoriesIndex = subcategories.findIndex((item: any) => !!item?.subSubCategories)\n const withoutSubSubCategoriesIndex = subcategories.findIndex((item: any) => !item?.subSubCategories)\n\n // \u521B\u5EFA\u5C55\u5F00\u72B6\u6001\u6570\u7EC4\n const expandedStates = subcategories.map((_: any, index: number) => ({\n index,\n open: withSubSubCategoriesIndex === index || withoutSubSubCategoriesIndex === index,\n }))\n\n setExpandedSubcategory(expandedStates)\n }, [sidebarCategoriesMetadata])\n\n useEffect(() => {\n initExpandedSubcategory()\n }, [initExpandedSubcategory])\n\n // \u901A\u8FC7categoriesMetadata\u7684subSubCategories\u7684label\u4E0Eseries\u7684label\u5339\u914D\n const matchSeriesMetadata = useMemo(() => {\n const subCategory =\n sidebarCategoriesMetadata?.subcategories?.[expandedSubcategory?.find(item => item.open)?.index || 0]\n const currentSeriesMetadata =\n seriesMetadata?.find((item: any) => item?.label?.toLowerCase() === subCategory?.label?.toLowerCase()) || {}\n if (subCategory?.collections) {\n const category = buildProps?.categories?.[subCategory?.collections] || {}\n return {\n label: currentSeriesMetadata?.label,\n isCollection: true,\n banner: currentSeriesMetadata?.banner,\n primary: currentSeriesMetadata?.primary,\n series: [\n {\n products: category?.products,\n },\n ],\n }\n } else {\n if (subCategory?.subSubCategories) {\n const activeSubSubcategory = subCategory?.subSubCategories?.[activeSubSubcategoryIndex]\n const currentActiveSeriesMetadata =\n seriesMetadata?.find(\n (item: any) => item?.label?.toLowerCase() === activeSubSubcategory?.label?.toLowerCase()\n ) || {}\n if (activeSubSubcategory?.collections) {\n const category = buildProps?.categories?.[activeSubSubcategory?.collections] || {}\n return {\n label: currentActiveSeriesMetadata?.label,\n isCollection: true,\n banner: currentActiveSeriesMetadata?.banner,\n primary: currentActiveSeriesMetadata?.primary,\n series: [\n {\n products: category?.products,\n },\n ],\n }\n } else {\n return currentActiveSeriesMetadata\n }\n } else {\n return currentSeriesMetadata\n }\n }\n }, [sidebarCategoriesMetadata, expandedSubcategory, activeSubSubcategoryIndex, seriesMetadata, buildProps])\n\n const handleSubcategoryOpen = useCallback(\n (index: number, subcategoryItem: any) => {\n const hasSubSubCategories = subcategoryItem?.subSubCategories?.length > 0\n hasSubSubCategories ? setActiveSubSubcategoryIndex(0) : setActiveSubSubcategoryIndex(-1)\n\n const lastClick = lastClickRef.current\n\n setExpandedSubcategory(prev =>\n prev.map((item, i) => {\n if (i === index) {\n return { ...item, open: !item.open }\n }\n // \u5982\u679C\u5F53\u524D\u70B9\u51FB\u7684\u9879\u6709\u5B50\u5B50\u5206\u7C7B\uFF0C\u5173\u95ED\u5176\u4ED6\u6240\u6709\u9879\n if (hasSubSubCategories) {\n return { ...item, open: false }\n }\n if (!lastClick && activeSubSubcategoryIndex === -1) {\n return { ...item, open: false }\n }\n if (\n lastClick &&\n !lastClick.hasSubSubCategories &&\n !hasSubSubCategories &&\n activeSubSubcategoryIndex === -1\n ) {\n // \u5982\u679C\u4E0A\u4E00\u6B21\u70B9\u51FB\u7684\u9879\u6CA1\u6709\u5B50\u5B50\u5206\u7C7B\uFF0C\u4E14\u8FD9\u6B21\u70B9\u51FB\u7684\u4E5F\u6CA1\u6709\u5B50\u5B50\u5206\u7C7B\uFF0C\u5E76\u4E14\u6CA1\u6709\u70B9\u51FB\u4E0A\u4E00\u6B21\u6CA1\u6709subSubCategories\u7684item \u5173\u95ED\u4E0A\u4E00\u6B21\u7684\u9879\n return { ...item, open: false }\n }\n return item\n })\n )\n\n // \u66F4\u65B0\u4E0A\u4E00\u6B21\u70B9\u51FB\u7684\u72B6\u6001\n lastClickRef.current = { index, hasSubSubCategories }\n },\n [activeSubSubcategoryIndex]\n )\n\n const handleSubSubcategoryOpen = (index: number, subSubindex: number) => {\n setExpandedSubcategory(prev =>\n prev.map(item => (item.index === index ? { ...item, open: true } : { ...item, open: false }))\n )\n setActiveSubSubcategoryIndex(subSubindex)\n }\n\n return (\n <Container childClassName=\"lg-desktop:gap-12 flex bg-white gap-8\">\n <div\n className=\"lg-desktop:basis-[356px] flex basis-[284px] flex-col gap-4 py-4\"\n style={{\n userSelect: 'none',\n }}\n ref={sidebarDropdownRef}\n >\n <div\n className=\"desktop:h-[416px] flex flex-col overflow-y-auto\"\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n >\n {sidebarCategoriesMetadata?.subcategories?.map((subItem: any, index: number) => {\n const hasSubSubCategory =\n Array.isArray(subItem?.subSubCategories) && subItem?.subSubCategories?.length > 0\n const isExpanded = expandedSubcategory?.find(item => item.index === index)?.open\n return (\n <div key={`${subItem?.label || ''}subcategoryItem-${index}`}>\n <button\n className={cn(\n 'rounded-sidebar-shelf flex w-full cursor-pointer items-center justify-between border-0 bg-transparent text-left',\n {\n 'bg-[#F5F5F7]': !hasSubSubCategory && isExpanded,\n }\n )}\n onClick={() => {\n handleSubcategoryOpen(index, subItem)\n onSidebarNavClick?.(subItem, index)\n }}\n aria-expanded={hasSubSubCategory ? isExpanded : undefined}\n aria-haspopup={hasSubSubCategory ? 'true' : undefined}\n >\n <Text html={subItem.label} className=\"p-4 text-sm font-bold leading-[1.4]\" />\n {hasSubSubCategory && (\n <DownArrow\n aria-hidden=\"true\"\n className={cn('size-4', {\n ['rotate-180']: isExpanded,\n })}\n />\n )}\n </button>\n {isExpanded && (\n <div className=\"flex flex-col\" role=\"menu\">\n {subItem.subSubCategories?.map((subSubItem: any, subSubindex: number) => (\n <button\n onClick={() => {\n handleSubSubcategoryOpen(index, subSubindex)\n onSidebarNavClick?.(subSubItem, subSubindex)\n }}\n key={`subSubItem-${index}-${subSubindex}`}\n className={cn(\n 'rounded-sidebar-shelf w-full cursor-pointer border-0 bg-transparent px-6 py-4 text-left leading-none hover:bg-[#F5F5F7]',\n {\n 'bg-[#F5F5F7]': activeSubSubcategoryIndex === subSubindex,\n }\n )}\n role=\"menuitem\"\n aria-label={subSubItem.label}\n >\n <Text html={subSubItem.label} className=\"text-sm font-bold leading-[1.4] text-[#4A4C56]\" />\n </button>\n ))}\n </div>\n )}\n </div>\n )\n })}\n </div>\n {sidebarCategoriesMetadata && (\n <div className=\"flex\">\n <div className=\"flex flex-col gap-4\">\n {sidebarCategoriesMetadata?.primary && (\n <Button\n as=\"a\"\n href={`${getLocalizedPath(sidebarCategoriesMetadata?.primary?.url, locale)}?ref=${sidebarCategoriesMetadata?.primary?.label}_shopall`}\n variant=\"primary\"\n size=\"lg\"\n className=\"lg-desktop:text-base text-sm\"\n >\n {sidebarCategoriesMetadata?.primary?.label}\n </Button>\n )}\n {sidebarCategoriesMetadata?.secondary && (\n <Button\n as=\"a\"\n href={sidebarCategoriesMetadata?.secondary?.url}\n variant=\"link\"\n size=\"lg\"\n iconClassName=\"size-4\"\n className=\"lg-desktop:text-base justify-start !p-0 text-sm\"\n >\n {sidebarCategoriesMetadata?.secondary?.label}\n </Button>\n )}\n </div>\n </div>\n )}\n </div>\n <div className=\"flex-1 py-4\">\n {Reflect.ownKeys(matchSeriesMetadata).length > 0 && (\n <div className=\"mb-4 flex items-center justify-between\">\n {(() => {\n const labelContent = (\n <>\n <Text\n html={matchSeriesMetadata?.label}\n className=\"lg-desktop:text-2xl text-xl font-bold leading-[1.4]\"\n />\n {matchSeriesMetadata?.primary && !matchSeriesMetadata?.primary?.hide && (\n <Text\n className=\"lg-desktop:text-base text-sm font-bold leading-[1.2]\"\n html={matchSeriesMetadata?.primary?.label}\n />\n )}\n </>\n )\n\n return matchSeriesMetadata?.primary?.url ? (\n <Button\n as=\"a\"\n href={`${getLocalizedPath(matchSeriesMetadata?.primary?.url, locale)}?ref=${matchSeriesMetadata?.label}_viewmore`}\n variant=\"link\"\n size=\"lg\"\n iconClassName=\"size-4\"\n className=\"flex items-center justify-start gap-2 !p-0 no-underline\"\n >\n {labelContent}\n </Button>\n ) : (\n <div className=\"flex items-center gap-2\">{labelContent}</div>\n )\n })()}\n {sidebarCategoriesMetadata?.guide?.label && (\n <Link\n href={getLocalizedPath(sidebarCategoriesMetadata?.guide?.url, locale)}\n className=\"lg-desktop:text-base text-sm leading-[1.2] text-[#6D6D6F]\"\n >\n {sidebarCategoriesMetadata?.guide?.label}\n </Link>\n )}\n </div>\n )}\n <div\n className=\"flex h-[426px] flex-col gap-4 overflow-y-auto\"\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n >\n {matchSeriesMetadata?.series?.map((seriesItem: any, seriesIndex: number) => (\n <div key={`seriesItem-${seriesItem?.label || ''}-${seriesIndex}`}>\n {seriesItem.label && (\n <Text\n html={seriesItem.label}\n as=\"p\"\n className=\"mb-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n )}\n <div className=\"grid grid-cols-3 gap-4\">\n {!!matchSeriesMetadata?.banner && (\n <Link\n asChild={!matchSeriesMetadata?.banner?.href}\n href={getLocalizedPath(matchSeriesMetadata?.banner?.href, locale)}\n >\n <div className=\"relative [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500\">\n <Picture\n source={matchSeriesMetadata?.banner?.imageUrl}\n className=\"laptop:h-[120px] h-[114px]\"\n imgClassName=\"object-cover h-full\"\n />\n <div className=\"absolute inset-x-0 bottom-0 p-4\">\n <Heading\n size={2}\n html={matchSeriesMetadata?.banner?.title || 'Buy in Guide'}\n className={cn('font-bold text-white', {\n 'text-black': matchSeriesMetadata?.banner?.theme === 'dark',\n })}\n />\n <Text\n html={matchSeriesMetadata?.banner?.desc || '20.000mAh'}\n className={cn('text-sm font-bold text-white', {\n 'text-black': matchSeriesMetadata?.banner?.theme === 'dark',\n })}\n />\n </div>\n </div>\n </Link>\n )}\n {seriesItem.products?.map((product: any, index: number) => (\n <SeriesProductItem\n seriesLabel={matchSeriesMetadata?.label}\n key={`seriesProductItem-${seriesItem?.label || ''}-${seriesIndex}-${index}`}\n product={product}\n isCollection={matchSeriesMetadata?.isCollection}\n />\n ))}\n </div>\n </div>\n ))}\n </div>\n </div>\n </Container>\n )\n }\n)\n\nSidebarDropdown.displayName = 'SidebarDropdown'\n\n/**\n * \u7CFB\u5217\u4EA7\u54C1\u9879\u7EC4\u4EF6\n */\nexport const SeriesProductItem = ({\n product,\n isCollection,\n position,\n seriesLabel,\n}: {\n product: any\n isCollection?: boolean\n position?: number\n seriesLabel?: string\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const { buildProps, onSeriesProductClick, componentOverrides } = useNavContext()\n const badgeVariant = componentOverrides?.badge?.variant\n let productData = isCollection\n ? product\n : buildProps?.products?.find((item: Product) => item.handle === product.handle)\n const variant =\n productData?.variants?.find((item: ProductVariant) => item.sku === product.sku) || productData?.variants?.[0]\n\n const listingLink = useMemo(() => {\n return `${getLocalizedPath(`/products/${productData?.handle}`, locale)}?variant=${atobID(variant?.id as string)}`\n }, [productData?.handle, variant?.id, locale])\n\n const tags = useMemo(() => {\n return productData?.tags\n ?.filter?.((item: any) => item?.startsWith?.('CLtag'))\n ?.map?.((item: any) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, 2)\n }, [productData?.tags])\n\n if (!variant?.availableForSale) return null\n\n return (\n <Link\n href={listingLink}\n onClick={e => {\n e.preventDefault()\n window.open(listingLink, '_self')\n onSeriesProductClick?.(productData, position || 0, seriesLabel)\n }}\n className=\"no-underline hover:text-current\"\n >\n <div className=\"rounded-sidebar-shelf flex shrink-0 items-center gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110 [&_img]:hover:duration-500\">\n <div className=\"shrink-0\">\n <img\n src={`${variant?.image?.url || product?.images?.[0]?.url}&width=200`}\n loading=\"lazy\"\n alt={productData?.title || product?.name}\n width={90}\n height={90}\n className=\"size-[96px] object-contain\"\n />\n </div>\n <div className=\"relative\">\n <div className=\"flex gap-1\">\n {Array.isArray(tags) &&\n tags?.map((tag: string, index: number) => (\n <Badge size=\"sm\" key={index} variant={badgeVariant} className=\"mb-1 whitespace-nowrap\">\n {tag}\n </Badge>\n ))}\n </div>\n <Text\n className=\"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]\"\n html={product?.custom_name || variant?.metafields?.infos?.page_short_title || productData?.title}\n />\n {product?.desc && (\n <Text\n as=\"p\"\n html={product?.desc}\n className=\"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n )}\n </div>\n </div>\n </Link>\n )\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,uBAAAE,EAAA,oBAAAC,IAAA,eAAAC,EAAAJ,GA4JkB,IAAAK,EAAA,6BA5JlBC,EAAyE,oBACzEC,EAAuE,qCACvEC,EAA6C,kCAC7CC,EAA0B,4BAC1BC,EAA8B,4BAE9BC,EAA+B,oCAMxB,MAAMR,EAAkB,EAAAS,QAAM,KACnC,CAAC,CAAE,0BAAAC,EAA2B,eAAAC,CAAe,IAA+D,CAC1G,KAAM,CAAE,WAAAC,EAAY,kBAAAC,CAAkB,KAAI,iBAAc,EAClD,CAAE,OAAAC,EAAS,IAAK,KAAI,kBAAe,EACnC,CAACC,EAAqBC,CAAsB,KAAI,YAA6C,CAAC,CAAC,EAC/F,CAACC,EAA2BC,CAA4B,KA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8C,KAAO,WAAQ,IACZH,GAAa,MAChB,SAAUjC,GAAcA,GAAM,aAAa,OAAO,CAAC,GACnD,MAAOA,GAAcA,GAAM,UAAU,SAAU,EAAE,CAAC,GAClD,QAAQ,EAAG,CAAC,EACf,CAACiC,GAAa,IAAI,CAAC,EAEtB,OAAKC,GAAS,oBAGZ,OAAC,QACC,KAAMC,EACN,QAASE,GAAK,CACZA,EAAE,eAAe,EACjB,OAAO,KAAKF,EAAa,OAAO,EAChCL,IAAuBG,EAAaL,GAAY,EAAGC,CAAW,CAChE,EACA,UAAU,kCAEV,oBAAC,OAAI,UAAU,mIACb,oBAAC,OAAI,UAAU,WACb,mBAAC,OACC,IAAK,GAAGK,GAAS,OAAO,KAAOR,GAAS,SAAS,CAAC,GAAG,GAAG,aACxD,QAAQ,OACR,IAAKO,GAAa,OAASP,GAAS,KACpC,MAAO,GACP,OAAQ,GACR,UAAU,6BACZ,EACF,KACA,QAAC,OAAI,UAAU,WACb,oBAAC,OAAI,UAAU,aACZ,eAAM,QAAQU,CAAI,GACjBA,GAAM,IAAI,CAACE,EAAalC,OACtB,OAAC,SAAM,KAAK,KAAiB,QAAS4B,EAAc,UAAU,yBAC3D,SAAAM,GADmBlC,CAEtB,CACD,EACL,KACA,OAAC,QACC,UAAU,iGACV,KAAMsB,GAAS,aAAeQ,GAAS,YAAY,OAAO,kBAAoBD,GAAa,MAC7F,EACCP,GAAS,SACR,OAAC,QACC,GAAG,IACH,KAAMA,GAAS,KACf,UAAU,sFACZ,GAEJ,GACF,EACF,EA7CqC,IA+CzC",
6
+ "names": ["SidebarDropdown_exports", "__export", "SeriesProductItem", "SidebarDropdown", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_utils", "import_icons", "import_NavProvider", "import_AiuiProvider", "React", "sidebarCategoriesMetadata", "seriesMetadata", "buildProps", "onSidebarNavClick", "locale", "expandedSubcategory", "setExpandedSubcategory", "activeSubSubcategoryIndex", "setActiveSubSubcategoryIndex", "sidebarDropdownRef", "lastClickRef", "initExpandedSubcategory", "subcategories", "withSubSubCategoriesIndex", "item", "withoutSubSubCategoriesIndex", "expandedStates", "_", "index", "matchSeriesMetadata", "subCategory", "currentSeriesMetadata", "category", "activeSubSubcategory", "currentActiveSeriesMetadata", "handleSubcategoryOpen", "subcategoryItem", "hasSubSubCategories", "lastClick", "prev", "i", "handleSubSubcategoryOpen", "subSubindex", "subItem", "hasSubSubCategory", "isExpanded", "subSubItem", "labelContent", "seriesItem", "seriesIndex", "product", "isCollection", "position", "seriesLabel", "onSeriesProductClick", "componentOverrides", "badgeVariant", "productData", "variant", "listingLink", "tags", "e", "tag"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var L=(t,e)=>{for(var r in e)a(t,r,{get:e[r],enumerable:!0})},R=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of w(e))!D.call(t,s)&&s!==r&&a(t,s,{get:()=>e[s],enumerable:!(i=v(e,s))||i.enumerable});return t};var b=t=>R(a({},"__esModule",{value:!0}),t);var E={};L(E,{SupportsDropdown:()=>y});module.exports=b(E);var l=require("react/jsx-runtime"),o=require("react"),u=require("../../components/index.js"),p=require("es-toolkit"),g=require("../AiuiProvider/index.js"),m=require("../../helpers/utils.js");const y=({supportsMetadata:t,currentNavItemRef:e})=>{const{locale:r="us"}=(0,g.useAiuiContext)(),i=(0,o.useRef)(null),[s,c]=(0,o.useState)(null),[f,h]=(0,o.useState)(0);(0,o.useEffect)(()=>{if(i?.current){const n=i?.current?.getBoundingClientRect();h(n.height)}},[i]);const d=(0,p.debounce)(()=>{if(e){const n=e.getBoundingClientRect();c(n)}},500);return(0,o.useEffect)(()=>(d(),window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}),[d]),(0,o.useEffect)(()=>{if(e){const n=e.getBoundingClientRect();c(n)}},[e]),(0,l.jsx)("div",{className:"absolute top-0 h-full overflow-hidden bg-white transition-all duration-500",style:{right:`calc(100% - ${s?.right}px)`,height:f},children:(0,l.jsx)("div",{ref:i,className:"p-4",children:t?.map(n=>(0,l.jsx)("div",{className:"py-2",children:(0,l.jsx)(u.Link,{href:(0,m.getLocalizedPath)(n.url,r),className:"text-sm font-bold leading-[1.4] no-underline",children:n.label})},n.id))})})};
1
+ "use strict";var a=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var b=Object.prototype.hasOwnProperty;var D=(t,e)=>{for(var r in e)a(t,r,{get:e[r],enumerable:!0})},L=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of w(e))!b.call(t,s)&&s!==r&&a(t,s,{get:()=>e[s],enumerable:!(i=v(e,s))||i.enumerable});return t};var R=t=>L(a({},"__esModule",{value:!0}),t);var E={};D(E,{SupportsDropdown:()=>y});module.exports=R(E);var l=require("react/jsx-runtime"),n=require("react"),u=require("../../components/index.js"),p=require("es-toolkit"),g=require("../AiuiProvider/index.js"),m=require("../../helpers/utils.js");const y=({supportsMetadata:t,currentNavItemRef:e})=>{const{locale:r="us"}=(0,g.useAiuiContext)(),i=(0,n.useRef)(null),[s,c]=(0,n.useState)(null),[f,h]=(0,n.useState)(0);(0,n.useEffect)(()=>{if(i?.current){const o=i?.current?.getBoundingClientRect();h(o.height)}},[i]);const d=(0,p.debounce)(()=>{if(e){const o=e.getBoundingClientRect();c(o)}},500);return(0,n.useEffect)(()=>(d(),window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}),[d]),(0,n.useEffect)(()=>{if(e){const o=e.getBoundingClientRect();c(o)}},[e]),(0,l.jsx)("div",{className:"rounded-b-box absolute top-0 h-full overflow-hidden bg-white transition-all duration-500",style:{right:`calc(100% - ${s?.right}px)`,height:f},children:(0,l.jsx)("div",{ref:i,className:"p-4",children:t?.map(o=>(0,l.jsx)("div",{className:"py-2",children:(0,l.jsx)(u.Link,{href:(0,m.getLocalizedPath)(o.url,r),className:"text-sm font-bold leading-[1.4] no-underline",children:o.label})},o.id))})})};
2
2
  //# sourceMappingURL=SupportsDropdown.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/HeaderNavigation/SupportsDropdown.tsx"],
4
- "sourcesContent": ["import React, { useEffect, useRef, useState } from 'react'\nimport { Link } from '../../components/index.js'\nimport { debounce } from 'es-toolkit'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { getLocalizedPath } from '../../helpers/utils.js'\n\n/**\n * supports\u4E0B\u62C9\n * @param categoriesItem \u5206\u7C7B\u9879\n * @param currentNavItemRef \u5F53\u524D\u5BFC\u822A\u9879\n */\nexport const SupportsDropdown = ({\n supportsMetadata,\n currentNavItemRef,\n}: {\n supportsMetadata: any\n currentNavItemRef: HTMLDivElement\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const supportsDropdownRef = useRef<HTMLDivElement>(null)\n const [navItemReact, setNavItemReact] = useState<DOMRect | null>(null)\n const [supportsDropdownHeight, setSupportsDropdownHeight] = useState(0)\n\n useEffect(() => {\n if (supportsDropdownRef?.current) {\n const rect = supportsDropdownRef?.current?.getBoundingClientRect()\n setSupportsDropdownHeight(rect.height)\n }\n }, [supportsDropdownRef])\n\n const debouncedHandleResize = debounce(() => {\n if (currentNavItemRef) {\n const rect = currentNavItemRef.getBoundingClientRect()\n setNavItemReact(rect)\n }\n }, 500)\n\n useEffect(() => {\n debouncedHandleResize()\n window.addEventListener('resize', debouncedHandleResize)\n return () => {\n window.removeEventListener('resize', debouncedHandleResize)\n }\n }, [debouncedHandleResize])\n\n useEffect(() => {\n if (currentNavItemRef) {\n const rect = currentNavItemRef.getBoundingClientRect()\n setNavItemReact(rect)\n }\n }, [currentNavItemRef])\n\n return (\n <div\n className=\"absolute top-0 h-full overflow-hidden bg-white transition-all duration-500\"\n style={{ right: `calc(100% - ${navItemReact?.right}px)`, height: supportsDropdownHeight }}\n >\n <div ref={supportsDropdownRef} className=\"p-4\">\n {supportsMetadata?.map((supportItem: any) => (\n <div key={supportItem.id} className=\"py-2\">\n <Link\n href={getLocalizedPath(supportItem.url, locale)}\n className=\"text-sm font-bold leading-[1.4] no-underline\"\n >\n {supportItem.label}\n </Link>\n </div>\n ))}\n </div>\n </div>\n )\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GA4DY,IAAAI,EAAA,6BA5DZC,EAAmD,iBACnDC,EAAqB,qCACrBC,EAAyB,sBACzBC,EAA+B,oCAC/BC,EAAiC,kCAO1B,MAAMP,EAAmB,CAAC,CAC/B,iBAAAQ,EACA,kBAAAC,CACF,IAGM,CACJ,KAAM,CAAE,OAAAC,EAAS,IAAK,KAAI,kBAAe,EACnCC,KAAsB,UAAuB,IAAI,EACjD,CAACC,EAAcC,CAAe,KAAI,YAAyB,IAAI,EAC/D,CAACC,EAAwBC,CAAyB,KAAI,YAAS,CAAC,KAEtE,aAAU,IAAM,CACd,GAAIJ,GAAqB,QAAS,CAChC,MAAMK,EAAOL,GAAqB,SAAS,sBAAsB,EACjEI,EAA0BC,EAAK,MAAM,CACvC,CACF,EAAG,CAACL,CAAmB,CAAC,EAExB,MAAMM,KAAwB,YAAS,IAAM,CAC3C,GAAIR,EAAmB,CACrB,MAAMO,EAAOP,EAAkB,sBAAsB,EACrDI,EAAgBG,CAAI,CACtB,CACF,EAAG,GAAG,EAEN,sBAAU,KACRC,EAAsB,EACtB,OAAO,iBAAiB,SAAUA,CAAqB,EAChD,IAAM,CACX,OAAO,oBAAoB,SAAUA,CAAqB,CAC5D,GACC,CAACA,CAAqB,CAAC,KAE1B,aAAU,IAAM,CACd,GAAIR,EAAmB,CACrB,MAAMO,EAAOP,EAAkB,sBAAsB,EACrDI,EAAgBG,CAAI,CACtB,CACF,EAAG,CAACP,CAAiB,CAAC,KAGpB,OAAC,OACC,UAAU,6EACV,MAAO,CAAE,MAAO,eAAeG,GAAc,KAAK,MAAO,OAAQE,CAAuB,EAExF,mBAAC,OAAI,IAAKH,EAAqB,UAAU,MACtC,SAAAH,GAAkB,IAAKU,MACtB,OAAC,OAAyB,UAAU,OAClC,mBAAC,QACC,QAAM,oBAAiBA,EAAY,IAAKR,CAAM,EAC9C,UAAU,+CAET,SAAAQ,EAAY,MACf,GANQA,EAAY,EAOtB,CACD,EACH,EACF,CAEJ",
4
+ "sourcesContent": ["import React, { useEffect, useRef, useState } from 'react'\nimport { Link } from '../../components/index.js'\nimport { debounce } from 'es-toolkit'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { getLocalizedPath } from '../../helpers/utils.js'\n\n/**\n * supports\u4E0B\u62C9\n * @param categoriesItem \u5206\u7C7B\u9879\n * @param currentNavItemRef \u5F53\u524D\u5BFC\u822A\u9879\n */\nexport const SupportsDropdown = ({\n supportsMetadata,\n currentNavItemRef,\n}: {\n supportsMetadata: any\n currentNavItemRef: HTMLDivElement\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const supportsDropdownRef = useRef<HTMLDivElement>(null)\n const [navItemReact, setNavItemReact] = useState<DOMRect | null>(null)\n const [supportsDropdownHeight, setSupportsDropdownHeight] = useState(0)\n\n useEffect(() => {\n if (supportsDropdownRef?.current) {\n const rect = supportsDropdownRef?.current?.getBoundingClientRect()\n setSupportsDropdownHeight(rect.height)\n }\n }, [supportsDropdownRef])\n\n const debouncedHandleResize = debounce(() => {\n if (currentNavItemRef) {\n const rect = currentNavItemRef.getBoundingClientRect()\n setNavItemReact(rect)\n }\n }, 500)\n\n useEffect(() => {\n debouncedHandleResize()\n window.addEventListener('resize', debouncedHandleResize)\n return () => {\n window.removeEventListener('resize', debouncedHandleResize)\n }\n }, [debouncedHandleResize])\n\n useEffect(() => {\n if (currentNavItemRef) {\n const rect = currentNavItemRef.getBoundingClientRect()\n setNavItemReact(rect)\n }\n }, [currentNavItemRef])\n\n return (\n <div\n className=\"rounded-b-box absolute top-0 h-full overflow-hidden bg-white transition-all duration-500\"\n style={{ right: `calc(100% - ${navItemReact?.right}px)`, height: supportsDropdownHeight }}\n >\n <div ref={supportsDropdownRef} className=\"p-4\">\n {supportsMetadata?.map((supportItem: any) => (\n <div key={supportItem.id} className=\"py-2\">\n <Link\n href={getLocalizedPath(supportItem.url, locale)}\n className=\"text-sm font-bold leading-[1.4] no-underline\"\n >\n {supportItem.label}\n </Link>\n </div>\n ))}\n </div>\n </div>\n )\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,sBAAAE,IAAA,eAAAC,EAAAH,GA4DY,IAAAI,EAAA,6BA5DZC,EAAmD,iBACnDC,EAAqB,qCACrBC,EAAyB,sBACzBC,EAA+B,oCAC/BC,EAAiC,kCAO1B,MAAMP,EAAmB,CAAC,CAC/B,iBAAAQ,EACA,kBAAAC,CACF,IAGM,CACJ,KAAM,CAAE,OAAAC,EAAS,IAAK,KAAI,kBAAe,EACnCC,KAAsB,UAAuB,IAAI,EACjD,CAACC,EAAcC,CAAe,KAAI,YAAyB,IAAI,EAC/D,CAACC,EAAwBC,CAAyB,KAAI,YAAS,CAAC,KAEtE,aAAU,IAAM,CACd,GAAIJ,GAAqB,QAAS,CAChC,MAAMK,EAAOL,GAAqB,SAAS,sBAAsB,EACjEI,EAA0BC,EAAK,MAAM,CACvC,CACF,EAAG,CAACL,CAAmB,CAAC,EAExB,MAAMM,KAAwB,YAAS,IAAM,CAC3C,GAAIR,EAAmB,CACrB,MAAMO,EAAOP,EAAkB,sBAAsB,EACrDI,EAAgBG,CAAI,CACtB,CACF,EAAG,GAAG,EAEN,sBAAU,KACRC,EAAsB,EACtB,OAAO,iBAAiB,SAAUA,CAAqB,EAChD,IAAM,CACX,OAAO,oBAAoB,SAAUA,CAAqB,CAC5D,GACC,CAACA,CAAqB,CAAC,KAE1B,aAAU,IAAM,CACd,GAAIR,EAAmB,CACrB,MAAMO,EAAOP,EAAkB,sBAAsB,EACrDI,EAAgBG,CAAI,CACtB,CACF,EAAG,CAACP,CAAiB,CAAC,KAGpB,OAAC,OACC,UAAU,2FACV,MAAO,CAAE,MAAO,eAAeG,GAAc,KAAK,MAAO,OAAQE,CAAuB,EAExF,mBAAC,OAAI,IAAKH,EAAqB,UAAU,MACtC,SAAAH,GAAkB,IAAKU,MACtB,OAAC,OAAyB,UAAU,OAClC,mBAAC,QACC,QAAM,oBAAiBA,EAAY,IAAKR,CAAM,EAC9C,UAAU,+CAET,SAAAQ,EAAY,MACf,GANQA,EAAY,EAOtB,CACD,EACH,EACF,CAEJ",
6
6
  "names": ["SupportsDropdown_exports", "__export", "SupportsDropdown", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_es_toolkit", "import_AiuiProvider", "import_utils", "supportsMetadata", "currentNavItemRef", "locale", "supportsDropdownRef", "navItemReact", "setNavItemReact", "supportsDropdownHeight", "setSupportsDropdownHeight", "rect", "debouncedHandleResize", "supportItem"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var Me=Object.create;var Q=Object.defineProperty;var Se=Object.getOwnPropertyDescriptor;var Pe=Object.getOwnPropertyNames;var De=Object.getPrototypeOf,Ee=Object.prototype.hasOwnProperty;var Te=(o,r)=>{for(var i in r)Q(o,i,{get:r[i],enumerable:!0})},ie=(o,r,i,c)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of Pe(r))!Ee.call(o,u)&&u!==i&&Q(o,u,{get:()=>r[u],enumerable:!(c=Se(r,u))||c.enumerable});return o};var V=(o,r,i)=>(i=o!=null?Me(De(o)):{},ie(r||!o||!o.__esModule?Q(i,"default",{value:o,enumerable:!0}):i,o)),He=o=>ie(Q({},"__esModule",{value:!0}),o);var Ie={};Te(Ie,{default:()=>Re});module.exports=He(Ie);var e=require("react/jsx-runtime"),t=require("react"),l=require("../../components/index.js"),me=require("../../shared/Styles.js"),h=require("../../helpers/utils.js"),W=V(require("./NavProvider.js")),n=require("./types.js"),pe=V(require("jump.js")),X=require("@gsap/react"),Z=require("gsap"),w=require("./withCategory.js"),S=require("./icons/index.js"),fe=V(require("../NavigationSearch/index.js")),be=require("./ResourceSidebarDropdown.js"),ve=require("./MobileResourceSidebarMenu.js"),ge=require("./SidebarDropdown.js"),ee=require("./useScrollLock.js"),he=require("./MulticolDropdown.js"),ye=require("./SupportsDropdown.js"),Ne=require("./MobileSidebarMenu.js"),ke=require("./MobileSupportMenu.js"),xe=require("./MobileMulticolMenu.js"),te=require("./MobileMenuComponents.js"),ae=require("../AiuiProvider/index.js"),Ce=V(require("../../shared/throttle.js"));const le=(0,t.forwardRef)((o,r)=>{const{data:{header:i}={},buildProps:c,event:u,profile:P,theme:s="light",isTop:m=!1,searchResult:k,onSearch:v,isSearching:g,keywords:O,onPrimaryNavClick:x,onSeriesProductClick:y,onSidebarNavClick:D,onMobileMenuToggle:F,headerId:H,cartCount:B,menuData:R,render:j,...U}=o,[I,A]=(0,t.useState)(!1),[f,L]=(0,t.useState)(!1),[G,T]=(0,t.useState)(!1),[$,C]=(0,t.useState)(!1),K=(0,t.useRef)(null),M=(0,t.useRef)(null),Y=()=>{const b=document?.querySelector("body")?.offsetWidth||0;C(b<=1440)};(0,t.useEffect)(()=>(Y(),window.addEventListener("resize",Y),()=>{window.removeEventListener("resize",Y)}),[]),(0,t.useImperativeHandle)(r,()=>M.current),(0,t.useEffect)(()=>{M.current&&m&&(0,pe.default)(M.current,{duration:0,offset:M.current?.getBoundingClientRect()?.bottom||0})},[m]),(0,t.useEffect)(()=>{if(m){L(!1),T(!1);return}let b=0,_=0,a=0;const d=()=>document?.documentElement?.scrollTop||document?.body?.scrollTop||0,p=d();b=p,L(p>300),T(p>30);const N=(0,Ce.default)(()=>{const z=d(),E=z-b;T(z>30),E>0?(_=0,a+=E,a>=300&&z>300&&L(!0)):E<0&&(a=0,_+=Math.abs(E),_>=300&&(L(!1),_=0)),b=z},100);return window.addEventListener("scroll",N,{passive:!0}),()=>window.removeEventListener("scroll",N)},[m]),(0,t.useEffect)(()=>{u&&(u.search=()=>A(!0))},[u]),(0,X.useGSAP)(()=>{K?.current&&I&&Z.gsap.fromTo(K.current,{height:0},{height:"auto",duration:.3})},[I]),(0,ee.useScrollLock)(I);const oe=(0,t.useMemo)(()=>i?.bar?.actions?.find(b=>b?.blockType===n.HeaderNavigationActionBlockType.Search)?.searchBar?.[0]||{},[i]),J=j?.mobileHeaderNavigation;return(0,e.jsx)(W.default,{buildProps:c,profile:P,isMobile:$,event:u,payloadData:i,onSidebarNavClick:D,onSeriesProductClick:y,cartCount:B,children:(0,e.jsx)("header",{...U,id:H||"header","data-ui-component-id":"HeaderNavigation",className:m?"relative z-[100] bg-white":(0,h.cn)("sticky top-0 z-[100] transition-transform duration-500 ease-in-out",{"translate-y-[-100%]":f}),ref:M,children:(0,e.jsxs)("div",{className:(0,h.cn)("hover:bg-white hover:text-black",s==="light"?"text-black":"text-white",{"!bg-white transition-all duration-500 ease-in-out":!m&&G},{"hover:!text-black":s==="dark","!text-black":!m&&G}),onClick:()=>!m&&T(!0),children:[(0,e.jsx)(se,{data:i,className:"desktop:block hidden !bg-white",theme:s,onNavItemClick:()=>!m&&T(!0),onPrimaryNavClick:x}),J?(0,e.jsx)(J,{className:"desktop:hidden block !bg-white",menuData:R,data:i,onPrimaryNavClick:x}):(0,e.jsx)(ce,{menuData:R,data:i,className:"desktop:hidden block !bg-white",onPrimaryNavClick:x,onMobileMenuToggle:F}),I&&(0,e.jsxs)("div",{className:"absolute left-0 top-0 z-[60] flex w-full flex-col bg-black/70",style:{height:`calc(100dvh - ${M?.current?.getBoundingClientRect()?.top}px)`},role:"dialog","aria-modal":"true","aria-label":"Search",children:[(0,e.jsx)("div",{ref:K,className:(0,h.cn)("overflow-y-auto",{}),children:(0,e.jsx)(fe.default,{data:oe,keywords:O,isSearching:g,searchResult:k,onSearch:b=>{v?.(b)},onClose:()=>{v?.(),A(!1)}})}),(0,e.jsx)("div",{className:"flex-1 bg-transparent",onClick:()=>A(!1),role:"button",tabIndex:0,"aria-label":"Close search",onKeyDown:b=>{(b.key==="Enter"||b.key===" "||b.key==="Escape")&&(b.preventDefault(),A(!1))}})]})]})})})}),se=(0,t.forwardRef)((o,r)=>{const{data:i,onNavItemClick:c,className:u,theme:P,onPrimaryNavClick:s}=o,{event:m,profile:k}=(0,W.useNavContext)(),[v,g]=(0,t.useState)(!1),{locale:O="us"}=(0,ae.useAiuiContext)(),x=(0,t.useMemo)(()=>(0,w.WithGroupCategory)(i?.categories?.filter(a=>a?.pcShow)),[i]),[y,D]=(0,t.useState)(null),[F,H]=(0,t.useState)([]),B=(0,t.useRef)(null),[R,j]=(0,t.useState)(!1),U=(0,t.useRef)(null),I=(0,t.useRef)(null),A=(0,t.useRef)(x.map(a=>Array(a?.length||0).fill(null)));(0,t.useEffect)(()=>{x?.length&&H(x?.map((a,d)=>a?.map((p,N)=>({groupIndex:d,index:N,open:!1}))))},[x]);const f=(0,t.useMemo)(()=>{let a=null;for(const d of F){for(const p of d)if(p.open){a=p;break}if(a)break}return a},[F]);(0,ee.useScrollLock)(!!f?.open||R);const L=(a,d,p)=>{j(!1);const N=x[d][p];if(N?.components?.[0]?.blockType===n.HeaderNavigationBlockType.Links)N?.components?.[0]?.url&&window.open(N?.components?.[0]?.url,N?.components?.[0]?.target??"_blank");else{const z=x?.flat()||[],E=z?.findIndex(ne=>ne?.id===x[d][p]?.id);a.stopPropagation(),c?.(),s?.(z[E],E),D(N),H(ne=>ne.map(we=>we.map(q=>q.groupIndex===d&&q.index===p?{...q,open:!q.open}:{...q,open:!1})))}},G=(a,d,p)=>{a.key==="Enter"||a.key===" "?(a.preventDefault(),L(a,d,p)):a.key==="Escape"&&f?.groupIndex===d&&f?.index===p&&(a.preventDefault(),T())},T=()=>{H(a=>a.map(d=>d.map(p=>({...p,open:!1}))))},$=(0,t.useMemo)(()=>{if(y)return y?.components?.[0]?.blockType},[y]),C=(0,w.WithSidebar)(ge.SidebarDropdown,y),K=(0,w.WithResource)(be.ResourceSidebarDropdown,y),M=(0,w.WithMulticol)(he.MulticolDropdown,y),Y=(0,w.WithSupports)(ye.SupportsDropdown,{categoriesItem:y,currentNavItemRef:A.current?.[f?.groupIndex||0]?.[f?.index||0]}),oe=(0,t.useMemo)(()=>{switch($){case n.HeaderNavigationBlockType.Sidebar:return(0,e.jsx)(C,{});case n.HeaderNavigationBlockType.Resource:return(0,e.jsx)(K,{});case n.HeaderNavigationBlockType.Supports:return(0,e.jsx)(Y,{});case n.HeaderNavigationBlockType.Multicol:return(0,e.jsx)(M,{});default:return null}},[$,y]),J=(0,t.useMemo)(()=>i?.bar?.actions?.filter(a=>a?.pcShow),[i]),b=(0,t.useMemo)(()=>J?.find(a=>a?.blockType===n.HeaderNavigationActionBlockType.Profile),[J]),_=(0,t.useCallback)(()=>{j(a=>!a)},[]);return(0,t.useEffect)(()=>{if(B?.current){const a=B.current;return a.addEventListener("click",_),()=>{a.removeEventListener("click",_)}}},[_]),(0,X.useGSAP)(()=>{f?.open&&Z.gsap.fromTo(I?.current,{height:0},{height:"auto"})},[f?.open]),(0,e.jsxs)(l.Container,{className:(0,h.cn)("relative h-[96px]",u),children:[(0,e.jsxs)("div",{ref:U,onClick:T,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)(ue,{}),(0,e.jsx)(re,{ref:B,actions:J,activeStatus:R})]}),(0,e.jsx)("nav",{className:"flex justify-between",role:"navigation","aria-label":"Primary navigation",children:x?.map((a,d)=>(0,e.jsx)("div",{className:"flex gap-3",children:a?.map((p,N)=>{const z=f?.groupIndex===d&&f?.index===N;return(0,e.jsx)("div",{ref:E=>{A.current[d][N]=E},className:"group",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:E=>L(E,d,N),onKeyDown:E=>G(E,d,N),"aria-expanded":z,"aria-haspopup":"true","aria-label":p.text,children:[(0,e.jsx)(l.Text,{html:p.text,className:"text-sm font-bold leading-[1.4]"}),(0,e.jsx)(S.DownArrow,{className:(0,h.cn)("size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100",{"rotate-180":f?.groupIndex===d&&f?.index===N,"opacity-100":v&&f?.groupIndex===d&&f?.index===N,invisible:!p?.components?.length||p?.components?.[0]?.blockType===n.HeaderNavigationBlockType.Links})})]}),(0,e.jsx)("div",{className:(0,h.cn)("absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500",{"w-[calc(100%-20px)]":z},P==="dark"?"bg-white":"bg-[#080A0F]"),"aria-hidden":"true"})]})},p.id)})},`groupCategory-${d}`))})]}),(0,e.jsxs)("div",{role:"menu","aria-hidden":!(f?.open&&y),className:(0,h.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:!(f?.open&&y)}),onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),style:{height:`calc(100dvh - ${U?.current?.getBoundingClientRect()?.bottom}px)`},children:[(0,e.jsx)("div",{ref:I,className:(0,h.cn)("relative z-50",{"overflow-hidden":$!==n.HeaderNavigationBlockType.Supports}),children:oe}),(0,e.jsx)("div",{className:"flex-1 bg-transparent",onClick:T,role:"button",tabIndex:0,"aria-label":"Close menu",onKeyDown:a=>{(a.key==="Enter"||a.key===" "||a.key==="Escape")&&(a.preventDefault(),T())}})]}),R&&(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:"rounded-box absolute w-[272px] overflow-hidden bg-white p-4",style:{right:`calc(100% - ${B?.current?.getBoundingClientRect()?.right}px)`,top:"-36px"},children:k?.email?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.Text,{html:k?.nick_name||b?.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:b?.profiles?.map(a=>(0,e.jsx)(te.MenuItem,{className:"py-2",label:a?.title,href:(0,h.getLocalizedPath)(a?.url,O)},a.id))})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(S.Polygon,{className:"absolute -top-2 right-[46px] z-30 text-white","aria-hidden":"true"}),(0,e.jsx)(l.Text,{html:b?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),(0,e.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:b?.benefits?.map(a=>(0,e.jsxs)("div",{className:"flex items-center gap-[6px]",children:[(0,e.jsx)(l.Picture,{source:a.benefitIcon?.url,className:"size-4",alt:a.benefit,width:16,height:16}),(0,e.jsx)(l.Text,{html:a.benefit,className:"text-sm font-bold leading-[1.4]"})]},a.id))}),(0,e.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[(0,e.jsx)(l.Button,{variant:"secondary",size:"lg",onClick:()=>m?.join?.(),children:(0,e.jsx)(l.Text,{html:b?.primaryButton||"Join Now",className:"font-bold"})}),(0,e.jsx)(l.Button,{variant:"primary",size:"lg",onClick:()=>m?.login?.(),children:(0,e.jsx)(l.Text,{html:b?.secondaryButton||"Log In",className:"font-bold"})})]})]})}),(0,e.jsx)("div",{className:"flex-1 bg-transparent",onClick:()=>j(!1),role:"button",tabIndex:0,"aria-label":"Close profile menu",onKeyDown:a=>{(a.key==="Enter"||a.key===" "||a.key==="Escape")&&(a.preventDefault(),j(!1))}})]})]})}),ce=(0,t.forwardRef)(({data:o,menuData:r,className:i,onPrimaryNavClick:c,onMobileMenuToggle:u},P)=>{const s=(0,t.useMemo)(()=>(0,w.WithGroupCategory)(o?.categories?.filter(C=>C?.mobileShow)),[o]),{currentMenu:m,setCurrentMenu:k,subSubCategory:v}=(0,W.useNavContext)(),[g,O]=(0,t.useState)(!1),[x,y]=(0,t.useState)(0),[D,F]=(0,t.useState)(null),H=(0,t.useRef)(null);(0,t.useEffect)(()=>{if(H?.current&&g){const C=H?.current?.getBoundingClientRect();y(window?.innerHeight-(C?.bottom||0))}u?.({open:g})},[g,u]),(0,X.useGSAP)(()=>{Z.gsap.fromTo(H.current,{height:0},{height:x,duration:.3})},[x]),(0,ee.useScrollLock)(g);const B=(0,t.useMemo)(()=>D?.components?.[0]?.blockType,[D]),R=(0,w.WithSupports)(ke.MobileSupportMenu,{categoriesItem:D}),j=(0,w.WithSidebar)(Ne.MobileSidebarMenu,D),U=(0,w.WithResource)(ve.MobileResourceSidebarMenu,D),I=(0,w.WithMulticol)(xe.MobileMulticolMenu,D),A=(0,t.useMemo)(()=>{switch(B){case n.HeaderNavigationBlockType.Sidebar:return(0,e.jsx)(j,{});case n.HeaderNavigationBlockType.Resource:return(0,e.jsx)(U,{});case n.HeaderNavigationBlockType.Supports:return(0,e.jsx)(R,{});case n.HeaderNavigationBlockType.Multicol:return(0,e.jsx)(I,{});default:return null}},[B,D,R]),f=(0,t.useCallback)(()=>{O(!1),y(0),k&&k(n.HeaderNavigationMenu.Primary)},[O,y,k]),L=(0,t.useMemo)(()=>o?.bar?.actions?.filter(C=>C?.mobileShow&&C?.blockType!==n.HeaderNavigationActionBlockType.Profile),[o]),G=(0,t.useMemo)(()=>o?.bar?.actions?.find(C=>C?.mobileShow&&C?.blockType===n.HeaderNavigationActionBlockType.Profile)||{},[o]),T=(0,t.useMemo)(()=>{switch(m){case n.HeaderNavigationMenu.Primary:return(0,e.jsx)(Be,{actions:L,menuOpen:g,onMenuOpenClose:()=>{O(!1),y(0)},onMenuOpenClick:()=>O(!0)});case n.HeaderNavigationMenu.Secondary:return(0,e.jsx)(de,{title:D?.text,onMenuOpenClose:f,onMenuBackClick:()=>k?.(n.HeaderNavigationMenu.Primary)});case n.HeaderNavigationMenu.Third:return(0,e.jsx)(de,{title:v?.label,onMenuOpenClose:f,onMenuBackClick:()=>k?.(n.HeaderNavigationMenu.Secondary)});default:return null}},[g,m,k,D,L,v,f]),$=(0,t.useCallback)((C,K)=>{const M=Array.isArray(s)?Array.isArray(s[C])?s[C][K]:{}:{};F(M),M?.components?.[0]?.blockType===n.HeaderNavigationBlockType.Links?M?.components?.[0]?.url&&window.open(M?.components?.[0]?.url,M?.components?.[0]?.target??"_blank"):k?.(n.HeaderNavigationMenu.Secondary)},[s,k]);return(0,e.jsxs)(l.Container,{className:(0,h.cn)("relative h-[52px]",i),children:[T,g&&(0,e.jsxs)("nav",{ref:H,className:"absolute left-0 top-full z-[999] w-full overflow-y-auto border-t border-[#E4E5E6] bg-white text-black",style:{height:x},role:"navigation","aria-label":"Mobile navigation menu",children:[m===n.HeaderNavigationMenu.Primary&&r?(0,e.jsx)("div",{className:"pt-4",children:(0,e.jsx)(l.BrandStrip,{data:r})}):null,m===n.HeaderNavigationMenu.Primary?(0,e.jsx)(Le,{categories:s,onPrimaryMenuClick:$,onPrimaryNavClick:c,profileAction:G}):A]})]})}),Le=({categories:o,onPrimaryMenuClick:r,profileAction:i,onPrimaryNavClick:c})=>(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:o?.map((u,P)=>(0,e.jsxs)("div",{className:"",children:[(0,e.jsx)("div",{className:(0,h.cn)("my-2 h-px w-full bg-[#E5E5E7]")}),u?.map((s,m)=>(0,e.jsx)(te.MenuItem,{label:s.text,onClick:()=>{const v=(o?.flat()||[])?.findIndex(g=>g?.id===o[P][m]?.id);r(P,m),c?.(s,v)},icon:s.components?.[0]?.icon},s.id))]},`groupCategory-${P}`))}),(0,e.jsx)(ze,{profileAction:i})]}),ze=({profileAction:o})=>{const[r,i]=(0,t.useState)(!1),{profile:c,event:u}=(0,W.useNavContext)(),{locale:P="us"}=(0,ae.useAiuiContext)();return(0,e.jsxs)("div",{className:(0,h.cn)("tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6",{"p-4":r}),children:[(0,e.jsxs)("button",{className:"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent",onClick:()=>i(!r),"aria-expanded":r,"aria-label":c?.nick_name||o?.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)(S.User,{"aria-hidden":"true"})}),(0,e.jsx)(l.Text,{html:c?.nick_name||o?.welcome,className:"text-base font-bold leading-[1.4]"})]}),!c?.email&&(0,e.jsx)(S.DownArrow,{"aria-hidden":"true",className:(0,h.cn)("laptop:size-4 size-5",{"rotate-180":r})})]}),c?.email&&(0,e.jsx)("nav",{className:"mt-4",role:"navigation","aria-label":"Profile menu",children:o?.profiles?.map(s=>(0,e.jsx)(te.MenuItem,{label:s?.title,href:(0,h.getLocalizedPath)(s?.url,P)},s.id))}),r&&!c?.email&&(0,e.jsxs)("div",{className:"mt-4",children:[(0,e.jsx)(l.Text,{html:o?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),(0,e.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:o?.benefits?.map(s=>(0,e.jsxs)("div",{className:"flex items-center gap-[6px]",children:[(0,e.jsx)(l.Picture,{source:s.benefitIcon?.url,className:"size-4",alt:s.benefit,width:16,height:16}),(0,e.jsx)(l.Text,{html:s.benefit,className:"text-sm font-bold leading-[1.4]"})]},s.id))})]}),!c?.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:()=>u?.join?.(),children:(0,e.jsx)(l.Text,{html:o?.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:()=>u?.login?.(),children:(0,e.jsx)(l.Text,{html:o?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]})},Be=({menuOpen:o,onMenuOpenClose:r,onMenuOpenClick:i,actions:c})=>(0,e.jsxs)("div",{className:"flex h-full items-center justify-between gap-4",children:[(0,e.jsx)(ue,{}),(0,e.jsxs)("div",{className:"desktop:gap-6 flex items-center gap-4",children:[(0,e.jsx)(re,{actions:c}),o?(0,e.jsx)("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>r(),"aria-label":"Close menu","aria-expanded":"true",children:(0,e.jsx)(S.Close,{className:"size-5","aria-hidden":"true"})}):(0,e.jsx)("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>i(),"aria-label":"Open menu","aria-expanded":"false","aria-haspopup":"true",children:(0,e.jsx)(S.Menu,{className:"size-5","aria-hidden":"true"})})]})]}),ue=()=>{const{payloadData:o,isMobile:r}=(0,W.useNavContext)(),{locale:i="us"}=(0,ae.useAiuiContext)();return(0,e.jsx)("a",{href:(0,h.getLocalizedPath)("/",i),className:"hover:text-brand-0 [&>svg]:w-full","aria-label":"Home",dangerouslySetInnerHTML:{__html:r?o?.bar?.mobileLogo:o?.bar?.desktopLogo}})},re=(0,t.forwardRef)(({actions:o,activeStatus:r=!1},i)=>{const{event:c,cartCount:u}=(0,W.useNavContext)(),[P,s]=(0,t.useState)(null),m=v=>{switch(v){case n.HeaderNavigationActionBlockType.Search:return"Search";case n.HeaderNavigationActionBlockType.Cart:return`Shopping cart${u>0?` (${u} items)`:""}`;case n.HeaderNavigationActionBlockType.Profile:return"User profile";case n.HeaderNavigationActionBlockType.Livestream:return"Livestream";default:return"Action"}},k=(0,t.useCallback)((v,g)=>{switch(s(g),v?.blockType){case n.HeaderNavigationActionBlockType.Search:c?.search?.();break;case n.HeaderNavigationActionBlockType.Cart:c?.cart?.();break;case n.HeaderNavigationActionBlockType.Profile:c?.profile?.();break;case n.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(o)&&o?.map((v,g)=>(0,e.jsxs)("button",{className:"relative cursor-pointer border-0 bg-transparent p-0",ref:v.blockType===n.HeaderNavigationActionBlockType.Profile?i:null,onClick:()=>k(v,g),"aria-label":m(v.blockType),"aria-pressed":r&&P===g,children:[(0,e.jsx)(l.Text,{html:v.icon,className:(0,h.cn)("size-5",{"text-brand-0":r&&P===g}),"aria-hidden":"true"}),v.blockType===n.HeaderNavigationActionBlockType.Cart&&u>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:u?.toString(),className:"text-sm font-bold leading-[1.2] text-white"})})]},v.id))})}),de=({title:o,onMenuOpenClose:r,onMenuBackClick:i})=>(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:()=>i(),"aria-label":"Back to previous menu",children:(0,e.jsx)(S.LeftArrow,{className:"size-5","aria-hidden":"true"})}),(0,e.jsx)(l.Text,{html:o,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:()=>r(),"aria-label":"Close menu",children:(0,e.jsx)(S.Close,{className:"size-5","aria-hidden":"true"})})]});ce.displayName="MobileNavigation",re.displayName="Actions",le.displayName="HeaderNavigation",se.displayName="DesktopNavigation";var Re=(0,me.withLayout)(le);
1
+ "use strict";"use client";var Me=Object.create;var Z=Object.defineProperty;var Se=Object.getOwnPropertyDescriptor;var Pe=Object.getOwnPropertyNames;var De=Object.getPrototypeOf,Ee=Object.prototype.hasOwnProperty;var Te=(n,r)=>{for(var i in r)Z(n,i,{get:r[i],enumerable:!0})},le=(n,r,i,c)=>{if(r&&typeof r=="object"||typeof r=="function")for(let u of Pe(r))!Ee.call(n,u)&&u!==i&&Z(n,u,{get:()=>r[u],enumerable:!(c=Se(r,u))||c.enumerable});return n};var ee=(n,r,i)=>(i=n!=null?Me(De(n)):{},le(r||!n||!n.__esModule?Z(i,"default",{value:n,enumerable:!0}):i,n)),He=n=>le(Z({},"__esModule",{value:!0}),n);var Ie={};Te(Ie,{default:()=>Be});module.exports=He(Ie);var e=require("react/jsx-runtime"),t=require("react"),l=require("../../components/index.js"),pe=require("../../shared/Styles.js"),k=require("../../helpers/utils.js"),F=ee(require("./NavProvider.js")),o=require("./types.js"),fe=ee(require("jump.js")),te=require("@gsap/react"),X=require("gsap"),C=require("./withCategory.js"),S=require("./icons/index.js"),be=ee(require("../NavigationSearch/index.js")),ve=require("./ResourceSidebarDropdown.js"),ge=require("./MobileResourceSidebarMenu.js"),he=require("./SidebarDropdown.js"),ae=require("./useScrollLock.js"),ye=require("./MulticolDropdown.js"),Ne=require("./SupportsDropdown.js"),ke=require("./MobileSidebarMenu.js"),we=require("./MobileSupportMenu.js"),xe=require("./MobileMulticolMenu.js"),ne=require("./MobileMenuComponents.js"),oe=require("../AiuiProvider/index.js"),ie=ee(require("../../shared/throttle.js"));const se=(0,t.forwardRef)((n,r)=>{const{data:{header:i}={},buildProps:c,event:u,profile:P,theme:s="light",isTop:m=!1,searchResult:x,onSearch:v,isSearching:p,keywords:_,onPrimaryNavClick:w,onSeriesProductClick:h,onSidebarNavClick:D,onMobileMenuToggle:U,headerId:E,cartCount:L,menuData:z,render:R,componentOverrides:G,...J}=n,[B,f]=(0,t.useState)(!1),[W,I]=(0,t.useState)(!1),[A,H]=(0,t.useState)(!1),[Y,g]=(0,t.useState)(!1),O=(0,t.useRef)(null),M=(0,t.useRef)(null),q=()=>{const y=document?.querySelector("body")?.offsetWidth||0;g(y<=1440)};(0,t.useEffect)(()=>(q(),window.addEventListener("resize",q),()=>{window.removeEventListener("resize",q)}),[]),(0,t.useImperativeHandle)(r,()=>M.current),(0,t.useEffect)(()=>{M.current&&m&&(0,fe.default)(M.current,{duration:0,offset:M.current?.getBoundingClientRect()?.bottom||0})},[m]),(0,t.useEffect)(()=>{if(m){I(!1),H(!1);return}let y=0,a=0,d=0;const b=()=>document?.documentElement?.scrollTop||document?.body?.scrollTop||0,N=b();y=N,I(N>300),H(N>30);const $=(0,ie.default)(()=>{const T=b(),K=T-y;H(T>30),K>0?(a=0,d+=K,d>=300&&T>300&&I(!0)):K<0&&(d=0,a+=Math.abs(K),a>=300&&(I(!1),a=0)),y=T},100);return window.addEventListener("scroll",$,{passive:!0}),()=>window.removeEventListener("scroll",$)},[m]),(0,t.useEffect)(()=>{u&&(u.search=()=>f(!0))},[u]),(0,te.useGSAP)(()=>{O?.current&&B&&X.gsap.fromTo(O.current,{height:0},{height:"auto",duration:.3})},[B]),(0,ae.useScrollLock)(B);const Q=(0,t.useMemo)(()=>i?.bar?.actions?.find(y=>y?.blockType===o.HeaderNavigationActionBlockType.Search)?.searchBar?.[0]||{},[i]),j=R?.mobileHeaderNavigation;return(0,e.jsx)(F.default,{buildProps:c,profile:P,isMobile:Y,event:u,payloadData:i,onSidebarNavClick:D,onSeriesProductClick:h,cartCount:L,componentOverrides:G,children:(0,e.jsx)("header",{...J,id:E||"header","data-ui-component-id":"HeaderNavigation",className:m?"relative z-[100] bg-white":(0,k.cn)("sticky top-0 z-[100] transition-transform duration-500 ease-in-out",{"translate-y-[-100%]":W}),ref:M,children:(0,e.jsxs)("div",{className:(0,k.cn)("hover:bg-white hover:text-black",s==="light"?"text-black":"text-white",{"!bg-white transition-all duration-500 ease-in-out":!m&&A},{"hover:!text-black":s==="dark","!text-black":!m&&A}),onClick:()=>!m&&H(!0),children:[(0,e.jsx)(ce,{data:i,className:"desktop:block hidden !bg-white",theme:s,onNavItemClick:()=>!m&&H(!0),onPrimaryNavClick:w}),j?(0,e.jsx)(j,{className:"desktop:hidden block !bg-white",menuData:z,data:i,onPrimaryNavClick:w}):(0,e.jsx)(ue,{menuData:z,data:i,className:"desktop:hidden block !bg-white",onPrimaryNavClick:w,onMobileMenuToggle:U}),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 - ${M?.current?.getBoundingClientRect()?.top}px)`},role:"dialog","aria-modal":"true","aria-label":"Search",children:[(0,e.jsx)("div",{ref:O,className:(0,k.cn)("overflow-y-auto",{}),children:(0,e.jsx)(be.default,{data:Q,keywords:_,isSearching:p,searchResult:x,onSearch:y=>{v?.(y)},onClose:()=>{v?.(),f(!1)}})}),(0,e.jsx)("div",{className:"flex-1 bg-transparent",onClick:()=>f(!1),role:"button",tabIndex:0,"aria-label":"Close search",onKeyDown:y=>{(y.key==="Enter"||y.key===" "||y.key==="Escape")&&(y.preventDefault(),f(!1))}})]})]})})})}),ce=(0,t.forwardRef)((n,r)=>{const{data:i,onNavItemClick:c,className:u,theme:P,onPrimaryNavClick:s}=n,{event:m,profile:x}=(0,F.useNavContext)(),[v,p]=(0,t.useState)(!1),{locale:_="us"}=(0,oe.useAiuiContext)(),w=(0,t.useMemo)(()=>(0,C.WithGroupCategory)(i?.categories?.filter(a=>a?.pcShow)),[i]),[h,D]=(0,t.useState)(null),[U,E]=(0,t.useState)([]),L=(0,t.useRef)(null),[z,R]=(0,t.useState)(!1),G=(0,t.useRef)(null),J=(0,t.useRef)(null),B=(0,t.useRef)(w.map(a=>Array(a?.length||0).fill(null)));(0,t.useEffect)(()=>{w?.length&&E(w?.map((a,d)=>a?.map((b,N)=>({groupIndex:d,index:N,open:!1}))))},[w]);const f=(0,t.useMemo)(()=>{let a=null;for(const d of U){for(const b of d)if(b.open){a=b;break}if(a)break}return a},[U]);(0,ae.useScrollLock)(!!f?.open||z);const W=(a,d,b)=>{R(!1);const N=w[d][b];if(N?.components?.[0]?.blockType===o.HeaderNavigationBlockType.Links)N?.components?.[0]?.url&&window.open(N?.components?.[0]?.url,N?.components?.[0]?.target??"_blank");else{const $=w?.flat()||[],T=$?.findIndex(K=>K?.id===w[d][b]?.id);a.stopPropagation(),c?.(),s?.($[T],T),D(N),E(K=>K.map(Ce=>Ce.map(V=>V.groupIndex===d&&V.index===b?{...V,open:!V.open}:{...V,open:!1})))}},I=(a,d,b)=>{a.key==="Enter"||a.key===" "?(a.preventDefault(),W(a,d,b)):a.key==="Escape"&&f?.groupIndex===d&&f?.index===b&&(a.preventDefault(),A())},A=()=>{E(a=>a.map(d=>d.map(b=>({...b,open:!1}))))},H=(0,t.useMemo)(()=>{if(h)return h?.components?.[0]?.blockType},[h]),Y=(0,C.WithSidebar)(he.SidebarDropdown,h),g=(0,C.WithResource)(ve.ResourceSidebarDropdown,h),O=(0,C.WithMulticol)(ye.MulticolDropdown,h),M=(0,C.WithSupports)(Ne.SupportsDropdown,{categoriesItem:h,currentNavItemRef:B.current?.[f?.groupIndex||0]?.[f?.index||0]}),q=(0,t.useMemo)(()=>{switch(H){case o.HeaderNavigationBlockType.Sidebar:return(0,e.jsx)(Y,{});case o.HeaderNavigationBlockType.Resource:return(0,e.jsx)(g,{});case o.HeaderNavigationBlockType.Supports:return(0,e.jsx)(M,{});case o.HeaderNavigationBlockType.Multicol:return(0,e.jsx)(O,{});default:return null}},[H,h]),Q=(0,t.useMemo)(()=>i?.bar?.actions?.filter(a=>a?.pcShow),[i]),j=(0,t.useMemo)(()=>Q?.find(a=>a?.blockType===o.HeaderNavigationActionBlockType.Profile),[Q]),y=(0,t.useCallback)(()=>{R(a=>!a)},[]);return(0,t.useEffect)(()=>{if(L?.current){const a=L.current;return a.addEventListener("click",y),()=>{a.removeEventListener("click",y)}}},[y]),(0,te.useGSAP)(()=>{f?.open&&X.gsap.fromTo(J?.current,{height:0},{height:"auto"})},[f?.open]),(0,e.jsxs)(l.Container,{className:(0,k.cn)("relative h-[96px]",u),children:[(0,e.jsxs)("div",{ref:G,onClick:A,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)(de,{}),(0,e.jsx)(re,{ref:L,actions:Q,activeStatus:z})]}),(0,e.jsx)("nav",{className:"flex justify-between",role:"navigation","aria-label":"Primary navigation",children:w?.map((a,d)=>(0,e.jsx)("div",{className:"flex gap-3",children:a?.map((b,N)=>{const $=f?.groupIndex===d&&f?.index===N;return(0,e.jsx)("div",{ref:T=>{B.current[d][N]=T},className:"group",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:T=>W(T,d,N),onKeyDown:T=>I(T,d,N),"aria-expanded":$,"aria-haspopup":"true","aria-label":b.text,children:[(0,e.jsx)(l.Text,{html:b.text,className:"text-sm font-bold leading-[1.4]"}),(0,e.jsx)(S.DownArrow,{className:(0,k.cn)("size-4 opacity-0 transition-opacity duration-500 group-hover:opacity-100",{"rotate-180":f?.groupIndex===d&&f?.index===N,"opacity-100":v&&f?.groupIndex===d&&f?.index===N,invisible:!b?.components?.length||b?.components?.[0]?.blockType===o.HeaderNavigationBlockType.Links})})]}),(0,e.jsx)("div",{className:(0,k.cn)("absolute bottom-0 left-0 h-[2px] w-0 transition-all duration-500",{"w-[calc(100%-20px)]":$},P==="dark"?"bg-white":"bg-[#080A0F]"),"aria-hidden":"true"})]})},b.id)})},`groupCategory-${d}`))})]}),(0,e.jsxs)("div",{role:"menu","aria-hidden":!(f?.open&&h),className:(0,k.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:!(f?.open&&h)}),onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),style:{height:`calc(100dvh - ${G?.current?.getBoundingClientRect()?.bottom}px)`},children:[(0,e.jsx)("div",{ref:J,className:(0,k.cn)("relative z-50",{"overflow-hidden":H!==o.HeaderNavigationBlockType.Supports}),children:q}),(0,e.jsx)("div",{className:"flex-1 bg-transparent",onClick:A,role:"button",tabIndex:0,"aria-label":"Close menu",onKeyDown:a=>{(a.key==="Enter"||a.key===" "||a.key==="Escape")&&(a.preventDefault(),A())}})]}),z&&(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:"rounded-box absolute w-[272px] overflow-hidden bg-white p-4",style:{right:`calc(100% - ${L?.current?.getBoundingClientRect()?.right}px)`,top:"-36px"},children:x?.email?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(l.Text,{html:x?.nick_name||j?.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:j?.profiles?.map(a=>(0,e.jsx)(ne.MenuItem,{className:"py-2",label:a?.title,href:(0,k.getLocalizedPath)(a?.url,_)},a.id))})]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(S.Polygon,{className:"absolute -top-2 right-[46px] z-30 text-white","aria-hidden":"true"}),(0,e.jsx)(l.Text,{html:j?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),(0,e.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:j?.benefits?.map(a=>(0,e.jsxs)("div",{className:"flex items-center gap-[6px]",children:[(0,e.jsx)(l.Picture,{source:a.benefitIcon?.url,className:"size-4",alt:a.benefit,width:16,height:16}),(0,e.jsx)(l.Text,{html:a.benefit,className:"text-sm font-bold leading-[1.4]"})]},a.id))}),(0,e.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[(0,e.jsx)(l.Button,{variant:"secondary",size:"lg",onClick:()=>m?.join?.(),children:(0,e.jsx)(l.Text,{html:j?.primaryButton||"Join Now",className:"font-bold"})}),(0,e.jsx)(l.Button,{variant:"primary",size:"lg",onClick:()=>m?.login?.(),children:(0,e.jsx)(l.Text,{html:j?.secondaryButton||"Log In",className:"font-bold"})})]})]})}),(0,e.jsx)("div",{className:"flex-1 bg-transparent",onClick:()=>R(!1),role:"button",tabIndex:0,"aria-label":"Close profile menu",onKeyDown:a=>{(a.key==="Enter"||a.key===" "||a.key==="Escape")&&(a.preventDefault(),R(!1))}})]})]})}),ue=(0,t.forwardRef)(({data:n,menuData:r,className:i,onPrimaryNavClick:c,onMobileMenuToggle:u},P)=>{const s=(0,t.useMemo)(()=>(0,C.WithGroupCategory)(n?.categories?.filter(g=>g?.mobileShow)),[n]),{currentMenu:m,setCurrentMenu:x,subSubCategory:v}=(0,F.useNavContext)(),[p,_]=(0,t.useState)(!1),[w,h]=(0,t.useState)(0),[D,U]=(0,t.useState)(null),E=(0,t.useRef)(null),L=(0,t.useRef)(!1);(0,t.useEffect)(()=>{if(E?.current&&p){const g=E?.current?.getBoundingClientRect();h(window?.innerHeight-(g?.top||0))}u?.({open:p})},[p,u]),(0,t.useEffect)(()=>{if(!p)return;const g=(0,ie.default)(()=>{if(E?.current){const O=E.current.getBoundingClientRect();L.current=!0,h(window?.innerHeight-(O?.top||0))}},100);return window.addEventListener("resize",g),()=>window.removeEventListener("resize",g)},[p]),(0,te.useGSAP)(()=>{if(L.current){X.gsap.set(E.current,{height:w}),L.current=!1;return}X.gsap.fromTo(E.current,{height:0},{height:w,duration:.3})},[w]),(0,ae.useScrollLock)(p);const z=(0,t.useMemo)(()=>D?.components?.[0]?.blockType,[D]),R=(0,C.WithSupports)(we.MobileSupportMenu,{categoriesItem:D}),G=(0,C.WithSidebar)(ke.MobileSidebarMenu,D),J=(0,C.WithResource)(ge.MobileResourceSidebarMenu,D),B=(0,C.WithMulticol)(xe.MobileMulticolMenu,D),f=(0,t.useMemo)(()=>{switch(z){case o.HeaderNavigationBlockType.Sidebar:return(0,e.jsx)(G,{});case o.HeaderNavigationBlockType.Resource:return(0,e.jsx)(J,{});case o.HeaderNavigationBlockType.Supports:return(0,e.jsx)(R,{});case o.HeaderNavigationBlockType.Multicol:return(0,e.jsx)(B,{});default:return null}},[z,D,R]),W=(0,t.useCallback)(()=>{_(!1),h(0),x&&x(o.HeaderNavigationMenu.Primary)},[_,h,x]),I=(0,t.useMemo)(()=>n?.bar?.actions?.filter(g=>g?.mobileShow&&g?.blockType!==o.HeaderNavigationActionBlockType.Profile),[n]),A=(0,t.useMemo)(()=>n?.bar?.actions?.find(g=>g?.mobileShow&&g?.blockType===o.HeaderNavigationActionBlockType.Profile)||{},[n]),H=(0,t.useMemo)(()=>{switch(m){case o.HeaderNavigationMenu.Primary:return(0,e.jsx)(Re,{actions:I,menuOpen:p,onMenuOpenClose:()=>{_(!1),h(0)},onMenuOpenClick:()=>_(!0)});case o.HeaderNavigationMenu.Secondary:return(0,e.jsx)(me,{title:D?.text,onMenuOpenClose:W,onMenuBackClick:()=>x?.(o.HeaderNavigationMenu.Primary)});case o.HeaderNavigationMenu.Third:return(0,e.jsx)(me,{title:v?.label,onMenuOpenClose:W,onMenuBackClick:()=>x?.(o.HeaderNavigationMenu.Secondary)});default:return null}},[p,m,x,D,I,v,W]),Y=(0,t.useCallback)((g,O)=>{const M=Array.isArray(s)?Array.isArray(s[g])?s[g][O]:{}:{};U(M),M?.components?.[0]?.blockType===o.HeaderNavigationBlockType.Links?M?.components?.[0]?.url&&window.open(M?.components?.[0]?.url,M?.components?.[0]?.target??"_blank"):x?.(o.HeaderNavigationMenu.Secondary)},[s,x]);return(0,e.jsxs)(l.Container,{className:(0,k.cn)("relative h-[52px]",i),children:[H,p&&(0,e.jsxs)("nav",{ref:E,className:"absolute left-0 top-full z-[999] w-full overflow-y-auto border-t border-[#E4E5E6] bg-white text-black",style:{height:w},role:"navigation","aria-label":"Mobile navigation menu",children:[m===o.HeaderNavigationMenu.Primary&&r?(0,e.jsx)("div",{className:"pt-4",children:(0,e.jsx)(l.BrandStrip,{data:r})}):null,m===o.HeaderNavigationMenu.Primary?(0,e.jsx)(Le,{categories:s,onPrimaryMenuClick:Y,onPrimaryNavClick:c,profileAction:A}):f]})]})}),Le=({categories:n,onPrimaryMenuClick:r,profileAction:i,onPrimaryNavClick:c})=>(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:n?.map((u,P)=>(0,e.jsxs)("div",{className:"",children:[(0,e.jsx)("div",{className:(0,k.cn)("my-2 h-px w-full bg-[#E5E5E7]")}),u?.map((s,m)=>(0,e.jsx)(ne.MenuItem,{label:s.text,onClick:()=>{const v=(n?.flat()||[])?.findIndex(p=>p?.id===n[P][m]?.id);r(P,m),c?.(s,v)},icon:s.components?.[0]?.icon},s.id))]},`groupCategory-${P}`))}),(0,e.jsx)(ze,{profileAction:i})]}),ze=({profileAction:n})=>{const[r,i]=(0,t.useState)(!1),{profile:c,event:u}=(0,F.useNavContext)(),{locale:P="us"}=(0,oe.useAiuiContext)();return(0,e.jsxs)("div",{className:(0,k.cn)("tablet:px-8 laptop:px-16 bg-[#F5F5F7] px-4 py-6",{"p-4":r}),children:[(0,e.jsxs)("button",{className:"flex w-full cursor-pointer items-center justify-between border-0 bg-transparent",onClick:()=>i(!r),"aria-expanded":r,"aria-label":c?.nick_name||n?.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)(S.User,{"aria-hidden":"true"})}),(0,e.jsx)(l.Text,{html:c?.nick_name||n?.welcome,className:"text-base font-bold leading-[1.4]"})]}),!c?.email&&(0,e.jsx)(S.DownArrow,{"aria-hidden":"true",className:(0,k.cn)("laptop:size-4 size-5",{"rotate-180":r})})]}),c?.email&&(0,e.jsx)("nav",{className:"mt-4",role:"navigation","aria-label":"Profile menu",children:n?.profiles?.map(s=>(0,e.jsx)(ne.MenuItem,{label:s?.title,href:(0,k.getLocalizedPath)(s?.url,P)},s.id))}),r&&!c?.email&&(0,e.jsxs)("div",{className:"mt-4",children:[(0,e.jsx)(l.Text,{html:n?.benefits_title,className:"text-sm font-bold leading-[1.4]"}),(0,e.jsx)("div",{className:"mt-2 flex flex-col gap-1",children:n?.benefits?.map(s=>(0,e.jsxs)("div",{className:"flex items-center gap-[6px]",children:[(0,e.jsx)(l.Picture,{source:s.benefitIcon?.url,className:"size-4",alt:s.benefit,width:16,height:16}),(0,e.jsx)(l.Text,{html:s.benefit,className:"text-sm font-bold leading-[1.4]"})]},s.id))})]}),!c?.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:()=>u?.join?.(),children:(0,e.jsx)(l.Text,{html:n?.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:()=>u?.login?.(),children:(0,e.jsx)(l.Text,{html:n?.secondaryButton||"Log In",className:"text-sm font-bold leading-[1.4]"})})]})]})},Re=({menuOpen:n,onMenuOpenClose:r,onMenuOpenClick:i,actions:c})=>(0,e.jsxs)("div",{className:"flex h-full items-center justify-between gap-4",children:[(0,e.jsx)(de,{}),(0,e.jsxs)("div",{className:"desktop:gap-6 flex items-center gap-4",children:[(0,e.jsx)(re,{actions:c}),n?(0,e.jsx)("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>r(),"aria-label":"Close menu","aria-expanded":"true",children:(0,e.jsx)(S.Close,{className:"size-5","aria-hidden":"true"})}):(0,e.jsx)("button",{className:"cursor-pointer border-0 bg-transparent p-0",onClick:()=>i(),"aria-label":"Open menu","aria-expanded":"false","aria-haspopup":"true",children:(0,e.jsx)(S.Menu,{className:"size-5","aria-hidden":"true"})})]})]}),de=()=>{const{payloadData:n,isMobile:r}=(0,F.useNavContext)(),{locale:i="us"}=(0,oe.useAiuiContext)();return(0,e.jsx)("a",{href:(0,k.getLocalizedPath)("/",i),className:"hover:text-brand-0 [&>svg]:w-full","aria-label":"Home",dangerouslySetInnerHTML:{__html:r?n?.bar?.mobileLogo:n?.bar?.desktopLogo}})},re=(0,t.forwardRef)(({actions:n,activeStatus:r=!1},i)=>{const{event:c,cartCount:u}=(0,F.useNavContext)(),[P,s]=(0,t.useState)(null),m=v=>{switch(v){case o.HeaderNavigationActionBlockType.Search:return"Search";case o.HeaderNavigationActionBlockType.Cart:return`Shopping cart${u>0?` (${u} items)`:""}`;case o.HeaderNavigationActionBlockType.Profile:return"User profile";case o.HeaderNavigationActionBlockType.Livestream:return"Livestream";default:return"Action"}},x=(0,t.useCallback)((v,p)=>{switch(s(p),v?.blockType){case o.HeaderNavigationActionBlockType.Search:c?.search?.();break;case o.HeaderNavigationActionBlockType.Cart:c?.cart?.();break;case o.HeaderNavigationActionBlockType.Profile:c?.profile?.();break;case o.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(n)&&n?.map((v,p)=>(0,e.jsxs)("button",{className:"relative cursor-pointer border-0 bg-transparent p-0",ref:v.blockType===o.HeaderNavigationActionBlockType.Profile?i:null,onClick:()=>x(v,p),"aria-label":m(v.blockType),"aria-pressed":r&&P===p,children:[(0,e.jsx)(l.Text,{html:v.icon,className:(0,k.cn)("size-5",{"text-brand-0":r&&P===p}),"aria-hidden":"true"}),v.blockType===o.HeaderNavigationActionBlockType.Cart&&u>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:u?.toString(),className:"text-sm font-bold leading-[1.2] text-white"})})]},v.id))})}),me=({title:n,onMenuOpenClose:r,onMenuBackClick:i})=>(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:()=>i(),"aria-label":"Back to previous menu",children:(0,e.jsx)(S.LeftArrow,{className:"size-5","aria-hidden":"true"})}),(0,e.jsx)(l.Text,{html:n,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:()=>r(),"aria-label":"Close menu",children:(0,e.jsx)(S.Close,{className:"size-5","aria-hidden":"true"})})]});ue.displayName="MobileNavigation",re.displayName="Actions",se.displayName="HeaderNavigation",ce.displayName="DesktopNavigation";var Be=(0,pe.withLayout)(se);
2
2
  //# sourceMappingURL=index.js.map