@anker-in/headless-ui 1.1.83 → 1.1.84-alpha.1776249522021

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 (379) hide show
  1. package/dist/cjs/biz-components/AccordionCards/index.js +1 -1
  2. package/dist/cjs/biz-components/AccordionCards/index.js.map +3 -3
  3. package/dist/cjs/biz-components/ActiveShelf/index.d.ts +2 -2
  4. package/dist/cjs/biz-components/ActiveShelf/index.js +1 -1
  5. package/dist/cjs/biz-components/ActiveShelf/index.js.map +3 -3
  6. package/dist/cjs/biz-components/ActivityMechanism/index.js +1 -1
  7. package/dist/cjs/biz-components/ActivityMechanism/index.js.map +3 -3
  8. package/dist/cjs/biz-components/ActivitySchedule/index.js +1 -1
  9. package/dist/cjs/biz-components/ActivitySchedule/index.js.map +3 -3
  10. package/dist/cjs/biz-components/AnchorNavigation/index.js +1 -1
  11. package/dist/cjs/biz-components/AnchorNavigation/index.js.map +3 -3
  12. package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js +1 -1
  13. package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js.map +3 -3
  14. package/dist/cjs/biz-components/Category/SwiperCategory.js +1 -1
  15. package/dist/cjs/biz-components/Category/SwiperCategory.js.map +3 -3
  16. package/dist/cjs/biz-components/Category/index.js +1 -1
  17. package/dist/cjs/biz-components/Category/index.js.map +3 -3
  18. package/dist/cjs/biz-components/Evaluate/index.js +1 -1
  19. package/dist/cjs/biz-components/Evaluate/index.js.map +3 -3
  20. package/dist/cjs/biz-components/EventSchedule/index.d.ts +2 -7
  21. package/dist/cjs/biz-components/EventSchedule/index.js +1 -1
  22. package/dist/cjs/biz-components/EventSchedule/index.js.map +3 -3
  23. package/dist/cjs/biz-components/Faq/Faq.js +1 -1
  24. package/dist/cjs/biz-components/Faq/Faq.js.map +2 -2
  25. package/dist/cjs/biz-components/Faq/types.d.ts +1 -0
  26. package/dist/cjs/biz-components/Faq/types.js +1 -1
  27. package/dist/cjs/biz-components/Faq/types.js.map +1 -1
  28. package/dist/cjs/biz-components/FeatureCards/FeatureCards.js +1 -1
  29. package/dist/cjs/biz-components/FeatureCards/FeatureCards.js.map +3 -3
  30. package/dist/cjs/biz-components/FeaturedBlogPosts/index.d.ts +1 -6
  31. package/dist/cjs/biz-components/FeaturedBlogPosts/index.js +1 -1
  32. package/dist/cjs/biz-components/FeaturedBlogPosts/index.js.map +3 -3
  33. package/dist/cjs/biz-components/GiftBox/index.js +1 -1
  34. package/dist/cjs/biz-components/GiftBox/index.js.map +2 -2
  35. package/dist/cjs/biz-components/GiftShelf/index.js +1 -1
  36. package/dist/cjs/biz-components/GiftShelf/index.js.map +3 -3
  37. package/dist/cjs/biz-components/GiftTierShelf/index.js +1 -1
  38. package/dist/cjs/biz-components/GiftTierShelf/index.js.map +3 -3
  39. package/dist/cjs/biz-components/Graphic/index.js +1 -1
  40. package/dist/cjs/biz-components/Graphic/index.js.map +3 -3
  41. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  42. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js.map +3 -3
  43. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
  44. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  45. package/dist/cjs/biz-components/ImageOverlayShelf/index.d.ts +3 -3
  46. package/dist/cjs/biz-components/ImageOverlayShelf/index.js +1 -1
  47. package/dist/cjs/biz-components/ImageOverlayShelf/index.js.map +3 -3
  48. package/dist/cjs/biz-components/ImageTextOverlay/index.d.ts +4 -0
  49. package/dist/cjs/biz-components/ImageTextOverlay/index.js +2 -0
  50. package/dist/cjs/biz-components/ImageTextOverlay/index.js.map +7 -0
  51. package/dist/cjs/biz-components/ImageTextOverlay/types.d.ts +58 -0
  52. package/dist/cjs/biz-components/ImageTextOverlay/types.js +2 -0
  53. package/dist/cjs/biz-components/ImageTextOverlay/types.js.map +7 -0
  54. package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
  55. package/dist/cjs/biz-components/ImageWithText/ImageWithText.js.map +3 -3
  56. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  57. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +2 -2
  58. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  59. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  60. package/dist/cjs/biz-components/LotteryShared/BaseModal.d.ts +61 -0
  61. package/dist/cjs/biz-components/LotteryShared/BaseModal.js +2 -0
  62. package/dist/cjs/biz-components/LotteryShared/BaseModal.js.map +7 -0
  63. package/dist/cjs/biz-components/LotteryShared/ChanceMethods.d.ts +25 -0
  64. package/dist/cjs/biz-components/LotteryShared/ChanceMethods.js +2 -0
  65. package/dist/cjs/biz-components/LotteryShared/ChanceMethods.js.map +7 -0
  66. package/dist/cjs/biz-components/LotteryShared/ErrorModal.d.ts +47 -0
  67. package/dist/cjs/biz-components/LotteryShared/ErrorModal.js +2 -0
  68. package/dist/cjs/biz-components/LotteryShared/ErrorModal.js.map +7 -0
  69. package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.d.ts +101 -0
  70. package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.js +2 -0
  71. package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.js.map +7 -0
  72. package/dist/cjs/biz-components/LotteryShared/PrizePool.d.ts +29 -0
  73. package/dist/cjs/biz-components/LotteryShared/PrizePool.js +2 -0
  74. package/dist/cjs/biz-components/LotteryShared/PrizePool.js.map +7 -0
  75. package/dist/cjs/biz-components/LotteryShared/RulesModal.d.ts +56 -0
  76. package/dist/cjs/biz-components/LotteryShared/RulesModal.js +2 -0
  77. package/dist/cjs/biz-components/LotteryShared/RulesModal.js.map +7 -0
  78. package/dist/cjs/biz-components/LotteryShared/ShareModal.d.ts +79 -0
  79. package/dist/cjs/biz-components/LotteryShared/ShareModal.js +2 -0
  80. package/dist/cjs/biz-components/LotteryShared/ShareModal.js.map +7 -0
  81. package/dist/cjs/biz-components/LotteryShared/WinnerModal.d.ts +27 -0
  82. package/dist/cjs/biz-components/LotteryShared/WinnerModal.js +2 -0
  83. package/dist/cjs/biz-components/LotteryShared/WinnerModal.js.map +7 -0
  84. package/dist/cjs/biz-components/LotteryShared/index.d.ts +23 -0
  85. package/dist/cjs/biz-components/LotteryShared/index.js +2 -0
  86. package/dist/cjs/biz-components/LotteryShared/index.js.map +7 -0
  87. package/dist/cjs/biz-components/LotteryShared/types.d.ts +760 -0
  88. package/dist/cjs/biz-components/LotteryShared/types.js +2 -0
  89. package/dist/cjs/biz-components/LotteryShared/types.js.map +7 -0
  90. package/dist/cjs/biz-components/Marquee/Marquee.js +1 -1
  91. package/dist/cjs/biz-components/Marquee/Marquee.js.map +3 -3
  92. package/dist/cjs/biz-components/Marquee/type.d.ts +5 -2
  93. package/dist/cjs/biz-components/Marquee/type.js.map +1 -1
  94. package/dist/cjs/biz-components/Media/index.d.ts +15 -3
  95. package/dist/cjs/biz-components/Media/index.js +1 -1
  96. package/dist/cjs/biz-components/Media/index.js.map +3 -3
  97. package/dist/cjs/biz-components/MediaEndorsement/index.js +2 -2
  98. package/dist/cjs/biz-components/MediaEndorsement/index.js.map +2 -2
  99. package/dist/cjs/biz-components/MediaPlayerMulti/index.js +1 -1
  100. package/dist/cjs/biz-components/MediaPlayerMulti/index.js.map +3 -3
  101. package/dist/cjs/biz-components/MediaShelf/index.d.ts +2 -2
  102. package/dist/cjs/biz-components/MediaShelf/index.js +1 -1
  103. package/dist/cjs/biz-components/MediaShelf/index.js.map +3 -3
  104. package/dist/cjs/biz-components/MemberEquity/index.js +2 -2
  105. package/dist/cjs/biz-components/MemberEquity/index.js.map +3 -3
  106. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  107. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
  108. package/dist/cjs/biz-components/NavigationSearch/index.js +2 -2
  109. package/dist/cjs/biz-components/NavigationSearch/index.js.map +2 -2
  110. package/dist/cjs/biz-components/ProductHero/ProductHero.js +1 -1
  111. package/dist/cjs/biz-components/ProductHero/ProductHero.js.map +3 -3
  112. package/dist/cjs/biz-components/ProductLottery/MediaDrawArea.d.ts +4 -0
  113. package/dist/cjs/biz-components/ProductLottery/MediaDrawArea.js +2 -0
  114. package/dist/cjs/biz-components/ProductLottery/MediaDrawArea.js.map +7 -0
  115. package/dist/cjs/biz-components/ProductLottery/index.d.ts +17 -0
  116. package/dist/cjs/biz-components/ProductLottery/index.js +2 -0
  117. package/dist/cjs/biz-components/ProductLottery/index.js.map +7 -0
  118. package/dist/cjs/biz-components/ProductLottery/types.d.ts +363 -0
  119. package/dist/cjs/biz-components/ProductLottery/types.js +2 -0
  120. package/dist/cjs/biz-components/ProductLottery/types.js.map +7 -0
  121. package/dist/cjs/biz-components/ProductNav/ProductNav.js +1 -1
  122. package/dist/cjs/biz-components/ProductNav/ProductNav.js.map +3 -3
  123. package/dist/cjs/biz-components/PromotionalBar/index.js +1 -1
  124. package/dist/cjs/biz-components/PromotionalBar/index.js.map +3 -3
  125. package/dist/cjs/biz-components/SceneShelfV2/index.d.ts +88 -0
  126. package/dist/cjs/biz-components/SceneShelfV2/index.js +2 -0
  127. package/dist/cjs/biz-components/SceneShelfV2/index.js.map +7 -0
  128. package/dist/cjs/biz-components/SceneShelfV3/ProductCard.d.ts +80 -0
  129. package/dist/cjs/biz-components/SceneShelfV3/ProductCard.js +2 -0
  130. package/dist/cjs/biz-components/SceneShelfV3/ProductCard.js.map +7 -0
  131. package/dist/cjs/biz-components/SceneShelfV3/index.d.ts +76 -0
  132. package/dist/cjs/biz-components/SceneShelfV3/index.js +2 -0
  133. package/dist/cjs/biz-components/SceneShelfV3/index.js.map +7 -0
  134. package/dist/cjs/biz-components/SceneShelfV3/types.d.ts +19 -0
  135. package/dist/cjs/biz-components/SceneShelfV3/types.js +2 -0
  136. package/dist/cjs/biz-components/SceneShelfV3/types.js.map +7 -0
  137. package/dist/cjs/biz-components/SecondaryBanner/index.js +1 -1
  138. package/dist/cjs/biz-components/SecondaryBanner/index.js.map +3 -3
  139. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
  140. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
  141. package/dist/cjs/biz-components/Specs/index.js +1 -1
  142. package/dist/cjs/biz-components/Specs/index.js.map +3 -3
  143. package/dist/cjs/biz-components/Subscribe/index.js +1 -1
  144. package/dist/cjs/biz-components/Subscribe/index.js.map +2 -2
  145. package/dist/cjs/biz-components/SwiperBox/index.js +1 -1
  146. package/dist/cjs/biz-components/SwiperBox/index.js.map +3 -3
  147. package/dist/cjs/biz-components/Tabs/Tabs.js +1 -1
  148. package/dist/cjs/biz-components/Tabs/Tabs.js.map +3 -3
  149. package/dist/cjs/biz-components/Tabs/types.d.ts +3 -0
  150. package/dist/cjs/biz-components/Tabs/types.js +1 -1
  151. package/dist/cjs/biz-components/Tabs/types.js.map +1 -1
  152. package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
  153. package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +3 -3
  154. package/dist/cjs/biz-components/Title/index.js +1 -1
  155. package/dist/cjs/biz-components/Title/index.js.map +3 -3
  156. package/dist/cjs/biz-components/Title/types.d.ts +48 -1
  157. package/dist/cjs/biz-components/Title/types.js +1 -1
  158. package/dist/cjs/biz-components/Title/types.js.map +1 -1
  159. package/dist/cjs/biz-components/WebPushPopup/index.d.ts +44 -0
  160. package/dist/cjs/biz-components/WebPushPopup/index.js +2 -0
  161. package/dist/cjs/biz-components/WebPushPopup/index.js.map +7 -0
  162. package/dist/cjs/biz-components/WheelLottery/index.d.ts +11 -11
  163. package/dist/cjs/biz-components/WheelLottery/index.js +1 -1
  164. package/dist/cjs/biz-components/WheelLottery/index.js.map +3 -3
  165. package/dist/cjs/biz-components/WheelLottery/types.d.ts +17 -723
  166. package/dist/cjs/biz-components/WheelLottery/types.js +1 -1
  167. package/dist/cjs/biz-components/WheelLottery/types.js.map +3 -3
  168. package/dist/cjs/biz-components/index.d.ts +13 -0
  169. package/dist/cjs/biz-components/index.js +1 -1
  170. package/dist/cjs/biz-components/index.js.map +3 -3
  171. package/dist/cjs/components/Countdown.js +1 -1
  172. package/dist/cjs/components/Countdown.js.map +3 -3
  173. package/dist/cjs/components/link.js +1 -1
  174. package/dist/cjs/components/link.js.map +2 -2
  175. package/dist/cjs/helpers/index.d.ts +1 -1
  176. package/dist/cjs/helpers/index.js +1 -1
  177. package/dist/cjs/helpers/index.js.map +2 -2
  178. package/dist/cjs/helpers/isLexicalEmpty.d.ts +5 -0
  179. package/dist/cjs/helpers/isLexicalEmpty.js +1 -1
  180. package/dist/cjs/helpers/isLexicalEmpty.js.map +3 -3
  181. package/dist/cjs/hooks/useEmarsysWebPush.d.ts +111 -0
  182. package/dist/cjs/hooks/useEmarsysWebPush.js +2 -0
  183. package/dist/cjs/hooks/useEmarsysWebPush.js.map +7 -0
  184. package/dist/cjs/hooks/useGridRowCount.d.ts +16 -0
  185. package/dist/cjs/hooks/useGridRowCount.js +2 -0
  186. package/dist/cjs/hooks/useGridRowCount.js.map +7 -0
  187. package/dist/cjs/hooks/useProductListTrack.d.ts +43 -0
  188. package/dist/cjs/hooks/useProductListTrack.js +2 -0
  189. package/dist/cjs/hooks/useProductListTrack.js.map +7 -0
  190. package/dist/cjs/types/props.d.ts +16 -0
  191. package/dist/cjs/types/props.js +1 -1
  192. package/dist/cjs/types/props.js.map +1 -1
  193. package/dist/esm/biz-components/AccordionCards/index.js +1 -1
  194. package/dist/esm/biz-components/AccordionCards/index.js.map +3 -3
  195. package/dist/esm/biz-components/ActiveShelf/index.d.ts +2 -2
  196. package/dist/esm/biz-components/ActiveShelf/index.js +1 -1
  197. package/dist/esm/biz-components/ActiveShelf/index.js.map +3 -3
  198. package/dist/esm/biz-components/ActivityMechanism/index.js +1 -1
  199. package/dist/esm/biz-components/ActivityMechanism/index.js.map +3 -3
  200. package/dist/esm/biz-components/ActivitySchedule/index.js +1 -1
  201. package/dist/esm/biz-components/ActivitySchedule/index.js.map +3 -3
  202. package/dist/esm/biz-components/AnchorNavigation/index.js +1 -1
  203. package/dist/esm/biz-components/AnchorNavigation/index.js.map +3 -3
  204. package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js +1 -1
  205. package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js.map +3 -3
  206. package/dist/esm/biz-components/Category/SwiperCategory.js +1 -1
  207. package/dist/esm/biz-components/Category/SwiperCategory.js.map +3 -3
  208. package/dist/esm/biz-components/Category/index.js +1 -1
  209. package/dist/esm/biz-components/Category/index.js.map +3 -3
  210. package/dist/esm/biz-components/Evaluate/index.js +1 -1
  211. package/dist/esm/biz-components/Evaluate/index.js.map +3 -3
  212. package/dist/esm/biz-components/EventSchedule/index.d.ts +2 -7
  213. package/dist/esm/biz-components/EventSchedule/index.js +1 -1
  214. package/dist/esm/biz-components/EventSchedule/index.js.map +3 -3
  215. package/dist/esm/biz-components/Faq/Faq.js +1 -1
  216. package/dist/esm/biz-components/Faq/Faq.js.map +2 -2
  217. package/dist/esm/biz-components/Faq/types.d.ts +1 -0
  218. package/dist/esm/biz-components/FeatureCards/FeatureCards.js +1 -1
  219. package/dist/esm/biz-components/FeatureCards/FeatureCards.js.map +3 -3
  220. package/dist/esm/biz-components/FeaturedBlogPosts/index.d.ts +1 -6
  221. package/dist/esm/biz-components/FeaturedBlogPosts/index.js +1 -1
  222. package/dist/esm/biz-components/FeaturedBlogPosts/index.js.map +3 -3
  223. package/dist/esm/biz-components/GiftBox/index.js +1 -1
  224. package/dist/esm/biz-components/GiftBox/index.js.map +2 -2
  225. package/dist/esm/biz-components/GiftShelf/index.js +1 -1
  226. package/dist/esm/biz-components/GiftShelf/index.js.map +3 -3
  227. package/dist/esm/biz-components/GiftTierShelf/index.js +1 -1
  228. package/dist/esm/biz-components/GiftTierShelf/index.js.map +3 -3
  229. package/dist/esm/biz-components/Graphic/index.js +1 -1
  230. package/dist/esm/biz-components/Graphic/index.js.map +3 -3
  231. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  232. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js.map +3 -3
  233. package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
  234. package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  235. package/dist/esm/biz-components/ImageOverlayShelf/index.d.ts +3 -3
  236. package/dist/esm/biz-components/ImageOverlayShelf/index.js +1 -1
  237. package/dist/esm/biz-components/ImageOverlayShelf/index.js.map +3 -3
  238. package/dist/esm/biz-components/ImageTextOverlay/index.d.ts +4 -0
  239. package/dist/esm/biz-components/ImageTextOverlay/index.js +2 -0
  240. package/dist/esm/biz-components/ImageTextOverlay/index.js.map +7 -0
  241. package/dist/esm/biz-components/ImageTextOverlay/types.d.ts +58 -0
  242. package/dist/esm/biz-components/ImageTextOverlay/types.js +1 -0
  243. package/dist/esm/biz-components/ImageTextOverlay/types.js.map +7 -0
  244. package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
  245. package/dist/esm/biz-components/ImageWithText/ImageWithText.js.map +3 -3
  246. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  247. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +2 -2
  248. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  249. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  250. package/dist/esm/biz-components/LotteryShared/BaseModal.d.ts +61 -0
  251. package/dist/esm/biz-components/LotteryShared/BaseModal.js +2 -0
  252. package/dist/esm/biz-components/LotteryShared/BaseModal.js.map +7 -0
  253. package/dist/esm/biz-components/LotteryShared/ChanceMethods.d.ts +25 -0
  254. package/dist/esm/biz-components/LotteryShared/ChanceMethods.js +2 -0
  255. package/dist/esm/biz-components/LotteryShared/ChanceMethods.js.map +7 -0
  256. package/dist/esm/biz-components/LotteryShared/ErrorModal.d.ts +47 -0
  257. package/dist/esm/biz-components/LotteryShared/ErrorModal.js +2 -0
  258. package/dist/esm/biz-components/LotteryShared/ErrorModal.js.map +7 -0
  259. package/dist/esm/biz-components/LotteryShared/MyRewardsModal.d.ts +101 -0
  260. package/dist/esm/biz-components/LotteryShared/MyRewardsModal.js +2 -0
  261. package/dist/esm/biz-components/LotteryShared/MyRewardsModal.js.map +7 -0
  262. package/dist/esm/biz-components/LotteryShared/PrizePool.d.ts +29 -0
  263. package/dist/esm/biz-components/LotteryShared/PrizePool.js +2 -0
  264. package/dist/esm/biz-components/LotteryShared/PrizePool.js.map +7 -0
  265. package/dist/esm/biz-components/LotteryShared/RulesModal.d.ts +56 -0
  266. package/dist/esm/biz-components/LotteryShared/RulesModal.js +2 -0
  267. package/dist/esm/biz-components/LotteryShared/RulesModal.js.map +7 -0
  268. package/dist/esm/biz-components/LotteryShared/ShareModal.d.ts +79 -0
  269. package/dist/esm/biz-components/LotteryShared/ShareModal.js +2 -0
  270. package/dist/esm/biz-components/LotteryShared/ShareModal.js.map +7 -0
  271. package/dist/esm/biz-components/LotteryShared/WinnerModal.d.ts +27 -0
  272. package/dist/esm/biz-components/LotteryShared/WinnerModal.js +2 -0
  273. package/dist/esm/biz-components/LotteryShared/WinnerModal.js.map +7 -0
  274. package/dist/esm/biz-components/LotteryShared/index.d.ts +23 -0
  275. package/dist/esm/biz-components/LotteryShared/index.js +2 -0
  276. package/dist/esm/biz-components/LotteryShared/index.js.map +7 -0
  277. package/dist/esm/biz-components/LotteryShared/types.d.ts +760 -0
  278. package/dist/esm/biz-components/LotteryShared/types.js +2 -0
  279. package/dist/esm/biz-components/LotteryShared/types.js.map +7 -0
  280. package/dist/esm/biz-components/Marquee/Marquee.js +1 -1
  281. package/dist/esm/biz-components/Marquee/Marquee.js.map +3 -3
  282. package/dist/esm/biz-components/Marquee/type.d.ts +5 -2
  283. package/dist/esm/biz-components/Media/index.d.ts +15 -3
  284. package/dist/esm/biz-components/Media/index.js +1 -1
  285. package/dist/esm/biz-components/Media/index.js.map +3 -3
  286. package/dist/esm/biz-components/MediaEndorsement/index.js +2 -2
  287. package/dist/esm/biz-components/MediaEndorsement/index.js.map +3 -3
  288. package/dist/esm/biz-components/MediaPlayerMulti/index.js +1 -1
  289. package/dist/esm/biz-components/MediaPlayerMulti/index.js.map +3 -3
  290. package/dist/esm/biz-components/MediaShelf/index.d.ts +2 -2
  291. package/dist/esm/biz-components/MediaShelf/index.js +1 -1
  292. package/dist/esm/biz-components/MediaShelf/index.js.map +3 -3
  293. package/dist/esm/biz-components/MemberEquity/index.js +2 -2
  294. package/dist/esm/biz-components/MemberEquity/index.js.map +3 -3
  295. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  296. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
  297. package/dist/esm/biz-components/NavigationSearch/index.js +2 -2
  298. package/dist/esm/biz-components/NavigationSearch/index.js.map +3 -3
  299. package/dist/esm/biz-components/ProductHero/ProductHero.js +1 -1
  300. package/dist/esm/biz-components/ProductHero/ProductHero.js.map +3 -3
  301. package/dist/esm/biz-components/ProductLottery/MediaDrawArea.d.ts +4 -0
  302. package/dist/esm/biz-components/ProductLottery/MediaDrawArea.js +2 -0
  303. package/dist/esm/biz-components/ProductLottery/MediaDrawArea.js.map +7 -0
  304. package/dist/esm/biz-components/ProductLottery/index.d.ts +17 -0
  305. package/dist/esm/biz-components/ProductLottery/index.js +2 -0
  306. package/dist/esm/biz-components/ProductLottery/index.js.map +7 -0
  307. package/dist/esm/biz-components/ProductLottery/types.d.ts +363 -0
  308. package/dist/esm/biz-components/ProductLottery/types.js +2 -0
  309. package/dist/esm/biz-components/ProductLottery/types.js.map +7 -0
  310. package/dist/esm/biz-components/ProductNav/ProductNav.js +1 -1
  311. package/dist/esm/biz-components/ProductNav/ProductNav.js.map +3 -3
  312. package/dist/esm/biz-components/PromotionalBar/index.js +1 -1
  313. package/dist/esm/biz-components/PromotionalBar/index.js.map +3 -3
  314. package/dist/esm/biz-components/SceneShelfV2/index.d.ts +88 -0
  315. package/dist/esm/biz-components/SceneShelfV2/index.js +2 -0
  316. package/dist/esm/biz-components/SceneShelfV2/index.js.map +7 -0
  317. package/dist/esm/biz-components/SceneShelfV3/ProductCard.d.ts +80 -0
  318. package/dist/esm/biz-components/SceneShelfV3/ProductCard.js +2 -0
  319. package/dist/esm/biz-components/SceneShelfV3/ProductCard.js.map +7 -0
  320. package/dist/esm/biz-components/SceneShelfV3/index.d.ts +76 -0
  321. package/dist/esm/biz-components/SceneShelfV3/index.js +2 -0
  322. package/dist/esm/biz-components/SceneShelfV3/index.js.map +7 -0
  323. package/dist/esm/biz-components/SceneShelfV3/types.d.ts +19 -0
  324. package/dist/esm/biz-components/SceneShelfV3/types.js +1 -0
  325. package/dist/esm/biz-components/SceneShelfV3/types.js.map +7 -0
  326. package/dist/esm/biz-components/SecondaryBanner/index.js +1 -1
  327. package/dist/esm/biz-components/SecondaryBanner/index.js.map +3 -3
  328. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
  329. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
  330. package/dist/esm/biz-components/Specs/index.js +1 -1
  331. package/dist/esm/biz-components/Specs/index.js.map +3 -3
  332. package/dist/esm/biz-components/Subscribe/index.js +1 -1
  333. package/dist/esm/biz-components/Subscribe/index.js.map +2 -2
  334. package/dist/esm/biz-components/SwiperBox/index.js +1 -1
  335. package/dist/esm/biz-components/SwiperBox/index.js.map +3 -3
  336. package/dist/esm/biz-components/Tabs/Tabs.js +1 -1
  337. package/dist/esm/biz-components/Tabs/Tabs.js.map +3 -3
  338. package/dist/esm/biz-components/Tabs/types.d.ts +3 -0
  339. package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
  340. package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +3 -3
  341. package/dist/esm/biz-components/Title/index.js +1 -1
  342. package/dist/esm/biz-components/Title/index.js.map +3 -3
  343. package/dist/esm/biz-components/Title/types.d.ts +48 -1
  344. package/dist/esm/biz-components/WebPushPopup/index.d.ts +44 -0
  345. package/dist/esm/biz-components/WebPushPopup/index.js +2 -0
  346. package/dist/esm/biz-components/WebPushPopup/index.js.map +7 -0
  347. package/dist/esm/biz-components/WheelLottery/index.d.ts +11 -11
  348. package/dist/esm/biz-components/WheelLottery/index.js +1 -1
  349. package/dist/esm/biz-components/WheelLottery/index.js.map +3 -3
  350. package/dist/esm/biz-components/WheelLottery/types.d.ts +17 -723
  351. package/dist/esm/biz-components/WheelLottery/types.js +1 -1
  352. package/dist/esm/biz-components/WheelLottery/types.js.map +3 -3
  353. package/dist/esm/biz-components/index.d.ts +13 -0
  354. package/dist/esm/biz-components/index.js +1 -1
  355. package/dist/esm/biz-components/index.js.map +3 -3
  356. package/dist/esm/components/Countdown.js +1 -1
  357. package/dist/esm/components/Countdown.js.map +3 -3
  358. package/dist/esm/components/link.js +1 -1
  359. package/dist/esm/components/link.js.map +2 -2
  360. package/dist/esm/helpers/index.d.ts +1 -1
  361. package/dist/esm/helpers/index.js +1 -1
  362. package/dist/esm/helpers/index.js.map +3 -3
  363. package/dist/esm/helpers/isLexicalEmpty.d.ts +5 -0
  364. package/dist/esm/helpers/isLexicalEmpty.js +1 -1
  365. package/dist/esm/helpers/isLexicalEmpty.js.map +3 -3
  366. package/dist/esm/hooks/useEmarsysWebPush.d.ts +111 -0
  367. package/dist/esm/hooks/useEmarsysWebPush.js +2 -0
  368. package/dist/esm/hooks/useEmarsysWebPush.js.map +7 -0
  369. package/dist/esm/hooks/useGridRowCount.d.ts +16 -0
  370. package/dist/esm/hooks/useGridRowCount.js +2 -0
  371. package/dist/esm/hooks/useGridRowCount.js.map +7 -0
  372. package/dist/esm/hooks/useProductListTrack.d.ts +43 -0
  373. package/dist/esm/hooks/useProductListTrack.js +2 -0
  374. package/dist/esm/hooks/useProductListTrack.js.map +7 -0
  375. package/dist/esm/types/props.d.ts +16 -0
  376. package/package.json +4 -2
  377. package/static/emarsys-service-worker.js +31 -0
  378. package/style.css +208 -5
  379. package/tailwind.config.js +11 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/GiftShelf/index.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport { Text, Picture, Button, Container, Heading } from '../../components/index.js'\nimport { cva } from 'class-variance-authority'\nimport type { GiftShelfProps, GiftShelfItem, CountdownConfig, ResponsiveBackgroundImage } from './types.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { Product, ProductVariant } from '../Listing/types/product.js'\nimport { formatVariantPrice } from '../Listing/utils/index.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { replaceTemplate } from '../Listing/utils/textFormat.js'\nimport type { GiftShelfProduct } from './types.js'\nimport type { Media } from '../../types/props.js'\n\n/**\n * Card style variants for gift shelf\n */\nconst giftCardVariants = cva('desktop:px-6 rounded-card relative min-w-0 overflow-hidden p-4', {\n variants: {\n state: {\n light: 'bg-[#EAEAEC]',\n dark: 'bg-[#1E2024]',\n },\n },\n defaultVariants: {\n state: 'light',\n },\n})\n\n/**\n * Content layout variants - \u63A7\u5236 Background image \u548C Bottom info area \u7684\u5E03\u5C40\n * horizontal \u5E03\u5C40\u4EC5\u5728 desktop (\u22651440px) \u65AD\u70B9\u751F\u6548\n */\nconst contentLayoutVariants = cva('', {\n variants: {\n layout: {\n vertical: '',\n horizontal: 'desktop:flex desktop:flex-row desktop:items-stretch desktop:gap-10',\n },\n },\n defaultVariants: {\n layout: 'vertical',\n },\n})\n\n/**\n * Image area variants\n * horizontal \u5E03\u5C40\u4EC5\u5728 desktop (\u22651440px) \u65AD\u70B9\u751F\u6548\n */\nconst imageAreaVariants = cva(\n 'desktop:max-w-[268px] lg-desktop:max-w-[356px] lg-desktop:h-[171px] relative mx-auto h-[118px] max-w-[256px] ',\n {\n variants: {\n layout: {\n vertical: '',\n horizontal: 'desktop:flex-1 desktop:h-[122px] lg-desktop:h-[161px]',\n },\n },\n defaultVariants: {\n layout: 'vertical',\n },\n }\n)\n\n/**\n * Info area variants\n * horizontal \u5E03\u5C40\u4EC5\u5728 desktop (\u22651440px) \u65AD\u70B9\u751F\u6548\n */\nconst infoAreaVariants = cva('mt-3', {\n variants: {\n layout: {\n vertical: '',\n horizontal: 'desktop:mt-0 desktop:flex-1 desktop:flex desktop:flex-col desktop:justify-center',\n },\n },\n defaultVariants: {\n layout: 'vertical',\n },\n})\n\n/**\n * Button style variants\n */\nconst buttonVariants = cva('mt-4 self-start', {\n variants: {\n state: {\n light: 'bg-[#080A0F] text-white',\n dark: 'bg-white text-[#080A0F]',\n },\n },\n defaultVariants: {\n state: 'light',\n },\n})\n\n/**\n * Text style variants\n */\nconst textVariants = cva('', {\n variants: {\n state: {\n light: 'text-[#080A0F]',\n dark: 'text-white',\n },\n },\n defaultVariants: {\n state: 'light',\n },\n})\n\n/**\n * Convert ResponsiveBackgroundImage to Picture source string\n * Format: \"url1 1920, url2 1439, url3 1024, url4 767, url5\"\n */\nconst getResponsiveSource = (bgImage?: ResponsiveBackgroundImage): string | undefined => {\n if (!bgImage) return undefined\n\n const sources: string[] = []\n\n // lg-desktop: \u22651920px\n if (bgImage.lgDesktop?.url) {\n sources.push(`${bgImage.lgDesktop.url} 1920`)\n }\n // desktop: \u22651440px\n if (bgImage.desktop?.url) {\n sources.push(`${bgImage.desktop.url} 1439`)\n }\n // laptop: \u22651025px\n if (bgImage.laptop?.url) {\n sources.push(`${bgImage.laptop.url} 1024`)\n }\n // tablet: \u2265768px\n if (bgImage.tablet?.url) {\n sources.push(`${bgImage.tablet.url} 767`)\n }\n // default (mobile): <768px\n if (bgImage.default?.url) {\n sources.push(bgImage.default.url)\n }\n\n return sources.length > 0 ? sources.join(', ') : undefined\n}\n\n/**\n * Get alt text from ResponsiveBackgroundImage\n */\nconst getBackgroundAlt = (bgImage?: ResponsiveBackgroundImage): string => {\n if (!bgImage) return ''\n return (\n bgImage.default?.alt ||\n bgImage.tablet?.alt ||\n bgImage.laptop?.alt ||\n bgImage.desktop?.alt ||\n bgImage.lgDesktop?.alt ||\n ''\n )\n}\n\n/**\n * Format countdown time\n */\nconst formatTime = (seconds: number) => {\n const hours = Math.floor(seconds / 3600)\n const minutes = Math.floor((seconds % 3600) / 60)\n const secs = seconds % 60\n return `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`\n}\n\n/**\n * \u89E3\u6790\u5F00\u59CB\u65F6\u95F4\uFF0C\u652F\u6301 ISO 8601 \u5B57\u7B26\u4E32\u6216\u65F6\u95F4\u6233\n */\nconst parseStartTime = (startTime: string | number): number => {\n if (typeof startTime === 'number') {\n return startTime\n }\n // \u89E3\u6790 ISO 8601 \u5B57\u7B26\u4E32\n const parsed = new Date(startTime).getTime()\n return isNaN(parsed) ? 0 : parsed\n}\n\n/**\n * \u8BA1\u7B97\u5F53\u524D\u662F\u5426\u5904\u4E8E\u8F6E\u6B21\u5207\u6362\u671F\uFF08\u4E0B\u4E00\u8F6E\u5F00\u59CB\u524D5\u5206\u949F\uFF09\n * @param countdown \u5012\u8BA1\u65F6\u914D\u7F6E\n * @returns \u662F\u5426\u5904\u4E8E\u5207\u6362\u671F\n */\nconst isInTransitionPeriod = (countdown?: CountdownConfig): boolean => {\n if (!countdown) return false\n const startTimeMs = parseStartTime(countdown.startTime)\n const durationMs = (countdown.durationDays ?? 1) * 24 * 3600 * 1000\n const rounds = countdown.rounds ?? 1\n const now = Date.now()\n\n // \u672A\u5230\u5F00\u59CB\u65F6\u95F4\n if (now < startTimeMs) return false\n\n // \u8BA1\u7B97\u5F53\u524D\u8F6E\u6B21\n const elapsed = now - startTimeMs\n const currentRound = Math.floor(elapsed / durationMs) + 1\n\n // \u6240\u6709\u8F6E\u6B21\u5DF2\u7ED3\u675F\n if (currentRound > rounds) return false\n\n // \u8BA1\u7B97\u5F53\u524D\u8F6E\u6B21\u7684\u7ED3\u675F\u65F6\u95F4\n const currentRoundEndTime = startTimeMs + currentRound * durationMs\n\n // \u8DDD\u79BB\u5F53\u524D\u8F6E\u6B21\u7ED3\u675F\u7684\u65F6\u95F4\n const timeUntilRoundEnd = currentRoundEndTime - now\n\n // \u5982\u679C\u8DDD\u79BB\u7ED3\u675F\u4E0D\u52305\u5206\u949F\uFF0C\u5904\u4E8E\u5207\u6362\u671F\n const TRANSITION_PERIOD_MS = 5 * 60 * 1000 // 5\u5206\u949F\n return timeUntilRoundEnd <= TRANSITION_PERIOD_MS && timeUntilRoundEnd > 0\n}\n\n/**\n * \u6839\u636E\u5012\u8BA1\u65F6\u914D\u7F6E\u8BA1\u7B97\u5F53\u524D\u8F6E\u6B21\u7684 Code\n * @param codePrefix Code \u524D\u7F00\n * @param countdown \u5012\u8BA1\u65F6\u914D\u7F6E\n * @returns \u5B8C\u6574\u7684 Code\uFF08\u524D\u7F00 + MMDD \u540E\u7F00\uFF09\n * @description \u7EDF\u4E00\u4F7F\u7528 UTC \u65F6\u95F4\u8BA1\u7B97\uFF0C\u786E\u4FDD\u5168\u7403\u4EFB\u4F55\u65F6\u533A\u5F97\u5230\u76F8\u540C\u7684 code\n */\nconst getCodeWithSuffix = (codePrefix?: string, countdown?: CountdownConfig): string => {\n if (!codePrefix || !countdown) return codePrefix || ''\n\n const startTimeMs = parseStartTime(countdown.startTime)\n const durationMs = (countdown.durationDays ?? 1) * 24 * 3600 * 1000\n const rounds = countdown.rounds ?? 1\n const now = Date.now()\n\n // \u672A\u5230\u5F00\u59CB\u65F6\u95F4\uFF0C\u4F7F\u7528\u7B2C\u4E00\u8F6E\u7684\u65E5\u671F\uFF08UTC \u65F6\u95F4\uFF09\n if (now < startTimeMs) {\n const date = new Date(startTimeMs)\n const suffix = `${(date.getUTCMonth() + 1).toString().padStart(2, '0')}${date.getUTCDate().toString().padStart(2, '0')}`\n return `${codePrefix}${suffix}`\n }\n\n // \u8BA1\u7B97\u5F53\u524D\u5904\u4E8E\u7B2C\u51E0\u8F6E\uFF08\u4ECE 1 \u5F00\u59CB\uFF09\n const elapsed = now - startTimeMs\n const currentRound = Math.min(Math.floor(elapsed / durationMs) + 1, rounds)\n\n // \u8BA1\u7B97\u5F53\u524D\u8F6E\u6B21\u7684\u5F00\u59CB\u65E5\u671F\n const currentRoundStartMs = startTimeMs + (currentRound - 1) * durationMs\n const date = new Date(currentRoundStartMs)\n\n // \u683C\u5F0F\u5316\u4E3A MMDD\uFF08\u4F7F\u7528 UTC \u65F6\u95F4\uFF09\n const suffix = `${(date.getUTCMonth() + 1).toString().padStart(2, '0')}${date.getUTCDate().toString().padStart(2, '0')}`\n\n return `${codePrefix}${suffix}`\n}\n\n/**\n * \u5012\u8BA1\u65F6\u72B6\u6001\u7C7B\u578B\n */\ntype CountdownState = 'beforeStart' | 'running' | 'lastRound' | 'finished'\n\n/**\n * Countdown Component\n * \u652F\u6301\u591A\u8F6E\u5012\u8BA1\u65F6\uFF0C\u663E\u793A\u4E0D\u540C\u72B6\u6001\u7684\u6807\u7B7E\n */\nconst Countdown = React.memo(\n ({\n config,\n theme = 'light',\n className,\n countdownText = 'Next round start time',\n lastRoundText = 'Last round',\n beforeStartText = 'Start time',\n countdownIcon,\n onStateChange,\n }: {\n config: CountdownConfig\n theme?: 'light' | 'dark'\n className?: string\n countdownText?: string\n lastRoundText?: string\n beforeStartText?: string\n countdownIcon?: Media\n onStateChange?: (state: CountdownState) => void\n }) => {\n const [timeLeft, setTimeLeft] = React.useState(0)\n const [countdownState, setCountdownState] = React.useState<CountdownState>('beforeStart')\n\n // \u89E3\u6790\u5F00\u59CB\u65F6\u95F4\u4E3A\u65F6\u95F4\u6233\n const startTimeMs = React.useMemo(() => parseStartTime(config.startTime), [config.startTime])\n\n const rounds = config.rounds ?? 1\n // \u9ED8\u8BA4 1 \u5929\uFF0C\u8F6C\u6362\u4E3A\u6BEB\u79D2 (1\u5929 = 24\u5C0F\u65F6 = 86400\u79D2 = 86400000\u6BEB\u79D2)\n const durationMs = (config.durationDays ?? 1) * 24 * 3600 * 1000\n\n React.useEffect(() => {\n const calculateCountdown = () => {\n const now = Date.now()\n\n // \u672A\u5230\u5F00\u59CB\u65F6\u95F4\uFF0C\u663E\u793A\u5F00\u59CB\u524D\u5012\u8BA1\u65F6\n if (now < startTimeMs) {\n const diff = Math.max(0, Math.floor((startTimeMs - now) / 1000))\n setTimeLeft(diff)\n setCountdownState('beforeStart')\n return\n }\n\n // \u8BA1\u7B97\u5DF2\u7ECF\u8FC7\u53BB\u7684\u65F6\u95F4\n const elapsed = now - startTimeMs\n // \u8BA1\u7B97\u5F53\u524D\u5904\u4E8E\u7B2C\u51E0\u8F6E\uFF08\u4ECE 1 \u5F00\u59CB\uFF09\n const currentRound = Math.floor(elapsed / durationMs) + 1\n\n // \u6240\u6709\u8F6E\u6B21\u5DF2\u7ED3\u675F\n if (currentRound > rounds) {\n setCountdownState('finished')\n return\n }\n\n // \u8BA1\u7B97\u5F53\u524D\u8F6E\u6B21\u7684\u76EE\u6807\u65F6\u95F4\n const currentRoundTargetTime = startTimeMs + currentRound * durationMs\n // \u8BA1\u7B97\u5269\u4F59\u79D2\u6570\n const diff = Math.max(0, Math.floor((currentRoundTargetTime - now) / 1000))\n\n setTimeLeft(diff)\n // \u5224\u65AD\u662F\u5426\u662F\u6700\u540E\u4E00\u8F6E\n setCountdownState(currentRound === rounds ? 'lastRound' : 'running')\n }\n\n calculateCountdown()\n const timer = setInterval(calculateCountdown, 1000)\n\n return () => clearInterval(timer)\n }, [startTimeMs, durationMs, rounds])\n\n // \u901A\u77E5\u7236\u7EC4\u4EF6\u72B6\u6001\u53D8\u5316\n React.useEffect(() => {\n onStateChange?.(countdownState)\n }, [countdownState, onStateChange])\n\n // \u6839\u636E\u72B6\u6001\u83B7\u53D6\u663E\u793A\u7684\u6807\u7B7E\u6587\u672C\n const labelText = React.useMemo(() => {\n switch (countdownState) {\n case 'beforeStart':\n return beforeStartText\n case 'lastRound':\n return lastRoundText\n default:\n return countdownText\n }\n }, [countdownState, beforeStartText, lastRoundText, countdownText])\n\n // \u6240\u6709\u8F6E\u6B21\u5DF2\u7ED3\u675F\uFF0C\u4E0D\u6E32\u67D3\n if (countdownState === 'finished') {\n return null\n }\n\n return (\n <div\n className={cn(\n 'desktop:gap-2 laptop:text-base flex items-center gap-1 text-sm',\n theme === 'dark' ? 'text-white' : 'text-[#080A0F]',\n className\n )}\n >\n {countdownIcon && (\n <Picture\n source={countdownIcon.url}\n alt={countdownIcon.alt}\n className=\"laptop:size-5 size-4 shrink-0\"\n imgClassName=\"size-full object-contain\"\n />\n )}\n <Text html={labelText} className=\"whitespace-nowrap font-bold\" />\n <span className=\"font-bold\">|</span>\n <Text className=\"font-bold\" html={formatTime(timeLeft)} />\n </div>\n )\n }\n)\n\nCountdown.displayName = 'Countdown'\n\n/**\n * Progress Bar Component\n */\nconst ProgressBar = React.memo(\n ({ progress, theme = 'light', className }: { progress: number; theme?: 'light' | 'dark'; className?: string }) => {\n // Clamp progress between 0 and 100\n const clampedProgress = Math.min(100, Math.max(0, progress))\n\n return (\n <div\n className={cn(\n 'flex h-2 w-full items-stretch overflow-hidden rounded-full',\n theme === 'dark' ? 'bg-white/20' : 'bg-black/20',\n className\n )}\n role=\"progressbar\"\n aria-valuenow={clampedProgress}\n aria-valuemin={0}\n aria-valuemax={100}\n >\n <div\n className={cn(\n 'h-full rounded-full transition-all duration-300',\n theme === 'dark' ? 'bg-white' : 'bg-[#080A0F]'\n )}\n style={{ width: `${clampedProgress}%` }}\n />\n </div>\n )\n }\n)\n\nProgressBar.displayName = 'ProgressBar'\n\n/**\n * Gift Shelf Card Component\n */\nconst GiftShelfCard = React.memo(\n ({\n item,\n theme = 'light',\n layout = 'vertical',\n className,\n buttonClassName,\n countdownClassName,\n onButtonClick,\n buildData,\n buttonText,\n remainText,\n lowStockText,\n soldOutButtonText,\n discountText = 'Only {price}',\n countdownText,\n countdownIcon,\n lastRoundText,\n beforeStartText,\n comingSoonButtonText,\n loading,\n }: {\n item: GiftShelfItem\n theme?: 'light' | 'dark'\n layout?: 'vertical' | 'horizontal'\n className?: string\n buttonClassName?: string\n countdownClassName?: string\n onButtonClick?: ({ product, code }: { product: GiftShelfProduct; code: string }) => void\n buildData?: {\n products: Product[]\n }\n buttonText: string\n remainText?: string\n lowStockText?: string\n soldOutButtonText?: string\n discountText?: string\n countdownText?: string\n countdownIcon?: Media\n lastRoundText?: string\n beforeStartText?: string\n comingSoonButtonText?: string\n loading?: boolean\n }) => {\n const { locale = 'us' } = useAiuiContext()\n // \u83B7\u53D6\u7B2C\u4E00\u4E2A\u4EA7\u54C1\u7684\u7B80\u5316\u6570\u636E\n const firstProduct = item.products?.[0]\n\n // \u68C0\u6D4B\u662F\u5426\u5904\u4E8E\u8F6E\u6B21\u5207\u6362\u671F + \u5F53\u524D\u8F6E\u6B21 code\uFF08\u6BCF\u79D2\u66F4\u65B0\uFF09\n const [isTransitioning, setIsTransitioning] = React.useState(() => isInTransitionPeriod(item.countdown))\n const [currentCode, setCurrentCode] = React.useState(() => getCodeWithSuffix(item.codePrefix, item.countdown))\n // \u5012\u8BA1\u65F6\u72B6\u6001\n const [countdownState, setCountdownState] = React.useState<CountdownState>('beforeStart')\n\n React.useEffect(() => {\n const checkAndUpdate = () => {\n // \u66F4\u65B0\u8F6E\u6B21\u5207\u6362\u72B6\u6001\n setIsTransitioning(isInTransitionPeriod(item.countdown))\n // \u66F4\u65B0\u5F53\u524D\u8F6E\u6B21 code\uFF08\u4EC5\u5728\u503C\u53D8\u5316\u65F6\u66F4\u65B0\uFF09\n const newCode = getCodeWithSuffix(item.codePrefix, item.countdown)\n setCurrentCode(prev => (prev !== newCode ? newCode : prev))\n }\n\n // \u521D\u59CB\u68C0\u67E5\n checkAndUpdate()\n // \u6BCF\u79D2\u68C0\u67E5\u4E00\u6B21\n const timer = setInterval(checkAndUpdate, 1000)\n\n return () => clearInterval(timer)\n }, [item.codePrefix, item.countdown])\n\n // \u5012\u8BA1\u65F6\u72B6\u6001\u53D8\u5316\u56DE\u8C03\n const handleCountdownStateChange = React.useCallback((state: CountdownState) => {\n setCountdownState(state)\n }, [])\n\n // \u901A\u8FC7 handle \u5339\u914D buildData \u4E2D\u7684\u5B8C\u6574\u4EA7\u54C1\u6570\u636E\n const fullProduct = React.useMemo(() => {\n if (!firstProduct?.handle || !buildData?.products?.length) return null\n return buildData.products.find(p => p.handle === firstProduct.handle) || null\n }, [firstProduct?.handle, buildData?.products])\n\n const fullProductVariant = React.useMemo(\n () => fullProduct?.variants?.find(variant => variant?.sku === firstProduct?.sku) || ({} as ProductVariant),\n [firstProduct?.sku, fullProduct?.variants]\n )\n\n // \u7EC4\u5408\u5C55\u793A\u6570\u636E\uFF08\u4F18\u5148\u4F7F\u7528\u8BE6\u7EC6\u6570\u636E\uFF0C\u56DE\u9000\u5230\u7B80\u5316\u6570\u636E\uFF09\n const displayData = React.useMemo(() => {\n const { price, basePrice } = formatVariantPrice({\n locale: locale || 'us',\n baseAmount: fullProductVariant?.price?.amount,\n amount: firstProduct?.custom_price ?? fullProductVariant?.price?.amount,\n currencyCode: fullProduct?.price?.currencyCode || 'USD',\n })\n\n return {\n // \u4E3B\u4EF7\u683C/\u4EF7\u503C\u5C55\u793A\uFF1A\u6709\u8BE6\u7EC6\u6570\u636E\u65F6\u663E\u793A\u4EF7\u683C\uFF0C\u5426\u5219\u663E\u793A\u4EA7\u54C1\u540D\n value: basePrice,\n // \u4EA7\u54C1\u63CF\u8FF0/\u6807\u9898\uFF1A\u6709\u8BE6\u7EC6\u6570\u636E\u65F6\u663E\u793A\u6807\u9898\uFF0C\u5426\u5219\u4E3A\u7A7A\uFF08\u907F\u514D\u91CD\u590D\u663E\u793A\uFF09\n description: firstProduct?.custom_description,\n // \u4F18\u60E0\u4EF7\u683C\n salePrice: replaceTemplate(discountText || '', {\n price,\n }),\n }\n }, [\n fullProduct,\n fullProductVariant,\n locale,\n discountText,\n firstProduct?.custom_price,\n firstProduct?.custom_description,\n ])\n\n const handleClick = React.useCallback(() => {\n onButtonClick?.({ product: firstProduct, code: currentCode })\n }, [onButtonClick, currentCode, firstProduct])\n\n return (\n <div className={cn(giftCardVariants({ state: theme }), className)} data-ui-component-id=\"GiftShelfCard\">\n {/* Countdown section - above the card content (only in vertical layout) */}\n {item.countdown && (\n <div className=\"laptop:h-[24px] mb-4 h-[20px]\">\n <Countdown\n config={item.countdown}\n theme={theme}\n className={countdownClassName}\n countdownText={countdownText}\n lastRoundText={lastRoundText}\n beforeStartText={beforeStartText}\n countdownIcon={countdownIcon}\n onStateChange={handleCountdownStateChange}\n />\n </div>\n )}\n\n {/* Content layout wrapper - \u63A7\u5236 Background image \u548C Bottom info area \u7684\u5E03\u5C40 */}\n <div className={contentLayoutVariants({ layout })}>\n {/* Background image - responsive across 5 breakpoints */}\n <div className={imageAreaVariants({ layout })}>\n {item.backgroundImage && (\n <Picture\n source={getResponsiveSource(item.backgroundImage)}\n alt={getBackgroundAlt(item.backgroundImage)}\n className=\"rounded-card size-full overflow-hidden object-cover\"\n imgClassName=\"h-full w-full object-cover\"\n />\n )}\n {/* Card content area */}\n <div className=\"absolute top-1/2 z-10 w-full -translate-y-1/2 px-6\">\n {/* Value and description */}\n <div className=\"flex flex-col gap-1\">\n {/* Main value display */}\n {displayData.value && (\n <Heading\n html={displayData.value}\n size={4}\n className={cn('font-bold leading-none', textVariants({ state: theme }))}\n />\n )}\n\n {/* Description */}\n {displayData.description && (\n <Text\n html={displayData.description}\n className={cn('text-base font-bold opacity-60', textVariants({ state: theme }))}\n />\n )}\n </div>\n </div>\n </div>\n\n {/* Bottom/Right info area */}\n <div className={infoAreaVariants({ layout })}>\n {/* Sale price */}\n {displayData.salePrice && (\n <Text\n as=\"p\"\n html={displayData.salePrice}\n className={cn('lg-desktop:text-2xl text-xl font-bold', textVariants({ state: theme }))}\n />\n )}\n\n {/* Progress bar - \u8D85\u5356\u65F6\u9690\u85CF\uFF08availableForSale=true \u4E14 quantityAvailable<=0\uFF09 */}\n <ProgressBar\n progress={\n firstProduct?.custom_inventory\n ? ((fullProductVariant?.quantityAvailable || 0) / firstProduct.custom_inventory) * 100\n : 0\n }\n theme={theme}\n className={cn(\n 'mb-1 mt-2',\n fullProductVariant?.availableForSale && (fullProductVariant?.quantityAvailable ?? 0) <= 0 && 'invisible'\n )}\n />\n\n {/* Remain text - \u6B63\u5E38\u5E93\u5B58\u63D0\u793A */}\n {remainText && (fullProductVariant?.quantityAvailable ?? 0) >= 0 && (\n <Text\n html={replaceTemplate(remainText, {\n inventory: firstProduct?.custom_inventory?.toString() || '',\n quantity: fullProductVariant?.quantityAvailable?.toString() || '0',\n })}\n as=\"p\"\n className={cn('laptop:text-base text-sm font-bold', textVariants({ state: theme }))}\n />\n )}\n\n {/* Low stock text - \u652F\u6301\u8D85\u5356\u65F6\u663E\u793A\uFF08availableForSale=true \u4F46 quantityAvailable<=0\uFF09 */}\n {lowStockText &&\n fullProductVariant?.availableForSale &&\n (fullProductVariant?.quantityAvailable ?? 0) < 0 && (\n <Text\n html={lowStockText}\n as=\"p\"\n className={cn('laptop:text-base text-sm font-bold text-red-500', textVariants({ state: theme }))}\n />\n )}\n\n {/* Action button */}\n <Button\n size=\"lg\"\n className={cn(buttonVariants({ state: theme }), buttonClassName)}\n onClick={handleClick}\n disabled={\n !fullProductVariant?.availableForSale ||\n loading ||\n isTransitioning ||\n countdownState === 'beforeStart' ||\n countdownState === 'finished'\n }\n loading={loading && fullProductVariant?.availableForSale}\n >\n {countdownState === 'beforeStart'\n ? comingSoonButtonText || buttonText\n : fullProductVariant?.availableForSale\n ? buttonText\n : soldOutButtonText || buttonText}\n </Button>\n </div>\n </div>\n </div>\n )\n }\n)\n\nGiftShelfCard.displayName = 'GiftShelfCard'\n\n/**\n * GiftShelf - Gift/Promotion Shelf Component\n *\n * @description Display gift cards with countdown, pricing, and purchase buttons\n */\nconst GiftShelf = React.forwardRef<HTMLDivElement, GiftShelfProps>(\n ({ classNames = {}, data, onButtonClick, buildData, loading, ...rest }, ref) => {\n const theme = data.theme || 'light'\n\n const itemsPerRow = React.useMemo(() => {\n return data?.items?.length || 4\n }, [data?.items])\n\n // \u5F53\u5361\u7247\u6570\u91CF\u4E3A 2 \u65F6\u4F7F\u7528\u6C34\u5E73\u5E03\u5C40\uFF0C\u5426\u5219\u4F7F\u7528\u5782\u76F4\u5E03\u5C40\n const cardLayout = itemsPerRow === 2 ? 'horizontal' : 'vertical'\n\n const swiperBreakpoints = React.useMemo(() => {\n const getBreakpointConfig = (breakpoint: 'mobile' | 'tablet' | 'laptop' | 'desktop') => {\n switch (breakpoint) {\n case 'mobile':\n return { slidesPerView: 1.2, spaceBetween: 12 }\n case 'tablet':\n if (itemsPerRow <= 2) return { slidesPerView: 2, spaceBetween: 12 }\n return { slidesPerView: 2.5, spaceBetween: 12 }\n case 'laptop':\n if (itemsPerRow <= 3) return { slidesPerView: itemsPerRow, spaceBetween: 16 }\n return { slidesPerView: 3.01, spaceBetween: 16 }\n case 'desktop':\n return { slidesPerView: Math.min(itemsPerRow, 4), spaceBetween: 20 }\n }\n }\n\n return {\n 0: getBreakpointConfig('mobile'),\n 768: getBreakpointConfig('tablet'),\n 1025: getBreakpointConfig('laptop'),\n 1440: getBreakpointConfig('desktop'),\n }\n }, [itemsPerRow])\n\n return (\n <Container\n ref={ref}\n className={cn(classNames?.root)}\n childClassName=\"overflow-hidden\"\n data-ui-component-id=\"GiftShelf\"\n {...rest}\n >\n {/* Cards swiper */}\n <Swiper breakpoints={swiperBreakpoints} className=\"w-full !overflow-visible\">\n {data.items.map((item, index) => (\n <SwiperSlide key={'giftShelfCardItem' + index}>\n <GiftShelfCard\n item={item}\n theme={theme}\n layout={cardLayout}\n className={classNames?.card}\n buttonClassName={classNames?.button}\n countdownClassName={classNames?.countdown}\n onButtonClick={onButtonClick}\n buildData={buildData}\n buttonText={data.buttonText}\n discountText={data.discountText}\n remainText={data.remainText}\n lowStockText={data.lowStockText}\n soldOutButtonText={data.soldOutButtonText}\n countdownText={data.countdownText}\n lastRoundText={data.lastRoundText}\n countdownIcon={data?.countdownIcon}\n beforeStartText={data.beforeStartText}\n comingSoonButtonText={data.comingSoonButtonText}\n loading={loading}\n />\n </SwiperSlide>\n ))}\n </Swiper>\n </Container>\n )\n }\n)\n\nGiftShelf.displayName = 'GiftShelf'\n\nexport default withLayout(GiftShelf)\nexport type {\n GiftShelfProps,\n GiftShelfData,\n GiftShelfItem,\n GiftShelfProduct,\n CountdownConfig,\n ResponsiveBackgroundImage,\n} from './types.js'\n"],
5
- "mappings": "olBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAgWM,IAAAI,EAAA,6BA9VNC,EAAuB,qBACvBC,EAAmB,kCACnBC,EAA0D,qCAC1DC,EAAoB,oCAEpBC,EAAoC,wBACpCC,EAA2B,kCAE3BC,EAAmC,qCACnCC,EAA+B,oCAC/BC,EAAgC,0CAOhC,MAAMC,MAAmB,OAAI,iEAAkE,CAC7F,SAAU,CACR,MAAO,CACL,MAAO,eACP,KAAM,cACR,CACF,EACA,gBAAiB,CACf,MAAO,OACT,CACF,CAAC,EAMKC,MAAwB,OAAI,GAAI,CACpC,SAAU,CACR,OAAQ,CACN,SAAU,GACV,WAAY,oEACd,CACF,EACA,gBAAiB,CACf,OAAQ,UACV,CACF,CAAC,EAMKC,MAAoB,OACxB,gHACA,CACE,SAAU,CACR,OAAQ,CACN,SAAU,GACV,WAAY,uDACd,CACF,EACA,gBAAiB,CACf,OAAQ,UACV,CACF,CACF,EAMMC,MAAmB,OAAI,OAAQ,CACnC,SAAU,CACR,OAAQ,CACN,SAAU,GACV,WAAY,kFACd,CACF,E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,EAC9B,eAAe,kBACf,uBAAqB,YACpB,GAAGE,EAGJ,mBAAC,UAAO,YAAaI,EAAmB,UAAU,2BAC/C,SAAAL,EAAK,MAAM,IAAI,CAAClC,EAAM0C,OACrB,OAAC,eACC,mBAAC3C,EAAA,CACC,KAAMC,EACN,MAAOpB,EACP,OAAQ0D,EACR,UAAWL,GAAY,KACvB,gBAAiBA,GAAY,OAC7B,mBAAoBA,GAAY,UAChC,cAAe7B,EACf,UAAWC,EACX,WAAY6B,EAAK,WACjB,aAAcA,EAAK,aACnB,WAAYA,EAAK,WACjB,aAAcA,EAAK,aACnB,kBAAmBA,EAAK,kBACxB,cAAeA,EAAK,cACpB,cAAeA,EAAK,cACpB,cAAeA,GAAM,cACrB,gBAAiBA,EAAK,gBACtB,qBAAsBA,EAAK,qBAC3B,QAAStB,EACX,GArBgB,oBAAsB8B,CAsBxC,CACD,EACH,EACF,CAEJ,CACF,EAEAV,EAAU,YAAc,YAExB,IAAOnG,MAAQ,cAAWmG,CAAS",
6
- "names": ["GiftShelf_exports", "__export", "GiftShelf_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_components", "import_class_variance_authority", "import_react", "import_Styles", "import_utils", "import_AiuiProvider", "import_textFormat", "giftCardVariants", "contentLayoutVariants", "imageAreaVariants", "infoAreaVariants", "buttonVariants", "textVariants", "getResponsiveSource", "bgImage", "sources", "getBackgroundAlt", "formatTime", "seconds", "hours", "minutes", "secs", "parseStartTime", "startTime", "parsed", "isInTransitionPeriod", "countdown", "startTimeMs", "durationMs", "rounds", "now", "elapsed", "currentRound", "timeUntilRoundEnd", "TRANSITION_PERIOD_MS", "getCodeWithSuffix", "codePrefix", "date", "suffix", "currentRoundStartMs", "Countdown", "config", "theme", "className", "countdownText", "lastRoundText", "beforeStartText", "countdownIcon", "onStateChange", "timeLeft", "setTimeLeft", "countdownState", "setCountdownState", "calculateCountdown", "diff", "currentRoundTargetTime", "timer", "labelText", "ProgressBar", "progress", "clampedProgress", "GiftShelfCard", "item", "layout", "buttonClassName", "countdownClassName", "onButtonClick", "buildData", "buttonText", "remainText", "lowStockText", "soldOutButtonText", "discountText", "comingSoonButtonText", "loading", "locale", "firstProduct", "isTransitioning", "setIsTransitioning", "currentCode", "setCurrentCode", "checkAndUpdate", "newCode", "prev", "handleCountdownStateChange", "state", "fullProduct", "p", "fullProductVariant", "variant", "displayData", "price", "basePrice", "handleClick", "GiftShelf", "classNames", "data", "rest", "ref", "itemsPerRow", "cardLayout", "swiperBreakpoints", "getBreakpointConfig", "breakpoint", "index"]
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport { Text, Picture, Button, Container, Heading } from '../../components/index.js'\nimport { cva } from 'class-variance-authority'\nimport type { GiftShelfProps, GiftShelfItem, CountdownConfig, ResponsiveBackgroundImage } from './types.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useProductListTrack } from '../../hooks/useProductListTrack.js'\nimport type { Product, ProductVariant } from '../Listing/types/product.js'\nimport { formatVariantPrice } from '../Listing/utils/index.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { replaceTemplate } from '../Listing/utils/textFormat.js'\nimport type { GiftShelfProduct } from './types.js'\nimport type { Media } from '../../types/props.js'\n\nconst componentType = 'image'\nconst componentName = 'gift_shelf'\n/**\n * Card style variants for gift shelf\n */\nconst giftCardVariants = cva('desktop:px-6 rounded-card relative min-w-0 overflow-hidden p-4', {\n variants: {\n state: {\n light: 'bg-[#EAEAEC]',\n dark: 'bg-[#1E2024]',\n },\n },\n defaultVariants: {\n state: 'light',\n },\n})\n\n/**\n * Content layout variants - \u63A7\u5236 Background image \u548C Bottom info area \u7684\u5E03\u5C40\n * horizontal \u5E03\u5C40\u4EC5\u5728 desktop (\u22651440px) \u65AD\u70B9\u751F\u6548\n */\nconst contentLayoutVariants = cva('', {\n variants: {\n layout: {\n vertical: '',\n horizontal: 'desktop:flex desktop:flex-row desktop:items-stretch desktop:gap-10',\n },\n },\n defaultVariants: {\n layout: 'vertical',\n },\n})\n\n/**\n * Image area variants\n * horizontal \u5E03\u5C40\u4EC5\u5728 desktop (\u22651440px) \u65AD\u70B9\u751F\u6548\n */\nconst imageAreaVariants = cva(\n 'desktop:max-w-[268px] lg-desktop:max-w-[356px] lg-desktop:h-[171px] relative mx-auto h-[118px] max-w-[256px] ',\n {\n variants: {\n layout: {\n vertical: '',\n horizontal: 'desktop:flex-1 desktop:h-[122px] lg-desktop:h-[161px]',\n },\n },\n defaultVariants: {\n layout: 'vertical',\n },\n }\n)\n\n/**\n * Info area variants\n * horizontal \u5E03\u5C40\u4EC5\u5728 desktop (\u22651440px) \u65AD\u70B9\u751F\u6548\n */\nconst infoAreaVariants = cva('mt-3', {\n variants: {\n layout: {\n vertical: '',\n horizontal: 'desktop:mt-0 desktop:flex-1 desktop:flex desktop:flex-col desktop:justify-center',\n },\n },\n defaultVariants: {\n layout: 'vertical',\n },\n})\n\n/**\n * Button style variants\n */\nconst buttonVariants = cva('mt-4 self-start', {\n variants: {\n state: {\n light: 'bg-[#080A0F] text-white',\n dark: 'bg-white text-[#080A0F]',\n },\n },\n defaultVariants: {\n state: 'light',\n },\n})\n\n/**\n * Text style variants\n */\nconst textVariants = cva('', {\n variants: {\n state: {\n light: 'text-[#080A0F]',\n dark: 'text-white',\n },\n },\n defaultVariants: {\n state: 'light',\n },\n})\n\n/**\n * Convert ResponsiveBackgroundImage to Picture source string\n * Format: \"url1 1920, url2 1439, url3 1024, url4 767, url5\"\n */\nconst getResponsiveSource = (bgImage?: ResponsiveBackgroundImage): string | undefined => {\n if (!bgImage) return undefined\n\n const sources: string[] = []\n\n // lg-desktop: \u22651920px\n if (bgImage.lgDesktop?.url) {\n sources.push(`${bgImage.lgDesktop.url} 1920`)\n }\n // desktop: \u22651440px\n if (bgImage.desktop?.url) {\n sources.push(`${bgImage.desktop.url} 1439`)\n }\n // laptop: \u22651025px\n if (bgImage.laptop?.url) {\n sources.push(`${bgImage.laptop.url} 1024`)\n }\n // tablet: \u2265768px\n if (bgImage.tablet?.url) {\n sources.push(`${bgImage.tablet.url} 767`)\n }\n // default (mobile): <768px\n if (bgImage.default?.url) {\n sources.push(bgImage.default.url)\n }\n\n return sources.length > 0 ? sources.join(', ') : undefined\n}\n\n/**\n * Get alt text from ResponsiveBackgroundImage\n */\nconst getBackgroundAlt = (bgImage?: ResponsiveBackgroundImage): string => {\n if (!bgImage) return ''\n return (\n bgImage.default?.alt ||\n bgImage.tablet?.alt ||\n bgImage.laptop?.alt ||\n bgImage.desktop?.alt ||\n bgImage.lgDesktop?.alt ||\n ''\n )\n}\n\n/**\n * Format countdown time\n */\nconst formatTime = (seconds: number) => {\n const hours = Math.floor(seconds / 3600)\n const minutes = Math.floor((seconds % 3600) / 60)\n const secs = seconds % 60\n return `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`\n}\n\n/**\n * \u89E3\u6790\u5F00\u59CB\u65F6\u95F4\uFF0C\u652F\u6301 ISO 8601 \u5B57\u7B26\u4E32\u6216\u65F6\u95F4\u6233\n */\nconst parseStartTime = (startTime: string | number): number => {\n if (typeof startTime === 'number') {\n return startTime\n }\n // \u89E3\u6790 ISO 8601 \u5B57\u7B26\u4E32\n const parsed = new Date(startTime).getTime()\n return isNaN(parsed) ? 0 : parsed\n}\n\n/**\n * \u8BA1\u7B97\u5F53\u524D\u662F\u5426\u5904\u4E8E\u8F6E\u6B21\u5207\u6362\u671F\uFF08\u4E0B\u4E00\u8F6E\u5F00\u59CB\u524D5\u5206\u949F\uFF09\n * @param countdown \u5012\u8BA1\u65F6\u914D\u7F6E\n * @returns \u662F\u5426\u5904\u4E8E\u5207\u6362\u671F\n */\nconst isInTransitionPeriod = (countdown?: CountdownConfig): boolean => {\n if (!countdown) return false\n const startTimeMs = parseStartTime(countdown.startTime)\n const durationMs = (countdown.durationDays ?? 1) * 24 * 3600 * 1000\n const rounds = countdown.rounds ?? 1\n const now = Date.now()\n\n // \u672A\u5230\u5F00\u59CB\u65F6\u95F4\n if (now < startTimeMs) return false\n\n // \u8BA1\u7B97\u5F53\u524D\u8F6E\u6B21\n const elapsed = now - startTimeMs\n const currentRound = Math.floor(elapsed / durationMs) + 1\n\n // \u6240\u6709\u8F6E\u6B21\u5DF2\u7ED3\u675F\n if (currentRound > rounds) return false\n\n // \u8BA1\u7B97\u5F53\u524D\u8F6E\u6B21\u7684\u7ED3\u675F\u65F6\u95F4\n const currentRoundEndTime = startTimeMs + currentRound * durationMs\n\n // \u8DDD\u79BB\u5F53\u524D\u8F6E\u6B21\u7ED3\u675F\u7684\u65F6\u95F4\n const timeUntilRoundEnd = currentRoundEndTime - now\n\n // \u5982\u679C\u8DDD\u79BB\u7ED3\u675F\u4E0D\u52305\u5206\u949F\uFF0C\u5904\u4E8E\u5207\u6362\u671F\n const TRANSITION_PERIOD_MS = 5 * 60 * 1000 // 5\u5206\u949F\n return timeUntilRoundEnd <= TRANSITION_PERIOD_MS && timeUntilRoundEnd > 0\n}\n\n/**\n * \u6839\u636E\u5012\u8BA1\u65F6\u914D\u7F6E\u8BA1\u7B97\u5F53\u524D\u8F6E\u6B21\u7684 Code\n * @param codePrefix Code \u524D\u7F00\n * @param countdown \u5012\u8BA1\u65F6\u914D\u7F6E\n * @returns \u5B8C\u6574\u7684 Code\uFF08\u524D\u7F00 + MMDD \u540E\u7F00\uFF09\n * @description \u7EDF\u4E00\u4F7F\u7528 UTC \u65F6\u95F4\u8BA1\u7B97\uFF0C\u786E\u4FDD\u5168\u7403\u4EFB\u4F55\u65F6\u533A\u5F97\u5230\u76F8\u540C\u7684 code\n */\nconst getCodeWithSuffix = (codePrefix?: string, countdown?: CountdownConfig): string => {\n if (!codePrefix || !countdown) return codePrefix || ''\n\n const startTimeMs = parseStartTime(countdown.startTime)\n const durationMs = (countdown.durationDays ?? 1) * 24 * 3600 * 1000\n const rounds = countdown.rounds ?? 1\n const now = Date.now()\n\n // \u672A\u5230\u5F00\u59CB\u65F6\u95F4\uFF0C\u4F7F\u7528\u7B2C\u4E00\u8F6E\u7684\u65E5\u671F\uFF08UTC \u65F6\u95F4\uFF09\n if (now < startTimeMs) {\n const date = new Date(startTimeMs)\n const suffix = `${(date.getUTCMonth() + 1).toString().padStart(2, '0')}${date.getUTCDate().toString().padStart(2, '0')}`\n return `${codePrefix}${suffix}`\n }\n\n // \u8BA1\u7B97\u5F53\u524D\u5904\u4E8E\u7B2C\u51E0\u8F6E\uFF08\u4ECE 1 \u5F00\u59CB\uFF09\n const elapsed = now - startTimeMs\n const currentRound = Math.min(Math.floor(elapsed / durationMs) + 1, rounds)\n\n // \u8BA1\u7B97\u5F53\u524D\u8F6E\u6B21\u7684\u5F00\u59CB\u65E5\u671F\n const currentRoundStartMs = startTimeMs + (currentRound - 1) * durationMs\n const date = new Date(currentRoundStartMs)\n\n // \u683C\u5F0F\u5316\u4E3A MMDD\uFF08\u4F7F\u7528 UTC \u65F6\u95F4\uFF09\n const suffix = `${(date.getUTCMonth() + 1).toString().padStart(2, '0')}${date.getUTCDate().toString().padStart(2, '0')}`\n\n return `${codePrefix}${suffix}`\n}\n\n/**\n * \u5012\u8BA1\u65F6\u72B6\u6001\u7C7B\u578B\n */\ntype CountdownState = 'beforeStart' | 'running' | 'lastRound' | 'finished'\n\n/**\n * Countdown Component\n * \u652F\u6301\u591A\u8F6E\u5012\u8BA1\u65F6\uFF0C\u663E\u793A\u4E0D\u540C\u72B6\u6001\u7684\u6807\u7B7E\n */\nconst Countdown = React.memo(\n ({\n config,\n theme = 'light',\n className,\n countdownText = 'Next round start time',\n lastRoundText = 'Last round',\n beforeStartText = 'Start time',\n countdownIcon,\n onStateChange,\n }: {\n config: CountdownConfig\n theme?: 'light' | 'dark'\n className?: string\n countdownText?: string\n lastRoundText?: string\n beforeStartText?: string\n countdownIcon?: Media\n onStateChange?: (state: CountdownState) => void\n }) => {\n const [timeLeft, setTimeLeft] = React.useState(0)\n const [countdownState, setCountdownState] = React.useState<CountdownState>('beforeStart')\n\n // \u89E3\u6790\u5F00\u59CB\u65F6\u95F4\u4E3A\u65F6\u95F4\u6233\n const startTimeMs = React.useMemo(() => parseStartTime(config.startTime), [config.startTime])\n\n const rounds = config.rounds ?? 1\n // \u9ED8\u8BA4 1 \u5929\uFF0C\u8F6C\u6362\u4E3A\u6BEB\u79D2 (1\u5929 = 24\u5C0F\u65F6 = 86400\u79D2 = 86400000\u6BEB\u79D2)\n const durationMs = (config.durationDays ?? 1) * 24 * 3600 * 1000\n\n React.useEffect(() => {\n const calculateCountdown = () => {\n const now = Date.now()\n\n // \u672A\u5230\u5F00\u59CB\u65F6\u95F4\uFF0C\u663E\u793A\u5F00\u59CB\u524D\u5012\u8BA1\u65F6\n if (now < startTimeMs) {\n const diff = Math.max(0, Math.floor((startTimeMs - now) / 1000))\n setTimeLeft(diff)\n setCountdownState('beforeStart')\n return\n }\n\n // \u8BA1\u7B97\u5DF2\u7ECF\u8FC7\u53BB\u7684\u65F6\u95F4\n const elapsed = now - startTimeMs\n // \u8BA1\u7B97\u5F53\u524D\u5904\u4E8E\u7B2C\u51E0\u8F6E\uFF08\u4ECE 1 \u5F00\u59CB\uFF09\n const currentRound = Math.floor(elapsed / durationMs) + 1\n\n // \u6240\u6709\u8F6E\u6B21\u5DF2\u7ED3\u675F\n if (currentRound > rounds) {\n setCountdownState('finished')\n return\n }\n\n // \u8BA1\u7B97\u5F53\u524D\u8F6E\u6B21\u7684\u76EE\u6807\u65F6\u95F4\n const currentRoundTargetTime = startTimeMs + currentRound * durationMs\n // \u8BA1\u7B97\u5269\u4F59\u79D2\u6570\n const diff = Math.max(0, Math.floor((currentRoundTargetTime - now) / 1000))\n\n setTimeLeft(diff)\n // \u5224\u65AD\u662F\u5426\u662F\u6700\u540E\u4E00\u8F6E\n setCountdownState(currentRound === rounds ? 'lastRound' : 'running')\n }\n\n calculateCountdown()\n const timer = setInterval(calculateCountdown, 1000)\n\n return () => clearInterval(timer)\n }, [startTimeMs, durationMs, rounds])\n\n // \u901A\u77E5\u7236\u7EC4\u4EF6\u72B6\u6001\u53D8\u5316\n React.useEffect(() => {\n onStateChange?.(countdownState)\n }, [countdownState, onStateChange])\n\n // \u6839\u636E\u72B6\u6001\u83B7\u53D6\u663E\u793A\u7684\u6807\u7B7E\u6587\u672C\n const labelText = React.useMemo(() => {\n switch (countdownState) {\n case 'beforeStart':\n return beforeStartText\n case 'lastRound':\n return lastRoundText\n default:\n return countdownText\n }\n }, [countdownState, beforeStartText, lastRoundText, countdownText])\n\n // \u6240\u6709\u8F6E\u6B21\u5DF2\u7ED3\u675F\uFF0C\u4E0D\u6E32\u67D3\n if (countdownState === 'finished') {\n return null\n }\n\n return (\n <div\n className={cn(\n 'desktop:gap-2 laptop:text-base flex items-center gap-1 text-sm',\n theme === 'dark' ? 'text-white' : 'text-[#080A0F]',\n className\n )}\n >\n {countdownIcon && (\n <Picture\n source={countdownIcon.url}\n alt={countdownIcon.alt}\n className=\"laptop:size-5 size-4 shrink-0\"\n imgClassName=\"size-full object-contain\"\n />\n )}\n <Text html={labelText} className=\"whitespace-nowrap font-bold\" />\n <span className=\"font-bold\">|</span>\n <Text className=\"font-bold\" html={formatTime(timeLeft)} />\n </div>\n )\n }\n)\n\nCountdown.displayName = 'Countdown'\n\n/**\n * Progress Bar Component\n */\nconst ProgressBar = React.memo(\n ({ progress, theme = 'light', className }: { progress: number; theme?: 'light' | 'dark'; className?: string }) => {\n // Clamp progress between 0 and 100\n const clampedProgress = Math.min(100, Math.max(0, progress))\n\n return (\n <div\n className={cn(\n 'flex h-2 w-full items-stretch overflow-hidden rounded-full',\n theme === 'dark' ? 'bg-white/20' : 'bg-black/20',\n className\n )}\n role=\"progressbar\"\n aria-valuenow={clampedProgress}\n aria-valuemin={0}\n aria-valuemax={100}\n >\n <div\n className={cn(\n 'h-full rounded-full transition-all duration-300',\n theme === 'dark' ? 'bg-white' : 'bg-[#080A0F]'\n )}\n style={{ width: `${clampedProgress}%` }}\n />\n </div>\n )\n }\n)\n\nProgressBar.displayName = 'ProgressBar'\n\n/**\n * Gift Shelf Card Component\n */\nconst GiftShelfCard = React.memo(\n ({\n item,\n theme = 'light',\n layout = 'vertical',\n className,\n buttonClassName,\n countdownClassName,\n onButtonClick,\n buildData,\n buttonText,\n remainText,\n lowStockText,\n soldOutButtonText,\n discountText = 'Only {price}',\n countdownText,\n countdownIcon,\n lastRoundText,\n beforeStartText,\n comingSoonButtonText,\n loading,\n }: {\n item: GiftShelfItem\n theme?: 'light' | 'dark'\n layout?: 'vertical' | 'horizontal'\n className?: string\n buttonClassName?: string\n countdownClassName?: string\n onButtonClick?: ({ product, code }: { product: GiftShelfProduct; code: string }) => void\n buildData?: {\n products: Product[]\n }\n buttonText: string\n remainText?: string\n lowStockText?: string\n soldOutButtonText?: string\n discountText?: string\n countdownText?: string\n countdownIcon?: Media\n lastRoundText?: string\n beforeStartText?: string\n comingSoonButtonText?: string\n loading?: boolean\n }) => {\n const { locale = 'us' } = useAiuiContext()\n // \u83B7\u53D6\u7B2C\u4E00\u4E2A\u4EA7\u54C1\u7684\u7B80\u5316\u6570\u636E\n const firstProduct = item.products?.[0]\n\n // \u68C0\u6D4B\u662F\u5426\u5904\u4E8E\u8F6E\u6B21\u5207\u6362\u671F + \u5F53\u524D\u8F6E\u6B21 code\uFF08\u6BCF\u79D2\u66F4\u65B0\uFF09\n const [isTransitioning, setIsTransitioning] = React.useState(() => isInTransitionPeriod(item.countdown))\n const [currentCode, setCurrentCode] = React.useState(() => getCodeWithSuffix(item.codePrefix, item.countdown))\n // \u5012\u8BA1\u65F6\u72B6\u6001\n const [countdownState, setCountdownState] = React.useState<CountdownState>('beforeStart')\n\n React.useEffect(() => {\n const checkAndUpdate = () => {\n // \u66F4\u65B0\u8F6E\u6B21\u5207\u6362\u72B6\u6001\n setIsTransitioning(isInTransitionPeriod(item.countdown))\n // \u66F4\u65B0\u5F53\u524D\u8F6E\u6B21 code\uFF08\u4EC5\u5728\u503C\u53D8\u5316\u65F6\u66F4\u65B0\uFF09\n const newCode = getCodeWithSuffix(item.codePrefix, item.countdown)\n setCurrentCode(prev => (prev !== newCode ? newCode : prev))\n }\n\n // \u521D\u59CB\u68C0\u67E5\n checkAndUpdate()\n // \u6BCF\u79D2\u68C0\u67E5\u4E00\u6B21\n const timer = setInterval(checkAndUpdate, 1000)\n\n return () => clearInterval(timer)\n }, [item.codePrefix, item.countdown])\n\n // \u5012\u8BA1\u65F6\u72B6\u6001\u53D8\u5316\u56DE\u8C03\n const handleCountdownStateChange = React.useCallback((state: CountdownState) => {\n setCountdownState(state)\n }, [])\n\n // \u901A\u8FC7 handle \u5339\u914D buildData \u4E2D\u7684\u5B8C\u6574\u4EA7\u54C1\u6570\u636E\n const fullProduct = React.useMemo(() => {\n if (!firstProduct?.handle || !buildData?.products?.length) return null\n return buildData.products.find(p => p.handle === firstProduct.handle) || null\n }, [firstProduct?.handle, buildData?.products])\n\n const fullProductVariant = React.useMemo(\n () => fullProduct?.variants?.find(variant => variant?.sku === firstProduct?.sku) || ({} as ProductVariant),\n [firstProduct?.sku, fullProduct?.variants]\n )\n\n // \u7EC4\u5408\u5C55\u793A\u6570\u636E\uFF08\u4F18\u5148\u4F7F\u7528\u8BE6\u7EC6\u6570\u636E\uFF0C\u56DE\u9000\u5230\u7B80\u5316\u6570\u636E\uFF09\n const displayData = React.useMemo(() => {\n const { price, basePrice } = formatVariantPrice({\n locale: locale || 'us',\n baseAmount: fullProductVariant?.price?.amount,\n amount: firstProduct?.custom_price ?? fullProductVariant?.price?.amount,\n currencyCode: fullProduct?.price?.currencyCode || 'USD',\n })\n\n return {\n // \u4E3B\u4EF7\u683C/\u4EF7\u503C\u5C55\u793A\uFF1A\u6709\u8BE6\u7EC6\u6570\u636E\u65F6\u663E\u793A\u4EF7\u683C\uFF0C\u5426\u5219\u663E\u793A\u4EA7\u54C1\u540D\n value: basePrice,\n // \u4EA7\u54C1\u63CF\u8FF0/\u6807\u9898\uFF1A\u6709\u8BE6\u7EC6\u6570\u636E\u65F6\u663E\u793A\u6807\u9898\uFF0C\u5426\u5219\u4E3A\u7A7A\uFF08\u907F\u514D\u91CD\u590D\u663E\u793A\uFF09\n description: firstProduct?.custom_description,\n // \u4F18\u60E0\u4EF7\u683C\n salePrice: replaceTemplate(discountText || '', {\n price,\n }),\n }\n }, [\n fullProduct,\n fullProductVariant,\n locale,\n discountText,\n firstProduct?.custom_price,\n firstProduct?.custom_description,\n ])\n\n const handleClick = React.useCallback(() => {\n onButtonClick?.({ product: firstProduct, code: currentCode })\n }, [onButtonClick, currentCode, firstProduct])\n\n return (\n <div className={cn(giftCardVariants({ state: theme }), className)} data-ui-component-id=\"GiftShelfCard\">\n {/* Countdown section - above the card content (only in vertical layout) */}\n {item.countdown && (\n <div className=\"laptop:h-[24px] mb-4 h-[20px]\">\n <Countdown\n config={item.countdown}\n theme={theme}\n className={countdownClassName}\n countdownText={countdownText}\n lastRoundText={lastRoundText}\n beforeStartText={beforeStartText}\n countdownIcon={countdownIcon}\n onStateChange={handleCountdownStateChange}\n />\n </div>\n )}\n\n {/* Content layout wrapper - \u63A7\u5236 Background image \u548C Bottom info area \u7684\u5E03\u5C40 */}\n <div className={contentLayoutVariants({ layout })}>\n {/* Background image - responsive across 5 breakpoints */}\n <div className={imageAreaVariants({ layout })}>\n {item.backgroundImage && (\n <Picture\n source={getResponsiveSource(item.backgroundImage)}\n alt={getBackgroundAlt(item.backgroundImage)}\n className=\"rounded-card size-full overflow-hidden object-cover\"\n imgClassName=\"h-full w-full object-cover\"\n />\n )}\n {/* Card content area */}\n <div className=\"absolute top-1/2 z-10 w-full -translate-y-1/2 px-6\">\n {/* Value and description */}\n <div className=\"flex flex-col gap-1\">\n {/* Main value display */}\n {displayData.value && (\n <Heading\n html={displayData.value}\n size={4}\n className={cn('font-bold leading-none', textVariants({ state: theme }))}\n />\n )}\n\n {/* Description */}\n {displayData.description && (\n <Text\n html={displayData.description}\n className={cn('text-base font-bold opacity-60', textVariants({ state: theme }))}\n />\n )}\n </div>\n </div>\n </div>\n\n {/* Bottom/Right info area */}\n <div className={infoAreaVariants({ layout })}>\n {/* Sale price */}\n {displayData.salePrice && (\n <Text\n as=\"p\"\n html={displayData.salePrice}\n className={cn('lg-desktop:text-2xl text-xl font-bold', textVariants({ state: theme }))}\n />\n )}\n\n {/* Progress bar - \u8D85\u5356\u65F6\u9690\u85CF\uFF08availableForSale=true \u4E14 quantityAvailable<=0\uFF09 */}\n <ProgressBar\n progress={\n firstProduct?.custom_inventory\n ? ((fullProductVariant?.quantityAvailable || 0) / firstProduct.custom_inventory) * 100\n : 0\n }\n theme={theme}\n className={cn(\n 'mb-1 mt-2',\n fullProductVariant?.availableForSale && (fullProductVariant?.quantityAvailable ?? 0) <= 0 && 'invisible'\n )}\n />\n\n {/* Remain text - \u6B63\u5E38\u5E93\u5B58\u63D0\u793A */}\n {remainText && (fullProductVariant?.quantityAvailable ?? 0) >= 0 && (\n <Text\n html={replaceTemplate(remainText, {\n inventory: firstProduct?.custom_inventory?.toString() || '',\n quantity: fullProductVariant?.quantityAvailable?.toString() || '0',\n })}\n as=\"p\"\n className={cn('laptop:text-base text-sm font-bold', textVariants({ state: theme }))}\n />\n )}\n\n {/* Low stock text - \u652F\u6301\u8D85\u5356\u65F6\u663E\u793A\uFF08availableForSale=true \u4F46 quantityAvailable<=0\uFF09 */}\n {lowStockText &&\n fullProductVariant?.availableForSale &&\n (fullProductVariant?.quantityAvailable ?? 0) < 0 && (\n <Text\n html={lowStockText}\n as=\"p\"\n className={cn('laptop:text-base text-sm font-bold text-red-500', textVariants({ state: theme }))}\n />\n )}\n\n {/* Action button */}\n <Button\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-sku={firstProduct?.sku || ''}\n size=\"lg\"\n className={cn(buttonVariants({ state: theme }), buttonClassName)}\n onClick={handleClick}\n disabled={\n !fullProductVariant?.availableForSale ||\n loading ||\n isTransitioning ||\n countdownState === 'beforeStart' ||\n countdownState === 'finished'\n }\n loading={loading && fullProductVariant?.availableForSale}\n >\n {countdownState === 'beforeStart'\n ? comingSoonButtonText || buttonText\n : fullProductVariant?.availableForSale\n ? buttonText\n : soldOutButtonText || buttonText}\n </Button>\n </div>\n </div>\n </div>\n )\n }\n)\n\nGiftShelfCard.displayName = 'GiftShelfCard'\n\n/**\n * GiftShelf - Gift/Promotion Shelf Component\n *\n * @description Display gift cards with countdown, pricing, and purchase buttons\n */\nconst GiftShelf = React.forwardRef<HTMLDivElement, GiftShelfProps>(\n ({ classNames = {}, data, onButtonClick, buildData, loading, ...rest }, ref) => {\n const innerRef = React.useRef<HTMLDivElement>(null)\n\n React.useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n // \u7EC4\u4EF6\u66DD\u5149\u57CB\u70B9\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: '',\n componentDescription: '',\n })\n\n // \u4EA7\u54C1\u5217\u8868\u9732\u51FA + \u9009\u62E9\u57CB\u70B9\n const { trackSelectItem } = useProductListTrack({\n containerRef: innerRef,\n listName: componentName,\n items: data.items.map(item => item.products?.[0]).filter(Boolean),\n products: buildData?.products,\n })\n\n const theme = data.theme || 'light'\n\n const itemsPerRow = React.useMemo(() => {\n return data?.items?.length || 4\n }, [data?.items])\n\n // \u5F53\u5361\u7247\u6570\u91CF\u4E3A 2 \u65F6\u4F7F\u7528\u6C34\u5E73\u5E03\u5C40\uFF0C\u5426\u5219\u4F7F\u7528\u5782\u76F4\u5E03\u5C40\n const cardLayout = itemsPerRow === 2 ? 'horizontal' : 'vertical'\n\n const swiperBreakpoints = React.useMemo(() => {\n const getBreakpointConfig = (breakpoint: 'mobile' | 'tablet' | 'laptop' | 'desktop') => {\n switch (breakpoint) {\n case 'mobile':\n return { slidesPerView: 1.2, spaceBetween: 12 }\n case 'tablet':\n if (itemsPerRow <= 2) return { slidesPerView: 2, spaceBetween: 12 }\n return { slidesPerView: 2.5, spaceBetween: 12 }\n case 'laptop':\n if (itemsPerRow <= 3) return { slidesPerView: itemsPerRow, spaceBetween: 16 }\n return { slidesPerView: 3.01, spaceBetween: 16 }\n case 'desktop':\n return { slidesPerView: Math.min(itemsPerRow, 4), spaceBetween: 20 }\n }\n }\n\n return {\n 0: getBreakpointConfig('mobile'),\n 768: getBreakpointConfig('tablet'),\n 1025: getBreakpointConfig('laptop'),\n 1440: getBreakpointConfig('desktop'),\n }\n }, [itemsPerRow])\n\n return (\n <Container\n ref={innerRef}\n className={cn(classNames?.root)}\n childClassName=\"overflow-hidden\"\n data-ui-component-id=\"GiftShelf\"\n {...rest}\n >\n {/* Cards swiper */}\n <Swiper breakpoints={swiperBreakpoints} className=\"w-full !overflow-visible\">\n {data.items.map((item, index) => (\n <SwiperSlide key={'giftShelfCardItem' + index}>\n <GiftShelfCard\n item={item}\n theme={theme}\n layout={cardLayout}\n className={classNames?.card}\n buttonClassName={classNames?.button}\n countdownClassName={classNames?.countdown}\n onButtonClick={params => {\n const product = item.products?.[0]\n if (product) trackSelectItem(product, index)\n onButtonClick?.(params)\n }}\n buildData={buildData}\n buttonText={data.buttonText}\n discountText={data.discountText}\n remainText={data.remainText}\n lowStockText={data.lowStockText}\n soldOutButtonText={data.soldOutButtonText}\n countdownText={data.countdownText}\n lastRoundText={data.lastRoundText}\n countdownIcon={data?.countdownIcon}\n beforeStartText={data.beforeStartText}\n comingSoonButtonText={data.comingSoonButtonText}\n loading={loading}\n />\n </SwiperSlide>\n ))}\n </Swiper>\n </Container>\n )\n }\n)\n\nGiftShelf.displayName = 'GiftShelf'\n\nexport default withLayout(GiftShelf)\nexport type {\n GiftShelfProps,\n GiftShelfData,\n GiftShelfItem,\n GiftShelfProduct,\n CountdownConfig,\n ResponsiveBackgroundImage,\n} from './types.js'\n"],
5
+ "mappings": "olBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAoWM,IAAAI,EAAA,6BAlWNC,EAAuB,qBACvBC,EAAmB,kCACnB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A,CACC,KAAMC,EACN,MAAOpB,EACP,OAAQ4D,EACR,UAAWP,GAAY,KACvB,gBAAiBA,GAAY,OAC7B,mBAAoBA,GAAY,UAChC,cAAeY,GAAU,CACvB,MAAMC,EAAU9C,EAAK,WAAW,CAAC,EAC7B8C,GAASR,EAAgBQ,EAASF,CAAK,EAC3CxC,IAAgByC,CAAM,CACxB,EACA,UAAWxC,EACX,WAAY6B,EAAK,WACjB,aAAcA,EAAK,aACnB,WAAYA,EAAK,WACjB,aAAcA,EAAK,aACnB,kBAAmBA,EAAK,kBACxB,cAAeA,EAAK,cACpB,cAAeA,EAAK,cACpB,cAAeA,GAAM,cACrB,gBAAiBA,EAAK,gBACtB,qBAAsBA,EAAK,qBAC3B,QAAStB,EACX,GAzBgB,oBAAsBgC,CA0BxC,CACD,EACH,EACF,CAEJ,CACF,EAEAZ,EAAU,YAAc,YAExB,IAAOvG,MAAQ,cAAWuG,CAAS",
6
+ "names": ["GiftShelf_exports", "__export", "GiftShelf_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_components", "import_class_variance_authority", "import_react", "import_Styles", "import_useExposure", "import_useProductListTrack", "import_utils", "import_AiuiProvider", "import_textFormat", "componentType", "componentName", "giftCardVariants", "contentLayoutVariants", "imageAreaVariants", "infoAreaVariants", "buttonVariants", "textVariants", "getResponsiveSource", "bgImage", "sources", "getBackgroundAlt", "formatTime", "seconds", "hours", "minutes", "secs", "parseStartTime", "startTime", "parsed", "isInTransitionPeriod", "countdown", "startTimeMs", "durationMs", "rounds", "now", "elapsed", "currentRound", "timeUntilRoundEnd", "TRANSITION_PERIOD_MS", "getCodeWithSuffix", "codePrefix", "date", "suffix", "currentRoundStartMs", "Countdown", "config", "theme", "className", "countdownText", "lastRoundText", "beforeStartText", "countdownIcon", "onStateChange", "timeLeft", "setTimeLeft", "countdownState", "setCountdownState", "calculateCountdown", "diff", "currentRoundTargetTime", "timer", "labelText", "ProgressBar", "progress", "clampedProgress", "GiftShelfCard", "item", "layout", "buttonClassName", "countdownClassName", "onButtonClick", "buildData", "buttonText", "remainText", "lowStockText", "soldOutButtonText", "discountText", "comingSoonButtonText", "loading", "locale", "firstProduct", "isTransitioning", "setIsTransitioning", "currentCode", "setCurrentCode", "checkAndUpdate", "newCode", "prev", "handleCountdownStateChange", "state", "fullProduct", "p", "fullProductVariant", "variant", "displayData", "price", "basePrice", "handleClick", "GiftShelf", "classNames", "data", "rest", "ref", "innerRef", "trackSelectItem", "itemsPerRow", "cardLayout", "swiperBreakpoints", "getBreakpointConfig", "breakpoint", "index", "params", "product"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var L=Object.create;var g=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var D=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var R=(e,i)=>{for(var l in i)g(e,l,{get:i[l],enumerable:!0})},N=(e,i,l,m)=>{if(i&&typeof i=="object"||typeof i=="function")for(let o of D(i))!H.call(e,o)&&o!==l&&g(e,o,{get:()=>i[o],enumerable:!(m=U(i,o))||m.enumerable});return e};var b=(e,i,l)=>(l=e!=null?L(E(e)):{},N(i||!e||!e.__esModule?g(l,"default",{value:e,enumerable:!0}):l,e)),_=e=>N(g({},"__esModule",{value:!0}),e);var K={};R(K,{default:()=>J});module.exports=_(K);var t=require("react/jsx-runtime"),s=b(require("react")),d=require("../../helpers/index.js"),a=require("../../components/index.js"),k=require("class-variance-authority"),f=require("swiper/react"),C=b(require("swiper/modules")),B=require("../../shared/Styles.js"),F=require("../AiuiProvider/index.js"),I=require("../Listing/utils/index.js");const q=(0,k.cva)("lg-desktop:h-[400px] rounded-card desktop:pt-4 desktop:pb-6 relative flex h-[320px] flex-col items-start gap-1 overflow-hidden p-4",{variants:{theme:{light:"bg-gradient-to-b from-[#FCCA7B] to-[#FFE6BF]",dark:"bg-gradient-to-b from-[#3A3A3A] to-[#1D1D1F]"}},defaultVariants:{theme:"light"}}),P=(0,k.cva)("",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{theme:"light"}}),M=s.memo(({image:e})=>e?(0,t.jsx)(a.Picture,{source:e.url,alt:e.alt||"Member Tag",className:"h-full w-auto",imgClassName:"h-full w-auto object-contain"}):null);M.displayName="MemberTag";const y=s.memo(({theme:e="light"})=>{const i=e==="light"?"bg-[#f6cd4e]":"bg-[#F5F6F7]";return(0,t.jsx)("div",{className:"flex h-4 w-full items-center",children:(0,t.jsx)("div",{className:(0,d.cn)("flex h-1 w-full items-center justify-center",i),children:(0,t.jsx)("div",{className:(0,d.cn)("relative size-4 shrink-0 rounded-full",i)})})})});y.displayName="TimelineItem";const V=s.memo(({item:e,theme:i="light",className:l,onClick:m,buildData:o})=>{const{locale:v="us"}=(0,F.useAiuiContext)(),n=e.products?.[0],p=s.useMemo(()=>!n?.handle||!o?.products?.length?null:o.products.find(w=>w.handle===n.handle)||null,[n?.handle,o?.products]),h=s.useMemo(()=>p?.variants?.find(w=>w?.sku===n?.sku)||{},[n?.sku,p?.variants]),x=(0,I.formatPrice)({locale:v||"us",amount:n?.custom_price??h?.price?.amount,currencyCode:p?.price?.currencyCode||"USD"});return(0,t.jsxs)("div",{className:(0,d.cn)(q({theme:i}),l),onClick:m,"data-ui-component-id":"GiftTierCard",children:[(0,t.jsx)("div",{className:"lg-desktop:h-[28px] z-10 h-6",children:e.showMemberTag&&e.memberTagImage&&(0,t.jsx)(M,{image:e.memberTagImage})}),(0,t.jsx)("div",{className:"relative z-10 mx-auto min-h-0 w-fit flex-1",children:(0,t.jsx)(a.Picture,{source:h?.image?.url||p?.images[0]?.url,className:"size-full",imgClassName:"size-full object-contain"})}),(0,t.jsxs)("div",{className:(0,d.cn)("z-10 flex w-full shrink-0 flex-col gap-2",P({theme:i})),children:[(0,t.jsxs)("div",{className:"flex items-end gap-1",children:[(0,t.jsx)(a.Heading,{html:x,size:4,className:"font-bold leading-[1.2] tracking-[-0.04em]"}),e.valueUnit&&(0,t.jsx)(a.Text,{html:e.valueUnit,className:"lg-desktop:text-2xl text-xl font-bold leading-[1.2] tracking-[-0.04em]"})]}),(0,t.jsx)(a.Text,{html:h?.title||p?.title,className:"lg-desktop:text-2xl line-clamp-2 min-h-[48px] text-wrap text-xl font-bold leading-[1.2] tracking-[-0.04em]"})]})]})});V.displayName="GiftTierCard";const G=s.forwardRef(({classNames:e={},data:i,onCardClick:l,buildData:m,...o},v)=>{const n=i.theme||"light",p=i.showTimeline!==!1,[h,x]=s.useState(null),[w,z]=s.useState(null),u=s.useMemo(()=>m?.products?.length?i.items.filter(r=>{const c=r.products?.[0];return c?.handle?m.products.find(S=>S.handle===c.handle)?.variants?.find(S=>S?.sku===c?.sku)?.availableForSale!==!1:!0}):i.items,[i.items,m?.products]),A=s.useMemo(()=>{const r=u.length;return{0:{slidesPerView:1.2,spaceBetween:12},768:{slidesPerView:Math.min(r,2.5),spaceBetween:12},1025:{slidesPerView:Math.min(r,3.5),spaceBetween:16},1440:{slidesPerView:Math.min(r,4),spaceBetween:16}}},[u.length]),j=s.useMemo(()=>{const r=u.length;return{0:{slidesPerView:1.2,spaceBetween:0},768:{slidesPerView:Math.min(r,2.5),spaceBetween:0},1025:{slidesPerView:Math.min(r,3.5),spaceBetween:0},1440:{slidesPerView:Math.min(r,4),spaceBetween:0}}},[u.length]),T=s.useMemo(()=>C.Controller?[C.Controller]:[],[]);return(0,t.jsxs)(a.Container,{ref:v,className:(0,d.cn)(e?.root),childClassName:"overflow-hidden","data-ui-component-id":"GiftTierShelf",...o,children:[(0,t.jsx)(f.Swiper,{modules:T,breakpoints:A,className:"w-full !overflow-visible",onSwiper:x,controller:{control:w},children:u.map((r,c)=>(0,t.jsx)(f.SwiperSlide,{children:(0,t.jsx)(V,{item:r,theme:n,buildData:m,className:e?.card,onClick:()=>l?.(r,c)})},"giftTierItem"+c))}),p&&(0,t.jsx)("div",{className:"mt-4 flex flex-col gap-4",children:(0,t.jsx)("div",{className:(0,d.cn)("w-full",e?.timeline),children:(0,t.jsx)(f.Swiper,{modules:T,breakpoints:j,className:"w-full !overflow-visible",onSwiper:z,controller:{control:h},children:u.map((r,c)=>(0,t.jsx)(f.SwiperSlide,{children:(0,t.jsxs)("div",{className:"flex flex-col items-center",children:[(0,t.jsx)(y,{theme:n}),(0,t.jsx)(a.Text,{html:r.threshold,className:(0,d.cn)("lg-desktop:text-2xl text-center text-xl font-bold leading-[1.2] tracking-[-0.04em]",P({theme:n}),e?.thresholdText)})]})},"timelineItem"+c))})})})]})});G.displayName="GiftTierShelf";var J=(0,B.withLayout)(G);
1
+ "use strict";"use client";var $=Object.create;var w=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var K=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var Q=(e,i)=>{for(var s in i)w(e,s,{get:i[s],enumerable:!0})},P=(e,i,s,m)=>{if(i&&typeof i=="object"||typeof i=="function")for(let a of J(i))!O.call(e,a)&&a!==s&&w(e,a,{get:()=>i[a],enumerable:!(m=q(i,a))||m.enumerable});return e};var y=(e,i,s)=>(s=e!=null?$(K(e)):{},P(i||!e||!e.__esModule?w(s,"default",{value:e,enumerable:!0}):s,e)),W=e=>P(w({},"__esModule",{value:!0}),e);var Z={};Q(Z,{default:()=>Y});module.exports=W(Z);var t=require("react/jsx-runtime"),l=y(require("react")),p=require("../../helpers/index.js"),n=require("../../components/index.js"),N=require("class-variance-authority"),f=require("swiper/react"),C=y(require("swiper/modules")),z=require("../../shared/Styles.js"),A=require("../../hooks/useExposure.js"),L=require("../../hooks/useProductListTrack.js"),j=require("../AiuiProvider/index.js"),E=require("../Listing/utils/index.js");const b="image",S="gift_tier_shelf",X=(0,N.cva)("lg-desktop:h-[400px] rounded-card desktop:pt-4 desktop:pb-6 relative flex h-[320px] flex-col items-start gap-1 overflow-hidden p-4",{variants:{theme:{light:"bg-gradient-to-b from-[#FCCA7B] to-[#FFE6BF]",dark:"bg-gradient-to-b from-[#3A3A3A] to-[#1D1D1F]"}},defaultVariants:{theme:"light"}}),V=(0,N.cva)("",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{theme:"light"}}),G=l.memo(({image:e})=>e?(0,t.jsx)(n.Picture,{source:e.url,alt:e.alt||"Member Tag",className:"h-full w-auto",imgClassName:"h-full w-auto object-contain"}):null);G.displayName="MemberTag";const B=l.memo(({theme:e="light"})=>{const i=e==="light"?"bg-[#f6cd4e]":"bg-[#F5F6F7]";return(0,t.jsx)("div",{className:"flex h-4 w-full items-center",children:(0,t.jsx)("div",{className:(0,p.cn)("flex h-1 w-full items-center justify-center",i),children:(0,t.jsx)("div",{className:(0,p.cn)("relative size-4 shrink-0 rounded-full",i)})})})});B.displayName="TimelineItem";const I=l.memo(({item:e,theme:i="light",className:s,onClick:m,buildData:a})=>{const{locale:v="us"}=(0,j.useAiuiContext)(),o=e.products?.[0],c=l.useMemo(()=>!o?.handle||!a?.products?.length?null:a.products.find(g=>g.handle===o.handle)||null,[o?.handle,a?.products]),h=l.useMemo(()=>c?.variants?.find(g=>g?.sku===o?.sku)||{},[o?.sku,c?.variants]),x=(0,E.formatPrice)({locale:v||"us",amount:o?.custom_price??h?.price?.amount,currencyCode:c?.price?.currencyCode||"USD"});return(0,t.jsxs)("div",{className:(0,p.cn)(X({theme:i}),s),onClick:m,"data-ui-component-id":"GiftTierCard","data-headless-type-name":`${b}#${S}`,"data-headless-sku":o?.sku||"",children:[(0,t.jsx)("div",{className:"lg-desktop:h-[28px] z-10 h-6",children:e.showMemberTag&&e.memberTagImage&&(0,t.jsx)(G,{image:e.memberTagImage})}),(0,t.jsx)("div",{className:"relative z-10 mx-auto min-h-0 w-fit flex-1",children:(0,t.jsx)(n.Picture,{source:h?.image?.url||c?.images[0]?.url,className:"size-full",imgClassName:"size-full object-contain"})}),(0,t.jsxs)("div",{className:(0,p.cn)("z-10 flex w-full shrink-0 flex-col gap-2",V({theme:i})),children:[(0,t.jsxs)("div",{className:"flex items-end gap-1",children:[(0,t.jsx)(n.Heading,{html:x,size:4,className:"font-bold leading-[1.2] tracking-[-0.04em]"}),e.valueUnit&&(0,t.jsx)(n.Text,{html:e.valueUnit,className:"lg-desktop:text-2xl text-xl font-bold leading-[1.2] tracking-[-0.04em]"})]}),(0,t.jsx)(n.Text,{html:h?.title||c?.title,className:"lg-desktop:text-2xl line-clamp-2 min-h-[48px] text-wrap text-xl font-bold leading-[1.2] tracking-[-0.04em]"})]})]})});I.displayName="GiftTierCard";const F=l.forwardRef(({classNames:e={},data:i,onCardClick:s,buildData:m,...a},v)=>{const o=l.useRef(null);l.useImperativeHandle(v,()=>o.current),(0,A.useExposure)(o,{componentType:b,componentName:S,componentTitle:i.items?.[0]?.threshold||"",componentDescription:""});const c=i.theme||"light",h=i.showTimeline!==!1,[x,g]=l.useState(null),[H,R]=l.useState(null),u=l.useMemo(()=>m?.products?.length?i.items.filter(r=>{const d=r.products?.[0];return d?.handle?m.products.find(k=>k.handle===d.handle)?.variants?.find(k=>k?.sku===d?.sku)?.availableForSale!==!1:!0}):i.items,[i.items,m?.products]),{trackSelectItem:D}=(0,L.useProductListTrack)({containerRef:o,listName:S,items:u.map(r=>r.products?.[0]).filter(Boolean),products:m?.products}),U=l.useMemo(()=>{const r=u.length;return{0:{slidesPerView:1.2,spaceBetween:12},768:{slidesPerView:Math.min(r,2.5),spaceBetween:12},1025:{slidesPerView:Math.min(r,3.5),spaceBetween:16},1440:{slidesPerView:Math.min(r,4),spaceBetween:16}}},[u.length]),_=l.useMemo(()=>{const r=u.length;return{0:{slidesPerView:1.2,spaceBetween:0},768:{slidesPerView:Math.min(r,2.5),spaceBetween:0},1025:{slidesPerView:Math.min(r,3.5),spaceBetween:0},1440:{slidesPerView:Math.min(r,4),spaceBetween:0}}},[u.length]),M=l.useMemo(()=>C.Controller?[C.Controller]:[],[]);return(0,t.jsxs)(n.Container,{ref:o,className:(0,p.cn)(e?.root),childClassName:"overflow-hidden","data-ui-component-id":"GiftTierShelf",...a,children:[(0,t.jsx)(f.Swiper,{modules:M,breakpoints:U,className:"w-full !overflow-visible",onSwiper:g,controller:{control:H},children:u.map((r,d)=>(0,t.jsx)(f.SwiperSlide,{children:(0,t.jsx)(I,{item:r,theme:c,buildData:m,className:e?.card,onClick:()=>{const T=r.products?.[0];T&&D(T,d),s?.(r,d)}})},"giftTierItem"+d))}),h&&(0,t.jsx)("div",{className:"mt-4 flex flex-col gap-4",children:(0,t.jsx)("div",{className:(0,p.cn)("w-full",e?.timeline),children:(0,t.jsx)(f.Swiper,{modules:M,breakpoints:_,className:"w-full !overflow-visible",onSwiper:R,controller:{control:x},children:u.map((r,d)=>(0,t.jsx)(f.SwiperSlide,{children:(0,t.jsxs)("div",{className:"flex flex-col items-center",children:[(0,t.jsx)(B,{theme:c}),(0,t.jsx)(n.Text,{html:r.threshold,className:(0,p.cn)("lg-desktop:text-2xl text-center text-xl font-bold leading-[1.2] tracking-[-0.04em]",V({theme:c}),e?.thresholdText)})]})},"timelineItem"+d))})})})]})});F.displayName="GiftTierShelf";var Y=(0,z.withLayout)(F);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/GiftTierShelf/index.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport { Text, Picture, Container, Heading } from '../../components/index.js'\nimport { cva } from 'class-variance-authority'\nimport type { GiftTierShelfProps, GiftTierItem, Media } from './types.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport * as SwiperModules from 'swiper/modules'\nimport type { Swiper as SwiperType } from 'swiper'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport type { Product, ProductVariant } from '../Listing/types/product.js'\nimport { formatPrice } from '../Listing/utils/index.js'\n\n/**\n * Card style variants\n */\nconst cardVariants = cva(\n 'lg-desktop:h-[400px] rounded-card desktop:pt-4 desktop:pb-6 relative flex h-[320px] flex-col items-start gap-1 overflow-hidden p-4',\n {\n variants: {\n theme: {\n light: 'bg-gradient-to-b from-[#FCCA7B] to-[#FFE6BF]',\n dark: 'bg-gradient-to-b from-[#3A3A3A] to-[#1D1D1F]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n }\n)\n\n/**\n * Text color variants\n */\nconst textVariants = cva('', {\n variants: {\n theme: {\n light: 'text-[#080A0F]',\n dark: 'text-white',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n})\n\n/**\n * Member Tag Component\n */\nconst MemberTag = React.memo(({ image }: { image?: Media }) => {\n if (!image) return null\n\n return (\n <Picture\n source={image.url}\n alt={image.alt || 'Member Tag'}\n className=\"h-full w-auto\"\n imgClassName=\"h-full w-auto object-contain\"\n />\n )\n})\n\nMemberTag.displayName = 'MemberTag'\n\n/**\n * Timeline Item Component - \u5355\u4E2A\u65F6\u95F4\u8F74\u8282\u70B9\n */\nconst TimelineItem = React.memo(({ theme = 'light' }: { theme?: 'light' | 'dark' }) => {\n const trackColor = theme === 'light' ? 'bg-[#f6cd4e]' : 'bg-[#F5F6F7]'\n\n return (\n <div className=\"flex h-4 w-full items-center\">\n <div className={cn('flex h-1 w-full items-center justify-center', trackColor)}>\n {/* Handle */}\n <div className={cn('relative size-4 shrink-0 rounded-full', trackColor)}></div>\n </div>\n </div>\n )\n})\n\nTimelineItem.displayName = 'TimelineItem'\n\n/**\n * Gift Tier Card Component\n */\nconst GiftTierCard = React.memo(\n ({\n item,\n theme = 'light',\n className,\n onClick,\n buildData,\n }: {\n item: GiftTierItem\n theme?: 'light' | 'dark'\n className?: string\n onClick?: () => void\n buildData?: {\n products: Product[]\n }\n }) => {\n const { locale = 'us' } = useAiuiContext()\n // \u83B7\u53D6\u7B2C\u4E00\u4E2A\u4EA7\u54C1\u7684\u7B80\u5316\u6570\u636E\n const product = item.products?.[0]\n\n const fullProduct = React.useMemo(() => {\n if (!product?.handle || !buildData?.products?.length) return null\n return buildData.products.find(p => p.handle === product.handle) || null\n }, [product?.handle, buildData?.products])\n\n const fullProductVariant = React.useMemo(\n () => fullProduct?.variants?.find(variant => variant?.sku === product?.sku) || ({} as ProductVariant),\n [product?.sku, fullProduct?.variants]\n )\n\n const price = formatPrice({\n locale: locale || 'us',\n amount: product?.custom_price ?? fullProductVariant?.price?.amount,\n currencyCode: fullProduct?.price?.currencyCode || 'USD',\n })\n\n return (\n <div className={cn(cardVariants({ theme }), className)} onClick={onClick} data-ui-component-id=\"GiftTierCard\">\n {/* Member Tag */}\n <div className=\"lg-desktop:h-[28px] z-10 h-6\">\n {item.showMemberTag && item.memberTagImage && <MemberTag image={item.memberTagImage} />}\n </div>\n\n {/* Product Image */}\n <div className=\"relative z-10 mx-auto min-h-0 w-fit flex-1\">\n <Picture\n source={fullProductVariant?.image?.url || fullProduct?.images[0]?.url}\n className=\"size-full\"\n imgClassName=\"size-full object-contain\"\n />\n </div>\n\n {/* Product Info */}\n <div className={cn('z-10 flex w-full shrink-0 flex-col gap-2', textVariants({ theme }))}>\n {/* Price */}\n <div className=\"flex items-end gap-1\">\n <Heading html={price} size={4} className=\"font-bold leading-[1.2] tracking-[-0.04em]\" />\n {item.valueUnit && (\n <Text\n html={item.valueUnit}\n className=\"lg-desktop:text-2xl text-xl font-bold leading-[1.2] tracking-[-0.04em]\"\n />\n )}\n </div>\n\n {/* Product Name */}\n <Text\n html={fullProductVariant?.title || fullProduct?.title}\n className=\"lg-desktop:text-2xl line-clamp-2 min-h-[48px] text-wrap text-xl font-bold leading-[1.2] tracking-[-0.04em]\"\n />\n </div>\n </div>\n )\n }\n)\n\nGiftTierCard.displayName = 'GiftTierCard'\n\n/**\n * GiftTierShelf - \u6EE1\u8D60\u8D27\u67B6\u7EC4\u4EF6\n *\n * @description \u9636\u68AF\u5F0F\u6EE1\u8D60\u6D3B\u52A8\u5C55\u793A\uFF0C\u652F\u6301\u591A\u4E2A\u6863\u4F4D\u7684\u4EA7\u54C1\u5C55\u793A\u548C\u65F6\u95F4\u8F74\n */\nconst GiftTierShelf = React.forwardRef<HTMLDivElement, GiftTierShelfProps>(\n ({ classNames = {}, data, onCardClick, buildData, ...rest }, ref) => {\n const theme = data.theme || 'light'\n const showTimeline = data.showTimeline !== false\n\n // Swiper \u5B9E\u4F8B\u72B6\u6001\uFF0C\u7528\u4E8E\u8054\u52A8\u63A7\u5236\n const [cardSwiper, setCardSwiper] = React.useState<SwiperType | null>(null)\n const [timelineSwiper, setTimelineSwiper] = React.useState<SwiperType | null>(null)\n\n // \u8FC7\u6EE4\u51FA\u53EF\u552E\u4EA7\u54C1\uFF0C\u786E\u4FDD\u5361\u7247\u4E0E Timeline \u540C\u6B65\n const availableItems = React.useMemo(() => {\n if (!buildData?.products?.length) return data.items\n\n return data.items.filter(item => {\n const product = item.products?.[0]\n if (!product?.handle) return true // \u6CA1\u6709\u5173\u8054\u4EA7\u54C1\u65F6\u9ED8\u8BA4\u663E\u793A\n\n const fullProduct = buildData.products.find(p => p.handle === product.handle)\n const variant = fullProduct?.variants?.find(v => v?.sku === product?.sku)\n\n return variant?.availableForSale !== false\n })\n }, [data.items, buildData?.products])\n\n // Card Swiper breakpoints\n const cardSwiperBreakpoints = React.useMemo(() => {\n const itemCount = availableItems.length\n return {\n 0: { slidesPerView: 1.2, spaceBetween: 12 },\n 768: { slidesPerView: Math.min(itemCount, 2.5), spaceBetween: 12 },\n 1025: { slidesPerView: Math.min(itemCount, 3.5), spaceBetween: 16 },\n 1440: { slidesPerView: Math.min(itemCount, 4), spaceBetween: 16 },\n }\n }, [availableItems.length])\n\n // Timeline Swiper breakpoints (spaceBetween \u4E3A 0)\n const timelineSwiperBreakpoints = React.useMemo(() => {\n const itemCount = availableItems.length\n return {\n 0: { slidesPerView: 1.2, spaceBetween: 0 },\n 768: { slidesPerView: Math.min(itemCount, 2.5), spaceBetween: 0 },\n 1025: { slidesPerView: Math.min(itemCount, 3.5), spaceBetween: 0 },\n 1440: { slidesPerView: Math.min(itemCount, 4), spaceBetween: 0 },\n }\n }, [availableItems.length])\n\n const swiperModules = React.useMemo(() => (SwiperModules.Controller ? [SwiperModules.Controller] : []), [])\n\n return (\n <Container\n ref={ref}\n className={cn(classNames?.root)}\n childClassName=\"overflow-hidden\"\n data-ui-component-id=\"GiftTierShelf\"\n {...rest}\n >\n {/* Cards Swiper */}\n <Swiper\n modules={swiperModules}\n breakpoints={cardSwiperBreakpoints}\n className=\"w-full !overflow-visible\"\n onSwiper={setCardSwiper}\n controller={{ control: timelineSwiper }}\n >\n {availableItems.map((item, index) => (\n <SwiperSlide key={'giftTierItem' + index}>\n <GiftTierCard\n item={item}\n theme={theme}\n buildData={buildData}\n className={classNames?.card}\n onClick={() => onCardClick?.(item, index)}\n />\n </SwiperSlide>\n ))}\n </Swiper>\n\n {/* Timeline */}\n {showTimeline && (\n <div className=\"mt-4 flex flex-col gap-4\">\n {/* Timeline Swiper */}\n <div className={cn('w-full', classNames?.timeline)}>\n <Swiper\n modules={swiperModules}\n breakpoints={timelineSwiperBreakpoints}\n className=\"w-full !overflow-visible\"\n onSwiper={setTimelineSwiper}\n controller={{ control: cardSwiper }}\n >\n {availableItems.map((item, index) => (\n <SwiperSlide key={'timelineItem' + index}>\n <div className=\"flex flex-col items-center\">\n <TimelineItem theme={theme} />\n <Text\n html={item.threshold}\n className={cn(\n 'lg-desktop:text-2xl text-center text-xl font-bold leading-[1.2] tracking-[-0.04em]',\n textVariants({ theme }),\n classNames?.thresholdText\n )}\n />\n </div>\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n </div>\n )}\n </Container>\n )\n }\n)\n\nGiftTierShelf.displayName = 'GiftTierShelf'\n\nexport default withLayout(GiftTierShelf)\nexport type { GiftTierShelfProps, GiftTierShelfData, GiftTierItem, GiftTierProduct } from './types.js'\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAuDI,IAAAI,EAAA,6BArDJC,EAAuB,oBACvBC,EAAmB,kCACnBC,EAAkD,qCAClDC,EAAo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AAGJ,GAAY,IAAI,EAC9B,eAAe,kBACf,uBAAqB,gBACpB,GAAGG,EAGJ,oBAAC,UACC,QAASY,EACT,YAAaH,EACb,UAAU,2BACV,SAAUL,EACV,WAAY,CAAE,QAASC,CAAe,EAErC,SAAAE,EAAe,IAAI,CAACtB,EAAM4B,OACzB,OAAC,eACC,mBAAC7B,EAAA,CACC,KAAMC,EACN,MAAOH,EACP,UAAWM,EACX,UAAWS,GAAY,KACvB,QAAS,IAAME,IAAcd,EAAM4B,CAAK,EAC1C,GAPgB,eAAiBA,CAQnC,CACD,EACH,EAGCX,MACC,OAAC,OAAI,UAAU,2BAEb,mBAAC,OAAI,aAAW,MAAG,SAAUL,GAAY,QAAQ,EAC/C,mBAAC,UACC,QAASe,EACT,YAAaD,EACb,UAAU,2BACV,SAAUL,EACV,WAAY,CAAE,QAASH,CAAW,EAEjC,SAAAI,EAAe,IAAI,CAACtB,EAAM4B,OACzB,OAAC,eACC,oBAAC,OAAI,UAAU,6BACb,oBAAChC,EAAA,CAAa,MAAOC,EAAO,KAC5B,OAAC,QACC,KAAMG,EAAK,UACX,aAAW,MACT,qFACAP,EAAa,CAAE,MAAAI,CAAM,CAAC,EACtBe,GAAY,aACd,EACF,GACF,GAXgB,eAAiBgB,CAYnC,CACD,EACH,EACF,EACF,GAEJ,CAEJ,CACF,EAEAjB,EAAc,YAAc,gBAE5B,IAAO/B,KAAQ,cAAW+B,CAAa",
6
- "names": ["GiftTierShelf_exports", "__export", "GiftTierShelf_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_components", "import_class_variance_authority", "import_react", "SwiperModules", "import_Styles", "import_AiuiProvider", "import_utils", "cardVariants", "textVariants", "MemberTag", "image", "TimelineItem", "theme", "trackColor", "GiftTierCard", "item", "className", "onClick", "buildData", "locale", "product", "fullProduct", "p", "fullProductVariant", "variant", "price", "GiftTierShelf", "classNames", "data", "onCardClick", "rest", "ref", "showTimeline", "cardSwiper", "setCardSwiper", "timelineSwiper", "setTimelineSwiper", "availableItems", "v", "cardSwiperBreakpoints", "itemCount", "timelineSwiperBreakpoints", "swiperModules", "index"]
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport { Text, Picture, Container, Heading } from '../../components/index.js'\nimport { cva } from 'class-variance-authority'\nimport type { GiftTierShelfProps, GiftTierItem, Media } from './types.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport * as SwiperModules from 'swiper/modules'\nimport type { Swiper as SwiperType } from 'swiper'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useProductListTrack } from '../../hooks/useProductListTrack.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport type { Product, ProductVariant } from '../Listing/types/product.js'\nimport { formatPrice } from '../Listing/utils/index.js'\n\nconst componentType = 'image'\nconst componentName = 'gift_tier_shelf'\n/**\n * Card style variants\n */\nconst cardVariants = cva(\n 'lg-desktop:h-[400px] rounded-card desktop:pt-4 desktop:pb-6 relative flex h-[320px] flex-col items-start gap-1 overflow-hidden p-4',\n {\n variants: {\n theme: {\n light: 'bg-gradient-to-b from-[#FCCA7B] to-[#FFE6BF]',\n dark: 'bg-gradient-to-b from-[#3A3A3A] to-[#1D1D1F]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n }\n)\n\n/**\n * Text color variants\n */\nconst textVariants = cva('', {\n variants: {\n theme: {\n light: 'text-[#080A0F]',\n dark: 'text-white',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n})\n\n/**\n * Member Tag Component\n */\nconst MemberTag = React.memo(({ image }: { image?: Media }) => {\n if (!image) return null\n\n return (\n <Picture\n source={image.url}\n alt={image.alt || 'Member Tag'}\n className=\"h-full w-auto\"\n imgClassName=\"h-full w-auto object-contain\"\n />\n )\n})\n\nMemberTag.displayName = 'MemberTag'\n\n/**\n * Timeline Item Component - \u5355\u4E2A\u65F6\u95F4\u8F74\u8282\u70B9\n */\nconst TimelineItem = React.memo(({ theme = 'light' }: { theme?: 'light' | 'dark' }) => {\n const trackColor = theme === 'light' ? 'bg-[#f6cd4e]' : 'bg-[#F5F6F7]'\n\n return (\n <div className=\"flex h-4 w-full items-center\">\n <div className={cn('flex h-1 w-full items-center justify-center', trackColor)}>\n {/* Handle */}\n <div className={cn('relative size-4 shrink-0 rounded-full', trackColor)}></div>\n </div>\n </div>\n )\n})\n\nTimelineItem.displayName = 'TimelineItem'\n\n/**\n * Gift Tier Card Component\n */\nconst GiftTierCard = React.memo(\n ({\n item,\n theme = 'light',\n className,\n onClick,\n buildData,\n }: {\n item: GiftTierItem\n theme?: 'light' | 'dark'\n className?: string\n onClick?: () => void\n buildData?: {\n products: Product[]\n }\n }) => {\n const { locale = 'us' } = useAiuiContext()\n // \u83B7\u53D6\u7B2C\u4E00\u4E2A\u4EA7\u54C1\u7684\u7B80\u5316\u6570\u636E\n const product = item.products?.[0]\n\n const fullProduct = React.useMemo(() => {\n if (!product?.handle || !buildData?.products?.length) return null\n return buildData.products.find(p => p.handle === product.handle) || null\n }, [product?.handle, buildData?.products])\n\n const fullProductVariant = React.useMemo(\n () => fullProduct?.variants?.find(variant => variant?.sku === product?.sku) || ({} as ProductVariant),\n [product?.sku, fullProduct?.variants]\n )\n\n const price = formatPrice({\n locale: locale || 'us',\n amount: product?.custom_price ?? fullProductVariant?.price?.amount,\n currencyCode: fullProduct?.price?.currencyCode || 'USD',\n })\n\n return (\n <div\n className={cn(cardVariants({ theme }), className)}\n onClick={onClick}\n data-ui-component-id=\"GiftTierCard\"\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-sku={product?.sku || ''}\n >\n {/* Member Tag */}\n <div className=\"lg-desktop:h-[28px] z-10 h-6\">\n {item.showMemberTag && item.memberTagImage && <MemberTag image={item.memberTagImage} />}\n </div>\n\n {/* Product Image */}\n <div className=\"relative z-10 mx-auto min-h-0 w-fit flex-1\">\n <Picture\n source={fullProductVariant?.image?.url || fullProduct?.images[0]?.url}\n className=\"size-full\"\n imgClassName=\"size-full object-contain\"\n />\n </div>\n\n {/* Product Info */}\n <div className={cn('z-10 flex w-full shrink-0 flex-col gap-2', textVariants({ theme }))}>\n {/* Price */}\n <div className=\"flex items-end gap-1\">\n <Heading html={price} size={4} className=\"font-bold leading-[1.2] tracking-[-0.04em]\" />\n {item.valueUnit && (\n <Text\n html={item.valueUnit}\n className=\"lg-desktop:text-2xl text-xl font-bold leading-[1.2] tracking-[-0.04em]\"\n />\n )}\n </div>\n\n {/* Product Name */}\n <Text\n html={fullProductVariant?.title || fullProduct?.title}\n className=\"lg-desktop:text-2xl line-clamp-2 min-h-[48px] text-wrap text-xl font-bold leading-[1.2] tracking-[-0.04em]\"\n />\n </div>\n </div>\n )\n }\n)\n\nGiftTierCard.displayName = 'GiftTierCard'\n\n/**\n * GiftTierShelf - \u6EE1\u8D60\u8D27\u67B6\u7EC4\u4EF6\n *\n * @description \u9636\u68AF\u5F0F\u6EE1\u8D60\u6D3B\u52A8\u5C55\u793A\uFF0C\u652F\u6301\u591A\u4E2A\u6863\u4F4D\u7684\u4EA7\u54C1\u5C55\u793A\u548C\u65F6\u95F4\u8F74\n */\nconst GiftTierShelf = React.forwardRef<HTMLDivElement, GiftTierShelfProps>(\n ({ classNames = {}, data, onCardClick, buildData, ...rest }, ref) => {\n const innerRef = React.useRef<HTMLDivElement>(null)\n\n React.useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n // \u7EC4\u4EF6\u66DD\u5149\u57CB\u70B9\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: data.items?.[0]?.threshold || '',\n componentDescription: '',\n })\n const theme = data.theme || 'light'\n const showTimeline = data.showTimeline !== false\n\n // Swiper \u5B9E\u4F8B\u72B6\u6001\uFF0C\u7528\u4E8E\u8054\u52A8\u63A7\u5236\n const [cardSwiper, setCardSwiper] = React.useState<SwiperType | null>(null)\n const [timelineSwiper, setTimelineSwiper] = React.useState<SwiperType | null>(null)\n\n // \u8FC7\u6EE4\u51FA\u53EF\u552E\u4EA7\u54C1\uFF0C\u786E\u4FDD\u5361\u7247\u4E0E Timeline \u540C\u6B65\n const availableItems = React.useMemo(() => {\n if (!buildData?.products?.length) return data.items\n\n return data.items.filter(item => {\n const product = item.products?.[0]\n if (!product?.handle) return true // \u6CA1\u6709\u5173\u8054\u4EA7\u54C1\u65F6\u9ED8\u8BA4\u663E\u793A\n\n const fullProduct = buildData.products.find(p => p.handle === product.handle)\n const variant = fullProduct?.variants?.find(v => v?.sku === product?.sku)\n\n return variant?.availableForSale !== false\n })\n }, [data.items, buildData?.products])\n\n // \u4EA7\u54C1\u5217\u8868\u9732\u51FA + \u9009\u62E9\u57CB\u70B9\n const { trackSelectItem } = useProductListTrack({\n containerRef: innerRef,\n listName: componentName,\n items: availableItems.map(item => item.products?.[0]).filter(Boolean),\n products: buildData?.products,\n })\n\n // Card Swiper breakpoints\n const cardSwiperBreakpoints = React.useMemo(() => {\n const itemCount = availableItems.length\n return {\n 0: { slidesPerView: 1.2, spaceBetween: 12 },\n 768: { slidesPerView: Math.min(itemCount, 2.5), spaceBetween: 12 },\n 1025: { slidesPerView: Math.min(itemCount, 3.5), spaceBetween: 16 },\n 1440: { slidesPerView: Math.min(itemCount, 4), spaceBetween: 16 },\n }\n }, [availableItems.length])\n\n // Timeline Swiper breakpoints (spaceBetween \u4E3A 0)\n const timelineSwiperBreakpoints = React.useMemo(() => {\n const itemCount = availableItems.length\n return {\n 0: { slidesPerView: 1.2, spaceBetween: 0 },\n 768: { slidesPerView: Math.min(itemCount, 2.5), spaceBetween: 0 },\n 1025: { slidesPerView: Math.min(itemCount, 3.5), spaceBetween: 0 },\n 1440: { slidesPerView: Math.min(itemCount, 4), spaceBetween: 0 },\n }\n }, [availableItems.length])\n\n const swiperModules = React.useMemo(() => (SwiperModules.Controller ? [SwiperModules.Controller] : []), [])\n\n return (\n <Container\n ref={innerRef}\n className={cn(classNames?.root)}\n childClassName=\"overflow-hidden\"\n data-ui-component-id=\"GiftTierShelf\"\n {...rest}\n >\n {/* Cards Swiper */}\n <Swiper\n modules={swiperModules}\n breakpoints={cardSwiperBreakpoints}\n className=\"w-full !overflow-visible\"\n onSwiper={setCardSwiper}\n controller={{ control: timelineSwiper }}\n >\n {availableItems.map((item, index) => (\n <SwiperSlide key={'giftTierItem' + index}>\n <GiftTierCard\n item={item}\n theme={theme}\n buildData={buildData}\n className={classNames?.card}\n onClick={() => {\n const product = item.products?.[0]\n if (product) trackSelectItem(product, index)\n onCardClick?.(item, index)\n }}\n />\n </SwiperSlide>\n ))}\n </Swiper>\n\n {/* Timeline */}\n {showTimeline && (\n <div className=\"mt-4 flex flex-col gap-4\">\n {/* Timeline Swiper */}\n <div className={cn('w-full', classNames?.timeline)}>\n <Swiper\n modules={swiperModules}\n breakpoints={timelineSwiperBreakpoints}\n className=\"w-full !overflow-visible\"\n onSwiper={setTimelineSwiper}\n controller={{ control: cardSwiper }}\n >\n {availableItems.map((item, index) => (\n <SwiperSlide key={'timelineItem' + index}>\n <div className=\"flex flex-col items-center\">\n <TimelineItem theme={theme} />\n <Text\n html={item.threshold}\n className={cn(\n 'lg-desktop:text-2xl text-center text-xl font-bold leading-[1.2] tracking-[-0.04em]',\n textVariants({ theme }),\n classNames?.thresholdText\n )}\n />\n </div>\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n </div>\n )}\n </Container>\n )\n }\n)\n\nGiftTierShelf.displayName = 'GiftTierShelf'\n\nexport default withLayout(GiftTierShelf)\nexport type { GiftTierShelfProps, GiftTierShelfData, GiftTierItem, GiftTierProduct } from './types.js'\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA2DI,IAAAI,EAAA,6BAzDJC,EAAuB,oBACvBC,EAAmB,kCACnBC,EAAkD,qCAClDC,EAAoB,oCAEpBC,EAAoC,wBACpCC,EAA+B,6BAE/BC,EAA2B,kCAC3BC,EAA4B,sCAC5BC,EAAoC,8CACpCC,E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Aa,CAAE,MAAAI,CAAM,CAAC,EACtBe,GAAY,aACd,EACF,GACF,GAXgB,eAAiBkB,CAYnC,CACD,EACH,EACF,EACF,GAEJ,CAEJ,CACF,EAEAnB,EAAc,YAAc,gBAE5B,IAAOnC,KAAQ,cAAWmC,CAAa",
6
+ "names": ["GiftTierShelf_exports", "__export", "GiftTierShelf_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_components", "import_class_variance_authority", "import_react", "SwiperModules", "import_Styles", "import_useExposure", "import_useProductListTrack", "import_AiuiProvider", "import_utils", "componentType", "componentName", "cardVariants", "textVariants", "MemberTag", "image", "TimelineItem", "theme", "trackColor", "GiftTierCard", "item", "className", "onClick", "buildData", "locale", "product", "fullProduct", "p", "fullProductVariant", "variant", "price", "GiftTierShelf", "classNames", "data", "onCardClick", "rest", "ref", "innerRef", "showTimeline", "cardSwiper", "setCardSwiper", "timelineSwiper", "setTimelineSwiper", "availableItems", "v", "trackSelectItem", "cardSwiperBreakpoints", "itemCount", "timelineSwiperBreakpoints", "swiperModules", "index"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var q=Object.create;var x=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var X=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var J=(e,o)=>{for(var s in o)x(e,s,{get:o[s],enumerable:!0})},I=(e,o,s,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of X(o))!F.call(e,r)&&r!==s&&x(e,r,{get:()=>o[r],enumerable:!(n=Q(o,r))||n.enumerable});return e};var v=(e,o,s)=>(s=e!=null?q(Z(e)):{},I(o||!e||!e.__esModule?x(s,"default",{value:e,enumerable:!0}):s,e)),K=e=>I(x({},"__esModule",{value:!0}),e);var ee={};J(ee,{default:()=>W});module.exports=K(ee);var t=require("react/jsx-runtime"),C=require("react-responsive"),i=v(require("react")),V=require("react-dom"),a=require("../../helpers/utils.js"),S=require("../../shared/Styles.js"),P=v(require("../SwiperBox/index.js")),p=require("../../components/index.js"),G=v(require("../Title/index.js")),D=require("../VideoModal/index.js"),L=require("../TextModal/index.js"),w=require("../../hooks/useExposure.js"),k=require("../../shared/trackUrlRef.js"),B=require("../AiuiProvider/index.js");const u="image",h="graphic",M=e=>{let o="";const s=l=>(l?.url&&(o=l.url),o),n=s(e.lgDesktop),r=s(e.desktop),m=s(e.laptop),b=s(e.tablet),d=e.default?.url;return[`${n} 9999`,`${r} 1919`,`${m} 1439`,`${b} 1024`,`${d} 768`].join(", ")},N="descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]",O=({data:e,configuration:o})=>{const s=(0,i.useRef)(null),[n,r]=(0,i.useState)({visible:!1,x:0,y:0,text:""}),m=()=>{switch(o.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]"}},b=l=>{e?.description&&r({visible:!0,x:l.clientX,y:l.clientY,text:e.description})},d=()=>{r(l=>({...l,visible:!1}))};return(0,w.useExposure)(s,{componentType:u,componentName:h,componentTitle:e?.title,componentDescription:e?.description,position:o?.index+1}),(0,t.jsx)("div",{ref:s,className:(0,a.cn)(m(),"graphicItem","laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]",{"aiui-dark":e.theme==="dark"}),children:(0,t.jsx)("div",{className:(0,a.cn)("absolute inset-0",{"rounded-xl overflow-hidden laptop:rounded-2xl":o?.itemShape==="round"}),children:(0,t.jsxs)("div",{className:`graphic-children relative block size-full overflow-hidden ${e?.href?"cursor-pointer":""}`,children:[e?.href?(0,t.jsx)("a",{"aria-label":e?.title??e?.description,href:(0,k.trackUrlRef)(e?.href||"",`${u}_${h}`),className:"rounded-card block size-full overflow-hidden","data-headless-nav-postion":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:(0,t.jsx)(p.Picture,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?M(e.backgroundImage):e?.imgUrl?.url,alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""})}):(0,t.jsx)("div",{className:"rounded-card block size-full overflow-hidden",children:(0,t.jsx)(p.Picture,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?M(e.backgroundImage):e?.imgUrl?.url||"",alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""})}),(0,t.jsxs)("div",{className:"laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4",children:[(0,t.jsxs)("div",{className:(0,a.cn)("flex items-end gap-1 overflow-hidden","graphic-bottom"),children:[(0,t.jsxs)("div",{className:"flex-1 overflow-hidden",children:[(0,t.jsx)(p.Text,{html:e?.title,style:{color:e?.textColor},className:"spanTitle graphic-title lg-desktop:text-lg desktop:text-base line-clamp-3 text-sm font-bold leading-[1.2]"}),e?.description&&(0,t.jsxs)("div",{onMouseMove:b,onMouseLeave:d,children:[e?.title?(0,t.jsx)(p.Heading,{html:e?.description,style:{color:e?.textColor},as:"h3",className:`${N} graphic-description`}):(0,t.jsx)("h3",{style:{color:e?.textColor},dangerouslySetInnerHTML:{__html:e?.description||""},className:`${N} graphic-description-item`}),typeof window<"u"&&n.visible&&(0,V.createPortal)((0,t.jsx)("div",{className:"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200",style:{left:`${n.x+16}px`,top:`${n.y+16}px`},children:n.text}),document.body)]})]}),!e?.isShowIcon&&(e?.video?.url||e?.youtubeId)&&(0,t.jsx)("button",{"aria-label":"Play Video",onClick:l=>{l.preventDefault(),l.stopPropagation(),o?.onVideoPlayBtnClick?.(o?.index||0,e)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white/20 hover:bg-black/75",children:(0,t.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})}),e?.isShowIcon&&e?.icon?.url&&(0,t.jsx)("button",{onClick:l=>{l.preventDefault(),l.stopPropagation(),o?.onIconClick?.(e,o)},className:"laptop:size-9 flex size-8 items-center justify-center overflow-hidden rounded-full bg-white/20 hover:bg-black/75",children:(0,t.jsx)(p.Picture,{className:"h-full",imgClassName:"h-full object-cover",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),e.buttonText&&(0,t.jsx)(p.Button,{as:"a","aria-label":e?.title??e?.description,variant:"secondary",className:"bgButton mt-[8px] self-start",href:(0,k.trackUrlRef)((0,a.getLocalizedPath)(e?.href||"",o?.locale||"us"),`${u}_${h}`),"data-headless-nav-position":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}#${e?.buttonText}`,children:e.buttonText})]})]})})})},$=i.default.forwardRef(({data:e,className:o,...s},n)=>{const r=(0,C.useMediaQuery)({query:"(max-width: 768px)"}),m=(0,i.useRef)(null),[b,d]=(0,i.useState)(!1),[l,U]=(0,i.useState)(""),[z,H]=(0,i.useState)(""),[E,R]=(0,i.useState)(""),[j,y]=(0,i.useState)(null),[_,T]=(0,i.useState)(!1),{locale:Y="us"}=(0,B.useAiuiContext)(),f=g=>{const c=e?.items?.length>3,A=e?.items?.length>2;switch(g){case 1440:return c?4:e?.items?.length;case 1024:return c?3:e?.items?.length;case 768:return e?.items?.length===1?1:c||A?2.3:2;default:return e?.items?.length===1?1:1.2}};return(0,i.useImperativeHandle)(n,()=>m.current),(0,w.useExposure)(m,{componentType:u,componentName:h,componentTitle:e?.title}),(0,t.jsxs)("div",{...s,ref:m,className:(0,a.cn)("graphicBlock",o),children:[(0,t.jsxs)("div",{className:"graphic-box",children:[e?.title&&(0,t.jsx)(G.default,{data:{title:e?.title}}),(0,t.jsx)(P.default,{id:"Graphic",className:(0,a.cn)("!overflow-visible"),data:{list:e?.items||[],configuration:{itemShape:e.itemShape,num:e?.items?.length||0,locale:Y,onVideoPlayBtnClick:(g,c)=>{d(!0),c?.isYouTube?H?.(c?.youtubeId||""):(U?.(c?.video?.url||""),R?.(c?.mobileVideo?.url||""))},onIconClick:g=>{T(!0),y(g)},title:e?.title}},Slide:O,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:f()},768:{spaceBetween:16,freeMode:!1,slidesPerView:f(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:f(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:f(1440)}}})]}),(0,t.jsx)(D.VideoModal,{visible:b,youTubeId:z,onCloseModal:()=>d(!1),videoUrl:r&&E||l}),(0,t.jsx)(L.TextModal,{textVisible:_,extension:j?.extension,onCloseModal:()=>{T(!1),y(null)}})]})});$.displayName="Graphic";var W=(0,S.withLayout)($);
1
+ "use strict";"use client";var q=Object.create;var v=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var X=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var J=(e,o)=>{for(var s in o)v(e,s,{get:o[s],enumerable:!0})},$=(e,o,s,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of X(o))!F.call(e,r)&&r!==s&&v(e,r,{get:()=>o[r],enumerable:!(c=Q(o,r))||c.enumerable});return e};var k=(e,o,s)=>(s=e!=null?q(Z(e)):{},$(o||!e||!e.__esModule?v(s,"default",{value:e,enumerable:!0}):s,e)),K=e=>$(v({},"__esModule",{value:!0}),e);var ee={};J(ee,{default:()=>W});module.exports=K(ee);var t=require("react/jsx-runtime"),P=require("react-responsive"),l=k(require("react")),D=require("react-dom"),a=require("../../helpers/utils.js"),G=require("../../shared/Styles.js"),L=k(require("../SwiperBox/index.js")),p=require("../../components/index.js"),B=k(require("../Title/index.js")),H=require("../VideoModal/index.js"),U=require("../TextModal/index.js"),y=require("../../hooks/useExposure.js"),T=require("../../shared/trackUrlRef.js"),I=require("../AiuiProvider/index.js");const b="image",g="graphic",C=e=>{let o="";const s=d=>(d?.url&&(o=d.url),o),c=s(e.lgDesktop),r=s(e.desktop),n=s(e.laptop),u=s(e.tablet),h=e.default?.url;return[`${c} 9999`,`${r} 1919`,`${n} 1439`,`${u} 1024`,`${h} 768`].join(", ")},V="descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]",O=({data:e,configuration:o})=>{const s=(0,l.useRef)(null),{trackingData:c,locale:r="us"}=(0,I.useAiuiContext)(),[n,u]=(0,l.useState)({visible:!1,x:0,y:0,text:""}),h=()=>{switch(o.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]"}},d=i=>{e?.description&&u({visible:!0,x:i.clientX,y:i.clientY,text:e.description})},w=()=>{u(i=>({...i,visible:!1}))};return(0,y.useExposure)(s,{componentType:b,componentName:g,componentTitle:e?.title,componentDescription:e?.description,position:o?.index+1}),(0,t.jsx)("div",{ref:s,className:(0,a.cn)(h(),"graphicItem","laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]",{"aiui-dark":e.theme==="dark"}),children:(0,t.jsx)("div",{className:(0,a.cn)("absolute inset-0",{"rounded-xl overflow-hidden laptop:rounded-2xl":o?.itemShape==="round"}),children:(0,t.jsxs)("div",{className:`graphic-children relative block size-full overflow-hidden ${e?.href?"cursor-pointer":""}`,children:[e?.href?(0,t.jsx)("a",{"aria-label":e?.title??e?.description,href:(0,T.trackUrlRef)((0,a.getLocalizedPath)(e?.href||"",r),`${c?.contextHandle||""}_${b}_${g}`),className:"rounded-card block size-full overflow-hidden","data-headless-nav-postion":`''#${o?.index+1}`,"data-headless-type-name":`${b}#${g}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:(0,t.jsx)(p.Picture,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?C(e.backgroundImage):e?.imgUrl?.url,alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""})}):(0,t.jsx)("div",{className:"rounded-card block size-full overflow-hidden",children:(0,t.jsx)(p.Picture,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?C(e.backgroundImage):e?.imgUrl?.url||"",alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""})}),(0,t.jsxs)("div",{className:"laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4",children:[(0,t.jsxs)("div",{className:(0,a.cn)("flex items-end gap-1 overflow-hidden","graphic-bottom"),children:[(0,t.jsxs)("div",{className:"flex-1 overflow-hidden",children:[(0,t.jsx)(p.Text,{html:e?.title,style:{color:e?.textColor},className:"spanTitle graphic-title lg-desktop:text-lg desktop:text-base line-clamp-3 text-sm font-bold leading-[1.2]"}),e?.description&&(0,t.jsxs)("div",{onMouseMove:d,onMouseLeave:w,children:[e?.title?(0,t.jsx)(p.Heading,{html:e?.description,style:{color:e?.textColor},as:"h3",className:`${V} graphic-description`}):(0,t.jsx)("h3",{style:{color:e?.textColor},dangerouslySetInnerHTML:{__html:e?.description||""},className:`${V} graphic-description-item`}),typeof window<"u"&&n.visible&&(0,D.createPortal)((0,t.jsx)("div",{className:"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200",style:{left:`${n.x+16}px`,top:`${n.y+16}px`},children:n.text}),document.body)]})]}),!e?.isShowIcon&&(e?.video?.url||e?.youtubeId)&&(0,t.jsx)("button",{"aria-label":"Play Video",onClick:i=>{i.preventDefault(),i.stopPropagation(),o?.onVideoPlayBtnClick?.(o?.index||0,e)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white/20 hover:bg-black/75",children:(0,t.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})}),e?.isShowIcon&&e?.icon?.url&&(0,t.jsx)("button",{onClick:i=>{i.preventDefault(),i.stopPropagation(),o?.onIconClick?.(e,o)},className:"laptop:size-9 flex size-8 items-center justify-center overflow-hidden rounded-full bg-white/20 hover:bg-black/75",children:(0,t.jsx)(p.Picture,{className:"h-full",imgClassName:"h-full object-cover",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),e.buttonText&&(0,t.jsx)(p.Button,{as:"a","aria-label":e?.title??e?.description,variant:"secondary",className:"bgButton mt-[8px] self-start",href:(0,T.trackUrlRef)((0,a.getLocalizedPath)(e?.href||"",o?.locale||"us"),`${c?.contextHandle||""}_${b}_${g}`),"data-headless-nav-position":`''#${o?.index+1}`,"data-headless-type-name":`${b}#${g}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}#${e?.buttonText}`,children:e.buttonText})]})]})})})},S=l.default.forwardRef(({data:e,className:o,...s},c)=>{const r=(0,P.useMediaQuery)({query:"(max-width: 768px)"}),n=(0,l.useRef)(null),[u,h]=(0,l.useState)(!1),[d,w]=(0,l.useState)(""),[i,z]=(0,l.useState)(""),[E,R]=(0,l.useState)(""),[_,M]=(0,l.useState)(null),[j,N]=(0,l.useState)(!1),{locale:Y="us",trackingData:te}=(0,I.useAiuiContext)(),f=x=>{const m=e?.items?.length>3,A=e?.items?.length>2;switch(x){case 1440:return m?4:e?.items?.length;case 1024:return m?3:e?.items?.length;case 768:return e?.items?.length===1?1:m||A?2.3:2;default:return e?.items?.length===1?1:1.2}};return(0,l.useImperativeHandle)(c,()=>n.current),(0,y.useExposure)(n,{componentType:b,componentName:g,componentTitle:e?.title}),(0,t.jsxs)("div",{...s,ref:n,className:(0,a.cn)("graphicBlock",o),children:[(0,t.jsxs)("div",{className:"graphic-box",children:[e?.title&&(0,t.jsx)(B.default,{data:{title:e?.title}}),(0,t.jsx)(L.default,{id:"Graphic",className:(0,a.cn)("!overflow-visible"),data:{list:e?.items||[],configuration:{itemShape:e.itemShape,num:e?.items?.length||0,locale:Y,onVideoPlayBtnClick:(x,m)=>{h(!0),m?.isYouTube?z?.(m?.youtubeId||""):(w?.(m?.video?.url||""),R?.(m?.mobileVideo?.url||""))},onIconClick:x=>{N(!0),M(x)},title:e?.title}},Slide:O,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:f()},768:{spaceBetween:16,freeMode:!1,slidesPerView:f(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:f(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:f(1440)}}})]}),(0,t.jsx)(H.VideoModal,{visible:u,youTubeId:i,onCloseModal:()=>h(!1),videoUrl:r&&E||d}),(0,t.jsx)(U.TextModal,{textVisible:j,extension:_?.extension,onCloseModal:()=>{N(!1),M(null)}})]})});S.displayName="Graphic";var W=(0,G.withLayout)(S);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Graphic/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport { useMediaQuery } from 'react-responsive'\nimport React, { useEffect, useImperativeHandle, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport Title from '../Title/index.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { TextModal } from '../TextModal/index.js'\nimport type { ComponentCommonProps, Video, Img, Theme } from '../../types/props.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\n\nconst componentType = 'image'\nconst componentName = 'graphic'\n\ntype GraphicType = {\n imgUrl: Img\n title: string\n description?: string\n textColor?: string\n href?: string\n video?: Video\n mobileVideo?: Video\n youtubeId?: string\n isYouTube?: boolean\n isShowIcon?: boolean\n buttonText?: string\n icon?: Img\n theme?: Theme\n backgroundImage?: {\n default?: Img\n tablet?: Img\n laptop?: Img\n desktop?: Img\n lgDesktop?: Img\n }\n extension?: {\n text: string\n textDesc: string\n textTitle: string\n textPcImg: Img\n textMobileImg: Img\n }\n}\n\n/**\n * \u5C06 backgroundImage \u5404\u5C3A\u5BF8\u5B57\u6BB5\u62FC\u63A5\u6210 Picture source \u5B57\u7B26\u4E32\u683C\u5F0F\n *\n * Picture \u5185\u90E8\u5339\u914D\u89C4\u5219\uFF1A\u5BF9\u6BCF\u4E2A deviceSize\uFF0C\u8FC7\u6EE4 breakpoint >= deviceSize \u7684\u6761\u76EE\uFF0C\u53D6\u6700\u540E\u4E00\u4E2A (.pop())\u3002\n * \u56E0\u6B64 source \u5B57\u7B26\u4E32\u5185\u65AD\u70B9\u5FC5\u987B\u300C\u7531\u5927\u5230\u5C0F\u300D\u6392\u5217\uFF0C\u624D\u80FD\u8BA9 .pop() \u5339\u914D\u5230\u6700\u63A5\u8FD1\u81EA\u8EAB\u7684\u65AD\u70B9\u3002\n *\n * \u65AD\u70B9\u5BF9\u5E94\u5173\u7CFB (max-width):\n * lgDesktop \u2192 1919px (\u22641920px, \u5145\u5F53\u6700\u5927\u5C4F\u5C4F\u5E55\u5339\u914D\u5C42)\n * desktop \u2192 1439px (1440px - 1919px)\n * laptop \u2192 1024px (1025px - 1439px)\n * tablet \u2192 767px (768px - 1024px)\n * default \u2192 \u9996\u4F4D\u65E0\u65AD\u70B9\uFF0C\u5145\u5F53 <img src> (\u79FB\u52A8\u7AEF <768px \u5C4F\u5E55)\n *\n * \u7EE7\u627F\u89C4\u5219\uFF08\u5927 \u2192 \u5C0F\uFF09\uFF1A\u672A\u914D\u7F6E\u7684\u5C3A\u5BF8\u81EA\u52A8\u7EE7\u627F\u4E0A\u4E00\u5C3A\u5BF8\uFF0C\u6700\u7EC8 fallback \u5230 default\n */\nconst buildPictureSource = (bg: NonNullable<GraphicType['backgroundImage']>): string => {\n // \u7531\u5927\u5230\u5C0F\u7EE7\u627F\uFF1A\u672A\u914D\u7F6E\u7684\u5C3A\u5BF8\u7EE7\u627F\u4E0A\u4E00\u5C3A\u5BF8\n let last = ''\n const resolve = (img?: Img) => {\n if (img?.url) last = img.url\n return last\n }\n const lgDesktopSrc = resolve(bg.lgDesktop)\n const desktopSrc = resolve(bg.desktop)\n const laptopSrc = resolve(bg.laptop)\n const tabletSrc = resolve(bg.tablet)\n // default \u65E0\u65AD\u70B9\uFF0C\u4F5C\u4E3A\u9996\u4F4D\u5145\u5F53 <img src>(\u79FB\u52A8\u7AEF\u5C4F\u5E55)\n const defaultSrc = bg.default?.url\n return [\n `${lgDesktopSrc} 9999`, // \u22641920px\n `${desktopSrc} 1919`, // 1440-1919px\n `${laptopSrc} 1439`, // 1025-1439px\n `${tabletSrc} 1024`, // 768-1024px\n `${defaultSrc} 768`, // \u9996\u4F4D\u65E0\u65AD\u70B9 \u2192 <img src>(<768px)\n ].join(', ')\n}\nconst descriptionClass =\n 'descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]'\nexport interface GraphicProps extends ComponentCommonProps, React.HTMLAttributes<HTMLDivElement> {\n data: {\n title?: string\n items?: GraphicType[]\n itemShape?: 'round' | 'square'\n itemTheme?: Theme\n }\n}\n\nconst Item = ({ data, configuration }: { data: GraphicType; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n const [tooltip, setTooltip] = useState<{ visible: boolean; x: number; y: number; text: string }>({\n visible: false,\n x: 0,\n y: 0,\n text: '',\n })\n\n const handleAspect = () => {\n switch (configuration.num) {\n case 1:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 2:\n return 'tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]'\n case 3:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]'\n }\n }\n\n const handleMouseMove = (e: React.MouseEvent) => {\n if (data?.description) {\n setTooltip({\n visible: true,\n x: e.clientX,\n y: e.clientY,\n text: data.description,\n })\n }\n }\n\n const handleMouseLeave = () => {\n setTooltip(prev => ({ ...prev, visible: false }))\n }\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n componentDescription: data?.description,\n position: configuration?.index + 1,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n handleAspect(),\n 'graphicItem',\n 'laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]',\n {\n 'aiui-dark': data.theme === 'dark',\n }\n )}\n >\n <div\n className={cn('absolute inset-0', {\n ['rounded-xl overflow-hidden laptop:rounded-2xl']: configuration?.itemShape === 'round',\n })}\n >\n <div\n className={`graphic-children relative block size-full overflow-hidden ${data?.href ? 'cursor-pointer' : ''}`}\n >\n {data?.href ? (\n <a\n aria-label={data?.title ?? data?.description}\n href={trackUrlRef(data?.href || '', `${componentType}_${componentName}`)}\n className=\"rounded-card block size-full overflow-hidden\"\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}`}\n >\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n source={data?.backgroundImage?.default ? buildPictureSource(data.backgroundImage) : data?.imgUrl?.url}\n alt={\n data?.backgroundImage?.lgDesktop?.alt ||\n data?.backgroundImage?.default?.alt ||\n data?.imgUrl?.alt ||\n ''\n }\n />\n </a>\n ) : (\n <div className=\"rounded-card block size-full overflow-hidden\">\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n source={\n data?.backgroundImage?.default ? buildPictureSource(data.backgroundImage) : data?.imgUrl?.url || ''\n }\n alt={\n data?.backgroundImage?.lgDesktop?.alt ||\n data?.backgroundImage?.default?.alt ||\n data?.imgUrl?.alt ||\n ''\n }\n />\n </div>\n )}\n <div className=\"laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4\">\n <div className={cn('flex items-end gap-1 overflow-hidden', 'graphic-bottom')}>\n <div className=\"flex-1 overflow-hidden\">\n <Text\n html={data?.title}\n style={{ color: data?.textColor }}\n className=\"spanTitle graphic-title lg-desktop:text-lg desktop:text-base line-clamp-3 text-sm font-bold leading-[1.2]\"\n />\n {data?.description && (\n <div onMouseMove={handleMouseMove} onMouseLeave={handleMouseLeave}>\n {data?.title ? (\n <Heading\n html={data?.description}\n style={{\n color: data?.textColor,\n }}\n as=\"h3\"\n className={`${descriptionClass} graphic-description`}\n />\n ) : (\n <h3\n style={{\n color: data?.textColor,\n }}\n dangerouslySetInnerHTML={{ __html: data?.description || '' }}\n className={`${descriptionClass} graphic-description-item`}\n />\n )}\n {typeof window !== 'undefined' &&\n tooltip.visible &&\n createPortal(\n <div\n className=\"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200\"\n style={{\n left: `${tooltip.x + 16}px`,\n top: `${tooltip.y + 16}px`,\n }}\n >\n {tooltip.text}\n </div>,\n document.body\n )}\n </div>\n )}\n </div>\n {!data?.isShowIcon && (data?.video?.url || data?.youtubeId) && (\n <button\n aria-label=\"Play Video\"\n onClick={(e: any) => {\n e.preventDefault()\n e.stopPropagation()\n configuration?.onVideoPlayBtnClick?.(configuration?.index || 0, data)\n }}\n className=\"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white/20 hover:bg-black/75\"\n >\n <svg width=\"12\" height=\"14\" viewBox=\"0 0 12 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L0 14L0 0L12 7Z\" fill=\"white\" />\n </svg>\n </button>\n )}\n {data?.isShowIcon && data?.icon?.url && (\n <button\n onClick={(e: any) => {\n e.preventDefault()\n e.stopPropagation()\n configuration?.onIconClick?.(data, configuration)\n }}\n className=\"laptop:size-9 flex size-8 items-center justify-center overflow-hidden rounded-full bg-white/20 hover:bg-black/75\"\n >\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover\"\n source={data?.icon?.url}\n alt={data?.icon?.alt || ''}\n />\n </button>\n )}\n </div>\n {data.buttonText && (\n <Button\n as=\"a\"\n aria-label={data?.title ?? data?.description}\n variant=\"secondary\"\n className=\"bgButton mt-[8px] self-start\"\n href={trackUrlRef(\n getLocalizedPath(data?.href || '', configuration?.locale || 'us'),\n `${componentType}_${componentName}`\n )}\n data-headless-nav-position={`''#${configuration?.index + 1}`}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}#${data?.buttonText}`}\n >\n {data.buttonText}\n </Button>\n )}\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nconst Graphic = React.forwardRef<HTMLDivElement, GraphicProps>(({ data, className, ...rest }, ref) => {\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const innerRef = useRef<HTMLDivElement>(null)\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n const [mobileVideoUrl, setMobileVideoUrl] = useState<string>('')\n const [currentItem, setCurrentItem] = useState<GraphicType | null>(null)\n const [textVisible, setTextVisible] = useState<boolean>(false)\n const { locale = 'us' } = useAiuiContext()\n\n const handleSwiperShow = (width?: number) => {\n const isShow = (data?.items as GraphicType[])?.length > 3\n const isMobile = (data?.items as GraphicType[])?.length > 2\n switch (width) {\n case 1440:\n return isShow ? 4 : data?.items?.length\n case 1024:\n return isShow ? 3 : data?.items?.length\n case 768:\n if ((data?.items as GraphicType[])?.length === 1) return 1 // \u2705 \u65B0\u589E\uFF1A\u53EA\u6709\u4E00\u4E2A item \u65F6\uFF0C\u5C55\u793A 1 \u4E2A\n return isShow ? 2.3 : isMobile ? 2.3 : 2\n default:\n if ((data?.items as GraphicType[])?.length === 1) return 1 // \u2705 \u65B0\u589E\uFF1A\u53EA\u6709\u4E00\u4E2A item \u65F6\uFF0C\u5C55\u793A 1 \u4E2A\n return 1.2\n }\n }\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: data?.title,\n })\n\n return (\n <div {...rest} ref={innerRef} className={cn('graphicBlock', className)}>\n <div className=\"graphic-box\">\n {data?.title && <Title data={{ title: data?.title }} />}\n <SwiperBox\n id=\"Graphic\"\n className={cn('!overflow-visible')}\n data={{\n list: data?.items || [],\n configuration: {\n itemShape: data.itemShape,\n num: data?.items?.length || 0,\n locale,\n onVideoPlayBtnClick: (_: number, data: GraphicType) => {\n setVisible(true)\n if (data?.isYouTube) {\n setYouTubeId?.(data?.youtubeId || '')\n } else {\n setVideoUrl?.(data?.video?.url || '')\n setMobileVideoUrl?.(data?.mobileVideo?.url || '')\n }\n },\n onIconClick: (data: GraphicType) => {\n setTextVisible(true)\n setCurrentItem(data)\n },\n title: data?.title,\n },\n }}\n Slide={Item}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: handleSwiperShow(),\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(768),\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(1024),\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(1440),\n },\n }}\n />\n </div>\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n onCloseModal={() => setVisible(false)}\n videoUrl={isMobile ? mobileVideoUrl || videoUrl : videoUrl}\n />\n <TextModal\n textVisible={textVisible}\n extension={currentItem?.extension}\n onCloseModal={() => {\n setTextVisible(false)\n setCurrentItem(null)\n }}\n />\n </div>\n )\n})\n\nGraphic.displayName = 'Graphic'\n\nexport default withLayout(Graphic)\n"],
5
- "mappings": "ukBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,aAAAE,IAAA,eAAAC,EAAAH,IA0Kc,IAAAI,EAAA,6BAzKdC,EAA8B,4BAC9BC,EAAwE,oBACxEC,EAA6B,qBAC7BC,EAAqC,kCACrCC,EAA2B,kCAC3BC,EAAsB,oCACtBC,EAA+C,qCAC/CC,EAAkB,gCAClBC,EAA2B,kCAC3BC,EAA0B,iCAE1BC,EAA4B,sCAC5BC,EAA4B,uCAC5BC,EAA+B,oCAE/B,MAAMC,EAAgB,QAChBC,EAAgB,UA+ChBC,EAAsBC,GAA4D,CAEtF,IAAIC,EAAO,GACX,MAAMC,EAAWC,IACXA,GAAK,MAAKF,EAAOE,EAAI,KAClBF,GAEHG,EAAeF,EAAQF,EAAG,SAAS,EACnCK,EAAaH,EAAQF,EAAG,OAAO,EAC/BM,EAAYJ,EAAQF,EAAG,MAAM,EAC7BO,EAAYL,EAAQF,EAAG,MAAM,EAE7BQ,EAAaR,EAAG,SAAS,IAC/B,MAAO,CACL,GAAGI,CAAY,QACf,GAAGC,CAAU,QACb,GAAGC,CAAS,QACZ,GAAGC,CAAS,QACZ,GAAGC,CAAU,MACf,EAAE,KAAK,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ClC2B,EAAe,EAAI,EACnBF,EAAezB,CAAI,CACrB,EACA,MAAOA,GAAM,KACf,CACF,EACA,MAAOD,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe8B,EAAiB,CAClC,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAeA,EAAiB,GAAG,CACrC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAeA,EAAiB,IAAI,CACtC,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAeA,EAAiB,IAAI,CACtC,CACF,EACF,GACF,KACA,OAAC,cACC,QAASb,EACT,UAAWI,EACX,aAAc,IAAMH,EAAW,EAAK,EACpC,SAAUH,GAAWQ,GAAkBJ,EACzC,KACA,OAAC,aACC,YAAaQ,EACb,UAAWF,GAAa,UACxB,aAAc,IAAM,CAClBG,EAAe,EAAK,EACpBF,EAAe,IAAI,CACrB,EACF,GACF,CAEJ,CAAC,EAEDf,EAAQ,YAAc,UAEtB,IAAOxC,KAAQ,cAAWwC,CAAO",
6
- "names": ["Graphic_exports", "__export", "Graphic_default", "__toCommonJS", "import_jsx_runtime", "import_react_responsive", "import_react", "import_react_dom", "import_utils", "import_Styles", "import_SwiperBox", "import_components", "import_Title", "import_VideoModal", "import_TextModal", "import_useExposure", "import_trackUrlRef", "import_AiuiProvider", "componentType", "componentName", "buildPictureSource", "bg", "last", "resolve", "img", "lgDesktopSrc", "desktopSrc", "laptopSrc", "tabletSrc", "defaultSrc", "descriptionClass", "Item", "data", "configuration", "ref", "tooltip", "setTooltip", "handleAspect", "handleMouseMove", "e", "handleMouseLeave", "prev", "Graphic", "React", "className", "rest", "isMobile", "innerRef", "visible", "setVisible", "videoUrl", "setVideoUrl", "youTubeId", "setYouTubeId", "mobileVideoUrl", "setMobileVideoUrl", "currentItem", "setCurrentItem", "textVisible", "setTextVisible", "locale", "handleSwiperShow", "width", "isShow", "Title", "SwiperBox", "_"]
4
+ "sourcesContent": ["'use client'\nimport { useMediaQuery } from 'react-responsive'\nimport React, { useEffect, useImperativeHandle, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { Button, Heading, Picture, Text } from '../../components/index.js'\nimport Title from '../Title/index.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { TextModal } from '../TextModal/index.js'\nimport type { ComponentCommonProps, Video, Img, Theme } from '../../types/props.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\n\nconst componentType = 'image'\nconst componentName = 'graphic'\n\ntype GraphicType = {\n imgUrl: Img\n title: string\n description?: string\n textColor?: string\n href?: string\n video?: Video\n mobileVideo?: Video\n youtubeId?: string\n isYouTube?: boolean\n isShowIcon?: boolean\n buttonText?: string\n icon?: Img\n theme?: Theme\n backgroundImage?: {\n default?: Img\n tablet?: Img\n laptop?: Img\n desktop?: Img\n lgDesktop?: Img\n }\n extension?: {\n text: string\n textDesc: string\n textTitle: string\n textPcImg: Img\n textMobileImg: Img\n }\n}\n\n/**\n * \u5C06 backgroundImage \u5404\u5C3A\u5BF8\u5B57\u6BB5\u62FC\u63A5\u6210 Picture source \u5B57\u7B26\u4E32\u683C\u5F0F\n *\n * Picture \u5185\u90E8\u5339\u914D\u89C4\u5219\uFF1A\u5BF9\u6BCF\u4E2A deviceSize\uFF0C\u8FC7\u6EE4 breakpoint >= deviceSize \u7684\u6761\u76EE\uFF0C\u53D6\u6700\u540E\u4E00\u4E2A (.pop())\u3002\n * \u56E0\u6B64 source \u5B57\u7B26\u4E32\u5185\u65AD\u70B9\u5FC5\u987B\u300C\u7531\u5927\u5230\u5C0F\u300D\u6392\u5217\uFF0C\u624D\u80FD\u8BA9 .pop() \u5339\u914D\u5230\u6700\u63A5\u8FD1\u81EA\u8EAB\u7684\u65AD\u70B9\u3002\n *\n * \u65AD\u70B9\u5BF9\u5E94\u5173\u7CFB (max-width):\n * lgDesktop \u2192 1919px (\u22641920px, \u5145\u5F53\u6700\u5927\u5C4F\u5C4F\u5E55\u5339\u914D\u5C42)\n * desktop \u2192 1439px (1440px - 1919px)\n * laptop \u2192 1024px (1025px - 1439px)\n * tablet \u2192 767px (768px - 1024px)\n * default \u2192 \u9996\u4F4D\u65E0\u65AD\u70B9\uFF0C\u5145\u5F53 <img src> (\u79FB\u52A8\u7AEF <768px \u5C4F\u5E55)\n *\n * \u7EE7\u627F\u89C4\u5219\uFF08\u5927 \u2192 \u5C0F\uFF09\uFF1A\u672A\u914D\u7F6E\u7684\u5C3A\u5BF8\u81EA\u52A8\u7EE7\u627F\u4E0A\u4E00\u5C3A\u5BF8\uFF0C\u6700\u7EC8 fallback \u5230 default\n */\nconst buildPictureSource = (bg: NonNullable<GraphicType['backgroundImage']>): string => {\n // \u7531\u5927\u5230\u5C0F\u7EE7\u627F\uFF1A\u672A\u914D\u7F6E\u7684\u5C3A\u5BF8\u7EE7\u627F\u4E0A\u4E00\u5C3A\u5BF8\n let last = ''\n const resolve = (img?: Img) => {\n if (img?.url) last = img.url\n return last\n }\n const lgDesktopSrc = resolve(bg.lgDesktop)\n const desktopSrc = resolve(bg.desktop)\n const laptopSrc = resolve(bg.laptop)\n const tabletSrc = resolve(bg.tablet)\n // default \u65E0\u65AD\u70B9\uFF0C\u4F5C\u4E3A\u9996\u4F4D\u5145\u5F53 <img src>(\u79FB\u52A8\u7AEF\u5C4F\u5E55)\n const defaultSrc = bg.default?.url\n return [\n `${lgDesktopSrc} 9999`, // \u22641920px\n `${desktopSrc} 1919`, // 1440-1919px\n `${laptopSrc} 1439`, // 1025-1439px\n `${tabletSrc} 1024`, // 768-1024px\n `${defaultSrc} 768`, // \u9996\u4F4D\u65E0\u65AD\u70B9 \u2192 <img src>(<768px)\n ].join(', ')\n}\nconst descriptionClass =\n 'descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]'\nexport interface GraphicProps extends ComponentCommonProps, React.HTMLAttributes<HTMLDivElement> {\n data: {\n title?: string\n items?: GraphicType[]\n itemShape?: 'round' | 'square'\n itemTheme?: Theme\n }\n}\n\nconst Item = ({ data, configuration }: { data: GraphicType; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n const { trackingData, locale = 'us' } = useAiuiContext()\n const [tooltip, setTooltip] = useState<{ visible: boolean; x: number; y: number; text: string }>({\n visible: false,\n x: 0,\n y: 0,\n text: '',\n })\n\n const handleAspect = () => {\n switch (configuration.num) {\n case 1:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 2:\n return 'tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]'\n case 3:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]'\n }\n }\n\n const handleMouseMove = (e: React.MouseEvent) => {\n if (data?.description) {\n setTooltip({\n visible: true,\n x: e.clientX,\n y: e.clientY,\n text: data.description,\n })\n }\n }\n\n const handleMouseLeave = () => {\n setTooltip(prev => ({ ...prev, visible: false }))\n }\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.title,\n componentDescription: data?.description,\n position: configuration?.index + 1,\n })\n\n return (\n <div\n ref={ref}\n className={cn(\n handleAspect(),\n 'graphicItem',\n 'laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]',\n {\n 'aiui-dark': data.theme === 'dark',\n }\n )}\n >\n <div\n className={cn('absolute inset-0', {\n ['rounded-xl overflow-hidden laptop:rounded-2xl']: configuration?.itemShape === 'round',\n })}\n >\n <div\n className={`graphic-children relative block size-full overflow-hidden ${data?.href ? 'cursor-pointer' : ''}`}\n >\n {data?.href ? (\n <a\n aria-label={data?.title ?? data?.description}\n href={trackUrlRef(\n getLocalizedPath(data?.href || '', locale),\n `${trackingData?.contextHandle || ''}_${componentType}_${componentName}`\n )}\n className=\"rounded-card block size-full overflow-hidden\"\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}`}\n >\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n source={data?.backgroundImage?.default ? buildPictureSource(data.backgroundImage) : data?.imgUrl?.url}\n alt={\n data?.backgroundImage?.lgDesktop?.alt ||\n data?.backgroundImage?.default?.alt ||\n data?.imgUrl?.alt ||\n ''\n }\n />\n </a>\n ) : (\n <div className=\"rounded-card block size-full overflow-hidden\">\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover tablet:hover:scale-110 transition-all duration-300\"\n source={\n data?.backgroundImage?.default ? buildPictureSource(data.backgroundImage) : data?.imgUrl?.url || ''\n }\n alt={\n data?.backgroundImage?.lgDesktop?.alt ||\n data?.backgroundImage?.default?.alt ||\n data?.imgUrl?.alt ||\n ''\n }\n />\n </div>\n )}\n <div className=\"laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4\">\n <div className={cn('flex items-end gap-1 overflow-hidden', 'graphic-bottom')}>\n <div className=\"flex-1 overflow-hidden\">\n <Text\n html={data?.title}\n style={{ color: data?.textColor }}\n className=\"spanTitle graphic-title lg-desktop:text-lg desktop:text-base line-clamp-3 text-sm font-bold leading-[1.2]\"\n />\n {data?.description && (\n <div onMouseMove={handleMouseMove} onMouseLeave={handleMouseLeave}>\n {data?.title ? (\n <Heading\n html={data?.description}\n style={{\n color: data?.textColor,\n }}\n as=\"h3\"\n className={`${descriptionClass} graphic-description`}\n />\n ) : (\n <h3\n style={{\n color: data?.textColor,\n }}\n dangerouslySetInnerHTML={{ __html: data?.description || '' }}\n className={`${descriptionClass} graphic-description-item`}\n />\n )}\n {typeof window !== 'undefined' &&\n tooltip.visible &&\n createPortal(\n <div\n className=\"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200\"\n style={{\n left: `${tooltip.x + 16}px`,\n top: `${tooltip.y + 16}px`,\n }}\n >\n {tooltip.text}\n </div>,\n document.body\n )}\n </div>\n )}\n </div>\n {!data?.isShowIcon && (data?.video?.url || data?.youtubeId) && (\n <button\n aria-label=\"Play Video\"\n onClick={(e: any) => {\n e.preventDefault()\n e.stopPropagation()\n configuration?.onVideoPlayBtnClick?.(configuration?.index || 0, data)\n }}\n className=\"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white/20 hover:bg-black/75\"\n >\n <svg width=\"12\" height=\"14\" viewBox=\"0 0 12 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L0 14L0 0L12 7Z\" fill=\"white\" />\n </svg>\n </button>\n )}\n {data?.isShowIcon && data?.icon?.url && (\n <button\n onClick={(e: any) => {\n e.preventDefault()\n e.stopPropagation()\n configuration?.onIconClick?.(data, configuration)\n }}\n className=\"laptop:size-9 flex size-8 items-center justify-center overflow-hidden rounded-full bg-white/20 hover:bg-black/75\"\n >\n <Picture\n className=\"h-full\"\n imgClassName=\"h-full object-cover\"\n source={data?.icon?.url}\n alt={data?.icon?.alt || ''}\n />\n </button>\n )}\n </div>\n {data.buttonText && (\n <Button\n as=\"a\"\n aria-label={data?.title ?? data?.description}\n variant=\"secondary\"\n className=\"bgButton mt-[8px] self-start\"\n href={trackUrlRef(\n getLocalizedPath(data?.href || '', configuration?.locale || 'us'),\n `${trackingData?.contextHandle || ''}_${componentType}_${componentName}`\n )}\n data-headless-nav-position={`''#${configuration?.index + 1}`}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.title}#${data?.description}#${data?.buttonText}`}\n >\n {data.buttonText}\n </Button>\n )}\n </div>\n </div>\n </div>\n </div>\n )\n}\n\nconst Graphic = React.forwardRef<HTMLDivElement, GraphicProps>(({ data, className, ...rest }, ref) => {\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const innerRef = useRef<HTMLDivElement>(null)\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n const [mobileVideoUrl, setMobileVideoUrl] = useState<string>('')\n const [currentItem, setCurrentItem] = useState<GraphicType | null>(null)\n const [textVisible, setTextVisible] = useState<boolean>(false)\n const { locale = 'us', trackingData } = useAiuiContext()\n\n const handleSwiperShow = (width?: number) => {\n const isShow = (data?.items as GraphicType[])?.length > 3\n const isMobile = (data?.items as GraphicType[])?.length > 2\n switch (width) {\n case 1440:\n return isShow ? 4 : data?.items?.length\n case 1024:\n return isShow ? 3 : data?.items?.length\n case 768:\n if ((data?.items as GraphicType[])?.length === 1) return 1 // \u2705 \u65B0\u589E\uFF1A\u53EA\u6709\u4E00\u4E2A item \u65F6\uFF0C\u5C55\u793A 1 \u4E2A\n return isShow ? 2.3 : isMobile ? 2.3 : 2\n default:\n if ((data?.items as GraphicType[])?.length === 1) return 1 // \u2705 \u65B0\u589E\uFF1A\u53EA\u6709\u4E00\u4E2A item \u65F6\uFF0C\u5C55\u793A 1 \u4E2A\n return 1.2\n }\n }\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: data?.title,\n })\n\n return (\n <div {...rest} ref={innerRef} className={cn('graphicBlock', className)}>\n <div className=\"graphic-box\">\n {data?.title && <Title data={{ title: data?.title }} />}\n <SwiperBox\n id=\"Graphic\"\n className={cn('!overflow-visible')}\n data={{\n list: data?.items || [],\n configuration: {\n itemShape: data.itemShape,\n num: data?.items?.length || 0,\n locale,\n onVideoPlayBtnClick: (_: number, data: GraphicType) => {\n setVisible(true)\n if (data?.isYouTube) {\n setYouTubeId?.(data?.youtubeId || '')\n } else {\n setVideoUrl?.(data?.video?.url || '')\n setMobileVideoUrl?.(data?.mobileVideo?.url || '')\n }\n },\n onIconClick: (data: GraphicType) => {\n setTextVisible(true)\n setCurrentItem(data)\n },\n title: data?.title,\n },\n }}\n Slide={Item}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: handleSwiperShow(),\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(768),\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(1024),\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleSwiperShow(1440),\n },\n }}\n />\n </div>\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n onCloseModal={() => setVisible(false)}\n videoUrl={isMobile ? mobileVideoUrl || videoUrl : videoUrl}\n />\n <TextModal\n textVisible={textVisible}\n extension={currentItem?.extension}\n onCloseModal={() => {\n setTextVisible(false)\n setCurrentItem(null)\n }}\n />\n </div>\n )\n})\n\nGraphic.displayName = 'Graphic'\n\nexport default withLayout(Graphic)\n"],
5
+ "mappings": "ukBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,aAAAE,IAAA,eAAAC,EAAAH,IA8Kc,IAAA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C,QAASZ,EACT,UAAWI,EACX,aAAc,IAAMH,EAAW,EAAK,EACpC,SAAUH,GAAWQ,GAAkBJ,EACzC,KACA,OAAC,aACC,YAAaQ,EACb,UAAWF,GAAa,UACxB,aAAc,IAAM,CAClBG,EAAe,EAAK,EACpBF,EAAe,IAAI,CACrB,EACF,GACF,CAEJ,CAAC,EAEDf,EAAQ,YAAc,UAEtB,IAAO1C,KAAQ,cAAW0C,CAAO",
6
+ "names": ["Graphic_exports", "__export", "Graphic_default", "__toCommonJS", "import_jsx_runtime", "import_react_responsive", "import_react", "import_react_dom", "import_utils", "import_Styles", "import_SwiperBox", "import_components", "import_Title", "import_VideoModal", "import_TextModal", "import_useExposure", "import_trackUrlRef", "import_AiuiProvider", "componentType", "componentName", "buildPictureSource", "bg", "last", "resolve", "img", "lgDesktopSrc", "desktopSrc", "laptopSrc", "tabletSrc", "defaultSrc", "descriptionClass", "Item", "data", "configuration", "ref", "trackingData", "locale", "tooltip", "setTooltip", "handleAspect", "handleMouseMove", "e", "handleMouseLeave", "prev", "Graphic", "React", "className", "rest", "isMobile", "innerRef", "visible", "setVisible", "videoUrl", "setVideoUrl", "youTubeId", "setYouTubeId", "mobileVideoUrl", "setMobileVideoUrl", "currentItem", "setCurrentItem", "textVisible", "setTextVisible", "handleSwiperShow", "width", "isShow", "Title", "SwiperBox", "_"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var D=Object.create;var B=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var Q=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var q=(a,t)=>{for(var s in t)B(a,s,{get:t[s],enumerable:!0})},z=(a,t,s,w)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of A(t))!Y.call(a,i)&&i!==s&&B(a,i,{get:()=>t[i],enumerable:!(w=H(t,i))||w.enumerable});return a};var M=(a,t,s)=>(s=a!=null?D(Q(a)):{},z(t||!a||!a.__esModule?B(s,"default",{value:a,enumerable:!0}):s,a)),Z=a=>z(B({},"__esModule",{value:!0}),a);var J={};q(J,{default:()=>F});module.exports=Z(J);var e=require("react/jsx-runtime"),l=M(require("react")),O=require("react-responsive"),S=require("../../shared/Styles.js"),P=M(require("../../components/picture.js")),V=M(require("../../components/button.js")),I=require("../../components/heading.js"),U=require("../VideoModal/index.js"),p=require("../../helpers/utils.js"),R=M(require("../SwiperBox/index.js")),L=require("../../shared/mimeType.js"),E=require("../../hooks/useExposure.js"),T=require("../../shared/trackUrlRef.js"),_=require("../AiuiProvider/index.js");const f="image",v="p1_banner",j=({data:a,configuration:t,jIndex:s})=>{const[w,i]=(0,l.useState)(!1),k=(0,O.useMediaQuery)({query:"(max-width: 768px)"}),m=(0,l.useRef)(null),g=()=>{switch(t?.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[400] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[426] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[426] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}};(0,E.useExposure)(m,{componentType:f,componentName:v,position:s,componentTitle:a.title,componentDescription:a.description,navigation:t?.activeTab}),(0,l.useEffect)(()=>{i(k)},[k]);const{theme:x="light",title:r,description:d,imageUrl:o,primaryButton:u,secondaryButton:h,imageMobileUrl:y,blockLink:b,video:c,youtubeId:n,isYouTube:$}=a,N="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return(0,e.jsxs)("div",{className:(0,p.cn)("item-wrapper text-info-primary group relative box-border w-full overflow-hidden",g(),{"rounded-2xl":t?.shape==="rounded","aiui-dark":x==="dark","h-[400px]":w},"text-info-primary"),ref:m,children:[b&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:(0,T.trackUrlRef)((0,p.getLocalizedPath)(b||"",t?.locale||"us"),`${f}_${v}`),"data-headless-type-name":`${f}#${v}`,"data-headless-title-desc-button":`${r}#${d}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,"aria-hidden":"true",tabIndex:-1}),(0,e.jsxs)("div",{className:"absolute inset-0",children:[(0,L.isVideo)(o?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:block hidden h-full overflow-hidden",children:(0,e.jsx)("source",{src:o?.url,type:"video/mp4"})}):(0,e.jsx)(P.default,{source:o?.url,alt:o?.alt||"",className:"tablet:block hidden h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 group-hover:scale-105 object-cover",style:{aspectRatio:`${o?.width}/${o?.height}`}}),(0,L.isVideo)(y?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:hidden block h-full overflow-hidden",children:(0,e.jsx)("source",{src:y?.url,type:"video/mp4"})}):(0,e.jsx)(P.default,{source:y?.url||o?.url,alt:y?.alt||o?.alt||"",className:"tablet:hidden block h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 object-cover"}),(0,e.jsxs)("div",{className:(0,p.cn)("laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 absolute inset-x-0 bottom-0 z-20 flex w-fit flex-col gap-6 p-4",{"laptop:top-1/2 laptop:-translate-y-1/2 laptop:bottom-auto":a?.width==="full"}),children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(I.Heading,{size:3,as:"h3",className:"item-title",html:r}),(0,e.jsx)(I.Heading,{as:"h4",className:"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1 text-[14px]",html:d})]}),(0,e.jsxs)("div",{className:"lg-desktop:gap-3 flex gap-2",children:[h&&h.text&&(0,e.jsxs)(V.default,{"aria-label":r??d,className:(0,p.cn)(N,"link-left"),variant:"secondary",as:"a",href:(0,T.trackUrlRef)((0,p.getLocalizedPath)(h.link||"",t?.locale||"us"),`${f}_${v}`),"data-headless-type-name":`${f}#${v}`,"data-headless-title-desc-button":`${r}#${d}#${h?.text}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,children:[h.text,(0,e.jsx)("span",{className:"sr-only",children:r??d})]}),u&&u.text&&(0,e.jsx)(V.default,{"aria-label":r??d,className:(0,p.cn)(N,"link-right"),variant:"primary",as:"a",href:(0,T.trackUrlRef)((0,p.getLocalizedPath)(u.link||"",t?.locale||"us"),`${f}_${v}`),"data-headless-type-name":`${f}#${v}`,"data-headless-title-desc-button":`${r}#${d}#${u.text}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,children:u.text})]})]})]}),(0,e.jsx)("div",{children:(0,e.jsx)("div",{className:"laptop:bottom-[32px] laptop:right-[32px] absolute bottom-[16px] right-[16px]",children:(c?.url||n)&&(0,e.jsx)("button",{onClick:()=>{t?.onVideoPlayBtnClick?.(c?.url||n,$)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:(0,e.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})})]})},G=l.default.forwardRef((a,t)=>{const{data:s,className:w,...i}=a,{shape:k,items:m=[]}=s,[g,x]=(0,l.useState)(!1),[r,d]=(0,l.useState)(""),[o,u]=(0,l.useState)(""),{locale:h="us"}=(0,_.useAiuiContext)(),y=(c,n)=>{x(!0),n?u?.(c||""):d?.(c||"")},b=c=>{const n=m?.length,$=n>3,N=n>2,C=n>1;switch(!0){case c>=1440:case c>=1024:return $?3:n;case c>=768:return $||N?2.3:C?2:1;default:return C?1.2:1}};return(0,e.jsxs)("section",{"data-ui-component-id":"GraphicOverlay",ref:t,...i,className:(0,p.cn)("graphicOverlayBlock text-info-primary ",w),children:[m&&m.length>0?(0,e.jsx)(R.default,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock3",data:{list:m||[],configuration:{shape:k,num:m.length,locale:h,onVideoPlayBtnClick:y}},Slide:j,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:b(374)},768:{spaceBetween:16,freeMode:!1,slidesPerView:b(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:b(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:b(1440)}}}):null,g&&(0,e.jsx)(U.VideoModal,{visible:g,youTubeId:o,videoUrl:r,onCloseModal:()=>x(!1)})]})});G.displayName="GraphicOverlayBlock";var F=(0,S.withLayout)(G);
1
+ "use strict";var E=Object.create;var B=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var Y=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var Z=(a,t)=>{for(var s in t)B(a,s,{get:t[s],enumerable:!0})},O=(a,t,s,v)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Q(t))!q.call(a,i)&&i!==s&&B(a,i,{get:()=>t[i],enumerable:!(v=A(t,i))||v.enumerable});return a};var M=(a,t,s)=>(s=a!=null?E(Y(a)):{},O(t||!a||!a.__esModule?B(s,"default",{value:a,enumerable:!0}):s,a)),j=a=>O(B({},"__esModule",{value:!0}),a);var K={};Z(K,{default:()=>J});module.exports=j(K);var e=require("react/jsx-runtime"),o=M(require("react")),_=require("react-responsive"),H=require("../../shared/Styles.js"),V=M(require("../../components/picture.js")),I=M(require("../../components/button.js")),L=require("../../components/heading.js"),U=require("../VideoModal/index.js"),p=require("../../helpers/utils.js"),D=M(require("../SwiperBox/index.js")),C=require("../../shared/mimeType.js"),R=require("../../hooks/useExposure.js"),T=require("../../shared/trackUrlRef.js"),z=require("../AiuiProvider/index.js");const b="image",f="p1_banner",F=({data:a,configuration:t,jIndex:s})=>{const[v,i]=(0,o.useState)(!1),g=(0,_.useMediaQuery)({query:"(max-width: 768px)"}),{trackingData:r}=(0,z.useAiuiContext)(),y=(0,o.useRef)(null),x=()=>{switch(t?.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[400] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[426] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[426] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}};(0,R.useExposure)(y,{componentType:b,componentName:f,position:s,componentTitle:a.title,componentDescription:a.description,navigation:t?.activeTab}),(0,o.useEffect)(()=>{i(g)},[g]);const{theme:P="light",title:c,description:n,imageUrl:l,primaryButton:u,secondaryButton:w,imageMobileUrl:k,blockLink:h,video:d,youtubeId:m,isYouTube:$}=a,N="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return(0,e.jsxs)("div",{className:(0,p.cn)("item-wrapper text-info-primary group relative box-border w-full overflow-hidden",x(),{"rounded-2xl":t?.shape==="rounded","aiui-dark":P==="dark","h-[400px]":v},"text-info-primary"),ref:y,children:[h&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:(0,T.trackUrlRef)((0,p.getLocalizedPath)(h||"",t?.locale||"us"),`${r?.contextHandle||""}_${b}_${f}`),"data-headless-type-name":`${b}#${f}`,"data-headless-title-desc-button":`${c}#${n}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,"aria-hidden":"true",tabIndex:-1}),(0,e.jsxs)("div",{className:"absolute inset-0",children:[(0,C.isVideo)(l?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:block hidden h-full overflow-hidden",children:(0,e.jsx)("source",{src:l?.url,type:"video/mp4"})}):(0,e.jsx)(V.default,{source:l?.url,alt:l?.alt||"",className:"tablet:block hidden h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 group-hover:scale-105 object-cover",style:{aspectRatio:`${l?.width}/${l?.height}`}}),(0,C.isVideo)(k?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:hidden block h-full overflow-hidden",children:(0,e.jsx)("source",{src:k?.url,type:"video/mp4"})}):(0,e.jsx)(V.default,{source:k?.url||l?.url,alt:k?.alt||l?.alt||"",className:"tablet:hidden block h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 object-cover"}),(0,e.jsxs)("div",{className:(0,p.cn)("laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 absolute inset-x-0 bottom-0 z-20 flex w-fit flex-col gap-6 p-4",{"laptop:top-1/2 laptop:-translate-y-1/2 laptop:bottom-auto":a?.width==="full"}),children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(L.Heading,{size:3,as:"h3",className:"item-title",html:c}),(0,e.jsx)(L.Heading,{as:"h4",className:"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1 text-[14px]",html:n})]}),(0,e.jsxs)("div",{className:"lg-desktop:gap-3 flex gap-2",children:[w&&w.text&&(0,e.jsxs)(I.default,{"aria-label":c??n,className:(0,p.cn)(N,"link-left"),variant:"secondary",as:"a",href:(0,T.trackUrlRef)((0,p.getLocalizedPath)(w.link||"",t?.locale||"us"),`${r?.contextHandle||""}_${b}_${f}`),"data-headless-type-name":`${b}#${f}`,"data-headless-title-desc-button":`${c}#${n}#${w?.text}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,children:[w.text,(0,e.jsx)("span",{className:"sr-only",children:c??n})]}),u&&u.text&&(0,e.jsx)(I.default,{"aria-label":c??n,className:(0,p.cn)(N,"link-right"),variant:"primary",as:"a",href:(0,T.trackUrlRef)((0,p.getLocalizedPath)(u.link||"",t?.locale||"us"),`${r?.contextHandle||""}_${b}_${f}`),"data-headless-type-name":`${b}#${f}`,"data-headless-title-desc-button":`${c}#${n}#${u.text}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,children:u.text})]})]})]}),(0,e.jsx)("div",{children:(0,e.jsx)("div",{className:"laptop:bottom-[32px] laptop:right-[32px] absolute bottom-[16px] right-[16px]",children:(d?.url||m)&&(0,e.jsx)("button",{onClick:()=>{t?.onVideoPlayBtnClick?.(d?.url||m,$)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:(0,e.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})})]})},S=o.default.forwardRef((a,t)=>{const{data:s,className:v,...i}=a,{shape:g,items:r=[]}=s,[y,x]=(0,o.useState)(!1),[P,c]=(0,o.useState)(""),[n,l]=(0,o.useState)(""),{locale:u="us",trackingData:w}=(0,z.useAiuiContext)(),k=(d,m)=>{x(!0),m?l?.(d||""):c?.(d||"")},h=d=>{const m=r?.length,$=m>3,N=m>2,G=m>1;switch(!0){case d>=1440:case d>=1024:return $?3:m;case d>=768:return $||N?2.3:G?2:1;default:return G?1.2:1}};return(0,e.jsxs)("section",{"data-ui-component-id":"GraphicOverlay",ref:t,...i,className:(0,p.cn)("graphicOverlayBlock text-info-primary ",v),children:[r&&r.length>0?(0,e.jsx)(D.default,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock3",data:{list:r||[],configuration:{shape:g,num:r.length,locale:u,onVideoPlayBtnClick:k}},Slide:F,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:h(374)},768:{spaceBetween:16,freeMode:!1,slidesPerView:h(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:h(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:h(1440)}}}):null,y&&(0,e.jsx)(U.VideoModal,{visible:y,youTubeId:n,videoUrl:P,onCloseModal:()=>x(!1)})]})});S.displayName="GraphicOverlayBlock";var J=(0,H.withLayout)(S);
2
2
  //# sourceMappingURL=GraphicOverlay.js.map