@anker-in/headless-ui 1.2.2 → 1.2.3

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 (80) hide show
  1. package/dist/cjs/biz-components/Faq/Faq.js +1 -1
  2. package/dist/cjs/biz-components/Faq/Faq.js.map +2 -2
  3. package/dist/cjs/biz-components/Graphic/index.js +1 -1
  4. package/dist/cjs/biz-components/Graphic/index.js.map +3 -3
  5. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
  6. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  7. package/dist/cjs/biz-components/HeroBanner/types.d.ts +5 -0
  8. package/dist/cjs/biz-components/HeroBanner/types.js +1 -1
  9. package/dist/cjs/biz-components/HeroBanner/types.js.map +1 -1
  10. package/dist/cjs/biz-components/ImageOverlayShelf/ProductCard.js +1 -1
  11. package/dist/cjs/biz-components/ImageOverlayShelf/ProductCard.js.map +2 -2
  12. package/dist/cjs/biz-components/Marquee/Marquee.d.ts +11 -4
  13. package/dist/cjs/biz-components/Marquee/Marquee.js +1 -1
  14. package/dist/cjs/biz-components/Marquee/Marquee.js.map +3 -3
  15. package/dist/cjs/biz-components/Marquee/index.d.ts +1 -1
  16. package/dist/cjs/biz-components/Marquee/index.js +1 -1
  17. package/dist/cjs/biz-components/Marquee/index.js.map +2 -2
  18. package/dist/cjs/biz-components/Marquee/type.d.ts +22 -4
  19. package/dist/cjs/biz-components/Marquee/type.js +1 -1
  20. package/dist/cjs/biz-components/Marquee/type.js.map +1 -1
  21. package/dist/cjs/biz-components/Media/index.js +1 -1
  22. package/dist/cjs/biz-components/Media/index.js.map +2 -2
  23. package/dist/cjs/biz-components/MediaTextOverlay/MediaTextOverlay.d.ts +9 -0
  24. package/dist/cjs/biz-components/MediaTextOverlay/MediaTextOverlay.js +2 -0
  25. package/dist/cjs/biz-components/MediaTextOverlay/MediaTextOverlay.js.map +7 -0
  26. package/dist/cjs/biz-components/MediaTextOverlay/index.d.ts +2 -0
  27. package/dist/cjs/biz-components/MediaTextOverlay/index.js +2 -0
  28. package/dist/cjs/biz-components/MediaTextOverlay/index.js.map +7 -0
  29. package/dist/cjs/biz-components/MediaTextOverlay/types.d.ts +24 -0
  30. package/dist/cjs/biz-components/MediaTextOverlay/types.js +2 -0
  31. package/dist/cjs/biz-components/MediaTextOverlay/types.js.map +7 -0
  32. package/dist/cjs/biz-components/ShelfDisplay/index.js +1 -1
  33. package/dist/cjs/biz-components/ShelfDisplay/index.js.map +2 -2
  34. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.d.ts +1 -0
  35. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js +1 -1
  36. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js.map +1 -1
  37. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
  38. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
  39. package/dist/cjs/biz-components/index.d.ts +2 -0
  40. package/dist/cjs/biz-components/index.js +1 -1
  41. package/dist/cjs/biz-components/index.js.map +3 -3
  42. package/dist/esm/biz-components/Faq/Faq.js +1 -1
  43. package/dist/esm/biz-components/Faq/Faq.js.map +2 -2
  44. package/dist/esm/biz-components/Graphic/index.js +1 -1
  45. package/dist/esm/biz-components/Graphic/index.js.map +3 -3
  46. package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
  47. package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  48. package/dist/esm/biz-components/HeroBanner/types.d.ts +5 -0
  49. package/dist/esm/biz-components/ImageOverlayShelf/ProductCard.js +1 -1
  50. package/dist/esm/biz-components/ImageOverlayShelf/ProductCard.js.map +2 -2
  51. package/dist/esm/biz-components/Marquee/Marquee.d.ts +11 -4
  52. package/dist/esm/biz-components/Marquee/Marquee.js +1 -1
  53. package/dist/esm/biz-components/Marquee/Marquee.js.map +3 -3
  54. package/dist/esm/biz-components/Marquee/index.d.ts +1 -1
  55. package/dist/esm/biz-components/Marquee/index.js +1 -1
  56. package/dist/esm/biz-components/Marquee/index.js.map +3 -3
  57. package/dist/esm/biz-components/Marquee/type.d.ts +22 -4
  58. package/dist/esm/biz-components/Media/index.js +1 -1
  59. package/dist/esm/biz-components/Media/index.js.map +2 -2
  60. package/dist/esm/biz-components/MediaTextOverlay/MediaTextOverlay.d.ts +9 -0
  61. package/dist/esm/biz-components/MediaTextOverlay/MediaTextOverlay.js +2 -0
  62. package/dist/esm/biz-components/MediaTextOverlay/MediaTextOverlay.js.map +7 -0
  63. package/dist/esm/biz-components/MediaTextOverlay/index.d.ts +2 -0
  64. package/dist/esm/biz-components/MediaTextOverlay/index.js +2 -0
  65. package/dist/esm/biz-components/MediaTextOverlay/index.js.map +7 -0
  66. package/dist/esm/biz-components/MediaTextOverlay/types.d.ts +24 -0
  67. package/dist/esm/biz-components/MediaTextOverlay/types.js +1 -0
  68. package/dist/esm/biz-components/MediaTextOverlay/types.js.map +7 -0
  69. package/dist/esm/biz-components/ShelfDisplay/index.js +1 -1
  70. package/dist/esm/biz-components/ShelfDisplay/index.js.map +2 -2
  71. package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.d.ts +1 -0
  72. package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js.map +1 -1
  73. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
  74. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
  75. package/dist/esm/biz-components/index.d.ts +2 -0
  76. package/dist/esm/biz-components/index.js +1 -1
  77. package/dist/esm/biz-components/index.js.map +2 -2
  78. package/package.json +1 -1
  79. package/style.css +49 -8
  80. package/tailwind.config.js +10 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/ShelfDisplay/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useState, useEffect, useRef, useImperativeHandle } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { Tabs, TabsList, TabsTrigger } from '../../components/tabs.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { gaTrack } from '../../shared/track.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { useRollout } from '../../hooks/useRollout.js'\nimport { ShelfDisplayWrapItem, ShelfDisplayHorizontalItem } from './shelfDisplayItem.js'\nimport type { ShelfDisplayProps, ShelfDisplayItem } from './shelfDisplay.js'\n\nconst componentType = 'image'\nconst componentName = 'product_shelf'\n\nconst sanitizeCssSelector = (value?: string | number) => {\n if (value === undefined || value === null) return 'default'\n const sanitized = String(value).replace(/[^a-zA-Z0-9_-]/g, '')\n return sanitized || 'default'\n}\n\nconst createInstanceId = () => `shelf-display-${Math.random().toString(36).slice(2, 9)}`\n\nconst ShelfDisplay = React.forwardRef<HTMLDivElement, ShelfDisplayProps>(\n (\n {\n key,\n data,\n event,\n buildData,\n breakpoints,\n className = '',\n recommendedData,\n target = '_self',\n metafields,\n isDisplayGudgments = false,\n isDisplayBackImage = false,\n onAddCart,\n onBuyNow,\n onLearnMore,\n ...rest\n },\n ref\n ) => {\n const {\n productsTab = [],\n productsCard = [],\n title,\n isShowTab = true,\n tabShape = 'square',\n isShowTag = false,\n isShowOriginalPrice = true,\n isShowRecommendedCard = false,\n ...other\n } = data\n\n const [tabId, setTabId] = useState<string>('')\n const [currentItems, setCurrentItems] = useState<ShelfDisplayItem[]>([])\n\n const isView = useRef<boolean>(false)\n const isRecommend = useRef<boolean>(false)\n const innerRef = useRef<HTMLDivElement>(null)\n const instanceIdRef = useRef<string>(createInstanceId())\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const [viewRef, inView] = useRollout<HTMLDivElement>({ threshold: 0 })\n\n const isOnce = currentItems?.length <= 1 && isDisplayGudgments\n const isShowGudgments = !isMobile && currentItems?.length <= 2 && isDisplayGudgments\n\n const showItemLength = (size?: number) => {\n switch (size) {\n case 1440:\n return isShowGudgments ? currentItems?.length : 4\n case 1024:\n return isShowGudgments ? currentItems?.length : 3\n default:\n return isShowGudgments ? currentItems?.length : 2.3\n }\n }\n\n const gackViewEvent = () => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'view_item_list',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: recommendedData?.map((item, index) => {\n const findData = item?.variants?.find((v: any) => v?.sku === item?.sku)\n const variant = findData || item?.variants?.[0]\n return {\n item_id: item?.sku || variant?.sku,\n item_name: item?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: index + 1,\n }\n }),\n },\n })\n }\n\n const handleCurrentTab = (currentData: ShelfDisplayItem[], flag: boolean) => {\n if (flag) {\n const newCurrentData = recommendedData?.map?.(item => {\n return {\n ...item,\n isShowRecommended: true,\n }\n })\n setCurrentItems(newCurrentData?.length ? newCurrentData || [] : [])\n } else {\n const isArray = Array.isArray(currentData)\n if (isArray) {\n const newCurrentData = currentData\n ?.map?.(item => {\n const findData = buildData?.products?.find(params => params?.handle === item?.handle)\n if (findData) {\n return {\n sku: item.sku,\n isShowRecommended: false,\n custom_name: item.custom_name,\n custom_description: item.custom_description,\n custom_image: item.custom_image,\n custom_theme: item.custom_theme,\n custom_primary_link: item?.custom_primary_link || '',\n custom_secondary_link: item?.custom_secondary_link || '',\n ...findData,\n }\n }\n })\n ?.filter(item => item)\n setCurrentItems(newCurrentData?.length ? newCurrentData || [] : [])\n } else {\n setCurrentItems([])\n }\n }\n }\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useEffect(() => {\n if (inView && recommendedData?.length && !isView.current) {\n isView.current = true\n gackViewEvent()\n }\n }, [inView, recommendedData])\n\n // \u7B97\u6CD5\u6570\u636E\u4F1A\u7A0D\u5FAE\u5EF6\u8FDF\uFF0C\u6240\u4EE5\u9700\u76D1\u542CrecommendedData\uFF0C\u4E3A\u4E86\u9632\u6B62\u5728\u6709\u7B97\u6CD5\u6570\u636E\u4E14\u5BF9\u9ED8\u8BA4\u6E32\u67D3\u7B2C\u4E00\u4E2A\u540E\u53CD\u590D\u89E6\u53D1\uFF0C\u7528isRecommend\u5173\u95ED\n useEffect(() => {\n if (isRecommend.current) return\n if (!isRecommend.current && recommendedData?.length) {\n isRecommend.current = true\n }\n if (isShowTab) {\n const currentTab = productsTab?.find(item => item?.tab === tabId) || productsTab?.[0]\n setTabId(currentTab?.tab || '')\n handleCurrentTab(currentTab?.data || [], currentTab?.isShowRecommendedTab)\n return\n }\n handleCurrentTab(productsCard, isShowRecommendedCard)\n }, [recommendedData])\n\n useEffect(() => {\n if (isShowTab) {\n const currentTab = productsTab?.find(item => item?.tab === tabId) || productsTab?.[0]\n handleCurrentTab(currentTab?.data || [], currentTab?.isShowRecommendedTab)\n return\n }\n handleCurrentTab(productsCard, isShowRecommendedCard)\n // buildData \u66F4\u65B0\u65F6\u9700\u8981\u91CD\u65B0\u8BA1\u7B97\u5F53\u524D\u5217\u8868\n }, [buildData])\n\n const safeTabKey = sanitizeCssSelector(tabId)\n const swiperInstanceId = `${instanceIdRef.current}-${safeTabKey}`\n\n return (\n <div\n ref={innerRef}\n {...rest}\n className={cn('shelf-display-wrap text-info-primary w-full', className, {\n 'aiui-dark': data?.theme === 'dark',\n })}\n >\n {title && <Title data={{ title: title }} />}\n {isShowTab && productsTab?.length > 0 && (\n <Tabs\n value={tabId}\n onValueChange={value => {\n const currentTab = productsTab?.find(item => item?.tab === value)\n if (currentTab) {\n setTabId(value)\n handleCurrentTab(currentTab.data || [], currentTab.isShowRecommendedTab)\n if (!currentTab.isShowRecommendedTab) {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: 'Home Page',\n component_type: componentType,\n component_name: componentName,\n component_title: data?.title,\n component_position: 1,\n navigation: value,\n },\n })\n return\n }\n gackViewEvent()\n }\n }}\n shape={tabShape === 'rounded' ? 'rounded' : 'square'}\n >\n <TabsList>\n {productsTab.map(item => (\n <TabsTrigger key={item?.id || item?.tab} value={item?.tab}>\n {item?.tab || ''}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n )}\n <div\n ref={viewRef as any}\n className=\"tablet:min-h-[393px] laptop:min-h-[425px] desktop:min-h-[405px] lg-desktop:min-h-[409px]\"\n >\n <SwiperBox\n key={swiperInstanceId}\n data={{\n list: currentItems,\n configuration: {\n ...other,\n event: event,\n isShowTag,\n isShowOriginalPrice,\n target: target,\n metafields: metafields,\n itemLength: currentItems?.length,\n isDisplayBackImage: isDisplayBackImage,\n onAddCart,\n onBuyNow,\n onLearnMore,\n },\n }}\n id={swiperInstanceId}\n className={`${isShowTab ? 'mt-6' : ''} shelf-display-swiper-box !overflow-visible`}\n itemClassName={isShowGudgments ? 'flex-1' : ''}\n Slide={isShowGudgments ? ShelfDisplayHorizontalItem : ShelfDisplayWrapItem}\n breakpoints={\n breakpoints || {\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: isOnce ? 1 : 1.2,\n },\n 768: {\n spaceBetween: isOnce ? 0 : 16,\n freeMode: false,\n slidesPerView: showItemLength(),\n },\n 1024: {\n spaceBetween: isOnce ? 0 : 16,\n freeMode: false,\n slidesPerView: showItemLength(1024),\n },\n 1440: {\n spaceBetween: isOnce ? 0 : 16,\n freeMode: false,\n slidesPerView: showItemLength(1440),\n },\n }\n }\n />\n </div>\n </div>\n )\n }\n)\n\nShelfDisplay.displayName = 'ShelfDisplay'\nexport default withLayout(ShelfDisplay)\n"],
5
- "mappings": "mlBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAmLM,IAAAI,EAAA,6BAlLNC,EAAwE,oBACxEC,EAAmB,kCACnBC,EAA4C,oCAC5CC,EAAkB,gCAClBC,EAAsB,oCACtBC,EAA2B,kCAC3BC,EAAwB,iCACxBC,EAA8B,4BAC9BC,EAA2B,qCAC3BC,EAAiE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WkB,CAAY",
4
+ "sourcesContent": ["'use client'\nimport React, { useState, useEffect, useRef, useImperativeHandle } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { Tabs, TabsList, TabsTrigger } from '../../components/tabs.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { gaTrack } from '../../shared/track.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { useRollout } from '../../hooks/useRollout.js'\nimport { ShelfDisplayWrapItem, ShelfDisplayHorizontalItem } from './shelfDisplayItem.js'\nimport type { ShelfDisplayProps, ShelfDisplayItem } from './shelfDisplay.js'\n\nconst componentType = 'image'\nconst componentName = 'product_shelf'\n\nconst sanitizeCssSelector = (value?: string | number) => {\n if (value === undefined || value === null) return 'default'\n const sanitized = String(value).replace(/[^a-zA-Z0-9_-]/g, '')\n return sanitized || 'default'\n}\n\nconst createInstanceId = () => `shelf-display-${Math.random().toString(36).slice(2, 9)}`\n\nconst ShelfDisplay = React.forwardRef<HTMLDivElement, ShelfDisplayProps>(\n (\n {\n key,\n data,\n event,\n buildData,\n breakpoints,\n className = '',\n recommendedData,\n target = '_self',\n metafields,\n isDisplayGudgments = false,\n isDisplayBackImage = false,\n onAddCart,\n onBuyNow,\n onLearnMore,\n ...rest\n },\n ref\n ) => {\n const {\n productsTab = [],\n productsCard = [],\n title,\n isShowTab = true,\n tabShape = 'square',\n isShowTag = false,\n isShowOriginalPrice = true,\n isShowRecommendedCard = false,\n ...other\n } = data\n\n const [tabId, setTabId] = useState<string>('')\n const [currentItems, setCurrentItems] = useState<ShelfDisplayItem[]>([])\n\n const isView = useRef<boolean>(false)\n const isRecommend = useRef<boolean>(false)\n const innerRef = useRef<HTMLDivElement>(null)\n const instanceIdRef = useRef<string>(createInstanceId())\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const [viewRef, inView] = useRollout<HTMLDivElement>({ threshold: 0 })\n\n const isOnce = currentItems?.length <= 1 && isDisplayGudgments\n const isShowGudgments = !isMobile && currentItems?.length <= 2 && isDisplayGudgments\n\n const showItemLength = (size?: number) => {\n switch (size) {\n case 1440:\n return isShowGudgments ? currentItems?.length : 4\n case 1024:\n return isShowGudgments ? currentItems?.length : 3\n default:\n return isShowGudgments ? currentItems?.length : 2.3\n }\n }\n\n const gackViewEvent = () => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'view_item_list',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: recommendedData?.map((item, index) => {\n const findData = item?.variants?.find((v: any) => v?.sku === item?.sku)\n const variant = findData || item?.variants?.[0]\n return {\n item_id: item?.sku || variant?.sku,\n item_name: item?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: index + 1,\n }\n }),\n },\n })\n }\n\n const handleCurrentTab = (currentData: ShelfDisplayItem[], flag: boolean) => {\n if (flag) {\n const newCurrentData = recommendedData?.map?.(item => {\n return {\n ...item,\n isShowRecommended: true,\n }\n })\n setCurrentItems(newCurrentData?.length ? newCurrentData || [] : [])\n } else {\n const isArray = Array.isArray(currentData)\n if (isArray) {\n const newCurrentData = currentData\n ?.map?.(item => {\n const findData = buildData?.products?.find(params => params?.handle === item?.handle)\n if (findData) {\n return {\n sku: item.sku,\n isShowRecommended: false,\n custom_name: item.custom_name,\n custom_description: item.custom_description,\n custom_image: item.custom_image,\n custom_theme: item.custom_theme,\n custom_primary_link: item?.custom_primary_link || '',\n custom_secondary_link: item?.custom_secondary_link || '',\n custom_bg_image: item?.custom_bg_image || '',\n ...findData,\n }\n }\n })\n ?.filter(item => item)\n setCurrentItems(newCurrentData?.length ? newCurrentData || [] : [])\n } else {\n setCurrentItems([])\n }\n }\n }\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useEffect(() => {\n if (inView && recommendedData?.length && !isView.current) {\n isView.current = true\n gackViewEvent()\n }\n }, [inView, recommendedData])\n\n // \u7B97\u6CD5\u6570\u636E\u4F1A\u7A0D\u5FAE\u5EF6\u8FDF\uFF0C\u6240\u4EE5\u9700\u76D1\u542CrecommendedData\uFF0C\u4E3A\u4E86\u9632\u6B62\u5728\u6709\u7B97\u6CD5\u6570\u636E\u4E14\u5BF9\u9ED8\u8BA4\u6E32\u67D3\u7B2C\u4E00\u4E2A\u540E\u53CD\u590D\u89E6\u53D1\uFF0C\u7528isRecommend\u5173\u95ED\n useEffect(() => {\n if (isRecommend.current) return\n if (!isRecommend.current && recommendedData?.length) {\n isRecommend.current = true\n }\n if (isShowTab) {\n const currentTab = productsTab?.find(item => item?.tab === tabId) || productsTab?.[0]\n setTabId(currentTab?.tab || '')\n handleCurrentTab(currentTab?.data || [], currentTab?.isShowRecommendedTab)\n return\n }\n handleCurrentTab(productsCard, isShowRecommendedCard)\n }, [recommendedData])\n\n useEffect(() => {\n if (isShowTab) {\n const currentTab = productsTab?.find(item => item?.tab === tabId) || productsTab?.[0]\n handleCurrentTab(currentTab?.data || [], currentTab?.isShowRecommendedTab)\n return\n }\n handleCurrentTab(productsCard, isShowRecommendedCard)\n // buildData \u66F4\u65B0\u65F6\u9700\u8981\u91CD\u65B0\u8BA1\u7B97\u5F53\u524D\u5217\u8868\n }, [buildData])\n\n const safeTabKey = sanitizeCssSelector(tabId)\n const swiperInstanceId = `${instanceIdRef.current}-${safeTabKey}`\n\n return (\n <div\n ref={innerRef}\n {...rest}\n className={cn('shelf-display-wrap text-info-primary w-full', className, {\n 'aiui-dark': data?.theme === 'dark',\n })}\n >\n {title && <Title data={{ title: title }} />}\n {isShowTab && productsTab?.length > 0 && (\n <Tabs\n value={tabId}\n onValueChange={value => {\n const currentTab = productsTab?.find(item => item?.tab === value)\n if (currentTab) {\n setTabId(value)\n handleCurrentTab(currentTab.data || [], currentTab.isShowRecommendedTab)\n if (!currentTab.isShowRecommendedTab) {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: 'Home Page',\n component_type: componentType,\n component_name: componentName,\n component_title: data?.title,\n component_position: 1,\n navigation: value,\n },\n })\n return\n }\n gackViewEvent()\n }\n }}\n shape={tabShape === 'rounded' ? 'rounded' : 'square'}\n >\n <TabsList>\n {productsTab.map(item => (\n <TabsTrigger key={item?.id || item?.tab} value={item?.tab}>\n {item?.tab || ''}\n </TabsTrigger>\n ))}\n </TabsList>\n </Tabs>\n )}\n <div\n ref={viewRef as any}\n className=\"tablet:min-h-[393px] laptop:min-h-[425px] desktop:min-h-[405px] lg-desktop:min-h-[409px]\"\n >\n <SwiperBox\n key={swiperInstanceId}\n data={{\n list: currentItems,\n configuration: {\n ...other,\n event: event,\n isShowTag,\n isShowOriginalPrice,\n target: target,\n metafields: metafields,\n itemLength: currentItems?.length,\n isDisplayBackImage: isDisplayBackImage,\n onAddCart,\n onBuyNow,\n onLearnMore,\n },\n }}\n id={swiperInstanceId}\n className={`${isShowTab ? 'mt-6' : ''} shelf-display-swiper-box !overflow-visible`}\n itemClassName={isShowGudgments ? 'flex-1' : ''}\n Slide={isShowGudgments ? ShelfDisplayHorizontalItem : ShelfDisplayWrapItem}\n breakpoints={\n breakpoints || {\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: isOnce ? 1 : 1.2,\n },\n 768: {\n spaceBetween: isOnce ? 0 : 16,\n freeMode: false,\n slidesPerView: showItemLength(),\n },\n 1024: {\n spaceBetween: isOnce ? 0 : 16,\n freeMode: false,\n slidesPerView: showItemLength(1024),\n },\n 1440: {\n spaceBetween: isOnce ? 0 : 16,\n freeMode: false,\n slidesPerView: showItemLength(1440),\n },\n }\n }\n />\n </div>\n </div>\n )\n }\n)\n\nShelfDisplay.displayName = 'ShelfDisplay'\nexport default withLayout(ShelfDisplay)\n"],
5
+ "mappings": "mlBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAoLM,IAAAI,EAAA,6BAnLNC,EAAwE,oBACxEC,EAAmB,kCACn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J,aAAcF,EAAS,EAAI,GAC3B,SAAU,GACV,cAAeE,EAAe,IAAI,CACpC,CACF,GAhDGe,CAkDP,EACF,GACF,CAEJ,CACF,EAEAvD,EAAa,YAAc,eAC3B,IAAOlB,MAAQ,cAAWkB,CAAY",
6
6
  "names": ["ShelfDisplay_exports", "__export", "ShelfDisplay_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_tabs", "import_Title", "import_SwiperBox", "import_Styles", "import_track", "import_react_responsive", "import_useRollout", "import_shelfDisplayItem", "componentType", "componentName", "sanitizeCssSelector", "value", "createInstanceId", "ShelfDisplay", "React", "key", "data", "event", "buildData", "breakpoints", "className", "recommendedData", "target", "metafields", "isDisplayGudgments", "isDisplayBackImage", "onAddCart", "onBuyNow", "onLearnMore", "rest", "ref", "productsTab", "productsCard", "title", "isShowTab", "tabShape", "isShowTag", "isShowOriginalPrice", "isShowRecommendedCard", "other", "tabId", "setTabId", "currentItems", "setCurrentItems", "isView", "isRecommend", "innerRef", "instanceIdRef", "isMobile", "viewRef", "inView", "isOnce", "isShowGudgments", "showItemLength", "size", "gackViewEvent", "item", "index", "variant", "v", "handleCurrentTab", "currentData", "flag", "newCurrentData", "findData", "params", "currentTab", "safeTabKey", "swiperInstanceId", "Title", "SwiperBox"]
7
7
  }
@@ -47,6 +47,7 @@ export interface ShelfDisplayItem {
47
47
  custom_description?: string;
48
48
  custom_image?: string;
49
49
  custom_theme?: string;
50
+ custom_bg_image?: string;
50
51
  }
51
52
  export type ShelfDisplayType = {
52
53
  title?: string;
@@ -1,2 +1,2 @@
1
- "use strict";var D=Object.create;var o=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var x=(e,n)=>{for(var r in n)o(e,r,{get:n[r],enumerable:!0})},l=(e,n,r,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of T(n))!P.call(e,t)&&t!==r&&o(e,t,{get:()=>n[t],enumerable:!(a=S(n,t))||a.enumerable});return e};var w=(e,n,r)=>(r=e!=null?D(v(e)):{},l(n||!e||!e.__esModule?o(r,"default",{value:e,enumerable:!0}):r,e)),_=e=>l(o({},"__esModule",{value:!0}),e);var C={};x(C,{formatVariantPrice:()=>B});module.exports=_(C);var c=w(require("decimal.js")),i=require("../../helpers/index.js");function B({amount:e,baseAmount:n,currencyCode:r,currencyDisplay:a,locale:t,maximumFractionDigits:g,minimumFractionDigits:f,removeTrailingZeros:m}){if(typeof Intl>"u")return{price:`${i.PRICE_SYMBOL[t]}${e}`,basePrice:`${i.PRICE_SYMBOL[t]}${n}`,discount:`${i.PRICE_SYMBOL[t]}${n-e||0}`};const s=n>e;let u=null;const y=(0,i.languageTerritory)(t);if(y){const p=new Intl.NumberFormat(y,{style:"percent"});u=s?p.format((n-e)/n):null}let d;if(s){const p=new c.default(n).sub(e||0).toNumber();d=(0,i.formatPrice)({amount:p,currencyDisplay:a,currencyCode:r||"USD",locale:t,maximumFractionDigits:2})}const b=(0,i.formatPrice)({amount:e,currencyCode:r,currencyDisplay:a,locale:t,removeTrailingZeros:m}),h=s?(0,i.formatPrice)({amount:n,currencyCode:r,currencyDisplay:a,locale:t,maximumFractionDigits:g,minimumFractionDigits:f,removeTrailingZeros:m}):void 0;return{price:b,basePrice:h,discount:u,discountAmount:d}}
1
+ "use strict";var D=Object.create;var o=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var _=(e,n)=>{for(var r in n)o(e,r,{get:n[r],enumerable:!0})},l=(e,n,r,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of T(n))!P.call(e,t)&&t!==r&&o(e,t,{get:()=>n[t],enumerable:!(a=S(n,t))||a.enumerable});return e};var x=(e,n,r)=>(r=e!=null?D(v(e)):{},l(n||!e||!e.__esModule?o(r,"default",{value:e,enumerable:!0}):r,e)),w=e=>l(o({},"__esModule",{value:!0}),e);var C={};_(C,{formatVariantPrice:()=>B});module.exports=w(C);var c=x(require("decimal.js")),i=require("../../helpers/index.js");function B({amount:e,baseAmount:n,currencyCode:r,currencyDisplay:a,locale:t,maximumFractionDigits:g,minimumFractionDigits:f,removeTrailingZeros:m}){if(typeof Intl>"u")return{price:`${i.PRICE_SYMBOL[t]}${e}`,basePrice:`${i.PRICE_SYMBOL[t]}${n}`,discount:`${i.PRICE_SYMBOL[t]}${n-e||0}`};const s=n>e;let u=null;const y=(0,i.languageTerritory)(t);if(y){const p=new Intl.NumberFormat(y,{style:"percent"});u=s?p.format((n-e)/n):null}let d;if(s){const p=new c.default(n).sub(e||0).toNumber();d=(0,i.formatPrice)({amount:p,currencyDisplay:a,currencyCode:r||"USD",locale:t,maximumFractionDigits:2})}const b=(0,i.formatPrice)({amount:e,currencyCode:r,currencyDisplay:a,locale:t,removeTrailingZeros:m}),h=s?(0,i.formatPrice)({amount:n,currencyCode:r,currencyDisplay:a,locale:t,maximumFractionDigits:g,minimumFractionDigits:f,removeTrailingZeros:m}):void 0;return{price:b,basePrice:h,discount:u,discountAmount:d}}
2
2
  //# sourceMappingURL=shelfDisplay.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/ShelfDisplay/shelfDisplay.ts"],
4
- "sourcesContent": ["import Decimal from 'decimal.js'\nimport type { ContainerProps, CurrencyDisplayType } from '../../types/props.js'\n/* eslint-disable no-useless-escape */\nimport { PRICE_SYMBOL, formatPrice, languageTerritory } from '../../helpers/index.js'\n\nexport function formatVariantPrice({\n amount,\n baseAmount,\n currencyCode,\n currencyDisplay,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n}: {\n baseAmount: number\n amount: number\n currencyCode: string\n currencyDisplay?: CurrencyDisplayType\n locale: string\n maximumFractionDigits?: number\n minimumFractionDigits?: number\n removeTrailingZeros?: boolean\n}) {\n if (typeof Intl === 'undefined') {\n return {\n price: `${PRICE_SYMBOL[locale]}${amount}`,\n basePrice: `${PRICE_SYMBOL[locale]}${baseAmount}`,\n discount: `${PRICE_SYMBOL[locale]}${baseAmount - amount || 0}`,\n }\n }\n\n const hasDiscount = baseAmount > amount\n let discount = null\n const currentLocale = languageTerritory(locale)\n if (currentLocale) {\n const formatDiscount = new Intl.NumberFormat(currentLocale, {\n style: 'percent',\n })\n discount = hasDiscount ? formatDiscount.format((baseAmount - amount) / baseAmount) : null\n }\n // \u6298\u6263\u91D1\u989D\n let discountAmount\n if (hasDiscount) {\n const savePriceAmount = new Decimal(baseAmount).sub(amount || 0).toNumber()\n discountAmount = formatPrice({\n amount: savePriceAmount,\n currencyDisplay,\n currencyCode: currencyCode || 'USD',\n locale,\n maximumFractionDigits: 2,\n })\n }\n\n const price = formatPrice({ amount, currencyCode, currencyDisplay, locale, removeTrailingZeros })\n const basePrice = hasDiscount\n ? formatPrice({\n amount: baseAmount,\n currencyCode,\n currencyDisplay,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n })\n : undefined\n\n return { price, basePrice, discount, discountAmount }\n}\n\ntype EventType = {\n primaryButton?: (v: any, index: number, data: ShelfDisplayType, coupon: any) => void\n secondaryButton?: (v: any, index: number, data: ShelfDisplayType, coupon: any) => void\n}\n\nexport interface ShelfDisplayItem {\n custom_primary_link?: string\n custom_secondary_link?: string\n id?: string\n /** \u4EA7\u54C1\u56FE\u7247*/\n img?: {\n url: string\n }\n handle?: string\n sku?: string\n /** \u6298\u6263\u540E\u4EF7\u683C*/\n price?: string\n title?: string\n /** \u6298\u6263\u524D\u4EF7\u683C*/\n basePrice?: string\n subTitle?: string\n /** \u6807\u7B7E*/\n tagItems?: string[]\n tab?: string\n data?: ShelfDisplayItem[]\n custom_name?: string\n custom_description?: string\n custom_image?: string\n custom_theme?: string\n}\n\nexport type ShelfDisplayType = {\n title?: string\n isShowTab?: boolean\n isShowTag?: boolean\n isShowRecommendedCard?: boolean\n isShowOriginalPrice?: boolean\n direction?: 'horizontal' | 'vertical'\n align?: 'left' | 'center' | 'right'\n productsTab?: any[]\n productsCard?: any[]\n /** \u5361\u7247\u5F62\u72B6 */\n itemShape?: 'round' | 'square'\n /** \u6309\u94AE\u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u6807\u7B7E\u9875\u5F62\u72B6*/\n tabShape?: 'rounded' | 'square'\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: string\n primaryFun?: 'AddCart' | 'BuyNow' | 'LearnMore'\n /** \u526F\u6309\u94AE\u914D\u7F6E */\n secondaryButton?: string\n secondaryFun?: 'AddCart' | 'BuyNow' | 'LearnMore'\n theme?: 'light' | 'dark'\n containerProps?: ContainerProps\n}\n\nexport interface ShelfDisplayProps extends React.HTMLAttributes<HTMLDivElement> {\n data: ShelfDisplayType\n buildData?: {\n categories: any[]\n products: any[]\n }\n recommendedData?: any[]\n /**\n * \u6309\u94AE\u4E8B\u4EF6\n * @deprecated \u8BF7\u4F7F\u7528 onAddCart / onBuyNow / onLearnMore \u914D\u5408 primaryFun / secondaryFun \u66FF\u4EE3\n */\n event?: EventType\n key?: string\n target?: '_self' | '_blank'\n breakpoints?: {\n [key: number]: {\n spaceBetween: number\n freeMode: boolean\n slidesPerView: number\n }\n }\n metafields?: any\n isDisplayGudgments?: boolean\n isDisplayBackImage?: boolean\n\n /** \u52A0\u5165\u8D2D\u7269\u8F66\u56DE\u8C03 */\n onAddCart?: (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => void\n /** \u7ACB\u5373\u8D2D\u4E70\u56DE\u8C03 */\n onBuyNow?: (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => void\n /** \u4E86\u89E3\u66F4\u591A\u56DE\u8C03 */\n onLearnMore?: (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => void\n}\n"],
4
+ "sourcesContent": ["import Decimal from 'decimal.js'\nimport type { ContainerProps, CurrencyDisplayType } from '../../types/props.js'\n/* eslint-disable no-useless-escape */\nimport { PRICE_SYMBOL, formatPrice, languageTerritory } from '../../helpers/index.js'\n\nexport function formatVariantPrice({\n amount,\n baseAmount,\n currencyCode,\n currencyDisplay,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n}: {\n baseAmount: number\n amount: number\n currencyCode: string\n currencyDisplay?: CurrencyDisplayType\n locale: string\n maximumFractionDigits?: number\n minimumFractionDigits?: number\n removeTrailingZeros?: boolean\n}) {\n if (typeof Intl === 'undefined') {\n return {\n price: `${PRICE_SYMBOL[locale]}${amount}`,\n basePrice: `${PRICE_SYMBOL[locale]}${baseAmount}`,\n discount: `${PRICE_SYMBOL[locale]}${baseAmount - amount || 0}`,\n }\n }\n\n const hasDiscount = baseAmount > amount\n let discount = null\n const currentLocale = languageTerritory(locale)\n if (currentLocale) {\n const formatDiscount = new Intl.NumberFormat(currentLocale, {\n style: 'percent',\n })\n discount = hasDiscount ? formatDiscount.format((baseAmount - amount) / baseAmount) : null\n }\n // \u6298\u6263\u91D1\u989D\n let discountAmount\n if (hasDiscount) {\n const savePriceAmount = new Decimal(baseAmount).sub(amount || 0).toNumber()\n discountAmount = formatPrice({\n amount: savePriceAmount,\n currencyDisplay,\n currencyCode: currencyCode || 'USD',\n locale,\n maximumFractionDigits: 2,\n })\n }\n\n const price = formatPrice({ amount, currencyCode, currencyDisplay, locale, removeTrailingZeros })\n const basePrice = hasDiscount\n ? formatPrice({\n amount: baseAmount,\n currencyCode,\n currencyDisplay,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n })\n : undefined\n\n return { price, basePrice, discount, discountAmount }\n}\n\ntype EventType = {\n primaryButton?: (v: any, index: number, data: ShelfDisplayType, coupon: any) => void\n secondaryButton?: (v: any, index: number, data: ShelfDisplayType, coupon: any) => void\n}\n\nexport interface ShelfDisplayItem {\n custom_primary_link?: string\n custom_secondary_link?: string\n id?: string\n /** \u4EA7\u54C1\u56FE\u7247*/\n img?: {\n url: string\n }\n handle?: string\n sku?: string\n /** \u6298\u6263\u540E\u4EF7\u683C*/\n price?: string\n title?: string\n /** \u6298\u6263\u524D\u4EF7\u683C*/\n basePrice?: string\n subTitle?: string\n /** \u6807\u7B7E*/\n tagItems?: string[]\n tab?: string\n data?: ShelfDisplayItem[]\n custom_name?: string\n custom_description?: string\n custom_image?: string\n custom_theme?: string\n custom_bg_image?: string\n}\n\nexport type ShelfDisplayType = {\n title?: string\n isShowTab?: boolean\n isShowTag?: boolean\n isShowRecommendedCard?: boolean\n isShowOriginalPrice?: boolean\n direction?: 'horizontal' | 'vertical'\n align?: 'left' | 'center' | 'right'\n productsTab?: any[]\n productsCard?: any[]\n /** \u5361\u7247\u5F62\u72B6 */\n itemShape?: 'round' | 'square'\n /** \u6309\u94AE\u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u6807\u7B7E\u9875\u5F62\u72B6*/\n tabShape?: 'rounded' | 'square'\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: string\n primaryFun?: 'AddCart' | 'BuyNow' | 'LearnMore'\n /** \u526F\u6309\u94AE\u914D\u7F6E */\n secondaryButton?: string\n secondaryFun?: 'AddCart' | 'BuyNow' | 'LearnMore'\n theme?: 'light' | 'dark'\n containerProps?: ContainerProps\n}\n\nexport interface ShelfDisplayProps extends React.HTMLAttributes<HTMLDivElement> {\n data: ShelfDisplayType\n buildData?: {\n categories: any[]\n products: any[]\n }\n recommendedData?: any[]\n /**\n * \u6309\u94AE\u4E8B\u4EF6\n * @deprecated \u8BF7\u4F7F\u7528 onAddCart / onBuyNow / onLearnMore \u914D\u5408 primaryFun / secondaryFun \u66FF\u4EE3\n */\n event?: EventType\n key?: string\n target?: '_self' | '_blank'\n breakpoints?: {\n [key: number]: {\n spaceBetween: number\n freeMode: boolean\n slidesPerView: number\n }\n }\n metafields?: any\n isDisplayGudgments?: boolean\n isDisplayBackImage?: boolean\n\n /** \u52A0\u5165\u8D2D\u7269\u8F66\u56DE\u8C03 */\n onAddCart?: (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => void\n /** \u7ACB\u5373\u8D2D\u4E70\u56DE\u8C03 */\n onBuyNow?: (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => void\n /** \u4E86\u89E3\u66F4\u591A\u56DE\u8C03 */\n onLearnMore?: (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => void\n}\n"],
5
5
  "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAoB,yBAGpBC,EAA6D,kCAEtD,SAASH,EAAmB,CACjC,OAAAI,EACA,WAAAC,EACA,aAAAC,EACA,gBAAAC,EACA,OAAAC,EACA,sBAAAC,EACA,sBAAAC,EACA,oBAAAC,CACF,EASG,CACD,GAAI,OAAO,KAAS,IAClB,MAAO,CACL,MAAO,GAAG,eAAaH,CAAM,CAAC,GAAGJ,CAAM,GACvC,UAAW,GAAG,eAAaI,CAAM,CAAC,GAAGH,CAAU,GAC/C,SAAU,GAAG,eAAaG,CAAM,CAAC,GAAGH,EAAaD,GAAU,CAAC,EAC9D,EAGF,MAAMQ,EAAcP,EAAaD,EACjC,IAAIS,EAAW,KACf,MAAMC,KAAgB,qBAAkBN,CAAM,EAC9C,GAAIM,EAAe,CACjB,MAAMC,EAAiB,IAAI,KAAK,aAAaD,EAAe,CAC1D,MAAO,SACT,CAAC,EACDD,EAAWD,EAAcG,EAAe,QAAQV,EAAaD,GAAUC,CAAU,EAAI,IACvF,CAEA,IAAIW,EACJ,GAAIJ,EAAa,CACf,MAAMK,EAAkB,IAAI,EAAAC,QAAQb,CAAU,EAAE,IAAID,GAAU,CAAC,EAAE,SAAS,EAC1EY,KAAiB,eAAY,CAC3B,OAAQC,EACR,gBAAAV,EACA,aAAcD,GAAgB,MAC9B,OAAAE,EACA,sBAAuB,CACzB,CAAC,CACH,CAEA,MAAMW,KAAQ,eAAY,CAAE,OAAAf,EAAQ,aAAAE,EAAc,gBAAAC,EAAiB,OAAAC,EAAQ,oBAAAG,CAAoB,CAAC,EAC1FS,EAAYR,KACd,eAAY,CACV,OAAQP,EACR,aAAAC,EACA,gBAAAC,EACA,OAAAC,EACA,sBAAAC,EACA,sBAAAC,EACA,oBAAAC,CACF,CAAC,EACD,OAEJ,MAAO,CAAE,MAAAQ,EAAO,UAAAC,EAAW,SAAAP,EAAU,eAAAG,CAAe,CACtD",
6
6
  "names": ["shelfDisplay_exports", "__export", "formatVariantPrice", "__toCommonJS", "import_decimal", "import_helpers", "amount", "baseAmount", "currencyCode", "currencyDisplay", "locale", "maximumFractionDigits", "minimumFractionDigits", "removeTrailingZeros", "hasDiscount", "discount", "currentLocale", "formatDiscount", "discountAmount", "savePriceAmount", "Decimal", "price", "basePrice"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var he=Object.create;var J=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var ve=Object.getPrototypeOf,ge=Object.prototype.hasOwnProperty;var be=(e,t)=>{for(var p in t)J(e,p,{get:t[p],enumerable:!0})},fe=(e,t,p,x)=>{if(t&&typeof t=="object"||typeof t=="function")for(let h of ye(t))!ge.call(e,h)&&h!==p&&J(e,h,{get:()=>t[h],enumerable:!(x=xe(t,h))||x.enumerable});return e};var le=(e,t,p)=>(p=e!=null?he(ve(e)):{},fe(t||!e||!e.__esModule?J(p,"default",{value:e,enumerable:!0}):p,e)),ke=e=>fe(J({},"__esModule",{value:!0}),e);var Ne={};be(Ne,{ShelfDisplayHorizontalItem:()=>_e,ShelfDisplayWrapItem:()=>we,getProductImage:()=>ue});module.exports=ke(Ne);var s=require("react/jsx-runtime"),ie=require("../AiuiProvider/index.js"),ne=require("./shelfDisplay.js"),Y=le(require("../../components/picture.js")),Z=le(require("../../components/badge.js")),g=require("../../helpers/utils.js"),ae=require("../../components/text.js"),O=le(require("../../components/button.js")),ce=require("../../shared/track.js"),pe=require("../../shared/trackUrlRef.js"),me=require("../../components/heading.js"),de=require("../../hooks/useExposure.js"),f=require("react");const K="image",Q="product_shelf",X=999999999e-2,ue=e=>{const t=e?.sku,p=e?.variants,x=p?.find(S=>S?.sku===t),h=x?.image?.url||p?.[0]?.image?.url||"",I=x?.image?.altText||p?.[0]?.image?.altText||e?.custom_name||e?.title||"";return{imageUrl:h,altText:I}},we=({data:e,configuration:t})=>{const{isDisplayBackImage:p=!1,itemShape:x,metafields:h,isTopTag:I=!1,isShowTag:S,isShowOriginalPrice:U,isShowShortTitle:_=!1}=t||{},{locale:N="es",copyWriting:ee,currencyDisplay:z}=(0,ie.useAiuiContext)(),{discounts:H,discountsCopy:P}=h||{},E=(0,f.useRef)(null),[R,m]=(0,f.useState)([]),[L,te]=(0,f.useState)(""),V=(o,r,l,i)=>{const{primaryFun:c,onAddCart:u,onBuyNow:v,onLearnMore:W,event:re}=t||{};if(c){if(c==="AddCart"&&u)return u(o,r+1,l,i);if(c==="BuyNow"&&v)return v(o,r+1,l,i);if(c==="LearnMore"&&W)return W(o,r+1,l,i)}re?.primaryButton?.(o,r+1,l,i)},se=(o,r,l,i)=>{const{secondaryFun:c,onAddCart:u,onBuyNow:v,onLearnMore:W,event:re}=t||{};if(c){if(c==="AddCart"&&u)return u(o,r+1,l,i);if(c==="BuyNow"&&v)return v(o,r+1,l,i);if(c==="LearnMore"&&W)return W(o,r+1,l,i)}re?.secondaryButton?.(o,r+1,l,i)},d=(0,f.useMemo)(()=>{const o=e?.variants||[];if(o.length)return e?.sku?o?.find?.(r=>r?.sku===e?.sku)||o[0]:o?.[0]},[e?.sku,e?.variants]),y=d?.id?.split?.("/")||[],A=y?.[y?.length-1],T=!d?.availableForSale||d?.price?.amount===X||d?.price===X,b=d?.coupons?.[0],M=!!(U&&b),q=e?.price?.currencyCode||"USD",B=(0,f.useMemo)(()=>(0,ne.formatVariantPrice)({locale:N,amount:M?b?.variant_price4wscode:d?.price,baseAmount:M?d?.price:0,currencyCode:q,currencyDisplay:z}),[q,N,M,b?.variant_price4wscode,d]),{price:F,basePrice:oe,discount:C,discountAmount:k}=B,{imageUrl:$,altText:D}=ue(e),w=e?.custom_name||e?.title,j=_&&d?.metafields?.infos?.page_short_title||w,G=e?.custom_description||e?.description,n=()=>{if(b?.value_type==="fixed_amount"){const o=k||"",r=o.match(/^(.*?)(\d[\d.,]*)(.*)$/);if(r){const[,l,i,c]=r;let u=i;return i.endsWith(".00")?u=i.replace(/\.00$/,""):i.endsWith(",00")&&(u=i.replace(/,00$/,"")),`${l}${u}${c}`}return o}return C||""};(0,f.useEffect)(()=>{let o=[];if(C||k){const l=`${n()} ${H?.off||P?.off||""}`;te(l),o.push(l)}const r=e?.tags?.filter?.(l=>l?.startsWith?.("CLtag"))?.map?.(l=>l?.replace?.("CLtag:",""))?.slice?.(0,C?1:2);m(o.concat(r))},[e?.tags,C,k,H?.off,P?.off]),(0,de.useExposure)(E,{componentType:K,componentName:Q,componentTitle:w,componentDescription:G,position:t?.index+1});const a=()=>(0,s.jsxs)(s.Fragment,{children:[S&&R?.length>0?(0,s.jsx)("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:R?.map?.((o,r)=>(0,s.jsx)(Z.default,{className:"shelf-items-tag",children:o},r))}):null,j?(0,s.jsx)(me.Heading,{as:"h3",title:j||"",size:2,className:"shelf-display-product-title lg-desktop:h-[58px] line-clamp-2 h-12",html:j||""}):null,(0,s.jsx)(ae.Text,{size:2,className:"lg-desktop:text-lg desktop:h-[24px] lg-desktop:h-[28px] desktop:text-base shelf-display-product-description line-clamp-1 h-[20px] text-sm",html:G||""}),(0,s.jsx)("div",{className:"mb-2 mt-4 flex items-center",children:T?(0,s.jsx)("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:ee?.soldOutText}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"final-price tablet:text-2xl text-info-primary text-xl font-bold",children:d?.availableForSale&&F||""}),(0,s.jsx)("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:d?.availableForSale&&oe||""})]})}),(0,s.jsxs)("div",{className:(0,g.cn)("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?(0,s.jsx)(O.default,{disabled:T&&t?.secondaryFun!=="LearnMore",variant:"secondary",href:e?.custom_secondary_link,as:e?.custom_secondary_link?"a":"button",onClick:()=>!e?.custom_secondary_link&&se(e,t?.index,t,b),className:t.direction==="vertical"?"w-full":"",children:t?.secondaryButton||""}):null,t?.primaryButton?(0,s.jsx)(O.default,{disabled:T&&t?.primaryFun!=="LearnMore",variant:"primary",href:e?.custom_primary_link,as:e?.custom_primary_link?"a":"button",onClick:()=>!e?.custom_primary_link&&V(e,t?.index,t,b),className:t.direction==="vertical"?"w-full":"",children:t?.primaryButton||""}):null]})]});return(0,s.jsx)("div",{ref:E,className:(0,g.cn)("bg-background tablet:hover:bg-info-white box-border w-full cursor-pointer overflow-hidden duration-300",x==="round"?"rounded-2xl":"rounded-none","lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]","laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative","md-tablet:h-[360px] shelf-display-item"),children:p?(0,s.jsx)("div",{className:"absolute inset-0 box-border overflow-hidden",children:(0,s.jsxs)("div",{className:"relative inset-0 size-full",children:[(0,s.jsx)(Y.default,{source:$,alt:D,className:"flex h-full justify-center object-cover [&_img]:w-auto"}),(0,s.jsx)("div",{className:"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4",children:a()})]})}):(0,s.jsxs)("div",{className:"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4",children:[L&&I&&(0,s.jsx)(Z.default,{className:"shelf-prices-tag absolute left-4 top-4 z-10",children:L||""}),(0,s.jsx)("div",{className:(0,g.cn)("lg-desktop:h-[195px] shelf-display-item-image relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden"),children:(0,s.jsx)("a",{"aria-label":w,target:t?.target,href:(0,pe.trackUrlRef)(`${N==="us"||!N?"":`/${N}`}/products/${e?.handle}?variant=${A}`,`${K}_${Q}`),onClick:()=>{(0,ce.gaTrack)({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||d?.sku,item_name:e?.name,item_variant:d?.name,price:d?.price,index:t?.index+1}]}})},children:(0,s.jsx)(Y.default,{source:$,alt:D,className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),a()]})},e?.id||e?.handle)},_e=({data:e,configuration:t})=>{const{itemShape:p,itemLength:x,metafields:h,isShowShortTitle:I}=t||{},{discounts:S,discountsCopy:U}=h||{},{locale:_="us",copyWriting:N,currencyDisplay:ee}=(0,ie.useAiuiContext)(),[z,H]=(0,f.useState)([]),P=(0,f.useRef)(null),E=(n,a,o,r)=>{const{primaryFun:l,onAddCart:i,onBuyNow:c,onLearnMore:u,event:v}=t||{};if(l){if(l==="AddCart"&&i)return i(n,a+1,o,r);if(l==="BuyNow"&&c)return c(n,a+1,o,r);if(l==="LearnMore"&&u)return u(n,a+1,o,r)}v?.primaryButton?.(n,a+1,o,r)},R=(n,a,o,r)=>{const{secondaryFun:l,onAddCart:i,onBuyNow:c,onLearnMore:u,event:v}=t||{};if(l){if(l==="AddCart"&&i)return i(n,a+1,o,r);if(l==="BuyNow"&&c)return c(n,a+1,o,r);if(l==="LearnMore"&&u)return u(n,a+1,o,r)}v?.secondaryButton?.(n,a+1,o,r)},m=(0,f.useMemo)(()=>{const n=e?.variants||[];if(n.length)return e?.sku&&n.find(a=>a?.sku===e?.sku)||n[0]},[e?.sku,e?.variants]),L=m?.id?.split?.("/")||[],te=L?.[L?.length-1],V=!m?.availableForSale||m?.price?.amount===X||m?.price===X,se=t?.isShowTag,d=t?.isShowOriginalPrice,y=m?.coupons?.[0],A=!!(d&&y),T=e?.price?.currencyCode||"USD",b=(0,f.useMemo)(()=>(0,ne.formatVariantPrice)({locale:_,amount:A?y?.variant_price4wscode:m?.price,baseAmount:A?m?.price:0,currencyCode:T,currencyDisplay:ee}),[T,_,A,y?.variant_price4wscode,m]),{price:M,basePrice:q,discount:B,discountAmount:F}=b,{imageUrl:oe,altText:C}=ue(e),k=e?.custom_name||e?.title,$=I&&m?.metafields?.infos?.page_short_title||k,D=e?.custom_description||e?.description;(0,de.useExposure)(P,{componentType:K,componentName:Q,componentTitle:k,componentDescription:D,position:t?.index+1});const w=()=>x>=2?{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] max-w-full",imgItem:"m-tablet:m-auto lg-desktop:max-w-[330px] lg-desktop:max-h-[330px] desktop:max-w-[260px] desktop:max-h-[260px] max-w-[138px] max-h-[138px]",wrap:"lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480] desktop:aspect-w-[648] desktop:aspect-h-[380] laptop:aspect-w-[440] laptop:aspect-h-[356] tablet:aspect-w-[346] tablet:aspect-h-[360] md-tablet:w-full"}:{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] laptop:max-w-[289px] max-w-[262px]",imgItem:"md-tablet:m-auto lg-desktop:max-w-[450px] lg-desktop:max-h-[450px] desktop:max-w-[332px] desktop:max-h-[332px] max-w-[312px] max-h-[312px]",wrap:"lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[480] desktop:aspect-w-[1312] desktop:aspect-h-[380] laptop:aspect-w-[896] laptop:aspect-h-[356] tablet:aspect-w-[704] tablet:aspect-h-[360] md-tablet:w-full"},j=()=>x>=2?"flex flex-col justify-between desktop:gap-12 desktop:flex-row desktop:justify-center desktop:items-center":"flex justify-center items-center gap-6 md-tablet:flex-col",G=()=>{if(y?.value_type==="fixed_amount"){const n=F||"",a=n.match(/^(.*?)(\d[\d.,]*)(.*)$/);if(a){const[,o,r,l]=a;let i=r;return r.endsWith(".00")?i=r.replace(/\.00$/,""):r.endsWith(",00")&&(i=r.replace(/,00$/,"")),`${o}${i}${l}`}return n}return B||""};return(0,f.useEffect)(()=>{let n=[];if(B||F){const o=`${G()} ${S?.off||U?.off||""}`;n.push(o)}const a=e?.tags?.filter?.(o=>o?.startsWith?.("CLtag"))?.map?.(o=>o?.replace?.("CLtag:",""))?.slice?.(0,B?1:2);H(n.concat(a))},[e?.tags,B,F,S?.off,U?.off]),(0,s.jsx)("div",{ref:P,className:(0,g.cn)(w().wrap,p==="round"?"rounded-2xl":"rounded-none","shelf-display-item","bg-container-secondary-1 tablet:hover:bg-info-white gap-6 duration-300","md-tablet:h-[360px] relative box-border w-full cursor-pointer overflow-hidden"),children:(0,s.jsxs)("div",{className:(0,g.cn)(j(),"desktop:p-6 absolute inset-0 box-border overflow-hidden p-4"),children:[(0,s.jsx)("div",{className:(0,g.cn)(w().imgItem,"desktop:mb-0 relative mb-1 overflow-hidden"),children:(0,s.jsx)("a",{"aria-label":k,target:t?.target,href:(0,pe.trackUrlRef)(`${_==="us"||!_?"":`/${_}`}/products/${e?.handle}?variant=${te}`,`${K}_${Q}`),onClick:()=>{(0,ce.gaTrack)({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||m?.sku,item_name:e?.name,item_variant:m?.name,price:m?.price,index:t?.index+1}]}})},children:(0,s.jsx)(Y.default,{source:oe,alt:C,className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),(0,s.jsxs)("div",{className:(0,g.cn)("flex flex-col items-start justify-center",w().boxItem),children:[se&&(0,s.jsx)("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:z?.length>0&&z?.map?.((n,a)=>(0,s.jsx)(Z.default,{className:"shelf-items-tag",children:n},a))}),$?(0,s.jsx)(me.Heading,{as:"h3",title:$||"",size:2,className:"shelf-display-product-title lg-desktop:h-[58px] mb-1 line-clamp-2 h-[48px]",html:$||""}):null,D?(0,s.jsx)(ae.Text,{size:2,className:"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description line-clamp-1 h-5 text-sm",html:D||""}):null,(0,s.jsx)("div",{className:"mb-2 mt-5 flex items-center",children:V?(0,s.jsx)("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:N?.soldOutText}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"final-price tablet:text-2xl text-info-primary text-xl font-bold",children:m?.availableForSale&&M||""}),(0,s.jsx)("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:m?.availableForSale&&q||""})]})}),(0,s.jsxs)("div",{className:(0,g.cn)("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?(0,s.jsx)(O.default,{variant:"secondary",href:e?.custom_secondary_link,as:e?.custom_secondary_link?"a":"button",onClick:()=>!e?.custom_secondary_link&&R(e,t?.index,t,y),className:t.direction==="vertical"?"w-full":"",children:t?.secondaryButton||""}):null,t?.primaryButton?(0,s.jsx)(O.default,{disabled:V,variant:"primary",href:e?.custom_primary_link,as:e?.custom_primary_link?"a":"button",onClick:()=>!e?.custom_primary_link&&E(e,t?.index,t,y),className:t.direction==="vertical"?"w-full":"",children:t?.primaryButton||""}):null]})]})]})},e?.id||e?.handle)};
1
+ "use strict";var ye=Object.create;var Q=Object.defineProperty;var ge=Object.getOwnPropertyDescriptor;var ve=Object.getOwnPropertyNames;var be=Object.getPrototypeOf,ke=Object.prototype.hasOwnProperty;var we=(e,t)=>{for(var p in t)Q(e,p,{get:t[p],enumerable:!0})},xe=(e,t,p,x)=>{if(t&&typeof t=="object"||typeof t=="function")for(let h of ve(t))!ke.call(e,h)&&h!==p&&Q(e,h,{get:()=>t[h],enumerable:!(x=ge(t,h))||x.enumerable});return e};var ne=(e,t,p)=>(p=e!=null?ye(be(e)):{},xe(t||!e||!e.__esModule?Q(p,"default",{value:e,enumerable:!0}):p,e)),_e=e=>xe(Q({},"__esModule",{value:!0}),e);var Te={};we(Te,{ShelfDisplayHorizontalItem:()=>Se,ShelfDisplayWrapItem:()=>Ne,getProductImage:()=>he});module.exports=_e(Te);var s=require("react/jsx-runtime"),ae=require("../AiuiProvider/index.js"),ce=require("./shelfDisplay.js"),ee=ne(require("../../components/picture.js")),te=ne(require("../../components/badge.js")),y=require("../../helpers/utils.js"),pe=require("../../components/text.js"),U=ne(require("../../components/button.js")),me=require("../../shared/track.js"),de=require("../../shared/trackUrlRef.js"),ue=require("../../components/heading.js"),fe=require("../../hooks/useExposure.js"),f=require("react");const X="image",Y="product_shelf",Z=999999999e-2,he=e=>{const t=e?.sku,p=e?.variants,x=p?.find(S=>S?.sku===t),h=x?.image?.url||p?.[0]?.image?.url||"",P=x?.image?.altText||p?.[0]?.image?.altText||e?.custom_name||e?.title||"";return{imageUrl:h,altText:P}},Ne=({data:e,configuration:t})=>{const{isDisplayBackImage:p=!1,itemShape:x,metafields:h,isTopTag:P=!1,isShowTag:S,isShowOriginalPrice:z,isShowShortTitle:_=!1}=t||{},{locale:N="es",copyWriting:se,currencyDisplay:H}=(0,ae.useAiuiContext)(),{discounts:E,discountsCopy:L}=h||{},R=(0,f.useRef)(null),[V,m]=(0,f.useState)([]),[A,oe]=(0,f.useState)(""),q=(o,r,i,n)=>{const{primaryFun:c,onAddCart:u,onBuyNow:v,onLearnMore:O,event:le}=t||{};if(c){if(c==="AddCart"&&u)return u(o,r+1,i,n);if(c==="BuyNow"&&v)return v(o,r+1,i,n);if(c==="LearnMore"&&O)return O(o,r+1,i,n)}le?.primaryButton?.(o,r+1,i,n)},re=(o,r,i,n)=>{const{secondaryFun:c,onAddCart:u,onBuyNow:v,onLearnMore:O,event:le}=t||{};if(c){if(c==="AddCart"&&u)return u(o,r+1,i,n);if(c==="BuyNow"&&v)return v(o,r+1,i,n);if(c==="LearnMore"&&O)return O(o,r+1,i,n)}le?.secondaryButton?.(o,r+1,i,n)},d=(0,f.useMemo)(()=>{const o=e?.variants||[];if(o.length)return e?.sku?o?.find?.(r=>r?.sku===e?.sku)||o[0]:o?.[0]},[e?.sku,e?.variants]),g=d?.id?.split?.("/")||[],M=g?.[g?.length-1],T=!d?.availableForSale||d?.price?.amount===Z||d?.price===Z,b=d?.coupons?.[0],F=!!(z&&b),G=e?.price?.currencyCode||"USD",B=(0,f.useMemo)(()=>(0,ce.formatVariantPrice)({locale:N,amount:F?b?.variant_price4wscode:d?.price,baseAmount:F?d?.price:0,currencyCode:G,currencyDisplay:H}),[G,N,F,b?.variant_price4wscode,d]),{price:j,basePrice:ie,discount:C,discountAmount:k}=B,{imageUrl:$,altText:D}=he(e),w=e?.custom_name||e?.title,W=_&&d?.metafields?.infos?.page_short_title||w,J=e?.custom_description||e?.description,I=()=>{if(b?.value_type==="fixed_amount"){const o=k||"",r=o.match(/^(.*?)(\d[\d.,]*)(.*)$/);if(r){const[,i,n,c]=r;let u=n;return n.endsWith(".00")?u=n.replace(/\.00$/,""):n.endsWith(",00")&&(u=n.replace(/,00$/,"")),`${i}${u}${c}`}return o}return C||""};(0,f.useEffect)(()=>{let o=[];if(C||k){const i=`${I()} ${E?.off||L?.off||""}`;oe(i),o.push(i)}const r=e?.tags?.filter?.(i=>i?.startsWith?.("CLtag"))?.map?.(i=>i?.replace?.("CLtag:",""))?.slice?.(0,C?1:2);m(o.concat(r))},[e?.tags,C,k,E?.off,L?.off]),(0,fe.useExposure)(R,{componentType:X,componentName:Y,componentTitle:w,componentDescription:J,position:t?.index+1});const K=()=>(0,s.jsxs)(s.Fragment,{children:[S&&V?.length>0?(0,s.jsx)("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:V?.map?.((o,r)=>(0,s.jsx)(te.default,{className:"shelf-items-tag",children:o},r))}):null,W?(0,s.jsx)(ue.Heading,{as:"h3",title:W||"",size:2,className:"shelf-display-product-title lg-desktop:h-[58px] text-info-primary line-clamp-2 h-12",html:W||""}):null,(0,s.jsx)(pe.Text,{size:2,className:"lg-desktop:text-lg desktop:h-[24px] lg-desktop:h-[28px] desktop:text-base shelf-display-product-description text-info-primary line-clamp-1 h-[20px] text-sm",html:J||""}),(0,s.jsx)("div",{className:"mb-2 mt-4 flex items-center",children:T?(0,s.jsx)("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:se?.soldOutText}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"final-price tablet:text-xl text-info-primary text-xl font-bold",children:d?.availableForSale&&j||""}),(0,s.jsx)("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:d?.availableForSale&&ie||""})]})}),(0,s.jsxs)("div",{className:(0,y.cn)("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?(0,s.jsx)(U.default,{disabled:T&&t?.secondaryFun!=="LearnMore",variant:"secondary",href:e?.custom_secondary_link,as:e?.custom_secondary_link?"a":"button",onClick:()=>!e?.custom_secondary_link&&re(e,t?.index,t,b),className:t.direction==="vertical"?"w-full":"",children:t?.secondaryButton||""}):null,t?.primaryButton?(0,s.jsx)(U.default,{disabled:T&&t?.primaryFun!=="LearnMore",variant:"primary",href:e?.custom_primary_link,as:e?.custom_primary_link?"a":"button",onClick:()=>!e?.custom_primary_link&&q(e,t?.index,t,b),className:t.direction==="vertical"?"w-full":"",children:t?.primaryButton||""}):null]})]}),l=e?.custom_bg_image,a=e?.custom_theme;return(0,s.jsx)("div",{ref:R,className:(0,y.cn)("box-border w-full cursor-pointer overflow-hidden duration-300",x==="round"?"rounded-2xl":"rounded-none","lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]","laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative","md-tablet:h-[360px] shelf-display-item",l?"bg-cover bg-center bg-no-repeat":"bg-background tablet:hover:bg-info-white",{"aiui-dark":a==="dark"}),style:l?{backgroundImage:`url(${l})`}:void 0,children:p?(0,s.jsx)("div",{className:"absolute inset-0 box-border overflow-hidden",children:(0,s.jsxs)("div",{className:"relative inset-0 size-full",children:[(0,s.jsx)(ee.default,{source:$,alt:D,className:(0,y.cn)("flex h-full justify-center object-cover [&_img]:w-auto",{"opacity-0":l})}),(0,s.jsx)("div",{className:"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4",children:K()})]})}):(0,s.jsxs)("div",{className:"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4",children:[A&&P&&(0,s.jsx)(te.default,{className:"shelf-prices-tag absolute left-4 top-4 z-10",children:A||""}),(0,s.jsx)("div",{className:(0,y.cn)("lg-desktop:h-[195px] shelf-display-item-image relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden",{"opacity-0":l}),children:(0,s.jsx)("a",{"aria-label":w,target:t?.target,href:(0,de.trackUrlRef)(`${N==="us"||!N?"":`/${N}`}/products/${e?.handle}?variant=${M}`,`${X}_${Y}`),onClick:()=>{(0,me.gaTrack)({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||d?.sku,item_name:e?.name,item_variant:d?.name,price:d?.price,index:t?.index+1}]}})},children:(0,s.jsx)(ee.default,{source:$,alt:D,className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),K()]})},e?.id||e?.handle)},Se=({data:e,configuration:t})=>{const{itemShape:p,itemLength:x,metafields:h,isShowShortTitle:P}=t||{},{discounts:S,discountsCopy:z}=h||{},{locale:_="us",copyWriting:N,currencyDisplay:se}=(0,ae.useAiuiContext)(),[H,E]=(0,f.useState)([]),L=(0,f.useRef)(null),R=(l,a,o,r)=>{const{primaryFun:i,onAddCart:n,onBuyNow:c,onLearnMore:u,event:v}=t||{};if(i){if(i==="AddCart"&&n)return n(l,a+1,o,r);if(i==="BuyNow"&&c)return c(l,a+1,o,r);if(i==="LearnMore"&&u)return u(l,a+1,o,r)}v?.primaryButton?.(l,a+1,o,r)},V=(l,a,o,r)=>{const{secondaryFun:i,onAddCart:n,onBuyNow:c,onLearnMore:u,event:v}=t||{};if(i){if(i==="AddCart"&&n)return n(l,a+1,o,r);if(i==="BuyNow"&&c)return c(l,a+1,o,r);if(i==="LearnMore"&&u)return u(l,a+1,o,r)}v?.secondaryButton?.(l,a+1,o,r)},m=(0,f.useMemo)(()=>{const l=e?.variants||[];if(l.length)return e?.sku&&l.find(a=>a?.sku===e?.sku)||l[0]},[e?.sku,e?.variants]),A=m?.id?.split?.("/")||[],oe=A?.[A?.length-1],q=!m?.availableForSale||m?.price?.amount===Z||m?.price===Z,re=t?.isShowTag,d=t?.isShowOriginalPrice,g=m?.coupons?.[0],M=!!(d&&g),T=e?.price?.currencyCode||"USD",b=(0,f.useMemo)(()=>(0,ce.formatVariantPrice)({locale:_,amount:M?g?.variant_price4wscode:m?.price,baseAmount:M?m?.price:0,currencyCode:T,currencyDisplay:se}),[T,_,M,g?.variant_price4wscode,m]),{price:F,basePrice:G,discount:B,discountAmount:j}=b,{imageUrl:ie,altText:C}=he(e),k=e?.custom_name||e?.title,$=P&&m?.metafields?.infos?.page_short_title||k,D=e?.custom_description||e?.description;(0,fe.useExposure)(L,{componentType:X,componentName:Y,componentTitle:k,componentDescription:D,position:t?.index+1});const w=()=>x>=2?{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] max-w-full",imgItem:"m-tablet:m-auto lg-desktop:max-w-[330px] lg-desktop:max-h-[330px] desktop:max-w-[260px] desktop:max-h-[260px] max-w-[138px] max-h-[138px]",wrap:"lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480] desktop:aspect-w-[648] desktop:aspect-h-[380] laptop:aspect-w-[440] laptop:aspect-h-[356] tablet:aspect-w-[346] tablet:aspect-h-[360] md-tablet:w-full"}:{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] laptop:max-w-[289px] max-w-[262px]",imgItem:"md-tablet:m-auto lg-desktop:max-w-[450px] lg-desktop:max-h-[450px] desktop:max-w-[332px] desktop:max-h-[332px] max-w-[312px] max-h-[312px]",wrap:"lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[480] desktop:aspect-w-[1312] desktop:aspect-h-[380] laptop:aspect-w-[896] laptop:aspect-h-[356] tablet:aspect-w-[704] tablet:aspect-h-[360] md-tablet:w-full"},W=()=>x>=2?"flex flex-col justify-between desktop:gap-12 desktop:flex-row desktop:justify-center desktop:items-center":"flex justify-center items-center gap-6 md-tablet:flex-col",J=()=>{if(g?.value_type==="fixed_amount"){const l=j||"",a=l.match(/^(.*?)(\d[\d.,]*)(.*)$/);if(a){const[,o,r,i]=a;let n=r;return r.endsWith(".00")?n=r.replace(/\.00$/,""):r.endsWith(",00")&&(n=r.replace(/,00$/,"")),`${o}${n}${i}`}return l}return B||""};(0,f.useEffect)(()=>{let l=[];if(B||j){const o=`${J()} ${S?.off||z?.off||""}`;l.push(o)}const a=e?.tags?.filter?.(o=>o?.startsWith?.("CLtag"))?.map?.(o=>o?.replace?.("CLtag:",""))?.slice?.(0,B?1:2);E(l.concat(a))},[e?.tags,B,j,S?.off,z?.off]);const I=e?.custom_bg_image,K=e?.custom_theme;return(0,s.jsx)("div",{ref:L,className:(0,y.cn)(w().wrap,p==="round"?"rounded-2xl":"rounded-none","shelf-display-item","duration-300","md-tablet:h-[360px] relative box-border w-full cursor-pointer overflow-hidden",I?"bg-cover bg-center bg-no-repeat":"bg-container-secondary-1 tablet:hover:bg-info-white",{"aiui-dark":K==="dark"}),style:I?{backgroundImage:`url(${I})`}:void 0,children:(0,s.jsxs)("div",{className:(0,y.cn)(W(),"desktop:p-6 absolute inset-0 box-border overflow-hidden p-4"),children:[(0,s.jsx)("div",{className:(0,y.cn)(w().imgItem,"desktop:mb-0 relative mb-1 overflow-hidden",{"opacity-0":I}),children:(0,s.jsx)("a",{"aria-label":k,target:t?.target,href:(0,de.trackUrlRef)(`${_==="us"||!_?"":`/${_}`}/products/${e?.handle}?variant=${oe}`,`${X}_${Y}`),onClick:()=>{(0,me.gaTrack)({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||m?.sku,item_name:e?.name,item_variant:m?.name,price:m?.price,index:t?.index+1}]}})},children:(0,s.jsx)(ee.default,{source:ie,alt:C,className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),(0,s.jsxs)("div",{className:(0,y.cn)("flex flex-col items-start justify-center",w().boxItem),children:[re&&(0,s.jsx)("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:H?.length>0&&H?.map?.((l,a)=>(0,s.jsx)(te.default,{className:"shelf-items-tag",children:l},a))}),$?(0,s.jsx)(ue.Heading,{as:"h3",title:$||"",size:2,className:"shelf-display-product-title lg-desktop:h-[58px] text-info-primary mb-1 line-clamp-2 h-[48px]",html:$||""}):null,D?(0,s.jsx)(pe.Text,{size:2,className:"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description text-info-primary line-clamp-1 h-5 text-sm",html:D||""}):null,(0,s.jsx)("div",{className:"mb-2 mt-5 flex items-center",children:q?(0,s.jsx)("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:N?.soldOutText}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"final-price tablet:text-xl text-info-primary text-xl font-bold",children:m?.availableForSale&&F||""}),(0,s.jsx)("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:m?.availableForSale&&G||""})]})}),(0,s.jsxs)("div",{className:(0,y.cn)("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?(0,s.jsx)(U.default,{variant:"secondary",href:e?.custom_secondary_link,as:e?.custom_secondary_link?"a":"button",onClick:()=>!e?.custom_secondary_link&&V(e,t?.index,t,g),className:t.direction==="vertical"?"w-full":"",children:t?.secondaryButton||""}):null,t?.primaryButton?(0,s.jsx)(U.default,{disabled:q,variant:"primary",href:e?.custom_primary_link,as:e?.custom_primary_link?"a":"button",onClick:()=>!e?.custom_primary_link&&R(e,t?.index,t,g),className:t.direction==="vertical"?"w-full":"",children:t?.primaryButton||""}):null]})]})]})},e?.id||e?.handle)};
2
2
  //# sourceMappingURL=shelfDisplayItem.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/ShelfDisplay/shelfDisplayItem.tsx"],
4
- "sourcesContent": ["import { useAiuiContext } from '../AiuiProvider/index.js'\nimport { formatVariantPrice } from './shelfDisplay.js'\nimport Picture from '../../components/picture.js'\nimport Badge from '../../components/badge.js'\nimport { cn } from '../../helpers/utils.js'\nimport { Text } from '../../components/text.js'\nimport Button from '../../components/button.js'\nimport { gaTrack } from '../../shared/track.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { Heading } from '../../components/heading.js'\nimport type { ShelfDisplayItem, ShelfDisplayType } from './shelfDisplay.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useRef, useEffect, useMemo, useState } from 'react'\n\nconst componentType = 'image'\nconst componentName = 'product_shelf'\n\nconst SOLD_OUT_PRICE = 9999999.99\n\n// \u516C\u5171\u51FD\u6570\uFF1A\u83B7\u53D6\u4EA7\u54C1\u56FE\u7247URL\u548CaltText\nexport const getProductImage = (data: any) => {\n const sku = data?.sku\n const skuArray = data?.variants\n const findSku = skuArray?.find((item: any) => item?.sku === sku)\n const imageUrl = findSku?.image?.url || skuArray?.[0]?.image?.url || ''\n const altText = findSku?.image?.altText || skuArray?.[0]?.image?.altText || data?.custom_name || data?.title || ''\n\n return {\n imageUrl,\n altText,\n }\n}\n\nexport const ShelfDisplayWrapItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const {\n isDisplayBackImage = false,\n itemShape,\n metafields,\n isTopTag = false,\n isShowTag,\n isShowOriginalPrice,\n isShowShortTitle = false,\n } = configuration || {}\n const { locale = 'es', copyWriting, currencyDisplay } = useAiuiContext()\n const { discounts, discountsCopy } = metafields || {}\n const ref = useRef<HTMLDivElement>(null)\n const [showTags, setShowTags] = useState<string[]>([])\n const [currentPriceTag, setCurrentPriceTag] = useState<string>('')\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => {\n const { primaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E primaryFun \u503C\uFF09\n if (primaryFun) {\n if (primaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (primaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (primaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.primaryButton?.(params, index + 1, data, coupon)\n }\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => {\n const { secondaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E secondaryFun \u503C\uFF09\n if (secondaryFun) {\n if (secondaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.secondaryButton?.(params, index + 1, data, coupon)\n }\n\n const variant = useMemo(() => {\n const variants = data?.variants || []\n if (!variants.length) {\n return undefined\n }\n if (!data?.sku) {\n return variants?.[0]\n }\n return variants?.find?.((item: any) => item?.sku === data?.sku) || variants[0]\n }, [data?.sku, data?.variants])\n\n const variantArr = variant?.id?.split?.('/') || []\n const variantId = variantArr?.[variantArr?.length - 1]\n\n const isSoldOut =\n !variant?.availableForSale || variant?.price?.amount === SOLD_OUT_PRICE || variant?.price === SOLD_OUT_PRICE\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n\n const shouldUseCouponPrice = Boolean(isShowOriginalPrice && coupon)\n const currencyCode = data?.price?.currencyCode || 'USD'\n\n const priceInfo = useMemo(\n () =>\n formatVariantPrice({\n locale,\n amount: shouldUseCouponPrice ? coupon?.variant_price4wscode : variant?.price,\n baseAmount: shouldUseCouponPrice ? variant?.price : 0,\n currencyCode,\n currencyDisplay,\n }),\n [currencyCode, locale, shouldUseCouponPrice, coupon?.variant_price4wscode, variant]\n )\n\n const { price, basePrice, discount, discountAmount } = priceInfo\n\n const { imageUrl, altText } = getProductImage(data)\n\n const displayTitle = data?.custom_name || data?.title\n const currentDisplayTitle = isShowShortTitle\n ? variant?.metafields?.infos?.page_short_title || displayTitle\n : displayTitle\n const displayDescription = data?.custom_description || data?.description\n\n const showPrice = () => {\n if (coupon?.value_type === 'fixed_amount') {\n const amountStr = discountAmount || ''\n const match = amountStr.match(/^(.*?)(\\d[\\d.,]*)(.*)$/)\n if (match) {\n const [, prefix, numeric, suffix] = match\n let updatedNumeric = numeric\n if (numeric.endsWith('.00')) {\n updatedNumeric = numeric.replace(/\\.00$/, '')\n } else if (numeric.endsWith(',00')) {\n updatedNumeric = numeric.replace(/,00$/, '')\n }\n return `${prefix}${updatedNumeric}${suffix}`\n }\n return amountStr\n }\n return discount || ''\n }\n\n // \u5904\u7406\u6807\u7B7E\n useEffect(() => {\n let handleTags: string[] = []\n if (discount || discountAmount) {\n const discountTag = `${showPrice()} ${discounts?.off || discountsCopy?.off || ''}`\n setCurrentPriceTag(discountTag)\n handleTags.push(discountTag)\n }\n const newTags = data?.tags\n ?.filter?.((item: string) => item?.startsWith?.('CLtag'))\n ?.map?.((item: string) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, discount ? 1 : 2)\n setShowTags(handleTags.concat(newTags))\n }, [data?.tags, discount, discountAmount, discounts?.off, discountsCopy?.off])\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: displayTitle,\n componentDescription: displayDescription,\n position: configuration?.index + 1,\n })\n\n const bottomContent = () => {\n return (\n <>\n {isShowTag && showTags?.length > 0 ? (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {showTags?.map?.((item: any, index: number) => (\n <Badge key={index} className=\"shelf-items-tag\">\n {item}\n </Badge>\n ))}\n </div>\n ) : null}\n {currentDisplayTitle ? (\n <Heading\n as=\"h3\"\n title={currentDisplayTitle || ''}\n size={2}\n className=\"shelf-display-product-title lg-desktop:h-[58px] line-clamp-2 h-12\"\n html={currentDisplayTitle || ''}\n />\n ) : null}\n <Text\n size={2}\n className=\"lg-desktop:text-lg desktop:h-[24px] lg-desktop:h-[28px] desktop:text-base shelf-display-product-description line-clamp-1 h-[20px] text-sm\"\n html={displayDescription || ''}\n />\n <div className=\"mb-2 mt-4 flex items-center\">\n {isSoldOut ? (\n <div className=\"tablet:text-2xl text-info-primary text-xl font-bold\">{copyWriting?.soldOutText}</div>\n ) : (\n <>\n <div className=\"final-price tablet:text-2xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n <div className=\"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through\">\n {variant?.availableForSale ? basePrice || '' : ''}\n </div>\n </>\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn(\n 'shelf-flex-button-group',\n 'lg-desktop:gap-3 flex items-center gap-2',\n configuration.direction === 'vertical' ? 'flex-col' : ''\n )}\n >\n {configuration?.secondaryButton ? (\n <Button\n disabled={isSoldOut && configuration?.secondaryFun !== 'LearnMore'}\n variant=\"secondary\"\n href={data?.custom_secondary_link}\n as={data?.custom_secondary_link ? 'a' : 'button'}\n onClick={() =>\n !data?.custom_secondary_link && onSecondaryButton(data, configuration?.index, configuration, coupon)\n }\n className={configuration.direction === 'vertical' ? 'w-full' : ''}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n disabled={isSoldOut && configuration?.primaryFun !== 'LearnMore'}\n variant=\"primary\"\n href={data?.custom_primary_link}\n as={data?.custom_primary_link ? 'a' : 'button'}\n onClick={() =>\n !data?.custom_primary_link && onPrimaryButton(data, configuration?.index, configuration, coupon)\n }\n className={configuration.direction === 'vertical' ? 'w-full' : ''}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) : null}\n </div>\n </>\n )\n }\n\n return (\n <div\n ref={ref}\n key={data?.id || data?.handle}\n className={cn(\n 'bg-background tablet:hover:bg-info-white box-border w-full cursor-pointer overflow-hidden duration-300',\n itemShape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative',\n 'md-tablet:h-[360px] shelf-display-item'\n )}\n >\n {isDisplayBackImage ? (\n <div className=\"absolute inset-0 box-border overflow-hidden\">\n <div className=\"relative inset-0 size-full\">\n <Picture\n source={imageUrl}\n alt={altText}\n className=\"flex h-full justify-center object-cover [&_img]:w-auto\"\n />\n <div className=\"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4\">\n {bottomContent()}\n </div>\n </div>\n </div>\n ) : (\n <div className=\"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4\">\n {currentPriceTag && isTopTag && (\n <Badge className=\"shelf-prices-tag absolute left-4 top-4 z-10\">{currentPriceTag || ''}</Badge>\n )}\n <div\n className={cn(\n 'lg-desktop:h-[195px] shelf-display-item-image relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden'\n )}\n >\n <a\n aria-label={displayTitle}\n target={configuration?.target}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}?variant=${variantId}`,\n `${componentType}_${componentName}`\n )}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'select_item',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: [\n {\n item_id: data?.sku || variant?.sku,\n item_name: data?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: configuration?.index + 1,\n },\n ],\n },\n })\n }}\n >\n <Picture\n source={imageUrl}\n alt={altText}\n className=\"flex h-full justify-center object-cover [&_img]:w-auto\"\n />\n </a>\n </div>\n {bottomContent()}\n </div>\n )}\n </div>\n )\n}\n\nexport const ShelfDisplayHorizontalItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const { itemShape, itemLength, metafields, isShowShortTitle } = configuration || {}\n const { discounts, discountsCopy } = metafields || {}\n const { locale = 'us', copyWriting, currencyDisplay } = useAiuiContext()\n const [showTags, setShowTags] = useState<string[]>([])\n const ref = useRef<HTMLDivElement>(null)\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => {\n const { primaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E primaryFun \u503C\uFF09\n if (primaryFun) {\n if (primaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (primaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (primaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.primaryButton?.(params, index + 1, data, coupon)\n }\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => {\n const { secondaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E secondaryFun \u503C\uFF09\n if (secondaryFun) {\n if (secondaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.secondaryButton?.(params, index + 1, data, coupon)\n }\n\n const variant = useMemo(() => {\n const variants = data?.variants || []\n if (!variants.length) {\n return undefined\n }\n if (!data?.sku) {\n return variants[0]\n }\n return variants.find((item: any) => item?.sku === data?.sku) || variants[0]\n }, [data?.sku, data?.variants])\n\n const variantArr = variant?.id?.split?.('/') || []\n const variantId = variantArr?.[variantArr?.length - 1]\n\n const isSoldOut =\n !variant?.availableForSale || variant?.price?.amount === SOLD_OUT_PRICE || variant?.price === SOLD_OUT_PRICE\n const isShowTag = configuration?.isShowTag\n const isShowOriginalPrice = configuration?.isShowOriginalPrice\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n\n const shouldUseCouponPrice = Boolean(isShowOriginalPrice && coupon)\n const currencyCode = data?.price?.currencyCode || 'USD'\n\n const priceInfo = useMemo(\n () =>\n formatVariantPrice({\n locale,\n amount: shouldUseCouponPrice ? coupon?.variant_price4wscode : variant?.price,\n baseAmount: shouldUseCouponPrice ? variant?.price : 0,\n currencyCode,\n currencyDisplay,\n }),\n [currencyCode, locale, shouldUseCouponPrice, coupon?.variant_price4wscode, variant]\n )\n\n const { price, basePrice, discount, discountAmount } = priceInfo\n\n const { imageUrl, altText } = getProductImage(data)\n\n const displayTitle = data?.custom_name || data?.title\n const currentDisplayTitle = isShowShortTitle\n ? variant?.metafields?.infos?.page_short_title || displayTitle\n : displayTitle\n const displayDescription = data?.custom_description || data?.description\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: displayTitle,\n componentDescription: displayDescription,\n position: configuration?.index + 1,\n })\n\n const showSizeClass = (): {\n boxItem: string\n imgItem: string\n wrap: string\n } => {\n if (itemLength >= 2) {\n return {\n boxItem: 'lg-desktop:max-w-[401px] desktop:max-w-[292px] max-w-full',\n imgItem:\n 'm-tablet:m-auto lg-desktop:max-w-[330px] lg-desktop:max-h-[330px] desktop:max-w-[260px] desktop:max-h-[260px] max-w-[138px] max-h-[138px]',\n wrap: 'lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480] desktop:aspect-w-[648] desktop:aspect-h-[380] laptop:aspect-w-[440] laptop:aspect-h-[356] tablet:aspect-w-[346] tablet:aspect-h-[360] md-tablet:w-full',\n }\n }\n return {\n boxItem: 'lg-desktop:max-w-[401px] desktop:max-w-[292px] laptop:max-w-[289px] max-w-[262px]',\n imgItem:\n 'md-tablet:m-auto lg-desktop:max-w-[450px] lg-desktop:max-h-[450px] desktop:max-w-[332px] desktop:max-h-[332px] max-w-[312px] max-h-[312px]',\n wrap: 'lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[480] desktop:aspect-w-[1312] desktop:aspect-h-[380] laptop:aspect-w-[896] laptop:aspect-h-[356] tablet:aspect-w-[704] tablet:aspect-h-[360] md-tablet:w-full',\n }\n }\n\n const handleWrapClass = () => {\n if (itemLength >= 2) {\n return 'flex flex-col justify-between desktop:gap-12 desktop:flex-row desktop:justify-center desktop:items-center'\n }\n return 'flex justify-center items-center gap-6 md-tablet:flex-col'\n }\n\n const showPrice = () => {\n if (coupon?.value_type === 'fixed_amount') {\n const amountStr = discountAmount || ''\n const match = amountStr.match(/^(.*?)(\\d[\\d.,]*)(.*)$/)\n if (match) {\n const [, prefix, numeric, suffix] = match\n let updatedNumeric = numeric\n if (numeric.endsWith('.00')) {\n updatedNumeric = numeric.replace(/\\.00$/, '')\n } else if (numeric.endsWith(',00')) {\n updatedNumeric = numeric.replace(/,00$/, '')\n }\n return `${prefix}${updatedNumeric}${suffix}`\n }\n return amountStr\n }\n return discount || ''\n }\n\n // \u5904\u7406\u6807\u7B7E\n useEffect(() => {\n let handleTags: string[] = []\n if (discount || discountAmount) {\n const discountTag = `${showPrice()} ${discounts?.off || discountsCopy?.off || ''}`\n handleTags.push(discountTag)\n }\n const newTags = data?.tags\n ?.filter?.((item: string) => item?.startsWith?.('CLtag'))\n ?.map?.((item: string) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, discount ? 1 : 2)\n setShowTags(handleTags.concat(newTags))\n }, [data?.tags, discount, discountAmount, discounts?.off, discountsCopy?.off])\n\n return (\n <div\n ref={ref}\n key={data?.id || data?.handle}\n className={cn(\n showSizeClass().wrap,\n itemShape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'shelf-display-item',\n 'bg-container-secondary-1 tablet:hover:bg-info-white gap-6 duration-300',\n 'md-tablet:h-[360px] relative box-border w-full cursor-pointer overflow-hidden'\n )}\n >\n <div className={cn(handleWrapClass(), 'desktop:p-6 absolute inset-0 box-border overflow-hidden p-4')}>\n <div className={cn(showSizeClass().imgItem, 'desktop:mb-0 relative mb-1 overflow-hidden')}>\n <a\n aria-label={displayTitle}\n target={configuration?.target}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}?variant=${variantId}`,\n `${componentType}_${componentName}`\n )}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'select_item',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: [\n {\n item_id: data?.sku || variant?.sku,\n item_name: data?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: configuration?.index + 1,\n },\n ],\n },\n })\n }}\n >\n <Picture\n source={imageUrl}\n alt={altText}\n className=\"flex h-full justify-center object-cover [&_img]:w-auto\"\n />\n </a>\n </div>\n <div className={cn('flex flex-col items-start justify-center', showSizeClass().boxItem)}>\n {isShowTag && (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {showTags?.length > 0 &&\n showTags?.map?.((item: any, index: number) => (\n <Badge key={index} className=\"shelf-items-tag\">\n {item}\n </Badge>\n ))}\n </div>\n )}\n {currentDisplayTitle ? (\n <Heading\n as=\"h3\"\n title={currentDisplayTitle || ''}\n size={2}\n className=\"shelf-display-product-title lg-desktop:h-[58px] mb-1 line-clamp-2 h-[48px]\"\n html={currentDisplayTitle || ''}\n />\n ) : null}\n {displayDescription ? (\n <Text\n size={2}\n className=\"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description line-clamp-1 h-5 text-sm\"\n html={displayDescription || ''}\n />\n ) : null}\n <div className=\"mb-2 mt-5 flex items-center\">\n {isSoldOut ? (\n <div className=\"tablet:text-2xl text-info-primary text-xl font-bold\">{copyWriting?.soldOutText}</div>\n ) : (\n <>\n <div className=\"final-price tablet:text-2xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n <div className=\"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through\">\n {variant?.availableForSale ? basePrice || '' : ''}\n </div>\n </>\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn(\n 'shelf-flex-button-group',\n 'lg-desktop:gap-3 flex items-center gap-2',\n configuration.direction === 'vertical' ? 'flex-col' : ''\n )}\n >\n {configuration?.secondaryButton ? (\n <Button\n variant=\"secondary\"\n href={data?.custom_secondary_link}\n as={data?.custom_secondary_link ? 'a' : 'button'}\n onClick={() =>\n !data?.custom_secondary_link && onSecondaryButton(data, configuration?.index, configuration, coupon)\n }\n className={configuration.direction === 'vertical' ? 'w-full' : ''}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n disabled={isSoldOut}\n variant=\"primary\"\n href={data?.custom_primary_link}\n as={data?.custom_primary_link ? 'a' : 'button'}\n onClick={() =>\n !data?.custom_primary_link && onPrimaryButton(data, configuration?.index, configuration, coupon)\n }\n className={configuration.direction === 'vertical' ? 'w-full' : ''}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) : null}\n </div>\n </div>\n </div>\n </div>\n )\n}\n"],
5
- "mappings": "0kBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,gCAAAE,GAAA,yBAAAC,GAAA,oBAAAC,KAAA,eAAAC,GAAAL,IAsLc,IAAAM,EAAA,6BAtLdC,GAA+B,oCAC/BC,GAAmC,6BACnCC,EAAoB,2CACpBC,EAAkB,yCAClBC,EAAmB,kCACnBC,GAAqB,oCACrBC,EAAmB,0CACnBC,GAAwB,iCACxBC,GAA4B,uCAC5BC,GAAwB,uCAExBC,GAA4B,sCAC5BC,EAAqD,iBAErD,MAAMC,EAAgB,QAChBC,EAAgB,gBAEhBC,EAAiB,aAGVjB,GAAmBkB,GAAc,CAC5C,MAAMC,EAAMD,GAAM,IACZE,EAAWF,GAAM,SACjBG,EAAUD,GAAU,KAAME,GAAcA,GAAM,MAAQH,CAAG,EACzDI,EAAWF,GAAS,OAAO,KAAOD,IAAW,CAAC,GAAG,OAAO,KAAO,GAC/DI,EAAUH,GAAS,OAAO,SAAWD,IAAW,CAAC,GAAG,OAAO,SAAWF,GAAM,aAAeA,GAAM,OAAS,GAEhH,MAAO,CACL,SAAAK,EACA,QAAAC,CACF,CACF,EAEazB,GAAuB,CAAC,CAAE,KAAAmB,EAAM,cAAAO,CAAc,IAA0C,CACnG,KAAM,CACJ,mBAAAC,EAAqB,GACrB,UAAAC,EACA,WAAAC,EACA,SAAAC,EAAW,GACX,UAAAC,EACA,oBAAAC,EACA,iBAAAC,EAAmB,EACrB,EAAIP,GAAiB,CAAC,EAChB,CAAE,OAAAQ,EAAS,KAAM,YAAAC,GAAa,gBAAAC,CAAgB,KAAI,mBAAe,EACjE,CAAE,UAAAC,EAAW,cAAAC,CAAc,EAAIT,GAAc,CAAC,EAC9CU,KAAM,UAAuB,IAAI,EACjC,CAACC,EAAUC,CAAW,KAA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ACV,QAAQ,UACR,KAAMxC,GAAM,oBACZ,GAAIA,GAAM,oBAAsB,IAAM,SACtC,QAAS,IACP,CAACA,GAAM,qBAAuByB,EAAgBzB,EAAMO,GAAe,MAAOA,EAAeqB,CAAM,EAEjG,UAAWrB,EAAc,YAAc,WAAa,SAAW,GAE9D,SAAAA,GAAe,eAAiB,GACnC,EACE,MACN,GACF,GACF,GA3HKP,GAAM,IAAMA,GAAM,MA4HzB,CAEJ",
6
- "names": ["shelfDisplayItem_exports", "__export", "ShelfDisplayHorizontalItem", "ShelfDisplayWrapItem", "getProductImage", "__toCommonJS", "import_jsx_runtime", "import_AiuiProvider", "import_shelfDisplay", "import_picture", "import_badge", "import_utils", "import_text", "import_button", "import_track", "import_trackUrlRef", "import_heading", "import_useExposure", "import_react", "componentType", "componentName", "SOLD_OUT_PRICE", "data", "sku", "skuArray", "findSku", "item", "imageUrl", "altText", "configuration", "isDisplayBackImage", "itemShape", "metafields", "isTopTag", "isShowTag", "isShowOriginalPrice", "isShowShortTitle", "locale", "copyWriting", "currencyDisplay", "discounts", "discountsCopy", "ref", "showTags", "setShowTags", "currentPriceTag", "setCurrentPriceTag", "onPrimaryButton", "params", "index", "coupon", "primaryFun", "onAddCart", "onBuyNow", "onLearnMore", "event", "onSecondaryButton", "secondaryFun", "variant", "variants", "variantArr", "variantId", "isSoldOut", "shouldUseCouponPrice", "currencyCode", "priceInfo", "price", "basePrice", "discount", "discountAmount", "displayTitle", "currentDisplayTitle", "displayDescription", "showPrice", "amountStr", "match", "prefix", "numeric", "suffix", "updatedNumeric", "handleTags", "discountTag", "newTags", "bottomContent", "Badge", "Button", "Picture", "itemLength", "showSizeClass", "handleWrapClass"]
4
+ "sourcesContent": ["import { useAiuiContext } from '../AiuiProvider/index.js'\nimport { formatVariantPrice } from './shelfDisplay.js'\nimport Picture from '../../components/picture.js'\nimport Badge from '../../components/badge.js'\nimport { cn } from '../../helpers/utils.js'\nimport { Text } from '../../components/text.js'\nimport Button from '../../components/button.js'\nimport { gaTrack } from '../../shared/track.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { Heading } from '../../components/heading.js'\nimport type { ShelfDisplayItem, ShelfDisplayType } from './shelfDisplay.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useRef, useEffect, useMemo, useState } from 'react'\n\nconst componentType = 'image'\nconst componentName = 'product_shelf'\n\nconst SOLD_OUT_PRICE = 9999999.99\n\n// \u516C\u5171\u51FD\u6570\uFF1A\u83B7\u53D6\u4EA7\u54C1\u56FE\u7247URL\u548CaltText\nexport const getProductImage = (data: any) => {\n const sku = data?.sku\n const skuArray = data?.variants\n const findSku = skuArray?.find((item: any) => item?.sku === sku)\n const imageUrl = findSku?.image?.url || skuArray?.[0]?.image?.url || ''\n const altText = findSku?.image?.altText || skuArray?.[0]?.image?.altText || data?.custom_name || data?.title || ''\n\n return {\n imageUrl,\n altText,\n }\n}\n\nexport const ShelfDisplayWrapItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const {\n isDisplayBackImage = false,\n itemShape,\n metafields,\n isTopTag = false,\n isShowTag,\n isShowOriginalPrice,\n isShowShortTitle = false,\n } = configuration || {}\n const { locale = 'es', copyWriting, currencyDisplay } = useAiuiContext()\n const { discounts, discountsCopy } = metafields || {}\n const ref = useRef<HTMLDivElement>(null)\n const [showTags, setShowTags] = useState<string[]>([])\n const [currentPriceTag, setCurrentPriceTag] = useState<string>('')\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => {\n const { primaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E primaryFun \u503C\uFF09\n if (primaryFun) {\n if (primaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (primaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (primaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.primaryButton?.(params, index + 1, data, coupon)\n }\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => {\n const { secondaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E secondaryFun \u503C\uFF09\n if (secondaryFun) {\n if (secondaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.secondaryButton?.(params, index + 1, data, coupon)\n }\n\n const variant = useMemo(() => {\n const variants = data?.variants || []\n if (!variants.length) {\n return undefined\n }\n if (!data?.sku) {\n return variants?.[0]\n }\n return variants?.find?.((item: any) => item?.sku === data?.sku) || variants[0]\n }, [data?.sku, data?.variants])\n\n const variantArr = variant?.id?.split?.('/') || []\n const variantId = variantArr?.[variantArr?.length - 1]\n\n const isSoldOut =\n !variant?.availableForSale || variant?.price?.amount === SOLD_OUT_PRICE || variant?.price === SOLD_OUT_PRICE\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n\n const shouldUseCouponPrice = Boolean(isShowOriginalPrice && coupon)\n const currencyCode = data?.price?.currencyCode || 'USD'\n\n const priceInfo = useMemo(\n () =>\n formatVariantPrice({\n locale,\n amount: shouldUseCouponPrice ? coupon?.variant_price4wscode : variant?.price,\n baseAmount: shouldUseCouponPrice ? variant?.price : 0,\n currencyCode,\n currencyDisplay,\n }),\n [currencyCode, locale, shouldUseCouponPrice, coupon?.variant_price4wscode, variant]\n )\n\n const { price, basePrice, discount, discountAmount } = priceInfo\n\n const { imageUrl, altText } = getProductImage(data)\n\n const displayTitle = data?.custom_name || data?.title\n const currentDisplayTitle = isShowShortTitle\n ? variant?.metafields?.infos?.page_short_title || displayTitle\n : displayTitle\n const displayDescription = data?.custom_description || data?.description\n\n const showPrice = () => {\n if (coupon?.value_type === 'fixed_amount') {\n const amountStr = discountAmount || ''\n const match = amountStr.match(/^(.*?)(\\d[\\d.,]*)(.*)$/)\n if (match) {\n const [, prefix, numeric, suffix] = match\n let updatedNumeric = numeric\n if (numeric.endsWith('.00')) {\n updatedNumeric = numeric.replace(/\\.00$/, '')\n } else if (numeric.endsWith(',00')) {\n updatedNumeric = numeric.replace(/,00$/, '')\n }\n return `${prefix}${updatedNumeric}${suffix}`\n }\n return amountStr\n }\n return discount || ''\n }\n\n // \u5904\u7406\u6807\u7B7E\n useEffect(() => {\n let handleTags: string[] = []\n if (discount || discountAmount) {\n const discountTag = `${showPrice()} ${discounts?.off || discountsCopy?.off || ''}`\n setCurrentPriceTag(discountTag)\n handleTags.push(discountTag)\n }\n const newTags = data?.tags\n ?.filter?.((item: string) => item?.startsWith?.('CLtag'))\n ?.map?.((item: string) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, discount ? 1 : 2)\n setShowTags(handleTags.concat(newTags))\n }, [data?.tags, discount, discountAmount, discounts?.off, discountsCopy?.off])\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: displayTitle,\n componentDescription: displayDescription,\n position: configuration?.index + 1,\n })\n\n const bottomContent = () => {\n return (\n <>\n {isShowTag && showTags?.length > 0 ? (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {showTags?.map?.((item: any, index: number) => (\n <Badge key={index} className=\"shelf-items-tag\">\n {item}\n </Badge>\n ))}\n </div>\n ) : null}\n {currentDisplayTitle ? (\n <Heading\n as=\"h3\"\n title={currentDisplayTitle || ''}\n size={2}\n className=\"shelf-display-product-title lg-desktop:h-[58px] text-info-primary line-clamp-2 h-12\"\n html={currentDisplayTitle || ''}\n />\n ) : null}\n <Text\n size={2}\n className=\"lg-desktop:text-lg desktop:h-[24px] lg-desktop:h-[28px] desktop:text-base shelf-display-product-description text-info-primary line-clamp-1 h-[20px] text-sm\"\n html={displayDescription || ''}\n />\n <div className=\"mb-2 mt-4 flex items-center\">\n {isSoldOut ? (\n <div className=\"tablet:text-2xl text-info-primary text-xl font-bold\">{copyWriting?.soldOutText}</div>\n ) : (\n <>\n <div className=\"final-price tablet:text-xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n <div className=\"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through\">\n {variant?.availableForSale ? basePrice || '' : ''}\n </div>\n </>\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn(\n 'shelf-flex-button-group',\n 'lg-desktop:gap-3 flex items-center gap-2',\n configuration.direction === 'vertical' ? 'flex-col' : ''\n )}\n >\n {configuration?.secondaryButton ? (\n <Button\n disabled={isSoldOut && configuration?.secondaryFun !== 'LearnMore'}\n variant=\"secondary\"\n href={data?.custom_secondary_link}\n as={data?.custom_secondary_link ? 'a' : 'button'}\n onClick={() =>\n !data?.custom_secondary_link && onSecondaryButton(data, configuration?.index, configuration, coupon)\n }\n className={configuration.direction === 'vertical' ? 'w-full' : ''}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n disabled={isSoldOut && configuration?.primaryFun !== 'LearnMore'}\n variant=\"primary\"\n href={data?.custom_primary_link}\n as={data?.custom_primary_link ? 'a' : 'button'}\n onClick={() =>\n !data?.custom_primary_link && onPrimaryButton(data, configuration?.index, configuration, coupon)\n }\n className={configuration.direction === 'vertical' ? 'w-full' : ''}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) : null}\n </div>\n </>\n )\n }\n\n const custom_bg_image = data?.custom_bg_image\n const custom_theme = data?.custom_theme\n\n return (\n <div\n ref={ref}\n key={data?.id || data?.handle}\n className={cn(\n 'box-border w-full cursor-pointer overflow-hidden duration-300',\n itemShape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative',\n 'md-tablet:h-[360px] shelf-display-item',\n custom_bg_image ? 'bg-cover bg-center bg-no-repeat' : 'bg-background tablet:hover:bg-info-white',\n { 'aiui-dark': custom_theme === 'dark' }\n )}\n style={custom_bg_image ? { backgroundImage: `url(${custom_bg_image})` } : undefined}\n >\n {isDisplayBackImage ? (\n <div className=\"absolute inset-0 box-border overflow-hidden\">\n <div className=\"relative inset-0 size-full\">\n <Picture\n source={imageUrl}\n alt={altText}\n className={cn('flex h-full justify-center object-cover [&_img]:w-auto', {\n 'opacity-0': custom_bg_image,\n })}\n />\n <div className=\"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4\">\n {bottomContent()}\n </div>\n </div>\n </div>\n ) : (\n <div className=\"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4\">\n {currentPriceTag && isTopTag && (\n <Badge className=\"shelf-prices-tag absolute left-4 top-4 z-10\">{currentPriceTag || ''}</Badge>\n )}\n <div\n className={cn(\n 'lg-desktop:h-[195px] shelf-display-item-image relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden',\n { 'opacity-0': custom_bg_image }\n )}\n >\n <a\n aria-label={displayTitle}\n target={configuration?.target}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}?variant=${variantId}`,\n `${componentType}_${componentName}`\n )}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'select_item',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: [\n {\n item_id: data?.sku || variant?.sku,\n item_name: data?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: configuration?.index + 1,\n },\n ],\n },\n })\n }}\n >\n <Picture\n source={imageUrl}\n alt={altText}\n className=\"flex h-full justify-center object-cover [&_img]:w-auto\"\n />\n </a>\n </div>\n {bottomContent()}\n </div>\n )}\n </div>\n )\n}\n\nexport const ShelfDisplayHorizontalItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const { itemShape, itemLength, metafields, isShowShortTitle } = configuration || {}\n const { discounts, discountsCopy } = metafields || {}\n const { locale = 'us', copyWriting, currencyDisplay } = useAiuiContext()\n const [showTags, setShowTags] = useState<string[]>([])\n const ref = useRef<HTMLDivElement>(null)\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => {\n const { primaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E primaryFun \u503C\uFF09\n if (primaryFun) {\n if (primaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (primaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (primaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.primaryButton?.(params, index + 1, data, coupon)\n }\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType, coupon: any) => {\n const { secondaryFun, onAddCart, onBuyNow, onLearnMore, event } = configuration || {}\n\n // \u4F18\u5148\u4F7F\u7528 function props\uFF08\u6839\u636E secondaryFun \u503C\uFF09\n if (secondaryFun) {\n if (secondaryFun === 'AddCart' && onAddCart) {\n return onAddCart(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'BuyNow' && onBuyNow) {\n return onBuyNow(params, index + 1, data, coupon)\n }\n if (secondaryFun === 'LearnMore' && onLearnMore) {\n return onLearnMore(params, index + 1, data, coupon)\n }\n }\n\n // \u517C\u5BB9\u65E7\u7684 event \u903B\u8F91\n event?.secondaryButton?.(params, index + 1, data, coupon)\n }\n\n const variant = useMemo(() => {\n const variants = data?.variants || []\n if (!variants.length) {\n return undefined\n }\n if (!data?.sku) {\n return variants[0]\n }\n return variants.find((item: any) => item?.sku === data?.sku) || variants[0]\n }, [data?.sku, data?.variants])\n\n const variantArr = variant?.id?.split?.('/') || []\n const variantId = variantArr?.[variantArr?.length - 1]\n\n const isSoldOut =\n !variant?.availableForSale || variant?.price?.amount === SOLD_OUT_PRICE || variant?.price === SOLD_OUT_PRICE\n const isShowTag = configuration?.isShowTag\n const isShowOriginalPrice = configuration?.isShowOriginalPrice\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n\n const shouldUseCouponPrice = Boolean(isShowOriginalPrice && coupon)\n const currencyCode = data?.price?.currencyCode || 'USD'\n\n const priceInfo = useMemo(\n () =>\n formatVariantPrice({\n locale,\n amount: shouldUseCouponPrice ? coupon?.variant_price4wscode : variant?.price,\n baseAmount: shouldUseCouponPrice ? variant?.price : 0,\n currencyCode,\n currencyDisplay,\n }),\n [currencyCode, locale, shouldUseCouponPrice, coupon?.variant_price4wscode, variant]\n )\n\n const { price, basePrice, discount, discountAmount } = priceInfo\n\n const { imageUrl, altText } = getProductImage(data)\n\n const displayTitle = data?.custom_name || data?.title\n const currentDisplayTitle = isShowShortTitle\n ? variant?.metafields?.infos?.page_short_title || displayTitle\n : displayTitle\n const displayDescription = data?.custom_description || data?.description\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: displayTitle,\n componentDescription: displayDescription,\n position: configuration?.index + 1,\n })\n\n const showSizeClass = (): {\n boxItem: string\n imgItem: string\n wrap: string\n } => {\n if (itemLength >= 2) {\n return {\n boxItem: 'lg-desktop:max-w-[401px] desktop:max-w-[292px] max-w-full',\n imgItem:\n 'm-tablet:m-auto lg-desktop:max-w-[330px] lg-desktop:max-h-[330px] desktop:max-w-[260px] desktop:max-h-[260px] max-w-[138px] max-h-[138px]',\n wrap: 'lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480] desktop:aspect-w-[648] desktop:aspect-h-[380] laptop:aspect-w-[440] laptop:aspect-h-[356] tablet:aspect-w-[346] tablet:aspect-h-[360] md-tablet:w-full',\n }\n }\n return {\n boxItem: 'lg-desktop:max-w-[401px] desktop:max-w-[292px] laptop:max-w-[289px] max-w-[262px]',\n imgItem:\n 'md-tablet:m-auto lg-desktop:max-w-[450px] lg-desktop:max-h-[450px] desktop:max-w-[332px] desktop:max-h-[332px] max-w-[312px] max-h-[312px]',\n wrap: 'lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[480] desktop:aspect-w-[1312] desktop:aspect-h-[380] laptop:aspect-w-[896] laptop:aspect-h-[356] tablet:aspect-w-[704] tablet:aspect-h-[360] md-tablet:w-full',\n }\n }\n\n const handleWrapClass = () => {\n if (itemLength >= 2) {\n return 'flex flex-col justify-between desktop:gap-12 desktop:flex-row desktop:justify-center desktop:items-center'\n }\n return 'flex justify-center items-center gap-6 md-tablet:flex-col'\n }\n\n const showPrice = () => {\n if (coupon?.value_type === 'fixed_amount') {\n const amountStr = discountAmount || ''\n const match = amountStr.match(/^(.*?)(\\d[\\d.,]*)(.*)$/)\n if (match) {\n const [, prefix, numeric, suffix] = match\n let updatedNumeric = numeric\n if (numeric.endsWith('.00')) {\n updatedNumeric = numeric.replace(/\\.00$/, '')\n } else if (numeric.endsWith(',00')) {\n updatedNumeric = numeric.replace(/,00$/, '')\n }\n return `${prefix}${updatedNumeric}${suffix}`\n }\n return amountStr\n }\n return discount || ''\n }\n\n // \u5904\u7406\u6807\u7B7E\n useEffect(() => {\n let handleTags: string[] = []\n if (discount || discountAmount) {\n const discountTag = `${showPrice()} ${discounts?.off || discountsCopy?.off || ''}`\n handleTags.push(discountTag)\n }\n const newTags = data?.tags\n ?.filter?.((item: string) => item?.startsWith?.('CLtag'))\n ?.map?.((item: string) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, discount ? 1 : 2)\n setShowTags(handleTags.concat(newTags))\n }, [data?.tags, discount, discountAmount, discounts?.off, discountsCopy?.off])\n\n const custom_bg_image = data?.custom_bg_image\n const custom_theme = data?.custom_theme\n\n return (\n <div\n ref={ref}\n key={data?.id || data?.handle}\n className={cn(\n showSizeClass().wrap,\n itemShape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'shelf-display-item',\n 'duration-300',\n 'md-tablet:h-[360px] relative box-border w-full cursor-pointer overflow-hidden',\n custom_bg_image ? 'bg-cover bg-center bg-no-repeat' : 'bg-container-secondary-1 tablet:hover:bg-info-white',\n { 'aiui-dark': custom_theme === 'dark' }\n )}\n style={custom_bg_image ? { backgroundImage: `url(${custom_bg_image})` } : undefined}\n >\n <div className={cn(handleWrapClass(), 'desktop:p-6 absolute inset-0 box-border overflow-hidden p-4')}>\n <div\n className={cn(showSizeClass().imgItem, 'desktop:mb-0 relative mb-1 overflow-hidden', {\n 'opacity-0': custom_bg_image,\n })}\n >\n <a\n aria-label={displayTitle}\n target={configuration?.target}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}?variant=${variantId}`,\n `${componentType}_${componentName}`\n )}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'select_item',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: [\n {\n item_id: data?.sku || variant?.sku,\n item_name: data?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: configuration?.index + 1,\n },\n ],\n },\n })\n }}\n >\n <Picture\n source={imageUrl}\n alt={altText}\n className=\"flex h-full justify-center object-cover [&_img]:w-auto\"\n />\n </a>\n </div>\n <div className={cn('flex flex-col items-start justify-center', showSizeClass().boxItem)}>\n {isShowTag && (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {showTags?.length > 0 &&\n showTags?.map?.((item: any, index: number) => (\n <Badge key={index} className=\"shelf-items-tag\">\n {item}\n </Badge>\n ))}\n </div>\n )}\n {currentDisplayTitle ? (\n <Heading\n as=\"h3\"\n title={currentDisplayTitle || ''}\n size={2}\n className=\"shelf-display-product-title lg-desktop:h-[58px] text-info-primary mb-1 line-clamp-2 h-[48px]\"\n html={currentDisplayTitle || ''}\n />\n ) : null}\n {displayDescription ? (\n <Text\n size={2}\n className=\"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description text-info-primary line-clamp-1 h-5 text-sm\"\n html={displayDescription || ''}\n />\n ) : null}\n <div className=\"mb-2 mt-5 flex items-center\">\n {isSoldOut ? (\n <div className=\"tablet:text-2xl text-info-primary text-xl font-bold\">{copyWriting?.soldOutText}</div>\n ) : (\n <>\n <div className=\"final-price tablet:text-xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n <div className=\"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through\">\n {variant?.availableForSale ? basePrice || '' : ''}\n </div>\n </>\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn(\n 'shelf-flex-button-group',\n 'lg-desktop:gap-3 flex items-center gap-2',\n configuration.direction === 'vertical' ? 'flex-col' : ''\n )}\n >\n {configuration?.secondaryButton ? (\n <Button\n variant=\"secondary\"\n href={data?.custom_secondary_link}\n as={data?.custom_secondary_link ? 'a' : 'button'}\n onClick={() =>\n !data?.custom_secondary_link && onSecondaryButton(data, configuration?.index, configuration, coupon)\n }\n className={configuration.direction === 'vertical' ? 'w-full' : ''}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n disabled={isSoldOut}\n variant=\"primary\"\n href={data?.custom_primary_link}\n as={data?.custom_primary_link ? 'a' : 'button'}\n onClick={() =>\n !data?.custom_primary_link && onPrimaryButton(data, configuration?.index, configuration, coupon)\n }\n className={configuration.direction === 'vertical' ? 'w-full' : ''}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) :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WAAa,EACxD,EAEC,UAAAA,GAAe,mBACd,OAAC,EAAAwD,QAAA,CACC,QAAQ,YACR,KAAM/D,GAAM,sBACZ,GAAIA,GAAM,sBAAwB,IAAM,SACxC,QAAS,IACP,CAACA,GAAM,uBAAyBkC,EAAkBlC,EAAMO,GAAe,MAAOA,EAAeqB,CAAM,EAErG,UAAWrB,EAAc,YAAc,WAAa,SAAW,GAE9D,SAAAA,GAAe,iBAAmB,GACrC,EACE,KACHA,GAAe,iBACd,OAAC,EAAAwD,QAAA,CACC,SAAUvB,EACV,QAAQ,UACR,KAAMxC,GAAM,oBACZ,GAAIA,GAAM,oBAAsB,IAAM,SACtC,QAAS,IACP,CAACA,GAAM,qBAAuByB,EAAgBzB,EAAMO,GAAe,MAAOA,EAAeqB,CAAM,EAEjG,UAAWrB,EAAc,YAAc,WAAa,SAAW,GAE9D,SAAAA,GAAe,eAAiB,GACnC,EACE,MACN,GACF,GACF,GAlIKP,GAAM,IAAMA,GAAM,MAmIzB,CAEJ",
6
+ "names": ["shelfDisplayItem_exports", "__export", "ShelfDisplayHorizontalItem", "ShelfDisplayWrapItem", "getProductImage", "__toCommonJS", "import_jsx_runtime", "import_AiuiProvider", "import_shelfDisplay", "import_picture", "import_badge", "import_utils", "import_text", "import_button", "import_track", "import_trackUrlRef", "import_heading", "import_useExposure", "import_react", "componentType", "componentName", "SOLD_OUT_PRICE", "data", "sku", "skuArray", "findSku", "item", "imageUrl", "altText", "configuration", "isDisplayBackImage", "itemShape", "metafields", "isTopTag", "isShowTag", "isShowOriginalPrice", "isShowShortTitle", "locale", "copyWriting", "currencyDisplay", "discounts", "discountsCopy", "ref", "showTags", "setShowTags", "currentPriceTag", "setCurrentPriceTag", "onPrimaryButton", "params", "index", "coupon", "primaryFun", "onAddCart", "onBuyNow", "onLearnMore", "event", "onSecondaryButton", "secondaryFun", "variant", "variants", "variantArr", "variantId", "isSoldOut", "shouldUseCouponPrice", "currencyCode", "priceInfo", "price", "basePrice", "discount", "discountAmount", "displayTitle", "currentDisplayTitle", "displayDescription", "showPrice", "amountStr", "match", "prefix", "numeric", "suffix", "updatedNumeric", "handleTags", "discountTag", "newTags", "bottomContent", "Badge", "Button", "custom_bg_image", "custom_theme", "Picture", "itemLength", "showSizeClass", "handleWrapClass"]
7
7
  }
@@ -127,6 +127,8 @@ export type { SceneShelfV3Data, SceneShelfV3Props, ProductTab as SceneShelfV3Pro
127
127
  export type { SceneShelfV3SemanticName, ProductCardData as SceneShelfV3ProductCardData, } from './SceneShelfV3/ProductCard.js';
128
128
  export { default as MediaEndorsement } from './MediaEndorsement/index.js';
129
129
  export type { MediaEndorsementProps, MediaEndorsementData, MediaEndorsementItem, MediaEndorsementSemanticName, } from './MediaEndorsement/index.js';
130
+ export { default as MediaTextOverlay } from './MediaTextOverlay/index.js';
131
+ export type { MediaTextOverlayProps, MediaTextOverlayData, MediaTextOverlayItem, MediaTextOverlaySemanticName, ResponsiveMedia, } from './MediaTextOverlay/index.js';
130
132
  export type { CopyConfig as MediaShelfCopyConfig, ButtonFunctionType as MediaShelfButtonFunctionType, } from './MediaShelf/types.js';
131
133
  export type { CopyConfig as ActiveShelfCopyConfig, ButtonFunctionType } from './ActiveShelf/types.js';
132
134
  export { default as ImageOverlayShelf, type ButtonFunctionType as ImageOverlayShelfButtonFunctionType, } from './ImageOverlayShelf/index.js';
@@ -1,2 +1,2 @@
1
- "use strict";var $e=Object.create;var p=Object.defineProperty;var et=Object.getOwnPropertyDescriptor;var tt=Object.getOwnPropertyNames;var rt=Object.getPrototypeOf,at=Object.prototype.hasOwnProperty;var ot=(t,r)=>{for(var a in r)p(t,a,{get:r[a],enumerable:!0})},n=(t,r,a,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of tt(r))!at.call(t,i)&&i!==a&&p(t,i,{get:()=>r[i],enumerable:!(u=et(r,i))||u.enumerable});return t};var e=(t,r,a)=>(a=t!=null?$e(rt(t)):{},n(r||!t||!t.__esModule?p(a,"default",{value:t,enumerable:!0}):a,t)),it=t=>n(p({},"__esModule",{value:!0}),t);var st={};ot(st,{AccordionCards:()=>j.default,ActiveShelf:()=>_e.default,ActivityMechanism:()=>y.default,ActivitySchedule:()=>m.default,AiuiProvider:()=>R.default,AnchorNavigation:()=>Ne.default,AplusDesc:()=>he.default,BenefitsTab:()=>le.default,BizProductProvider:()=>Y.default,BrandCardLink:()=>ge.default,BrandEquity:()=>S.default,BuyOneGetOneShelf:()=>Ke.default,Category:()=>T.default,CreativeModule:()=>K.default,CreditsProductCard:()=>f.CreditsProductCard,CreditsShelf:()=>f.default,DownLoad:()=>Pe.default,Evaluate:()=>v.default,EventSchedule:()=>Re.default,Faq:()=>L.default,FeatureCards:()=>je.default,FeatureShowcase:()=>ke.default,FeaturedBlogPosts:()=>De.default,Features:()=>xe.default,FootCharger:()=>Ce.default,FooterNavigation:()=>E.default,GiftBox:()=>ye.default,GiftShelf:()=>x.default,GiftTierShelf:()=>h.default,Graphic:()=>D.default,GraphicAttractionBlock:()=>q.default,GraphicMore:()=>me.default,GraphicOverlay:()=>_.default,HeaderNavigation:()=>O.default,HeroBanner:()=>I.default,IPC_SEARCH_PAGE:()=>s.IPC_SEARCH_PAGE,IPRedirect:()=>ft,ImageOverlayShelf:()=>Je.default,ImageTextFeature:()=>Ie.default,ImageTextOverlay:()=>Qe.default,ImageWithText:()=>Fe.default,Ksp:()=>Te.default,Marquee:()=>A.default,MarqueeImageContent:()=>o.MarqueeImageContent,MarqueeItem:()=>o.MarqueeItem,MarqueeReview:()=>k.default,MarqueeTextContent:()=>o.MarqueeTextContent,MediaEndorsement:()=>Ye.default,MediaPlayerBase:()=>F.default,MediaPlayerMulti:()=>b.default,MediaPlayerSticky:()=>G.default,MediaSceneSwitcher:()=>Ve.default,MediaSceneSwitcherV2:()=>qe.default,MediaShelf:()=>ze.default,MemberEquity:()=>P.default,MiniCart:()=>Xe.default,MiniCartCircleProgress:()=>Ze.default,MiniCartDialog:()=>l.default,MiniCartDialogComponent:()=>l.MiniCartDialog,MultiLayoutGraphicBlock:()=>V.default,PAYLOAD_COMPONENT_MAP:()=>pt,PaidShipping:()=>ue.default,ProductActions:()=>Q.default,ProductBanner:()=>pe.default,ProductBenefits:()=>$.default,ProductBenefitsTabs:()=>Z.default,ProductBundle:()=>oe.default,ProductCard:()=>X.default,ProductCompare:()=>ve.default,ProductCoupon:()=>ie.default,ProductDetail:()=>de.default,ProductExchangePurchase:()=>re.default,ProductFreeGift:()=>te.default,ProductGallery:()=>fe.default,ProductGridBox:()=>se.default,ProductHero:()=>we.default,ProductHighlight:()=>ee.default,ProductLottery:()=>Be.default,ProductNav:()=>Ee.default,ProductOptions:()=>ae.default,ProductPaidShipping:()=>ne.default,ProductSummary:()=>ce.default,PromotionalBar:()=>We.default,PurchaseBar:()=>J.default,SceneProductCard:()=>d.SceneProductCard,SceneShelf:()=>d.default,SceneShelfV2:()=>c.default,SceneShelfV2ProductCard:()=>c.SceneShelfV2ProductCard,SceneShelfV3:()=>Ue.default,SearchPage:()=>N.default,SearchPageTabType:()=>s.SearchPageTabType,SecondaryBanner:()=>He.default,SelectStore:()=>Se.default,ShelfDisplay:()=>B.default,Slogan:()=>C.default,Spacer:()=>M.default,Specs:()=>z.default,SpecsComparison:()=>Le.default,TabGroup:()=>U.default,TabWithImage:()=>Ae.default,Tabs:()=>H.default,TabsWithMedia:()=>be.default,ThreeDCarousel:()=>Oe.default,Title:()=>g.default,VideoFeature:()=>Ge.default,WheelLottery:()=>Me.default,WhyChoose:()=>w.default,withLayout:()=>W.withLayout});module.exports=it(st);var m=e(require("./ActivitySchedule/index.js")),x=e(require("./GiftShelf/index.js")),h=e(require("./GiftTierShelf/index.js")),y=e(require("./ActivityMechanism/index.js")),S=e(require("./BrandEquity/index.js")),P=e(require("./MemberEquity/index.js")),C=e(require("./Slogan/index.js")),g=e(require("./Title/index.js")),M=e(require("./Spacer/index.js")),B=e(require("./ShelfDisplay/index.js")),v=e(require("./Evaluate/index.js")),T=e(require("./Category/index.js")),I=e(require("./HeroBanner/index.js")),j=e(require("./AccordionCards/index.js")),D=e(require("./Graphic/index.js")),F=e(require("./MediaPlayerBase/index.js")),G=e(require("./MediaPlayerSticky/index.js")),b=e(require("./MediaPlayerMulti/index.js")),A=e(require("./Marquee/index.js")),k=e(require("./MarqueeReview/index.js")),w=e(require("./WhyChoose/index.js")),L=e(require("./Faq/index.js")),o=require("./Marquee/index.js"),V=e(require("./MultiLayoutGraphicBlock/index.js")),q=e(require("./GraphicAttractionBlock/index.js")),O=e(require("./HeaderNavigation/index.js")),E=e(require("./FooterNavigation/index.js")),N=e(require("./SearchPage/index.js")),s=require("./SearchPage/types.js"),W=require("../shared/Styles.js"),R=e(require("./AiuiProvider/index.js")),H=e(require("./Tabs/index.js")),K=e(require("./CreativeModule/index.js")),_=e(require("./GraphicOverlay/index.js")),z=e(require("./Specs/index.js")),U=e(require("./TabsGroup/index.js")),Y=e(require("./Listing/BizProductProvider.js")),J=e(require("./Listing/components/PurchaseBar/index.js")),Q=e(require("./Listing/components/PurchaseBar/ProductActions/index.js")),X=e(require("./Listing/components/ProductCard/index.js")),Z=e(require("./Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js")),$=e(require("./Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js")),ee=e(require("./Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js")),te=e(require("./Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js")),re=e(require("./Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js")),ae=e(require("./Listing/components/ProductCard/ProductDetail/ProductOptions/index.js")),oe=e(require("./Listing/components/ProductCard/ProductDetail/ProductBundle/index.js")),ie=e(require("./Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js")),pe=e(require("./Listing/components/ProductCard/ProductDetail/ProductBanner/index.js")),se=e(require("./Listing/components/ProductCard/ProductGridBox.js")),fe=e(require("./Listing/components/ProductCard/ProductGallery/index.js")),de=e(require("./Listing/components/ProductCard/ProductDetail/index.js")),ce=e(require("./Listing/components/ProductCard/ProductSummary/index.js")),le=e(require("./Listing/components/ProductCard/ProductDetail/BenefitsTab.js")),ue=e(require("./Listing/components/PaidShipping/index.js")),ne=e(require("./Listing/components/ProductCard/ProductPaidShipping/index.js")),me=e(require("./GraphicMore/index.js")),xe=e(require("./Features/index.js")),he=e(require("./AplusDesc/index.js")),ye=e(require("./GiftBox/index.js")),Se=e(require("./SelectStore/index.js")),Pe=e(require("./DownLoad/index.js")),Ce=e(require("./FootCharger/index.js")),ge=e(require("./BrandCardLink/index.js")),ft=e(require("./IPRedirect/index.js")),Me=e(require("./WheelLottery/index.js")),Be=e(require("./ProductLottery/index.js")),ve=e(require("./ProductCompare/index.js")),Te=e(require("./Ksp/index.js")),Ie=e(require("./ImageTextFeature/index.js")),je=e(require("./FeatureCards/index.js")),De=e(require("./FeaturedBlogPosts/index.js")),Fe=e(require("./ImageWithText/index.js")),Ge=e(require("./VideoFeature/index.js")),be=e(require("./TabsWithMedia/index.js")),Ae=e(require("./TabWithImage/index.js")),ke=e(require("./FeatureShowcase/index.js")),we=e(require("./ProductHero/index.js")),Le=e(require("./SpecsComparison/index.js")),Ve=e(require("./MediaSceneSwitcher/index.js")),qe=e(require("./MediaSceneSwitcherV2/index.js")),Oe=e(require("./ThreeDCarousel/index.js")),Ee=e(require("./ProductNav/index.js")),Ne=e(require("./AnchorNavigation/index.js")),We=e(require("./PromotionalBar/index.js")),Re=e(require("./EventSchedule/index.js")),He=e(require("./SecondaryBanner/index.js")),Ke=e(require("./BuyOneGetOneShelf/index.js")),_e=e(require("./ActiveShelf/index.js")),ze=e(require("./MediaShelf/index.js")),f=e(require("./CreditsShelf/index.js")),d=e(require("./SceneShelf/index.js")),c=e(require("./SceneShelfV2/index.js")),Ue=e(require("./SceneShelfV3/index.js")),Ye=e(require("./MediaEndorsement/index.js")),Je=e(require("./ImageOverlayShelf/index.js")),Qe=e(require("./ImageTextOverlay/index.js")),Xe=e(require("./MiniCart/index.js")),Ze=e(require("./MiniCart/CircleProgress.js")),l=e(require("./MiniCart/MiniCartDialog.js"));const pt={"ipc-accordioncards":"AccordionCards","ipc-aplusdesc":"AplusDesc","ipc-banner":"HeroBanner","ipc-brand-equity":"BrandEquity","ipc-category":"Category","ipc-collection-banner":"CollectionBanner","ipc-collection-shelves":"CollectionShelves","ipc-creativemodule":"CreativeModule","ipc-download":"DownLoad","ipc-evaluate":"Evaluate","ipc-faq":"Faq","ipc-features":"Features","ipc-footcharger":"FootCharger","ipc-ga-block":"GraphicAttractionBlock","ipc-giftbox":"GiftBox","ipc-giftshelf":"GiftShelf","ipc-graphic":"Graphic","ipc-graphicmore":"GraphicMore","ipc-graphicoverlay":"GraphicOverlay","ipc-marquee":"Marquee","ipc-mediaplayerbase":"MediaPlayerBase","ipc-mediaplayermulti":"MediaPlayerMulti","ipc-mediaplayersticky":"MediaPlayerSticky","ipc-member-equity":"MemberEquity","ipc-mlg-block":"MultiLayoutGraphicBlock","ipc-search-page-tabs":"SearchPageBlock","ipc-selectstore":"SelectStore","ipc-shelfdisplay":"ShelfDisplay","ipc-slogan":"Slogan","ipc-spacer":"Spacer","ipc-specs":"Specs","ipc-tabs":"TabsBlock","ipc-text-marquee":"TextMarquee","ipc-title":"Title","ipc-whychoose":"WhyChoose","ipc-product-nav":"ProductNav","ipc-brand-card-link":"BrandCardLink","ipc-ipredirect":"IPRedirect",ksp:"Ksp","ipc-secondary-banner":"SecondaryBanner","ipc-active-shelf":"ActiveShelf","ipc-media-shelf":"MediaShelf","ipc-bogo-shelf":"BuyOneGetOneShelf","ipc-media-endorsement":"MediaEndorsement","ipc-media-scene-switcher-v2":"MediaSceneSwitcherV2","ipc-featured-blog-posts":"FeaturedBlogPosts"};
1
+ "use strict";var et=Object.create;var p=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var rt=Object.getOwnPropertyNames;var at=Object.getPrototypeOf,ot=Object.prototype.hasOwnProperty;var it=(t,r)=>{for(var a in r)p(t,a,{get:r[a],enumerable:!0})},m=(t,r,a,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of rt(r))!ot.call(t,i)&&i!==a&&p(t,i,{get:()=>r[i],enumerable:!(u=tt(r,i))||u.enumerable});return t};var e=(t,r,a)=>(a=t!=null?et(at(t)):{},m(r||!t||!t.__esModule?p(a,"default",{value:t,enumerable:!0}):a,t)),pt=t=>m(p({},"__esModule",{value:!0}),t);var ft={};it(ft,{AccordionCards:()=>j.default,ActiveShelf:()=>_e.default,ActivityMechanism:()=>h.default,ActivitySchedule:()=>n.default,AiuiProvider:()=>R.default,AnchorNavigation:()=>Ee.default,AplusDesc:()=>ye.default,BenefitsTab:()=>le.default,BizProductProvider:()=>Y.default,BrandCardLink:()=>ge.default,BrandEquity:()=>S.default,BuyOneGetOneShelf:()=>Ke.default,Category:()=>B.default,CreativeModule:()=>K.default,CreditsProductCard:()=>f.CreditsProductCard,CreditsShelf:()=>f.default,DownLoad:()=>Pe.default,Evaluate:()=>T.default,EventSchedule:()=>Re.default,Faq:()=>L.default,FeatureCards:()=>je.default,FeatureShowcase:()=>ke.default,FeaturedBlogPosts:()=>De.default,Features:()=>xe.default,FootCharger:()=>Ce.default,FooterNavigation:()=>N.default,GiftBox:()=>he.default,GiftShelf:()=>x.default,GiftTierShelf:()=>y.default,Graphic:()=>D.default,GraphicAttractionBlock:()=>V.default,GraphicMore:()=>ne.default,GraphicOverlay:()=>_.default,HeaderNavigation:()=>q.default,HeroBanner:()=>I.default,IPC_SEARCH_PAGE:()=>s.IPC_SEARCH_PAGE,IPRedirect:()=>dt,ImageOverlayShelf:()=>Qe.default,ImageTextFeature:()=>Ie.default,ImageTextOverlay:()=>Xe.default,ImageWithText:()=>Fe.default,Ksp:()=>Be.default,Marquee:()=>A.default,MarqueeImageContent:()=>o.MarqueeImageContent,MarqueeItem:()=>o.MarqueeItem,MarqueeReview:()=>k.default,MarqueeTextContent:()=>o.MarqueeTextContent,MediaEndorsement:()=>Ye.default,MediaPlayerBase:()=>F.default,MediaPlayerMulti:()=>b.default,MediaPlayerSticky:()=>G.default,MediaSceneSwitcher:()=>Oe.default,MediaSceneSwitcherV2:()=>Ve.default,MediaShelf:()=>ze.default,MediaTextOverlay:()=>Je.default,MemberEquity:()=>P.default,MiniCart:()=>Ze.default,MiniCartCircleProgress:()=>$e.default,MiniCartDialog:()=>l.default,MiniCartDialogComponent:()=>l.MiniCartDialog,MultiLayoutGraphicBlock:()=>O.default,PAYLOAD_COMPONENT_MAP:()=>st,PaidShipping:()=>ue.default,ProductActions:()=>Q.default,ProductBanner:()=>pe.default,ProductBenefits:()=>$.default,ProductBenefitsTabs:()=>Z.default,ProductBundle:()=>oe.default,ProductCard:()=>X.default,ProductCompare:()=>Te.default,ProductCoupon:()=>ie.default,ProductDetail:()=>de.default,ProductExchangePurchase:()=>re.default,ProductFreeGift:()=>te.default,ProductGallery:()=>fe.default,ProductGridBox:()=>se.default,ProductHero:()=>we.default,ProductHighlight:()=>ee.default,ProductLottery:()=>ve.default,ProductNav:()=>Ne.default,ProductOptions:()=>ae.default,ProductPaidShipping:()=>me.default,ProductSummary:()=>ce.default,PromotionalBar:()=>We.default,PurchaseBar:()=>J.default,SceneProductCard:()=>d.SceneProductCard,SceneShelf:()=>d.default,SceneShelfV2:()=>c.default,SceneShelfV2ProductCard:()=>c.SceneShelfV2ProductCard,SceneShelfV3:()=>Ue.default,SearchPage:()=>E.default,SearchPageTabType:()=>s.SearchPageTabType,SecondaryBanner:()=>He.default,SelectStore:()=>Se.default,ShelfDisplay:()=>v.default,Slogan:()=>C.default,Spacer:()=>M.default,Specs:()=>z.default,SpecsComparison:()=>Le.default,TabGroup:()=>U.default,TabWithImage:()=>Ae.default,Tabs:()=>H.default,TabsWithMedia:()=>be.default,ThreeDCarousel:()=>qe.default,Title:()=>g.default,VideoFeature:()=>Ge.default,WheelLottery:()=>Me.default,WhyChoose:()=>w.default,withLayout:()=>W.withLayout});module.exports=pt(ft);var n=e(require("./ActivitySchedule/index.js")),x=e(require("./GiftShelf/index.js")),y=e(require("./GiftTierShelf/index.js")),h=e(require("./ActivityMechanism/index.js")),S=e(require("./BrandEquity/index.js")),P=e(require("./MemberEquity/index.js")),C=e(require("./Slogan/index.js")),g=e(require("./Title/index.js")),M=e(require("./Spacer/index.js")),v=e(require("./ShelfDisplay/index.js")),T=e(require("./Evaluate/index.js")),B=e(require("./Category/index.js")),I=e(require("./HeroBanner/index.js")),j=e(require("./AccordionCards/index.js")),D=e(require("./Graphic/index.js")),F=e(require("./MediaPlayerBase/index.js")),G=e(require("./MediaPlayerSticky/index.js")),b=e(require("./MediaPlayerMulti/index.js")),A=e(require("./Marquee/index.js")),k=e(require("./MarqueeReview/index.js")),w=e(require("./WhyChoose/index.js")),L=e(require("./Faq/index.js")),o=require("./Marquee/index.js"),O=e(require("./MultiLayoutGraphicBlock/index.js")),V=e(require("./GraphicAttractionBlock/index.js")),q=e(require("./HeaderNavigation/index.js")),N=e(require("./FooterNavigation/index.js")),E=e(require("./SearchPage/index.js")),s=require("./SearchPage/types.js"),W=require("../shared/Styles.js"),R=e(require("./AiuiProvider/index.js")),H=e(require("./Tabs/index.js")),K=e(require("./CreativeModule/index.js")),_=e(require("./GraphicOverlay/index.js")),z=e(require("./Specs/index.js")),U=e(require("./TabsGroup/index.js")),Y=e(require("./Listing/BizProductProvider.js")),J=e(require("./Listing/components/PurchaseBar/index.js")),Q=e(require("./Listing/components/PurchaseBar/ProductActions/index.js")),X=e(require("./Listing/components/ProductCard/index.js")),Z=e(require("./Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js")),$=e(require("./Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js")),ee=e(require("./Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js")),te=e(require("./Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js")),re=e(require("./Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js")),ae=e(require("./Listing/components/ProductCard/ProductDetail/ProductOptions/index.js")),oe=e(require("./Listing/components/ProductCard/ProductDetail/ProductBundle/index.js")),ie=e(require("./Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js")),pe=e(require("./Listing/components/ProductCard/ProductDetail/ProductBanner/index.js")),se=e(require("./Listing/components/ProductCard/ProductGridBox.js")),fe=e(require("./Listing/components/ProductCard/ProductGallery/index.js")),de=e(require("./Listing/components/ProductCard/ProductDetail/index.js")),ce=e(require("./Listing/components/ProductCard/ProductSummary/index.js")),le=e(require("./Listing/components/ProductCard/ProductDetail/BenefitsTab.js")),ue=e(require("./Listing/components/PaidShipping/index.js")),me=e(require("./Listing/components/ProductCard/ProductPaidShipping/index.js")),ne=e(require("./GraphicMore/index.js")),xe=e(require("./Features/index.js")),ye=e(require("./AplusDesc/index.js")),he=e(require("./GiftBox/index.js")),Se=e(require("./SelectStore/index.js")),Pe=e(require("./DownLoad/index.js")),Ce=e(require("./FootCharger/index.js")),ge=e(require("./BrandCardLink/index.js")),dt=e(require("./IPRedirect/index.js")),Me=e(require("./WheelLottery/index.js")),ve=e(require("./ProductLottery/index.js")),Te=e(require("./ProductCompare/index.js")),Be=e(require("./Ksp/index.js")),Ie=e(require("./ImageTextFeature/index.js")),je=e(require("./FeatureCards/index.js")),De=e(require("./FeaturedBlogPosts/index.js")),Fe=e(require("./ImageWithText/index.js")),Ge=e(require("./VideoFeature/index.js")),be=e(require("./TabsWithMedia/index.js")),Ae=e(require("./TabWithImage/index.js")),ke=e(require("./FeatureShowcase/index.js")),we=e(require("./ProductHero/index.js")),Le=e(require("./SpecsComparison/index.js")),Oe=e(require("./MediaSceneSwitcher/index.js")),Ve=e(require("./MediaSceneSwitcherV2/index.js")),qe=e(require("./ThreeDCarousel/index.js")),Ne=e(require("./ProductNav/index.js")),Ee=e(require("./AnchorNavigation/index.js")),We=e(require("./PromotionalBar/index.js")),Re=e(require("./EventSchedule/index.js")),He=e(require("./SecondaryBanner/index.js")),Ke=e(require("./BuyOneGetOneShelf/index.js")),_e=e(require("./ActiveShelf/index.js")),ze=e(require("./MediaShelf/index.js")),f=e(require("./CreditsShelf/index.js")),d=e(require("./SceneShelf/index.js")),c=e(require("./SceneShelfV2/index.js")),Ue=e(require("./SceneShelfV3/index.js")),Ye=e(require("./MediaEndorsement/index.js")),Je=e(require("./MediaTextOverlay/index.js")),Qe=e(require("./ImageOverlayShelf/index.js")),Xe=e(require("./ImageTextOverlay/index.js")),Ze=e(require("./MiniCart/index.js")),$e=e(require("./MiniCart/CircleProgress.js")),l=e(require("./MiniCart/MiniCartDialog.js"));const st={"ipc-accordioncards":"AccordionCards","ipc-aplusdesc":"AplusDesc","ipc-banner":"HeroBanner","ipc-brand-equity":"BrandEquity","ipc-category":"Category","ipc-collection-banner":"CollectionBanner","ipc-collection-shelves":"CollectionShelves","ipc-creativemodule":"CreativeModule","ipc-download":"DownLoad","ipc-evaluate":"Evaluate","ipc-faq":"Faq","ipc-features":"Features","ipc-footcharger":"FootCharger","ipc-ga-block":"GraphicAttractionBlock","ipc-giftbox":"GiftBox","ipc-giftshelf":"GiftShelf","ipc-graphic":"Graphic","ipc-graphicmore":"GraphicMore","ipc-graphicoverlay":"GraphicOverlay","ipc-marquee":"Marquee","ipc-mediaplayerbase":"MediaPlayerBase","ipc-mediaplayermulti":"MediaPlayerMulti","ipc-mediaplayersticky":"MediaPlayerSticky","ipc-member-equity":"MemberEquity","ipc-mlg-block":"MultiLayoutGraphicBlock","ipc-search-page-tabs":"SearchPageBlock","ipc-selectstore":"SelectStore","ipc-shelfdisplay":"ShelfDisplay","ipc-slogan":"Slogan","ipc-spacer":"Spacer","ipc-specs":"Specs","ipc-tabs":"TabsBlock","ipc-text-marquee":"TextMarquee","ipc-title":"Title","ipc-whychoose":"WhyChoose","ipc-product-nav":"ProductNav","ipc-brand-card-link":"BrandCardLink","ipc-ipredirect":"IPRedirect",ksp:"Ksp","ipc-secondary-banner":"SecondaryBanner","ipc-active-shelf":"ActiveShelf","ipc-media-shelf":"MediaShelf","ipc-bogo-shelf":"BuyOneGetOneShelf","ipc-media-endorsement":"MediaEndorsement","ipc-media-scene-switcher-v2":"MediaSceneSwitcherV2","ipc-featured-blog-posts":"FeaturedBlogPosts"};
2
2
  //# sourceMappingURL=index.js.map