@anker-in/headless-ui 1.1.52 → 1.1.53-alpha.1770189242094

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 (232) hide show
  1. package/dist/cjs/biz-components/ActivityMechanism/index.d.ts +7 -0
  2. package/dist/cjs/biz-components/ActivityMechanism/index.js +2 -0
  3. package/dist/cjs/biz-components/ActivityMechanism/index.js.map +7 -0
  4. package/dist/cjs/biz-components/ActivityMechanism/types.d.ts +43 -0
  5. package/dist/cjs/biz-components/ActivityMechanism/types.js +2 -0
  6. package/dist/cjs/biz-components/ActivityMechanism/types.js.map +7 -0
  7. package/dist/cjs/biz-components/ActivitySchedule/index.d.ts +8 -0
  8. package/dist/cjs/biz-components/ActivitySchedule/index.js +2 -0
  9. package/dist/cjs/biz-components/ActivitySchedule/index.js.map +7 -0
  10. package/dist/cjs/biz-components/ActivitySchedule/types.d.ts +42 -0
  11. package/dist/cjs/biz-components/ActivitySchedule/types.js +2 -0
  12. package/dist/cjs/biz-components/ActivitySchedule/types.js.map +7 -0
  13. package/dist/cjs/biz-components/BuyOneGetOneShelf/FreeGiftItem.js +1 -1
  14. package/dist/cjs/biz-components/BuyOneGetOneShelf/FreeGiftItem.js.map +2 -2
  15. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
  16. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js.map +2 -2
  17. package/dist/cjs/biz-components/BuyOneGetOneShelf/index.js +1 -1
  18. package/dist/cjs/biz-components/BuyOneGetOneShelf/index.js.map +2 -2
  19. package/dist/cjs/biz-components/Category/index.js +1 -1
  20. package/dist/cjs/biz-components/Category/index.js.map +2 -2
  21. package/dist/cjs/biz-components/CreditsShelf/ProductCard.d.ts +109 -0
  22. package/dist/cjs/biz-components/CreditsShelf/ProductCard.js +2 -0
  23. package/dist/cjs/biz-components/CreditsShelf/ProductCard.js.map +7 -0
  24. package/dist/cjs/biz-components/CreditsShelf/index.d.ts +75 -0
  25. package/dist/cjs/biz-components/CreditsShelf/index.js +2 -0
  26. package/dist/cjs/biz-components/CreditsShelf/index.js.map +7 -0
  27. package/dist/cjs/biz-components/CreditsShelf/types.d.ts +19 -0
  28. package/dist/cjs/biz-components/CreditsShelf/types.js +2 -0
  29. package/dist/cjs/biz-components/CreditsShelf/types.js.map +7 -0
  30. package/dist/cjs/biz-components/GiftBox/index.js +1 -1
  31. package/dist/cjs/biz-components/GiftBox/index.js.map +2 -2
  32. package/dist/cjs/biz-components/HeaderNavigation/types.d.ts +1 -1
  33. package/dist/cjs/biz-components/HeaderNavigation/types.js +1 -1
  34. package/dist/cjs/biz-components/HeaderNavigation/types.js.map +1 -1
  35. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
  36. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  37. package/dist/cjs/biz-components/ImageOverlayShelf/ProductCard.js +1 -1
  38. package/dist/cjs/biz-components/ImageOverlayShelf/ProductCard.js.map +2 -2
  39. package/dist/cjs/biz-components/MediaPlayerSticky/index.js +1 -1
  40. package/dist/cjs/biz-components/MediaPlayerSticky/index.js.map +2 -2
  41. package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js +2 -2
  42. package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js.map +2 -2
  43. package/dist/cjs/biz-components/MediaSceneSwitcher/types.d.ts +1 -0
  44. package/dist/cjs/biz-components/MediaSceneSwitcher/types.js +1 -1
  45. package/dist/cjs/biz-components/MediaSceneSwitcher/types.js.map +1 -1
  46. package/dist/cjs/biz-components/MediaShelf/ProductCard.js +1 -1
  47. package/dist/cjs/biz-components/MediaShelf/ProductCard.js.map +2 -2
  48. package/dist/cjs/biz-components/MiniCart/CircleProgress.d.ts +36 -0
  49. package/dist/cjs/biz-components/MiniCart/CircleProgress.js +2 -0
  50. package/dist/cjs/biz-components/MiniCart/CircleProgress.js.map +7 -0
  51. package/dist/cjs/biz-components/MiniCart/index.d.ts +27 -1
  52. package/dist/cjs/biz-components/MiniCart/index.js +1 -1
  53. package/dist/cjs/biz-components/MiniCart/index.js.map +3 -3
  54. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  55. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
  56. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/types.d.ts +1 -0
  57. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/types.js +1 -1
  58. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/types.js.map +1 -1
  59. package/dist/cjs/biz-components/SceneShelf/index.d.ts +23 -0
  60. package/dist/cjs/biz-components/SceneShelf/index.js +2 -0
  61. package/dist/cjs/biz-components/SceneShelf/index.js.map +7 -0
  62. package/dist/cjs/biz-components/SecondaryBanner/index.d.ts +25 -0
  63. package/dist/cjs/biz-components/SecondaryBanner/index.js +1 -1
  64. package/dist/cjs/biz-components/SecondaryBanner/index.js.map +3 -3
  65. package/dist/cjs/biz-components/Specs/index.js +1 -1
  66. package/dist/cjs/biz-components/Specs/index.js.map +2 -2
  67. package/dist/cjs/biz-components/WheelLottery/BaseModal.d.ts +60 -0
  68. package/dist/cjs/biz-components/WheelLottery/BaseModal.js +2 -0
  69. package/dist/cjs/biz-components/WheelLottery/BaseModal.js.map +7 -0
  70. package/dist/cjs/biz-components/WheelLottery/ChanceMethods.d.ts +30 -0
  71. package/dist/cjs/biz-components/WheelLottery/ChanceMethods.js +2 -0
  72. package/dist/cjs/biz-components/WheelLottery/ChanceMethods.js.map +7 -0
  73. package/dist/cjs/biz-components/WheelLottery/ErrorModal.d.ts +47 -0
  74. package/dist/cjs/biz-components/WheelLottery/ErrorModal.js +2 -0
  75. package/dist/cjs/biz-components/WheelLottery/ErrorModal.js.map +7 -0
  76. package/dist/cjs/biz-components/WheelLottery/MyRewardsModal.d.ts +96 -0
  77. package/dist/cjs/biz-components/WheelLottery/MyRewardsModal.js +2 -0
  78. package/dist/cjs/biz-components/WheelLottery/MyRewardsModal.js.map +7 -0
  79. package/dist/cjs/biz-components/WheelLottery/PrizePool.d.ts +29 -0
  80. package/dist/cjs/biz-components/WheelLottery/PrizePool.js +2 -0
  81. package/dist/cjs/biz-components/WheelLottery/PrizePool.js.map +7 -0
  82. package/dist/cjs/biz-components/WheelLottery/RulesModal.d.ts +56 -0
  83. package/dist/cjs/biz-components/WheelLottery/RulesModal.js +2 -0
  84. package/dist/cjs/biz-components/WheelLottery/RulesModal.js.map +7 -0
  85. package/dist/cjs/biz-components/WheelLottery/ShareModal.d.ts +79 -0
  86. package/dist/cjs/biz-components/WheelLottery/ShareModal.js +2 -0
  87. package/dist/cjs/biz-components/WheelLottery/ShareModal.js.map +7 -0
  88. package/dist/cjs/biz-components/WheelLottery/Wheel.d.ts +27 -0
  89. package/dist/cjs/biz-components/WheelLottery/Wheel.js +2 -0
  90. package/dist/cjs/biz-components/WheelLottery/Wheel.js.map +7 -0
  91. package/dist/cjs/biz-components/WheelLottery/WinnerModal.d.ts +27 -0
  92. package/dist/cjs/biz-components/WheelLottery/WinnerModal.js +2 -0
  93. package/dist/cjs/biz-components/WheelLottery/WinnerModal.js.map +7 -0
  94. package/dist/cjs/biz-components/WheelLottery/index.d.ts +52 -0
  95. package/dist/cjs/biz-components/WheelLottery/index.js +2 -0
  96. package/dist/cjs/biz-components/WheelLottery/index.js.map +7 -0
  97. package/dist/cjs/biz-components/WheelLottery/types.d.ts +1193 -0
  98. package/dist/cjs/biz-components/WheelLottery/types.js +2 -0
  99. package/dist/cjs/biz-components/WheelLottery/types.js.map +7 -0
  100. package/dist/cjs/biz-components/index.d.ts +13 -2
  101. package/dist/cjs/biz-components/index.js +1 -1
  102. package/dist/cjs/biz-components/index.js.map +3 -3
  103. package/dist/cjs/components/Countdown.js +1 -1
  104. package/dist/cjs/components/Countdown.js.map +2 -2
  105. package/dist/cjs/hooks/useDraggableScroll.d.ts +77 -0
  106. package/dist/cjs/hooks/useDraggableScroll.js +2 -0
  107. package/dist/cjs/hooks/useDraggableScroll.js.map +7 -0
  108. package/dist/cjs/index.js.map +2 -2
  109. package/dist/cjs/stories/decorators/dataPropsDecorator.d.ts +16 -0
  110. package/dist/cjs/stories/decorators/dataPropsDecorator.js +2 -0
  111. package/dist/cjs/stories/decorators/dataPropsDecorator.js.map +7 -0
  112. package/dist/cjs/update-notifier.d.ts +5 -0
  113. package/dist/cjs/update-notifier.js +5 -0
  114. package/dist/cjs/update-notifier.js.map +7 -0
  115. package/dist/esm/biz-components/ActivityMechanism/index.d.ts +7 -0
  116. package/dist/esm/biz-components/ActivityMechanism/index.js +2 -0
  117. package/dist/esm/biz-components/ActivityMechanism/index.js.map +7 -0
  118. package/dist/esm/biz-components/ActivityMechanism/types.d.ts +43 -0
  119. package/dist/esm/biz-components/ActivityMechanism/types.js +1 -0
  120. package/dist/esm/biz-components/ActivityMechanism/types.js.map +7 -0
  121. package/dist/esm/biz-components/ActivitySchedule/index.d.ts +8 -0
  122. package/dist/esm/biz-components/ActivitySchedule/index.js +2 -0
  123. package/dist/esm/biz-components/ActivitySchedule/index.js.map +7 -0
  124. package/dist/esm/biz-components/ActivitySchedule/types.d.ts +42 -0
  125. package/dist/esm/biz-components/ActivitySchedule/types.js +1 -0
  126. package/dist/esm/biz-components/ActivitySchedule/types.js.map +7 -0
  127. package/dist/esm/biz-components/BuyOneGetOneShelf/FreeGiftItem.js +1 -1
  128. package/dist/esm/biz-components/BuyOneGetOneShelf/FreeGiftItem.js.map +2 -2
  129. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
  130. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js.map +2 -2
  131. package/dist/esm/biz-components/BuyOneGetOneShelf/index.js +1 -1
  132. package/dist/esm/biz-components/BuyOneGetOneShelf/index.js.map +2 -2
  133. package/dist/esm/biz-components/Category/index.js +1 -1
  134. package/dist/esm/biz-components/Category/index.js.map +2 -2
  135. package/dist/esm/biz-components/CreditsShelf/ProductCard.d.ts +109 -0
  136. package/dist/esm/biz-components/CreditsShelf/ProductCard.js +2 -0
  137. package/dist/esm/biz-components/CreditsShelf/ProductCard.js.map +7 -0
  138. package/dist/esm/biz-components/CreditsShelf/index.d.ts +75 -0
  139. package/dist/esm/biz-components/CreditsShelf/index.js +2 -0
  140. package/dist/esm/biz-components/CreditsShelf/index.js.map +7 -0
  141. package/dist/esm/biz-components/CreditsShelf/types.d.ts +19 -0
  142. package/dist/esm/biz-components/CreditsShelf/types.js +1 -0
  143. package/dist/esm/biz-components/CreditsShelf/types.js.map +7 -0
  144. package/dist/esm/biz-components/GiftBox/index.js +1 -1
  145. package/dist/esm/biz-components/GiftBox/index.js.map +2 -2
  146. package/dist/esm/biz-components/HeaderNavigation/types.d.ts +1 -1
  147. package/dist/esm/biz-components/HeaderNavigation/types.js.map +1 -1
  148. package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
  149. package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  150. package/dist/esm/biz-components/ImageOverlayShelf/ProductCard.js +1 -1
  151. package/dist/esm/biz-components/ImageOverlayShelf/ProductCard.js.map +2 -2
  152. package/dist/esm/biz-components/MediaPlayerSticky/index.js +1 -1
  153. package/dist/esm/biz-components/MediaPlayerSticky/index.js.map +2 -2
  154. package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js +2 -2
  155. package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.js.map +2 -2
  156. package/dist/esm/biz-components/MediaSceneSwitcher/types.d.ts +1 -0
  157. package/dist/esm/biz-components/MediaShelf/ProductCard.js +1 -1
  158. package/dist/esm/biz-components/MediaShelf/ProductCard.js.map +2 -2
  159. package/dist/esm/biz-components/MiniCart/CircleProgress.d.ts +36 -0
  160. package/dist/esm/biz-components/MiniCart/CircleProgress.js +2 -0
  161. package/dist/esm/biz-components/MiniCart/CircleProgress.js.map +7 -0
  162. package/dist/esm/biz-components/MiniCart/index.d.ts +27 -1
  163. package/dist/esm/biz-components/MiniCart/index.js +1 -1
  164. package/dist/esm/biz-components/MiniCart/index.js.map +3 -3
  165. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  166. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
  167. package/dist/esm/biz-components/MultiLayoutGraphicBlock/types.d.ts +1 -0
  168. package/dist/esm/biz-components/SceneShelf/index.d.ts +23 -0
  169. package/dist/esm/biz-components/SceneShelf/index.js +2 -0
  170. package/dist/esm/biz-components/SceneShelf/index.js.map +7 -0
  171. package/dist/esm/biz-components/SecondaryBanner/index.d.ts +25 -0
  172. package/dist/esm/biz-components/SecondaryBanner/index.js +1 -1
  173. package/dist/esm/biz-components/SecondaryBanner/index.js.map +3 -3
  174. package/dist/esm/biz-components/Specs/index.js +1 -1
  175. package/dist/esm/biz-components/Specs/index.js.map +2 -2
  176. package/dist/esm/biz-components/WheelLottery/BaseModal.d.ts +60 -0
  177. package/dist/esm/biz-components/WheelLottery/BaseModal.js +2 -0
  178. package/dist/esm/biz-components/WheelLottery/BaseModal.js.map +7 -0
  179. package/dist/esm/biz-components/WheelLottery/ChanceMethods.d.ts +30 -0
  180. package/dist/esm/biz-components/WheelLottery/ChanceMethods.js +2 -0
  181. package/dist/esm/biz-components/WheelLottery/ChanceMethods.js.map +7 -0
  182. package/dist/esm/biz-components/WheelLottery/ErrorModal.d.ts +47 -0
  183. package/dist/esm/biz-components/WheelLottery/ErrorModal.js +2 -0
  184. package/dist/esm/biz-components/WheelLottery/ErrorModal.js.map +7 -0
  185. package/dist/esm/biz-components/WheelLottery/MyRewardsModal.d.ts +96 -0
  186. package/dist/esm/biz-components/WheelLottery/MyRewardsModal.js +2 -0
  187. package/dist/esm/biz-components/WheelLottery/MyRewardsModal.js.map +7 -0
  188. package/dist/esm/biz-components/WheelLottery/PrizePool.d.ts +29 -0
  189. package/dist/esm/biz-components/WheelLottery/PrizePool.js +2 -0
  190. package/dist/esm/biz-components/WheelLottery/PrizePool.js.map +7 -0
  191. package/dist/esm/biz-components/WheelLottery/RulesModal.d.ts +56 -0
  192. package/dist/esm/biz-components/WheelLottery/RulesModal.js +2 -0
  193. package/dist/esm/biz-components/WheelLottery/RulesModal.js.map +7 -0
  194. package/dist/esm/biz-components/WheelLottery/ShareModal.d.ts +79 -0
  195. package/dist/esm/biz-components/WheelLottery/ShareModal.js +2 -0
  196. package/dist/esm/biz-components/WheelLottery/ShareModal.js.map +7 -0
  197. package/dist/esm/biz-components/WheelLottery/Wheel.d.ts +27 -0
  198. package/dist/esm/biz-components/WheelLottery/Wheel.js +2 -0
  199. package/dist/esm/biz-components/WheelLottery/Wheel.js.map +7 -0
  200. package/dist/esm/biz-components/WheelLottery/WinnerModal.d.ts +27 -0
  201. package/dist/esm/biz-components/WheelLottery/WinnerModal.js +2 -0
  202. package/dist/esm/biz-components/WheelLottery/WinnerModal.js.map +7 -0
  203. package/dist/esm/biz-components/WheelLottery/index.d.ts +52 -0
  204. package/dist/esm/biz-components/WheelLottery/index.js +2 -0
  205. package/dist/esm/biz-components/WheelLottery/index.js.map +7 -0
  206. package/dist/esm/biz-components/WheelLottery/types.d.ts +1193 -0
  207. package/dist/esm/biz-components/WheelLottery/types.js +2 -0
  208. package/dist/esm/biz-components/WheelLottery/types.js.map +7 -0
  209. package/dist/esm/biz-components/index.d.ts +13 -2
  210. package/dist/esm/biz-components/index.js +1 -1
  211. package/dist/esm/biz-components/index.js.map +3 -3
  212. package/dist/esm/components/Countdown.js +1 -1
  213. package/dist/esm/components/Countdown.js.map +2 -2
  214. package/dist/esm/hooks/useDraggableScroll.d.ts +77 -0
  215. package/dist/esm/hooks/useDraggableScroll.js +2 -0
  216. package/dist/esm/hooks/useDraggableScroll.js.map +7 -0
  217. package/dist/esm/index.js.map +2 -2
  218. package/dist/esm/stories/decorators/dataPropsDecorator.d.ts +16 -0
  219. package/dist/esm/stories/decorators/dataPropsDecorator.js +2 -0
  220. package/dist/esm/stories/decorators/dataPropsDecorator.js.map +7 -0
  221. package/dist/esm/update-notifier.d.ts +5 -0
  222. package/dist/esm/update-notifier.js +5 -0
  223. package/dist/esm/update-notifier.js.map +7 -0
  224. package/dist/tokens/anker.css +1 -0
  225. package/dist/tokens/base.css +1 -0
  226. package/dist/tokens/eufy.css +1 -0
  227. package/dist/tokens/eufyMake.css +1 -0
  228. package/dist/tokens/solix.css +1 -0
  229. package/dist/tokens/soundcore.css +1 -0
  230. package/package.json +12 -4
  231. package/style.css +5169 -121
  232. package/tailwind.config.js +19 -2
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { ActivityMechanismProps } from './types.js';
3
+ declare const _default: React.ForwardRefExoticComponent<Omit<ActivityMechanismProps & React.RefAttributes<HTMLDivElement> & {
4
+ style?: string | React.CSSProperties;
5
+ container?: import("../../shared/Styles.js").ContainerProps["container"];
6
+ }, "ref"> & React.RefAttributes<any>>;
7
+ export default _default;
@@ -0,0 +1,2 @@
1
+ "use strict";"use client";var R=Object.create;var h=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var N=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var D=(t,e)=>{for(var i in e)h(t,i,{get:e[i],enumerable:!0})},y=(t,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of V(e))!C.call(t,o)&&o!==i&&h(t,o,{get:()=>e[o],enumerable:!(s=T(e,o))||s.enumerable});return t};var w=(t,e,i)=>(i=t!=null?R(N(t)):{},y(e||!t||!t.__esModule?h(i,"default",{value:t,enumerable:!0}):i,t)),H=t=>y(h({},"__esModule",{value:!0}),t);var _={};D(_,{default:()=>F});module.exports=H(_);var l=require("react/jsx-runtime"),c=w(require("react")),a=require("../../components/index.js"),A=require("../../shared/Styles.js"),r=require("../../helpers/utils.js"),M=require("../../hooks/useExposure.js"),x=require("../../shared/trackUrlRef.js"),g=require("class-variance-authority");const u="image",f="activity_mechanism",P=(0,g.cva)("line-clamp-2",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{theme:"light"}}),B=(0,g.cva)("desktop:text-[16px] mt-1 line-clamp-2 text-[14px] font-bold leading-[1.4] tracking-[-0.02em]",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white/80"}},defaultVariants:{theme:"light"}}),L=(0,g.cva)("mt-2 !p-0 text-[14px]",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{theme:"light"}}),v={default:767,tablet:1024,laptop:1439,desktop:1919,lgDesktop:9999},E=t=>{if(!t)return"";const e=[];return t.lgDesktop?.url&&e.push(`${t.lgDesktop.url}`),t.desktop?.url&&e.push(`${t.desktop.url} ${v.desktop}`),t.laptop?.url&&e.push(`${t.laptop.url} ${v.laptop}`),t.tablet?.url&&e.push(`${t.tablet.url} ${v.tablet}`),t.default?.url&&e.push(`${t.default.url} ${v.default}`),e.join(", ")},S=t=>t&&(t.default?.alt||t.tablet?.alt||t.laptop?.alt||t.desktop?.alt||t.lgDesktop?.alt)||"",z=({item:t,theme:e,classNames:i})=>{const{title:s,description:o,linkText:n,linkHref:p,backgroundImage:m}=t,d=E(m),k=S(m);return(0,l.jsx)("div",{className:(0,r.cn)("rounded-card relative flex flex-col overflow-hidden","desktop:px-6 h-[280px] p-4","laptop:gap-4 gap-3","laptop:h-[320px] lg-desktop:[400px]",i?.card),"data-headless-type-name":`${u}#${f}`,children:(0,l.jsxs)(a.Link,{asChild:!p,href:(0,x.trackUrlRef)(p,`${u}_${f}`),className:"no-underline",children:[d&&(0,l.jsx)(a.Picture,{source:d,alt:k||s,className:(0,r.cn)("absolute inset-0 size-full",i?.background),imgClassName:"size-full object-cover"}),(0,l.jsxs)("div",{className:"relative z-10",children:[(0,l.jsx)(a.Heading,{as:"h3",size:3,className:(0,r.cn)(P({theme:e}),i?.title),children:s}),(0,l.jsx)(a.Text,{as:"p",className:(0,r.cn)(B({theme:e}),i?.description),children:o}),n&&p&&(0,l.jsx)(a.Button,{variant:"link",as:"a",href:(0,x.trackUrlRef)(p,`${u}_${f}`),className:(0,r.cn)(L({theme:e}),i?.link),"data-headless-title-desc-button":`${s}#${o}#${n}`,children:n})]})]})})},$=c.default.forwardRef(({data:t,classNames:e},i)=>{const{items:s=[],theme:o="light"}=t,n=(0,c.useRef)(null);if((0,c.useImperativeHandle)(i,()=>n.current),(0,M.useExposure)(n,{componentType:u,componentName:f,componentTitle:s[0]?.title||"",componentDescription:s[0]?.description||""}),!s||s.length===0)return null;const p={1:"laptop:grid-cols-1 desktop:grid-cols-1 lg-desktop:grid-cols-1",2:"laptop:grid-cols-2 desktop:grid-cols-2 lg-desktop:grid-cols-2",3:"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-3 lg-desktop:grid-cols-3",4:"laptop:grid-cols-4 desktop:grid-cols-4 lg-desktop:grid-cols-4"},m=p[Math.min(s.length,4)]||p[4];return(0,l.jsx)(a.Container,{"data-ui-component-id":"ActivityMechanism",className:(0,r.cn)("activity-mechanism","w-full",e?.root),ref:n,children:(0,l.jsx)("div",{className:(0,r.cn)("tablet:grid-cols-2 laptop:gap-4 grid grid-cols-1 gap-3",m,e?.grid),children:s.map((d,k)=>(0,l.jsx)(z,{item:d,theme:o,classNames:{...e,...s?.length===3&&{card:e?.card+" first:tablet:col-span-full first:laptop:col-span-1"}}},`${d.title}-${k}`))})})});$.displayName="ActivityMechanism";var F=(0,A.withLayout)($);
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/ActivityMechanism/index.tsx"],
4
+ "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\nimport { Heading, Picture, Text, Container, Button, Link } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type {\n ActivityMechanismProps,\n ActivityMechanismItem,\n ActivityMechanismSemanticName,\n ResponsiveBackgroundImage,\n} from './types.js'\nimport { cn } from '../../helpers/utils.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nconst componentType = 'image'\nconst componentName = 'activity_mechanism'\n\n/**\n * \u6807\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst titleVariants = cva('line-clamp-2', {\n variants: {\n theme: {\n light: 'text-[#080A0F]',\n dark: 'text-white',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n})\n\n/**\n * \u63CF\u8FF0\u6837\u5F0F\u53D8\u4F53\n */\nconst descriptionVariants = cva(\n 'desktop:text-[16px] mt-1 line-clamp-2 text-[14px] font-bold leading-[1.4] tracking-[-0.02em]',\n {\n variants: {\n theme: {\n light: 'text-[#080A0F]',\n dark: 'text-white/80',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n }\n)\n\n/**\n * \u94FE\u63A5\u6837\u5F0F\u53D8\u4F53\n */\nconst linkVariants = cva('mt-2 !p-0 text-[14px]', {\n variants: {\n theme: {\n light: 'text-[#080A0F]',\n dark: 'text-white',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n})\n\ntype ThemeVariants = VariantProps<typeof titleVariants>\n\n/**\n * \u65AD\u70B9\u914D\u7F6E\uFF08\u4E0E Tailwind \u65AD\u70B9\u5BF9\u5E94\uFF09\n * Picture \u7EC4\u4EF6\u4F7F\u7528 max-width \u5A92\u4F53\u67E5\u8BE2\uFF0C\u6240\u4EE5\u9700\u8981\u6309\u4ECE\u5C0F\u5230\u5927\u7684\u987A\u5E8F\u6392\u5217\n */\nconst BREAKPOINTS = {\n default: 767, // <768px (\u79FB\u52A8\u7AEF)\n tablet: 1024, // 768px - 1024px\n laptop: 1439, // 1025px - 1439px\n desktop: 1919, // 1440px - 1919px\n lgDesktop: 9999, // \u22651920px (\u6700\u5927\u503C\uFF0C\u4F5C\u4E3A\u9ED8\u8BA4\u56FE\u7247)\n} as const\n\n/**\n * \u5C06\u54CD\u5E94\u5F0F\u80CC\u666F\u56FE\u7247\u5BF9\u8C61\u8F6C\u6362\u4E3A Picture \u7EC4\u4EF6\u7684 source \u5B57\u7B26\u4E32\n * \u683C\u5F0F: \"url1 767, url2 1024, url3 1439, url4 1919, url5\"\n */\nconst buildResponsiveSource = (backgroundImage?: ResponsiveBackgroundImage): string => {\n if (!backgroundImage) return ''\n\n const sources: string[] = []\n\n // \u6309\u65AD\u70B9\u987A\u5E8F\u6DFB\u52A0\u56FE\u7247 URL\n // lgDesktop \u4F5C\u4E3A\u9ED8\u8BA4\u56FE\u7247\uFF0C\u4E0D\u9700\u8981\u65AD\u70B9\u503C\n if (backgroundImage.lgDesktop?.url) {\n sources.push(`${backgroundImage.lgDesktop.url}`)\n }\n if (backgroundImage.desktop?.url) {\n sources.push(`${backgroundImage.desktop.url} ${BREAKPOINTS.desktop}`)\n }\n if (backgroundImage.laptop?.url) {\n sources.push(`${backgroundImage.laptop.url} ${BREAKPOINTS.laptop}`)\n }\n if (backgroundImage.tablet?.url) {\n sources.push(`${backgroundImage.tablet.url} ${BREAKPOINTS.tablet}`)\n }\n if (backgroundImage.default?.url) {\n sources.push(`${backgroundImage.default.url} ${BREAKPOINTS.default}`)\n }\n\n return sources.join(', ')\n}\n\n/**\n * \u83B7\u53D6\u54CD\u5E94\u5F0F\u80CC\u666F\u56FE\u7247\u7684\u9ED8\u8BA4 alt \u6587\u672C\n */\nconst getDefaultAlt = (backgroundImage?: ResponsiveBackgroundImage): string => {\n if (!backgroundImage) return ''\n return (\n backgroundImage.default?.alt ||\n backgroundImage.tablet?.alt ||\n backgroundImage.laptop?.alt ||\n backgroundImage.desktop?.alt ||\n backgroundImage.lgDesktop?.alt ||\n ''\n )\n}\n\n/**\n * \u5355\u4E2A\u6D3B\u52A8\u673A\u5236\u5361\u7247\u7EC4\u4EF6\n */\nconst ActivityMechanismCard: React.FC<{\n item: ActivityMechanismItem\n theme?: ThemeVariants['theme']\n classNames?: Partial<Record<ActivityMechanismSemanticName, string>>\n}> = ({ item, theme, classNames }) => {\n const { title, description, linkText, linkHref, backgroundImage } = item\n const responsiveSource = buildResponsiveSource(backgroundImage)\n const defaultAlt = getDefaultAlt(backgroundImage)\n\n return (\n <div\n className={cn(\n 'rounded-card relative flex flex-col overflow-hidden',\n 'desktop:px-6 h-[280px] p-4',\n 'laptop:gap-4 gap-3',\n 'laptop:h-[320px] lg-desktop:[400px]',\n classNames?.card\n )}\n data-headless-type-name={`${componentType}#${componentName}`}\n >\n <Link\n asChild={!linkHref}\n href={trackUrlRef(linkHref, `${componentType}_${componentName}`)}\n className=\"no-underline\"\n >\n {/* \u54CD\u5E94\u5F0F\u80CC\u666F\u56FE\u7247 */}\n {responsiveSource && (\n <Picture\n source={responsiveSource}\n alt={defaultAlt || title}\n className={cn('absolute inset-0 size-full', classNames?.background)}\n imgClassName=\"size-full object-cover\"\n />\n )}\n\n {/* \u6587\u672C\u5185\u5BB9\u533A\u57DF */}\n <div className=\"relative z-10\">\n <Heading as=\"h3\" size={3} className={cn(titleVariants({ theme }), classNames?.title)}>\n {title}\n </Heading>\n <Text as=\"p\" className={cn(descriptionVariants({ theme }), classNames?.description)}>\n {description}\n </Text>\n {linkText && linkHref && (\n <Button\n variant=\"link\"\n as=\"a\"\n href={trackUrlRef(linkHref, `${componentType}_${componentName}`)}\n className={cn(linkVariants({ theme }), classNames?.link)}\n data-headless-title-desc-button={`${title}#${description}#${linkText}`}\n >\n {linkText}\n </Button>\n )}\n </div>\n </Link>\n </div>\n )\n}\n\n/**\n * ActivityMechanism - \u6D3B\u52A8\u673A\u5236\u7EC4\u4EF6\n *\n * @description \u5C55\u793A\u6D3B\u52A8\u673A\u5236/\u4F1A\u5458\u6743\u76CA\u7B49\u5361\u7247\u5217\u8868\u7684\u7EC4\u4EF6\uFF0C\u652F\u6301\u54CD\u5E94\u5F0F\u5E03\u5C40\u548C\u4E3B\u9898\u5207\u6362\n */\nconst ActivityMechanism = React.forwardRef<HTMLDivElement, ActivityMechanismProps>(({ data, classNames }, ref) => {\n const { items = [], theme = 'light' } = data\n\n const innerRef = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: items[0]?.title || '',\n componentDescription: items[0]?.description || '',\n })\n\n if (!items || items.length === 0) {\n return null\n }\n\n // \u6839\u636E items \u6570\u91CF\u6620\u5C04 laptop/desktop/lg-desktop \u7684\u5217\u6570\u7C7B\u540D\n // \u4F7F\u7528\u663E\u5F0F\u7C7B\u540D\u6620\u5C04\u4EE5\u786E\u4FDD Tailwind \u80FD\u6B63\u786E\u626B\u63CF\n const gridColsMap: Record<number, string> = {\n 1: 'laptop:grid-cols-1 desktop:grid-cols-1 lg-desktop:grid-cols-1',\n 2: 'laptop:grid-cols-2 desktop:grid-cols-2 lg-desktop:grid-cols-2',\n 3: 'tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-3 lg-desktop:grid-cols-3',\n 4: 'laptop:grid-cols-4 desktop:grid-cols-4 lg-desktop:grid-cols-4',\n }\n const gridColsClass = gridColsMap[Math.min(items.length, 4)] || gridColsMap[4]\n\n return (\n <Container\n data-ui-component-id=\"ActivityMechanism\"\n className={cn('activity-mechanism', 'w-full', classNames?.root)}\n ref={innerRef}\n >\n <div className={cn('tablet:grid-cols-2 laptop:gap-4 grid grid-cols-1 gap-3', gridColsClass, classNames?.grid)}>\n {items.map((item, index) => (\n <ActivityMechanismCard\n key={`${item.title}-${index}`}\n item={item}\n theme={theme}\n classNames={{\n ...classNames,\n ...(items?.length === 3 && {\n card: classNames?.card + ' ' + 'first:tablet:col-span-full first:laptop:col-span-1',\n }),\n }}\n />\n ))}\n </div>\n </Container>\n )\n})\n\nActivityMechanism.displayName = 'ActivityMechanism'\n\nexport default withLayout(ActivityMechanism)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,G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E,KAAAC,EAAM,WAAAT,CAAW,EAAGU,IAAQ,CAChH,KAAM,CAAE,MAAAC,EAAQ,CAAC,EAAG,MAAAZ,EAAQ,OAAQ,EAAIU,EAElCG,KAAW,UAAuB,IAAI,EAW5C,MATA,uBAAoBF,EAAK,IAAME,EAAS,OAAyB,KAEjE,eAAYA,EAAU,CACpB,cAAAzB,EACA,cAAAC,EACA,eAAgBuB,EAAM,CAAC,GAAG,OAAS,GACnC,qBAAsBA,EAAM,CAAC,GAAG,aAAe,EACjD,CAAC,EAEG,CAACA,GAASA,EAAM,SAAW,EAC7B,OAAO,KAKT,MAAME,EAAsC,CAC1C,EAAG,gEACH,EAAG,gEACH,EAAG,mFACH,EAAG,+DACL,EACMC,EAAgBD,EAAY,KAAK,IAAIF,EAAM,OAAQ,CAAC,CAAC,GAAKE,EAAY,CAAC,EAE7E,SACE,OAAC,aACC,uBAAqB,oBACrB,aAAW,MAAG,qBAAsB,SAAUb,GAAY,IAAI,EAC9D,IAAKY,EAEL,mBAAC,OAAI,aAAW,MAAG,yDAA0DE,EAAed,GAAY,IAAI,EACzG,SAAAW,EAAM,IAAI,CAACb,EAAMiB,OAChB,OAAClB,EAAA,CAEC,KAAMC,EACN,MAAOC,EACP,WAAY,CACV,GAAGC,EACH,GAAIW,GAAO,SAAW,GAAK,CACzB,KAAMX,GAAY,KAAO,qDAC3B,CACF,GARK,GAAGF,EAAK,KAAK,IAAIiB,CAAK,EAS7B,CACD,EACH,EACF,CAEJ,CAAC,EAEDR,EAAkB,YAAc,oBAEhC,IAAO9B,KAAQ,cAAW8B,CAAiB",
6
+ "names": ["ActivityMechanism_exports", "__export", "ActivityMechanism_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_Styles", "import_utils", "import_useExposure", "import_trackUrlRef", "import_class_variance_authority", "componentType", "componentName", "titleVariants", "descriptionVariants", "linkVariants", "BREAKPOINTS", "buildResponsiveSource", "backgroundImage", "sources", "getDefaultAlt", "ActivityMechanismCard", "item", "theme", "classNames", "title", "description", "linkText", "linkHref", "responsiveSource", "defaultAlt", "ActivityMechanism", "React", "data", "ref", "items", "innerRef", "gridColsMap", "gridColsClass", "index"]
7
+ }
@@ -0,0 +1,43 @@
1
+ import type { ComponentCommonProps, Media, Theme } from '../../types/props.js';
2
+ /**
3
+ * 响应式背景图片类型
4
+ * 支持 5 个断点的图片配置
5
+ */
6
+ export interface ResponsiveBackgroundImage {
7
+ /** 默认图片 (<768px 移动端) */
8
+ default?: Media;
9
+ /** tablet 断点图片 (≥768px) */
10
+ tablet?: Media;
11
+ /** laptop 断点图片 (≥1025px) */
12
+ laptop?: Media;
13
+ /** desktop 断点图片 (≥1440px) */
14
+ desktop?: Media;
15
+ /** lg-desktop 断点图片 (≥1920px) */
16
+ lgDesktop?: Media;
17
+ }
18
+ export interface ActivityMechanismItem {
19
+ /** 标题 */
20
+ title: string;
21
+ /** 描述文本 */
22
+ description: string;
23
+ /** 链接文本 */
24
+ linkText?: string;
25
+ /** 链接地址 */
26
+ linkHref?: string;
27
+ /** 响应式背景图片(支持 5 个断点) */
28
+ backgroundImage?: ResponsiveBackgroundImage;
29
+ }
30
+ /**
31
+ * 语义化类名
32
+ */
33
+ export type ActivityMechanismSemanticName = 'root' | 'grid' | 'card' | 'background' | 'title' | 'description' | 'link';
34
+ export interface ActivityMechanismProps extends ComponentCommonProps {
35
+ data: {
36
+ /** 活动机制列表 */
37
+ items: ActivityMechanismItem[];
38
+ /** 主题 */
39
+ theme?: Theme;
40
+ };
41
+ /** 语义化类名 */
42
+ classNames?: Partial<Record<ActivityMechanismSemanticName, string>>;
43
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var n=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var c=(t,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of s(e))!m.call(t,i)&&i!==o&&n(t,i,{get:()=>e[i],enumerable:!(a=r(e,i))||a.enumerable});return t};var p=t=>c(n({},"__esModule",{value:!0}),t);var d={};module.exports=p(d);
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/ActivityMechanism/types.ts"],
4
+ "sourcesContent": ["import type { ComponentCommonProps, Media, Theme } from '../../types/props.js'\n\n/**\n * \u54CD\u5E94\u5F0F\u80CC\u666F\u56FE\u7247\u7C7B\u578B\n * \u652F\u6301 5 \u4E2A\u65AD\u70B9\u7684\u56FE\u7247\u914D\u7F6E\n */\nexport interface ResponsiveBackgroundImage {\n /** \u9ED8\u8BA4\u56FE\u7247 (<768px \u79FB\u52A8\u7AEF) */\n default?: Media\n /** tablet \u65AD\u70B9\u56FE\u7247 (\u2265768px) */\n tablet?: Media\n /** laptop \u65AD\u70B9\u56FE\u7247 (\u22651025px) */\n laptop?: Media\n /** desktop \u65AD\u70B9\u56FE\u7247 (\u22651440px) */\n desktop?: Media\n /** lg-desktop \u65AD\u70B9\u56FE\u7247 (\u22651920px) */\n lgDesktop?: Media\n}\n\nexport interface ActivityMechanismItem {\n /** \u6807\u9898 */\n title: string\n /** \u63CF\u8FF0\u6587\u672C */\n description: string\n /** \u94FE\u63A5\u6587\u672C */\n linkText?: string\n /** \u94FE\u63A5\u5730\u5740 */\n linkHref?: string\n /** \u54CD\u5E94\u5F0F\u80CC\u666F\u56FE\u7247\uFF08\u652F\u6301 5 \u4E2A\u65AD\u70B9\uFF09 */\n backgroundImage?: ResponsiveBackgroundImage\n}\n\n/**\n * \u8BED\u4E49\u5316\u7C7B\u540D\n */\nexport type ActivityMechanismSemanticName = 'root' | 'grid' | 'card' | 'background' | 'title' | 'description' | 'link'\n\nexport interface ActivityMechanismProps extends ComponentCommonProps {\n data: {\n /** \u6D3B\u52A8\u673A\u5236\u5217\u8868 */\n items: ActivityMechanismItem[]\n /** \u4E3B\u9898 */\n theme?: Theme\n }\n /** \u8BED\u4E49\u5316\u7C7B\u540D */\n classNames?: Partial<Record<ActivityMechanismSemanticName, string>>\n}\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["types_exports", "__toCommonJS"]
7
+ }
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import type { ActivityScheduleProps } from './types.js';
3
+ declare const _default: React.ForwardRefExoticComponent<Omit<ActivityScheduleProps & React.RefAttributes<HTMLDivElement> & {
4
+ style?: string | React.CSSProperties;
5
+ container?: import("../../shared/Styles.js").ContainerProps["container"];
6
+ }, "ref"> & React.RefAttributes<any>>;
7
+ export default _default;
8
+ export type { ActivityScheduleProps, ActivityScheduleData, ActivityScheduleItem } from './types.js';
@@ -0,0 +1,2 @@
1
+ "use strict";"use client";var C=Object.create;var p=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var B=(e,t)=>{for(var a in t)p(e,a,{get:t[a],enumerable:!0})},g=(e,t,a,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of V(t))!z.call(e,s)&&s!==a&&p(e,s,{get:()=>t[s],enumerable:!(c=P(t,s))||c.enumerable});return e};var E=(e,t,a)=>(a=e!=null?C(I(e)):{},g(t||!e||!e.__esModule?p(a,"default",{value:e,enumerable:!0}):a,e)),L=e=>g(p({},"__esModule",{value:!0}),e);var R={};B(R,{default:()=>M});module.exports=L(R);var i=require("react/jsx-runtime"),v=E(require("react")),d=require("../../helpers/index.js"),l=require("../../components/index.js"),f=require("class-variance-authority"),h=require("swiper/react"),y=require("../../shared/Styles.js");const j=(0,f.cva)("rounded-card laptop:px-6 laptop:py-4 relative flex min-w-0 flex-col justify-between gap-2 overflow-hidden px-4 py-3",{variants:{state:{"active-light":"bg-gradient-to-r from-[#3555aa] to-[#6988e3]","active-dark":"bg-gradient-to-r from-[#3555aa] to-[#6988e3]","inactive-light":"bg-[#EAEAEC]","inactive-dark":"bg-[#1E2024]"},size:{small:"laptop:h-[160px] h-[120px]",large:"laptop:h-[240px] h-[200px]"}},defaultVariants:{state:"inactive-light",size:"small"}}),u=(0,f.cva)("font-bold leading-[1.2]",{variants:{state:{"active-light":"text-white","active-dark":"text-white","inactive-light":"text-[#080A0F]","inactive-dark":"text-white"}},defaultVariants:{state:"inactive-light"}}),w=v.memo(({item:e,theme:t="light",className:a,size:c})=>{const s=e.isActive||!1,o=`${s?"active":"inactive"}-${t}`;return(0,i.jsxs)("div",{className:(0,d.cn)(j({state:o,size:c}),a),"data-ui-component-id":"ActivityScheduleCard",children:[(s?e.activeIcon:e.inactiveIcon)&&(0,i.jsx)("div",{className:"laptop:w-[160px] aspect-1 absolute right-0 top-0 z-10 w-[120px]",children:(0,i.jsx)(l.Picture,{source:s?e.activeIcon.url:e.inactiveIcon.url,alt:s?e.activeIcon.alt:e.inactiveIcon.alt,className:"aspect-square"})}),(0,i.jsxs)("div",{className:"relative z-20 flex h-full flex-col justify-between",children:[(0,i.jsx)(l.Heading,{as:"h3",size:3,html:e.title,className:(0,d.cn)(u({state:o}))}),(0,i.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,i.jsx)("div",{className:"flex flex-col justify-end overflow-hidden",children:(0,i.jsx)(l.Heading,{as:"h4",size:2,html:e.subtitle,className:(0,d.cn)(" line-clamp-2",u({state:o}))})}),c==="large"&&e.description&&(0,i.jsx)(l.Text,{html:e.description,className:(0,d.cn)("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-3 text-[14px] leading-[1.4]",u({state:o}))})]})]})]})});w.displayName="ActivityScheduleCard";const x=v.forwardRef(({classNames:e={},data:t,...a},c)=>{const s=t.theme||"light",o=t.size||"large",r=v.useMemo(()=>t?.scheduleList?.length||2,[t?.scheduleList]),S=v.useMemo(()=>{const n=N=>{switch(N){case"mobile":return{slidesPerView:1.17,spaceBetween:12};case"tablet":return r===2?{slidesPerView:2,spaceBetween:12}:{slidesPerView:2.4,spaceBetween:12};case"laptop":return r===2?{}:r===4?{slidesPerView:3.2,spaceBetween:16}:{slidesPerView:r,spaceBetween:16};case"desktop":return r===2?{slidesPerView:2,spaceBetween:16}:{slidesPerView:r,spaceBetween:16}}},m=n("mobile"),b=n("tablet"),A=n("laptop"),k=n("desktop");return{0:m,768:b,1024:A,1440:k}},[r]);return(0,i.jsx)(l.Container,{ref:c,className:(0,d.cn)(e?.root),childClassName:"overflow-hidden","data-ui-component-id":"ActivitySchedule",...a,children:(0,i.jsx)(h.Swiper,{breakpoints:S,className:"w-full !overflow-visible",children:t.scheduleList.map((n,m)=>(0,i.jsx)(h.SwiperSlide,{children:(0,i.jsx)(w,{item:n,theme:s,size:o,className:e?.card})},"activityScheduleCardItem"+m))})})});x.displayName="ActivitySchedule";var M=(0,y.withLayout)(x);
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/ActivitySchedule/index.tsx"],
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport { Text, Picture, Heading, Container } from '../../components/index.js'\nimport { cva } from 'class-variance-authority'\nimport type { ActivityScheduleProps, ActivityScheduleItem } from './types.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { withLayout } from '../../shared/Styles.js'\n\n/**\n * Card style variants for activity schedule\n */\nconst activityCardVariants = cva(\n 'rounded-card laptop:px-6 laptop:py-4 relative flex min-w-0 flex-col justify-between gap-2 overflow-hidden px-4 py-3',\n {\n variants: {\n state: {\n // Active state - gradient background\n 'active-light': 'bg-gradient-to-r from-[#3555aa] to-[#6988e3]',\n 'active-dark': 'bg-gradient-to-r from-[#3555aa] to-[#6988e3]',\n // Inactive state - solid background\n 'inactive-light': 'bg-[#EAEAEC]',\n 'inactive-dark': 'bg-[#1E2024]',\n },\n size: {\n // Small size - 120px height with responsive scaling\n small: 'laptop:h-[160px] h-[120px]',\n // Large size - 200px height with responsive scaling\n large: 'laptop:h-[240px] h-[200px]',\n },\n },\n defaultVariants: {\n state: 'inactive-light',\n size: 'small',\n },\n }\n)\n\n/**\n * Text style variants for card\n */\nconst cardTextVariants = cva('font-bold leading-[1.2]', {\n variants: {\n state: {\n // Active state - white text\n 'active-light': 'text-white',\n 'active-dark': 'text-white',\n // Inactive state - dark text\n 'inactive-light': 'text-[#080A0F]',\n 'inactive-dark': 'text-white',\n },\n },\n defaultVariants: {\n state: 'inactive-light',\n },\n})\n\n/**\n * Activity Schedule Card Component\n */\nconst ActivityScheduleCard = React.memo(\n ({\n item,\n theme = 'light',\n className,\n size,\n }: {\n item: ActivityScheduleItem\n theme?: 'light' | 'dark'\n className?: string\n size: 'small' | 'large'\n }) => {\n const isActive = item.isActive || false\n\n // Calculate combined state\n const cardState = `${isActive ? 'active' : 'inactive'}-${theme}` as\n | 'active-light'\n | 'active-dark'\n | 'inactive-light'\n | 'inactive-dark'\n\n return (\n <div\n className={cn(activityCardVariants({ state: cardState, size }), className)}\n data-ui-component-id=\"ActivityScheduleCard\"\n >\n {/* Background decoration icon - show activeIcon when active, inactiveIcon when inactive */}\n {(isActive ? item.activeIcon : item.inactiveIcon) && (\n <div className=\"laptop:w-[160px] aspect-1 absolute right-0 top-0 z-10 w-[120px]\">\n <Picture\n source={isActive ? item.activeIcon!.url : item.inactiveIcon!.url}\n alt={isActive ? item.activeIcon!.alt : item.inactiveIcon!.alt}\n className=\"aspect-square\"\n />\n </div>\n )}\n\n {/* Content area */}\n <div className=\"relative z-20 flex h-full flex-col justify-between\">\n {/* Title */}\n <Heading as=\"h3\" size={3} html={item.title} className={cn(cardTextVariants({ state: cardState }))} />\n\n <div className=\"flex flex-col gap-1\">\n {/* Subtitle */}\n <div className=\"flex flex-col justify-end overflow-hidden\">\n <Heading\n as=\"h4\"\n size={2}\n html={item.subtitle}\n className={cn(' line-clamp-2', cardTextVariants({ state: cardState }))}\n />\n </div>\n {/* Detailed description - only show when size is large */}\n {size === 'large' && item.description && (\n <Text\n html={item.description}\n className={cn(\n 'lg-desktop:text-[18px] desktop:text-[16px] line-clamp-3 text-[14px] leading-[1.4]',\n cardTextVariants({ state: cardState })\n )}\n />\n )}\n </div>\n </div>\n </div>\n )\n }\n)\n\nActivityScheduleCard.displayName = 'ActivityScheduleCard'\n\n/**\n * ActivitySchedule - Activity Schedule Component\n *\n * @description Display activity schedule card list with active/inactive states, theme switching, and responsive layout\n */\nconst ActivitySchedule = React.forwardRef<HTMLDivElement, ActivityScheduleProps>(\n ({ classNames = {}, data, ...rest }, ref) => {\n const theme = data.theme || 'light'\n const size = data.size || 'large'\n\n const itemsPerRow = React.useMemo(() => {\n return data?.scheduleList?.length || 2\n }, [data?.scheduleList])\n\n const swiperBreakpoints = React.useMemo(() => {\n const getBreakpointConfig = (breakpoint: 'mobile' | 'tablet' | 'laptop' | 'desktop') => {\n switch (breakpoint) {\n case 'mobile':\n return { slidesPerView: 1.17, spaceBetween: 12 }\n case 'tablet':\n if (itemsPerRow === 2) return { slidesPerView: 2, spaceBetween: 12 }\n return { slidesPerView: 2.4, spaceBetween: 12 }\n case 'laptop':\n if (itemsPerRow === 2) return {}\n if (itemsPerRow === 4) return { slidesPerView: 3.2, spaceBetween: 16 }\n return { slidesPerView: itemsPerRow, spaceBetween: 16 }\n case 'desktop':\n if (itemsPerRow === 2) return { slidesPerView: 2, spaceBetween: 16 }\n return { slidesPerView: itemsPerRow, spaceBetween: 16 }\n }\n }\n\n const mobileConfig = getBreakpointConfig('mobile')\n const tabletConfig = getBreakpointConfig('tablet')\n const laptopConfig = getBreakpointConfig('laptop')\n const desktopConfig = getBreakpointConfig('desktop')\n\n return {\n 0: mobileConfig,\n 768: tabletConfig,\n 1024: laptopConfig,\n 1440: desktopConfig,\n }\n }, [itemsPerRow])\n\n return (\n <Container\n ref={ref}\n className={cn(classNames?.root)}\n childClassName=\"overflow-hidden\"\n data-ui-component-id=\"ActivitySchedule\"\n {...rest}\n >\n <Swiper breakpoints={swiperBreakpoints} className=\"w-full !overflow-visible\">\n {data.scheduleList.map((item, index) => (\n <SwiperSlide key={'activityScheduleCardItem' + index}>\n <ActivityScheduleCard item={item} theme={theme} size={size} className={classNames?.card} />\n </SwiperSlide>\n ))}\n </Swiper>\n </Container>\n )\n }\n)\n\nActivitySchedule.displayName = 'ActivitySchedule'\n\nexport default withLayout(ActivitySchedule)\nexport type { ActivityScheduleProps, ActivityScheduleData, ActivityScheduleItem } from './types.js'\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA0FY,IAAAI,EAAA,6BAxFZC,EAAuB,oBACvBC,EAAmB,kCACnBC,EAAkD,qCAClDC,EAAoB,oCAEpBC,EAAoC,wBACpCC,EAA2B,kCAK3B,MAAMC,KAAuB,OAC3B,sHACA,CACE,SAAU,CACR,MAAO,CAEL,eAAgB,+CAChB,cAAe,+CAEf,iBAAkB,eAClB,gBAAiB,cACnB,EACA,KAAM,CAEJ,MAAO,6BAEP,MAAO,4BACT,CACF,EACA,gBAAiB,CACf,MAAO,iBACP,KAAM,OACR,CACF,CACF,EAKMC,KAAmB,OAAI,0BAA2B,CACtD,SAAU,CACR,MAAO,CAEL,eAAgB,aAChB,cAAe,aAEf,iBAAkB,iBAClB,gBAAiB,YACnB,CACF,EACA,gBAAiB,CACf,MAAO,gBACT,CACF,CAAC,EAKKC,EAAuBR,EAAM,KACjC,CAAC,CACC,KAAAS,EACA,MAAAC,EAAQ,QACR,UAAAC,EACA,KAAAC,CACF,IAKM,CACJ,MAAMC,EAAWJ,EAAK,UAAY,GAG5BK,EAAY,GAAGD,EAAW,SAAW,UAAU,IAAIH,CAAK,GAM9D,SACE,QAAC,OACC,aAAW,MAAGJ,EAAqB,CAAE,MAAOQ,EAAW,KAAAF,CAAK,CAAC,EAAGD,CAAS,EACzE,uBAAqB,uBAGnB,WAAAE,EAAWJ,EAAK,WAAaA,EAAK,kBAClC,OAAC,OAAI,UAAU,kEACb,mBAAC,WACC,OAAQI,EAAWJ,EAAK,WAAY,IAA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AAG,EACxD,IAAK,UACH,OAAIA,IAAgB,EAAU,CAAE,cAAe,EAAG,aAAc,EAAG,EAC5D,CAAE,cAAeA,EAAa,aAAc,EAAG,CAC1D,CACF,EAEMI,EAAeF,EAAoB,QAAQ,EAC3CG,EAAeH,EAAoB,QAAQ,EAC3CI,EAAeJ,EAAoB,QAAQ,EAC3CK,EAAgBL,EAAoB,SAAS,EAEnD,MAAO,CACL,EAAGE,EACH,IAAKC,EACL,KAAMC,EACN,KAAMC,CACR,CACF,EAAG,CAACP,CAAW,CAAC,EAEhB,SACE,OAAC,aACC,IAAKD,EACL,aAAW,MAAGH,GAAY,IAAI,EAC9B,eAAe,kBACf,uBAAqB,mBACpB,GAAGE,EAEJ,mBAAC,UAAO,YAAaG,EAAmB,UAAU,2BAC/C,SAAAJ,EAAK,aAAa,IAAI,CAACR,EAAMmB,OAC5B,OAAC,eACC,mBAACpB,EAAA,CAAqB,KAAMC,EAAM,MAAOC,EAAO,KAAME,EAAM,UAAWI,GAAY,KAAM,GADzE,2BAA6BY,CAE/C,CACD,EACH,EACF,CAEJ,CACF,EAEAb,EAAiB,YAAc,mBAE/B,IAAOlB,KAAQ,cAAWkB,CAAgB",
6
+ "names": ["ActivitySchedule_exports", "__export", "ActivitySchedule_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_components", "import_class_variance_authority", "import_react", "import_Styles", "activityCardVariants", "cardTextVariants", "ActivityScheduleCard", "item", "theme", "className", "size", "isActive", "cardState", "ActivitySchedule", "classNames", "data", "rest", "ref", "itemsPerRow", "swiperBreakpoints", "getBreakpointConfig", "breakpoint", "mobileConfig", "tabletConfig", "laptopConfig", "desktopConfig", "index"]
7
+ }
@@ -0,0 +1,42 @@
1
+ import type { Media } from '../../types/props.js';
2
+ /**
3
+ * 活动日程项数据接口
4
+ */
5
+ export interface ActivityScheduleItem {
6
+ /** 活动标题 */
7
+ title: string;
8
+ /** 活动副标题 */
9
+ subtitle: string;
10
+ /** 活动详细描述(可选,用于完整版) */
11
+ description?: string;
12
+ /** 激活状态装饰图标 */
13
+ activeIcon?: Media;
14
+ /** 非激活状态装饰图标 */
15
+ inactiveIcon?: Media;
16
+ /** 是否为激活状态(激活状态显示渐变背景) */
17
+ isActive?: boolean;
18
+ }
19
+ /**
20
+ * 活动日程组件数据接口
21
+ */
22
+ export interface ActivityScheduleData {
23
+ /** 活动列表 */
24
+ scheduleList: ActivityScheduleItem[];
25
+ /** 主题模式,默认为 light */
26
+ theme?: 'light' | 'dark';
27
+ /** 卡片尺寸,默认为 small */
28
+ size?: 'small' | 'large';
29
+ }
30
+ /**
31
+ * 语义化类名
32
+ */
33
+ export type ActivityScheduleSemanticName = 'root' | 'card';
34
+ /**
35
+ * 活动日程组件 Props
36
+ */
37
+ export interface ActivityScheduleProps extends React.HTMLAttributes<HTMLDivElement> {
38
+ /** 业务数据 */
39
+ data: ActivityScheduleData;
40
+ /** 语义化类名 */
41
+ classNames?: Partial<Record<ActivityScheduleSemanticName, string>>;
42
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var a=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var n=(t,e,r,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of l(e))!d.call(t,i)&&i!==r&&a(t,i,{get:()=>e[i],enumerable:!(c=s(e,i))||c.enumerable});return t};var o=t=>n(a({},"__esModule",{value:!0}),t);var m={};module.exports=o(m);
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/ActivitySchedule/types.ts"],
4
+ "sourcesContent": ["import type { Media } from '../../types/props.js'\n\n/**\n * \u6D3B\u52A8\u65E5\u7A0B\u9879\u6570\u636E\u63A5\u53E3\n */\nexport interface ActivityScheduleItem {\n /** \u6D3B\u52A8\u6807\u9898 */\n title: string\n /** \u6D3B\u52A8\u526F\u6807\u9898 */\n subtitle: string\n /** \u6D3B\u52A8\u8BE6\u7EC6\u63CF\u8FF0\uFF08\u53EF\u9009\uFF0C\u7528\u4E8E\u5B8C\u6574\u7248\uFF09 */\n description?: string\n /** \u6FC0\u6D3B\u72B6\u6001\u88C5\u9970\u56FE\u6807 */\n activeIcon?: Media\n /** \u975E\u6FC0\u6D3B\u72B6\u6001\u88C5\u9970\u56FE\u6807 */\n inactiveIcon?: Media\n /** \u662F\u5426\u4E3A\u6FC0\u6D3B\u72B6\u6001\uFF08\u6FC0\u6D3B\u72B6\u6001\u663E\u793A\u6E10\u53D8\u80CC\u666F\uFF09 */\n isActive?: boolean\n}\n\n/**\n * \u6D3B\u52A8\u65E5\u7A0B\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface ActivityScheduleData {\n /** \u6D3B\u52A8\u5217\u8868 */\n scheduleList: ActivityScheduleItem[]\n /** \u4E3B\u9898\u6A21\u5F0F\uFF0C\u9ED8\u8BA4\u4E3A light */\n theme?: 'light' | 'dark'\n /** \u5361\u7247\u5C3A\u5BF8\uFF0C\u9ED8\u8BA4\u4E3A small */\n size?: 'small' | 'large'\n}\n\n/**\n * \u8BED\u4E49\u5316\u7C7B\u540D\n */\nexport type ActivityScheduleSemanticName = 'root' | 'card'\n\n/**\n * \u6D3B\u52A8\u65E5\u7A0B\u7EC4\u4EF6 Props\n */\nexport interface ActivityScheduleProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: ActivityScheduleData\n /** \u8BED\u4E49\u5316\u7C7B\u540D */\n classNames?: Partial<Record<ActivityScheduleSemanticName, string>>\n}\n"],
5
+ "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
+ "names": ["types_exports", "__toCommonJS"]
7
+ }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var x=Object.create;var d=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var N=(e,i)=>{for(var r in i)d(e,r,{get:i[r],enumerable:!0})},p=(e,i,r,a)=>{if(i&&typeof i=="object"||typeof i=="function")for(let s of u(i))!b.call(e,s)&&s!==r&&d(e,s,{get:()=>i[s],enumerable:!(a=f(i,s))||a.enumerable});return e};var n=(e,i,r)=>(r=e!=null?x(v(e)):{},p(i||!e||!e.__esModule?d(r,"default",{value:e,enumerable:!0}):r,e)),h=e=>p(d({},"__esModule",{value:!0}),e);var z={};N(z,{default:()=>k});module.exports=h(z);var t=require("react/jsx-runtime"),y=n(require("react")),l=require("../../helpers/index.js"),m=n(require("../../components/picture.js")),o=require("../../components/text.js");const c=y.forwardRef(({gift:e,onClick:i,className:r,giftType:a},s)=>(0,t.jsx)("div",{ref:s,className:(0,l.cn)("bg-container-primary laptop:rounded-[8px] border-lines relative flex w-full flex-col overflow-hidden rounded-[6px] border-2 transition-all","desktop:min-h-[88px] min-h-[80px]",a===2?"border-brand-0 cursor-default":`cursor-pointer hover:shadow-sm ${e.selected?"border-brand-0 bg-secondary-1":"border-lines bg-secondary-0"}`,r),onClick:()=>{a===1&&i?.(e)},children:(0,t.jsxs)("div",{className:"flex size-full flex-col items-end",children:[e.tag&&(0,t.jsx)("div",{className:"absolute right-0 top-0 z-10 flex items-start",children:(0,t.jsx)("div",{className:"bg-brand-0 lg-desktop:text-[16px] laptop:rounded-bl-[8px] rounded-bl-[6px] px-[6px] pb-[4px] pt-[3px] text-[14px] font-bold text-white",children:e.tag})}),(0,t.jsxs)("div",{className:(0,l.cn)("flex size-full items-center gap-4 p-4","tablet:p-2"),children:[(0,t.jsx)("div",{className:(0,l.cn)("size-14 shrink-0","tablet:size-12"),children:(0,t.jsx)(m.default,{source:e.image,alt:e.name,className:"size-full rounded object-cover"})}),(0,t.jsxs)("div",{className:"flex h-full min-w-0 flex-1 flex-col justify-center gap-1 py-1",children:[(0,t.jsx)(o.Text,{size:2,html:e.name,className:(0,l.cn)("text-info-primary desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1")}),(0,t.jsxs)("div",{className:"mt-auto flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Text,{size:2,className:(0,l.cn)("text-info-primary desktop:text-[16px] lg-desktop:text-[18px]"),children:e.currentPrice}),e.originalPrice&&e.originalPrice!==e.currentPrice&&(0,t.jsx)(o.Text,{size:2,className:(0,l.cn)("text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] pr-6 line-through"),children:e.originalPrice})]}),e.quantity>1&&(0,t.jsxs)(o.Text,{size:4,className:(0,l.cn)("self-end"),children:["x",e.quantity]})]})]})]})]})}));c.displayName="FreeGiftItem";var k=c;
1
+ "use strict";var x=Object.create;var d=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,b=Object.prototype.hasOwnProperty;var N=(e,r)=>{for(var i in r)d(e,i,{get:r[i],enumerable:!0})},p=(e,r,i,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of u(r))!b.call(e,s)&&s!==i&&d(e,s,{get:()=>r[s],enumerable:!(a=f(r,s))||a.enumerable});return e};var n=(e,r,i)=>(i=e!=null?x(v(e)):{},p(r||!e||!e.__esModule?d(i,"default",{value:e,enumerable:!0}):i,e)),h=e=>p(d({},"__esModule",{value:!0}),e);var z={};N(z,{default:()=>k});module.exports=h(z);var t=require("react/jsx-runtime"),y=n(require("react")),l=require("../../helpers/index.js"),c=n(require("../../components/picture.js")),o=require("../../components/text.js");const m=y.forwardRef(({gift:e,onClick:r,className:i,giftType:a},s)=>(0,t.jsx)("div",{ref:s,className:(0,l.cn)("bg-container-primary laptop:rounded-[8px] border-lines relative flex w-full flex-col overflow-hidden rounded-[6px] border-2 transition-all","desktop:min-h-[88px] min-h-[80px]",a===2?"border-brand-0 cursor-default":`cursor-pointer hover:shadow-sm ${e.selected?"border-brand-0 bg-secondary-1":"border-lines bg-secondary-0"}`,i),onClick:()=>{a===1&&r?.(e)},children:(0,t.jsxs)("div",{className:"flex size-full flex-col items-end",children:[e.tag&&(0,t.jsx)("div",{className:"absolute right-0 top-0 z-10 flex items-start",children:(0,t.jsx)("div",{className:"bg-brand-0 lg-desktop:text-[16px] laptop:rounded-bl-[8px] rounded-bl-[6px] px-[6px] pb-[4px] pt-[3px] text-[14px] font-bold text-white",children:e.tag})}),(0,t.jsxs)("div",{className:(0,l.cn)("flex size-full items-center gap-4 p-4","tablet:p-2"),children:[(0,t.jsx)("div",{className:(0,l.cn)("size-14 shrink-0","tablet:size-12"),children:(0,t.jsx)(c.default,{source:e.image,alt:e.name,className:"size-full rounded object-cover"})}),(0,t.jsxs)("div",{className:"flex h-full min-w-0 flex-1 flex-col justify-center gap-1 py-1",children:[(0,t.jsx)(o.Text,{size:2,html:e.name,className:(0,l.cn)("text-info-primary desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1")}),(0,t.jsxs)("div",{className:"mt-auto flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Text,{size:2,className:(0,l.cn)("text-info-primary desktop:text-[16px] lg-desktop:text-[18px]"),children:e.currentPrice}),e.originalPrice&&e.originalPrice!==e.currentPrice&&(0,t.jsx)(o.Text,{size:2,className:(0,l.cn)("text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] pr-6 line-through"),children:e.originalPrice})]}),e.quantity>1&&(0,t.jsxs)(o.Text,{size:4,className:(0,l.cn)("self-end"),children:["x",e.quantity]})]})]})]})]})}));m.displayName="FreeGiftItem";var k=m;
2
2
  //# sourceMappingURL=FreeGiftItem.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/BuyOneGetOneShelf/FreeGiftItem.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport Picture from '../../components/picture.js'\nimport { Text } from '../../components/text.js'\n\nimport type { FreeGift, FreeGiftWithSelection } from './types.js'\n\nexport interface FreeGiftItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'> {\n /** \u8D60\u54C1\u6570\u636E\uFF08\u5305\u542B\u9009\u62E9\u72B6\u6001\uFF09 */\n gift: FreeGiftWithSelection\n /** \u70B9\u51FB\u56DE\u8C03 */\n onClick?: (gift: FreeGift) => void\n /** \u8D60\u54C1\u7C7B\u578B 1-> \u5355\u9009\u6A21\u5F0F\uFF0C 2 -> \u5168\u9009\u6A21\u5F0F */\n giftType?: 1 | 2\n}\n\n/**\n * FreeGiftItem - \u514D\u8D39\u8D60\u54C1\u9879\n */\nconst FreeGiftItem = React.forwardRef<HTMLDivElement, FreeGiftItemProps>(\n ({ gift, onClick, className, giftType }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-primary laptop:rounded-[8px] border-lines relative flex w-full flex-col overflow-hidden rounded-[6px] border-2 transition-all',\n 'desktop:min-h-[88px] min-h-[80px]', // \u56FA\u5B9A\u6700\u5C0F\u9AD8\u5EA6\u786E\u4FDD\u6240\u6709\u5BB9\u5668\u9AD8\u5EA6\u4E00\u81F4\n // \u6837\u5F0F\u6839\u636E gift_type \u548C\u9009\u62E9\u72B6\u6001\u53D8\u5316\n giftType === 2\n ? 'border-brand-0 cursor-default' // \u5168\u9009\u6A21\u5F0F\uFF1A\u59CB\u7EC8\u9009\u4E2D\uFF0C\u4E0D\u53EF\u70B9\u51FB\n : `cursor-pointer hover:shadow-sm ${gift.selected ? 'border-brand-0 bg-secondary-1' : 'border-lines bg-secondary-0'}`, // \u5355\u9009\u6A21\u5F0F\uFF1A\u53EF\u70B9\u51FB\uFF0C\u6839\u636E\u9009\u62E9\u72B6\u6001\u53D8\u5316\u8FB9\u6846\n className\n )}\n onClick={() => {\n // \u53EA\u6709\u5355\u9009\u6A21\u5F0F\u624D\u5141\u8BB8\u70B9\u51FB\n if (giftType === 1) {\n onClick?.(gift)\n }\n }}\n >\n <div className=\"flex size-full flex-col items-end\">\n {gift.tag && (\n <div className=\"absolute right-0 top-0 z-10 flex items-start\">\n <div className=\"bg-brand-0 lg-desktop:text-[16px] laptop:rounded-bl-[8px] rounded-bl-[6px] px-[6px] pb-[4px] pt-[3px] text-[14px] font-bold text-white\">\n {gift.tag}\n </div>\n </div>\n )}\n <div className={cn('flex size-full items-center gap-4 p-4', 'tablet:p-2')}>\n <div className={cn('size-14 shrink-0', 'tablet:size-12')}>\n <Picture source={gift.image} alt={gift.name} className=\"size-full rounded object-cover\" />\n </div>\n <div className=\"flex h-full min-w-0 flex-1 flex-col justify-center gap-1 py-1\">\n <Text\n size={2}\n html={gift.name}\n className={cn('text-info-primary desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1')}\n />\n <div className=\"mt-auto flex items-center justify-between gap-2\">\n <div className=\"flex items-center gap-2\">\n <Text size={2} className={cn('text-info-primary desktop:text-[16px] lg-desktop:text-[18px]')}>\n {gift.currentPrice}\n </Text>\n {gift.originalPrice && gift.originalPrice !== gift.currentPrice && (\n <Text\n size={2}\n className={cn('text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] pr-6 line-through')}\n >\n {gift.originalPrice}\n </Text>\n )}\n </div>\n {gift.quantity > 1 && (\n <Text size={4} className={cn('self-end')}>\n x{gift.quantity}\n </Text>\n )}\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n }\n)\n\nFreeGiftItem.displayName = 'FreeGiftItem'\n\nexport default FreeGiftItem\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA6Cc,IAAAI,EAAA,6BA3CdC,EAAuB,oBACvBC,EAAmB,kCACnBC,EAAoB,0CACpBC,EAAqB,oCAgBrB,MAAMC,EAAeJ,EAAM,WACzB,CAAC,CAAE,KAAAK,EAAM,QAAAC,EAAS,UAAAC,EAAW,SAAAC,CAAS,EAAGC,OAErC,OAAC,OACC,IAAKA,EACL,aAAW,MACT,6IACA,oCAEAD,IAAa,EACT,gCACA,kCAAkCH,EAAK,SAAW,gCAAkC,6BAA6B,GACrHE,CACF,EACA,QAAS,IAAM,CAETC,IAAa,GACfF,IAAUD,CAAI,CAElB,EAEA,oBAAC,OAAI,UAAU,oCACZ,UAAAA,EAAK,QACJ,OAAC,OAAI,UAAU,+CACb,mBAAC,OAAI,UAAU,yIACZ,SAAAA,EAAK,IACR,EACF,KAEF,QAAC,OAAI,aAAW,MAAG,wCAAyC,YAAY,EACtE,oBAAC,OAAI,aAAW,MAAG,mBAAoB,gBAAgB,EACrD,mBAAC,EAAAK,QAAA,CAAQ,OAAQL,EAAK,MAAO,IAAKA,EAAK,KAAM,UAAU,iCAAiC,EAC1F,KACA,QAAC,OAAI,UAAU,gEACb,oBAAC,QACC,KAAM,EACN,KAAMA,EAAK,KACX,aAAW,MAAG,2EAA2E,EAC3F,KACA,QAAC,OAAI,UAAU,kDACb,qBAAC,OAAI,UAAU,0BACb,oBAAC,QAAK,KAAM,EAAG,aAAW,MAAG,8DAA8D,EACxF,SAAAA,EAAK,aACR,EACCA,EAAK,eAAiBA,EAAK,gBAAkBA,EAAK,iBACjD,OAAC,QACC,KAAM,EACN,aAAW,MAAG,iFAAiF,EAE9F,SAAAA,EAAK,cACR,GAEJ,EACCA,EAAK,SAAW,MACf,QAAC,QAAK,KAAM,EAAG,aAAW,MAAG,UAAU,EAAG,cACtCA,EAAK,UACT,GAEJ,GACF,GACF,GACF,EACF,CAGN,EAEAD,EAAa,YAAc,eAE3B,IAAOP,EAAQO",
4
+ "sourcesContent": ["import * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport Picture from '../../components/picture.js'\nimport { Text } from '../../components/text.js'\n\nimport type { FreeGift, FreeGiftWithSelection } from './types.js'\n\nexport interface FreeGiftItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'> {\n /** \u8D60\u54C1\u6570\u636E\uFF08\u5305\u542B\u9009\u62E9\u72B6\u6001\uFF09 */\n gift: FreeGiftWithSelection\n /** \u70B9\u51FB\u56DE\u8C03 */\n onClick?: (gift: FreeGift) => void\n /** \u8D60\u54C1\u7C7B\u578B 1-> \u5355\u9009\u6A21\u5F0F\uFF0C 2 -> \u5168\u9009\u6A21\u5F0F */\n giftType?: 1 | 2\n}\n\n/**\n * FreeGiftItem - \u514D\u8D39\u8D60\u54C1\u9879\n */\nconst FreeGiftItem = React.forwardRef<HTMLDivElement, FreeGiftItemProps>(\n ({ gift, onClick, className, giftType }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-primary laptop:rounded-[8px] border-lines relative flex w-full flex-col overflow-hidden rounded-[6px] border-2 transition-all',\n 'desktop:min-h-[88px] min-h-[80px]', // \u56FA\u5B9A\u6700\u5C0F\u9AD8\u5EA6\u786E\u4FDD\u6240\u6709\u5BB9\u5668\u9AD8\u5EA6\u4E00\u81F4\n // \u6837\u5F0F\u6839\u636E gift_type \u548C\u9009\u62E9\u72B6\u6001\u53D8\u5316\n giftType === 2\n ? 'border-brand-0 cursor-default' // \u5168\u9009\u6A21\u5F0F\uFF1A\u59CB\u7EC8\u9009\u4E2D\uFF0C\u4E0D\u53EF\u70B9\u51FB\n : `cursor-pointer hover:shadow-sm ${gift.selected ? 'border-brand-0 bg-secondary-1' : 'border-lines bg-secondary-0'}`, // \u5355\u9009\u6A21\u5F0F\uFF1A\u53EF\u70B9\u51FB\uFF0C\u6839\u636E\u9009\u62E9\u72B6\u6001\u53D8\u5316\u8FB9\u6846\n className\n )}\n onClick={() => {\n // \u53EA\u6709\u5355\u9009\u6A21\u5F0F\u624D\u5141\u8BB8\u70B9\u51FB\n if (giftType === 1) {\n onClick?.(gift)\n }\n }}\n >\n <div className=\"flex size-full flex-col items-end\">\n {gift.tag && (\n <div className=\"absolute right-0 top-0 z-10 flex items-start\">\n <div className=\"bg-brand-0 lg-desktop:text-[16px] laptop:rounded-bl-[8px] rounded-bl-[6px] px-[6px] pb-[4px] pt-[3px] text-[14px] font-bold text-white\">\n {gift.tag}\n </div>\n </div>\n )}\n <div className={cn('flex size-full items-center gap-4 p-4', 'tablet:p-2')}>\n <div className={cn('size-14 shrink-0', 'tablet:size-12')}>\n <Picture source={gift.image} alt={gift.name} className=\"size-full rounded object-cover\" />\n </div>\n <div className=\"flex h-full min-w-0 flex-1 flex-col justify-center gap-1 py-1\">\n <Text\n size={2}\n html={gift.name}\n className={cn('text-info-primary desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1')}\n />\n <div className=\"mt-auto flex items-center justify-between gap-2\">\n <div className=\"flex items-center gap-2\">\n <Text size={2} className={cn('text-info-primary desktop:text-[16px] lg-desktop:text-[18px]')}>\n {gift.currentPrice}\n </Text>\n {gift.originalPrice && gift.originalPrice !== gift.currentPrice && (\n <Text\n size={2}\n className={cn('text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] pr-6 line-through')}\n >\n {gift.originalPrice}\n </Text>\n )}\n </div>\n {gift.quantity > 1 && (\n <Text size={4} className={cn('self-end')}>\n x{gift.quantity}\n </Text>\n )}\n </div>\n </div>\n </div>\n </div>\n </div>\n )\n }\n)\n\nFreeGiftItem.displayName = 'FreeGiftItem'\n\nexport default FreeGiftItem\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA2Cc,IAAAI,EAAA,6BA3CdC,EAAuB,oBACvBC,EAAmB,kCACnBC,EAAoB,0CACpBC,EAAqB,oCAgBrB,MAAMC,EAAeJ,EAAM,WACzB,CAAC,CAAE,KAAAK,EAAM,QAAAC,EAAS,UAAAC,EAAW,SAAAC,CAAS,EAAGC,OAErC,OAAC,OACC,IAAKA,EACL,aAAW,MACT,6IACA,oCAEAD,IAAa,EACT,gCACA,kCAAkCH,EAAK,SAAW,gCAAkC,6BAA6B,GACrHE,CACF,EACA,QAAS,IAAM,CAETC,IAAa,GACfF,IAAUD,CAAI,CAElB,EAEA,oBAAC,OAAI,UAAU,oCACZ,UAAAA,EAAK,QACJ,OAAC,OAAI,UAAU,+CACb,mBAAC,OAAI,UAAU,yIACZ,SAAAA,EAAK,IACR,EACF,KAEF,QAAC,OAAI,aAAW,MAAG,wCAAyC,YAAY,EACtE,oBAAC,OAAI,aAAW,MAAG,mBAAoB,gBAAgB,EACrD,mBAAC,EAAAK,QAAA,CAAQ,OAAQL,EAAK,MAAO,IAAKA,EAAK,KAAM,UAAU,iCAAiC,EAC1F,KACA,QAAC,OAAI,UAAU,gEACb,oBAAC,QACC,KAAM,EACN,KAAMA,EAAK,KACX,aAAW,MAAG,2EAA2E,EAC3F,KACA,QAAC,OAAI,UAAU,kDACb,qBAAC,OAAI,UAAU,0BACb,oBAAC,QAAK,KAAM,EAAG,aAAW,MAAG,8DAA8D,EACxF,SAAAA,EAAK,aACR,EACCA,EAAK,eAAiBA,EAAK,gBAAkBA,EAAK,iBACjD,OAAC,QACC,KAAM,EACN,aAAW,MAAG,iFAAiF,EAE9F,SAAAA,EAAK,cACR,GAEJ,EACCA,EAAK,SAAW,MACf,QAAC,QAAK,KAAM,EAAG,aAAW,MAAG,UAAU,EAAG,cACtCA,EAAK,UACT,GAEJ,GACF,GACF,GACF,EACF,CAGN,EAEAD,EAAa,YAAc,eAE3B,IAAOP,EAAQO",
6
6
  "names": ["FreeGiftItem_exports", "__export", "FreeGiftItem_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_picture", "import_text", "FreeGiftItem", "gift", "onClick", "className", "giftType", "ref", "Picture"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var D=Object.create;var p=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var J=Object.getPrototypeOf,K=Object.prototype.hasOwnProperty;var Q=(t,e)=>{for(var r in e)p(t,r,{get:e[r],enumerable:!0})},k=(t,e,r,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of q(e))!K.call(t,l)&&l!==r&&p(t,l,{get:()=>e[l],enumerable:!(c=_(e,l))||c.enumerable});return t};var s=(t,e,r)=>(r=t!=null?D(J(t)):{},k(e||!t||!t.__esModule?p(r,"default",{value:t,enumerable:!0}):r,t)),U=t=>k(p({},"__esModule",{value:!0}),t);var Y={};Q(Y,{default:()=>X});module.exports=U(Y);var n=require("react/jsx-runtime"),a=s(require("react")),x=require("../../helpers/index.js"),N=s(require("./ProductImage.js")),L=s(require("./ProductInfo.js")),y=s(require("./GiftSelection.js")),g=s(require("./PriceAndActions.js"));const F=a.forwardRef(({productData:t,gifts:e=[],giftType:r=1,selectedGiftSku:c,sceneImages:l,tags:M,layout:G="horizontal",className:I,onProductClick:P,onLearnMore:T,onShopNow:z,onGiftClick:S,onGiftSelectionChange:O,classNames:R,...j},A)=>{const[E,b]=a.useState(!1),[H,C]=a.useState(!1),[w,f]=a.useState(()=>!e||e.length===0?[]:r===2?e.map(o=>o.id):[e[0].id]),u=a.useMemo(()=>e?e.map(o=>({...o,selected:w.includes(o.id)})):[],[e,w]);a.useEffect(()=>{if(!e||e.length===0){f([]);return}f(r===2?e.map(o=>o.id):o=>{const i=o[0];return i&&e.some(h=>h.id===i)?[i]:[e[0].id]})},[e,r]);const m=a.useMemo(()=>({...t,gifts:e,gift_type:r}),[t,e,r]),W=o=>{if(r===2){const i=u.filter(d=>d.selected);S?.(o,i);return}f(()=>{const i=[o.id],d=e?.filter(h=>i.includes(h.id))||[];return S?.(o,d),O?.(d,m),i})},v=()=>{P?.(m)},B=async()=>{const o=u.filter(i=>i.selected);b(!0);try{await T?.(m,o)}finally{b(!1)}},V=async()=>{const o=u.filter(i=>i.selected);C(!0);try{await z?.(m,o)}finally{C(!1)}};return(0,n.jsxs)("div",{ref:A,className:(0,x.cn)("bg-container-primary rounded-box flex items-stretch overflow-hidden",G==="horizontal"?["laptop:flex-row lg-desktop:min-h-[560px] desktop:min-h-[448px] tablet:min-h-[526px] min-h-[610px] flex-1 flex-col"]:["flex-0 tablet:flex-1 tablet:flex-nowrap flex-wrap","flex-col justify-between","min-h-[610px] "],P?"cursor-pointer":"",I),...j,children:[(0,n.jsx)(N.default,{images:l,name:t.name,layout:G,tags:t.tags||M,onClick:v}),(0,n.jsx)("div",{className:(0,x.cn)("bg-container-primary desktop:p-6 flex flex-col justify-between p-4",G==="horizontal"?["rounded-r-box laptop:rounded-r-box tablet:rounded-b-box tablet:rounded-l-none","laptop:basis-[39.1%]","desktop:basis-[42.1%]","lg-desktop:basis-[42.1%]","shrink-0"]:["rounded-b-box","w-full","grow"]),children:(0,n.jsxs)("div",{className:"flex flex-1 flex-col justify-between gap-6",children:[(0,n.jsx)(L.default,{name:t.name,onClick:v,description:t.description,classNames:R}),(0,n.jsx)(y.default,{freeGiftLabel:t.freeGiftLabel,freeGifts:u,onGiftClick:W,giftType:r,selectedGiftSku:c}),(0,n.jsx)(g.default,{currentPrice:t.currentPrice??"",originalPrice:t.originalPrice,learnMoreText:t.learnMoreText,shopNowText:t.shopNowText,onLearnMore:B,onShopNow:V,availableForSale:t.availableForSale,learnMoreLoading:E,shopNowLoading:H})]})})]})});F.displayName="ProductCard";var X=F;
1
+ "use strict";"use client";var D=Object.create;var p=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var J=Object.getPrototypeOf,K=Object.prototype.hasOwnProperty;var Q=(t,e)=>{for(var r in e)p(t,r,{get:e[r],enumerable:!0})},k=(t,e,r,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of q(e))!K.call(t,l)&&l!==r&&p(t,l,{get:()=>e[l],enumerable:!(c=_(e,l))||c.enumerable});return t};var s=(t,e,r)=>(r=t!=null?D(J(t)):{},k(e||!t||!t.__esModule?p(r,"default",{value:t,enumerable:!0}):r,t)),U=t=>k(p({},"__esModule",{value:!0}),t);var Y={};Q(Y,{default:()=>X});module.exports=U(Y);var n=require("react/jsx-runtime"),a=s(require("react")),S=require("../../helpers/index.js"),N=s(require("./ProductImage.js")),y=s(require("./ProductInfo.js")),L=s(require("./GiftSelection.js")),g=s(require("./PriceAndActions.js"));const F=a.forwardRef(({productData:t,gifts:e=[],giftType:r=1,selectedGiftSku:c,sceneImages:l,tags:M,layout:G="horizontal",className:I,onProductClick:x,onLearnMore:O,onShopNow:T,onGiftClick:P,onGiftSelectionChange:z,classNames:R,...j},A)=>{const[B,b]=a.useState(!1),[E,C]=a.useState(!1),[w,f]=a.useState(()=>!e||e.length===0?[]:r===2?e.map(o=>o.id):[e[0].id]),u=a.useMemo(()=>e?e.map(o=>({...o,selected:w.includes(o.id)})):[],[e,w]);a.useEffect(()=>{if(!e||e.length===0){f([]);return}f(r===2?e.map(o=>o.id):o=>{const i=o[0];return i&&e.some(h=>h.id===i)?[i]:[e[0].id]})},[e,r]);const m=a.useMemo(()=>({...t,gifts:e,gift_type:r}),[t,e,r]),H=o=>{if(r===2){const i=u.filter(d=>d.selected);P?.(o,i);return}f(()=>{const i=[o.id],d=e?.filter(h=>i.includes(h.id))||[];return P?.(o,d),z?.(d,m),i})},v=()=>{x?.(m)},W=async()=>{const o=u.filter(i=>i.selected);b(!0);try{await O?.(m,o)}finally{b(!1)}},V=async()=>{const o=u.filter(i=>i.selected);C(!0);try{await T?.(m,o)}finally{C(!1)}};return(0,n.jsxs)("div",{ref:A,className:(0,S.cn)("bg-container-primary rounded-box flex items-stretch overflow-hidden",G==="horizontal"?["laptop:flex-row lg-desktop:min-h-[560px] desktop:min-h-[448px] tablet:min-h-[526px] min-h-[610px] flex-1 flex-col"]:["flex-0 tablet:flex-1 tablet:flex-nowrap flex-wrap","flex-col justify-between","min-h-[610px] "],x?"cursor-pointer":"",I),...j,children:[(0,n.jsx)(N.default,{images:l,name:t.name,layout:G,tags:t.tags||M,onClick:v}),(0,n.jsx)("div",{className:(0,S.cn)("bg-container-primary desktop:p-6 flex flex-col justify-between p-4",G==="horizontal"?["rounded-r-box laptop:rounded-r-box tablet:rounded-b-box tablet:rounded-l-none","laptop:basis-[39.1%]","desktop:basis-[42.1%]","lg-desktop:basis-[42.1%]","shrink-0"]:["rounded-b-box","w-full","grow"]),children:(0,n.jsxs)("div",{className:"flex flex-1 flex-col justify-between gap-6",children:[(0,n.jsx)(y.default,{name:t.name,onClick:v,description:t.description,classNames:R}),(0,n.jsx)(L.default,{freeGiftLabel:t.freeGiftLabel,freeGifts:u,onGiftClick:H,giftType:r,selectedGiftSku:c}),(0,n.jsx)(g.default,{currentPrice:t.currentPrice??"",originalPrice:t.originalPrice,learnMoreText:t.learnMoreText,shopNowText:t.shopNowText,onLearnMore:W,onShopNow:V,availableForSale:t.availableForSale,learnMoreLoading:B,shopNowLoading:E})]})})]})});F.displayName="BuyOneGetOneShelf.ProductCard";var X=F;
2
2
  //# sourceMappingURL=ProductCard.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/BuyOneGetOneShelf/ProductCard.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport ProductImage from './ProductImage.js'\nimport ProductInfo from './ProductInfo.js'\nimport GiftSelection from './GiftSelection.js'\nimport PriceAndActions from './PriceAndActions.js'\nimport type {\n FreeGift,\n FreeGiftWithSelection,\n ProductCardData,\n PureProductData,\n ProductTag,\n BuyOneGetOneShelfProductCardSemanticName,\n} from './types.js'\n\nexport interface ProductCardProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4EA7\u54C1\u6570\u636E\uFF08\u4E0D\u5305\u542B\u8D60\u54C1\u4FE1\u606F\uFF09 */\n productData: PureProductData\n /** \u8D60\u54C1\u5217\u8868 */\n gifts?: FreeGift[]\n /** \u8D60\u54C1\u7C7B\u578B 1-> \u8D60\u9001\u5176\u4E2D\u4E00\u4E2A\u8D60\u54C1\uFF0C 2 -> \u8D60\u9001\u6240\u6709\u8D60\u54C1 */\n giftType?: 1 | 2\n /** \u573A\u666F\u56FE\u7247 */\n sceneImages: any\n /** \u4EA7\u54C1\u6807\u7B7E */\n tags?: ProductTag[]\n /** \u5F53\u524D\u9009\u4E2D\u7684\u8D60\u54C1SKU\uFF08\u53D7\u63A7\u7EC4\u4EF6\uFF09 */\n selectedGiftSku?: string\n /** \u5E03\u5C40\u6A21\u5F0F */\n layout?: 'horizontal' | 'vertical'\n classNames?: Partial<Record<BuyOneGetOneShelfProductCardSemanticName, string>>\n /** \u4EA7\u54C1\u70B9\u51FB\u56DE\u8C03 */\n onProductClick?: (product: ProductCardData) => void\n /** Learn More \u70B9\u51FB\u56DE\u8C03 */\n onLearnMore?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n /** Shop Now \u70B9\u51FB\u56DE\u8C03 */\n onShopNow?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n /** \u8D60\u54C1\u70B9\u51FB\u56DE\u8C03 */\n onGiftClick?: (gift: FreeGift, selectedGifts: FreeGift[]) => void\n /** \u8D60\u54C1\u9009\u62E9\u53D8\u5316\u56DE\u8C03 */\n onGiftSelectionChange?: (selectedGifts: FreeGift[], product: ProductCardData) => void\n /** \u9009\u4E2D\u8D60\u54C1SKU\u53D8\u5316\u56DE\u8C03\uFF08\u53D7\u63A7\u7EC4\u4EF6\uFF09 */\n onSelectedGiftSkuChange?: (selectedSku: string | null) => void\n}\n\n/**\n * ProductCard - \u4E70\u8D60\u8D27\u67B6\u4EA7\u54C1\u5361\u7247\n *\n * @description \u7528\u4E8E\u4E70\u4E00\u8D60\u4E00\u6D3B\u52A8\u7684\u4EA7\u54C1\u5C55\u793A\u5361\u7247\uFF0C\u5DE6\u4FA7\u5C55\u793A\u4EA7\u54C1\u56FE\u7247\u548C\u6807\u7B7E\uFF0C\u53F3\u4FA7\u5C55\u793A\u4EA7\u54C1\u4FE1\u606F\u3001\u8D60\u54C1\u548C\u8D2D\u4E70\u6309\u94AE\n */\nconst ProductCard = React.forwardRef<HTMLDivElement, ProductCardProps>(\n (\n {\n productData,\n gifts = [],\n giftType = 1,\n selectedGiftSku,\n sceneImages,\n tags,\n layout = 'horizontal',\n className,\n onProductClick,\n onLearnMore,\n onShopNow,\n onGiftClick,\n onGiftSelectionChange,\n classNames,\n ...props\n },\n ref\n ) => {\n const [learnMoreLoading, setLearnMoreLoading] = React.useState(false)\n const [shopNowLoading, setShopNowLoading] = React.useState(false)\n\n // \u5185\u90E8\u72B6\u6001\u7BA1\u7406\u8D60\u54C1\u7684\u9009\u62E9\u72B6\u6001 - \u4F7F\u7528\u9009\u4E2D\u7684ID\u6570\u7EC4\u800C\u4E0D\u662F\u4FEE\u6539gift\u5BF9\u8C61\n const [selectedGiftIds, setSelectedGiftIds] = React.useState<string[]>(() => {\n if (!gifts || gifts.length === 0) return []\n\n if (giftType === 2) {\n // gift_type 2 (\u5168\u9009\u6A21\u5F0F) - \u9009\u4E2D\u6240\u6709\u8D60\u54C1\n return gifts.map((gift: FreeGift) => gift.id)\n } else {\n // gift_type 1 (\u5355\u9009\u6A21\u5F0F) - \u9ED8\u8BA4\u9009\u4E2D\u7B2C\u4E00\u4E2A\u8D60\u54C1\n return [gifts[0].id]\n }\n })\n\n // \u751F\u6210\u5E26\u6709\u9009\u62E9\u72B6\u6001\u7684\u8D60\u54C1\u5217\u8868\u7528\u4E8E\u6E32\u67D3\n const giftsWithSelection = React.useMemo(() => {\n if (!gifts) return []\n\n return gifts.map((gift: FreeGift) => ({\n ...gift,\n selected: selectedGiftIds.includes(gift.id),\n }))\n }, [gifts, selectedGiftIds])\n\n // \u5F53 gifts \u6216 giftType \u66F4\u65B0\u65F6\uFF0C\u540C\u6B65\u66F4\u65B0\u5185\u90E8\u72B6\u6001\n React.useEffect(() => {\n if (!gifts || gifts.length === 0) {\n setSelectedGiftIds([])\n return\n }\n\n if (giftType === 2) {\n // gift_type 2 (\u5168\u9009\u6A21\u5F0F) - \u9009\u4E2D\u6240\u6709\u8D60\u54C1\n setSelectedGiftIds(gifts.map((gift: FreeGift) => gift.id))\n } else {\n // gift_type 1 (\u5355\u9009\u6A21\u5F0F) - \u667A\u80FD\u72B6\u6001\u7BA1\u7406\n setSelectedGiftIds(prevSelectedIds => {\n // \u68C0\u67E5\u5F53\u524D\u9009\u4E2D\u7684\u793C\u54C1\u662F\u5426\u4ECD\u7136\u5B58\u5728\u4E8E\u65B0\u7684 gifts \u5217\u8868\u4E2D\n const currentSelectedId = prevSelectedIds[0]\n const isCurrentSelectionValid =\n currentSelectedId && gifts.some((gift: FreeGift) => gift.id === currentSelectedId)\n\n // \u5982\u679C\u5F53\u524D\u9009\u4E2D\u72B6\u6001\u4ECD\u7136\u6709\u6548\uFF0C\u4FDD\u6301\u4E0D\u53D8\uFF1B\u5426\u5219\u9ED8\u8BA4\u9009\u4E2D\u7B2C\u4E00\u4E2A\n return isCurrentSelectionValid ? [currentSelectedId] : [gifts[0].id]\n })\n }\n }, [gifts, giftType])\n\n // \u6784\u9020\u5B8C\u6574\u7684\u4EA7\u54C1\u6570\u636E\u7528\u4E8E\u56DE\u8C03\n const fullProductData: ProductCardData = React.useMemo(\n () => ({\n ...productData,\n gifts,\n gift_type: giftType,\n }),\n [productData, gifts, giftType]\n )\n\n const handleGiftClick = (gift: FreeGift) => {\n // gift_type 2 (\u5168\u9009\u6A21\u5F0F) - \u4E0D\u5141\u8BB8\u53D6\u6D88\u9009\u62E9\uFF0C\u76F4\u63A5\u8FD4\u56DE\n if (giftType === 2) {\n // \u83B7\u53D6\u5F53\u524D\u6240\u6709\u9009\u4E2D\u7684gifts\u4F5C\u4E3A\u7B2C\u4E8C\u4E2A\u53C2\u6570\n const currentSelectedGifts = giftsWithSelection.filter((g: FreeGiftWithSelection) => g.selected)\n onGiftClick?.(gift, currentSelectedGifts)\n return\n }\n\n // gift_type 1 (\u5355\u9009\u6A21\u5F0F)\n setSelectedGiftIds(() => {\n const newSelectedIds = [gift.id] // \u5355\u9009\uFF1A\u59CB\u7EC8\u9009\u4E2D\u5F53\u524D\u9879\uFF0C\u70B9\u51FB\u5DF2\u9009\u4E2D\u9879\u4FDD\u6301\u72B6\u6001\uFF0C\u70B9\u51FB\u672A\u9009\u4E2D\u9879\u5207\u6362\u5230\u8BE5\u9879\n\n // \u8BA1\u7B97\u65B0\u7684\u9009\u4E2Dgifts\u4F5C\u4E3A\u7B2C\u4E8C\u4E2A\u53C2\u6570\u4F20\u9012\u7ED9\u56DE\u8C03\n const newSelectedGifts = gifts?.filter((g: FreeGift) => newSelectedIds.includes(g.id)) || []\n\n // \u8C03\u7528\u56DE\u8C03\u51FD\u6570\uFF0C\u7B2C\u4E8C\u4E2A\u53C2\u6570\u662F\u5F53\u524D\u9009\u4E2D\u7684gifts\n onGiftClick?.(gift, newSelectedGifts)\n onGiftSelectionChange?.(newSelectedGifts, fullProductData)\n\n return newSelectedIds\n })\n }\n\n const handleProductImageClick = () => {\n onProductClick?.(fullProductData)\n }\n\n const handleLearnMoreClick = async () => {\n const selectedGifts = giftsWithSelection.filter(gift => gift.selected)\n setLearnMoreLoading(true)\n try {\n await onLearnMore?.(fullProductData, selectedGifts)\n } finally {\n setLearnMoreLoading(false)\n }\n }\n\n const handleShopNowClick = async () => {\n const selectedGifts = giftsWithSelection.filter(gift => gift.selected)\n setShopNowLoading(true)\n try {\n await onShopNow?.(fullProductData, selectedGifts)\n } finally {\n setShopNowLoading(false)\n }\n }\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-primary rounded-box flex items-stretch overflow-hidden',\n // \u6839\u636E\u5E03\u5C40\u6A21\u5F0F\u8C03\u6574\u5BB9\u5668\n layout === 'horizontal'\n ? [\n // \u6C34\u5E73\u5E03\u5C40\uFF1Aflex-row\uFF0C\u5360\u6EE1\u6574\u884C\n 'laptop:flex-row lg-desktop:min-h-[560px] desktop:min-h-[448px] tablet:min-h-[526px] min-h-[610px] flex-1 flex-col', // 964px + 700px\n ]\n : [\n // \u5782\u76F4\u5E03\u5C40\uFF1Aflex-col\uFF0C\u9002\u5408\u4E00\u884C\u4E24\u4E2A\n 'flex-0 tablet:flex-1 tablet:flex-nowrap flex-wrap',\n 'flex-col justify-between',\n 'min-h-[610px] ',\n ],\n onProductClick ? 'cursor-pointer' : '',\n className\n )}\n {...props}\n >\n {/* \u4EA7\u54C1\u56FE\u7247\u533A\u57DF */}\n <ProductImage\n images={sceneImages}\n name={productData.name}\n layout={layout}\n tags={productData.tags || tags}\n onClick={handleProductImageClick}\n />\n\n {/* \u4EA7\u54C1\u4FE1\u606F\u533A\u57DF */}\n <div\n className={cn(\n 'bg-container-primary desktop:p-6 flex flex-col justify-between p-4',\n // \u6839\u636E\u5E03\u5C40\u6A21\u5F0F\u8C03\u6574\u5706\u89D2\u548C\u5C3A\u5BF8\n layout === 'horizontal'\n ? [\n 'rounded-r-box laptop:rounded-r-box tablet:rounded-b-box tablet:rounded-l-none',\n // \u4F7F\u7528 flex-basis \u8BBE\u7F6E\u5BBD\u5EA6\u6BD4\u4F8B\n 'laptop:basis-[39.1%]', // 360px / 921px \u2248 39.1%\n 'desktop:basis-[42.1%]', // 552px / 1312px \u2248 42.1%\n 'lg-desktop:basis-[42.1%]', // 700px / 1664px \u2248 42.1%\n 'shrink-0',\n ]\n : ['rounded-b-box', 'w-full', 'grow']\n )}\n >\n <div className=\"flex flex-1 flex-col justify-between gap-6\">\n {/* \u4EA7\u54C1\u6807\u9898\u548C\u63CF\u8FF0 */}\n <ProductInfo\n name={productData.name}\n onClick={handleProductImageClick}\n description={productData.description}\n classNames={classNames}\n />\n\n {/* \u514D\u8D39\u8D60\u54C1\u533A\u57DF */}\n <GiftSelection\n freeGiftLabel={productData.freeGiftLabel}\n freeGifts={giftsWithSelection}\n onGiftClick={handleGiftClick}\n giftType={giftType}\n selectedGiftSku={selectedGiftSku}\n />\n <PriceAndActions\n currentPrice={productData.currentPrice ?? ''}\n originalPrice={productData.originalPrice}\n learnMoreText={productData.learnMoreText}\n shopNowText={productData.shopNowText}\n onLearnMore={handleLearnMoreClick}\n onShopNow={handleShopNowClick}\n availableForSale={productData.availableForSale}\n learnMoreLoading={learnMoreLoading}\n shopNowLoading={shopNowLoading}\n />\n </div>\n </div>\n </div>\n )\n }\n)\n\nProductCard.displayName = 'ProductCard'\n\nexport default ProductCard\n"],
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EAAAsB,QAAA,CACC,OAAQhC,EACR,KAAMJ,EAAY,KAClB,OAAQM,EACR,KAAMN,EAAY,MAAQK,EAC1B,QAAS2B,EACX,KAGA,OAAC,OACC,aAAW,MACT,qEAEA1B,IAAW,aACP,CACE,gFAEA,uBACA,wBACA,2BACA,UACF,EACA,CAAC,gBAAiB,SAAU,MAAM,CACxC,EAEA,oBAAC,OAAI,UAAU,6CAEb,oBAAC,EAAA+B,QAAA,CACC,KAAMrC,EAAY,KAClB,QAASgC,EACT,YAAahC,EAAY,YACzB,WAAYa,EACd,KAGA,OAAC,EAAAyB,QAAA,CACC,cAAetC,EAAY,cAC3B,UAAWuB,EACX,YAAaI,EACb,SAAUzB,EACV,gBAAiBC,EACnB,KACA,OAAC,EAAAoC,QAAA,CACC,aAAcvC,EAAY,cAAgB,GAC1C,cAAeA,EAAY,cAC3B,cAAeA,EAAY,cAC3B,YAAaA,EAAY,YACzB,YAAaiC,EACb,UAAWE,EACX,iBAAkBnC,EAAY,iBAC9B,iBAAkBgB,EAClB,eAAgBE,EAClB,GACF,EACF,GACF,CAEJ,CACF,EAEAnB,EAAY,YAAc,cAE1B,IAAOT,EAAQS",
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport ProductImage from './ProductImage.js'\nimport ProductInfo from './ProductInfo.js'\nimport GiftSelection from './GiftSelection.js'\nimport PriceAndActions from './PriceAndActions.js'\nimport type {\n FreeGift,\n FreeGiftWithSelection,\n ProductCardData,\n PureProductData,\n ProductTag,\n BuyOneGetOneShelfProductCardSemanticName,\n} from './types.js'\n\nexport interface ProductCardProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4EA7\u54C1\u6570\u636E\uFF08\u4E0D\u5305\u542B\u8D60\u54C1\u4FE1\u606F\uFF09 */\n productData: PureProductData\n /** \u8D60\u54C1\u5217\u8868 */\n gifts?: FreeGift[]\n /** \u8D60\u54C1\u7C7B\u578B 1-> \u8D60\u9001\u5176\u4E2D\u4E00\u4E2A\u8D60\u54C1\uFF0C 2 -> \u8D60\u9001\u6240\u6709\u8D60\u54C1 */\n giftType?: 1 | 2\n /** \u573A\u666F\u56FE\u7247 */\n sceneImages: any\n /** \u4EA7\u54C1\u6807\u7B7E */\n tags?: ProductTag[]\n /** \u5F53\u524D\u9009\u4E2D\u7684\u8D60\u54C1SKU\uFF08\u53D7\u63A7\u7EC4\u4EF6\uFF09 */\n selectedGiftSku?: string\n /** \u5E03\u5C40\u6A21\u5F0F */\n layout?: 'horizontal' | 'vertical'\n classNames?: Partial<Record<BuyOneGetOneShelfProductCardSemanticName, string>>\n /** \u4EA7\u54C1\u70B9\u51FB\u56DE\u8C03 */\n onProductClick?: (product: ProductCardData) => void\n /** Learn More \u70B9\u51FB\u56DE\u8C03 */\n onLearnMore?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n /** Shop Now \u70B9\u51FB\u56DE\u8C03 */\n onShopNow?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n /** \u8D60\u54C1\u70B9\u51FB\u56DE\u8C03 */\n onGiftClick?: (gift: FreeGift, selectedGifts: FreeGift[]) => void\n /** \u8D60\u54C1\u9009\u62E9\u53D8\u5316\u56DE\u8C03 */\n onGiftSelectionChange?: (selectedGifts: FreeGift[], product: ProductCardData) => void\n /** \u9009\u4E2D\u8D60\u54C1SKU\u53D8\u5316\u56DE\u8C03\uFF08\u53D7\u63A7\u7EC4\u4EF6\uFF09 */\n onSelectedGiftSkuChange?: (selectedSku: string | null) => void\n}\n\n/**\n * ProductCard - \u4E70\u8D60\u8D27\u67B6\u4EA7\u54C1\u5361\u7247\n *\n * @description \u7528\u4E8E\u4E70\u4E00\u8D60\u4E00\u6D3B\u52A8\u7684\u4EA7\u54C1\u5C55\u793A\u5361\u7247\uFF0C\u5DE6\u4FA7\u5C55\u793A\u4EA7\u54C1\u56FE\u7247\u548C\u6807\u7B7E\uFF0C\u53F3\u4FA7\u5C55\u793A\u4EA7\u54C1\u4FE1\u606F\u3001\u8D60\u54C1\u548C\u8D2D\u4E70\u6309\u94AE\n */\nconst ProductCard = React.forwardRef<HTMLDivElement, ProductCardProps>(\n (\n {\n productData,\n gifts = [],\n giftType = 1,\n selectedGiftSku,\n sceneImages,\n tags,\n layout = 'horizontal',\n className,\n onProductClick,\n onLearnMore,\n onShopNow,\n onGiftClick,\n onGiftSelectionChange,\n classNames,\n ...props\n },\n ref\n ) => {\n const [learnMoreLoading, setLearnMoreLoading] = React.useState(false)\n const [shopNowLoading, setShopNowLoading] = React.useState(false)\n\n // \u5185\u90E8\u72B6\u6001\u7BA1\u7406\u8D60\u54C1\u7684\u9009\u62E9\u72B6\u6001 - \u4F7F\u7528\u9009\u4E2D\u7684ID\u6570\u7EC4\u800C\u4E0D\u662F\u4FEE\u6539gift\u5BF9\u8C61\n const [selectedGiftIds, setSelectedGiftIds] = React.useState<string[]>(() => {\n if (!gifts || gifts.length === 0) return []\n\n if (giftType === 2) {\n // gift_type 2 (\u5168\u9009\u6A21\u5F0F) - \u9009\u4E2D\u6240\u6709\u8D60\u54C1\n return gifts.map((gift: FreeGift) => gift.id)\n } else {\n // gift_type 1 (\u5355\u9009\u6A21\u5F0F) - \u9ED8\u8BA4\u9009\u4E2D\u7B2C\u4E00\u4E2A\u8D60\u54C1\n return [gifts[0].id]\n }\n })\n\n // \u751F\u6210\u5E26\u6709\u9009\u62E9\u72B6\u6001\u7684\u8D60\u54C1\u5217\u8868\u7528\u4E8E\u6E32\u67D3\n const giftsWithSelection = React.useMemo(() => {\n if (!gifts) return []\n\n return gifts.map((gift: FreeGift) => ({\n ...gift,\n selected: selectedGiftIds.includes(gift.id),\n }))\n }, [gifts, selectedGiftIds])\n\n // \u5F53 gifts \u6216 giftType \u66F4\u65B0\u65F6\uFF0C\u540C\u6B65\u66F4\u65B0\u5185\u90E8\u72B6\u6001\n React.useEffect(() => {\n if (!gifts || gifts.length === 0) {\n setSelectedGiftIds([])\n return\n }\n\n if (giftType === 2) {\n // gift_type 2 (\u5168\u9009\u6A21\u5F0F) - \u9009\u4E2D\u6240\u6709\u8D60\u54C1\n setSelectedGiftIds(gifts.map((gift: FreeGift) => gift.id))\n } else {\n // gift_type 1 (\u5355\u9009\u6A21\u5F0F) - \u667A\u80FD\u72B6\u6001\u7BA1\u7406\n setSelectedGiftIds(prevSelectedIds => {\n // \u68C0\u67E5\u5F53\u524D\u9009\u4E2D\u7684\u793C\u54C1\u662F\u5426\u4ECD\u7136\u5B58\u5728\u4E8E\u65B0\u7684 gifts \u5217\u8868\u4E2D\n const currentSelectedId = prevSelectedIds[0]\n const isCurrentSelectionValid =\n currentSelectedId && gifts.some((gift: FreeGift) => gift.id === currentSelectedId)\n\n // \u5982\u679C\u5F53\u524D\u9009\u4E2D\u72B6\u6001\u4ECD\u7136\u6709\u6548\uFF0C\u4FDD\u6301\u4E0D\u53D8\uFF1B\u5426\u5219\u9ED8\u8BA4\u9009\u4E2D\u7B2C\u4E00\u4E2A\n return isCurrentSelectionValid ? [currentSelectedId] : [gifts[0].id]\n })\n }\n }, [gifts, giftType])\n\n // \u6784\u9020\u5B8C\u6574\u7684\u4EA7\u54C1\u6570\u636E\u7528\u4E8E\u56DE\u8C03\n const fullProductData: ProductCardData = React.useMemo(\n () => ({\n ...productData,\n gifts,\n gift_type: giftType,\n }),\n [productData, gifts, giftType]\n )\n\n const handleGiftClick = (gift: FreeGift) => {\n // gift_type 2 (\u5168\u9009\u6A21\u5F0F) - \u4E0D\u5141\u8BB8\u53D6\u6D88\u9009\u62E9\uFF0C\u76F4\u63A5\u8FD4\u56DE\n if (giftType === 2) {\n // \u83B7\u53D6\u5F53\u524D\u6240\u6709\u9009\u4E2D\u7684gifts\u4F5C\u4E3A\u7B2C\u4E8C\u4E2A\u53C2\u6570\n const currentSelectedGifts = giftsWithSelection.filter((g: FreeGiftWithSelection) => g.selected)\n onGiftClick?.(gift, currentSelectedGifts)\n return\n }\n\n // gift_type 1 (\u5355\u9009\u6A21\u5F0F)\n setSelectedGiftIds(() => {\n const newSelectedIds = [gift.id] // \u5355\u9009\uFF1A\u59CB\u7EC8\u9009\u4E2D\u5F53\u524D\u9879\uFF0C\u70B9\u51FB\u5DF2\u9009\u4E2D\u9879\u4FDD\u6301\u72B6\u6001\uFF0C\u70B9\u51FB\u672A\u9009\u4E2D\u9879\u5207\u6362\u5230\u8BE5\u9879\n\n // \u8BA1\u7B97\u65B0\u7684\u9009\u4E2Dgifts\u4F5C\u4E3A\u7B2C\u4E8C\u4E2A\u53C2\u6570\u4F20\u9012\u7ED9\u56DE\u8C03\n const newSelectedGifts = gifts?.filter((g: FreeGift) => newSelectedIds.includes(g.id)) || []\n\n // \u8C03\u7528\u56DE\u8C03\u51FD\u6570\uFF0C\u7B2C\u4E8C\u4E2A\u53C2\u6570\u662F\u5F53\u524D\u9009\u4E2D\u7684gifts\n onGiftClick?.(gift, newSelectedGifts)\n onGiftSelectionChange?.(newSelectedGifts, fullProductData)\n\n return newSelectedIds\n })\n }\n\n const handleProductImageClick = () => {\n onProductClick?.(fullProductData)\n }\n\n const handleLearnMoreClick = async () => {\n const selectedGifts = giftsWithSelection.filter(gift => gift.selected)\n setLearnMoreLoading(true)\n try {\n await onLearnMore?.(fullProductData, selectedGifts)\n } finally {\n setLearnMoreLoading(false)\n }\n }\n\n const handleShopNowClick = async () => {\n const selectedGifts = giftsWithSelection.filter(gift => gift.selected)\n setShopNowLoading(true)\n try {\n await onShopNow?.(fullProductData, selectedGifts)\n } finally {\n setShopNowLoading(false)\n }\n }\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-primary rounded-box flex items-stretch overflow-hidden',\n // \u6839\u636E\u5E03\u5C40\u6A21\u5F0F\u8C03\u6574\u5BB9\u5668\n layout === 'horizontal'\n ? [\n // \u6C34\u5E73\u5E03\u5C40\uFF1Aflex-row\uFF0C\u5360\u6EE1\u6574\u884C\n 'laptop:flex-row lg-desktop:min-h-[560px] desktop:min-h-[448px] tablet:min-h-[526px] min-h-[610px] flex-1 flex-col', // 964px + 700px\n ]\n : [\n // \u5782\u76F4\u5E03\u5C40\uFF1Aflex-col\uFF0C\u9002\u5408\u4E00\u884C\u4E24\u4E2A\n 'flex-0 tablet:flex-1 tablet:flex-nowrap flex-wrap',\n 'flex-col justify-between',\n 'min-h-[610px] ',\n ],\n onProductClick ? 'cursor-pointer' : '',\n className\n )}\n {...props}\n >\n {/* \u4EA7\u54C1\u56FE\u7247\u533A\u57DF */}\n <ProductImage\n images={sceneImages}\n name={productData.name}\n layout={layout}\n tags={productData.tags || tags}\n onClick={handleProductImageClick}\n />\n\n {/* \u4EA7\u54C1\u4FE1\u606F\u533A\u57DF */}\n <div\n className={cn(\n 'bg-container-primary desktop:p-6 flex flex-col justify-between p-4',\n // \u6839\u636E\u5E03\u5C40\u6A21\u5F0F\u8C03\u6574\u5706\u89D2\u548C\u5C3A\u5BF8\n layout === 'horizontal'\n ? [\n 'rounded-r-box laptop:rounded-r-box tablet:rounded-b-box tablet:rounded-l-none',\n // \u4F7F\u7528 flex-basis \u8BBE\u7F6E\u5BBD\u5EA6\u6BD4\u4F8B\n 'laptop:basis-[39.1%]', // 360px / 921px \u2248 39.1%\n 'desktop:basis-[42.1%]', // 552px / 1312px \u2248 42.1%\n 'lg-desktop:basis-[42.1%]', // 700px / 1664px \u2248 42.1%\n 'shrink-0',\n ]\n : ['rounded-b-box', 'w-full', 'grow']\n )}\n >\n <div className=\"flex flex-1 flex-col justify-between gap-6\">\n {/* \u4EA7\u54C1\u6807\u9898\u548C\u63CF\u8FF0 */}\n <ProductInfo\n name={productData.name}\n onClick={handleProductImageClick}\n description={productData.description}\n classNames={classNames}\n />\n\n {/* \u514D\u8D39\u8D60\u54C1\u533A\u57DF */}\n <GiftSelection\n freeGiftLabel={productData.freeGiftLabel}\n freeGifts={giftsWithSelection}\n onGiftClick={handleGiftClick}\n giftType={giftType}\n selectedGiftSku={selectedGiftSku}\n />\n <PriceAndActions\n currentPrice={productData.currentPrice ?? ''}\n originalPrice={productData.originalPrice}\n learnMoreText={productData.learnMoreText}\n shopNowText={productData.shopNowText}\n onLearnMore={handleLearnMoreClick}\n onShopNow={handleShopNowClick}\n availableForSale={productData.availableForSale}\n learnMoreLoading={learnMoreLoading}\n shopNowLoading={shopNowLoading}\n />\n </div>\n </div>\n </div>\n )\n }\n)\n\nProductCard.displayName = 'BuyOneGetOneShelf.ProductCard'\n\nexport default ProductCard\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA4MQ,IAAAI,EAAA,6BA1MRC,EAAuB,oBACvBC,EAAmB,kCACnBC,EAAyB,gCACzBC,EAAwB,+BACxBC,EAA0B,iCAC1BC,EAA4B,mCA6C5B,MAAMC,EAAcN,EAAM,WACxB,CACE,CACE,YAAAO,EACA,MAAAC,EAAQ,CAAC,EACT,SAAAC,EAAW,EACX,gBAAAC,EACA,YAAAC,EACA,KAAAC,EACA,OAAAC,EAAS,aACT,UAAAC,EACA,eAAAC,EACA,YAAAC,EACA,UAAAC,EACA,YAAAC,EACA,sBAAAC,EACA,WAAAC,EACA,GAAGC,CACL,EACAC,IACG,CACH,KAAM,CAACC,EAAkBC,CAAmB,EAAIxB,EAAM,SAAS,EAAK,EAC9D,CAACyB,EAAgBC,CAAiB,EAAI1B,EAAM,SAAS,EAAK,EAG1D,CAAC2B,EAAiBC,CAAkB,EAAI5B,EAAM,SAAmB,IACjE,CAACQ,GAASA,EAAM,SAAW,EAAU,CAAC,EAEtCC,IAAa,EAERD,EAAM,IAAKqB,GAAmBA,EAAK,EAAE,EAGrC,CAACrB,EAAM,CAAC,EAAE,EAAE,CAEtB,EAGKsB,EAAqB9B,EAAM,QAAQ,IAClCQ,EAEEA,EAAM,IAAKqB,IAAoB,CACpC,GAAGA,EACH,SAAUF,EAAgB,SAASE,EAAK,EAAE,CAC5C,EAAE,EALiB,CAAC,EAMnB,CAACrB,EAAOmB,CAAe,CAAC,EAG3B3B,EAAM,UAAU,IAAM,CACpB,G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F,MAAMT,IAAYgB,EAAiBQ,CAAa,CAClD,QAAE,CACAf,EAAkB,EAAK,CACzB,CACF,EAEA,SACE,QAAC,OACC,IAAKJ,EACL,aAAW,MACT,uEAEAT,IAAW,aACP,CAEE,mHACF,EACA,CAEE,oDACA,2BACA,gBACF,EACJE,EAAiB,iBAAmB,GACpCD,CACF,EACC,GAAGO,EAGJ,oBAAC,EAAAsB,QAAA,CACC,OAAQhC,EACR,KAAMJ,EAAY,KAClB,OAAQM,EACR,KAAMN,EAAY,MAAQK,EAC1B,QAAS2B,EACX,KAGA,OAAC,OACC,aAAW,MACT,qEAEA1B,IAAW,aACP,CACE,gFAEA,uBACA,wBACA,2BACA,UACF,EACA,CAAC,gBAAiB,SAAU,MAAM,CACxC,EAEA,oBAAC,OAAI,UAAU,6CAEb,oBAAC,EAAA+B,QAAA,CACC,KAAMrC,EAAY,KAClB,QAASgC,EACT,YAAahC,EAAY,YACzB,WAAYa,EACd,KAGA,OAAC,EAAAyB,QAAA,CACC,cAAetC,EAAY,cAC3B,UAAWuB,EACX,YAAaI,EACb,SAAUzB,EACV,gBAAiBC,EACnB,KACA,OAAC,EAAAoC,QAAA,CACC,aAAcvC,EAAY,cAAgB,GAC1C,cAAeA,EAAY,cAC3B,cAAeA,EAAY,cAC3B,YAAaA,EAAY,YACzB,YAAaiC,EACb,UAAWE,EACX,iBAAkBnC,EAAY,iBAC9B,iBAAkBgB,EAClB,eAAgBE,EAClB,GACF,EACF,GACF,CAEJ,CACF,EAEAnB,EAAY,YAAc,gCAE1B,IAAOT,EAAQS",
6
6
  "names": ["ProductCard_exports", "__export", "ProductCard_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_ProductImage", "import_ProductInfo", "import_GiftSelection", "import_PriceAndActions", "ProductCard", "productData", "gifts", "giftType", "selectedGiftSku", "sceneImages", "tags", "layout", "className", "onProductClick", "onLearnMore", "onShopNow", "onGiftClick", "onGiftSelectionChange", "classNames", "props", "ref", "learnMoreLoading", "setLearnMoreLoading", "shopNowLoading", "setShopNowLoading", "selectedGiftIds", "setSelectedGiftIds", "gift", "giftsWithSelection", "prevSelectedIds", "currentSelectedId", "fullProductData", "handleGiftClick", "currentSelectedGifts", "g", "newSelectedIds", "newSelectedGifts", "handleProductImageClick", "handleLearnMoreClick", "selectedGifts", "handleShopNowClick", "ProductImage", "ProductInfo", "GiftSelection", "PriceAndActions"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var c=Object.create;var i=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var G=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var P=(e,t)=>{for(var o in t)i(e,o,{get:t[o],enumerable:!0})},p=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of S(t))!B.call(e,a)&&a!==o&&i(e,a,{get:()=>t[a],enumerable:!(n=h(t,a))||n.enumerable});return e};var m=(e,t,o)=>(o=e!=null?c(G(e)):{},p(t||!e||!e.__esModule?i(o,"default",{value:e,enumerable:!0}):o,e)),g=e=>p(i({},"__esModule",{value:!0}),e);var C={};P(C,{default:()=>v});module.exports=g(C);var r=require("react/jsx-runtime"),x=m(require("react")),f=require("../../helpers/index.js"),d=m(require("./ProductCard.js")),l=require("../../components/index.js");const s=x.forwardRef(({className:e,classNames:t={},theme:o,title:n,subtitle:a,children:u,...O},y)=>(0,r.jsxs)("div",{ref:y,className:(0,f.cn)("w-full py-0",{"aiui-dark":o==="dark"},e,t?.root),...O,children:[n&&(0,r.jsx)(l.Heading,{as:"h2",html:n,className:(0,f.cn)("mb-4 text-2xl font-bold",t?.title)}),a&&(0,r.jsx)(l.Text,{size:3,as:"p",html:a,className:(0,f.cn)("mb-6 text-gray-600",t?.description)}),(0,r.jsx)("div",{className:(0,f.cn)("flex flex-wrap justify-center gap-6","laptop:justify-start laptop:flex-row"),children:u})]}));s.displayName="BuyOneGetOneShelfRoot";const R={Root:s,ProductCard:d.default};var v=R;
1
+ "use strict";var c=Object.create;var i=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var G=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var P=(e,t)=>{for(var o in t)i(e,o,{get:t[o],enumerable:!0})},l=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of S(t))!B.call(e,a)&&a!==o&&i(e,a,{get:()=>t[a],enumerable:!(n=h(t,a))||n.enumerable});return e};var m=(e,t,o)=>(o=e!=null?c(G(e)):{},l(t||!e||!e.__esModule?i(o,"default",{value:e,enumerable:!0}):o,e)),g=e=>l(i({},"__esModule",{value:!0}),e);var C={};P(C,{default:()=>v});module.exports=g(C);var r=require("react/jsx-runtime"),x=m(require("react")),f=require("../../helpers/index.js"),s=m(require("./ProductCard.js")),p=require("../../components/index.js");const d=x.forwardRef(({className:e,classNames:t={},theme:o,title:n,subtitle:a,children:u,...O},y)=>(0,r.jsxs)("div",{ref:y,className:(0,f.cn)("w-full py-0",{"aiui-dark":o==="dark"},e,t?.root),...O,children:[n&&(0,r.jsx)(p.Heading,{as:"h2",html:n,className:(0,f.cn)("mb-4 text-2xl font-bold",t?.title)}),a&&(0,r.jsx)(p.Text,{size:3,as:"p",html:a,className:(0,f.cn)("mb-6 text-gray-600",t?.description)}),(0,r.jsx)("div",{className:(0,f.cn)("flex flex-wrap justify-center gap-6","laptop:justify-start laptop:flex-row"),children:u})]}));d.displayName="BuyOneGetOneShelf.Root";const R={Root:d,ProductCard:s.default};var v=R;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/BuyOneGetOneShelf/index.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport ProductCard from './ProductCard.js'\nimport { Heading, Text } from '../../components/index.js'\nimport type { BuyOneGetOneShelfProps } from './types.js'\n\n/**\n * BuyOneGetOneShelfRoot - \u4E70\u8D60\u8D27\u67B6\u6839\u5BB9\u5668\u7EC4\u4EF6\n *\n * @description \u7EC4\u5408\u5F0F\u8BBE\u8BA1\u7684\u4E70\u8D60\u8D27\u67B6\u5BB9\u5668\uFF0C\u8D1F\u8D23\u5E03\u5C40\u548C\u6807\u9898\u5C55\u793A\n * \u652F\u6301\u4F20\u5165\u591A\u4E2A BuyOneGetOneShelf.ProductCard \u5B50\u7EC4\u4EF6\n */\nconst BuyOneGetOneShelfRoot = React.forwardRef<HTMLDivElement, BuyOneGetOneShelfProps>(\n ({ className, classNames = {}, theme, title, subtitle, children, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n 'w-full py-0',\n {\n 'aiui-dark': theme === 'dark',\n },\n className,\n classNames?.root\n )}\n {...props}\n >\n {title && <Heading as=\"h2\" html={title} className={cn('mb-4 text-2xl font-bold', classNames?.title)} />}\n {subtitle && (\n <Text size={3} as=\"p\" html={subtitle} className={cn('mb-6 text-gray-600', classNames?.description)} />\n )}\n\n {/* \u4E70\u8D60\u8D27\u67B6\u4EA7\u54C1\u533A\u57DF */}\n <div className={cn('flex flex-wrap justify-center gap-6', 'laptop:justify-start laptop:flex-row')}>\n {children}\n </div>\n </div>\n )\n }\n)\n\nBuyOneGetOneShelfRoot.displayName = 'BuyOneGetOneShelfRoot'\n\n// \u521B\u5EFA\u547D\u540D\u7A7A\u95F4\u5BF9\u8C61\uFF0C\u5305\u542B Root \u548C ProductCard \u7EC4\u4EF6\nconst BuyOneGetOneShelf = {\n Root: BuyOneGetOneShelfRoot,\n ProductCard: ProductCard,\n}\n\nexport default BuyOneGetOneShelf\n\n// Re-export types for external use\nexport type {\n FreeGift,\n FreeGiftWithSelection,\n ProductTag,\n BuyOneGetOneShelfSemanticName,\n BuyOneGetOneShelfRootSemanticName,\n BuyOneGetOneShelfProductCardSemanticName,\n ResponsiveImage,\n ResponsiveImages,\n BaseProductData,\n PureProductData,\n WithGiftData,\n ProductData,\n ProductCardData,\n CopyConfig,\n BogoItem,\n BuyOneGetOneShelfData,\n BuyOneGetOneShelfProps,\n BuyOneGetOneShelfCardProps,\n} from './types.js'\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAiBM,IAAAI,EAAA,6BAfNC,EAAuB,oBACvBC,EAAmB,kCACnBC,EAAwB,+BACxBC,EAA8B,qCAS9B,MAAMC,EAAwBJ,EAAM,WAClC,CAAC,CAAE,UAAAK,EAAW,WAAAC,EAAa,CAAC,EAAG,MAAAC,EAAO,MAAAC,EAAO,SAAAC,EAAU,SAAAC,EAAU,GAAGC,CAAM,EAAGC,OAEzE,QAAC,OACC,IAAKA,EACL,aAAW,MACT,cACA,CACE,YAAaL,IAAU,MACzB,EACAF,EACAC,GAAY,IACd,EACC,GAAGK,EAEH,UAAAH,MAAS,OAAC,WAAQ,GAAG,KAAK,KAAMA,EAAO,aAAW,MAAG,0BAA2BF,GAAY,KAAK,EAAG,EACpGG,MACC,OAAC,QAAK,KAAM,EAAG,GAAG,IAAI,KAAMA,EAAU,aAAW,MAAG,qBAAsBH,GAAY,WAAW,EAAG,KAItG,OAAC,OAAI,aAAW,MAAG,sCAAuC,sCAAsC,EAC7F,SAAAI,EACH,GACF,CAGN,EAEAN,EAAsB,YAAc,wBAGpC,MAAMS,EAAoB,CACxB,KAAMT,EACN,YAAa,EAAAU,OACf,EAEA,IAAOjB,EAAQgB",
4
+ "sourcesContent": ["import * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport ProductCard from './ProductCard.js'\nimport { Heading, Text } from '../../components/index.js'\nimport type { BuyOneGetOneShelfProps } from './types.js'\n\n/**\n * BuyOneGetOneShelfRoot - \u4E70\u8D60\u8D27\u67B6\u6839\u5BB9\u5668\u7EC4\u4EF6\n *\n * @description \u7EC4\u5408\u5F0F\u8BBE\u8BA1\u7684\u4E70\u8D60\u8D27\u67B6\u5BB9\u5668\uFF0C\u8D1F\u8D23\u5E03\u5C40\u548C\u6807\u9898\u5C55\u793A\n * \u652F\u6301\u4F20\u5165\u591A\u4E2A BuyOneGetOneShelf.ProductCard \u5B50\u7EC4\u4EF6\n */\nconst BuyOneGetOneShelfRoot = React.forwardRef<HTMLDivElement, BuyOneGetOneShelfProps>(\n ({ className, classNames = {}, theme, title, subtitle, children, ...props }, ref) => {\n return (\n <div\n ref={ref}\n className={cn(\n 'w-full py-0',\n {\n 'aiui-dark': theme === 'dark',\n },\n className,\n classNames?.root\n )}\n {...props}\n >\n {title && <Heading as=\"h2\" html={title} className={cn('mb-4 text-2xl font-bold', classNames?.title)} />}\n {subtitle && (\n <Text size={3} as=\"p\" html={subtitle} className={cn('mb-6 text-gray-600', classNames?.description)} />\n )}\n\n {/* \u4E70\u8D60\u8D27\u67B6\u4EA7\u54C1\u533A\u57DF */}\n <div className={cn('flex flex-wrap justify-center gap-6', 'laptop:justify-start laptop:flex-row')}>\n {children}\n </div>\n </div>\n )\n }\n)\n\nBuyOneGetOneShelfRoot.displayName = 'BuyOneGetOneShelf.Root'\n\n// \u521B\u5EFA\u547D\u540D\u7A7A\u95F4\u5BF9\u8C61\uFF0C\u5305\u542B Root \u548C ProductCard \u7EC4\u4EF6\nconst BuyOneGetOneShelf = {\n Root: BuyOneGetOneShelfRoot,\n ProductCard: ProductCard,\n}\n\nexport default BuyOneGetOneShelf\n\n// Re-export types for external use\nexport type {\n FreeGift,\n FreeGiftWithSelection,\n ProductTag,\n BuyOneGetOneShelfSemanticName,\n BuyOneGetOneShelfRootSemanticName,\n BuyOneGetOneShelfProductCardSemanticName,\n ResponsiveImage,\n ResponsiveImages,\n BaseProductData,\n PureProductData,\n WithGiftData,\n ProductData,\n ProductCardData,\n CopyConfig,\n BogoItem,\n BuyOneGetOneShelfData,\n BuyOneGetOneShelfProps,\n BuyOneGetOneShelfCardProps,\n} from './types.js'\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAeM,IAAAI,EAAA,6BAfNC,EAAuB,oBACvBC,EAAmB,kCACnBC,EAAwB,+BACxBC,EAA8B,qCAS9B,MAAMC,EAAwBJ,EAAM,WAClC,CAAC,CAAE,UAAAK,EAAW,WAAAC,EAAa,CAAC,EAAG,MAAAC,EAAO,MAAAC,EAAO,SAAAC,EAAU,SAAAC,EAAU,GAAGC,CAAM,EAAGC,OAEzE,QAAC,OACC,IAAKA,EACL,aAAW,MACT,cACA,CACE,YAAaL,IAAU,MACzB,EACAF,EACAC,GAAY,IACd,EACC,GAAGK,EAEH,UAAAH,MAAS,OAAC,WAAQ,GAAG,KAAK,KAAMA,EAAO,aAAW,MAAG,0BAA2BF,GAAY,KAAK,EAAG,EACpGG,MACC,OAAC,QAAK,KAAM,EAAG,GAAG,IAAI,KAAMA,EAAU,aAAW,MAAG,qBAAsBH,GAAY,WAAW,EAAG,KAItG,OAAC,OAAI,aAAW,MAAG,sCAAuC,sCAAsC,EAC7F,SAAAI,EACH,GACF,CAGN,EAEAN,EAAsB,YAAc,yBAGpC,MAAMS,EAAoB,CACxB,KAAMT,EACN,YAAa,EAAAU,OACf,EAEA,IAAOjB,EAAQgB",
6
6
  "names": ["BuyOneGetOneShelf_exports", "__export", "BuyOneGetOneShelf_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_ProductCard", "import_components", "BuyOneGetOneShelfRoot", "className", "classNames", "theme", "title", "subtitle", "children", "props", "ref", "BuyOneGetOneShelf", "ProductCard"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var $=Object.create;var d=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var M=(e,t)=>{for(var a in t)d(e,a,{get:t[a],enumerable:!0})},w=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of L(t))!T.call(e,i)&&i!==a&&d(e,i,{get:()=>t[i],enumerable:!(r=E(t,i))||r.enumerable});return e};var u=(e,t,a)=>(a=e!=null?$(S(e)):{},w(t||!e||!e.__esModule?d(a,"default",{value:e,enumerable:!0}):a,e)),D=e=>w(d({},"__esModule",{value:!0}),e);var z={};M(z,{default:()=>R});module.exports=D(z);var o=require("react/jsx-runtime"),l=u(require("react")),n=require("../../helpers/utils.js"),h=u(require("../../components/picture.js")),I=require("../../shared/Styles.js"),N=u(require("../Title/index.js")),f=u(require("./SwiperCategory.js")),x=require("../../hooks/useExposure.js"),y=require("../../shared/trackUrlRef.js");const p="image",c="category_banner",g=5,j=3,P=(e,t)=>{const a=[];for(let r=0;r<e.length;r+=t)a.push(e.slice(r,r+t));return a},H=({data:e,configuration:t})=>{const a=(0,l.useRef)(null);return(0,x.useExposure)(a,{componentType:p,componentName:c,componentTitle:e?.name,position:t?.index+1}),(0,o.jsx)("div",{className:(0,n.cn)("relative","aspect-w-[167] aspect-h-[120]","tablet:aspect-w-[167] tablet:aspect-h-[120]","laptop:aspect-w-[212] laptop:aspect-h-[144]","desktop:aspect-w-[205] desktop:aspect-h-[192]","lg-desktop:aspect-w-[264] lg-desktop:aspect-h-[240]"),children:(0,o.jsxs)("div",{ref:a,className:(0,n.cn)("tablet:p-3 laptop:p-4 desktop:p-6 absolute inset-0 justify-between","bg-container-secondary-1 hover:bg-info-white group box-border flex cursor-pointer flex-col overflow-hidden duration-300",t?.shape==="round"?"rounded-2xl":"rounded-none"),children:[(0,o.jsx)("div",{className:"transition-all duration-300 group-hover:scale-110",children:(0,o.jsx)("a",{"aria-label":e?.name,href:(0,y.trackUrlRef)(e?.link,`${p}_${c}`),"data-headless-type-name":`${p}#${c}`,"data-headless-title-desc-button":`${e?.name}`,onClick:()=>t?.event?.primaryButton(e,t?.index),children:(0,o.jsx)(h.default,{alt:e?.image?.alt||"",source:e?.image?.url||"",className:"laptop:size-[88px] tablet:size-[72px] desktop:size-[116px] lg-desktop:size-[146px] m-auto flex justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover"})})}),(0,o.jsx)("p",{className:"lg-desktop:text-lg lg-desktop:!leading-6 text-info-primary box-border line-clamp-2 text-center text-sm font-bold leading-4",children:e?.name})]})})},A=({data:e,configuration:t,index:a,isFirstItemLarger:r})=>{const i=(0,l.useRef)(null);(0,x.useExposure)(i,{componentType:p,componentName:c,componentTitle:e?.name,position:t?.index+1});const s=a===0;return(0,o.jsxs)("div",{ref:i,className:(0,n.cn)("bg-container-primary box-border flex w-full shrink-0 flex-col items-center justify-center overflow-hidden","hover:bg-info-white cursor-pointer duration-300",r?(0,n.cn)("p-4",s?"aspect-h-[252] row-span-2":"aspect-h-[120]"):"max-h-[126px] px-3 py-4",t?.shape==="round"?"rounded-2xl":"rounded-none"),children:[(0,o.jsx)("a",{href:(0,y.trackUrlRef)(e?.link,`${p}_${c}`),"data-headless-type-name":`${p}#${c}`,"data-headless-title-desc-button":`${e?.name}`,"data-headless-nav-postion":`''#${t?.index+1}`,onClick:()=>t?.event?.primaryButton(e,t?.index+1),children:(0,o.jsx)(h.default,{source:e?.image?.url||"",alt:e?.image?.alt||"",className:(0,n.cn)("m-auto mb-2 flex justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover",r?(0,n.cn)(s?"max-h-[146px] overflow-hidden":"max-h-[72px] max-w-[72px]"):"size-[72px]")})}),(0,o.jsx)("p",{className:(0,n.cn)("text-info-primary w-full text-center text-sm font-bold",r?"line-clamp-2":"shrink-0 truncate"),children:e?.name})]})},B=({data:e,configuration:t})=>{const r=(t?.totalCategories??0)<=g;return(0,o.jsx)("div",{className:`gap-3 ${r?"grid grid-cols-2":"flex h-full flex-col"}`,children:e?.map((i,s)=>(0,o.jsx)(A,{index:s,data:i,configuration:t,isFirstItemLarger:r},s))})},C=l.default.forwardRef((e,t)=>{const{data:a,className:r="",key:i,event:s}=e,m=(a?.isShowSelect?a?.products:a?.productData)||[],v=m.length>g,b=m.length,_=P(m,v?j:g),k=(0,l.useRef)(null);return(0,l.useImperativeHandle)(t,()=>k.current),(0,o.jsxs)("div",{ref:k,className:(0,n.cn)("w-full overflow-hidden",r,{"aiui-dark":a?.theme==="dark"}),children:[a?.title&&(0,o.jsx)(N.default,{data:{title:a?.title},className:"text-4xl"}),(0,o.jsx)("div",{className:"tablet:block hidden",children:(0,o.jsx)(f.default,{id:`Category${i}`,Slide:H,data:{list:m,configuration:{shape:a?.shape,event:s,title:a?.title,totalCategories:b}}})}),(0,o.jsx)("div",{className:"tablet:hidden block",children:(0,o.jsx)(f.default,{id:`Category1${i}`,Slide:B,data:{list:_,configuration:{shape:a?.shape,event:s,title:a?.title,totalCategories:b}},isHalf:v})}),(0,o.jsx)("div",{className:"h-7"})]})});C.displayName="Category";var R=(0,I.withLayout)(C);
1
+ "use strict";"use client";var $=Object.create;var d=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty;var M=(e,t)=>{for(var a in t)d(e,a,{get:t[a],enumerable:!0})},w=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of L(t))!T.call(e,i)&&i!==a&&d(e,i,{get:()=>t[i],enumerable:!(r=E(t,i))||r.enumerable});return e};var u=(e,t,a)=>(a=e!=null?$(S(e)):{},w(t||!e||!e.__esModule?d(a,"default",{value:e,enumerable:!0}):a,e)),D=e=>w(d({},"__esModule",{value:!0}),e);var z={};M(z,{default:()=>R});module.exports=D(z);var o=require("react/jsx-runtime"),l=u(require("react")),n=require("../../helpers/utils.js"),h=u(require("../../components/picture.js")),I=require("../../shared/Styles.js"),N=u(require("../Title/index.js")),f=u(require("./SwiperCategory.js")),x=require("../../hooks/useExposure.js"),y=require("../../shared/trackUrlRef.js");const p="image",c="category_banner",g=5,j=3,P=(e,t)=>{const a=[];for(let r=0;r<e.length;r+=t)a.push(e.slice(r,r+t));return a},H=({data:e,configuration:t})=>{const a=(0,l.useRef)(null);return(0,x.useExposure)(a,{componentType:p,componentName:c,componentTitle:e?.name,position:t?.index+1}),(0,o.jsx)("div",{className:(0,n.cn)("relative","aspect-w-[167] aspect-h-[120]","tablet:aspect-w-[167] tablet:aspect-h-[120]","laptop:aspect-w-[212] laptop:aspect-h-[144]","desktop:aspect-w-[205] desktop:aspect-h-[192]","lg-desktop:aspect-w-[264] lg-desktop:aspect-h-[240]"),children:(0,o.jsxs)("div",{ref:a,className:(0,n.cn)("tablet:p-3 laptop:p-4 desktop:p-6 absolute inset-0 justify-between","bg-container-primary hover:bg-info-white group box-border flex cursor-pointer flex-col overflow-hidden duration-300",t?.shape==="round"?"rounded-2xl":"rounded-none"),children:[(0,o.jsx)("div",{className:"transition-all duration-300 group-hover:scale-110",children:(0,o.jsx)("a",{"aria-label":e?.name,href:(0,y.trackUrlRef)(e?.link,`${p}_${c}`),"data-headless-type-name":`${p}#${c}`,"data-headless-title-desc-button":`${e?.name}`,onClick:()=>t?.event?.primaryButton(e,t?.index),children:(0,o.jsx)(h.default,{alt:e?.image?.alt||"",source:e?.image?.url||"",className:"laptop:size-[88px] tablet:size-[72px] desktop:size-[116px] lg-desktop:size-[146px] m-auto flex justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover"})})}),(0,o.jsx)("p",{className:"lg-desktop:text-lg lg-desktop:!leading-6 text-info-primary box-border line-clamp-2 text-center text-sm font-bold leading-4",children:e?.name})]})})},A=({data:e,configuration:t,index:a,isFirstItemLarger:r})=>{const i=(0,l.useRef)(null);(0,x.useExposure)(i,{componentType:p,componentName:c,componentTitle:e?.name,position:t?.index+1});const s=a===0;return(0,o.jsxs)("div",{ref:i,className:(0,n.cn)("bg-container-primary box-border flex w-full shrink-0 flex-col items-center justify-center overflow-hidden","hover:bg-info-white cursor-pointer duration-300",r?(0,n.cn)("p-4",s?"aspect-h-[252] row-span-2":"aspect-h-[120]"):"max-h-[126px] px-3 py-4",t?.shape==="round"?"rounded-2xl":"rounded-none"),children:[(0,o.jsx)("a",{href:(0,y.trackUrlRef)(e?.link,`${p}_${c}`),"data-headless-type-name":`${p}#${c}`,"data-headless-title-desc-button":`${e?.name}`,"data-headless-nav-postion":`''#${t?.index+1}`,onClick:()=>t?.event?.primaryButton(e,t?.index+1),children:(0,o.jsx)(h.default,{source:e?.image?.url||"",alt:e?.image?.alt||"",className:(0,n.cn)("m-auto mb-2 flex justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover",r?(0,n.cn)(s?"max-h-[146px] overflow-hidden":"max-h-[72px] max-w-[72px]"):"size-[72px]")})}),(0,o.jsx)("p",{className:(0,n.cn)("text-info-primary w-full text-center text-sm font-bold",r?"line-clamp-2":"shrink-0 truncate"),children:e?.name})]})},B=({data:e,configuration:t})=>{const r=(t?.totalCategories??0)<=g;return(0,o.jsx)("div",{className:`gap-3 ${r?"grid grid-cols-2":"flex h-full flex-col"}`,children:e?.map((i,s)=>(0,o.jsx)(A,{index:s,data:i,configuration:t,isFirstItemLarger:r},s))})},C=l.default.forwardRef((e,t)=>{const{data:a,className:r="",key:i,event:s}=e,m=(a?.isShowSelect?a?.products:a?.productData)||[],v=m.length>g,b=m.length,_=P(m,v?j:g),k=(0,l.useRef)(null);return(0,l.useImperativeHandle)(t,()=>k.current),(0,o.jsxs)("div",{ref:k,className:(0,n.cn)("w-full overflow-hidden",r,{"aiui-dark":a?.theme==="dark"}),children:[a?.title&&(0,o.jsx)(N.default,{data:{title:a?.title},className:"text-4xl"}),(0,o.jsx)("div",{className:"tablet:block hidden",children:(0,o.jsx)(f.default,{id:`Category${i}`,Slide:H,data:{list:m,configuration:{shape:a?.shape,event:s,title:a?.title,totalCategories:b}}})}),(0,o.jsx)("div",{className:"tablet:hidden block",children:(0,o.jsx)(f.default,{id:`Category1${i}`,Slide:B,data:{list:_,configuration:{shape:a?.shape,event:s,title:a?.title,totalCategories:b}},isHalf:v})}),(0,o.jsx)("div",{className:"h-7"})]})});C.displayName="Category";var R=(0,I.withLayout)(C);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Category/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from './SwiperCategory.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport type { Img } from '../../types/props.js'\n\nconst componentType = 'image'\nconst componentName = 'category_banner'\nconst MOBILE_FULL_PAGE_CAPACITY = 5\nconst MOBILE_COMPACT_PAGE_SIZE = 3\n\nexport interface CategoryItem {\n /** \u4EA7\u54C1\u56FE\u7247*/\n image: Img\n name: string\n link?: string\n}\n\nexport interface CategoryProps {\n className?: string\n /** \u4E3B\u9898\u8272*/\n data: {\n isShowSelect: boolean\n products: CategoryItem[]\n productData: CategoryItem[]\n /** \u5361\u7247\u5F62\u72B6 */\n shape?: 'round' | 'square'\n title?: string\n theme?: 'light' | 'dark'\n }\n buildData?: {\n categories: any[]\n products: any[]\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: {\n primaryButton?: (_v: any, _index: number) => void\n }\n key?: string\n}\n\nconst chunkArray = (arr: any[], size: number) => {\n const chunks = []\n for (let i = 0; i < arr.length; i += size) {\n chunks.push(arr.slice(i, i + size))\n }\n return chunks\n}\n\nconst CategoryPcItem = ({ data, configuration }: { data: CategoryItem; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.name,\n position: configuration?.index + 1,\n })\n\n return (\n <div\n className={cn(\n 'relative',\n 'aspect-w-[167] aspect-h-[120]',\n 'tablet:aspect-w-[167] tablet:aspect-h-[120]',\n 'laptop:aspect-w-[212] laptop:aspect-h-[144]',\n 'desktop:aspect-w-[205] desktop:aspect-h-[192]',\n 'lg-desktop:aspect-w-[264] lg-desktop:aspect-h-[240]'\n )}\n >\n <div\n ref={ref}\n className={cn(\n 'tablet:p-3 laptop:p-4 desktop:p-6 absolute inset-0 justify-between',\n 'bg-container-secondary-1 hover:bg-info-white group box-border flex cursor-pointer flex-col overflow-hidden duration-300',\n configuration?.shape === 'round' ? 'rounded-2xl' : 'rounded-none'\n )}\n >\n <div className=\"transition-all duration-300 group-hover:scale-110\">\n <a\n aria-label={data?.name}\n href={trackUrlRef(data?.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.name}`}\n onClick={() => configuration?.event?.primaryButton(data, configuration?.index)}\n >\n <Picture\n alt={data?.image?.alt || ''}\n source={data?.image?.url || ''}\n className=\"laptop:size-[88px] tablet:size-[72px] desktop:size-[116px] lg-desktop:size-[146px] m-auto flex justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover\"\n />\n </a>\n </div>\n <p className=\"lg-desktop:text-lg lg-desktop:!leading-6 text-info-primary box-border line-clamp-2 text-center text-sm font-bold leading-4\">\n {data?.name}\n </p>\n </div>\n </div>\n )\n}\n\n// \u79FB\u52A8\u7AEF\u54C1\u7C7B\u5C55\u793A\u7EC4\u4EF6\nconst SingleMobileItem = ({\n data,\n configuration,\n index,\n isFirstItemLarger,\n}: {\n data: CategoryItem\n configuration?: any\n index: number\n isFirstItemLarger: boolean\n}) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.name,\n position: configuration?.index + 1,\n })\n\n const isFirstItem = index === 0\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-primary box-border flex w-full shrink-0 flex-col items-center justify-center overflow-hidden',\n 'hover:bg-info-white cursor-pointer duration-300',\n // \u5F53\u7B2C\u4E00\u4E2A\u9879\u76EE\u9700\u8981\u66F4\u5927\u7A7A\u95F4\u65F6\u8C03\u6574\u6837\u5F0F\n isFirstItemLarger\n ? cn('p-4', isFirstItem ? 'aspect-h-[252] row-span-2' : 'aspect-h-[120]')\n : 'max-h-[126px] px-3 py-4',\n configuration?.shape === 'round' ? 'rounded-2xl' : 'rounded-none'\n )}\n >\n <a\n href={trackUrlRef(data?.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.name}`}\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n onClick={() => configuration?.event?.primaryButton(data, configuration?.index + 1)}\n >\n <Picture\n source={data?.image?.url || ''}\n alt={data?.image?.alt || ''}\n className={cn(\n 'm-auto mb-2 flex justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover',\n // \u5F53\u7B2C\u4E00\u4E2A\u9879\u76EE\u9700\u8981\u66F4\u5927\u7A7A\u95F4\u65F6\u8C03\u6574\u56FE\u7247\u5C3A\u5BF8\n isFirstItemLarger\n ? cn(isFirstItem ? 'max-h-[146px] overflow-hidden' : 'max-h-[72px] max-w-[72px]')\n : 'size-[72px]'\n )}\n />\n </a>\n <p\n className={cn(\n 'text-info-primary w-full text-center text-sm font-bold',\n // \u5F53\u7B2C\u4E00\u4E2A\u9879\u76EE\u9700\u8981\u66F4\u5927\u7A7A\u95F4\u65F6\u8C03\u6574\u6587\u5B57\u663E\u793A\n isFirstItemLarger ? 'line-clamp-2' : 'shrink-0 truncate'\n )}\n >\n {data?.name}\n </p>\n </div>\n )\n}\n\n// \u79FB\u52A8\u7AEF\u54C1\u7C7B\u5C55\u793A\nconst CategoryMobileItem = ({ data, configuration }: { data: CategoryItem[]; configuration?: any }) => {\n const totalCategories = configuration?.totalCategories ?? 0\n // \u5F53\u6570\u91CF\u5C11\u4E8E\u5BB9\u5668\u65F6\uFF0C\u7B2C\u4E00\u4E2A\u9879\u76EE\u4F1A\u5360\u636E\u66F4\u5927\u7A7A\u95F4\n const isFirstItemLarger = totalCategories <= MOBILE_FULL_PAGE_CAPACITY\n return (\n <div className={`gap-3 ${isFirstItemLarger ? 'grid grid-cols-2' : 'flex h-full flex-col'}`}>\n {data?.map((item, index) => (\n <SingleMobileItem\n key={index}\n index={index}\n data={item}\n configuration={configuration}\n isFirstItemLarger={isFirstItemLarger}\n />\n ))}\n </div>\n )\n}\n\nconst Category = React.forwardRef<HTMLDivElement, CategoryProps>((props, ref) => {\n const { data, className = '', key, event } = props\n // soundcore\u54C1\u724C\u54C1\u7C7B\u4E0D\u8D85\u8FC75\u4E2A\uFF0C\u5355\u72EC\u505A\u6837\u5F0F\u5904\u7406\n const currentData = (data?.isShowSelect ? data?.products : data?.productData) || []\n const isCardShow = currentData.length > MOBILE_FULL_PAGE_CAPACITY\n const totalCategories = currentData.length\n const mobileSlides = chunkArray(currentData, isCardShow ? MOBILE_COMPACT_PAGE_SIZE : MOBILE_FULL_PAGE_CAPACITY)\n\n const innerRef = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n return (\n <div ref={innerRef} className={cn('w-full overflow-hidden', className, { 'aiui-dark': data?.theme === 'dark' })}>\n {data?.title && <Title data={{ title: data?.title }} className=\"text-4xl\" />}\n <div className=\"tablet:block hidden\">\n <SwiperBox\n id={`Category${key}`}\n Slide={CategoryPcItem}\n data={{\n list: currentData,\n configuration: { shape: data?.shape, event: event, title: data?.title, totalCategories },\n }}\n />\n </div>\n <div className=\"tablet:hidden block\">\n <SwiperBox\n id={`Category1${key}`}\n Slide={CategoryMobileItem}\n data={{\n list: mobileSlides,\n configuration: { shape: data?.shape, event: event, title: data?.title, totalCategories },\n }}\n isHalf={isCardShow}\n />\n </div>\n <div className=\"h-7\" />\n </div>\n )\n})\n\nCategory.displayName = 'Category'\n\nexport default withLayout(Category)\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA2EM,IAAAI,EAAA,6BA1ENC,EAAmD,oBACnDC,EAAmB,kCACnBC,EAAoB,0CACpBC,EAA2B,kCAC3BC,EAAkB,gCAClBC,EAAsB,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eA,GAAM,SAAWA,GAAM,cAAgB,CAAC,EAC5EiB,EAAaD,EAAY,OAASxB,EAClC0B,EAAkBF,EAAY,OAC9BG,EAAezB,EAAWsB,EAAaC,EAAaxB,EAA2BD,CAAyB,EAExG4B,KAAW,UAAuB,IAAI,EAE5C,gCAAoBlB,EAAK,IAAMkB,EAAS,OAAyB,KAG/D,QAAC,OAAI,IAAKA,EAAU,aAAW,MAAG,yBAA0BP,EAAW,CAAE,YAAab,GAAM,QAAU,MAAO,CAAC,EAC3G,UAAAA,GAAM,UAAS,OAAC,EAAAqB,QAAA,CAAM,KAAM,CAAE,MAAOrB,GAAM,KAAM,EAAG,UAAU,WAAW,KAC1E,OAAC,OAAI,UAAU,sBACb,mBAAC,EAAAsB,QAAA,CACC,GAAI,WAAWR,CAAG,GAClB,MAAOf,EACP,KAAM,CACJ,KAAMiB,EACN,cAAe,CAAE,MAAOhB,GAAM,MAAO,MAAOe,EAAO,MAAOf,GAAM,MAAO,gBAAAkB,CAAgB,CACzF,EACF,EACF,KACA,OAAC,OAAI,UAAU,sBACb,mBAAC,EAAAI,QAAA,CACC,GAAI,YAAYR,CAAG,GACnB,MAAON,EACP,KAAM,CACJ,KAAMW,EACN,cAAe,CAAE,MAAOnB,GAAM,MAAO,MAAOe,EAAO,MAAOf,GAAM,MAAO,gBAAAkB,CAAgB,CACzF,EACA,OAAQD,EACV,EACF,KACA,OAAC,OAAI,UAAU,MAAM,GACvB,CAEJ,CAAC,EAEDP,EAAS,YAAc,WAEvB,IAAO/B,KAAQ,cAAW+B,CAAQ",
4
+ "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from './SwiperCategory.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport type { Img } from '../../types/props.js'\n\nconst componentType = 'image'\nconst componentName = 'category_banner'\nconst MOBILE_FULL_PAGE_CAPACITY = 5\nconst MOBILE_COMPACT_PAGE_SIZE = 3\n\nexport interface CategoryItem {\n /** \u4EA7\u54C1\u56FE\u7247*/\n image: Img\n name: string\n link?: string\n}\n\nexport interface CategoryProps {\n className?: string\n /** \u4E3B\u9898\u8272*/\n data: {\n isShowSelect: boolean\n products: CategoryItem[]\n productData: CategoryItem[]\n /** \u5361\u7247\u5F62\u72B6 */\n shape?: 'round' | 'square'\n title?: string\n theme?: 'light' | 'dark'\n }\n buildData?: {\n categories: any[]\n products: any[]\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: {\n primaryButton?: (_v: any, _index: number) => void\n }\n key?: string\n}\n\nconst chunkArray = (arr: any[], size: number) => {\n const chunks = []\n for (let i = 0; i < arr.length; i += size) {\n chunks.push(arr.slice(i, i + size))\n }\n return chunks\n}\n\nconst CategoryPcItem = ({ data, configuration }: { data: CategoryItem; configuration?: any }) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.name,\n position: configuration?.index + 1,\n })\n\n return (\n <div\n className={cn(\n 'relative',\n 'aspect-w-[167] aspect-h-[120]',\n 'tablet:aspect-w-[167] tablet:aspect-h-[120]',\n 'laptop:aspect-w-[212] laptop:aspect-h-[144]',\n 'desktop:aspect-w-[205] desktop:aspect-h-[192]',\n 'lg-desktop:aspect-w-[264] lg-desktop:aspect-h-[240]'\n )}\n >\n <div\n ref={ref}\n className={cn(\n 'tablet:p-3 laptop:p-4 desktop:p-6 absolute inset-0 justify-between',\n 'bg-container-primary hover:bg-info-white group box-border flex cursor-pointer flex-col overflow-hidden duration-300',\n configuration?.shape === 'round' ? 'rounded-2xl' : 'rounded-none'\n )}\n >\n <div className=\"transition-all duration-300 group-hover:scale-110\">\n <a\n aria-label={data?.name}\n href={trackUrlRef(data?.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.name}`}\n onClick={() => configuration?.event?.primaryButton(data, configuration?.index)}\n >\n <Picture\n alt={data?.image?.alt || ''}\n source={data?.image?.url || ''}\n className=\"laptop:size-[88px] tablet:size-[72px] desktop:size-[116px] lg-desktop:size-[146px] m-auto flex justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover\"\n />\n </a>\n </div>\n <p className=\"lg-desktop:text-lg lg-desktop:!leading-6 text-info-primary box-border line-clamp-2 text-center text-sm font-bold leading-4\">\n {data?.name}\n </p>\n </div>\n </div>\n )\n}\n\n// \u79FB\u52A8\u7AEF\u54C1\u7C7B\u5C55\u793A\u7EC4\u4EF6\nconst SingleMobileItem = ({\n data,\n configuration,\n index,\n isFirstItemLarger,\n}: {\n data: CategoryItem\n configuration?: any\n index: number\n isFirstItemLarger: boolean\n}) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useExposure(ref, {\n componentType,\n componentName,\n componentTitle: data?.name,\n position: configuration?.index + 1,\n })\n\n const isFirstItem = index === 0\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-primary box-border flex w-full shrink-0 flex-col items-center justify-center overflow-hidden',\n 'hover:bg-info-white cursor-pointer duration-300',\n // \u5F53\u7B2C\u4E00\u4E2A\u9879\u76EE\u9700\u8981\u66F4\u5927\u7A7A\u95F4\u65F6\u8C03\u6574\u6837\u5F0F\n isFirstItemLarger\n ? cn('p-4', isFirstItem ? 'aspect-h-[252] row-span-2' : 'aspect-h-[120]')\n : 'max-h-[126px] px-3 py-4',\n configuration?.shape === 'round' ? 'rounded-2xl' : 'rounded-none'\n )}\n >\n <a\n href={trackUrlRef(data?.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${data?.name}`}\n data-headless-nav-postion={`''#${configuration?.index + 1}`}\n onClick={() => configuration?.event?.primaryButton(data, configuration?.index + 1)}\n >\n <Picture\n source={data?.image?.url || ''}\n alt={data?.image?.alt || ''}\n className={cn(\n 'm-auto mb-2 flex justify-center object-cover [&_img]:h-full [&_img]:w-auto [&_img]:object-cover',\n // \u5F53\u7B2C\u4E00\u4E2A\u9879\u76EE\u9700\u8981\u66F4\u5927\u7A7A\u95F4\u65F6\u8C03\u6574\u56FE\u7247\u5C3A\u5BF8\n isFirstItemLarger\n ? cn(isFirstItem ? 'max-h-[146px] overflow-hidden' : 'max-h-[72px] max-w-[72px]')\n : 'size-[72px]'\n )}\n />\n </a>\n <p\n className={cn(\n 'text-info-primary w-full text-center text-sm font-bold',\n // \u5F53\u7B2C\u4E00\u4E2A\u9879\u76EE\u9700\u8981\u66F4\u5927\u7A7A\u95F4\u65F6\u8C03\u6574\u6587\u5B57\u663E\u793A\n isFirstItemLarger ? 'line-clamp-2' : 'shrink-0 truncate'\n )}\n >\n {data?.name}\n </p>\n </div>\n )\n}\n\n// \u79FB\u52A8\u7AEF\u54C1\u7C7B\u5C55\u793A\nconst CategoryMobileItem = ({ data, configuration }: { data: CategoryItem[]; configuration?: any }) => {\n const totalCategories = configuration?.totalCategories ?? 0\n // \u5F53\u6570\u91CF\u5C11\u4E8E\u5BB9\u5668\u65F6\uFF0C\u7B2C\u4E00\u4E2A\u9879\u76EE\u4F1A\u5360\u636E\u66F4\u5927\u7A7A\u95F4\n const isFirstItemLarger = totalCategories <= MOBILE_FULL_PAGE_CAPACITY\n return (\n <div className={`gap-3 ${isFirstItemLarger ? 'grid grid-cols-2' : 'flex h-full flex-col'}`}>\n {data?.map((item, index) => (\n <SingleMobileItem\n key={index}\n index={index}\n data={item}\n configuration={configuration}\n isFirstItemLarger={isFirstItemLarger}\n />\n ))}\n </div>\n )\n}\n\nconst Category = React.forwardRef<HTMLDivElement, CategoryProps>((props, ref) => {\n const { data, className = '', key, event } = props\n // soundcore\u54C1\u724C\u54C1\u7C7B\u4E0D\u8D85\u8FC75\u4E2A\uFF0C\u5355\u72EC\u505A\u6837\u5F0F\u5904\u7406\n const currentData = (data?.isShowSelect ? data?.products : data?.productData) || []\n const isCardShow = currentData.length > MOBILE_FULL_PAGE_CAPACITY\n const totalCategories = currentData.length\n const mobileSlides = chunkArray(currentData, isCardShow ? MOBILE_COMPACT_PAGE_SIZE : MOBILE_FULL_PAGE_CAPACITY)\n\n const innerRef = useRef<HTMLDivElement>(null)\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n return (\n <div ref={innerRef} className={cn('w-full overflow-hidden', className, { 'aiui-dark': data?.theme === 'dark' })}>\n {data?.title && <Title data={{ title: data?.title }} className=\"text-4xl\" />}\n <div className=\"tablet:block hidden\">\n <SwiperBox\n id={`Category${key}`}\n Slide={CategoryPcItem}\n data={{\n list: currentData,\n configuration: { shape: data?.shape, event: event, title: data?.title, totalCategories },\n }}\n />\n </div>\n <div className=\"tablet:hidden block\">\n <SwiperBox\n id={`Category1${key}`}\n Slide={CategoryMobileItem}\n data={{\n list: mobileSlides,\n configuration: { shape: data?.shape, event: event, title: data?.title, totalCategories },\n }}\n isHalf={isCardShow}\n />\n </div>\n <div className=\"h-7\" />\n </div>\n )\n})\n\nCategory.displayName = 'Category'\n\nexport default withLayout(Category)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA2EM,IAAAI,EAAA,6BA1ENC,EAAmD,oBACnDC,EAAmB,kCACnBC,EAAoB,0CACpBC,EAA2B,kCAC3BC,EAAkB,gCAClBC,EAAsB,kCACtBC,EAA4B,sCAC5BC,EAA4B,uCAG5B,MAAMC,EAAgB,QAChBC,EAAgB,kBAChBC,EAA4B,EAC5BC,EAA2B,EAgC3BC,EAAa,CAACC,EAAYC,IAAiB,CAC/C,MAAMC,EAAS,CAAC,EAChB,QAASC,EAAI,EAAGA,EAAIH,EAAI,OAAQG,GAAKF,EACnCC,EAAO,KAAKF,EAAI,MAAMG,EAAGA,EAAIF,CAAI,CAAC,EAEpC,OAAOC,CACT,EAEME,EAAiB,CAAC,CAAE,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UAAAA,GAAM,UAAS,OAAC,EAAAqB,QAAA,CAAM,KAAM,CAAE,MAAOrB,GAAM,KAAM,EAAG,UAAU,WAAW,KAC1E,OAAC,OAAI,UAAU,sBACb,mBAAC,EAAAsB,QAAA,CACC,GAAI,WAAWR,CAAG,GAClB,MAAOf,EACP,KAAM,CACJ,KAAMiB,EACN,cAAe,CAAE,MAAOhB,GAAM,MAAO,MAAOe,EAAO,MAAOf,GAAM,MAAO,gBAAAkB,CAAgB,CACzF,EACF,EACF,KACA,OAAC,OAAI,UAAU,sBACb,mBAAC,EAAAI,QAAA,CACC,GAAI,YAAYR,CAAG,GACnB,MAAON,EACP,KAAM,CACJ,KAAMW,EACN,cAAe,CAAE,MAAOnB,GAAM,MAAO,MAAOe,EAAO,MAAOf,GAAM,MAAO,gBAAAkB,CAAgB,CACzF,EACA,OAAQD,EACV,EACF,KACA,OAAC,OAAI,UAAU,MAAM,GACvB,CAEJ,CAAC,EAEDP,EAAS,YAAc,WAEvB,IAAO/B,KAAQ,cAAW+B,CAAQ",
6
6
  "names": ["Category_exports", "__export", "Category_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_picture", "import_Styles", "import_Title", "import_SwiperCategory", "import_useExposure", "import_trackUrlRef", "componentType", "componentName", "MOBILE_FULL_PAGE_CAPACITY", "MOBILE_COMPACT_PAGE_SIZE", "chunkArray", "arr", "size", "chunks", "i", "CategoryPcItem", "data", "configuration", "ref", "Picture", "SingleMobileItem", "index", "isFirstItemLarger", "isFirstItem", "CategoryMobileItem", "item", "Category", "React", "props", "className", "key", "event", "currentData", "isCardShow", "totalCategories", "mobileSlides", "innerRef", "Title", "SwiperBox"]
7
7
  }