@anker-in/headless-ui 1.0.26-alpha.1762243303200 → 1.0.26-alpha.1762264700743

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 (262) hide show
  1. package/dist/cjs/biz-components/AiuiProvider/index.d.ts +1 -1
  2. package/dist/cjs/biz-components/AiuiProvider/index.js.map +1 -1
  3. package/dist/cjs/biz-components/AplusDesc/index.d.ts +22 -0
  4. package/dist/cjs/biz-components/AplusDesc/index.js +2 -0
  5. package/dist/cjs/biz-components/AplusDesc/index.js.map +7 -0
  6. package/dist/cjs/biz-components/CollectionShelves/CollectionShelvesItem.d.ts +4 -0
  7. package/dist/cjs/biz-components/CollectionShelves/CollectionShelvesItem.js +2 -0
  8. package/dist/cjs/biz-components/CollectionShelves/CollectionShelvesItem.js.map +7 -0
  9. package/dist/cjs/biz-components/CollectionShelves/index.d.ts +6 -0
  10. package/dist/cjs/biz-components/CollectionShelves/index.js +2 -0
  11. package/dist/cjs/biz-components/CollectionShelves/index.js.map +7 -0
  12. package/dist/cjs/biz-components/CollectionsBanner/index.d.ts +7 -0
  13. package/dist/cjs/biz-components/CollectionsBanner/index.js +2 -0
  14. package/dist/cjs/biz-components/CollectionsBanner/index.js.map +7 -0
  15. package/dist/cjs/biz-components/CollectionsBanner/types.d.ts +43 -0
  16. package/dist/cjs/biz-components/CollectionsBanner/types.js +2 -0
  17. package/dist/cjs/biz-components/CollectionsBanner/types.js.map +7 -0
  18. package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrap.d.ts +18 -0
  19. package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrap.js +2 -0
  20. package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrap.js.map +7 -0
  21. package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrapItem.d.ts +10 -0
  22. package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrapItem.js +2 -0
  23. package/dist/cjs/biz-components/CollectionsFilters/FilterCardWrapItem.js.map +7 -0
  24. package/dist/cjs/biz-components/CollectionsFilters/FilterHeader.d.ts +13 -0
  25. package/dist/cjs/biz-components/CollectionsFilters/FilterHeader.js +2 -0
  26. package/dist/cjs/biz-components/CollectionsFilters/FilterHeader.js.map +7 -0
  27. package/dist/cjs/biz-components/CollectionsFilters/FilterList.d.ts +14 -0
  28. package/dist/cjs/biz-components/CollectionsFilters/FilterList.js +2 -0
  29. package/dist/cjs/biz-components/CollectionsFilters/FilterList.js.map +7 -0
  30. package/dist/cjs/biz-components/CollectionsFilters/component/AnimatedUL.d.ts +5 -0
  31. package/dist/cjs/biz-components/CollectionsFilters/component/AnimatedUL.js +2 -0
  32. package/dist/cjs/biz-components/CollectionsFilters/component/AnimatedUL.js.map +7 -0
  33. package/dist/cjs/biz-components/CollectionsFilters/component/TabFilter.d.ts +12 -0
  34. package/dist/cjs/biz-components/CollectionsFilters/component/TabFilter.js +2 -0
  35. package/dist/cjs/biz-components/CollectionsFilters/component/TabFilter.js.map +7 -0
  36. package/dist/cjs/biz-components/CollectionsFilters/component/filtersFun.d.ts +12 -0
  37. package/dist/cjs/biz-components/CollectionsFilters/component/filtersFun.js +2 -0
  38. package/dist/cjs/biz-components/CollectionsFilters/component/filtersFun.js.map +7 -0
  39. package/dist/cjs/biz-components/CollectionsFilters/component/helper.d.ts +81 -0
  40. package/dist/cjs/biz-components/CollectionsFilters/component/helper.js +2 -0
  41. package/dist/cjs/biz-components/CollectionsFilters/component/helper.js.map +7 -0
  42. package/dist/cjs/biz-components/CollectionsFilters/component/price.d.ts +25 -0
  43. package/dist/cjs/biz-components/CollectionsFilters/component/price.js +2 -0
  44. package/dist/cjs/biz-components/CollectionsFilters/component/price.js.map +7 -0
  45. package/dist/cjs/biz-components/CollectionsFilters/component/priceProps.d.ts +215 -0
  46. package/dist/cjs/biz-components/CollectionsFilters/component/priceProps.js +2 -0
  47. package/dist/cjs/biz-components/CollectionsFilters/component/priceProps.js.map +7 -0
  48. package/dist/cjs/biz-components/CollectionsFilters/index.d.ts +23 -0
  49. package/dist/cjs/biz-components/CollectionsFilters/index.js +2 -0
  50. package/dist/cjs/biz-components/CollectionsFilters/index.js.map +7 -0
  51. package/dist/cjs/biz-components/DownLoad/index.d.ts +20 -0
  52. package/dist/cjs/biz-components/DownLoad/index.js +2 -0
  53. package/dist/cjs/biz-components/DownLoad/index.js.map +7 -0
  54. package/dist/cjs/biz-components/Faq/Faq.js +1 -1
  55. package/dist/cjs/biz-components/Faq/Faq.js.map +2 -2
  56. package/dist/cjs/biz-components/Features/index.d.ts +26 -0
  57. package/dist/cjs/biz-components/Features/index.js +2 -0
  58. package/dist/cjs/biz-components/Features/index.js.map +7 -0
  59. package/dist/cjs/biz-components/FootCharger/index.d.ts +12 -0
  60. package/dist/cjs/biz-components/FootCharger/index.js +2 -0
  61. package/dist/cjs/biz-components/FootCharger/index.js.map +7 -0
  62. package/dist/cjs/biz-components/GiftBox/index.d.ts +17 -0
  63. package/dist/cjs/biz-components/GiftBox/index.js +2 -0
  64. package/dist/cjs/biz-components/GiftBox/index.js.map +7 -0
  65. package/dist/cjs/biz-components/Graphic/index.js +1 -1
  66. package/dist/cjs/biz-components/Graphic/index.js.map +2 -2
  67. package/dist/cjs/biz-components/GraphicMore/index.d.ts +22 -0
  68. package/dist/cjs/biz-components/GraphicMore/index.js +2 -0
  69. package/dist/cjs/biz-components/GraphicMore/index.js.map +7 -0
  70. package/dist/cjs/biz-components/Listing/BizProductProvider.d.ts +19 -11
  71. package/dist/cjs/biz-components/Listing/BizProductProvider.js +1 -1
  72. package/dist/cjs/biz-components/Listing/BizProductProvider.js.map +3 -3
  73. package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js +1 -1
  74. package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js.map +2 -2
  75. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +1 -0
  76. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +8 -8
  77. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +2 -2
  78. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +1 -1
  79. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +2 -2
  80. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
  81. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +2 -2
  82. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
  83. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +2 -2
  84. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
  85. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +2 -2
  86. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +1 -1
  87. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +3 -3
  88. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  89. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +2 -2
  90. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  91. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  92. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  93. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  94. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  95. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
  96. package/dist/cjs/biz-components/Paginator/index.d.ts +7 -0
  97. package/dist/cjs/biz-components/Paginator/index.js +7 -0
  98. package/dist/cjs/biz-components/Paginator/index.js.map +7 -0
  99. package/dist/cjs/biz-components/SelectStore/index.d.ts +20 -0
  100. package/dist/cjs/biz-components/SelectStore/index.js +2 -0
  101. package/dist/cjs/biz-components/SelectStore/index.js.map +7 -0
  102. package/dist/cjs/biz-components/ShelfDisplay/index.js +1 -1
  103. package/dist/cjs/biz-components/ShelfDisplay/index.js.map +3 -3
  104. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.d.ts +11 -2
  105. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js +1 -1
  106. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js.map +3 -3
  107. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +4 -4
  108. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
  109. package/dist/cjs/biz-components/TextMarquee/index.d.ts +9 -0
  110. package/dist/cjs/biz-components/TextMarquee/index.js +2 -0
  111. package/dist/cjs/biz-components/TextMarquee/index.js.map +7 -0
  112. package/dist/cjs/biz-components/Title/index.js +1 -1
  113. package/dist/cjs/biz-components/Title/index.js.map +3 -3
  114. package/dist/cjs/biz-components/Title/types.d.ts +1 -0
  115. package/dist/cjs/biz-components/Title/types.js +1 -1
  116. package/dist/cjs/biz-components/Title/types.js.map +1 -1
  117. package/dist/cjs/biz-components/index.d.ts +16 -0
  118. package/dist/cjs/biz-components/index.js +1 -1
  119. package/dist/cjs/biz-components/index.js.map +3 -3
  120. package/dist/cjs/components/breadcrumb.d.ts +12 -0
  121. package/dist/cjs/components/breadcrumb.js +2 -0
  122. package/dist/cjs/components/breadcrumb.js.map +7 -0
  123. package/dist/cjs/components/index.d.ts +1 -0
  124. package/dist/cjs/components/index.js +1 -1
  125. package/dist/cjs/components/index.js.map +3 -3
  126. package/dist/cjs/helpers/utils.d.ts +1 -0
  127. package/dist/cjs/helpers/utils.js +1 -1
  128. package/dist/cjs/helpers/utils.js.map +3 -3
  129. package/dist/cjs/hooks/useRollout.d.ts +1 -0
  130. package/dist/cjs/hooks/useRollout.js +2 -0
  131. package/dist/cjs/hooks/useRollout.js.map +7 -0
  132. package/dist/esm/biz-components/AiuiProvider/index.d.ts +1 -1
  133. package/dist/esm/biz-components/AiuiProvider/index.js.map +1 -1
  134. package/dist/esm/biz-components/AplusDesc/index.d.ts +22 -0
  135. package/dist/esm/biz-components/AplusDesc/index.js +2 -0
  136. package/dist/esm/biz-components/AplusDesc/index.js.map +7 -0
  137. package/dist/esm/biz-components/CollectionShelves/CollectionShelvesItem.d.ts +4 -0
  138. package/dist/esm/biz-components/CollectionShelves/CollectionShelvesItem.js +2 -0
  139. package/dist/esm/biz-components/CollectionShelves/CollectionShelvesItem.js.map +7 -0
  140. package/dist/esm/biz-components/CollectionShelves/index.d.ts +6 -0
  141. package/dist/esm/biz-components/CollectionShelves/index.js +2 -0
  142. package/dist/esm/biz-components/CollectionShelves/index.js.map +7 -0
  143. package/dist/esm/biz-components/CollectionsBanner/index.d.ts +7 -0
  144. package/dist/esm/biz-components/CollectionsBanner/index.js +2 -0
  145. package/dist/esm/biz-components/CollectionsBanner/index.js.map +7 -0
  146. package/dist/esm/biz-components/CollectionsBanner/types.d.ts +43 -0
  147. package/dist/esm/biz-components/CollectionsBanner/types.js +1 -0
  148. package/dist/esm/biz-components/CollectionsBanner/types.js.map +7 -0
  149. package/dist/esm/biz-components/CollectionsFilters/FilterCardWrap.d.ts +18 -0
  150. package/dist/esm/biz-components/CollectionsFilters/FilterCardWrap.js +2 -0
  151. package/dist/esm/biz-components/CollectionsFilters/FilterCardWrap.js.map +7 -0
  152. package/dist/esm/biz-components/CollectionsFilters/FilterCardWrapItem.d.ts +10 -0
  153. package/dist/esm/biz-components/CollectionsFilters/FilterCardWrapItem.js +2 -0
  154. package/dist/esm/biz-components/CollectionsFilters/FilterCardWrapItem.js.map +7 -0
  155. package/dist/esm/biz-components/CollectionsFilters/FilterHeader.d.ts +13 -0
  156. package/dist/esm/biz-components/CollectionsFilters/FilterHeader.js +2 -0
  157. package/dist/esm/biz-components/CollectionsFilters/FilterHeader.js.map +7 -0
  158. package/dist/esm/biz-components/CollectionsFilters/FilterList.d.ts +14 -0
  159. package/dist/esm/biz-components/CollectionsFilters/FilterList.js +2 -0
  160. package/dist/esm/biz-components/CollectionsFilters/FilterList.js.map +7 -0
  161. package/dist/esm/biz-components/CollectionsFilters/component/AnimatedUL.d.ts +5 -0
  162. package/dist/esm/biz-components/CollectionsFilters/component/AnimatedUL.js +2 -0
  163. package/dist/esm/biz-components/CollectionsFilters/component/AnimatedUL.js.map +7 -0
  164. package/dist/esm/biz-components/CollectionsFilters/component/TabFilter.d.ts +12 -0
  165. package/dist/esm/biz-components/CollectionsFilters/component/TabFilter.js +2 -0
  166. package/dist/esm/biz-components/CollectionsFilters/component/TabFilter.js.map +7 -0
  167. package/dist/esm/biz-components/CollectionsFilters/component/filtersFun.d.ts +12 -0
  168. package/dist/esm/biz-components/CollectionsFilters/component/filtersFun.js +2 -0
  169. package/dist/esm/biz-components/CollectionsFilters/component/filtersFun.js.map +7 -0
  170. package/dist/esm/biz-components/CollectionsFilters/component/helper.d.ts +81 -0
  171. package/dist/esm/biz-components/CollectionsFilters/component/helper.js +2 -0
  172. package/dist/esm/biz-components/CollectionsFilters/component/helper.js.map +7 -0
  173. package/dist/esm/biz-components/CollectionsFilters/component/price.d.ts +25 -0
  174. package/dist/esm/biz-components/CollectionsFilters/component/price.js +2 -0
  175. package/dist/esm/biz-components/CollectionsFilters/component/price.js.map +7 -0
  176. package/dist/esm/biz-components/CollectionsFilters/component/priceProps.d.ts +215 -0
  177. package/dist/esm/biz-components/CollectionsFilters/component/priceProps.js +2 -0
  178. package/dist/esm/biz-components/CollectionsFilters/component/priceProps.js.map +7 -0
  179. package/dist/esm/biz-components/CollectionsFilters/index.d.ts +23 -0
  180. package/dist/esm/biz-components/CollectionsFilters/index.js +2 -0
  181. package/dist/esm/biz-components/CollectionsFilters/index.js.map +7 -0
  182. package/dist/esm/biz-components/DownLoad/index.d.ts +20 -0
  183. package/dist/esm/biz-components/DownLoad/index.js +2 -0
  184. package/dist/esm/biz-components/DownLoad/index.js.map +7 -0
  185. package/dist/esm/biz-components/Faq/Faq.js +1 -1
  186. package/dist/esm/biz-components/Faq/Faq.js.map +3 -3
  187. package/dist/esm/biz-components/Features/index.d.ts +26 -0
  188. package/dist/esm/biz-components/Features/index.js +2 -0
  189. package/dist/esm/biz-components/Features/index.js.map +7 -0
  190. package/dist/esm/biz-components/FootCharger/index.d.ts +12 -0
  191. package/dist/esm/biz-components/FootCharger/index.js +2 -0
  192. package/dist/esm/biz-components/FootCharger/index.js.map +7 -0
  193. package/dist/esm/biz-components/GiftBox/index.d.ts +17 -0
  194. package/dist/esm/biz-components/GiftBox/index.js +2 -0
  195. package/dist/esm/biz-components/GiftBox/index.js.map +7 -0
  196. package/dist/esm/biz-components/Graphic/index.js +1 -1
  197. package/dist/esm/biz-components/Graphic/index.js.map +2 -2
  198. package/dist/esm/biz-components/GraphicMore/index.d.ts +22 -0
  199. package/dist/esm/biz-components/GraphicMore/index.js +2 -0
  200. package/dist/esm/biz-components/GraphicMore/index.js.map +7 -0
  201. package/dist/esm/biz-components/Listing/BizProductProvider.d.ts +19 -11
  202. package/dist/esm/biz-components/Listing/BizProductProvider.js +1 -1
  203. package/dist/esm/biz-components/Listing/BizProductProvider.js.map +3 -3
  204. package/dist/esm/biz-components/Listing/components/PaidShipping/index.js +1 -1
  205. package/dist/esm/biz-components/Listing/components/PaidShipping/index.js.map +2 -2
  206. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +1 -0
  207. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +8 -8
  208. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +2 -2
  209. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +1 -1
  210. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +2 -2
  211. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
  212. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +2 -2
  213. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
  214. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +2 -2
  215. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
  216. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +2 -2
  217. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +1 -1
  218. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +3 -3
  219. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  220. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +2 -2
  221. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  222. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  223. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  224. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  225. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  226. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
  227. package/dist/esm/biz-components/Paginator/index.d.ts +7 -0
  228. package/dist/esm/biz-components/Paginator/index.js +7 -0
  229. package/dist/esm/biz-components/Paginator/index.js.map +7 -0
  230. package/dist/esm/biz-components/SelectStore/index.d.ts +20 -0
  231. package/dist/esm/biz-components/SelectStore/index.js +2 -0
  232. package/dist/esm/biz-components/SelectStore/index.js.map +7 -0
  233. package/dist/esm/biz-components/ShelfDisplay/index.js +1 -1
  234. package/dist/esm/biz-components/ShelfDisplay/index.js.map +3 -3
  235. package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.d.ts +11 -2
  236. package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js +1 -1
  237. package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js.map +3 -3
  238. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +9 -9
  239. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
  240. package/dist/esm/biz-components/TextMarquee/index.d.ts +9 -0
  241. package/dist/esm/biz-components/TextMarquee/index.js +2 -0
  242. package/dist/esm/biz-components/TextMarquee/index.js.map +7 -0
  243. package/dist/esm/biz-components/Title/index.js +1 -1
  244. package/dist/esm/biz-components/Title/index.js.map +3 -3
  245. package/dist/esm/biz-components/Title/types.d.ts +1 -0
  246. package/dist/esm/biz-components/index.d.ts +16 -0
  247. package/dist/esm/biz-components/index.js +1 -1
  248. package/dist/esm/biz-components/index.js.map +2 -2
  249. package/dist/esm/components/breadcrumb.d.ts +12 -0
  250. package/dist/esm/components/breadcrumb.js +2 -0
  251. package/dist/esm/components/breadcrumb.js.map +7 -0
  252. package/dist/esm/components/index.d.ts +1 -0
  253. package/dist/esm/components/index.js +1 -1
  254. package/dist/esm/components/index.js.map +2 -2
  255. package/dist/esm/helpers/utils.d.ts +1 -0
  256. package/dist/esm/helpers/utils.js +1 -1
  257. package/dist/esm/helpers/utils.js.map +3 -3
  258. package/dist/esm/hooks/useRollout.d.ts +1 -0
  259. package/dist/esm/hooks/useRollout.js +2 -0
  260. package/dist/esm/hooks/useRollout.js.map +7 -0
  261. package/package.json +1 -1
  262. package/style.css +23 -0
@@ -1,2 +1,2 @@
1
- import{jsx as t,jsxs as c}from"react/jsx-runtime";import{Text as m,Picture as b,Button as k,Dialog as w,DialogContent as y,DialogTrigger as N}from"../../../../../../components";import{Content as x,List as C,Root as D,Trigger as E}from"@radix-ui/react-tabs";import{useEffect as T,useMemo as g,useRef as v,useState as f}from"react";import{cn as H}from"../../../../../../helpers";import{useBizProductContext as L}from"../../../../BizProductProvider.js";const P=()=>{const{product:s,variant:a,isMobile:r}=L(),[p,d]=f(!1),n=g(()=>{const l=a.metafields?.component?.ksp||s.metafields?.component?.ksp;return(r?l?.mobileList:l?.list)?.filter(h=>!!h?.text)},[a.metafields?.component?.ksp,r]),[e,i]=f(n?.[0]),o=g(()=>s?.payload?.components?.find(l=>l.componentKey==="ProductHighlight")?.data||{},[s?.payload]);return n?.length?c("div",{className:"ipc-product-detail-highlight",children:[c("div",{className:"flex items-center justify-between",children:[o?.title&&t(m,{size:3,className:"font-bold",html:o?.title}),c(w,{open:p,onOpenChange:d,children:[t(N,{asChild:!0,children:t(k,{variant:"link",className:"font-bold !p-0 text-base",children:o?.view})}),t(R,{ksp:n,clickActiveKspItem:e})]})]}),t("div",{className:"flex flex-wrap gap-4 mt-3 desktop:mt-4",children:n.map(l=>t("div",{className:"px-4 py-2 cursor-pointer hover:bg-[#EAEAEC] lg-desktop:max-w-[256px] desktop:max-w-[208px] laptop:max-w-[310px] rounded-full bg-[#F5F5F7]",children:t(m,{size:3,onClick:()=>{i(l),d(!0)},className:"font-bold text-[#1D1D1F] text-[14px] lg-desktop:text-[16px] break-all line-clamp-1 desktop:text-base overflow-hidden",html:l?.text},l?.text)}))})]}):null},R=({ksp:s,clickActiveKspItem:a})=>{const r=v([]),p=v(null),[d,n]=f(null);return T(()=>{a&&(n(a),setTimeout(()=>{const e=s.findIndex(o=>o.text===a?.text),i=r.current[e];if(i&&p.current){const o=p.current,l=i,u=l.offsetLeft-o.offsetWidth/2+l.offsetWidth/2;o.scrollTo({left:u,behavior:"smooth"})}},100))},[a,s]),t(y,{overlayClassName:"z-[70]",className:"tablet:max-w-[896px] max-w-[326px] mx-auto w-full border-none z-[80] overflow-hidden p-0",children:c(D,{defaultValue:d?.text,className:"w-full overflow-hidden",children:[s.map(e=>t(x,{value:e.text,children:t(b,{source:e.img,className:"w-full h-[304px] desktop:h-[480px]",alt:e.img.alt,imgClassName:"object-cover h-full"})},e.text)),t("div",{className:"py-4 desktop:py-6 w-full overflow-visible",children:c("div",{ref:p,className:"px-4 desktop:px-6 overflow-x-auto",children:[t("div",{className:"w-fit rounded-full bg-[#EAEAEC]",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t(C,{className:"flex p-1 w-max",children:s.map((e,i)=>t(E,{ref:o=>{o&&(r.current[i]=o)},className:H("lg-desktop:px-7 shrink-0 lg-desktop:pb-[14px] rounded-full lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px]",e.text===d?.text&&"bg-white"),onClick:()=>{n(e)},value:e.text,children:t(m,{html:e.text,className:"font-bold text-[14px] leading-tight"})},i))})}),t("div",{className:"mt-4",children:s.map(e=>t(x,{value:e.label,className:"font-bold text-base desktop:text-[18px]",children:e.description}))})]})})]})})};var K=P;export{K as default};
1
+ import{jsx as e,jsxs as m}from"react/jsx-runtime";import{Text as u,Picture as k,Button as y,Dialog as w,DialogContent as N,DialogTrigger as C}from"../../../../../../components";import{Content as g,List as D,Root as T,Trigger as E}from"@radix-ui/react-tabs";import{useCallback as H,useEffect as L,useMemo as v,useRef as h,useState as x}from"react";import{cn as P}from"../../../../../../helpers";import{useBizProductContext as A}from"../../../../BizProductProvider.js";const I=()=>{const{product:l,variant:a,isMobile:r}=A(),[p,i]=x(!1),n=v(()=>{const o=a.metafields?.component?.ksp||l.metafields?.component?.ksp;return(r?o?.mobileList:o?.list)?.filter(f=>!!f?.text)},[a.metafields?.component?.ksp,r]),[c,t]=x(n?.[0]),s=v(()=>l?.payload?.components?.find(o=>o.componentKey==="ProductHighlight")?.data||{},[l?.payload]);return n?.length?m("div",{className:"ipc-product-detail-highlight",children:[m("div",{className:"flex items-center justify-between",children:[s?.title&&e(u,{size:3,className:"font-bold",html:s?.title}),m(w,{open:p,onOpenChange:i,children:[e(C,{asChild:!0,children:e(y,{variant:"link",className:"font-bold !p-0 text-base",children:s?.view})}),e(R,{ksp:n,clickActiveKspItem:c})]})]}),e("div",{className:"flex flex-wrap gap-4 mt-3 desktop:mt-4",children:n.map(o=>e("div",{className:"px-4 py-2 cursor-pointer hover:bg-[#EAEAEC] lg-desktop:max-w-[256px] desktop:max-w-[208px] laptop:max-w-[310px] rounded-full bg-[#F5F5F7]",children:e(u,{size:3,onClick:()=>{t(o),i(!0)},className:"font-bold text-[#1D1D1F] text-[14px] lg-desktop:text-[16px] break-all line-clamp-1 desktop:text-base overflow-hidden",html:o?.text},o?.text)}))})]}):null},R=({ksp:l,clickActiveKspItem:a})=>{const r=h([]),p=h(null),[i,n]=x(null),c=H(t=>{const s=l.findIndex(d=>d.text===t?.text),o=r.current[s];if(o&&p.current){const d=p.current,f=o,b=f.offsetLeft-d.offsetWidth/2+f.offsetWidth/2;d.scrollTo({left:b,behavior:"smooth"})}},[a,l]);return L(()=>{a&&(n(a),setTimeout(()=>{c(i)},100))},[a,c]),e(N,{overlayClassName:"z-[70]",className:"tablet:max-w-[896px] max-w-[326px] mx-auto w-full border-none z-[80] overflow-hidden p-0",children:m(T,{defaultValue:i?.text,className:"w-full overflow-hidden",children:[l.map(t=>e(g,{value:t.text,children:e(k,{source:t.img,className:"w-full h-[304px] desktop:h-[480px]",alt:t.img.alt,imgClassName:"object-cover h-full"})},t.text)),e("div",{className:"py-4 desktop:py-6 w-full overflow-visible",children:m("div",{ref:p,className:"px-4 desktop:px-6 overflow-x-auto",children:[e("div",{className:"w-fit rounded-full bg-[#EAEAEC]",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e(D,{className:"flex p-1 w-max",children:l.map((t,s)=>e(E,{ref:o=>{o&&(r.current[s]=o)},className:P("lg-desktop:px-7 shrink-0 lg-desktop:pb-[14px] rounded-full lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px]",t.text===i?.text&&"bg-white"),onClick:()=>{c(t),n(t)},value:t.text,children:e(u,{html:t.text,className:"font-bold text-[14px] leading-tight"})},s))})}),e("div",{className:"mt-4",children:l.map(t=>e(g,{value:t.label,className:"font-bold text-base desktop:text-[18px]",children:t.description}))})]})})]})})};var S=I;export{S as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.tsx"],
4
- "sourcesContent": ["import type { HighlightProps } from '../types'\nimport { Text, Picture, Button, Heading, Dialog, DialogContent, DialogTrigger } from '../../../../../../components'\nimport { Content, List, Root, Trigger } from '@radix-ui/react-tabs'\nimport { useEffect, useMemo, useRef, useState } from 'react'\nimport { cn } from '../../../../../../helpers'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\n\nconst ProductHighlight = () => {\n const { product, variant, isMobile } = useBizProductContext()\n const [open, setOpen] = useState(false)\n\n const ksp = useMemo(() => {\n const ksp_value = variant.metafields?.component?.ksp || product.metafields?.component?.ksp\n const result = isMobile ? ksp_value?.mobileList : ksp_value?.list\n return result?.filter((item: any) => !!item?.text)\n }, [variant.metafields?.component?.ksp, isMobile])\n\n const [activeKspItem, setActiveKspItem] = useState(ksp?.[0])\n\n const ProductHighlightData = useMemo(() => {\n return product?.payload?.components?.find((item: any) => item.componentKey === 'ProductHighlight')?.data || {}\n }, [product?.payload])\n\n if (!ksp?.length) return null\n\n return (\n <div className=\"ipc-product-detail-highlight\">\n <div className=\"flex items-center justify-between\">\n {ProductHighlightData?.title && <Text size={3} className=\"font-bold\" html={ProductHighlightData?.title} />}\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogTrigger asChild>\n <Button variant=\"link\" className=\"font-bold !p-0 text-base\">\n {ProductHighlightData?.view}\n </Button>\n </DialogTrigger>\n <ProductHighlightModal ksp={ksp} clickActiveKspItem={activeKspItem} />\n </Dialog>\n </div>\n <div className=\"flex flex-wrap gap-4 mt-3 desktop:mt-4\">\n {ksp.map((item: any) => (\n <div className=\"px-4 py-2 cursor-pointer hover:bg-[#EAEAEC] lg-desktop:max-w-[256px] desktop:max-w-[208px] laptop:max-w-[310px] rounded-full bg-[#F5F5F7]\">\n <Text\n size={3}\n key={item?.text}\n onClick={() => {\n setActiveKspItem(item)\n setOpen(true)\n }}\n className=\"font-bold text-[#1D1D1F] text-[14px] lg-desktop:text-[16px] break-all line-clamp-1 desktop:text-base overflow-hidden\"\n html={item?.text}\n />\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nconst ProductHighlightModal = ({ ksp, clickActiveKspItem }: { ksp: any[]; clickActiveKspItem: any }) => {\n const highlightRef = useRef<HTMLButtonElement[]>([])\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n const [activeKspItem, setActiveKspItem] = useState<any>(null)\n\n useEffect(() => {\n if (!clickActiveKspItem) return\n setActiveKspItem(clickActiveKspItem)\n\n // \u5EF6\u8FDF\u6267\u884C\uFF0C\u7B49\u5F85 Dialog \u548C\u5185\u90E8\u5143\u7D20\u5B8C\u5168\u6E32\u67D3\n setTimeout(() => {\n const curIndex = ksp.findIndex(item => item.text === clickActiveKspItem?.text)\n const curRef = highlightRef.current[curIndex]\n\n if (curRef && scrollContainerRef.current) {\n const container = scrollContainerRef.current\n const button = curRef\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }, 100)\n }, [clickActiveKspItem, ksp])\n\n return (\n <DialogContent\n overlayClassName=\"z-[70]\"\n className=\"tablet:max-w-[896px] max-w-[326px] mx-auto w-full border-none z-[80] overflow-hidden p-0\"\n >\n <Root defaultValue={activeKspItem?.text} className=\"w-full overflow-hidden\">\n {ksp.map(item => (\n <Content value={item.text} key={item.text}>\n <Picture\n source={item.img}\n className=\"w-full h-[304px] desktop:h-[480px]\"\n alt={item.img.alt}\n imgClassName=\"object-cover h-full\"\n />\n </Content>\n ))}\n <div className=\"py-4 desktop:py-6 w-full overflow-visible\">\n <div ref={scrollContainerRef} className=\"px-4 desktop:px-6 overflow-x-auto\">\n <div\n className=\"w-fit rounded-full bg-[#EAEAEC]\"\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n >\n <List className=\"flex p-1 w-max\">\n {ksp.map((item, index) => (\n <Trigger\n ref={el => {\n if (el) {\n highlightRef.current[index] = el\n }\n }}\n className={cn(\n 'lg-desktop:px-7 shrink-0 lg-desktop:pb-[14px] rounded-full lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px]',\n item.text === activeKspItem?.text && 'bg-white'\n )}\n onClick={() => {\n setActiveKspItem(item)\n }}\n key={index}\n value={item.text}\n >\n <Text html={item.text} className=\"font-bold text-[14px] leading-tight\" />\n </Trigger>\n ))}\n </List>\n </div>\n <div className=\"mt-4\">\n {ksp.map(item => (\n <Content value={item.label} className=\"font-bold text-base desktop:text-[18px]\">\n {item.description}\n </Content>\n ))}\n </div>\n </div>\n </div>\n </Root>\n </DialogContent>\n )\n}\n\nexport default ProductHighlight\n"],
5
- "mappings": "AA4BwC,cAAAA,EAChC,QAAAC,MADgC,oBA3BxC,OAAS,QAAAC,EAAM,WAAAC,EAAS,UAAAC,EAAiB,UAAAC,EAAQ,iBAAAC,EAAe,iBAAAC,MAAqB,+BACrF,OAAS,WAAAC,EAAS,QAAAC,EAAM,QAAAC,EAAM,WAAAC,MAAe,uBAC7C,OAAS,aAAAC,EAAW,WAAAC,EAAS,UAAAC,EAAQ,YAAAC,MAAgB,QACrD,OAAS,MAAAC,MAAU,4BACnB,OAAS,wBAAAC,MAA4B,oCAErC,MAAMC,EAAmB,IAAM,CAC7B,KAAM,CAAE,QAAAC,EAAS,QAAAC,EAAS,SAAAC,CAAS,EAAIJ,EAAqB,EACtD,CAACK,EAAMC,CAAO,EAAIR,EAAS,EAAK,EAEhCS,EAAMX,EAAQ,IAAM,CACx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U,sCAAsC,GAHlEa,CAIP,CACD,EACH,EACF,EACAvC,EAAC,OAAI,UAAU,OACZ,SAAAwB,EAAI,IAAIE,GACP1B,EAACQ,EAAA,CAAQ,MAAOkB,EAAK,MAAO,UAAU,0CACnC,SAAAA,EAAK,YACR,CACD,EACH,GACF,EACF,GACF,EACF,CAEJ,EAEA,IAAOe,EAAQvB",
6
- "names": ["jsx", "jsxs", "Text", "Picture", "Button", "Dialog", "DialogContent", "DialogTrigger", "Content", "List", "Root", "Trigger", "useEffect", "useMemo", "useRef", "useState", "cn", "useBizProductContext", "ProductHighlight", "product", "variant", "isMobile", "open", "setOpen", "ksp", "ksp_value", "item", "activeKspItem", "setActiveKspItem", "ProductHighlightData", "ProductHighlightModal", "clickActiveKspItem", "highlightRef", "scrollContainerRef", "curIndex", "curRef", "container", "button", "scrollLeft", "index", "el", "ProductHighlight_default"]
4
+ "sourcesContent": ["import type { HighlightProps } from '../types'\nimport { Text, Picture, Button, Heading, Dialog, DialogContent, DialogTrigger } from '../../../../../../components'\nimport { Content, List, Root, Trigger } from '@radix-ui/react-tabs'\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { cn } from '../../../../../../helpers'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\n\nconst ProductHighlight = () => {\n const { product, variant, isMobile } = useBizProductContext()\n const [open, setOpen] = useState(false)\n\n const ksp = useMemo(() => {\n const ksp_value = variant.metafields?.component?.ksp || product.metafields?.component?.ksp\n const result = isMobile ? ksp_value?.mobileList : ksp_value?.list\n return result?.filter((item: any) => !!item?.text)\n }, [variant.metafields?.component?.ksp, isMobile])\n\n const [activeKspItem, setActiveKspItem] = useState(ksp?.[0])\n\n const ProductHighlightData = useMemo(() => {\n return product?.payload?.components?.find((item: any) => item.componentKey === 'ProductHighlight')?.data || {}\n }, [product?.payload])\n\n if (!ksp?.length) return null\n\n return (\n <div className=\"ipc-product-detail-highlight\">\n <div className=\"flex items-center justify-between\">\n {ProductHighlightData?.title && <Text size={3} className=\"font-bold\" html={ProductHighlightData?.title} />}\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogTrigger asChild>\n <Button variant=\"link\" className=\"font-bold !p-0 text-base\">\n {ProductHighlightData?.view}\n </Button>\n </DialogTrigger>\n <ProductHighlightModal ksp={ksp} clickActiveKspItem={activeKspItem} />\n </Dialog>\n </div>\n <div className=\"flex flex-wrap gap-4 mt-3 desktop:mt-4\">\n {ksp.map((item: any) => (\n <div className=\"px-4 py-2 cursor-pointer hover:bg-[#EAEAEC] lg-desktop:max-w-[256px] desktop:max-w-[208px] laptop:max-w-[310px] rounded-full bg-[#F5F5F7]\">\n <Text\n size={3}\n key={item?.text}\n onClick={() => {\n setActiveKspItem(item)\n setOpen(true)\n }}\n className=\"font-bold text-[#1D1D1F] text-[14px] lg-desktop:text-[16px] break-all line-clamp-1 desktop:text-base overflow-hidden\"\n html={item?.text}\n />\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nconst ProductHighlightModal = ({ ksp, clickActiveKspItem }: { ksp: any[]; clickActiveKspItem: any }) => {\n const highlightRef = useRef<HTMLButtonElement[]>([])\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n const [activeKspItem, setActiveKspItem] = useState<any>(null)\n\n const autoScrollToActiveItem = useCallback((activeKspItem: any) => {\n const curIndex = ksp.findIndex(item => item.text === activeKspItem?.text)\n const curRef = highlightRef.current[curIndex]\n\n if (curRef && scrollContainerRef.current) {\n const container = scrollContainerRef.current\n const button = curRef\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }, [clickActiveKspItem, ksp])\n\n useEffect(() => {\n if (!clickActiveKspItem) return\n setActiveKspItem(clickActiveKspItem)\n\n // \u5EF6\u8FDF\u6267\u884C\uFF0C\u7B49\u5F85 Dialog \u548C\u5185\u90E8\u5143\u7D20\u5B8C\u5168\u6E32\u67D3\n setTimeout(() => {\n autoScrollToActiveItem(activeKspItem)\n }, 100)\n }, [clickActiveKspItem, autoScrollToActiveItem])\n\n return (\n <DialogContent\n overlayClassName=\"z-[70]\"\n className=\"tablet:max-w-[896px] max-w-[326px] mx-auto w-full border-none z-[80] overflow-hidden p-0\"\n >\n <Root defaultValue={activeKspItem?.text} className=\"w-full overflow-hidden\">\n {ksp.map(item => (\n <Content value={item.text} key={item.text}>\n <Picture\n source={item.img}\n className=\"w-full h-[304px] desktop:h-[480px]\"\n alt={item.img.alt}\n imgClassName=\"object-cover h-full\"\n />\n </Content>\n ))}\n <div className=\"py-4 desktop:py-6 w-full overflow-visible\">\n <div ref={scrollContainerRef} className=\"px-4 desktop:px-6 overflow-x-auto\">\n <div\n className=\"w-fit rounded-full bg-[#EAEAEC]\"\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n >\n <List className=\"flex p-1 w-max\">\n {ksp.map((item, index) => (\n <Trigger\n ref={el => {\n if (el) {\n highlightRef.current[index] = el\n }\n }}\n className={cn(\n 'lg-desktop:px-7 shrink-0 lg-desktop:pb-[14px] rounded-full lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px]',\n item.text === activeKspItem?.text && 'bg-white'\n )}\n onClick={() => {\n autoScrollToActiveItem(item)\n setActiveKspItem(item)\n }}\n key={index}\n value={item.text}\n >\n <Text html={item.text} className=\"font-bold text-[14px] leading-tight\" />\n </Trigger>\n ))}\n </List>\n </div>\n <div className=\"mt-4\">\n {ksp.map(item => (\n <Content value={item.label} className=\"font-bold text-base desktop:text-[18px]\">\n {item.description}\n </Content>\n ))}\n </div>\n </div>\n </div>\n </Root>\n </DialogContent>\n )\n}\n\nexport default ProductHighlight\n"],
5
+ "mappings": "AA4BwC,cAAAA,EAChC,QAAAC,MADgC,oBA3BxC,OAAS,QAAAC,EAAM,WAAAC,EAAS,UAAAC,EAAiB,UAAAC,EAAQ,iBAAAC,EAAe,iBAAAC,MAAqB,+BACrF,OAAS,WAAAC,EAAS,Q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AAAC,EAAC,OAAI,IAAKiC,EAAoB,UAAU,oCACtC,UAAAlC,EAAC,OACC,UAAU,kCACV,MAAO,CACL,eAAgB,OAChB,gBAAiB,MACnB,EAEA,SAAAA,EAACS,EAAA,CAAK,UAAU,iBACb,SAAAgB,EAAI,IAAI,CAACE,EAAMc,IACdzC,EAACW,EAAA,CACC,IAAK+B,GAAM,CACLA,IACFT,EAAa,QAAQQ,CAAK,EAAIC,EAElC,EACA,UAAWzB,EACT,mIACAU,EAAK,OAASC,GAAe,MAAQ,UACvC,EACA,QAAS,IAAM,CACbO,EAAuBR,CAAI,EAC3BE,EAAiBF,CAAI,CACvB,EAEA,MAAOA,EAAK,KAEZ,SAAA3B,EAACE,EAAA,CAAK,KAAMyB,EAAK,KAAM,UAAU,sCAAsC,GAHlEc,CAIP,CACD,EACH,EACF,EACAzC,EAAC,OAAI,UAAU,OACZ,SAAAyB,EAAI,IAAIE,GACP3B,EAACQ,EAAA,CAAQ,MAAOmB,EAAK,MAAO,UAAU,0CACnC,SAAAA,EAAK,YACR,CACD,EACH,GACF,EACF,GACF,EACF,CAEJ,EAEA,IAAOgB,EAAQxB",
6
+ "names": ["jsx", "jsxs", "Text", "Picture", "Button", "Dialog", "DialogContent", "DialogTrigger", "Content", "List", "Root", "Trigger", "useCallback", "useEffect", "useMemo", "useRef", "useState", "cn", "useBizProductContext", "ProductHighlight", "product", "variant", "isMobile", "open", "setOpen", "ksp", "ksp_value", "item", "activeKspItem", "setActiveKspItem", "ProductHighlightData", "ProductHighlightModal", "clickActiveKspItem", "highlightRef", "scrollContainerRef", "autoScrollToActiveItem", "curIndex", "curRef", "container", "button", "scrollLeft", "index", "el", "ProductHighlight_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{Fragment as ee,jsx as e,jsxs as c}from"react/jsx-runtime";import{useAiuiContext as z}from"../../../../AiuiProvider/index.js";import{Text as $,Picture as T,Badge as F}from"../../../../../components";import{useMemo as k,useState as y,forwardRef as j,useRef as L}from"react";import{Swiper as G,SwiperSlide as N}from"swiper/react";import{Navigation as E,Mousewheel as V,Thumbs as C,Pagination as R}from"swiper/modules";import{cn as m}from"../../../../../helpers/index.js";import{GalleryTabType as b}from"./types.js";import{Content as Y,List as W,Root as O,Trigger as H}from"@radix-ui/react-tabs";import{useBizProductContext as M}from"../../../BizProductProvider.js";import{useVariantMedia as U}from"../../../hooks/use-variant-media.js";import{SpecsModal as Z}from"./components/SpecsModal.js";import K from"./components/CompareModal.js";import{formatPrice as q}from"../../../utils/index.js";const _=t=>c("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[e("rect",{x:"48",y:"48",width:"48",height:"48",rx:"24",transform:"rotate(-180 48 48)",fill:"white"}),e("path",{d:"M25.1035 16.8545C25.5372 16.3818 26.246 16.3818 26.6797 16.8545C27.1067 17.3201 27.1067 18.0706 26.6797 18.5361L21.668 24L26.6797 29.4639C27.1067 29.9294 27.1067 30.6799 26.6797 31.1455C26.246 31.6182 25.5372 31.6182 25.1035 31.1455L19.3203 24.8408C18.8933 24.3752 18.8933 23.6248 19.3203 23.1592L25.1035 16.8545Z",fill:"currentColor"})]}),B=t=>c("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[e("rect",{width:"48",height:"48",rx:"24",transform:"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)",fill:"white"}),e("path",{d:"M22.8965 16.8545C22.4628 16.3818 21.754 16.3818 21.3203 16.8545C20.8933 17.3201 20.8933 18.0706 21.3203 18.5361L26.332 24L21.3203 29.4639C20.8933 29.9294 20.8933 30.6799 21.3203 31.1455C21.754 31.6182 22.4628 31.6182 22.8965 31.1455L28.6797 24.8408C29.1067 24.3752 29.1067 23.6248 28.6797 23.1592L22.8965 16.8545Z",fill:"currentColor"})]}),J=()=>{const{copyWriting:t}=z(),{product:r,variant:p,selectedOptions:x}=M(),o=U({product:r,variant:p}),[d,w]=y(null),i=p?.metafields?.component?.custom_media_list;let s,u,v,f;i&&i?.available?(s=i?.product||[],u=i?.scenarios||[],v=i?.keyFeatures||[],f=i?.video||[]):(s=o?.productList,u=o?.sceneList,v=o?.keyFeaturesList,f=o?.videoList);const A=k(()=>[...s,...u,...f],[s,u,f]),S={productList:s,sceneList:u,keyFeaturesList:v,videoList:f},g=k(()=>(r?.payload?.components?.find(a=>a.componentKey==="ProductGallery")?.data||[])?.map(a=>({...a,galleries:S[a?.galleries]||[]})).filter(a=>a.galleries.length>0),[r?.payload,S]),I=L({}),[l,h]=y(g?.[0]),D=(n,a)=>{switch(n?.galleryTabType){case b.GALLERY_IMAGE_MAIN:return e(P,{...n,index:a});case b.GALLERY_IMAGE_FEATURES:return e(P,{...n,index:a});case b.GALLERY_IMAGE_SCENE:return e(P,{...n,index:a});case b.GALLERY_VIDEO:return e(X,{...n});default:return null}};return e("div",{id:"ipc-product-gallery",children:c(O,{className:"relative",defaultValue:g?.[0]?.tabValue,children:[e("div",{className:"h-[420px] overflow-hidden tablet:h-[620px] desktop:rounded-2xl desktop:h-[560px] lg-desktop:h-[700px] bg-[#EAEAEC] desktop:relative ",children:g.map((n,a)=>e(Y,{className:"h-full",value:n.tabValue,children:D(n,a)},n.tabValue))}),e(Q,{galleryTabs:g,activeGalleryTab:l,setActiveGalleryTab:h})]})})},Q=({galleryTabs:t,activeGalleryTab:r,setActiveGalleryTab:p})=>{const{product:x}=M(),o=L(null);return c("div",{className:"absolute z-[2] bottom-4 left-4 right-4 laptop:left-16 laptop:right-16 flex justify-between items-center tablet:mt-3 desktop:static",children:[e(W,{ref:o,className:"rounded-full bg-[#EAEAEC] p-1 laptop:p-0 desktop:p-1 overflow-x-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e("div",{className:"whitespace-nowrap",children:t?.map(d=>e(H,{className:m("lg-desktop:px-7 lg-desktop:pb-[14px] rounded-full font-bold lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px] text-[14px] leading-tight",d.tabValue===r?.tabValue&&"bg-white"),onClick:w=>{if(p(d),o.current){const i=o.current,s=w.currentTarget,u=s.offsetLeft-i.offsetWidth/2+s.offsetWidth/2;i.scrollTo({left:u,behavior:"smooth"})}},value:d.tabValue,children:d.tabLabel},d.tabValue))})}),e("div",{className:"laptop:gap-2 hidden laptop:flex",children:x.metafields?.global?.specifications&&c(ee,{children:[e(Z,{})," | ",e(K,{})]})})]})},P=j((t,r)=>{const{locale:p="us",copyWriting:x}=z(),{variant:o,totalSavings:d}=M(),w=L(null),[i,s]=y(null),[u,v]=y(!0),[f,A]=y(!1),[S,g]=y(null),I=k(()=>{if(t?.galleryTabType===b.GALLERY_IMAGE_MAIN)return"size-[240px] mx-auto mt-[42px] tablet:mt-16 tablet:size-[420px] lg-desktop:size-[560px]";t?.galleryTabType===b.GALLERY_IMAGE_FEATURES||(t?.galleryTabType,b.GALLERY_IMAGE_SCENE)},[t?.galleryTabType]);return c("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[e(G,{ref:r,className:"h-full",navigation:{nextEl:`.ipc-product-gallery-${t?.id}-custom-swiper-button-next`,prevEl:`.ipc-product-gallery-${t?.id}-custom-swiper-button-prev`},onSwiper:g,onProgress:l=>{v(l.isBeginning),A(l.isEnd)},pagination:{clickable:!0,el:w.current},onSlideChange:l=>{l&&(l.isEnd?t?.onCurrentTabLoopEnd?.():l.isBeginning&&t?.onCurrentTabLoopStart?.())},thumbs:{swiper:i},modules:[V,C,E,R],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((l,h)=>e(N,{className:"h-full",children:e(T,{source:l?.image?.url,alt:l?.image?.altText,className:m("h-full",I),imgClassName:"object-contain h-full"})},t?.id+"SwiperSlideItem"+h))}),o.availableForSale&&!!d&&!t.index&&e(F,{size:"lg",className:"absolute bg-brand text-white top-3 laptop:left-16 laptop:top-5 left-4 z-[2] desktop:left-6 desktop:top-6",children:`${q({amount:d,currencyCode:o?.price?.currencyCode,locale:p})} ${x?.off}`}),e("div",{className:m("hidden tablet:opacity-0 tablet:block tablet:absolute tablet:top-1/2 laptop:left-16 tablet:left-6 desktop:left-6 z-10 -translate-y-1/2 cursor-pointer",`ipc-product-gallery-${t?.id}-custom-swiper-button-prev`,"swiper-button"),children:e(_,{className:m("tablet:size-10 lg-desktop:size-12")})}),e("div",{className:m("hidden tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 laptop:right-16 tablet:right-6 z-10 desktop:right-6 -translate-y-1/2 cursor-pointer",`ipc-product-gallery-${t?.id}-custom-swiper-button-next`,"swiper-button"),children:e(B,{className:m("tablet:size-10 lg-desktop:size-12")})}),c("div",{className:"absolute bottom-[94px] tablet:bottom-[70px] left-4 right-4 z-10 items-center tablet:flex justify-between laptop:left-16 laptop:right-16 desktop:bottom-[20px] desktop:right-6 desktop:left-6",children:[e("div",{className:"hidden tablet:block",children:e(G,{className:"flex items-center justify-between",onSwiper:s,spaceBetween:12,slidesPerView:6,freeMode:!0,watchSlidesProgress:!0,modules:[E,C],children:t?.galleries?.map((l,h)=>e(N,{className:"!w-auto [&.swiper-slide-thumb-active]:border [&.swiper-slide-thumb-active]:rounded [&.swiper-slide-thumb-active]:border-brand",children:e(T,{source:l.image?.url,alt:l.image?.altText,className:"size-10 lg-desktop:size-12 overflow-hidden bg-white rounded",imgClassName:"object-contain h-full"})},t?.id+"SwiperSlideThumbItem"+h))})}),!t?.index&&c("div",{className:"flex items-center gap-2",children:[e(T,{source:t?.comment?.avatar?.url,className:"size-8 laptop:size-10 rounded-full shrink-0",imgClassName:"object-cover "}),e($,{html:t?.comment?.content,className:"text-sm lg-desktop:text-base max-w-[528px] font-bold text-[#1D1D1F] line-clamp-2"})]})]}),e("div",{ref:w,className:"tablet:hidden text-center absolute !bottom-[70px] left-4 right-4 z-10"})]})}),X=t=>c("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[e(G,{className:"h-full",navigation:{nextEl:`.ipc-product-gallery-${t?.id}-custom-swiper-button-next`,prevEl:`.ipc-product-gallery-${t?.id}-custom-swiper-button-prev`},modules:[V,C,E,R],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((r,p)=>e(N,{className:"h-full",children:c("video",{controls:!0,className:"size-full",children:[e("track",{kind:"captions"}),e("source",{src:r?.sources?.[0]?.url,type:"video/mp4"}),e("source",{src:r?.sources?.[0]?.url,type:"video/webm"}),e("source",{src:r?.sources?.[0]?.url,type:"video/ogg"})]})},t?.id+"SwiperSlideItem"+p))}),e("div",{className:m("hidden swiper-button tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:left-6 z-10 -translate-y-1/2 cursor-pointer",`ipc-product-gallery-${t?.id}-custom-swiper-button-prev`),children:e(_,{className:"tablet:size-10 lg-desktop:size-12"})}),e("div",{className:m("hidden tablet:block swiper-button tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:right-6 z-10 -translate-y-1/2 cursor-pointer",`ipc-product-gallery-${t?.id}-custom-swiper-button-next`),children:e(B,{className:"tablet:size-10 lg-desktop:size-12"})})]}),ye=t=>e("div",{children:"3D View"});var we=J;export{we as default};
1
+ import{Fragment as ee,jsx as e,jsxs as c}from"react/jsx-runtime";import{useAiuiContext as z}from"../../../../AiuiProvider/index.js";import{Text as $,Picture as T,Badge as F}from"../../../../../components";import{useMemo as k,useState as y,forwardRef as j,useRef as L}from"react";import{Swiper as G,SwiperSlide as N}from"swiper/react";import{Navigation as E,Mousewheel as V,Thumbs as C,Pagination as R}from"swiper/modules";import{cn as m}from"../../../../../helpers/index.js";import{GalleryTabType as b}from"./types.js";import{Content as Y,List as W,Root as O,Trigger as H}from"@radix-ui/react-tabs";import{useBizProductContext as M}from"../../../BizProductProvider.js";import{useVariantMedia as U}from"../../../hooks/use-variant-media.js";import{SpecsModal as Z}from"./components/SpecsModal.js";import K from"./components/CompareModal.js";import{formatPrice as q}from"../../../utils/index.js";const _=t=>c("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[e("rect",{x:"48",y:"48",width:"48",height:"48",rx:"24",transform:"rotate(-180 48 48)",fill:"white"}),e("path",{d:"M25.1035 16.8545C25.5372 16.3818 26.246 16.3818 26.6797 16.8545C27.1067 17.3201 27.1067 18.0706 26.6797 18.5361L21.668 24L26.6797 29.4639C27.1067 29.9294 27.1067 30.6799 26.6797 31.1455C26.246 31.6182 25.5372 31.6182 25.1035 31.1455L19.3203 24.8408C18.8933 24.3752 18.8933 23.6248 19.3203 23.1592L25.1035 16.8545Z",fill:"currentColor"})]}),B=t=>c("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[e("rect",{width:"48",height:"48",rx:"24",transform:"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)",fill:"white"}),e("path",{d:"M22.8965 16.8545C22.4628 16.3818 21.754 16.3818 21.3203 16.8545C20.8933 17.3201 20.8933 18.0706 21.3203 18.5361L26.332 24L21.3203 29.4639C20.8933 29.9294 20.8933 30.6799 21.3203 31.1455C21.754 31.6182 22.4628 31.6182 22.8965 31.1455L28.6797 24.8408C29.1067 24.3752 29.1067 23.6248 28.6797 23.1592L22.8965 16.8545Z",fill:"currentColor"})]}),J=()=>{const{copyWriting:t}=z(),{product:r,variant:p,selectedOptions:x}=M(),o=U({product:r,variant:p}),[d,w]=y(null),i=p?.metafields?.component?.custom_media_list;let s,u,v,f;i&&i?.available?(s=i?.product||[],u=i?.scenarios||[],v=i?.keyFeatures||[],f=i?.video||[]):(s=o?.productList,u=o?.sceneList,v=o?.keyFeaturesList,f=o?.videoList);const A=k(()=>[...s,...u,...f],[s,u,f]),S={productList:s,sceneList:u,keyFeaturesList:v,videoList:f},g=k(()=>(r?.payload?.components?.find(a=>a.componentKey==="ProductGallery")?.data||[])?.map(a=>({...a,galleries:S[a?.galleries]||[]})).filter(a=>a.galleries.length>0),[r?.payload,S]),I=L({}),[l,h]=y(g?.[0]),D=(n,a)=>{switch(n?.galleryTabType){case b.GALLERY_IMAGE_MAIN:return e(P,{...n,index:a});case b.GALLERY_IMAGE_FEATURES:return e(P,{...n,index:a});case b.GALLERY_IMAGE_SCENE:return e(P,{...n,index:a});case b.GALLERY_VIDEO:return e(X,{...n});default:return null}};return e("div",{id:"ipc-product-gallery",children:c(O,{className:"relative",defaultValue:g?.[0]?.tabValue,children:[e("div",{className:"h-[420px] overflow-hidden tablet:h-[620px] desktop:rounded-2xl desktop:h-[560px] lg-desktop:h-[700px] bg-[#EAEAEC] desktop:relative ",children:g.map((n,a)=>e(Y,{className:"h-full",value:n.tabValue,children:D(n,a)},n.tabValue))}),e(Q,{galleryTabs:g,activeGalleryTab:l,setActiveGalleryTab:h})]})})},Q=({galleryTabs:t,activeGalleryTab:r,setActiveGalleryTab:p})=>{const{product:x}=M(),o=L(null);return c("div",{className:"absolute z-[2] bottom-4 left-4 right-4 laptop:left-16 laptop:right-16 flex justify-between items-center tablet:mt-3 desktop:static",children:[e(W,{ref:o,className:"rounded-full bg-[#EAEAEC] p-1 laptop:p-0 desktop:p-1 overflow-x-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e("div",{className:"whitespace-nowrap",children:t?.map(d=>e(H,{className:m("lg-desktop:px-7 lg-desktop:pb-[14px] rounded-full font-bold lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px] text-[14px] leading-tight",d.tabValue===r?.tabValue&&"bg-white"),onClick:w=>{if(p(d),o.current){const i=o.current,s=w.currentTarget,u=s.offsetLeft-i.offsetWidth/2+s.offsetWidth/2;i.scrollTo({left:u,behavior:"smooth"})}},value:d.tabValue,children:d.tabLabel},d.tabValue))})}),e("div",{className:"laptop:gap-2 hidden laptop:flex",children:x.metafields?.global?.specifications&&c(ee,{children:[e(Z,{})," | ",e(K,{})]})})]})},P=j((t,r)=>{const{locale:p="us",copyWriting:x}=z(),{variant:o,totalSavings:d}=M(),w=L(null),[i,s]=y(null),[u,v]=y(!0),[f,A]=y(!1),[S,g]=y(null),I=k(()=>{if(t?.galleryTabType===b.GALLERY_IMAGE_MAIN)return"size-[240px] mx-auto mt-[42px] tablet:mt-16 tablet:size-[420px] lg-desktop:size-[560px]";t?.galleryTabType===b.GALLERY_IMAGE_FEATURES||(t?.galleryTabType,b.GALLERY_IMAGE_SCENE)},[t?.galleryTabType]);return c("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[e(G,{ref:r,className:"h-full",navigation:{nextEl:`.ipc-product-gallery-${t?.id}-custom-swiper-button-next`,prevEl:`.ipc-product-gallery-${t?.id}-custom-swiper-button-prev`},onSwiper:g,onProgress:l=>{v(l.isBeginning),A(l.isEnd)},pagination:{clickable:!0,el:w.current},onSlideChange:l=>{l&&(l.isEnd?t?.onCurrentTabLoopEnd?.():l.isBeginning&&t?.onCurrentTabLoopStart?.())},thumbs:{swiper:i},modules:[V,C,E,R],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((l,h)=>e(N,{className:"h-full",children:e(T,{source:l?.image?.url,alt:l?.image?.altText,className:m("h-full",I),imgClassName:"object-cover h-full"})},t?.id+"SwiperSlideItem"+h))}),o.availableForSale&&!!d&&!t.index&&e(F,{size:"lg",className:"absolute bg-brand text-white top-3 laptop:left-16 laptop:top-5 left-4 z-[2] desktop:left-6 desktop:top-6",children:`${q({amount:d,currencyCode:o?.price?.currencyCode,locale:p})} ${x?.off}`}),e("div",{className:m("hidden tablet:opacity-0 tablet:block tablet:absolute tablet:top-1/2 laptop:left-16 tablet:left-6 desktop:left-6 z-10 -translate-y-1/2 cursor-pointer",`ipc-product-gallery-${t?.id}-custom-swiper-button-prev`,"swiper-button"),children:e(_,{className:m("tablet:size-10 lg-desktop:size-12")})}),e("div",{className:m("hidden tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 laptop:right-16 tablet:right-6 z-10 desktop:right-6 -translate-y-1/2 cursor-pointer",`ipc-product-gallery-${t?.id}-custom-swiper-button-next`,"swiper-button"),children:e(B,{className:m("tablet:size-10 lg-desktop:size-12")})}),c("div",{className:"absolute bottom-[94px] tablet:bottom-[70px] left-4 right-4 z-10 items-center tablet:flex justify-between laptop:left-16 laptop:right-16 desktop:bottom-[20px] desktop:right-6 desktop:left-6",children:[e("div",{className:"hidden tablet:block",children:e(G,{className:"flex items-center justify-between",onSwiper:s,spaceBetween:12,slidesPerView:6,freeMode:!0,watchSlidesProgress:!0,modules:[E,C],children:t?.galleries?.map((l,h)=>e(N,{className:"!w-auto [&.swiper-slide-thumb-active]:border [&.swiper-slide-thumb-active]:rounded [&.swiper-slide-thumb-active]:border-brand",children:e(T,{source:l.image?.url,alt:l.image?.altText,className:"size-10 lg-desktop:size-12 overflow-hidden bg-white rounded",imgClassName:"object-contain h-full"})},t?.id+"SwiperSlideThumbItem"+h))})}),!t?.index&&c("div",{className:"flex items-center gap-2",children:[e(T,{source:t?.comment?.avatar?.url,className:"size-8 laptop:size-10 rounded-full shrink-0",imgClassName:"object-cover "}),e($,{html:t?.comment?.content,className:"text-sm lg-desktop:text-base max-w-[528px] font-bold text-[#1D1D1F] line-clamp-2"})]})]}),e("div",{ref:w,className:"tablet:hidden text-center absolute !bottom-[70px] left-4 right-4 z-10"})]})}),X=t=>c("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[e(G,{className:"h-full",navigation:{nextEl:`.ipc-product-gallery-${t?.id}-custom-swiper-button-next`,prevEl:`.ipc-product-gallery-${t?.id}-custom-swiper-button-prev`},modules:[V,C,E,R],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((r,p)=>e(N,{className:"h-full",children:c("video",{controls:!0,className:"size-full",children:[e("track",{kind:"captions"}),e("source",{src:r?.sources?.[0]?.url,type:"video/mp4"}),e("source",{src:r?.sources?.[0]?.url,type:"video/webm"}),e("source",{src:r?.sources?.[0]?.url,type:"video/ogg"})]})},t?.id+"SwiperSlideItem"+p))}),e("div",{className:m("hidden swiper-button tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:left-6 z-10 -translate-y-1/2 cursor-pointer",`ipc-product-gallery-${t?.id}-custom-swiper-button-prev`),children:e(_,{className:"tablet:size-10 lg-desktop:size-12"})}),e("div",{className:m("hidden tablet:block swiper-button tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:right-6 z-10 -translate-y-1/2 cursor-pointer",`ipc-product-gallery-${t?.id}-custom-swiper-button-next`),children:e(B,{className:"tablet:size-10 lg-desktop:size-12"})})]}),ye=t=>e("div",{children:"3D View"});var we=J;export{we as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/biz-components/Listing/components/ProductCard/ProductGallery/index.tsx"],
4
- "sourcesContent": ["import { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { Text, Picture, Button, Badge } from '../../../../../components'\nimport {\n useCallback,\n useMemo,\n useState,\n forwardRef,\n useRef,\n type RefObject,\n useEffect,\n type Dispatch,\n type SetStateAction,\n} from 'react'\nimport { Swiper, SwiperSlide, type SwiperRef } from 'swiper/react'\nimport { Navigation, Mousewheel, Thumbs, Pagination } from 'swiper/modules'\nimport { cn } from '../../../../../helpers/index.js'\nimport { GalleryTabType } from './types.js'\nimport { Content, List, Root, Trigger } from '@radix-ui/react-tabs'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useVariantMedia } from '../../../hooks/use-variant-media.js'\nimport { SpecsModal } from './components/SpecsModal.js'\nimport CompareModal from './components/CompareModal.js'\nimport { formatPrice } from '../../../utils/index.js'\n\nimport type { Swiper as SwiperType } from 'swiper'\nimport type { ImageMedia, VideoMedia } from '../../../hooks/use-variant-media.js'\nimport type { ProductGalleryProps, ProductGalleryTabItemProps, GalleryTabItemProps } from './types.js'\n\nconst SwiperLeftButtonIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <rect x=\"48\" y=\"48\" width=\"48\" height=\"48\" rx=\"24\" transform=\"rotate(-180 48 48)\" fill=\"white\" />\n <path\n d=\"M25.1035 16.8545C25.5372 16.3818 26.246 16.3818 26.6797 16.8545C27.1067 17.3201 27.1067 18.0706 26.6797 18.5361L21.668 24L26.6797 29.4639C27.1067 29.9294 27.1067 30.6799 26.6797 31.1455C26.246 31.6182 25.5372 31.6182 25.1035 31.1455L19.3203 24.8408C18.8933 24.3752 18.8933 23.6248 19.3203 23.1592L25.1035 16.8545Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nconst SwiperRightButtonIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <rect width=\"48\" height=\"48\" rx=\"24\" transform=\"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)\" fill=\"white\" />\n <path\n d=\"M22.8965 16.8545C22.4628 16.3818 21.754 16.3818 21.3203 16.8545C20.8933 17.3201 20.8933 18.0706 21.3203 18.5361L26.332 24L21.3203 29.4639C20.8933 29.9294 20.8933 30.6799 21.3203 31.1455C21.754 31.6182 22.4628 31.6182 22.8965 31.1455L28.6797 24.8408C29.1067 24.3752 29.1067 23.6248 28.6797 23.1592L22.8965 16.8545Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nconst ProductGallery = () => {\n const { copyWriting } = useAiuiContext()\n const { product, variant, selectedOptions } = useBizProductContext()\n const defaultMediaData = useVariantMedia({ product, variant })\n const [swiper, setSwiper] = useState<SwiperType | null>(null)\n\n const customMediaList = variant?.metafields?.component?.custom_media_list\n let productList: ImageMedia[], sceneList: ImageMedia[], keyFeaturesList: ImageMedia[], videoList: VideoMedia[]\n\n if (customMediaList && customMediaList?.available) {\n productList = customMediaList?.product || []\n sceneList = customMediaList?.scenarios || []\n keyFeaturesList = customMediaList?.keyFeatures || []\n videoList = customMediaList?.video || []\n } else {\n productList = defaultMediaData?.productList\n sceneList = defaultMediaData?.sceneList\n keyFeaturesList = defaultMediaData?.keyFeaturesList\n videoList = defaultMediaData?.videoList\n }\n\n const allMedia = useMemo(() => [...productList, ...sceneList, ...videoList], [productList, sceneList, videoList])\n\n const galleryMap: Record<string, ImageMedia[] | VideoMedia[]> = {\n productList: productList,\n sceneList: sceneList,\n keyFeaturesList: keyFeaturesList,\n videoList: videoList,\n }\n\n const galleryTabs = useMemo(() => {\n const productTab =\n product?.payload?.components?.find((item: any) => item.componentKey === 'ProductGallery')?.data || []\n\n return productTab\n ?.map((item: any) => ({\n ...item,\n galleries: galleryMap[item?.galleries] || [],\n }))\n .filter((item: any) => item.galleries.length > 0)\n }, [product?.payload, galleryMap])\n\n // \u4E3A\u6BCF\u4E2A galleryTab \u521B\u5EFA\u5BF9\u5E94\u7684 ref\n const gallerySwiperRefs = useRef<{ [key: string]: SwiperRef | null }>({})\n\n const [activeGalleryTab, setActiveGalleryTab] = useState<GalleryTabItemProps>(galleryTabs?.[0])\n\n\n // useEffect(() => {\n // if (selectedOptions?.color) {\n // setActiveGalleryTab(galleryTabs?.find((item: any) => item.galleryTabType === GalleryTabType.GALLERY_IMAGE_MAIN))\n // }\n // }, [selectedOptions, galleryTabs])\n\n // \u4E3A\u6BCF\u4E2A tab \u6E32\u67D3\u5BF9\u5E94\u7684\u7EC4\u4EF6\n const renderGalleryForTab = (tab: any, index: number) => {\n switch (tab?.galleryTabType) {\n // case GalleryTabType.GALLERY_IMAGE_MAIN ||\n // GalleryTabType.GALLERY_IMAGE_FEATURES ||\n // GalleryTabType.GALLERY_IMAGE_SCENE:\n // return (\n // <ProductGalleryTabImage\n // {...tab}\n // // onCurrentTabLoopEnd={() => {\n // // setActiveGalleryTab(galleryTabs?.[index])\n // // }}\n // // onCurrentTabLoopStart={() => {\n // // setActiveGalleryTab(galleryTabs?.[index])\n // // }}\n // index={index}\n // />\n // )\n\n case GalleryTabType.GALLERY_IMAGE_MAIN:\n return <ProductGalleryTabImage {...tab} index={index} />\n case GalleryTabType.GALLERY_IMAGE_FEATURES:\n return <ProductGalleryTabImage {...tab} index={index} />\n case GalleryTabType.GALLERY_IMAGE_SCENE:\n return <ProductGalleryTabImage {...tab} index={index} />\n case GalleryTabType.GALLERY_VIDEO:\n return <ProductGalleryTabVideo {...tab} />\n // case GalleryTabType.GALLERY_3D_VIEW:\n // return <ProductGalleryTab3DView {...item} />\n default:\n return null\n }\n }\n\n return (\n <div id=\"ipc-product-gallery\">\n <Root className=\"relative\" defaultValue={galleryTabs?.[0]?.tabValue}>\n {/* <Swiper\n className=\"h-[420px] laptop:h-[700px] bg-[#EAEAEC] rounded-2xl\"\n onSwiper={setSwiper}\n loop={true}\n // onProgress={swiper => {\n // setStart(swiper.isBeginning)\n // setEnd(swiper.isEnd)\n // }}\n modules={[Mousewheel]}\n mousewheel={{\n forceToAxis: true,\n }}\n >\n {galleryTabs.map((item, index) => {\n return (\n <Content forceMount key={item.tabValue} value={item.tabValue}>\n <SwiperSlide key={index}>{renderGalleryForTab(activeGalleryTab)}</SwiperSlide>\n </Content>\n )\n })}\n </Swiper>\n <div\n className={cn(\n 'absolute top-1/2 left-6 z-10 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-custom-swiper-button-prev`\n )}\n >\n <SwiperLeftButtonIcon\n className=\"size-12\"\n onClick={() => {\n if (activeGalleryTab?.tabValue) {\n const currentRef = gallerySwiperRefs.current[activeGalleryTab.tabValue]\n currentRef?.swiper?.slidePrev()\n }\n }}\n />\n </div>\n <div\n className={cn(\n 'absolute top-1/2 right-6 z-10 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-custom-swiper-button-next`\n )}\n >\n <SwiperRightButtonIcon\n className=\"size-12\"\n onClick={() => {\n if (activeGalleryTab?.tabValue) {\n const currentRef = gallerySwiperRefs.current[activeGalleryTab.tabValue]\n currentRef?.swiper?.slideNext()\n }\n }}\n />\n </div> */}\n <div className=\"h-[420px] overflow-hidden tablet:h-[620px] desktop:rounded-2xl desktop:h-[560px] lg-desktop:h-[700px] bg-[#EAEAEC] desktop:relative \">\n {galleryTabs.map((item: any, index: number) => {\n return (\n <Content key={item.tabValue} className=\"h-full\" value={item.tabValue}>\n {renderGalleryForTab(item, index)}\n </Content>\n )\n })}\n </div>\n <ProductGalleryTab\n galleryTabs={galleryTabs}\n activeGalleryTab={activeGalleryTab}\n setActiveGalleryTab={setActiveGalleryTab}\n />\n </Root>\n </div>\n )\n}\n\nconst ProductGalleryTab = ({\n galleryTabs,\n activeGalleryTab,\n setActiveGalleryTab,\n}: {\n galleryTabs: GalleryTabItemProps[]\n activeGalleryTab: GalleryTabItemProps\n setActiveGalleryTab: Dispatch<SetStateAction<GalleryTabItemProps>>\n}) => {\n const { product } = useBizProductContext()\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n return (\n <div className=\"absolute z-[2] bottom-4 left-4 right-4 laptop:left-16 laptop:right-16 flex justify-between items-center tablet:mt-3 desktop:static\">\n <List\n ref={scrollContainerRef}\n className=\"rounded-full bg-[#EAEAEC] p-1 laptop:p-0 desktop:p-1 overflow-x-auto\"\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n >\n <div className=\"whitespace-nowrap\">\n {galleryTabs?.map(item => {\n return (\n <Trigger\n className={cn(\n 'lg-desktop:px-7 lg-desktop:pb-[14px] rounded-full font-bold lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px] text-[14px] leading-tight',\n item.tabValue === activeGalleryTab?.tabValue && 'bg-white'\n )}\n onClick={el => {\n setActiveGalleryTab(item)\n if (scrollContainerRef.current) {\n const container = scrollContainerRef.current\n const button = el.currentTarget\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }}\n key={item.tabValue}\n value={item.tabValue}\n >\n {item.tabLabel}\n </Trigger>\n )\n })}\n </div>\n </List>\n <div className=\"laptop:gap-2 hidden laptop:flex\">\n {product.metafields?.global?.specifications && (\n <>\n <SpecsModal /> | <CompareModal />\n </>\n )}\n </div>\n </div>\n )\n}\n\nconst ProductGalleryTabImage = forwardRef<SwiperRef, ProductGalleryTabItemProps>((props, ref) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { variant, totalSavings } = useBizProductContext()\n const paginationRef = useRef<HTMLDivElement>(null)\n const [thumbsSwiper, setThumbsSwiper] = useState<SwiperType | null>(null)\n const [isStart, setStart] = useState(true)\n const [isEnd, setEnd] = useState(false)\n const [swiper, setSwiper] = useState<SwiperType | null>(null)\n\n const imageClassName = useMemo(() => {\n if (props?.galleryTabType === GalleryTabType.GALLERY_IMAGE_MAIN) {\n return 'size-[240px] mx-auto mt-[42px] tablet:mt-16 tablet:size-[420px] lg-desktop:size-[560px]'\n } else if (props?.galleryTabType === GalleryTabType.GALLERY_IMAGE_FEATURES) {\n // return '420px'\n } else if (props?.galleryTabType === GalleryTabType.GALLERY_IMAGE_SCENE) {\n // return '560px'\n }\n }, [props?.galleryTabType])\n\n return (\n <div className=\"h-full [&_.swiper-button]:hover:opacity-100\">\n <Swiper\n ref={ref}\n className=\"h-full\"\n navigation={{\n nextEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-next`,\n prevEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-prev`,\n }}\n onSwiper={setSwiper}\n onProgress={swiper => {\n setStart(swiper.isBeginning)\n setEnd(swiper.isEnd)\n }}\n pagination={{\n clickable: true,\n el: paginationRef.current,\n }}\n onSlideChange={swiper => {\n if (swiper) {\n if (swiper.isEnd) {\n props?.onCurrentTabLoopEnd?.()\n } else if (swiper.isBeginning) {\n props?.onCurrentTabLoopStart?.()\n }\n }\n }}\n thumbs={{ swiper: thumbsSwiper }}\n modules={[Mousewheel, Thumbs, Navigation, Pagination]}\n mousewheel={{\n forceToAxis: true,\n }}\n breakpoints={{\n 0: {\n slidesPerView: 1,\n freeMode: false,\n },\n }}\n >\n {props?.galleries?.map((item, jIndex) => {\n return (\n <SwiperSlide className=\"h-full\" key={props?.id + 'SwiperSlideItem' + jIndex}>\n <Picture\n source={item?.image?.url}\n alt={item?.image?.altText}\n className={cn(\"h-full\", imageClassName)}\n imgClassName=\"object-contain h-full\"\n />\n </SwiperSlide>\n )\n })}\n </Swiper>\n {variant.availableForSale && !!totalSavings && !props.index && (\n <Badge\n size=\"lg\"\n className=\"absolute bg-brand text-white top-3 laptop:left-16 laptop:top-5 left-4 z-[2] desktop:left-6 desktop:top-6\"\n >\n {`${formatPrice({\n amount: totalSavings,\n currencyCode: variant?.price?.currencyCode,\n locale: locale,\n })} ${copyWriting?.off}`}\n </Badge>\n )}\n <div\n className={cn(\n 'hidden tablet:opacity-0 tablet:block tablet:absolute tablet:top-1/2 laptop:left-16 tablet:left-6 desktop:left-6 z-10 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-${props?.id}-custom-swiper-button-prev`,\n `swiper-button`\n )}\n >\n <SwiperLeftButtonIcon className={cn('tablet:size-10 lg-desktop:size-12')} />\n </div>\n <div\n className={cn(\n 'hidden tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 laptop:right-16 tablet:right-6 z-10 desktop:right-6 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-${props?.id}-custom-swiper-button-next`,\n `swiper-button`\n )}\n >\n <SwiperRightButtonIcon className={cn('tablet:size-10 lg-desktop:size-12')} />\n </div>\n {/* {props?.galleries?.map((item, jIndex) => {\n return (\n <Picture\n key={props?.id + 'SwiperSlideItem' + jIndex}\n source={item?.image?.url}\n alt={item?.image?.altText}\n className=\"h-full\"\n imgClassName=\"object-cover h-full\"\n />\n )\n })} */}\n <div className=\"absolute bottom-[94px] tablet:bottom-[70px] left-4 right-4 z-10 items-center tablet:flex justify-between laptop:left-16 laptop:right-16 desktop:bottom-[20px] desktop:right-6 desktop:left-6\">\n <div className=\"hidden tablet:block\">\n <Swiper\n className=\"flex items-center justify-between\"\n onSwiper={setThumbsSwiper}\n spaceBetween={12}\n slidesPerView={6}\n freeMode={true}\n watchSlidesProgress={true}\n modules={[Navigation, Thumbs]}\n >\n {props?.galleries?.map((item, jIndex) => (\n <SwiperSlide\n key={props?.id + 'SwiperSlideThumbItem' + jIndex}\n className=\"!w-auto [&.swiper-slide-thumb-active]:border [&.swiper-slide-thumb-active]:rounded [&.swiper-slide-thumb-active]:border-brand\"\n >\n <Picture\n source={item.image?.url}\n alt={item.image?.altText}\n className=\"size-10 lg-desktop:size-12 overflow-hidden bg-white rounded\"\n imgClassName=\"object-contain h-full\"\n />\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n {!props?.index && (\n <div className=\"flex items-center gap-2\">\n <Picture\n source={props?.comment?.avatar?.url}\n className=\"size-8 laptop:size-10 rounded-full shrink-0\"\n imgClassName=\"object-cover \"\n />\n <Text\n html={props?.comment?.content}\n className=\"text-sm lg-desktop:text-base max-w-[528px] font-bold text-[#1D1D1F] line-clamp-2\"\n />\n </div>\n )}\n </div>\n <div ref={paginationRef} className=\"tablet:hidden text-center absolute !bottom-[70px] left-4 right-4 z-10\" />\n </div>\n )\n})\n\nconst ProductGalleryTabVideo = (props: ProductGalleryTabItemProps) => {\n return (\n <div className=\"h-full [&_.swiper-button]:hover:opacity-100\">\n <Swiper\n className=\"h-full\"\n navigation={{\n nextEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-next`,\n prevEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-prev`,\n }}\n modules={[Mousewheel, Thumbs, Navigation, Pagination]}\n mousewheel={{\n forceToAxis: true,\n }}\n breakpoints={{\n 0: {\n slidesPerView: 1,\n freeMode: false,\n },\n }}\n >\n {props?.galleries?.map((item, jIndex) => {\n return (\n <SwiperSlide className=\"h-full\" key={props?.id + 'SwiperSlideItem' + jIndex}>\n <video controls className=\"size-full\">\n <track kind=\"captions\" />\n <source src={item?.sources?.[0]?.url} type=\"video/mp4\" />\n <source src={item?.sources?.[0]?.url} type=\"video/webm\" />\n <source src={item?.sources?.[0]?.url} type=\"video/ogg\" />\n </video>\n </SwiperSlide>\n )\n })}\n </Swiper>\n <div\n className={cn(\n 'hidden swiper-button tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:left-6 z-10 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-${props?.id}-custom-swiper-button-prev`\n )}\n >\n <SwiperLeftButtonIcon className=\"tablet:size-10 lg-desktop:size-12\" />\n </div>\n <div\n className={cn(\n 'hidden tablet:block swiper-button tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:right-6 z-10 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-${props?.id}-custom-swiper-button-next`\n )}\n >\n <SwiperRightButtonIcon className=\"tablet:size-10 lg-desktop:size-12\" />\n </div>\n </div>\n )\n}\n\nconst ProductGalleryTab3DView = (props: ProductGalleryTabItemProps) => {\n return <div>3D View</div>\n}\n\nexport default ProductGallery\n"],
5
- "mappings": "AA8BI,OA6OM,YAAAA,GA5OJ,OAAAC,EADF,QAAAC,MAAA,oBA9BJ,OAAS,kBAAAC,MAAsB,oCAC/B,OAAS,QAAAC,EAAM,WAAAC,EAAiB,SAAAC,MAAa,4BAC7C,OAEE,WAAAC,EACA,YAAAC,EACA,cAAAC,EACA,UAAAC,MAKK,QACP,OAAS,UAAAC,EAAQ,eAAAC,MAAmC,eACpD,OAAS,cAAAC,EAAY,cAAAC,EAAY,UAAAC,EAAQ,cAAAC,MAAkB,iBAC3D,OAAS,MAAAC,MAAU,kCACnB,OAAS,kBAAAC,MAAsB,aAC/B,OAAS,WAAAC,EAAS,QAAAC,EAAM,QAAAC,EAAM,WAAAC,MAAe,uBAC7C,OAAS,wBAAAC,MAA4B,iCACrC,OAAS,mBAAAC,MAAuB,sCAChC,OAAS,cAAAC,MAAkB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,wBAAwBkB,GAAO,EAAE,6BACzC,OAAQ,wBAAwBA,GAAO,EAAE,4BAC3C,EACA,QAAS,CAACf,EAAYC,EAAQF,EAAYG,CAAU,EACpD,WAAY,CACV,YAAa,EACf,EACA,YAAa,CACX,EAAG,CACD,cAAe,EACf,SAAU,EACZ,CACF,EAEC,SAAAa,GAAO,WAAW,IAAI,CAACkB,EAAM0B,IAE1BxE,EAACW,EAAA,CAAY,UAAU,SACrB,SAAAV,EAAC,SAAM,SAAQ,GAAC,UAAU,YACxB,UAAAD,EAAC,SAAM,KAAK,WAAW,EACvBA,EAAC,UAAO,IAAK8C,GAAM,UAAU,CAAC,GAAG,IAAK,KAAK,YAAY,EACvD9C,EAAC,UAAO,IAAK8C,GAAM,UAAU,CAAC,GAAG,IAAK,KAAK,aAAa,EACxD9C,EAAC,UAAO,IAAK8C,GAAM,UAAU,CAAC,GAAG,IAAK,KAAK,YAAY,GACzD,GANmClB,GAAO,GAAK,kBAAoB4C,CAOrE,CAEH,EACH,EACAxE,EAAC,OACC,UAAWgB,EACT,uIACA,uBAAuBY,GAAO,EAAE,4BAClC,EAEA,SAAA5B,EAAC2B,EAAA,CAAqB,UAAU,oCAAoC,EACtE,EACA3B,EAAC,OACC,UAAWgB,EACT,wIACA,uBAAuBY,GAAO,EAAE,4BAClC,EAEA,SAAA5B,EAAC6B,EAAA,CAAsB,UAAU,oCAAoC,EACvE,GACF,EAIE4C,GAA2B7C,GACxB5B,EAAC,OAAI,mBAAO,EAGrB,IAAO0E,GAAQ5C",
4
+ "sourcesContent": ["import { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { Text, Picture, Button, Badge } from '../../../../../components'\nimport {\n useCallback,\n useMemo,\n useState,\n forwardRef,\n useRef,\n type RefObject,\n useEffect,\n type Dispatch,\n type SetStateAction,\n} from 'react'\nimport { Swiper, SwiperSlide, type SwiperRef } from 'swiper/react'\nimport { Navigation, Mousewheel, Thumbs, Pagination } from 'swiper/modules'\nimport { cn } from '../../../../../helpers/index.js'\nimport { GalleryTabType } from './types.js'\nimport { Content, List, Root, Trigger } from '@radix-ui/react-tabs'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useVariantMedia } from '../../../hooks/use-variant-media.js'\nimport { SpecsModal } from './components/SpecsModal.js'\nimport CompareModal from './components/CompareModal.js'\nimport { formatPrice } from '../../../utils/index.js'\n\nimport type { Swiper as SwiperType } from 'swiper'\nimport type { ImageMedia, VideoMedia } from '../../../hooks/use-variant-media.js'\nimport type { ProductGalleryProps, ProductGalleryTabItemProps, GalleryTabItemProps } from './types.js'\n\nconst SwiperLeftButtonIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <rect x=\"48\" y=\"48\" width=\"48\" height=\"48\" rx=\"24\" transform=\"rotate(-180 48 48)\" fill=\"white\" />\n <path\n d=\"M25.1035 16.8545C25.5372 16.3818 26.246 16.3818 26.6797 16.8545C27.1067 17.3201 27.1067 18.0706 26.6797 18.5361L21.668 24L26.6797 29.4639C27.1067 29.9294 27.1067 30.6799 26.6797 31.1455C26.246 31.6182 25.5372 31.6182 25.1035 31.1455L19.3203 24.8408C18.8933 24.3752 18.8933 23.6248 19.3203 23.1592L25.1035 16.8545Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nconst SwiperRightButtonIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <rect width=\"48\" height=\"48\" rx=\"24\" transform=\"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)\" fill=\"white\" />\n <path\n d=\"M22.8965 16.8545C22.4628 16.3818 21.754 16.3818 21.3203 16.8545C20.8933 17.3201 20.8933 18.0706 21.3203 18.5361L26.332 24L21.3203 29.4639C20.8933 29.9294 20.8933 30.6799 21.3203 31.1455C21.754 31.6182 22.4628 31.6182 22.8965 31.1455L28.6797 24.8408C29.1067 24.3752 29.1067 23.6248 28.6797 23.1592L22.8965 16.8545Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nconst ProductGallery = () => {\n const { copyWriting } = useAiuiContext()\n const { product, variant, selectedOptions } = useBizProductContext()\n const defaultMediaData = useVariantMedia({ product, variant })\n const [swiper, setSwiper] = useState<SwiperType | null>(null)\n\n const customMediaList = variant?.metafields?.component?.custom_media_list\n let productList: ImageMedia[], sceneList: ImageMedia[], keyFeaturesList: ImageMedia[], videoList: VideoMedia[]\n\n if (customMediaList && customMediaList?.available) {\n productList = customMediaList?.product || []\n sceneList = customMediaList?.scenarios || []\n keyFeaturesList = customMediaList?.keyFeatures || []\n videoList = customMediaList?.video || []\n } else {\n productList = defaultMediaData?.productList\n sceneList = defaultMediaData?.sceneList\n keyFeaturesList = defaultMediaData?.keyFeaturesList\n videoList = defaultMediaData?.videoList\n }\n\n const allMedia = useMemo(() => [...productList, ...sceneList, ...videoList], [productList, sceneList, videoList])\n\n const galleryMap: Record<string, ImageMedia[] | VideoMedia[]> = {\n productList: productList,\n sceneList: sceneList,\n keyFeaturesList: keyFeaturesList,\n videoList: videoList,\n }\n\n const galleryTabs = useMemo(() => {\n const productTab =\n product?.payload?.components?.find((item: any) => item.componentKey === 'ProductGallery')?.data || []\n\n return productTab\n ?.map((item: any) => ({\n ...item,\n galleries: galleryMap[item?.galleries] || [],\n }))\n .filter((item: any) => item.galleries.length > 0)\n }, [product?.payload, galleryMap])\n\n // \u4E3A\u6BCF\u4E2A galleryTab \u521B\u5EFA\u5BF9\u5E94\u7684 ref\n const gallerySwiperRefs = useRef<{ [key: string]: SwiperRef | null }>({})\n\n const [activeGalleryTab, setActiveGalleryTab] = useState<GalleryTabItemProps>(galleryTabs?.[0])\n\n\n // useEffect(() => {\n // if (selectedOptions?.color) {\n // setActiveGalleryTab(galleryTabs?.find((item: any) => item.galleryTabType === GalleryTabType.GALLERY_IMAGE_MAIN))\n // }\n // }, [selectedOptions, galleryTabs])\n\n // \u4E3A\u6BCF\u4E2A tab \u6E32\u67D3\u5BF9\u5E94\u7684\u7EC4\u4EF6\n const renderGalleryForTab = (tab: any, index: number) => {\n switch (tab?.galleryTabType) {\n // case GalleryTabType.GALLERY_IMAGE_MAIN ||\n // GalleryTabType.GALLERY_IMAGE_FEATURES ||\n // GalleryTabType.GALLERY_IMAGE_SCENE:\n // return (\n // <ProductGalleryTabImage\n // {...tab}\n // // onCurrentTabLoopEnd={() => {\n // // setActiveGalleryTab(galleryTabs?.[index])\n // // }}\n // // onCurrentTabLoopStart={() => {\n // // setActiveGalleryTab(galleryTabs?.[index])\n // // }}\n // index={index}\n // />\n // )\n\n case GalleryTabType.GALLERY_IMAGE_MAIN:\n return <ProductGalleryTabImage {...tab} index={index} />\n case GalleryTabType.GALLERY_IMAGE_FEATURES:\n return <ProductGalleryTabImage {...tab} index={index} />\n case GalleryTabType.GALLERY_IMAGE_SCENE:\n return <ProductGalleryTabImage {...tab} index={index} />\n case GalleryTabType.GALLERY_VIDEO:\n return <ProductGalleryTabVideo {...tab} />\n // case GalleryTabType.GALLERY_3D_VIEW:\n // return <ProductGalleryTab3DView {...item} />\n default:\n return null\n }\n }\n\n return (\n <div id=\"ipc-product-gallery\">\n <Root className=\"relative\" defaultValue={galleryTabs?.[0]?.tabValue}>\n {/* <Swiper\n className=\"h-[420px] laptop:h-[700px] bg-[#EAEAEC] rounded-2xl\"\n onSwiper={setSwiper}\n loop={true}\n // onProgress={swiper => {\n // setStart(swiper.isBeginning)\n // setEnd(swiper.isEnd)\n // }}\n modules={[Mousewheel]}\n mousewheel={{\n forceToAxis: true,\n }}\n >\n {galleryTabs.map((item, index) => {\n return (\n <Content forceMount key={item.tabValue} value={item.tabValue}>\n <SwiperSlide key={index}>{renderGalleryForTab(activeGalleryTab)}</SwiperSlide>\n </Content>\n )\n })}\n </Swiper>\n <div\n className={cn(\n 'absolute top-1/2 left-6 z-10 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-custom-swiper-button-prev`\n )}\n >\n <SwiperLeftButtonIcon\n className=\"size-12\"\n onClick={() => {\n if (activeGalleryTab?.tabValue) {\n const currentRef = gallerySwiperRefs.current[activeGalleryTab.tabValue]\n currentRef?.swiper?.slidePrev()\n }\n }}\n />\n </div>\n <div\n className={cn(\n 'absolute top-1/2 right-6 z-10 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-custom-swiper-button-next`\n )}\n >\n <SwiperRightButtonIcon\n className=\"size-12\"\n onClick={() => {\n if (activeGalleryTab?.tabValue) {\n const currentRef = gallerySwiperRefs.current[activeGalleryTab.tabValue]\n currentRef?.swiper?.slideNext()\n }\n }}\n />\n </div> */}\n <div className=\"h-[420px] overflow-hidden tablet:h-[620px] desktop:rounded-2xl desktop:h-[560px] lg-desktop:h-[700px] bg-[#EAEAEC] desktop:relative \">\n {galleryTabs.map((item: any, index: number) => {\n return (\n <Content key={item.tabValue} className=\"h-full\" value={item.tabValue}>\n {renderGalleryForTab(item, index)}\n </Content>\n )\n })}\n </div>\n <ProductGalleryTab\n galleryTabs={galleryTabs}\n activeGalleryTab={activeGalleryTab}\n setActiveGalleryTab={setActiveGalleryTab}\n />\n </Root>\n </div>\n )\n}\n\nconst ProductGalleryTab = ({\n galleryTabs,\n activeGalleryTab,\n setActiveGalleryTab,\n}: {\n galleryTabs: GalleryTabItemProps[]\n activeGalleryTab: GalleryTabItemProps\n setActiveGalleryTab: Dispatch<SetStateAction<GalleryTabItemProps>>\n}) => {\n const { product } = useBizProductContext()\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n return (\n <div className=\"absolute z-[2] bottom-4 left-4 right-4 laptop:left-16 laptop:right-16 flex justify-between items-center tablet:mt-3 desktop:static\">\n <List\n ref={scrollContainerRef}\n className=\"rounded-full bg-[#EAEAEC] p-1 laptop:p-0 desktop:p-1 overflow-x-auto\"\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n >\n <div className=\"whitespace-nowrap\">\n {galleryTabs?.map(item => {\n return (\n <Trigger\n className={cn(\n 'lg-desktop:px-7 lg-desktop:pb-[14px] rounded-full font-bold lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px] text-[14px] leading-tight',\n item.tabValue === activeGalleryTab?.tabValue && 'bg-white'\n )}\n onClick={el => {\n setActiveGalleryTab(item)\n if (scrollContainerRef.current) {\n const container = scrollContainerRef.current\n const button = el.currentTarget\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }}\n key={item.tabValue}\n value={item.tabValue}\n >\n {item.tabLabel}\n </Trigger>\n )\n })}\n </div>\n </List>\n <div className=\"laptop:gap-2 hidden laptop:flex\">\n {product.metafields?.global?.specifications && (\n <>\n <SpecsModal /> | <CompareModal />\n </>\n )}\n </div>\n </div>\n )\n}\n\nconst ProductGalleryTabImage = forwardRef<SwiperRef, ProductGalleryTabItemProps>((props, ref) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { variant, totalSavings } = useBizProductContext()\n const paginationRef = useRef<HTMLDivElement>(null)\n const [thumbsSwiper, setThumbsSwiper] = useState<SwiperType | null>(null)\n const [isStart, setStart] = useState(true)\n const [isEnd, setEnd] = useState(false)\n const [swiper, setSwiper] = useState<SwiperType | null>(null)\n\n const imageClassName = useMemo(() => {\n if (props?.galleryTabType === GalleryTabType.GALLERY_IMAGE_MAIN) {\n return 'size-[240px] mx-auto mt-[42px] tablet:mt-16 tablet:size-[420px] lg-desktop:size-[560px]'\n } else if (props?.galleryTabType === GalleryTabType.GALLERY_IMAGE_FEATURES) {\n // return '420px'\n } else if (props?.galleryTabType === GalleryTabType.GALLERY_IMAGE_SCENE) {\n // return '560px'\n }\n }, [props?.galleryTabType])\n\n return (\n <div className=\"h-full [&_.swiper-button]:hover:opacity-100\">\n <Swiper\n ref={ref}\n className=\"h-full\"\n navigation={{\n nextEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-next`,\n prevEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-prev`,\n }}\n onSwiper={setSwiper}\n onProgress={swiper => {\n setStart(swiper.isBeginning)\n setEnd(swiper.isEnd)\n }}\n pagination={{\n clickable: true,\n el: paginationRef.current,\n }}\n onSlideChange={swiper => {\n if (swiper) {\n if (swiper.isEnd) {\n props?.onCurrentTabLoopEnd?.()\n } else if (swiper.isBeginning) {\n props?.onCurrentTabLoopStart?.()\n }\n }\n }}\n thumbs={{ swiper: thumbsSwiper }}\n modules={[Mousewheel, Thumbs, Navigation, Pagination]}\n mousewheel={{\n forceToAxis: true,\n }}\n breakpoints={{\n 0: {\n slidesPerView: 1,\n freeMode: false,\n },\n }}\n >\n {props?.galleries?.map((item, jIndex) => {\n return (\n <SwiperSlide className=\"h-full\" key={props?.id + 'SwiperSlideItem' + jIndex}>\n <Picture\n source={item?.image?.url}\n alt={item?.image?.altText}\n className={cn(\"h-full\", imageClassName)}\n imgClassName=\"object-cover h-full\"\n />\n </SwiperSlide>\n )\n })}\n </Swiper>\n {variant.availableForSale && !!totalSavings && !props.index && (\n <Badge\n size=\"lg\"\n className=\"absolute bg-brand text-white top-3 laptop:left-16 laptop:top-5 left-4 z-[2] desktop:left-6 desktop:top-6\"\n >\n {`${formatPrice({\n amount: totalSavings,\n currencyCode: variant?.price?.currencyCode,\n locale: locale,\n })} ${copyWriting?.off}`}\n </Badge>\n )}\n <div\n className={cn(\n 'hidden tablet:opacity-0 tablet:block tablet:absolute tablet:top-1/2 laptop:left-16 tablet:left-6 desktop:left-6 z-10 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-${props?.id}-custom-swiper-button-prev`,\n `swiper-button`\n )}\n >\n <SwiperLeftButtonIcon className={cn('tablet:size-10 lg-desktop:size-12')} />\n </div>\n <div\n className={cn(\n 'hidden tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 laptop:right-16 tablet:right-6 z-10 desktop:right-6 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-${props?.id}-custom-swiper-button-next`,\n `swiper-button`\n )}\n >\n <SwiperRightButtonIcon className={cn('tablet:size-10 lg-desktop:size-12')} />\n </div>\n {/* {props?.galleries?.map((item, jIndex) => {\n return (\n <Picture\n key={props?.id + 'SwiperSlideItem' + jIndex}\n source={item?.image?.url}\n alt={item?.image?.altText}\n className=\"h-full\"\n imgClassName=\"object-cover h-full\"\n />\n )\n })} */}\n <div className=\"absolute bottom-[94px] tablet:bottom-[70px] left-4 right-4 z-10 items-center tablet:flex justify-between laptop:left-16 laptop:right-16 desktop:bottom-[20px] desktop:right-6 desktop:left-6\">\n <div className=\"hidden tablet:block\">\n <Swiper\n className=\"flex items-center justify-between\"\n onSwiper={setThumbsSwiper}\n spaceBetween={12}\n slidesPerView={6}\n freeMode={true}\n watchSlidesProgress={true}\n modules={[Navigation, Thumbs]}\n >\n {props?.galleries?.map((item, jIndex) => (\n <SwiperSlide\n key={props?.id + 'SwiperSlideThumbItem' + jIndex}\n className=\"!w-auto [&.swiper-slide-thumb-active]:border [&.swiper-slide-thumb-active]:rounded [&.swiper-slide-thumb-active]:border-brand\"\n >\n <Picture\n source={item.image?.url}\n alt={item.image?.altText}\n className=\"size-10 lg-desktop:size-12 overflow-hidden bg-white rounded\"\n imgClassName=\"object-contain h-full\"\n />\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n {!props?.index && (\n <div className=\"flex items-center gap-2\">\n <Picture\n source={props?.comment?.avatar?.url}\n className=\"size-8 laptop:size-10 rounded-full shrink-0\"\n imgClassName=\"object-cover \"\n />\n <Text\n html={props?.comment?.content}\n className=\"text-sm lg-desktop:text-base max-w-[528px] font-bold text-[#1D1D1F] line-clamp-2\"\n />\n </div>\n )}\n </div>\n <div ref={paginationRef} className=\"tablet:hidden text-center absolute !bottom-[70px] left-4 right-4 z-10\" />\n </div>\n )\n})\n\nconst ProductGalleryTabVideo = (props: ProductGalleryTabItemProps) => {\n return (\n <div className=\"h-full [&_.swiper-button]:hover:opacity-100\">\n <Swiper\n className=\"h-full\"\n navigation={{\n nextEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-next`,\n prevEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-prev`,\n }}\n modules={[Mousewheel, Thumbs, Navigation, Pagination]}\n mousewheel={{\n forceToAxis: true,\n }}\n breakpoints={{\n 0: {\n slidesPerView: 1,\n freeMode: false,\n },\n }}\n >\n {props?.galleries?.map((item, jIndex) => {\n return (\n <SwiperSlide className=\"h-full\" key={props?.id + 'SwiperSlideItem' + jIndex}>\n <video controls className=\"size-full\">\n <track kind=\"captions\" />\n <source src={item?.sources?.[0]?.url} type=\"video/mp4\" />\n <source src={item?.sources?.[0]?.url} type=\"video/webm\" />\n <source src={item?.sources?.[0]?.url} type=\"video/ogg\" />\n </video>\n </SwiperSlide>\n )\n })}\n </Swiper>\n <div\n className={cn(\n 'hidden swiper-button tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:left-6 z-10 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-${props?.id}-custom-swiper-button-prev`\n )}\n >\n <SwiperLeftButtonIcon className=\"tablet:size-10 lg-desktop:size-12\" />\n </div>\n <div\n className={cn(\n 'hidden tablet:block swiper-button tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:right-6 z-10 -translate-y-1/2 cursor-pointer',\n `ipc-product-gallery-${props?.id}-custom-swiper-button-next`\n )}\n >\n <SwiperRightButtonIcon className=\"tablet:size-10 lg-desktop:size-12\" />\n </div>\n </div>\n )\n}\n\nconst ProductGalleryTab3DView = (props: ProductGalleryTabItemProps) => {\n return <div>3D View</div>\n}\n\nexport default ProductGallery\n"],
5
+ "mappings": "AA8BI,OA6OM,YAAAA,GA5OJ,OAAAC,EADF,QAAAC,MAAA,oBA9BJ,OAAS,kBAAAC,MAAsB,oCAC/B,OAAS,QAAAC,EAAM,WAAAC,EAAiB,SAAA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sB,UAAU,oCAAoC,EACvE,GACF,EAIE4C,GAA2B7C,GACxB5B,EAAC,OAAI,mBAAO,EAGrB,IAAO0E,GAAQ5C",
6
6
  "names": ["Fragment", "jsx", "jsxs", "useAiuiContext", "Text", "Picture", "Badge", "useMemo", "useState", "forwardRef", "useRef", "Swiper", "SwiperSlide", "Navigation", "Mousewheel", "Thumbs", "Pagination", "cn", "GalleryTabType", "Content", "List", "Root", "Trigger", "useBizProductContext", "useVariantMedia", "SpecsModal", "CompareModal", "formatPrice", "SwiperLeftButtonIcon", "props", "SwiperRightButtonIcon", "ProductGallery", "copyWriting", "product", "variant", "selectedOptions", "defaultMediaData", "swiper", "setSwiper", "customMediaList", "productList", "sceneList", "keyFeaturesList", "videoList", "allMedia", "galleryMap", "galleryTabs", "item", "gallerySwiperRefs", "activeGalleryTab", "setActiveGalleryTab", "renderGalleryForTab", "tab", "index", "ProductGalleryTabImage", "ProductGalleryTabVideo", "ProductGalleryTab", "scrollContainerRef", "el", "container", "button", "scrollLeft", "ref", "locale", "totalSavings", "paginationRef", "thumbsSwiper", "setThumbsSwiper", "isStart", "setStart", "isEnd", "setEnd", "imageClassName", "jIndex", "ProductGalleryTab3DView", "ProductGallery_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as a}from"react/jsx-runtime";import{Text as s,Button as P,Grid as H,GridItem as j,Picture as B,Heading as M}from"../../../../../components";import{useBizProductContext as C}from"../../../BizProductProvider";import{useEffect as W,useMemo as G,useState as J}from"react";import{formatPrice as g}from"../../../utils";import{useAiuiContext as z}from"../../../../AiuiProvider";import"../../../../../helpers";import E from"decimal.js";const q=({})=>{const{locale:r="us",copyWriting:t}=z(),{product:d,variant:o,finalPrice:p,comparePrice:x,coupon:h,selectedOptions:i,selectedVariants:u,totalSavings:y,onAddToCart:R,onBuyNow:D,savingDetail:k,checkedBundle:w,joinedRecommendBuyProducts:n,setJoinedRecommendBuyProducts:b}=C(),[m,f]=J({bundle:!1,gift:!1,exchange:!1}),[N]=u,O=G(()=>{const[c]=w?.variants||[],T=new E(N?.price?.amount||0).minus(c?.price||N?.price?.amount).toNumber();return new E(N?.price?.amount||0).minus(k?.coupon).minus(T).toNumber()},[N,y,w]);if(!o.availableForSale)return null;const{bundleVariant:F,giftVariant:V,exchangeVariant:I}=K()||{},[l,v]=J();W(()=>{v({bundle:n.bundle?void 0:F,gift:n.gift?void 0:V,exchange:n.exchange?void 0:I})},[F,V,n]);const $=G(()=>new E(x).minus(k.freeGift).toNumber(),[x,k]);return e("div",{className:"ipc-product-summary laptop:px-16 desktop:px-0 mt-8 desktop:mt-16",children:e("div",{className:"bg-[#F5F5F7] laptop:rounded-2xl",children:a(H,{className:"px-4 py-6 tablet:p-8",children:[a(j,{className:"col-span-12 laptop:col-start-1 laptop:col-span-5",children:[e(M,{className:"font-bold text-[24px] lg-desktop:text-[48px] laptop:text-[32px] desktop:text-[40px] leading-[1] mb-4 [&>span]:text-[#D1D1D1]",html:`${d.title} is ready <br/><span>Just the way you want it.</span>`}),e("div",{className:"aspect-[644/320]",children:e(B,{source:o.image?.url||d?.images?.[0]?.url,className:"h-full w-full",imgClassName:"object-contain h-full"})})]}),a(j,{className:"col-span-12 mt-8 laptop:col-start-7 laptop:mt-0 laptop:col-span-6 flex flex-col gap-6 justify-between",children:[a("div",{children:[a("div",{className:"flex flex-col gap-4",children:[a("div",{className:"flex items-center justify-between",children:[a("div",{className:"shrink-0 flex items-center gap-4",children:[e(B,{source:o.image?.url||d?.images?.[0]?.url,className:"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg"}),a("div",{className:"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none",children:[e(s,{className:"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]",html:d.title}),e(s,{className:"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]",html:`x1 | ${i.color||i.colour||i.couleur}`})]})]}),a("div",{className:"flex items-center gap-1",children:[e(s,{className:"text-base desktop:text-2xl font-bold",html:g({amount:O,currencyCode:o.price.currencyCode,locale:r})}),y>0&&e(s,{className:"text-base desktop:text-2xl laptop:text-xl font-bold line-through text-[#6D6D6F]",html:g({amount:o?.price?.amount,currencyCode:o.price.currencyCode,locale:r})})]})]}),n?.gift&&e(A,{giftOperation:c=>{b?.({...n,gift:void 0}),v?.({...l,gift:c})},status:!!n?.gift,gift:n?.gift,currentJoinedRecommendBuyProducts:m?.gift}),n?.bundle&&e(S,{bundleOperation:c=>{b?.({...n,bundle:void 0}),v?.({...l,bundle:c})},status:!!n?.bundle,bundleListItem:n?.bundle,currentJoinedRecommendBuyProducts:m?.bundle}),n?.exchange&&e(L,{exchangeOperation:c=>{b?.({...n,exchange:void 0}),v?.({...l,exchange:c})},status:!!n?.exchange,currentJoinedRecommendBuyProducts:m?.exchange,exchange:n?.exchange})]}),(l?.bundle||l?.gift||l?.exchange)&&a("div",{className:"mt-6",children:[e(s,{className:"text-sm desktop:text-[18px] font-bold",html:"Recommend Buy"}),a("div",{className:"flex flex-col gap-6 mt-6",children:[l?.exchange&&e(L,{exchangeOperation:c=>{b?.({exchange:c}),f({...m,exchange:!1}),v?.({...l,exchange:void 0})},currentJoinedRecommendBuyProducts:m?.exchange,status:!l?.exchange,exchange:l?.exchange}),l?.bundle&&e(S,{bundleOperation:c=>{b?.({bundle:c}),f({...m,bundle:!1}),v?.({...l,bundle:void 0})},currentJoinedRecommendBuyProducts:m?.bundle,status:!l?.bundle,bundleListItem:l?.bundle}),l?.gift&&e(A,{giftOperation:c=>{b?.({gift:c}),f({...m,gift:!1}),v?.({...l,gift:void 0})},currentJoinedRecommendBuyProducts:m?.gift,status:!l?.gift,gift:l?.gift})]})]})]}),a("div",{className:"text-right",children:[e(s,{className:"laptop:text-xl desktop:text-2xl font-bold text-right",html:`${t?.totalPrice} ${g({amount:p,currencyCode:o.price.currencyCode,locale:r})}`}),y>0&&e(s,{className:"text-base laptop:text-xl desktop:text-2xl ml-1 font-bold line-through text-[#6D6D6F]",html:g({amount:$,currencyCode:o.price.currencyCode,locale:r})}),a("div",{className:"flex gap-3 mt-2 justify-end",children:[e(P,{size:"lg",variant:"secondary",className:"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto",onClick:()=>R?.(),children:t?.addToCart}),e(P,{size:"lg",variant:"primary",className:"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto",onClick:()=>D?.(),children:t?.shopNow})]})]})]})]})})})},K=()=>{const{bundle:r,variant:t,checkedBundle:d,freeGift:o,checkedGift:p,exchangePurchase:x,checkedExchangePurchase:h}=C();let i,u,y;const{bundleList:R}=r||{},{giftList:D=[]}=o||{},{giftList:k=[]}=x||{},w=R?.filter(f=>f.variants.slice(1,f.variants.length).every(N=>N.variant.availableForSale))||[],[n]=w;i=d||n;const[b]=D?.filter(f=>f.availableForSale);u=p||b;const[m]=k?.filter(f=>f.availableForSale);return y=h||m,{bundleVariant:i,giftVariant:u,exchangeVariant:y}},S=({bundleOperation:r,bundleListItem:t,currentJoinedRecommendBuyProducts:d,status:o})=>{const{locale:p="us"}=z(),{variant:x,setCheckedBundle:h}=C(),i=t?.variants.filter(u=>u.variant.sku!==x.sku);return a("div",{className:"flex items-center justify-between",children:[i?.map(u=>a("div",{className:"flex items-center gap-4",children:[e(B,{source:u?.variant?.image?.url,className:"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg"}),e("div",{className:"flex flex-col gap-[6px] line-clamp-2 max-w-[178px] tablet:max-w-none",children:e(s,{className:"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]",html:u.variant.product.title})})]},u.variant.id)),a("div",{className:"flex flex-col items-end gap-1 justify-center",children:[!!t&&e(s,{className:"text-base desktop:text-2xl font-bold",html:g({amount:i[0]?.price,locale:p,currencyCode:i[0]?.variant?.price?.currencyCode})}),!d&&e(P,{size:"icon",variant:"link",onClick:()=>{h?.(o?void 0:t),r(t)},className:"shrink-0 size-auto underline",children:o?"Remove":"Add"})]})]})},A=({giftOperation:r,gift:t,currentJoinedRecommendBuyProducts:d,status:o})=>{const{locale:p="us"}=z(),{freeGift:x,setCheckedGift:h}=C(),{freeLabel:i,count:u}=x||{};return a("div",{className:"flex items-center justify-between",children:[a("div",{className:"flex items-center gap-4",children:[e(B,{source:t?.image?.url,className:"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg"}),a("div",{className:"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none",children:[e(s,{className:"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]",html:t?.product?.title}),e(s,{className:"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]",html:`x${u} | ${i}`})]})]}),a("div",{className:"flex flex-col items-end gap-2 justify-center",children:[!!t&&a("div",{className:"flex items-center gap-1",children:[e(s,{className:"text-base desktop:text-2xl font-bold",html:i}),e(s,{className:"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]",html:g({amount:t.price.amount,locale:p,currencyCode:t.price.currencyCode})})]}),d&&e(P,{size:"icon",variant:"link",onClick:()=>{h?.(o?void 0:t),r(t)},className:"shrink-0 size-auto underline",children:o?"Remove":"Add"})]})]})},L=({exchangeOperation:r,exchange:t,currentJoinedRecommendBuyProducts:d,status:o})=>{const{locale:p="us"}=z(),{setCheckedExchangePurchase:x}=C();return a("div",{className:"flex items-center justify-between",children:[a("div",{className:"flex items-center gap-4",children:[e(B,{source:t?.image?.url,className:"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg"}),a("div",{className:"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none",children:[e(s,{className:"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]",html:t?.product?.title}),e(s,{className:"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]"})]})]}),a("div",{className:"flex flex-col items-end gap-2 justify-center",children:[!!t&&a("div",{className:"flex items-center gap-1",children:[e(s,{className:"text-base desktop:text-2xl font-bold",html:g({amount:t.finalPrice?.amount||0,locale:p,currencyCode:t.price.currencyCode})}),e(s,{className:"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]",html:g({amount:t.price?.amount||0,locale:p,currencyCode:t.price.currencyCode})})]}),d&&e(P,{size:"icon",variant:"link",onClick:()=>{x?.(o?void 0:t),r(t)},className:"shrink-0 size-auto underline",children:o?"Remove":"Add"})]})]})};var ne=q;export{ne as default};
1
+ import{jsx as e,jsxs as n}from"react/jsx-runtime";import{Text as i,Button as y,Grid as M,GridItem as S,Picture as P,Heading as W}from"../../../../../components";import{useBizProductContext as O}from"../../../BizProductProvider";import{useEffect as q,useMemo as A,useState as K}from"react";import{formatPrice as v}from"../../../utils";import{useAiuiContext as z}from"../../../../AiuiProvider";import"../../../../../helpers";import F from"decimal.js";const Q=({})=>{const{locale:d="us",copyWriting:t}=z(),{product:c,variant:l,finalPrice:p,comparePrice:m,coupon:b,selectedOptions:s,selectedVariants:u,totalSavings:h,onAddToCart:D,onBuyNow:E,savingDetail:N,checkedBundle:C,joinedRecommendBuyProducts:a,setJoinedRecommendBuyProducts:f,setCheckedGift:w,setCheckedExchangePurchase:x,setCheckedBundle:k,setSavingDetail:$}=O(),[B]=u,T=A(()=>{const[r]=C?.variants||[],H=new F(B?.price?.amount||0).minus(r?.price||B?.price?.amount).toNumber();return new F(B?.price?.amount||0).minus(N?.coupon).minus(H).toNumber()},[B,h,C]);if(!l.availableForSale)return null;const{bundleVariant:V,giftVariant:j,exchangeVariant:G}=U()||{},[o,g]=K();q(()=>{g({bundle:a.bundle?.value?void 0:V,gift:a.gift?.value?void 0:j,exchange:a.exchange?.value?void 0:G})},[V,j,G,a]);const J=A(()=>new F(m).minus(N.freeGift).toNumber(),[m,N]);return e("div",{className:"ipc-product-summary laptop:px-16 desktop:px-0 mt-16 desktop:mt-[96px] lg-desktop:mt-[128px]",children:e("div",{className:"bg-[#F5F5F7] laptop:rounded-2xl",children:n(M,{className:"px-4 py-6 tablet:p-8",children:[n(S,{className:"col-span-12 laptop:col-start-1 laptop:col-span-5",children:[e(W,{className:"font-bold text-[24px] lg-desktop:text-[48px] laptop:text-[32px] desktop:text-[40px] leading-[1] mb-4 [&>span]:text-[#D1D1D1]",html:`${c.title} is ready <br/><span>Just the way you want it.</span>`}),e("div",{className:"aspect-[644/320]",children:e(P,{source:l.image?.url||c?.images?.[0]?.url,className:"h-full w-full",imgClassName:"object-contain h-full"})})]}),n(S,{className:"col-span-12 mt-8 laptop:col-start-7 laptop:mt-0 laptop:col-span-6 flex flex-col gap-6 justify-between",children:[n("div",{children:[n("div",{className:"flex flex-col gap-4",children:[n("div",{className:"flex items-center justify-between",children:[n("div",{className:"shrink-0 flex items-center gap-4",children:[e(P,{source:l.image?.url||c?.images?.[0]?.url,className:"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg"}),n("div",{className:"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none",children:[e(i,{className:"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]",html:c.title}),e(i,{className:"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]",html:`x1 | ${s.color||s.colour||s.couleur}`})]})]}),n("div",{className:"flex items-center gap-1",children:[e(i,{className:"text-base desktop:text-2xl font-bold",html:v({amount:T,currencyCode:l.price.currencyCode,locale:d})}),h>0&&e(i,{className:"text-base desktop:text-2xl laptop:text-xl font-bold line-through text-[#6D6D6F]",html:v({amount:l?.price?.amount,currencyCode:l.price.currencyCode,locale:d})})]})]}),a?.gift?.value&&e(R,{giftOperation:r=>{w?.(void 0),f?.({...a,gift:{value:void 0,canOperate:!0}}),g?.({...o,gift:r})},status:!!a?.gift,gift:a?.gift?.value,canOperate:a?.gift?.canOperate}),a?.bundle?.value&&e(L,{bundleOperation:r=>{k?.(void 0),f?.({...a,bundle:{value:void 0,canOperate:!0}}),g?.({...o,bundle:r})},status:!!a?.bundle,bundleListItem:a?.bundle?.value,canOperate:a?.bundle?.canOperate}),a?.exchange?.value&&e(I,{exchangeOperation:r=>{x?.(void 0),f?.({...a,exchange:{value:void 0,canOperate:!0}}),g?.({...o,exchange:r})},status:!!a?.exchange,canOperate:a?.exchange?.canOperate,exchange:a?.exchange?.value})]}),(o?.bundle||o?.gift||o?.exchange)&&n("div",{className:"mt-6",children:[e(i,{className:"text-sm desktop:text-[18px] font-bold",html:"Recommend Buy"}),n("div",{className:"flex flex-col gap-6 mt-6",children:[o?.exchange&&e(I,{exchangeOperation:r=>{k?.(void 0),f?.({bundle:{value:void 0,canOperate:!0},gift:{value:a?.gift?.value,canOperate:!0},exchange:{value:r,canOperate:!0}}),g?.({...o,exchange:void 0})},canOperate:a?.exchange?.canOperate,status:!o?.exchange,exchange:o?.exchange}),o?.bundle&&e(L,{bundleOperation:r=>{w?.(void 0),x?.(void 0),$?.({...N,exchangePurchase:0}),f?.({gift:{value:void 0,canOperate:!0},exchange:{value:void 0,canOperate:!0},bundle:{value:r,canOperate:!0}}),g?.({...o,bundle:void 0})},canOperate:a?.bundle?.canOperate,status:!o?.bundle,bundleListItem:o?.bundle}),o?.gift&&e(R,{giftOperation:r=>{k?.(void 0),f?.({bundle:{value:void 0,canOperate:!0},exchange:{value:a?.exchange?.value,canOperate:!0},gift:{value:r,canOperate:!0}}),g?.({...o,gift:void 0})},canOperate:a?.gift?.canOperate,status:!o?.gift,gift:o?.gift})]})]})]}),n("div",{className:"text-right",children:[e(i,{className:"laptop:text-xl desktop:text-2xl font-bold text-right",html:`${t?.totalPrice} ${v({amount:p,currencyCode:l.price.currencyCode,locale:d})}`}),h>0&&e(i,{className:"text-base laptop:text-xl desktop:text-2xl ml-1 font-bold line-through text-[#6D6D6F]",html:v({amount:J,currencyCode:l.price.currencyCode,locale:d})}),n("div",{className:"flex gap-3 mt-2 justify-end",children:[e(y,{size:"lg",variant:"secondary",className:"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto",onClick:()=>D?.(),children:t?.addToCart}),e(y,{size:"lg",variant:"primary",className:"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto",onClick:()=>E?.(),children:t?.shopNow})]})]})]})]})})})},U=()=>{const{bundle:d,variant:t,checkedBundle:c,freeGift:l,checkedGift:p,exchangePurchase:m,checkedExchangePurchase:b}=O();let s,u,h;const{bundleList:D}=d||{},{giftList:E=[]}=l||{},{giftList:N=[]}=m||{},C=D?.filter(x=>x.variants.slice(1,x.variants.length).every(k=>k.variant.availableForSale))||[],[a]=C;s=c||a;const[f]=E?.filter(x=>x.availableForSale);u=p||f;const[w]=N?.filter(x=>x.availableForSale);return h=b||w,{bundleVariant:s,giftVariant:u,exchangeVariant:h}},L=({bundleOperation:d,bundleListItem:t,canOperate:c,status:l})=>{const{locale:p="us"}=z(),{variant:m,setCheckedBundle:b}=O(),s=t?.variants.filter(u=>u.variant.sku!==m.sku);return n("div",{className:"flex items-center justify-between",children:[s?.map(u=>n("div",{className:"flex items-center gap-4",children:[e(P,{source:u?.variant?.image?.url,className:"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg"}),e("div",{className:"flex flex-col gap-[6px] line-clamp-2 max-w-[178px] tablet:max-w-none",children:e(i,{className:"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]",html:u.variant.product.title})})]},u.variant.id)),n("div",{className:"flex flex-col items-end gap-1 justify-center",children:[!!t&&e(i,{className:"text-base desktop:text-2xl font-bold",html:v({amount:s?.[0]?.price||0,locale:p,currencyCode:s?.[0]?.variant?.price?.currencyCode||""})}),c&&e(y,{size:"icon",variant:"link",onClick:()=>{b?.(l?void 0:t),d?.(t)},className:"shrink-0 size-auto underline",children:l?"Remove":"Add"})]})]})},R=({giftOperation:d,gift:t,status:c,canOperate:l})=>{const{locale:p="us"}=z(),{freeGift:m,setCheckedGift:b}=O(),{freeLabel:s,count:u}=m||{};return n("div",{className:"flex items-center justify-between",children:[n("div",{className:"flex items-center gap-4",children:[e(P,{source:t?.image?.url,className:"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg"}),n("div",{className:"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none",children:[e(i,{className:"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]",html:t?.product?.title}),e(i,{className:"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]",html:`x${u} | ${s}`})]})]}),n("div",{className:"flex flex-col items-end gap-2 justify-center",children:[!!t&&n("div",{className:"flex items-center gap-1",children:[e(i,{className:"text-base desktop:text-2xl font-bold",html:s}),e(i,{className:"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]",html:v({amount:t.price.amount,locale:p,currencyCode:t.price.currencyCode})})]}),l&&e(y,{size:"icon",variant:"link",onClick:()=>{b?.(c?void 0:t),d(t)},className:"shrink-0 size-auto underline",children:c?"Remove":"Add"})]})]})},I=({exchangeOperation:d,exchange:t,canOperate:c,status:l})=>{const{locale:p="us"}=z(),{setCheckedExchangePurchase:m}=O();return n("div",{className:"flex items-center justify-between",children:[n("div",{className:"flex items-center gap-4",children:[e(P,{source:t?.image?.url,className:"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg"}),n("div",{className:"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none",children:[e(i,{className:"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]",html:t?.product?.title}),e(i,{className:"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]"})]})]}),n("div",{className:"flex flex-col items-end gap-2 justify-center",children:[!!t&&n("div",{className:"flex items-center gap-1",children:[e(i,{className:"text-base desktop:text-2xl font-bold",html:v({amount:t.finalPrice?.amount||0,locale:p,currencyCode:t.price.currencyCode})}),e(i,{className:"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]",html:v({amount:t.price?.amount||0,locale:p,currencyCode:t.price.currencyCode})})]}),c&&e(y,{size:"icon",variant:"link",onClick:()=>{m?.(l?void 0:t),d(t)},className:"shrink-0 size-auto underline",children:l?"Remove":"Add"})]})]})};var ie=Q;export{ie as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/biz-components/Listing/components/ProductCard/ProductSummary/index.tsx"],
4
- "sourcesContent": ["import { Text, Button, Container, Grid, GridItem, Picture, Heading } from '../../../../../components'\nimport type { ProductSummaryProps } from './types'\nimport { useBizProductContext } from '../../../BizProductProvider'\nimport { useEffect, useMemo, useState } from 'react'\nimport { formatPrice } from '../../../utils'\nimport { useAiuiContext } from '../../../../AiuiProvider'\nimport type { BundleListItem, ProductVariant, ProductPrice } from '../../../types/product'\nimport { cn } from '../../../../../helpers'\nimport Decimal from 'decimal.js'\n\nconst ProductSummary = ({}: ProductSummaryProps) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const {\n product,\n variant,\n finalPrice,\n comparePrice,\n coupon,\n selectedOptions,\n selectedVariants,\n totalSavings,\n onAddToCart,\n onBuyNow,\n savingDetail,\n checkedBundle,\n joinedRecommendBuyProducts,\n setJoinedRecommendBuyProducts,\n } = useBizProductContext()\n\n const [currentJoinedRecommendBuyProducts, setCurrentJoinedRecommendBuyProducts] = useState<{\n bundle?: boolean\n gift?: boolean\n exchange?: boolean\n }>({\n bundle: false,\n gift: false,\n exchange: false,\n })\n\n const [currentProductVariant] = selectedVariants\n\n const summaryFinalPrice = useMemo(() => {\n const [currentBundleVariant] = checkedBundle?.variants || []\n const currentBundlePrice = new Decimal(currentProductVariant?.price?.amount || 0)\n .minus(currentBundleVariant?.price || currentProductVariant?.price?.amount)\n .toNumber()\n return new Decimal(currentProductVariant?.price?.amount || 0)\n .minus(savingDetail?.coupon)\n .minus(currentBundlePrice)\n .toNumber()\n }, [currentProductVariant, totalSavings, checkedBundle])\n\n const isAvailable = variant.availableForSale\n if (!isAvailable) return null\n\n const { bundleVariant, giftVariant, exchangeVariant } = useRecommendBuyProducts() || {}\n const [initialRecommendBuyProducts, setInitialRecommendBuyProducts] = useState<{\n bundle?: BundleListItem\n gift?: ProductVariant\n exchange?: ProductVariant\n }>()\n\n useEffect(() => {\n setInitialRecommendBuyProducts({\n bundle: joinedRecommendBuyProducts.bundle ? undefined : bundleVariant,\n gift: joinedRecommendBuyProducts.gift ? undefined : giftVariant,\n exchange: joinedRecommendBuyProducts.exchange ? undefined : exchangeVariant,\n })\n }, [bundleVariant, giftVariant, joinedRecommendBuyProducts])\n\n const comparePriceRemovedFreeGift = useMemo(\n () => new Decimal(comparePrice).minus(savingDetail.freeGift).toNumber(),\n [comparePrice, savingDetail]\n )\n\n return (\n <div className=\"ipc-product-summary laptop:px-16 desktop:px-0 mt-8 desktop:mt-16\">\n <div className=\"bg-[#F5F5F7] laptop:rounded-2xl\">\n <Grid className=\"px-4 py-6 tablet:p-8\">\n <GridItem className=\"col-span-12 laptop:col-start-1 laptop:col-span-5\">\n <Heading\n className=\"font-bold text-[24px] lg-desktop:text-[48px] laptop:text-[32px] desktop:text-[40px] leading-[1] mb-4 [&>span]:text-[#D1D1D1]\"\n html={`${product.title} is ready <br/><span>Just the way you want it.</span>`}\n />\n <div className=\"aspect-[644/320]\">\n <Picture\n source={variant.image?.url || product?.images?.[0]?.url}\n className=\"h-full w-full\"\n imgClassName=\"object-contain h-full\"\n />\n </div>\n </GridItem>\n <GridItem className=\"col-span-12 mt-8 laptop:col-start-7 laptop:mt-0 laptop:col-span-6 flex flex-col gap-6 justify-between\">\n <div>\n <div className=\"flex flex-col gap-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"shrink-0 flex items-center gap-4\">\n <Picture\n source={variant.image?.url || product?.images?.[0]?.url}\n className=\"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg\"\n />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]\"\n html={product.title}\n />\n <Text\n className=\"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]\"\n html={`x1 | ${selectedOptions.color || selectedOptions.colour || selectedOptions.couleur}`}\n />\n </div>\n </div>\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"text-base desktop:text-2xl font-bold\"\n html={formatPrice({\n amount: summaryFinalPrice,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n {totalSavings > 0 && (\n <Text\n className=\"text-base desktop:text-2xl laptop:text-xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: variant?.price?.amount,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n </div>\n </div>\n {joinedRecommendBuyProducts?.gift && (\n <ProductGiftSummary\n giftOperation={gift => {\n setJoinedRecommendBuyProducts?.({ ...joinedRecommendBuyProducts, gift: undefined })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift })\n }}\n status={!!joinedRecommendBuyProducts?.gift}\n gift={joinedRecommendBuyProducts?.gift}\n currentJoinedRecommendBuyProducts={currentJoinedRecommendBuyProducts?.gift}\n />\n )}\n {joinedRecommendBuyProducts?.bundle && (\n <ProductBundleSummary\n bundleOperation={bundle => {\n setJoinedRecommendBuyProducts?.({ ...joinedRecommendBuyProducts, bundle: undefined })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle })\n }}\n status={!!joinedRecommendBuyProducts?.bundle}\n bundleListItem={joinedRecommendBuyProducts?.bundle}\n currentJoinedRecommendBuyProducts={currentJoinedRecommendBuyProducts?.bundle}\n />\n )}\n {joinedRecommendBuyProducts?.exchange && (\n <ProductExchangeSummary\n exchangeOperation={exchange => {\n setJoinedRecommendBuyProducts?.({ ...joinedRecommendBuyProducts, exchange: undefined })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, exchange })\n }}\n status={!!joinedRecommendBuyProducts?.exchange}\n currentJoinedRecommendBuyProducts={currentJoinedRecommendBuyProducts?.exchange}\n exchange={joinedRecommendBuyProducts?.exchange}\n />\n )}\n </div>\n {(initialRecommendBuyProducts?.bundle ||\n initialRecommendBuyProducts?.gift ||\n initialRecommendBuyProducts?.exchange) && (\n <div className=\"mt-6\">\n <Text className=\"text-sm desktop:text-[18px] font-bold\" html={'Recommend Buy'} />\n <div className=\"flex flex-col gap-6 mt-6\">\n {initialRecommendBuyProducts?.exchange && (\n <ProductExchangeSummary\n exchangeOperation={exchange => {\n setJoinedRecommendBuyProducts?.({ exchange })\n setCurrentJoinedRecommendBuyProducts({ ...currentJoinedRecommendBuyProducts, exchange: false })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, exchange: undefined })\n }}\n currentJoinedRecommendBuyProducts={currentJoinedRecommendBuyProducts?.exchange}\n status={!initialRecommendBuyProducts?.exchange}\n exchange={initialRecommendBuyProducts?.exchange}\n />\n )}\n {initialRecommendBuyProducts?.bundle && (\n <ProductBundleSummary\n bundleOperation={bundle => {\n setJoinedRecommendBuyProducts?.({ bundle })\n setCurrentJoinedRecommendBuyProducts({ ...currentJoinedRecommendBuyProducts, bundle: false })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle: undefined })\n }}\n currentJoinedRecommendBuyProducts={currentJoinedRecommendBuyProducts?.bundle}\n status={!initialRecommendBuyProducts?.bundle}\n bundleListItem={initialRecommendBuyProducts?.bundle}\n />\n )}\n {initialRecommendBuyProducts?.gift && (\n <ProductGiftSummary\n giftOperation={gift => {\n setJoinedRecommendBuyProducts?.({ gift })\n setCurrentJoinedRecommendBuyProducts({ ...currentJoinedRecommendBuyProducts, gift: false })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift: undefined })\n }}\n currentJoinedRecommendBuyProducts={currentJoinedRecommendBuyProducts?.gift}\n status={!initialRecommendBuyProducts?.gift}\n gift={initialRecommendBuyProducts?.gift}\n />\n )}\n </div>\n </div>\n )}\n </div>\n <div className=\"text-right\">\n <Text\n className=\"laptop:text-xl desktop:text-2xl font-bold text-right\"\n html={`${copyWriting?.totalPrice} ${formatPrice({ amount: finalPrice, currencyCode: variant.price.currencyCode, locale })}`}\n />\n\n {totalSavings > 0 && (\n <Text\n className=\"text-base laptop:text-xl desktop:text-2xl ml-1 font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: comparePriceRemovedFreeGift,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n <div className=\"flex gap-3 mt-2 justify-end\">\n <Button\n size=\"lg\"\n variant=\"secondary\"\n className=\"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto\"\n onClick={() => onAddToCart?.()}\n >\n {copyWriting?.addToCart}\n </Button>\n <Button\n size=\"lg\"\n variant=\"primary\"\n className=\"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto\"\n onClick={() => onBuyNow?.()}\n >\n {copyWriting?.shopNow}\n </Button>\n </div>\n </div>\n </GridItem>\n </Grid>\n </div>\n </div>\n )\n}\n\nconst useRecommendBuyProducts = () => {\n const { bundle, variant, checkedBundle, freeGift, checkedGift, exchangePurchase, checkedExchangePurchase } =\n useBizProductContext()\n let bundleVariant = undefined\n let giftVariant = undefined\n let exchangeVariant = undefined\n const { bundleList } = bundle || {}\n\n const { giftList = [] } = freeGift || {}\n const { giftList: exchangeList = [] } = exchangePurchase || {}\n\n const availableBundleList =\n bundleList?.filter(bundle =>\n bundle.variants.slice(1, bundle.variants.length).every(v => v.variant.availableForSale)\n ) || []\n\n const [firstAvailableBundle] = availableBundleList\n bundleVariant = checkedBundle || firstAvailableBundle\n\n const [firstAvailableGift] = giftList?.filter(gift => gift.availableForSale)\n giftVariant = checkedGift || firstAvailableGift\n\n const [firstAvailableExchange] = exchangeList?.filter(exchange => exchange.availableForSale)\n exchangeVariant = checkedExchangePurchase || firstAvailableExchange\n\n return { bundleVariant, giftVariant, exchangeVariant }\n}\n\nconst ProductBundleSummary = ({\n bundleOperation,\n bundleListItem,\n currentJoinedRecommendBuyProducts,\n status,\n}: {\n bundleOperation: (bundle: BundleListItem) => void\n bundleListItem: BundleListItem\n currentJoinedRecommendBuyProducts?: boolean\n status?: boolean\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const { variant, setCheckedBundle } = useBizProductContext()\n const bundleVariants = bundleListItem?.variants.filter(v => v.variant.sku !== variant.sku)\n\n return (\n <div className=\"flex items-center justify-between\">\n {bundleVariants?.map(bundleVariant => {\n return (\n <div className=\"flex items-center gap-4\" key={bundleVariant.variant.id}>\n <Picture\n source={bundleVariant?.variant?.image?.url}\n className=\"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg\"\n />\n <div className=\"flex flex-col gap-[6px] line-clamp-2 max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]\"\n html={bundleVariant.variant.product.title}\n />\n </div>\n </div>\n )\n })}\n <div className=\"flex flex-col items-end gap-1 justify-center\">\n {!!bundleListItem && (\n <Text\n className=\"text-base desktop:text-2xl font-bold\"\n html={formatPrice({\n amount: bundleVariants[0]?.price,\n locale,\n currencyCode: bundleVariants[0]?.variant?.price?.currencyCode,\n })}\n />\n )}\n {!currentJoinedRecommendBuyProducts && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedBundle?.(status ? undefined : bundleListItem)\n bundleOperation(bundleListItem)\n }}\n className=\"shrink-0 size-auto underline\"\n >\n {!!status ? 'Remove' : 'Add'}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nconst ProductGiftSummary = ({\n giftOperation,\n gift,\n currentJoinedRecommendBuyProducts,\n status,\n}: {\n giftOperation: (gift: ProductVariant) => void\n gift: ProductVariant\n currentJoinedRecommendBuyProducts?: boolean\n status?: boolean\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const { freeGift, setCheckedGift } = useBizProductContext()\n const { freeLabel, count } = freeGift || {}\n\n return (\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={gift?.image?.url}\n className=\"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg\"\n />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]\"\n html={gift?.product?.title}\n />\n <Text\n className=\"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]\"\n html={`x${count} | ${freeLabel}`}\n />\n </div>\n </div>\n <div className=\"flex flex-col items-end gap-2 justify-center\">\n {!!gift && (\n <div className=\"flex items-center gap-1\">\n <Text className=\"text-base desktop:text-2xl font-bold\" html={freeLabel} />\n <Text\n className=\"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n )}\n {currentJoinedRecommendBuyProducts && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedGift?.(status ? undefined : gift)\n giftOperation(gift)\n }}\n className=\"shrink-0 size-auto underline\"\n >\n {status ? 'Remove' : 'Add'}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nconst ProductExchangeSummary = ({\n exchangeOperation,\n exchange,\n currentJoinedRecommendBuyProducts,\n status,\n}: {\n exchangeOperation: (exchange: ProductVariant) => void\n exchange: ProductVariant & { finalPrice?: ProductPrice }\n currentJoinedRecommendBuyProducts?: boolean\n status?: boolean\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const { setCheckedExchangePurchase } = useBizProductContext()\n\n return (\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={exchange?.image?.url}\n className=\"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg\"\n />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]\"\n html={exchange?.product?.title}\n />\n <Text className=\"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]\" />\n </div>\n </div>\n <div className=\"flex flex-col items-end gap-2 justify-center\">\n {!!exchange && (\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"text-base desktop:text-2xl font-bold\"\n html={formatPrice({\n amount: exchange.finalPrice?.amount || 0,\n locale,\n currencyCode: exchange.price.currencyCode,\n })}\n />\n <Text\n className=\"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: exchange.price?.amount || 0,\n locale,\n currencyCode: exchange.price.currencyCode,\n })}\n />\n </div>\n )}\n {currentJoinedRecommendBuyProducts && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedExchangePurchase?.(status ? undefined : exchange)\n exchangeOperation(exchange)\n }}\n className=\"shrink-0 size-auto underline\"\n >\n {status ? 'Remove' : 'Add'}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nexport default ProductSummary\n"],
5
- "mappings": "AA+EU,OACE,OAAAA,EADF,QAAAC,MAAA,oBA/EV,OAAS,QAAAC,EAAM,UAAAC,EAAmB,QAAAC,EAAM,YAAAC,EAAU,WAAAC,EAAS,WAAAC,MAAe,4BAE1E,OAAS,wBAAAC,MAA4B,8BACrC,OAAS,aAAAC,EAAW,WAAAC,EAAS,YAAAC,MAAgB,QAC7C,OAAS,eAAAC,MAAmB,iBAC5B,OAAS,kBAAAC,MAAsB,2BAE/B,MAAmB,yBACnB,OAAOC,MAAa,aAEpB,MAAMC,EAAiB,CAAC,CAAC,IAA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GAAQ3D",
6
- "names": ["jsx", "jsxs", "Text", "Button", "Grid", "GridItem", "Picture", "Heading", "useBizProductContext", "useEffect", "useMemo", "useState", "formatPrice", "useAiuiContext", "Decimal", "ProductSummary", "locale", "copyWriting", "product", "variant", "finalPrice", "comparePrice", "coupon", "selectedOptions", "selectedVariants", "totalSavings", "onAddToCart", "onBuyNow", "savingDetail", "checkedBundle", "joinedRecommendBuyProducts", "setJoinedRecommendBuyProducts", "currentJoinedRecommendBuyProducts", "setCurrentJoinedRecommendBuyProducts", "currentProductVariant", "summaryFinalPrice", "currentBundleVariant", "currentBundlePrice", "bundleVariant", "giftVariant", "exchangeVariant", "useRecommendBuyProducts", "initialRecommendBuyProducts", "setInitialRecommendBuyProducts", "comparePriceRemovedFreeGift", "ProductGiftSummary", "gift", "ProductBundleSummary", "bundle", "ProductExchangeSummary", "exchange", "freeGift", "checkedGift", "exchangePurchase", "checkedExchangePurchase", "bundleList", "giftList", "exchangeList", "availableBundleList", "v", "firstAvailableBundle", "firstAvailableGift", "firstAvailableExchange", "bundleOperation", "bundleListItem", "status", "setCheckedBundle", "bundleVariants", "giftOperation", "setCheckedGift", "freeLabel", "count", "exchangeOperation", "setCheckedExchangePurchase", "ProductSummary_default"]
4
+ "sourcesContent": ["import { Text, Button, Container, Grid, GridItem, Picture, Heading } from '../../../../../components'\nimport type { ProductSummaryProps } from './types'\nimport { useBizProductContext } from '../../../BizProductProvider'\nimport { useEffect, useMemo, useState } from 'react'\nimport { formatPrice } from '../../../utils'\nimport { useAiuiContext } from '../../../../AiuiProvider'\nimport type { BundleListItem, ProductVariant, ProductPrice } from '../../../types/product'\nimport { cn } from '../../../../../helpers'\nimport Decimal from 'decimal.js'\n\nconst ProductSummary = ({}: ProductSummaryProps) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const {\n product,\n variant,\n finalPrice,\n comparePrice,\n coupon,\n selectedOptions,\n selectedVariants,\n totalSavings,\n onAddToCart,\n onBuyNow,\n savingDetail,\n checkedBundle,\n joinedRecommendBuyProducts,\n setJoinedRecommendBuyProducts,\n setCheckedGift,\n setCheckedExchangePurchase,\n setCheckedBundle,\n setSavingDetail,\n } = useBizProductContext()\n\n const [currentProductVariant] = selectedVariants\n\n const summaryFinalPrice = useMemo(() => {\n const [currentBundleVariant] = checkedBundle?.variants || []\n const currentBundlePrice = new Decimal(currentProductVariant?.price?.amount || 0)\n .minus(currentBundleVariant?.price || currentProductVariant?.price?.amount)\n .toNumber()\n return new Decimal(currentProductVariant?.price?.amount || 0)\n .minus(savingDetail?.coupon)\n .minus(currentBundlePrice)\n .toNumber()\n }, [currentProductVariant, totalSavings, checkedBundle])\n\n const isAvailable = variant.availableForSale\n if (!isAvailable) return null\n\n const { bundleVariant, giftVariant, exchangeVariant } = useRecommendBuyProducts() || {}\n const [initialRecommendBuyProducts, setInitialRecommendBuyProducts] = useState<{\n bundle?: BundleListItem\n gift?: ProductVariant\n exchange?: ProductVariant\n }>()\n\n useEffect(() => {\n setInitialRecommendBuyProducts({\n bundle: joinedRecommendBuyProducts.bundle?.value ? undefined : bundleVariant,\n gift: joinedRecommendBuyProducts.gift?.value ? undefined : giftVariant,\n exchange: joinedRecommendBuyProducts.exchange?.value ? undefined : exchangeVariant,\n })\n }, [bundleVariant, giftVariant, exchangeVariant, joinedRecommendBuyProducts])\n\n const comparePriceRemovedFreeGift = useMemo(\n () => new Decimal(comparePrice).minus(savingDetail.freeGift).toNumber(),\n [comparePrice, savingDetail]\n )\n\n return (\n <div className=\"ipc-product-summary laptop:px-16 desktop:px-0 mt-16 desktop:mt-[96px] lg-desktop:mt-[128px]\">\n <div className=\"bg-[#F5F5F7] laptop:rounded-2xl\">\n <Grid className=\"px-4 py-6 tablet:p-8\">\n <GridItem className=\"col-span-12 laptop:col-start-1 laptop:col-span-5\">\n <Heading\n className=\"font-bold text-[24px] lg-desktop:text-[48px] laptop:text-[32px] desktop:text-[40px] leading-[1] mb-4 [&>span]:text-[#D1D1D1]\"\n html={`${product.title} is ready <br/><span>Just the way you want it.</span>`}\n />\n <div className=\"aspect-[644/320]\">\n <Picture\n source={variant.image?.url || product?.images?.[0]?.url}\n className=\"h-full w-full\"\n imgClassName=\"object-contain h-full\"\n />\n </div>\n </GridItem>\n <GridItem className=\"col-span-12 mt-8 laptop:col-start-7 laptop:mt-0 laptop:col-span-6 flex flex-col gap-6 justify-between\">\n <div>\n <div className=\"flex flex-col gap-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"shrink-0 flex items-center gap-4\">\n <Picture\n source={variant.image?.url || product?.images?.[0]?.url}\n className=\"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg\"\n />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]\"\n html={product.title}\n />\n <Text\n className=\"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]\"\n html={`x1 | ${selectedOptions.color || selectedOptions.colour || selectedOptions.couleur}`}\n />\n </div>\n </div>\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"text-base desktop:text-2xl font-bold\"\n html={formatPrice({\n amount: summaryFinalPrice,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n {totalSavings > 0 && (\n <Text\n className=\"text-base desktop:text-2xl laptop:text-xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: variant?.price?.amount,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n </div>\n </div>\n {joinedRecommendBuyProducts?.gift?.value && (\n <ProductGiftSummary\n giftOperation={gift => {\n setCheckedGift?.(undefined)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value: undefined,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift })\n }}\n status={!!joinedRecommendBuyProducts?.gift}\n gift={joinedRecommendBuyProducts?.gift?.value}\n canOperate={joinedRecommendBuyProducts?.gift?.canOperate}\n />\n )}\n {joinedRecommendBuyProducts?.bundle?.value && (\n <ProductBundleSummary\n bundleOperation={bundle => {\n setCheckedBundle?.(undefined)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n bundle: {\n value: undefined,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle })\n }}\n status={!!joinedRecommendBuyProducts?.bundle}\n bundleListItem={joinedRecommendBuyProducts?.bundle?.value}\n canOperate={joinedRecommendBuyProducts?.bundle?.canOperate}\n />\n )}\n {joinedRecommendBuyProducts?.exchange?.value && (\n <ProductExchangeSummary\n exchangeOperation={exchange => {\n setCheckedExchangePurchase?.(undefined)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value: undefined,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, exchange })\n }}\n status={!!joinedRecommendBuyProducts?.exchange}\n canOperate={joinedRecommendBuyProducts?.exchange?.canOperate}\n exchange={joinedRecommendBuyProducts?.exchange?.value}\n />\n )}\n </div>\n {(initialRecommendBuyProducts?.bundle ||\n initialRecommendBuyProducts?.gift ||\n initialRecommendBuyProducts?.exchange) && (\n <div className=\"mt-6\">\n <Text className=\"text-sm desktop:text-[18px] font-bold\" html={'Recommend Buy'} />\n <div className=\"flex flex-col gap-6 mt-6\">\n {initialRecommendBuyProducts?.exchange && (\n <ProductExchangeSummary\n exchangeOperation={exchange => {\n setCheckedBundle?.(undefined)\n setJoinedRecommendBuyProducts?.({\n bundle: {\n value: undefined,\n canOperate: true,\n },\n gift: {\n value: joinedRecommendBuyProducts?.gift?.value,\n canOperate: true,\n },\n exchange: {\n value: exchange,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, exchange: undefined })\n }}\n canOperate={joinedRecommendBuyProducts?.exchange?.canOperate}\n status={!initialRecommendBuyProducts?.exchange}\n exchange={initialRecommendBuyProducts?.exchange}\n />\n )}\n {initialRecommendBuyProducts?.bundle && (\n <ProductBundleSummary\n bundleOperation={bundle => {\n setCheckedGift?.(undefined)\n setCheckedExchangePurchase?.(undefined)\n setSavingDetail?.({ ...savingDetail, exchangePurchase: 0 })\n setJoinedRecommendBuyProducts?.({\n gift: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value: undefined,\n canOperate: true,\n },\n bundle: {\n value: bundle,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle: undefined })\n }}\n canOperate={joinedRecommendBuyProducts?.bundle?.canOperate}\n status={!initialRecommendBuyProducts?.bundle}\n bundleListItem={initialRecommendBuyProducts?.bundle}\n />\n )}\n {initialRecommendBuyProducts?.gift && (\n <ProductGiftSummary\n giftOperation={gift => {\n setCheckedBundle?.(undefined)\n setJoinedRecommendBuyProducts?.({\n bundle: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value: joinedRecommendBuyProducts?.exchange?.value,\n canOperate: true,\n },\n gift: {\n value: gift,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift: undefined })\n }}\n canOperate={joinedRecommendBuyProducts?.gift?.canOperate}\n status={!initialRecommendBuyProducts?.gift}\n gift={initialRecommendBuyProducts?.gift}\n />\n )}\n </div>\n </div>\n )}\n </div>\n <div className=\"text-right\">\n <Text\n className=\"laptop:text-xl desktop:text-2xl font-bold text-right\"\n html={`${copyWriting?.totalPrice} ${formatPrice({ amount: finalPrice, currencyCode: variant.price.currencyCode, locale })}`}\n />\n\n {totalSavings > 0 && (\n <Text\n className=\"text-base laptop:text-xl desktop:text-2xl ml-1 font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: comparePriceRemovedFreeGift,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n <div className=\"flex gap-3 mt-2 justify-end\">\n <Button\n size=\"lg\"\n variant=\"secondary\"\n className=\"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto\"\n onClick={() => onAddToCart?.()}\n >\n {copyWriting?.addToCart}\n </Button>\n <Button\n size=\"lg\"\n variant=\"primary\"\n className=\"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto\"\n onClick={() => onBuyNow?.()}\n >\n {copyWriting?.shopNow}\n </Button>\n </div>\n </div>\n </GridItem>\n </Grid>\n </div>\n </div>\n )\n}\n\nconst useRecommendBuyProducts = () => {\n const { bundle, variant, checkedBundle, freeGift, checkedGift, exchangePurchase, checkedExchangePurchase } =\n useBizProductContext()\n let bundleVariant = undefined\n let giftVariant = undefined\n let exchangeVariant = undefined\n const { bundleList } = bundle || {}\n\n const { giftList = [] } = freeGift || {}\n const { giftList: exchangeList = [] } = exchangePurchase || {}\n\n const availableBundleList =\n bundleList?.filter(bundle =>\n bundle.variants.slice(1, bundle.variants.length).every(v => v.variant.availableForSale)\n ) || []\n\n const [firstAvailableBundle] = availableBundleList\n bundleVariant = checkedBundle || firstAvailableBundle\n\n const [firstAvailableGift] = giftList?.filter(gift => gift.availableForSale)\n giftVariant = checkedGift || firstAvailableGift\n\n const [firstAvailableExchange] = exchangeList?.filter(exchange => exchange.availableForSale)\n exchangeVariant = checkedExchangePurchase || firstAvailableExchange\n\n return { bundleVariant, giftVariant, exchangeVariant }\n}\n\nconst ProductBundleSummary = ({\n bundleOperation,\n bundleListItem,\n canOperate,\n status,\n}: {\n bundleOperation: (bundle?: BundleListItem) => void\n bundleListItem?: BundleListItem\n canOperate?: boolean\n status?: boolean\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const { variant, setCheckedBundle } = useBizProductContext()\n const bundleVariants = bundleListItem?.variants.filter(v => v.variant.sku !== variant.sku)\n\n return (\n <div className=\"flex items-center justify-between\">\n {bundleVariants?.map(bundleVariant => {\n return (\n <div className=\"flex items-center gap-4\" key={bundleVariant.variant.id}>\n <Picture\n source={bundleVariant?.variant?.image?.url}\n className=\"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg\"\n />\n <div className=\"flex flex-col gap-[6px] line-clamp-2 max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]\"\n html={bundleVariant.variant.product.title}\n />\n </div>\n </div>\n )\n })}\n <div className=\"flex flex-col items-end gap-1 justify-center\">\n {!!bundleListItem && (\n <Text\n className=\"text-base desktop:text-2xl font-bold\"\n html={formatPrice({\n amount: bundleVariants?.[0]?.price || 0,\n locale,\n currencyCode: bundleVariants?.[0]?.variant?.price?.currencyCode || '',\n })}\n />\n )}\n {canOperate && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedBundle?.(status ? undefined : bundleListItem)\n bundleOperation?.(bundleListItem)\n }}\n className=\"shrink-0 size-auto underline\"\n >\n {!!status ? 'Remove' : 'Add'}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nconst ProductGiftSummary = ({\n giftOperation,\n gift,\n status,\n canOperate,\n}: {\n giftOperation: (gift?: ProductVariant) => void\n gift?: ProductVariant\n status?: boolean\n canOperate?: boolean\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const { freeGift, setCheckedGift } = useBizProductContext()\n const { freeLabel, count } = freeGift || {}\n\n return (\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={gift?.image?.url}\n className=\"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg\"\n />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]\"\n html={gift?.product?.title}\n />\n <Text\n className=\"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]\"\n html={`x${count} | ${freeLabel}`}\n />\n </div>\n </div>\n <div className=\"flex flex-col items-end gap-2 justify-center\">\n {!!gift && (\n <div className=\"flex items-center gap-1\">\n <Text className=\"text-base desktop:text-2xl font-bold\" html={freeLabel} />\n <Text\n className=\"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n )}\n {canOperate && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedGift?.(status ? undefined : gift)\n giftOperation(gift)\n }}\n className=\"shrink-0 size-auto underline\"\n >\n {status ? 'Remove' : 'Add'}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nconst ProductExchangeSummary = ({\n exchangeOperation,\n exchange,\n canOperate,\n status,\n}: {\n exchangeOperation: (exchange?: ProductVariant) => void\n exchange?: ProductVariant & { finalPrice?: ProductPrice }\n canOperate?: boolean\n status?: boolean\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const { setCheckedExchangePurchase } = useBizProductContext()\n\n return (\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={exchange?.image?.url}\n className=\"size-10 laptop:size-12 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] rounded-[5px] rounded-lg\"\n />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]\"\n html={exchange?.product?.title}\n />\n <Text className=\"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]\" />\n </div>\n </div>\n <div className=\"flex flex-col items-end gap-2 justify-center\">\n {!!exchange && (\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"text-base desktop:text-2xl font-bold\"\n html={formatPrice({\n amount: exchange.finalPrice?.amount || 0,\n locale,\n currencyCode: exchange.price.currencyCode,\n })}\n />\n <Text\n className=\"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: exchange.price?.amount || 0,\n locale,\n currencyCode: exchange.price.currencyCode,\n })}\n />\n </div>\n )}\n {canOperate && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedExchangePurchase?.(status ? undefined : exchange)\n exchangeOperation(exchange)\n }}\n className=\"shrink-0 size-auto underline\"\n >\n {status ? 'Remove' : 'Add'}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nexport default ProductSummary\n"],
5
+ "mappings": "AAyEU,OACE,OAAAA,EADF,QAAAC,MAAA,oBAzEV,OAAS,QAAAC,EAAM,UAAAC,EAAmB,QAAAC,EAAM,YAAAC,EAAU,WAAAC,EAAS,WAAAC,MAAe,4BAE1E,OAAS,wBAAAC,MAA4B,8BACrC,OAAS,aAAAC,EAAW,WAAAC,EAAS,YAAAC,MAAgB,QAC7C,OAAS,eAAAC,MAAmB,iBAC5B,OAAS,kBAAAC,MAAsB,2BAE/B,MAAmB,yBACnB,OAAOC,MAAa,aAEpB,MAAMC,EAAiB,CAAC,CAAC,IAA2B,CAClD,KAAM,CAAE,OAAAC,EAAS,KAAM,YAAAC,CAAY,EAAIJ,EAAe,EAChD,CACJ,QAAAK,EACA,QAAAC,EACA,WAAAC,EACA,aAAAC,EACA,OAAAC,EACA,gBAAAC,EACA,iBAAAC,EACA,aAAAC,EACA,YAAAC,EACA,SAAAC,EACA,aAAAC,EACA,cAAAC,EACA,2BAAAC,EACA,8BAAAC,EACA,eAAAC,EACA,2BAAAC,EACA,iBAAAC,EACA,gBAAAC,CACF,EAAI3B,EAAqB,EAEnB,CAAC4B,CAAqB,EAAIZ,EAE1Ba,EAAoB3B,EAAQ,IAAM,CACtC,KAAM,CAAC4B,CAAoB,EAAIT,GAAe,UAAY,CAAC,EACrDU,EAAqB,IAAIzB,EAAQsB,GAAuB,OAAO,QAAU,CAAC,EAC7E,MAAME,GAAsB,OAASF,GAAuB,OAAO,MAAM,EACzE,SAAS,EACZ,OAAO,IAAItB,EAAQsB,GAAuB,OAAO,QAAU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AAS,OAAYpB,CAAI,EAC1CsB,EAActB,CAAI,CACpB,EACA,UAAU,+BAET,SAAAoB,EAAS,SAAW,MACvB,GAEJ,GACF,CAEJ,EAEMjB,EAAyB,CAAC,CAC9B,kBAAAsB,EACA,SAAArB,EACA,WAAAe,EACA,OAAAC,CACF,IAKM,CACJ,KAAM,CAAE,OAAApD,EAAS,IAAK,EAAIH,EAAe,EACnC,CAAE,2BAAAoB,CAA2B,EAAIzB,EAAqB,EAE5D,OACEP,EAAC,OAAI,UAAU,oCACb,UAAAA,EAAC,OAAI,UAAU,0BACb,UAAAD,EAACM,EAAA,CACC,OAAQ8C,GAAU,OAAO,IACzB,UAAU,4GACZ,EACAnD,EAAC,OAAI,UAAU,0DACb,UAAAD,EAACE,EAAA,CACC,UAAU,gFACV,KAAMkD,GAAU,SAAS,MAC3B,EACApD,EAACE,EAAA,CAAK,UAAU,8EAA8E,GAChG,GACF,EACAD,EAAC,OAAI,UAAU,+CACZ,WAAC,CAACmD,GACDnD,EAAC,OAAI,UAAU,0BACb,UAAAD,EAACE,EAAA,CACC,UAAU,uCACV,KAAMU,EAAY,CAChB,OAAQwC,EAAS,YAAY,QAAU,EACvC,OAAApC,EACA,aAAcoC,EAAS,MAAM,YAC/B,CAAC,EACH,EACApD,EAACE,EAAA,CACC,UAAU,mEACV,KAAMU,EAAY,CAChB,OAAQwC,EAAS,OAAO,QAAU,EAClC,OAAApC,EACA,aAAcoC,EAAS,MAAM,YAC/B,CAAC,EACH,GACF,EAEDe,GACCnE,EAACG,EAAA,CACC,KAAK,OACL,QAAQ,OACR,QAAS,IAAM,CACb8B,IAA6BmC,EAAS,OAAYhB,CAAQ,EAC1DqB,EAAkBrB,CAAQ,CAC5B,EACA,UAAU,+BAET,SAAAgB,EAAS,SAAW,MACvB,GAEJ,GACF,CAEJ,EAEA,IAAOM,GAAQ3D",
6
+ "names": ["jsx", "jsxs", "Text", "Button", "Grid", "GridItem", "Picture", "Heading", "useBizProductContext", "useEffect", "useMemo", "useState", "formatPrice", "useAiuiContext", "Decimal", "ProductSummary", "locale", "copyWriting", "product", "variant", "finalPrice", "comparePrice", "coupon", "selectedOptions", "selectedVariants", "totalSavings", "onAddToCart", "onBuyNow", "savingDetail", "checkedBundle", "joinedRecommendBuyProducts", "setJoinedRecommendBuyProducts", "setCheckedGift", "setCheckedExchangePurchase", "setCheckedBundle", "setSavingDetail", "currentProductVariant", "summaryFinalPrice", "currentBundleVariant", "currentBundlePrice", "bundleVariant", "giftVariant", "exchangeVariant", "useRecommendBuyProducts", "initialRecommendBuyProducts", "setInitialRecommendBuyProducts", "comparePriceRemovedFreeGift", "ProductGiftSummary", "gift", "ProductBundleSummary", "bundle", "ProductExchangeSummary", "exchange", "freeGift", "checkedGift", "exchangePurchase", "checkedExchangePurchase", "bundleList", "giftList", "exchangeList", "availableBundleList", "v", "firstAvailableBundle", "firstAvailableGift", "firstAvailableExchange", "bundleOperation", "bundleListItem", "canOperate", "status", "bundleVariants", "giftOperation", "freeLabel", "count", "exchangeOperation", "ProductSummary_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{jsx as t,jsxs as l}from"react/jsx-runtime";import{Text as a,Button as x}from"../../../../../components";import{useAiuiContext as C}from"../../../../AiuiProvider/index.js";import{useBizProductContext as N}from"../../../BizProductProvider.js";import{useMemo as y}from"react";import{formatPrice as m}from"../../../utils";import p from"decimal.js";const w=()=>{const{copyWriting:o,locale:i="us"}=C(),{variant:e,finalPrice:b,totalSavings:r,memberFunctionResult:c,isLogin:d,comparePrice:u,onAddToCart:f,onBuyNow:v,savingDetail:n,coupon:h}=N(),g=y(()=>new p(u).minus(n.freeGift).toNumber(),[u,n]),s=Math.max(c?.withCouponMemberTotalSave??0,c?.withoutCouponMaxMemberTotalSave??0);return l("div",{className:"bg-white py-3 px-4 tablet:p-0 tablet:flex tablet:items-center tablet:gap-4",children:[e.availableForSale?l("div",{className:"flex items-center justify-between tablet:flex-col desktop:items-end",children:[l("div",{className:"flex items-center gap-1",children:[t(a,{className:"text-xl font-bold !leading-[1.2] desktop:text-xl lg-desktop:text-2xl",html:m({amount:b,currencyCode:e.price.currencyCode,locale:i})}),r>0&&t(a,{className:"text-xl font-bold line-through text-[#999] !leading-[1.2] desktop:text-xl lg-desktop:text-2xl",html:m({amount:g,currencyCode:e.price.currencyCode,locale:i})})]}),r>0&&t(a,{className:"text-brand-0 text-base !leading-[1.2] font-bold desktop:text-xl lg-desktop:text-2xl",html:`${s>0&&d?o?.memberSaving:o?.totalSavings} ${m({amount:s>0&&d?s:new p(r).minus(n?.freeGift).toNumber(),currencyCode:e.price.currencyCode,locale:i})}`})]}):t(a,{className:"text-[20px] font-bold text-[#999999]",html:o?.soldOut??"Sold Out"}),l("div",{className:"flex items-center gap-2 mt-2 tablet:mt-0",children:[t(x,{variant:"secondary",disabled:!e.availableForSale,size:"lg",className:"w-1/2 tablet:w-auto",onClick:()=>f?.(),children:o?.addToCart??"Add to Cart"}),t(x,{variant:"primary",disabled:!e.availableForSale,size:"lg",className:"w-1/2 tablet:w-auto",onClick:()=>v?.(),children:o?.buyNow??"Buy Now"})]})]})};var T=w;export{T as default};
1
+ import{jsx as t,jsxs as l}from"react/jsx-runtime";import{Text as a,Button as x}from"../../../../../components";import{useAiuiContext as y}from"../../../../AiuiProvider/index.js";import{useBizProductContext as w}from"../../../BizProductProvider.js";import{useMemo as h}from"react";import{formatPrice as m}from"../../../utils";import p from"decimal.js";const S=()=>{const{copyWriting:o,locale:i="us"}=y(),{variant:e,finalPrice:b,totalSavings:r,memberFunctionResult:d,isLogin:c,comparePrice:u,onAddToCart:f,onBuyNow:g,savingDetail:n,coupon:k,addToCartLoading:v,buyNowLoading:C}=w(),N=h(()=>new p(u).minus(n.freeGift).toNumber(),[u,n]),s=Math.max(d?.withCouponMemberTotalSave??0,d?.withoutCouponMaxMemberTotalSave??0);return l("div",{className:"bg-white py-3 px-4 tablet:p-0 tablet:flex tablet:items-center tablet:gap-4",children:[e.availableForSale?l("div",{className:"flex items-center justify-between tablet:flex-col desktop:items-end",children:[l("div",{className:"flex items-center gap-1",children:[t(a,{className:"text-xl font-bold !leading-[1.2] desktop:text-xl lg-desktop:text-2xl",html:m({amount:b,currencyCode:e.price.currencyCode,locale:i})}),r>0&&t(a,{className:"text-xl font-bold line-through text-[#999] !leading-[1.2] desktop:text-xl lg-desktop:text-2xl",html:m({amount:N,currencyCode:e.price.currencyCode,locale:i})})]}),r>0&&t(a,{className:"text-brand-0 text-base !leading-[1.2] font-bold desktop:text-xl lg-desktop:text-2xl",html:`${s>0&&c?o?.memberSaving:o?.totalSavings} ${m({amount:s>0&&c?s:new p(r).minus(n?.freeGift).toNumber(),currencyCode:e.price.currencyCode,locale:i})}`})]}):t(a,{className:"text-[20px] font-bold text-[#999999]",html:o?.soldOut??"Sold Out"}),l("div",{className:"flex items-center gap-2 mt-2 tablet:mt-0",children:[t(x,{variant:"secondary",disabled:!e.availableForSale,size:"lg",className:"w-1/2 tablet:w-auto",onClick:()=>f?.(),loading:v,children:o?.addToCart??"Add to Cart"}),t(x,{variant:"primary",disabled:!e.availableForSale,size:"lg",loading:C,className:"w-1/2 tablet:w-auto",onClick:()=>g?.(),children:o?.buyNow??"Buy Now"})]})]})};var z=S;export{z as default};
2
2
  //# sourceMappingURL=index.js.map