@anker-in/headless-ui 1.0.9 → 1.0.10

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 (251) hide show
  1. package/dist/cjs/biz-components/AccordionCards/index.d.ts +3 -2
  2. package/dist/cjs/biz-components/AccordionCards/index.js +1 -1
  3. package/dist/cjs/biz-components/AccordionCards/index.js.map +2 -2
  4. package/dist/cjs/biz-components/BrandEquity/BrandEquity.d.ts +1 -1
  5. package/dist/cjs/biz-components/BrandEquity/BrandEquity.js +1 -1
  6. package/dist/cjs/biz-components/BrandEquity/BrandEquity.js.map +1 -1
  7. package/dist/cjs/biz-components/Category/index.d.ts +1 -1
  8. package/dist/cjs/biz-components/Category/index.js +1 -1
  9. package/dist/cjs/biz-components/Category/index.js.map +2 -2
  10. package/dist/cjs/biz-components/Evaluate/index.d.ts +1 -1
  11. package/dist/cjs/biz-components/Evaluate/index.js +1 -1
  12. package/dist/cjs/biz-components/Evaluate/index.js.map +3 -3
  13. package/dist/cjs/biz-components/Faq/Faq.d.ts +14 -0
  14. package/dist/cjs/biz-components/Faq/Faq.js +2 -0
  15. package/dist/cjs/biz-components/Faq/Faq.js.map +7 -0
  16. package/dist/cjs/biz-components/Faq/index.d.ts +2 -0
  17. package/dist/cjs/biz-components/Faq/index.js +2 -0
  18. package/dist/cjs/biz-components/Faq/index.js.map +7 -0
  19. package/dist/cjs/biz-components/Faq/types.d.ts +12 -0
  20. package/dist/cjs/biz-components/Faq/types.js +2 -0
  21. package/dist/cjs/biz-components/Faq/types.js.map +7 -0
  22. package/dist/cjs/biz-components/Graphic/index.d.ts +2 -1
  23. package/dist/cjs/biz-components/Graphic/index.js +1 -1
  24. package/dist/cjs/biz-components/Graphic/index.js.map +2 -2
  25. package/dist/cjs/biz-components/GraphicAttractionBlock/index.d.ts +1 -1
  26. package/dist/cjs/biz-components/GraphicAttractionBlock/index.js +1 -1
  27. package/dist/cjs/biz-components/GraphicAttractionBlock/index.js.map +1 -1
  28. package/dist/cjs/biz-components/HeroBanner/HeroBanner.d.ts +1 -1
  29. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
  30. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  31. package/dist/cjs/biz-components/Marquee/Marquee.d.ts +1 -1
  32. package/dist/cjs/biz-components/Marquee/Marquee.js +1 -1
  33. package/dist/cjs/biz-components/Marquee/Marquee.js.map +1 -1
  34. package/dist/cjs/biz-components/MediaPlayerBase/index.d.ts +1 -1
  35. package/dist/cjs/biz-components/MediaPlayerBase/index.js +1 -1
  36. package/dist/cjs/biz-components/MediaPlayerBase/index.js.map +3 -3
  37. package/dist/cjs/biz-components/MediaPlayerBase/types.d.ts +2 -0
  38. package/dist/cjs/biz-components/MediaPlayerBase/types.js +1 -1
  39. package/dist/cjs/biz-components/MediaPlayerBase/types.js.map +1 -1
  40. package/dist/cjs/biz-components/MediaPlayerMulti/index.d.ts +1 -1
  41. package/dist/cjs/biz-components/MediaPlayerMulti/index.js +1 -1
  42. package/dist/cjs/biz-components/MediaPlayerMulti/index.js.map +1 -1
  43. package/dist/cjs/biz-components/MediaPlayerSticky/index.d.ts +1 -1
  44. package/dist/cjs/biz-components/MediaPlayerSticky/index.js +1 -1
  45. package/dist/cjs/biz-components/MediaPlayerSticky/index.js.map +2 -2
  46. package/dist/cjs/biz-components/MemberEquity/index.d.ts +1 -1
  47. package/dist/cjs/biz-components/MemberEquity/index.js +2 -2
  48. package/dist/cjs/biz-components/MemberEquity/index.js.map +2 -2
  49. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +1 -1
  50. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  51. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
  52. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/types.d.ts +5 -0
  53. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/types.js +1 -1
  54. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/types.js.map +1 -1
  55. package/dist/cjs/biz-components/ShelfDisplay/index.d.ts +6 -3
  56. package/dist/cjs/biz-components/ShelfDisplay/index.js +3 -3
  57. package/dist/cjs/biz-components/ShelfDisplay/index.js.map +3 -3
  58. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js +1 -1
  59. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js.map +2 -2
  60. package/dist/cjs/biz-components/Slogan/index.d.ts +1 -1
  61. package/dist/cjs/biz-components/Slogan/index.js +1 -1
  62. package/dist/cjs/biz-components/Slogan/index.js.map +3 -3
  63. package/dist/cjs/biz-components/Spacer/index.d.ts +1 -1
  64. package/dist/cjs/biz-components/Spacer/index.js +1 -1
  65. package/dist/cjs/biz-components/Spacer/index.js.map +1 -1
  66. package/dist/cjs/biz-components/Tabs/Tabs.d.ts +1 -1
  67. package/dist/cjs/biz-components/Tabs/Tabs.js +1 -1
  68. package/dist/cjs/biz-components/Tabs/Tabs.js.map +3 -3
  69. package/dist/cjs/biz-components/Tabs/types.d.ts +6 -0
  70. package/dist/cjs/biz-components/Tabs/types.js +1 -1
  71. package/dist/cjs/biz-components/Tabs/types.js.map +1 -1
  72. package/dist/cjs/biz-components/Title/index.d.ts +1 -1
  73. package/dist/cjs/biz-components/Title/index.js +1 -1
  74. package/dist/cjs/biz-components/Title/index.js.map +3 -3
  75. package/dist/cjs/biz-components/Title/types.d.ts +4 -0
  76. package/dist/cjs/biz-components/Title/types.js +1 -1
  77. package/dist/cjs/biz-components/Title/types.js.map +1 -1
  78. package/dist/cjs/biz-components/WhyChoose/WhyChoose.d.ts +14 -0
  79. package/dist/cjs/biz-components/WhyChoose/WhyChoose.js +2 -0
  80. package/dist/cjs/biz-components/WhyChoose/WhyChoose.js.map +7 -0
  81. package/dist/cjs/biz-components/WhyChoose/index.d.ts +2 -0
  82. package/dist/cjs/biz-components/WhyChoose/index.js +2 -0
  83. package/dist/cjs/biz-components/WhyChoose/index.js.map +7 -0
  84. package/dist/cjs/biz-components/WhyChoose/types.d.ts +12 -0
  85. package/dist/cjs/biz-components/WhyChoose/types.js +2 -0
  86. package/dist/cjs/biz-components/WhyChoose/types.js.map +7 -0
  87. package/dist/cjs/biz-components/index.d.ts +4 -0
  88. package/dist/cjs/biz-components/index.js +1 -1
  89. package/dist/cjs/biz-components/index.js.map +3 -3
  90. package/dist/cjs/components/button.d.ts +3 -0
  91. package/dist/cjs/components/button.js +1 -1
  92. package/dist/cjs/components/button.js.map +3 -3
  93. package/dist/cjs/components/container.js +1 -1
  94. package/dist/cjs/components/container.js.map +2 -2
  95. package/dist/cjs/components/picture.js +1 -1
  96. package/dist/cjs/components/picture.js.map +3 -3
  97. package/dist/cjs/helpers/utils.d.ts +1 -0
  98. package/dist/cjs/helpers/utils.js +1 -1
  99. package/dist/cjs/helpers/utils.js.map +3 -3
  100. package/dist/cjs/hooks/useExposure.js +1 -1
  101. package/dist/cjs/hooks/useExposure.js.map +3 -3
  102. package/dist/cjs/shared/Styles.d.ts +11 -3
  103. package/dist/cjs/shared/Styles.js +1 -1
  104. package/dist/cjs/shared/Styles.js.map +3 -3
  105. package/dist/cjs/stories/HeroBanner.stories.d.ts +1 -1
  106. package/dist/cjs/stories/MultiLayoutGraphicBlock.stories.d.ts +1 -0
  107. package/dist/cjs/stories/MultiLayoutGraphicBlock.stories.js +1 -1
  108. package/dist/cjs/stories/MultiLayoutGraphicBlock.stories.js.map +3 -3
  109. package/dist/cjs/stories/accordionCards.stories.d.ts +1 -21
  110. package/dist/cjs/stories/brandEquity.stories.d.ts +1 -1
  111. package/dist/cjs/stories/button.stories.d.ts +1 -0
  112. package/dist/cjs/stories/button.stories.js +1 -1
  113. package/dist/cjs/stories/button.stories.js.map +3 -3
  114. package/dist/cjs/stories/category.stories.d.ts +1 -1
  115. package/dist/cjs/stories/evaluate.stories.d.ts +1 -1
  116. package/dist/cjs/stories/faq.stories.d.ts +21 -0
  117. package/dist/cjs/stories/faq.stories.js +2 -0
  118. package/dist/cjs/stories/faq.stories.js.map +7 -0
  119. package/dist/cjs/stories/graphic.stories.d.ts +7 -2
  120. package/dist/cjs/stories/graphic.stories.js +1 -1
  121. package/dist/cjs/stories/graphic.stories.js.map +2 -2
  122. package/dist/cjs/stories/marquee.stories.d.ts +1 -1
  123. package/dist/cjs/stories/mediaplayerMulti.stories.d.ts +1 -1
  124. package/dist/cjs/stories/shelfDisplay.stories.d.ts +1 -1
  125. package/dist/cjs/stories/slogan.stories.d.ts +1 -1
  126. package/dist/cjs/stories/whychoose.stories.d.ts +21 -0
  127. package/dist/cjs/stories/whychoose.stories.js +2 -0
  128. package/dist/cjs/stories/whychoose.stories.js.map +7 -0
  129. package/dist/esm/biz-components/AccordionCards/index.d.ts +3 -2
  130. package/dist/esm/biz-components/AccordionCards/index.js +1 -1
  131. package/dist/esm/biz-components/AccordionCards/index.js.map +3 -3
  132. package/dist/esm/biz-components/BrandEquity/BrandEquity.d.ts +1 -1
  133. package/dist/esm/biz-components/BrandEquity/BrandEquity.js +1 -1
  134. package/dist/esm/biz-components/BrandEquity/BrandEquity.js.map +2 -2
  135. package/dist/esm/biz-components/Category/index.d.ts +1 -1
  136. package/dist/esm/biz-components/Category/index.js +1 -1
  137. package/dist/esm/biz-components/Category/index.js.map +3 -3
  138. package/dist/esm/biz-components/Evaluate/index.d.ts +1 -1
  139. package/dist/esm/biz-components/Evaluate/index.js +1 -1
  140. package/dist/esm/biz-components/Evaluate/index.js.map +3 -3
  141. package/dist/esm/biz-components/Faq/Faq.d.ts +14 -0
  142. package/dist/esm/biz-components/Faq/Faq.js +2 -0
  143. package/dist/esm/biz-components/Faq/Faq.js.map +7 -0
  144. package/dist/esm/biz-components/Faq/index.d.ts +2 -0
  145. package/dist/esm/biz-components/Faq/index.js +2 -0
  146. package/dist/esm/biz-components/Faq/index.js.map +7 -0
  147. package/dist/esm/biz-components/Faq/types.d.ts +12 -0
  148. package/dist/esm/biz-components/Faq/types.js +1 -0
  149. package/dist/esm/biz-components/Faq/types.js.map +7 -0
  150. package/dist/esm/biz-components/Graphic/index.d.ts +2 -1
  151. package/dist/esm/biz-components/Graphic/index.js +1 -1
  152. package/dist/esm/biz-components/Graphic/index.js.map +3 -3
  153. package/dist/esm/biz-components/GraphicAttractionBlock/index.d.ts +1 -1
  154. package/dist/esm/biz-components/GraphicAttractionBlock/index.js +1 -1
  155. package/dist/esm/biz-components/GraphicAttractionBlock/index.js.map +2 -2
  156. package/dist/esm/biz-components/HeroBanner/HeroBanner.d.ts +1 -1
  157. package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
  158. package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +3 -3
  159. package/dist/esm/biz-components/Marquee/Marquee.d.ts +1 -1
  160. package/dist/esm/biz-components/Marquee/Marquee.js +1 -1
  161. package/dist/esm/biz-components/Marquee/Marquee.js.map +2 -2
  162. package/dist/esm/biz-components/MediaPlayerBase/index.d.ts +1 -1
  163. package/dist/esm/biz-components/MediaPlayerBase/index.js +1 -1
  164. package/dist/esm/biz-components/MediaPlayerBase/index.js.map +3 -3
  165. package/dist/esm/biz-components/MediaPlayerBase/types.d.ts +2 -0
  166. package/dist/esm/biz-components/MediaPlayerMulti/index.d.ts +1 -1
  167. package/dist/esm/biz-components/MediaPlayerMulti/index.js +1 -1
  168. package/dist/esm/biz-components/MediaPlayerMulti/index.js.map +2 -2
  169. package/dist/esm/biz-components/MediaPlayerSticky/index.d.ts +1 -1
  170. package/dist/esm/biz-components/MediaPlayerSticky/index.js +1 -1
  171. package/dist/esm/biz-components/MediaPlayerSticky/index.js.map +3 -3
  172. package/dist/esm/biz-components/MemberEquity/index.d.ts +1 -1
  173. package/dist/esm/biz-components/MemberEquity/index.js +2 -2
  174. package/dist/esm/biz-components/MemberEquity/index.js.map +3 -3
  175. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +1 -1
  176. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  177. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
  178. package/dist/esm/biz-components/MultiLayoutGraphicBlock/types.d.ts +5 -0
  179. package/dist/esm/biz-components/ShelfDisplay/index.d.ts +6 -3
  180. package/dist/esm/biz-components/ShelfDisplay/index.js +5 -5
  181. package/dist/esm/biz-components/ShelfDisplay/index.js.map +3 -3
  182. package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js +1 -1
  183. package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js.map +2 -2
  184. package/dist/esm/biz-components/Slogan/index.d.ts +1 -1
  185. package/dist/esm/biz-components/Slogan/index.js +1 -1
  186. package/dist/esm/biz-components/Slogan/index.js.map +3 -3
  187. package/dist/esm/biz-components/Spacer/index.d.ts +1 -1
  188. package/dist/esm/biz-components/Spacer/index.js +1 -1
  189. package/dist/esm/biz-components/Spacer/index.js.map +2 -2
  190. package/dist/esm/biz-components/Tabs/Tabs.d.ts +1 -1
  191. package/dist/esm/biz-components/Tabs/Tabs.js +1 -1
  192. package/dist/esm/biz-components/Tabs/Tabs.js.map +3 -3
  193. package/dist/esm/biz-components/Tabs/types.d.ts +6 -0
  194. package/dist/esm/biz-components/Title/index.d.ts +1 -1
  195. package/dist/esm/biz-components/Title/index.js +1 -1
  196. package/dist/esm/biz-components/Title/index.js.map +3 -3
  197. package/dist/esm/biz-components/Title/types.d.ts +4 -0
  198. package/dist/esm/biz-components/WhyChoose/WhyChoose.d.ts +14 -0
  199. package/dist/esm/biz-components/WhyChoose/WhyChoose.js +2 -0
  200. package/dist/esm/biz-components/WhyChoose/WhyChoose.js.map +7 -0
  201. package/dist/esm/biz-components/WhyChoose/index.d.ts +2 -0
  202. package/dist/esm/biz-components/WhyChoose/index.js +2 -0
  203. package/dist/esm/biz-components/WhyChoose/index.js.map +7 -0
  204. package/dist/esm/biz-components/WhyChoose/types.d.ts +12 -0
  205. package/dist/esm/biz-components/WhyChoose/types.js +1 -0
  206. package/dist/esm/biz-components/WhyChoose/types.js.map +7 -0
  207. package/dist/esm/biz-components/index.d.ts +4 -0
  208. package/dist/esm/biz-components/index.js +1 -1
  209. package/dist/esm/biz-components/index.js.map +3 -3
  210. package/dist/esm/components/button.d.ts +3 -0
  211. package/dist/esm/components/button.js +1 -1
  212. package/dist/esm/components/button.js.map +3 -3
  213. package/dist/esm/components/container.js +1 -1
  214. package/dist/esm/components/container.js.map +2 -2
  215. package/dist/esm/components/picture.js +1 -1
  216. package/dist/esm/components/picture.js.map +3 -3
  217. package/dist/esm/helpers/utils.d.ts +1 -0
  218. package/dist/esm/helpers/utils.js +1 -1
  219. package/dist/esm/helpers/utils.js.map +3 -3
  220. package/dist/esm/hooks/useExposure.js +1 -1
  221. package/dist/esm/hooks/useExposure.js.map +3 -3
  222. package/dist/esm/shared/Styles.d.ts +11 -3
  223. package/dist/esm/shared/Styles.js +1 -1
  224. package/dist/esm/shared/Styles.js.map +3 -3
  225. package/dist/esm/stories/HeroBanner.stories.d.ts +1 -1
  226. package/dist/esm/stories/MultiLayoutGraphicBlock.stories.d.ts +1 -0
  227. package/dist/esm/stories/MultiLayoutGraphicBlock.stories.js +1 -1
  228. package/dist/esm/stories/MultiLayoutGraphicBlock.stories.js.map +3 -3
  229. package/dist/esm/stories/accordionCards.stories.d.ts +1 -21
  230. package/dist/esm/stories/brandEquity.stories.d.ts +1 -1
  231. package/dist/esm/stories/button.stories.d.ts +1 -0
  232. package/dist/esm/stories/button.stories.js +1 -1
  233. package/dist/esm/stories/button.stories.js.map +3 -3
  234. package/dist/esm/stories/category.stories.d.ts +1 -1
  235. package/dist/esm/stories/evaluate.stories.d.ts +1 -1
  236. package/dist/esm/stories/faq.stories.d.ts +21 -0
  237. package/dist/esm/stories/faq.stories.js +2 -0
  238. package/dist/esm/stories/faq.stories.js.map +7 -0
  239. package/dist/esm/stories/graphic.stories.d.ts +7 -2
  240. package/dist/esm/stories/graphic.stories.js +1 -1
  241. package/dist/esm/stories/graphic.stories.js.map +2 -2
  242. package/dist/esm/stories/marquee.stories.d.ts +1 -1
  243. package/dist/esm/stories/mediaplayerMulti.stories.d.ts +1 -1
  244. package/dist/esm/stories/shelfDisplay.stories.d.ts +1 -1
  245. package/dist/esm/stories/slogan.stories.d.ts +1 -1
  246. package/dist/esm/stories/whychoose.stories.d.ts +21 -0
  247. package/dist/esm/stories/whychoose.stories.js +2 -0
  248. package/dist/esm/stories/whychoose.stories.js.map +7 -0
  249. package/dist/tokens/base.css +1 -1
  250. package/package.json +1 -1
  251. package/tailwind.config.js +1 -0
@@ -1,6 +1,6 @@
1
- "use strict";"use client";var J=Object.create;var k=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var X=Object.getOwnPropertyNames;var Y=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty;var ee=(e,t)=>{for(var i in t)k(e,i,{get:t[i],enumerable:!0})},$=(e,t,i,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of X(t))!Z.call(e,n)&&n!==i&&k(e,n,{get:()=>t[n],enumerable:!(d=K(t,n))||d.enumerable});return e};var c=(e,t,i)=>(i=e!=null?J(Y(e)):{},$(t||!e||!e.__esModule?k(i,"default",{value:e,enumerable:!0}):i,e)),te=e=>$(k({},"__esModule",{value:!0}),e);var ae={};ee(ae,{default:()=>oe});module.exports=te(ae);var s=require("react/jsx-runtime"),o=c(require("react")),b=require("../../helpers/utils.js"),E=c(require("../../components/picture.js")),L=c(require("./tabSwitch.js")),C=c(require("../../components/button.js")),O=c(require("../Title/index.js")),q=c(require("../SwiperBox/index.js")),H=require("../../shared/Styles.js"),R=require("./shelfDisplay.js"),I=require("react-responsive"),V=require("../../hooks/useExposure.js"),A=require("../../shared/track.js"),j=require("../AiuiProvider/index.js"),U=c(require("../../components/badge.js")),z=require("../../components/heading.js"),F=require("../../components/text.js"),W=require("../../shared/trackUrlRef.js");const _="image",P="product_shelf",se=999999999e-2,ie=({data:e,configuration:t})=>{const{locale:i="us",copyWriting:d}=(0,j.useAiuiContext)(),n=(0,I.useMediaQuery)({query:"(max-width: 768px)"}),T=(r,a,u)=>t?.event?.primaryButton?.(r,a+1,u),h=(r,a,u)=>t?.event?.secondaryButton?.(r,a+1,u),l=e?.variants?.find(r=>r?.sku===e?.sku)||e?.variants?.[0]||{},D=!l?.availableForSale&&l?.price?.amount===se,B=t?.isShowTag,g=t?.isShowOriginalPrice,p=l?.coupons?.[0],{price:y,basePrice:N}=(0,R.formatVariantPrice)({locale:i,amount:g&&p?p.variant_price4wscode:l.price,baseAmount:g&&p?l.price:0,currencyCode:e?.price?.currencyCode||"USD"}),w=()=>{const r=e?.sku,a=e?.variants;return a?.find(v=>v?.sku===r)?.image?.url||a?.[0]?.image?.url||""},m=e?.custom_name||e?.title,S=e?.custom_description||e?.description;return(0,s.jsx)("div",{className:(0,b.cn)("bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full cursor-pointer overflow-hidden duration-300",t?.shape==="round"?"rounded-2xl":"rounded-none","lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]","laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative",{"h-[360px]":n}),children:(0,s.jsxs)("div",{className:"absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4",children:[(0,s.jsx)("div",{className:(0,b.cn)("lg-desktop:mb-3 lg-desktop:h-[195px] relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden"),children:(0,s.jsx)("a",{href:(0,W.trackUrlRef)(`${i==="us"||!i?"":`/${i}`}/products/${e?.handle}`,`${_}_${P}`),children:(0,s.jsx)(E.default,{source:w(),alt:"",className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),B?(0,s.jsx)("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:e?.tags?.filter?.(r=>r?.startsWith?.("CLtag"))?.map?.(r=>r?.replace?.("CLtag:",""))?.slice?.(0,2)?.map?.((r,a)=>(0,s.jsx)(U.default,{children:r},a))}):null,m?(0,s.jsx)(z.Heading,{as:"h3",title:m||"",size:2,className:"shelf-display-product-title lg-desktop:h-[58px] mb-1 line-clamp-2 flex h-[48px] items-end justify-start",html:m||""}):null,S?(0,s.jsx)(F.Text,{size:2,className:"shelf-display-product-description lg-desktop:text-[18px] lg-desktop:h-[26px] desktop:text-[16px] desktop:h-[24px] line-clamp-1 h-[20px] text-[14px]",html:S||""}):null,(0,s.jsx)("div",{className:"mb-2 mt-[20px] flex items-center",children:D?(0,s.jsx)("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:d?.soldOutText}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"final-price tablet:text-2xl text-info-primary text-xl font-bold",children:y||""}),(0,s.jsx)("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:N||""})]})}),(0,s.jsxs)("div",{className:(0,b.cn)("lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?(0,s.jsx)(C.default,{variant:"secondary",onClick:()=>h(e,t?.index,t),className:`
1
+ "use strict";"use client";var re=Object.create;var D=Object.defineProperty;var se=Object.getOwnPropertyDescriptor;var ae=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,le=Object.prototype.hasOwnProperty;var pe=(e,t)=>{for(var i in t)D(e,i,{get:t[i],enumerable:!0})},L=(e,t,i,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of ae(t))!le.call(e,l)&&l!==i&&D(e,l,{get:()=>t[l],enumerable:!(d=se(t,l))||d.enumerable});return e};var f=(e,t,i)=>(i=e!=null?re(oe(e)):{},L(t||!e||!e.__esModule?D(i,"default",{value:e,enumerable:!0}):i,e)),ce=e=>L(D({},"__esModule",{value:!0}),e);var ye={};pe(ye,{default:()=>he});module.exports=ce(ye);var n=require("react/jsx-runtime"),s=f(require("react")),w=require("../../helpers/utils.js"),q=f(require("../../components/picture.js")),A=f(require("./tabSwitch.js")),H=f(require("../../components/button.js")),F=f(require("../Title/index.js")),j=f(require("../SwiperBox/index.js")),U=require("../../shared/Styles.js"),z=require("./shelfDisplay.js"),O=require("react-responsive"),W=require("../../hooks/useExposure.js"),P=require("../../shared/track.js"),Q=require("../AiuiProvider/index.js"),G=f(require("../../components/badge.js")),J=require("../../components/heading.js"),K=require("../../components/text.js"),X=require("../../shared/trackUrlRef.js");const M="image",V="product_shelf",me=999999999e-2;function de(e){const t=(0,s.useRef)(null),[i,d]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{if(i)return;const l=t.current;if(!l||typeof IntersectionObserver>"u")return;const p=new IntersectionObserver(([v])=>{v.isIntersecting&&(d(!0),p.disconnect())},e);return p.observe(l),()=>p.disconnect()},[i,e]),[t,i]}const ue=({data:e,configuration:t})=>{const{locale:i="us",copyWriting:d}=(0,Q.useAiuiContext)(),l=(0,O.useMediaQuery)({query:"(max-width: 768px)"}),p=(r,a,y)=>t?.event?.primaryButton?.(r,a+1,y),v=(r,a,y)=>t?.event?.secondaryButton?.(r,a+1,y),c=e?.variants?.find(r=>r?.sku===e?.sku)||e?.variants?.[0]||{},b=!c?.availableForSale&&c?.price?.amount===me,x=t?.isShowTag,S=t?.isShowOriginalPrice,h=c?.coupons?.[0],{price:N,basePrice:C}=(0,z.formatVariantPrice)({locale:i,amount:S&&h?h.variant_price4wscode:c.price,baseAmount:S&&h?c.price:0,currencyCode:e?.price?.currencyCode||"USD"}),k=()=>{const r=e?.sku,a=e?.variants;return a?.find(_=>_?.sku===r)?.image?.url||a?.[0]?.image?.url||""},u=e?.custom_name||e?.title,g=e?.custom_description||e?.description;return(0,n.jsx)("div",{className:(0,w.cn)("bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full cursor-pointer overflow-hidden duration-300",t?.itemShape==="round"?"rounded-2xl":"rounded-none","lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]","laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative",{"h-[360px]":l}),children:(0,n.jsxs)("div",{className:"absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4",children:[(0,n.jsx)("div",{className:(0,w.cn)("lg-desktop:mb-3 lg-desktop:h-[195px] relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden"),children:(0,n.jsx)("a",{"aria-label":u,target:t?.target,href:(0,X.trackUrlRef)(`${i==="us"||!i?"":`/${i}`}/products/${e?.handle}`,`${M}_${V}`),onClick:()=>{(0,P.gaTrack)({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||c?.sku,item_name:e?.name,item_variant:c?.name,price:c?.price,index:t?.index+1}]}})},children:(0,n.jsx)(q.default,{source:k(),alt:"",className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),x?(0,n.jsx)("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:e?.tags?.filter?.(r=>r?.startsWith?.("CLtag"))?.map?.(r=>r?.replace?.("CLtag:",""))?.slice?.(0,2)?.map?.((r,a)=>(0,n.jsx)(G.default,{children:r},a))}):null,u?(0,n.jsx)(J.Heading,{as:"h3",title:u||"",size:2,className:"shelf-display-product-title lg-desktop:h-[58px] mb-1 line-clamp-2 flex h-[48px] items-end justify-start",html:u||""}):null,g?(0,n.jsx)(K.Text,{size:2,className:"shelf-display-product-description lg-desktop:text-[18px] lg-desktop:h-[26px] desktop:text-[16px] desktop:h-[24px] line-clamp-1 h-[20px] text-[14px]",html:g||""}):null,(0,n.jsx)("div",{className:"mb-2 mt-[20px] flex items-center",children:b?(0,n.jsx)("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:d?.soldOutText}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"final-price tablet:text-2xl text-info-primary text-xl font-bold",children:c?.availableForSale&&N||""}),(0,n.jsx)("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:c?.availableForSale&&C||""})]})}),(0,n.jsxs)("div",{className:(0,w.cn)("lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?(0,n.jsx)(H.default,{variant:"secondary",onClick:()=>v(e,t?.index,t),className:`
2
2
  ${t.direction==="vertical"?"w-full":""}
3
- `,children:t?.secondaryButton||""}):null,t?.primaryButton?(0,s.jsx)(C.default,{variant:"primary",onClick:()=>T(e,t?.index,t),className:`
3
+ `,children:t?.secondaryButton||""}):null,t?.primaryButton?(0,n.jsx)(H.default,{variant:"primary",onClick:()=>p(e,t?.index,t),className:`
4
4
  ${t.direction==="vertical"?"w-full":""}
5
- `,children:t?.primaryButton||""}):null]})]})},e?.id||e?.handle)},re=o.default.forwardRef(({data:e,buildData:t,className:i="",key:d,event:n},T)=>{const[h,l]=(0,o.useState)(""),[D,B]=(0,o.useState)([]),g=(0,I.useMediaQuery)({query:"(max-width: 768px)"}),p=(0,o.useRef)(null);(0,o.useImperativeHandle)(T,()=>p.current),(0,V.useExposure)(p,{componentType:_,componentName:P,componentTitle:e?.title,navigation:h});const{productsTab:y=[],productsCard:N=[],title:w,isShowTab:m=!0,tabShape:S="square",isShowTag:r=!1,isShowOriginalPrice:a=!0,...u}=e,v=x=>{const Q=x?.map(f=>{const M=t?.products?.find(G=>G?.handle===f?.handle);if(M)return{sku:f.sku,custom_name:f.custom_name,custom_description:f.custom_description,...M}})?.filter(f=>f);B(Q)};return(0,o.useEffect)(()=>{if(m){l(y?.[0]?.tab||""),v(y?.[0]?.data||[]);return}v(N)},[]),(0,s.jsxs)("div",{ref:p,className:(0,b.cn)("w-full",i,{"aiui-dark":e?.theme==="dark"}),children:[w&&(0,s.jsx)(O.default,{data:{title:w}}),m&&(0,s.jsx)("div",{className:`${g?"w-full overflow-hidden":""}`,children:(0,s.jsx)(L.default,{value:h,tabs:y,tabShape:S,onTabClick:x=>{l(x?.tab),v(x?.data||[]),(0,A.gaTrack)({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:"Home Page",component_type:_,component_name:P,component_title:e?.title,component_position:1,navigation:x?.tab}})}})}),(0,s.jsx)("div",{className:"tablet:min-h-[393px] laptop:min-h-[425px] desktop:min-h-[405px] lg-desktop:min-h-[409px]",children:(0,s.jsx)(q.default,{className:"mt-6 !overflow-visible",id:`ShelfDisplay${d}${h}`,data:{list:D,configuration:{...u,event:n,isShowTag:r,isShowOriginalPrice:a}},Slide:ie,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}})})]})});var oe=(0,H.withStyles)(re);
5
+ `,children:t?.primaryButton||""}):null]})]})},e?.id||e?.handle)},fe=s.default.forwardRef(({data:e,buildData:t,className:i="",key:d,event:l,recommendedData:p,target:v="_self"},c)=>{const[b,x]=(0,s.useState)(""),[S,h]=(0,s.useState)([]),N=(0,O.useMediaQuery)({query:"(max-width: 768px)"}),[C,k]=de({threshold:0}),u=(0,s.useRef)(!1),g=(0,s.useRef)(!1),r=(0,s.useRef)(null);(0,s.useImperativeHandle)(c,()=>r.current),(0,W.useExposure)(r,{componentType:M,componentName:V,componentTitle:e?.title,navigation:b});const{productsTab:a=[],productsCard:y=[],title:_,isShowTab:I=!0,tabShape:Y="square",isShowTag:Z=!1,isShowOriginalPrice:ee=!0,isShowRecommendedCard:te=!1,...ne}=e,$=()=>{(0,P.gaTrack)({event:"ga4Event",event_name:"view_item_list",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:p?.map((o,E)=>{const m=o?.variants?.find(B=>B?.sku===o?.sku)||o?.variants?.[0];return{item_id:o?.sku||m?.sku,item_name:o?.name,item_variant:m?.name,price:m?.price,index:E+1}})}})},R=(o,E)=>{if(E){const T=p?.map(m=>({...m,isShowRecommended:!0}));h(T||[])}else{const T=o?.map(m=>{const B=t?.products?.find(ie=>ie?.handle===m?.handle);if(B)return{sku:m.sku,isShowRecommended:!1,custom_name:m.custom_name,custom_description:m.custom_description,...B}})?.filter(m=>m);h(T||[])}};return(0,s.useEffect)(()=>{k&&p?.length&&!g.current&&(g.current=!0,$())},[k,p]),(0,s.useEffect)(()=>{if(!u.current){if(!u.current&&p?.length&&(u.current=!0),I){x(a?.[0]?.tab||""),R(a?.[0]?.data||[],a?.[0]?.isShowRecommendedTab);return}R(y,te)}},[p]),(0,n.jsxs)("div",{ref:r,className:(0,w.cn)("shelf-display-wrap w-full",i,{"aiui-dark":e?.theme==="dark"}),children:[_&&(0,n.jsx)(F.default,{data:{title:_}}),I&&(0,n.jsx)("div",{className:`${N?"w-full overflow-hidden":""}`,children:(0,n.jsx)(A.default,{value:b,tabs:a,tabShape:Y,onTabClick:o=>{if(x(o?.tab),R(o?.data||[],o?.isShowRecommendedTab),!o?.isShowRecommendedTab){(0,P.gaTrack)({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:"Home Page",component_type:M,component_name:V,component_title:e?.title,component_position:1,navigation:o?.tab}});return}$()}})}),(0,n.jsx)("div",{ref:C,className:"tablet:min-h-[393px] laptop:min-h-[425px] desktop:min-h-[405px] lg-desktop:min-h-[409px]",children:(0,n.jsx)(j.default,{className:`${I?"mt-6":""} !overflow-visible`,id:`ShelfDisplay${d}${b}`,data:{list:S,configuration:{...ne,event:l,isShowTag:Z,isShowOriginalPrice:ee,target:v}},Slide:ue,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}})})]})});var he=(0,U.withLayout)(fe);
6
6
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/ShelfDisplay/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useState, useEffect, useRef, useImperativeHandle } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport TabSwitch from './tabSwitch.js'\nimport Button from '../../components/button.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport { formatVariantPrice } from './shelfDisplay.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { gaTrack } from '../../shared/track.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport Badge from '../../components/badge.js'\nimport { Heading } from '../../components/heading.js'\nimport { Text } from '../../components/text.js'\nimport type { ContainerProps } from '../../types/props.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\n\nconst componentType = 'image'\nconst componentName = 'product_shelf'\n\nconst SOLD_OUT_PRICE = 9999999.99\n\nexport interface ShelfDisplayItem {\n id?: string\n /** \u4EA7\u54C1\u56FE\u7247*/\n img?: {\n url: string\n }\n handle?: string\n sku?: string\n /** \u6298\u6263\u540E\u4EF7\u683C*/\n price?: string\n title?: string\n /** \u6298\u6263\u524D\u4EF7\u683C*/\n basePrice?: string\n subTitle?: string\n /** \u6807\u7B7E*/\n tagItems?: string[]\n tab?: string\n data?: ShelfDisplayItem[]\n custom_name?: string\n custom_description?: string\n}\n\ntype EventType = {\n primaryButton?: (v: any, index: number, data: ShelfDisplayType) => void\n secondaryButton?: (v: any, index: number, data: ShelfDisplayType) => void\n}\n\ntype ShelfDisplayType = {\n title?: string\n isShowTab?: boolean\n isShowTag?: boolean\n isShowOriginalPrice?: boolean\n direction?: 'horizontal' | 'vertical'\n align?: 'left' | 'center' | 'right'\n productsTab?: any\n productsCard?: any\n /** \u5361\u7247\u5F62\u72B6 */\n itemShape?: 'round' | 'square'\n /** \u6309\u94AE\u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u6807\u7B7E\u9875\u5F62\u72B6*/\n tabShape?: 'rounded' | 'square'\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: string\n primaryFun?: 'AddCart' | 'BuyNow' | 'LearnMore'\n /** \u526F\u6309\u94AE\u914D\u7F6E */\n secondaryButton?: string\n secondaryFun?: 'AddCart' | 'BuyNow' | 'LearnMore'\n theme?: 'light' | 'dark'\n containerProps?: ContainerProps\n}\n\nexport interface ShelfDisplayProps {\n data: ShelfDisplayType\n buildData?: {\n categories: any[]\n products: any[]\n }\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: EventType\n className?: string\n key?: string\n}\n\nconst ShelfDisplayItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.primaryButton?.(params, index + 1, data)\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.secondaryButton?.(params, index + 1, data)\n\n const variant = data?.variants?.find((item: any) => item?.sku === data?.sku) || data?.variants?.[0] || {}\n\n const isSoldOut = !variant?.availableForSale && variant?.price?.amount === SOLD_OUT_PRICE\n const isShowTag = configuration?.isShowTag\n const isShowOriginalPrice = configuration?.isShowOriginalPrice\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n\n const { price, basePrice } = formatVariantPrice({\n locale: locale,\n amount: isShowOriginalPrice && coupon ? coupon.variant_price4wscode : variant.price,\n baseAmount: isShowOriginalPrice && coupon ? variant.price : 0,\n currencyCode: data?.price?.currencyCode || 'USD',\n })\n\n const handleUrl = () => {\n const sku = data?.sku\n const skuArray = data?.variants\n const findSku = skuArray?.find((item: any) => item?.sku === sku)\n return findSku?.image?.url || skuArray?.[0]?.image?.url || ''\n }\n\n const displayTitle = data?.custom_name || data?.title\n const displayDescription = data?.custom_description || data?.description\n\n return (\n <div\n key={data?.id || data?.handle}\n className={cn(\n 'bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full cursor-pointer overflow-hidden duration-300',\n configuration?.shape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative',\n {\n 'h-[360px]': isMobile,\n }\n )}\n >\n <div className=\"absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4\">\n <div\n className={cn(\n 'lg-desktop:mb-3 lg-desktop:h-[195px] relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden'\n )}\n >\n <a\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}`,\n `${componentType}_${componentName}`\n )}\n >\n <Picture source={handleUrl()} alt=\"\" className=\"flex h-full justify-center object-cover [&_img]:w-auto\" />\n </a>\n </div>\n {isShowTag ? (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {data?.tags\n ?.filter?.((item: any) => item?.startsWith?.('CLtag'))\n ?.map?.((item: any) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, 2)\n ?.map?.((item: any, index: number) => <Badge key={index}>{item}</Badge>)}\n </div>\n ) : null}\n {displayTitle ? (\n <Heading\n as=\"h3\"\n title={displayTitle || ''}\n size={2}\n className=\"shelf-display-product-title lg-desktop:h-[58px] mb-1 line-clamp-2 flex h-[48px] items-end justify-start\"\n html={displayTitle || ''}\n />\n ) : null}\n {displayDescription ? (\n <Text\n size={2}\n className=\"shelf-display-product-description lg-desktop:text-[18px] lg-desktop:h-[26px] desktop:text-[16px] desktop:h-[24px] line-clamp-1 h-[20px] text-[14px]\"\n html={displayDescription || ''}\n />\n ) : null}\n <div className=\"mb-2 mt-[20px] flex items-center\">\n {isSoldOut ? (\n <div className=\"tablet:text-2xl text-info-primary text-xl font-bold\">{copyWriting?.soldOutText}</div>\n ) : (\n <>\n <div className=\"final-price tablet:text-2xl text-info-primary text-xl font-bold\">{price || ''}</div>\n <div className=\"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through\">\n {basePrice || ''}\n </div>\n </>\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn(\n 'lg-desktop:gap-3 flex items-center gap-2',\n configuration.direction === 'vertical' ? 'flex-col' : ''\n )}\n >\n {configuration?.secondaryButton ? (\n <Button\n variant=\"secondary\"\n onClick={() => onSecondaryButton(data, configuration?.index, configuration)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n variant=\"primary\"\n onClick={() => onPrimaryButton(data, configuration?.index, configuration)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) : null}\n </div>\n </div>\n </div>\n )\n}\n\nconst ShelfDisplay = React.forwardRef<HTMLDivElement, ShelfDisplayProps>(\n ({ data, buildData, className = '', key, event }, ref) => {\n const [tabId, setTabId] = useState<string>('')\n const [currentItems, setCurrentItems] = useState<ShelfDisplayItem[]>([])\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType: componentType,\n componentName: componentName,\n componentTitle: data?.title,\n navigation: tabId,\n })\n\n const {\n productsTab = [],\n productsCard = [],\n title,\n isShowTab = true,\n tabShape = 'square',\n isShowTag = false,\n isShowOriginalPrice = true,\n ...other\n } = data\n\n const handleCurrentTab = (currentData: ShelfDisplayItem[]) => {\n const newCurrentData = currentData\n ?.map(item => {\n const findData = buildData?.products?.find(params => params?.handle === item?.handle)\n if (findData) {\n return {\n sku: item.sku,\n custom_name: item.custom_name,\n custom_description: item.custom_description,\n ...findData,\n }\n }\n })\n ?.filter(item => item)\n setCurrentItems(newCurrentData)\n }\n\n useEffect(() => {\n if (isShowTab) {\n setTabId(productsTab?.[0]?.tab || '')\n handleCurrentTab(productsTab?.[0]?.data || [])\n return\n }\n handleCurrentTab(productsCard)\n }, [])\n\n return (\n <div ref={innerRef} className={cn('w-full', className, { 'aiui-dark': data?.theme === 'dark' })}>\n {title && <Title data={{ title: title }} />}\n {isShowTab && (\n <div className={`${isMobile ? 'w-full overflow-hidden' : ''}`}>\n <TabSwitch\n value={tabId}\n tabs={productsTab}\n tabShape={tabShape}\n onTabClick={v => {\n setTabId(v?.tab)\n handleCurrentTab(v?.data || [])\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: 'Home Page',\n component_type: componentType,\n component_name: componentName,\n component_title: data?.title,\n component_position: 1,\n navigation: v?.tab,\n },\n })\n }}\n />\n </div>\n )}\n <div className=\"tablet:min-h-[393px] laptop:min-h-[425px] desktop:min-h-[405px] lg-desktop:min-h-[409px]\">\n <SwiperBox\n className=\"mt-6 !overflow-visible\"\n id={`ShelfDisplay${key}${tabId}`}\n data={{ list: currentItems, configuration: { ...other, event: event, isShowTag, isShowOriginalPrice } }}\n Slide={ShelfDisplayItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n </div>\n </div>\n )\n }\n)\n\nexport default withStyles(ShelfDisplay)\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Ae,CAAE,GAAGQ,EAAO,MAAOZ,EAAO,UAAAlB,EAAW,oBAAAC,CAAoB,CAAE,EACtG,MAAOd,GACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,EACF,GACF,CAEJ,CACF,EAEA,IAAOvB,MAAQ,cAAWiD,EAAY",
6
- "names": ["ShelfDisplay_exports", "__export", "ShelfDisplay_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_picture", "import_tabSwitch", "import_button", "import_Title", "import_SwiperBox", "import_Styles", "import_shelfDisplay", "import_react_responsive", "import_useExposure", "import_track", "import_AiuiProvider", "import_badge", "import_heading", "import_text", "import_trackUrlRef", "componentType", "componentName", "SOLD_OUT_PRICE", "ShelfDisplayItem", "data", "configuration", "locale", "copyWriting", "isMobile", "onPrimaryButton", "params", "index", "onSecondaryButton", "variant", "item", "isSoldOut", "isShowTag", "isShowOriginalPrice", "coupon", "price", "basePrice", "handleUrl", "sku", "skuArray", "displayTitle", "displayDescription", "Picture", "Badge", "Button", "ShelfDisplay", "React", "buildData", "className", "key", "event", "ref", "tabId", "setTabId", "currentItems", "setCurrentItems", "innerRef", "productsTab", "productsCard", "title", "isShowTab", "tabShape", "other", "handleCurrentTab", "currentData", "newCurrentData", "findData", "Title", "TabSwitch", "v", "SwiperBox"]
4
+ "sourcesContent": ["'use client'\nimport React, { useState, useEffect, useRef, useImperativeHandle } from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport Picture from '../../components/picture.js'\nimport TabSwitch from './tabSwitch.js'\nimport Button from '../../components/button.js'\nimport Title from '../Title/index.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { formatVariantPrice } from './shelfDisplay.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { gaTrack } from '../../shared/track.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport Badge from '../../components/badge.js'\nimport { Heading } from '../../components/heading.js'\nimport { Text } from '../../components/text.js'\nimport type { ContainerProps } from '../../types/props.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\n\nconst componentType = 'image'\nconst componentName = 'product_shelf'\n\nconst SOLD_OUT_PRICE = 9999999.99\n\nexport interface ShelfDisplayItem {\n id?: string\n /** \u4EA7\u54C1\u56FE\u7247*/\n img?: {\n url: string\n }\n handle?: string\n sku?: string\n /** \u6298\u6263\u540E\u4EF7\u683C*/\n price?: string\n title?: string\n /** \u6298\u6263\u524D\u4EF7\u683C*/\n basePrice?: string\n subTitle?: string\n /** \u6807\u7B7E*/\n tagItems?: string[]\n tab?: string\n data?: ShelfDisplayItem[]\n custom_name?: string\n custom_description?: string\n}\n\ntype EventType = {\n primaryButton?: (v: any, index: number, data: ShelfDisplayType) => void\n secondaryButton?: (v: any, index: number, data: ShelfDisplayType) => void\n}\n\ntype ShelfDisplayType = {\n title?: string\n isShowTab?: boolean\n isShowTag?: boolean\n isShowRecommendedCard?: boolean\n isShowOriginalPrice?: boolean\n direction?: 'horizontal' | 'vertical'\n align?: 'left' | 'center' | 'right'\n productsTab?: any[]\n productsCard?: any[]\n /** \u5361\u7247\u5F62\u72B6 */\n itemShape?: 'round' | 'square'\n /** \u6309\u94AE\u5F62\u72B6 */\n shape?: 'round' | 'square'\n /** \u6807\u7B7E\u9875\u5F62\u72B6*/\n tabShape?: 'rounded' | 'square'\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: string\n primaryFun?: 'AddCart' | 'BuyNow' | 'LearnMore'\n /** \u526F\u6309\u94AE\u914D\u7F6E */\n secondaryButton?: string\n secondaryFun?: 'AddCart' | 'BuyNow' | 'LearnMore'\n theme?: 'light' | 'dark'\n containerProps?: ContainerProps\n}\n\nexport interface ShelfDisplayProps {\n data: ShelfDisplayType\n buildData?: {\n categories: any[]\n products: any[]\n }\n recommendedData?: any[]\n /** \u6309\u94AE\u4E8B\u4EF6*/\n event?: EventType\n className?: string\n key?: string\n target?: '_self' | '_blank'\n}\n\nfunction useOnceInView<T extends Element>(options: any) {\n const ref = useRef<T>(null)\n const [inView, setInView] = useState(false)\n\n useEffect(() => {\n if (inView) return // \u5DF2\u8FDB\u5165\u8FC7\uFF0C\u5219\u4E0D\u518D\u89C2\u5BDF\n const el = ref.current\n if (!el || typeof IntersectionObserver === 'undefined') return\n\n const observer = new IntersectionObserver(([entry]) => {\n if (entry.isIntersecting) {\n setInView(true)\n observer.disconnect() // \u505C\u6B62\u89C2\u5BDF\n }\n }, options)\n\n observer.observe(el)\n return () => observer.disconnect()\n }, [inView, options])\n\n return [ref, inView]\n}\n\nconst ShelfDisplayItem = ({ data, configuration }: { data: any; configuration?: any }) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n\n const onPrimaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.primaryButton?.(params, index + 1, data)\n\n const onSecondaryButton = (params: ShelfDisplayItem, index: number, data: ShelfDisplayType) =>\n configuration?.event?.secondaryButton?.(params, index + 1, data)\n\n const variant = data?.variants?.find((item: any) => item?.sku === data?.sku) || data?.variants?.[0] || {}\n\n const isSoldOut = !variant?.availableForSale && variant?.price?.amount === SOLD_OUT_PRICE\n const isShowTag = configuration?.isShowTag\n const isShowOriginalPrice = configuration?.isShowOriginalPrice\n\n // active \u7684 \u901A\u7528\u6298\u6263\n const coupon = variant?.coupons?.[0]\n\n const { price, basePrice } = formatVariantPrice({\n locale: locale,\n amount: isShowOriginalPrice && coupon ? coupon.variant_price4wscode : variant.price,\n baseAmount: isShowOriginalPrice && coupon ? variant.price : 0,\n currencyCode: data?.price?.currencyCode || 'USD',\n })\n\n const handleUrl = () => {\n const sku = data?.sku\n const skuArray = data?.variants\n const findSku = skuArray?.find((item: any) => item?.sku === sku)\n return findSku?.image?.url || skuArray?.[0]?.image?.url || ''\n }\n\n const displayTitle = data?.custom_name || data?.title\n const displayDescription = data?.custom_description || data?.description\n\n return (\n <div\n key={data?.id || data?.handle}\n className={cn(\n 'bg-container-secondary-1 tablet:hover:bg-info-white box-border w-full cursor-pointer overflow-hidden duration-300',\n configuration?.itemShape === 'round' ? 'rounded-2xl' : 'rounded-none',\n 'lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]',\n 'laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative',\n {\n 'h-[360px]': isMobile,\n }\n )}\n >\n <div className=\"absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4\">\n <div\n className={cn(\n 'lg-desktop:mb-3 lg-desktop:h-[195px] relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden'\n )}\n >\n <a\n aria-label={displayTitle}\n target={configuration?.target}\n href={trackUrlRef(\n `${locale === 'us' || !locale ? '' : `/${locale}`}/products/${data?.handle}`,\n `${componentType}_${componentName}`\n )}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'select_item',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: [\n {\n item_id: data?.sku || variant?.sku,\n item_name: data?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: configuration?.index + 1,\n },\n ],\n },\n })\n }}\n >\n <Picture source={handleUrl()} alt=\"\" className=\"flex h-full justify-center object-cover [&_img]:w-auto\" />\n </a>\n </div>\n {isShowTag ? (\n <div className=\"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden\">\n {data?.tags\n ?.filter?.((item: any) => item?.startsWith?.('CLtag'))\n ?.map?.((item: any) => item?.replace?.('CLtag:', ''))\n ?.slice?.(0, 2)\n ?.map?.((item: any, index: number) => <Badge key={index}>{item}</Badge>)}\n </div>\n ) : null}\n {displayTitle ? (\n <Heading\n as=\"h3\"\n title={displayTitle || ''}\n size={2}\n className=\"shelf-display-product-title lg-desktop:h-[58px] mb-1 line-clamp-2 flex h-[48px] items-end justify-start\"\n html={displayTitle || ''}\n />\n ) : null}\n {displayDescription ? (\n <Text\n size={2}\n className=\"shelf-display-product-description lg-desktop:text-[18px] lg-desktop:h-[26px] desktop:text-[16px] desktop:h-[24px] line-clamp-1 h-[20px] text-[14px]\"\n html={displayDescription || ''}\n />\n ) : null}\n <div className=\"mb-2 mt-[20px] flex items-center\">\n {isSoldOut ? (\n <div className=\"tablet:text-2xl text-info-primary text-xl font-bold\">{copyWriting?.soldOutText}</div>\n ) : (\n <>\n <div className=\"final-price tablet:text-2xl text-info-primary text-xl font-bold\">\n {variant?.availableForSale ? price || '' : ''}\n </div>\n <div className=\"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through\">\n {variant?.availableForSale ? basePrice || '' : ''}\n </div>\n </>\n )}\n </div>\n {/* \u6309\u94AE\u7EC4 */}\n <div\n className={cn(\n 'lg-desktop:gap-3 flex items-center gap-2',\n configuration.direction === 'vertical' ? 'flex-col' : ''\n )}\n >\n {configuration?.secondaryButton ? (\n <Button\n variant=\"secondary\"\n onClick={() => onSecondaryButton(data, configuration?.index, configuration)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.secondaryButton || ''}\n </Button>\n ) : null}\n {configuration?.primaryButton ? (\n <Button\n variant=\"primary\"\n onClick={() => onPrimaryButton(data, configuration?.index, configuration)}\n className={`\n ${configuration.direction === 'vertical' ? 'w-full' : ''}\n `}\n >\n {configuration?.primaryButton || ''}\n </Button>\n ) : null}\n </div>\n </div>\n </div>\n )\n}\n\nconst ShelfDisplay = React.forwardRef<HTMLDivElement, ShelfDisplayProps>(\n ({ data, buildData, className = '', key, event, recommendedData, target = '_self' }, ref) => {\n const [tabId, setTabId] = useState<string>('')\n const [currentItems, setCurrentItems] = useState<ShelfDisplayItem[]>([])\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n\n const [viewRef, inView] = useOnceInView<HTMLDivElement>({ threshold: 0 })\n const isRecommend = useRef<boolean>(false)\n const isView = useRef<boolean>(false)\n const innerRef = useRef<HTMLDivElement>(null)\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType: componentType,\n componentName: componentName,\n componentTitle: data?.title,\n navigation: tabId,\n })\n\n const {\n productsTab = [],\n productsCard = [],\n title,\n isShowTab = true,\n tabShape = 'square',\n isShowTag = false,\n isShowOriginalPrice = true,\n isShowRecommendedCard = false,\n ...other\n } = data\n\n const gackViewEvent = () => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'view_item_list',\n event_parameters: {\n page_group: 'Home Page',\n item_list_name: 'Home_Page_Bundle',\n items: recommendedData?.map((item, index) => {\n const findData = item?.variants?.find((v: any) => v?.sku === item?.sku)\n const variant = findData || item?.variants?.[0]\n return {\n item_id: item?.sku || variant?.sku,\n item_name: item?.name,\n item_variant: variant?.name,\n price: variant?.price,\n index: index + 1,\n }\n }),\n },\n })\n }\n\n const handleCurrentTab = (currentData: ShelfDisplayItem[], flag: boolean) => {\n if (flag) {\n const newCurrentData = recommendedData?.map(item => {\n return {\n ...item,\n isShowRecommended: true,\n }\n })\n setCurrentItems(newCurrentData || [])\n } else {\n const newCurrentData = currentData\n ?.map(item => {\n const findData = buildData?.products?.find(params => params?.handle === item?.handle)\n if (findData) {\n return {\n sku: item.sku,\n isShowRecommended: false,\n custom_name: item.custom_name,\n custom_description: item.custom_description,\n ...findData,\n }\n }\n })\n ?.filter(item => item)\n setCurrentItems(newCurrentData || [])\n }\n }\n\n useEffect(() => {\n if (inView && recommendedData?.length && !isView.current) {\n isView.current = true\n gackViewEvent()\n }\n }, [inView, recommendedData])\n\n // \u7B97\u6CD5\u6570\u636E\u4F1A\u7A0D\u5FAE\u5EF6\u8FDF\uFF0C\u6240\u4EE5\u9700\u76D1\u542CrecommendedData\uFF0C\u4E3A\u4E86\u9632\u6B62\u5728\u6709\u7B97\u6CD5\u6570\u636E\u4E14\u5BF9\u9ED8\u8BA4\u6E32\u67D3\u7B2C\u4E00\u4E2A\u540E\u53CD\u590D\u89E6\u53D1\uFF0C\u7528isRecommend\u5173\u95ED\n useEffect(() => {\n if (isRecommend.current) return\n if (!isRecommend.current && recommendedData?.length) {\n isRecommend.current = true\n }\n if (isShowTab) {\n setTabId(productsTab?.[0]?.tab || '')\n handleCurrentTab(productsTab?.[0]?.data || [], productsTab?.[0]?.isShowRecommendedTab)\n return\n }\n handleCurrentTab(productsCard, isShowRecommendedCard)\n }, [recommendedData])\n\n return (\n <div\n ref={innerRef}\n className={cn('shelf-display-wrap w-full', className, { 'aiui-dark': data?.theme === 'dark' })}\n >\n {title && <Title data={{ title: title }} />}\n {isShowTab && (\n <div className={`${isMobile ? 'w-full overflow-hidden' : ''}`}>\n <TabSwitch\n value={tabId}\n tabs={productsTab}\n tabShape={tabShape}\n onTabClick={v => {\n setTabId(v?.tab)\n handleCurrentTab(v?.data || [], v?.isShowRecommendedTab)\n if (!v?.isShowRecommendedTab) {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: 'Home Page',\n component_type: componentType,\n component_name: componentName,\n component_title: data?.title,\n component_position: 1,\n navigation: v?.tab,\n },\n })\n return\n }\n gackViewEvent()\n }}\n />\n </div>\n )}\n <div\n ref={viewRef as any}\n className=\"tablet:min-h-[393px] laptop:min-h-[425px] desktop:min-h-[405px] lg-desktop:min-h-[409px]\"\n >\n <SwiperBox\n className={`${isShowTab ? 'mt-6' : ''} !overflow-visible`}\n id={`ShelfDisplay${key}${tabId}`}\n data={{\n list: currentItems,\n configuration: { ...other, event: event, isShowTag, isShowOriginalPrice, target: target },\n }}\n Slide={ShelfDisplayItem}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n </div>\n </div>\n )\n }\n)\n\nexport default withLayout(ShelfDisplay)\n"],
5
+ "mappings": "mlBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAqMY,IAAAI,EAAA,6BApMZC,EAAwE,oBACxEC,EAAmB,kCACnBC,EAAoB,0CACpBC,EAAsB,6BACtBC,EAAmB,yCACnBC,EAAkB,gCAClBC,EAAsB,oCACtBC,EAA2B,kCAC3BC,EAAmC,6BACnCC,EAA8B,4BAC9BC,EAA4B,sCAC5BC,EAAwB,iCACxBC,EAA+B,oCAC/BC,EAAkB,wCAClBC,EAAwB,uCACxBC,EAAqB,oCAErBC,EAA4B,uCAE5B,MAAMC,EAAgB,QAChBC,EAAgB,gBAEhBC,GAAiB,aAqEvB,SAASC,GAAiCC,EAAc,CACtD,MAAMC,KAAM,UAAU,IAAI,EACpB,CAACC,EAAQC,CAAS,KAAI,YAAS,EAAK,EAE1C,sBAAU,IAAM,CACd,GAAID,EAAQ,OACZ,MAAME,EAAKH,EAAI,QACf,GAAI,CAACG,GAAM,OAAO,qBAAyB,IAAa,OAExD,MAAMC,EAAW,IAAI,qBAAqB,CAAC,CAACC,CAAK,IAAM,CACjDA,EAAM,iBACRH,EAAU,EAAI,EACdE,EAAS,WAAW,EAExB,EAAGL,CAAO,EAEV,OAAAK,EAAS,QAAQD,CAAE,EACZ,IAAMC,EAAS,WAAW,CACnC,EAAG,CAACH,EAAQF,CAAO,CAAC,EAEb,CAACC,EAAKC,CAAM,CACrB,CAEA,MAAMK,GAAmB,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jB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,EACF,GACF,CAEJ,CACF,EAEA,IAAO/B,MAAQ,cAAWyD,EAAY",
6
+ "names": ["ShelfDisplay_exports", "__export", "ShelfDisplay_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_picture", "import_tabSwitch", "import_button", "import_Title", "import_SwiperBox", "import_Styles", "import_shelfDisplay", "import_react_responsive", "import_useExposure", "import_track", "import_AiuiProvider", "import_badge", "import_heading", "import_text", "import_trackUrlRef", "componentType", "componentName", "SOLD_OUT_PRICE", "useOnceInView", "options", "ref", "inView", "setInView", "el", "observer", "entry", "ShelfDisplayItem", "data", "configuration", "locale", "copyWriting", "isMobile", "onPrimaryButton", "params", "index", "onSecondaryButton", "variant", "item", "isSoldOut", "isShowTag", "isShowOriginalPrice", "coupon", "price", "basePrice", "handleUrl", "sku", "skuArray", "displayTitle", "displayDescription", "Picture", "Badge", "Button", "ShelfDisplay", "React", "buildData", "className", "key", "event", "recommendedData", "target", "tabId", "setTabId", "currentItems", "setCurrentItems", "viewRef", "isRecommend", "isView", "innerRef", "productsTab", "productsCard", "title", "isShowTab", "tabShape", "isShowRecommendedCard", "other", "gackViewEvent", "v", "handleCurrentTab", "currentData", "flag", "newCurrentData", "findData", "Title", "TabSwitch", "SwiperBox"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var o=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var D=(r,e)=>{for(var t in e)o(r,t,{get:e[t],enumerable:!0})},F=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of $(e))!y.call(r,i)&&i!==t&&o(r,i,{get:()=>e[i],enumerable:!(n=p(e,i))||n.enumerable});return r};var v=r=>F(o({},"__esModule",{value:!0}),r);var P={};D(P,{PRICE_SYMBOL:()=>c,formatPrice:()=>f,formatVariantPrice:()=>x,languageTerritory:()=>m});module.exports=v(P);const c={us:"$",uk:"\xA3",ca:"$",eu:"\u20AC",fr:"\u20AC",de:"\u20AC",vn:"\u20AB",cl:"$",sg:"$",ae:"AED"},m=r=>({us:"en-us",uk:"en-gb",ca:"en-ca",au:"en-au",eu:"en",fr:"fr-fr",de:"de-de",vn:"vi-vn",sg:"en-sg","ae-en":"ae-en",plus:"en-us",cl:"es-cl"})[r]||"";function f({amount:r,currencyCode:e,locale:t,maximumFractionDigits:n,minimumFractionDigits:i,removeTrailingZeros:s=!1}){let u=new Intl.NumberFormat(m(t),{style:"currency",currency:e||"USD",minimumFractionDigits:n===0?0:i,maximumFractionDigits:n}).format(r);return["eu-de","eu-en","de","eu"].includes(t)&&(u=u?.toString()?.replace(/[\s]/g,"")),s&&(u=u.replace(/(\.\d*?[1-9])0+\b/,"$1").replace(/\.0+\b/,"").replace(/(\,\d*?[1-9])0+\b/,"$1").replace(/\,0+\b/,"")),u}function x({amount:r,baseAmount:e,currencyCode:t,locale:n,maximumFractionDigits:i,minimumFractionDigits:s,removeTrailingZeros:a}){if(typeof Intl>"u")return{price:`${c[n]}${r}`,basePrice:`${c[n]}${e}`,discount:`${c[n]}${e-r||0}`};const u=e>r,g=new Intl.NumberFormat(m(n),{style:"percent"}),d=u?g.format((e-r)/e):null,l=f({amount:r,currencyCode:t,locale:n,removeTrailingZeros:a}),b=u?f({amount:e,currencyCode:t,locale:n,maximumFractionDigits:i,minimumFractionDigits:s,removeTrailingZeros:a}):void 0;return{price:l,basePrice:b,discount:d}}
1
+ "use strict";var o=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var D=(r,e)=>{for(var t in e)o(r,t,{get:e[t],enumerable:!0})},F=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of $(e))!y.call(r,i)&&i!==t&&o(r,i,{get:()=>e[i],enumerable:!(n=p(e,i))||n.enumerable});return r};var v=r=>F(o({},"__esModule",{value:!0}),r);var P={};D(P,{PRICE_SYMBOL:()=>c,formatPrice:()=>f,formatVariantPrice:()=>x,languageTerritory:()=>m});module.exports=v(P);const c={us:"$",uk:"\xA3",ca:"$",eu:"\u20AC",fr:"\u20AC",de:"\u20AC",vn:"\u20AB",cl:"$",sg:"$",ae:"AED"},m=r=>({us:"en-us",uk:"en-gb",ca:"en-ca",au:"en-au",eu:"en",fr:"fr-fr",de:"de-de",vn:"vi-vn",sg:"en-sg","ae-en":"ae-en",plus:"en-us",cl:"es-cl","eu-de":"de-de"})[r]||"";function f({amount:r,currencyCode:e,locale:t,maximumFractionDigits:n,minimumFractionDigits:i,removeTrailingZeros:s=!1}){let u=new Intl.NumberFormat(m(t),{style:"currency",currency:e||"USD",minimumFractionDigits:n===0?0:i,maximumFractionDigits:n}).format(r);return["eu-de","eu-en","de","eu"].includes(t)&&(u=u?.toString()?.replace(/[\s]/g,"")),s&&(u=u.replace(/(\.\d*?[1-9])0+\b/,"$1").replace(/\.0+\b/,"").replace(/(\,\d*?[1-9])0+\b/,"$1").replace(/\,0+\b/,"")),u}function x({amount:r,baseAmount:e,currencyCode:t,locale:n,maximumFractionDigits:i,minimumFractionDigits:s,removeTrailingZeros:a}){if(typeof Intl>"u")return{price:`${c[n]}${r}`,basePrice:`${c[n]}${e}`,discount:`${c[n]}${e-r||0}`};const u=e>r,d=new Intl.NumberFormat(m(n),{style:"percent"}),g=u?d.format((e-r)/e):null,l=f({amount:r,currencyCode:t,locale:n,removeTrailingZeros:a}),b=u?f({amount:e,currencyCode:t,locale:n,maximumFractionDigits:i,minimumFractionDigits:s,removeTrailingZeros:a}):void 0;return{price:l,basePrice:b,discount:g}}
2
2
  //# sourceMappingURL=shelfDisplay.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/ShelfDisplay/shelfDisplay.ts"],
4
- "sourcesContent": ["/* eslint-disable no-useless-escape */\nexport const PRICE_SYMBOL = {\n us: '$',\n uk: '\u00A3',\n ca: '$',\n eu: '\u20AC',\n fr: '\u20AC',\n de: '\u20AC',\n vn: '\u20AB',\n cl: '$',\n sg: '$',\n ae: 'AED',\n} as any\n\nexport const languageTerritory = (locale: string) =>\n // https://unicode-org.github.io/cldr-staging/charts/37/supplemental/language_territory_information.html\n ({\n us: 'en-us',\n uk: 'en-gb',\n ca: 'en-ca',\n au: 'en-au',\n eu: 'en',\n fr: 'fr-fr',\n de: 'de-de',\n vn: 'vi-vn',\n sg: 'en-sg',\n 'ae-en': 'ae-en',\n plus: 'en-us',\n cl: 'es-cl',\n })[locale] || ''\n\nexport function formatPrice({\n amount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros = false,\n}: {\n amount: number\n currencyCode: string\n locale: string\n maximumFractionDigits?: number\n minimumFractionDigits?: number\n removeTrailingZeros?: boolean\n}) {\n const formatCurrency = new Intl.NumberFormat(languageTerritory(locale), {\n style: 'currency',\n currency: currencyCode || 'USD',\n minimumFractionDigits: maximumFractionDigits === 0 ? 0 : minimumFractionDigits,\n maximumFractionDigits,\n })\n\n let formattedValue = formatCurrency.format(amount)\n\n if (['eu-de', 'eu-en', 'de', 'eu'].includes(locale)) {\n formattedValue = formattedValue?.toString()?.replace(/[\\s]/g, '')\n }\n\n if (removeTrailingZeros) {\n // Adjust the regex to match comma as decimal separator\n formattedValue = formattedValue\n .replace(/(\\.\\d*?[1-9])0+\\b/, '$1')\n .replace(/\\.0+\\b/, '')\n .replace(/(\\,\\d*?[1-9])0+\\b/, '$1')\n .replace(/\\,0+\\b/, '')\n }\n\n return formattedValue\n}\n\nexport function formatVariantPrice({\n amount,\n baseAmount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n}: {\n baseAmount: number\n amount: number\n currencyCode: string\n locale: string\n maximumFractionDigits?: number\n minimumFractionDigits?: number\n removeTrailingZeros?: boolean\n}) {\n if (typeof Intl === 'undefined') {\n return {\n price: `${PRICE_SYMBOL[locale]}${amount}`,\n basePrice: `${PRICE_SYMBOL[locale]}${baseAmount}`,\n discount: `${PRICE_SYMBOL[locale]}${baseAmount - amount || 0}`,\n }\n }\n\n const hasDiscount = baseAmount > amount\n const formatDiscount = new Intl.NumberFormat(languageTerritory(locale), {\n style: 'percent',\n })\n const discount = hasDiscount ? formatDiscount.format((baseAmount - amount) / baseAmount) : null\n\n const price = formatPrice({ amount, currencyCode, locale, removeTrailingZeros })\n const basePrice = hasDiscount\n ? formatPrice({\n amount: baseAmount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n })\n : undefined\n\n return { price, basePrice, discount }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,EAAA,gBAAAC,EAAA,uBAAAC,EAAA,sBAAAC,IAAA,eAAAC,EAAAN,GACO,MAAME,EAAe,CAC1B,GAAI,IACJ,GAAI,OACJ,GAAI,IACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,IACJ,GAAI,IACJ,GAAI,KACN,EAEaG,EAAqBE,IAE/B,CACC,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,KACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,QAAS,QACT,KAAM,QACN,GAAI,OACN,GAAGA,CAAM,GAAK,GAET,SAASJ,EAAY,CAC1B,OAAAK,EACA,aAAAC,EACA,OAAAF,EACA,sBAAAG,EACA,sBAAAC,EACA,oBAAAC,EAAsB,EACxB,EAOG,CAQD,IAAIC,EAPmB,IAAI,KAAK,aAAaR,EAAkBE,CAAM,EAAG,CACtE,MAAO,WACP,SAAUE,GAAgB,MAC1B,sBAAuBC,IAA0B,EAAI,EAAIC,EACz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n sg: '$',\n ae: 'AED',\n} as any\n\nexport const languageTerritory = (locale: string) =>\n // https://unicode-org.github.io/cldr-staging/charts/37/supplemental/language_territory_information.html\n ({\n us: 'en-us',\n uk: 'en-gb',\n ca: 'en-ca',\n au: 'en-au',\n eu: 'en',\n fr: 'fr-fr',\n de: 'de-de',\n vn: 'vi-vn',\n sg: 'en-sg',\n 'ae-en': 'ae-en',\n plus: 'en-us',\n cl: 'es-cl',\n 'eu-de': 'de-de',\n })[locale] || ''\n\nexport function formatPrice({\n amount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros = false,\n}: {\n amount: number\n currencyCode: string\n locale: string\n maximumFractionDigits?: number\n minimumFractionDigits?: number\n removeTrailingZeros?: boolean\n}) {\n const formatCurrency = new Intl.NumberFormat(languageTerritory(locale), {\n style: 'currency',\n currency: currencyCode || 'USD',\n minimumFractionDigits: maximumFractionDigits === 0 ? 0 : minimumFractionDigits,\n maximumFractionDigits,\n })\n\n let formattedValue = formatCurrency.format(amount)\n\n if (['eu-de', 'eu-en', 'de', 'eu'].includes(locale)) {\n formattedValue = formattedValue?.toString()?.replace(/[\\s]/g, '')\n }\n\n if (removeTrailingZeros) {\n // Adjust the regex to match comma as decimal separator\n formattedValue = formattedValue\n .replace(/(\\.\\d*?[1-9])0+\\b/, '$1')\n .replace(/\\.0+\\b/, '')\n .replace(/(\\,\\d*?[1-9])0+\\b/, '$1')\n .replace(/\\,0+\\b/, '')\n }\n\n return formattedValue\n}\n\nexport function formatVariantPrice({\n amount,\n baseAmount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n}: {\n baseAmount: number\n amount: number\n currencyCode: string\n locale: string\n maximumFractionDigits?: number\n minimumFractionDigits?: number\n removeTrailingZeros?: boolean\n}) {\n if (typeof Intl === 'undefined') {\n return {\n price: `${PRICE_SYMBOL[locale]}${amount}`,\n basePrice: `${PRICE_SYMBOL[locale]}${baseAmount}`,\n discount: `${PRICE_SYMBOL[locale]}${baseAmount - amount || 0}`,\n }\n }\n\n const hasDiscount = baseAmount > amount\n const formatDiscount = new Intl.NumberFormat(languageTerritory(locale), {\n style: 'percent',\n })\n const discount = hasDiscount ? formatDiscount.format((baseAmount - amount) / baseAmount) : null\n\n const price = formatPrice({ amount, currencyCode, locale, removeTrailingZeros })\n const basePrice = hasDiscount\n ? formatPrice({\n amount: baseAmount,\n currencyCode,\n locale,\n maximumFractionDigits,\n minimumFractionDigits,\n removeTrailingZeros,\n })\n : undefined\n\n return { price, basePrice, discount }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,EAAA,gBAAAC,EAAA,uBAAAC,EAAA,sBAAAC,IAAA,eAAAC,EAAAN,GACO,MAAME,EAAe,CAC1B,GAAI,IACJ,GAAI,OACJ,GAAI,IACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,SACJ,GAAI,IACJ,GAAI,IACJ,GAAI,KACN,EAEaG,EAAqBE,IAE/B,CACC,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,KACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,GAAI,QACJ,QAAS,QACT,KAAM,QACN,GAAI,QACJ,QAAS,OACX,GAAGA,CAAM,GAAK,GAET,SAASJ,EAAY,CAC1B,OAAAK,EACA,aAAAC,EACA,OAAAF,EACA,sBAAAG,EACA,sBAAAC,EACA,oBAAAC,EAAsB,EACxB,EAOG,CAQD,IAAIC,EAPmB,IAAI,KAAK,aAAaR,EAAkBE,CAAM,EAAG,CACtE,MAAO,WACP,SAAUE,GAAgB,MAC1B,sBAAuBC,IAA0B,EAAI,EAAIC,EACzD,sBAAAD,CACF,CAAC,EAEmC,OAAOF,CAAM,EAEjD,MAAI,CAAC,QAAS,QAAS,KAAM,IAAI,EAAE,SAASD,CAAM,IAChDM,EAAiBA,GAAgB,SAAS,GAAG,QAAQ,QAAS,EAAE,GAG9DD,IAEFC,EAAiBA,EACd,QAAQ,oBAAqB,IAAI,EACjC,QAAQ,SAAU,EAAE,EACpB,QAAQ,oBAAqB,IAAI,EACjC,QAAQ,SAAU,EAAE,GAGlBA,CACT,CAEO,SAAST,EAAmB,CACjC,OAAAI,EACA,WAAAM,EACA,aAAAL,EACA,OAAAF,EACA,sBAAAG,EACA,sBAAAC,EACA,oBAAAC,CACF,EAQG,CACD,GAAI,OAAO,KAAS,IAClB,MAAO,CACL,MAAO,GAAGV,EAAaK,CAAM,CAAC,GAAGC,CAAM,GACvC,UAAW,GAAGN,EAAaK,CAAM,CAAC,GAAGO,CAAU,GAC/C,SAAU,GAAGZ,EAAaK,CAAM,CAAC,GAAGO,EAAaN,GAAU,CAAC,EAC9D,EAGF,MAAMO,EAAcD,EAAaN,EAC3BQ,EAAiB,IAAI,KAAK,aAAaX,EAAkBE,CAAM,EAAG,CACtE,MAAO,SACT,CAAC,EACKU,EAAWF,EAAcC,EAAe,QAAQF,EAAaN,GAAUM,CAAU,EAAI,KAErFI,EAAQf,EAAY,CAAE,OAAAK,EAAQ,aAAAC,EAAc,OAAAF,EAAQ,oBAAAK,CAAoB,CAAC,EACzEO,EAAYJ,EACdZ,EAAY,CACV,OAAQW,EACR,aAAAL,EACA,OAAAF,EACA,sBAAAG,EACA,sBAAAC,EACA,oBAAAC,CACF,CAAC,EACD,OAEJ,MAAO,CAAE,MAAAM,EAAO,UAAAC,EAAW,SAAAF,CAAS,CACtC",
6
6
  "names": ["shelfDisplay_exports", "__export", "PRICE_SYMBOL", "formatPrice", "formatVariantPrice", "languageTerritory", "__toCommonJS", "locale", "amount", "currencyCode", "maximumFractionDigits", "minimumFractionDigits", "removeTrailingZeros", "formattedValue", "baseAmount", "hasDiscount", "formatDiscount", "discount", "price", "basePrice"]
7
7
  }
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import type { SloganProps } from './types.js';
3
3
  export declare const componentType = "copy";
4
4
  export declare const componentName = "brand_slogan";
5
- declare const _default: React.ForwardRefExoticComponent<Omit<Omit<SloganProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
5
+ declare const _default: React.ForwardRefExoticComponent<Omit<Omit<SloganProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & {
6
6
  className?: string;
7
7
  data?: Record<string, any>;
8
8
  }, "ref"> & React.RefAttributes<any>>;
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var K=Object.create;var v=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var V=Object.getPrototypeOf,W=Object.prototype.hasOwnProperty;var X=(t,e)=>{for(var n in e)v(t,n,{get:e[n],enumerable:!0})},G=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Q(e))!W.call(t,o)&&o!==n&&v(t,o,{get:()=>e[o],enumerable:!(s=O(e,o))||s.enumerable});return t};var Z=(t,e,n)=>(n=t!=null?K(V(t)):{},G(e||!t||!t.__esModule?v(n,"default",{value:t,enumerable:!0}):n,t)),tt=t=>G(v({},"__esModule",{value:!0}),t);var nt={};X(nt,{componentName:()=>A,componentType:()=>j,default:()=>rt});module.exports=tt(nt);var l=require("react/jsx-runtime"),r=Z(require("react")),z=require("@gsap/react"),g=require("gsap"),N=require("gsap/dist/SplitText"),d=require("gsap/dist/ScrollTrigger"),c=require("../../helpers/utils.js"),y=require("../../components/index.js"),D=require("../../shared/Styles.js"),P=require("../../hooks/useExposure.js");const j="copy",A="brand_slogan";function et(t=[],e=3){const n=[];for(let s=0;s<t.length;s+=e)n.push(t.slice(s,s+e));return n}const L=r.default.forwardRef(({data:t,className:e=""},n)=>{const{title:s,features:o=[],featureChunkSize:R=3}=t,[w,k]=r.default.useState(0),[C,b]=r.default.useState(!0),T=(0,r.useRef)(null),x=et(o,R),E=x.length,u=o.length>R,F=u?[...x,x[0]]:x,S=40;(0,r.useImperativeHandle)(n,()=>T.current),(0,P.useExposure)(T,{componentType:j,componentName:A,componentTitle:s}),r.default.useEffect(()=>{if(!u)return;const i=setInterval(()=>{k(a=>a+1),b(!0)},3e3);return()=>clearInterval(i)},[E,u]),r.default.useEffect(()=>{if(u)if(w===E){const i=setTimeout(()=>{b(!1),k(0)},500);return()=>clearTimeout(i)}else b(!0)},[w,E,u]);const m=(0,r.useRef)(null),I=(0,r.useRef)(null),h=(0,r.useRef)(null);return(0,z.useGSAP)(()=>{g.gsap.registerPlugin(d.ScrollTrigger,N.SplitText);function i(){if(!m.current)return;h.current=new N.SplitText(m.current,{type:"words",wordsClass:"word"});const a=m.current?.clientHeight||100,f=h.current.words;g.gsap.set(f,{opacity:0}),d.ScrollTrigger.create({trigger:m.current,start:"bottom bottom-=4%",end:`bottom+=${a*1.5}px bottom-=4%`,scrub:!0,onUpdate:p=>{const U=p.progress,M=f.length,Y=1/M,$=.5;f.forEach((_,q)=>{const B=q/M*(1-$),J=Y*(1+$);let H=(U-B)/J;H=Math.max(0,Math.min(H,1)),g.gsap.set(_,{opacity:H})})}}),o&&o.length>0&&d.ScrollTrigger.create({trigger:I.current,start:`bottom+=${a*2}px bottom-=6%`,end:`bottom+=${a*2+100}px bottom-=6%`,onUpdate:p=>{g.gsap.set(I.current,{opacity:p.progress})}})}return setTimeout(()=>{i()},1e3),()=>{h.current&&h.current.revert(),d.ScrollTrigger.getAll().forEach(a=>a.kill())}},[]),(0,l.jsxs)("div",{ref:T,className:(0,c.cn)("slogan-container laptop:flex-row laptop:items-end laptop:justify-between text-info-primary flex h-auto w-full flex-col items-start justify-center gap-[24px] text-center",e),children:[(0,l.jsx)(y.Heading,{ref:m,as:"h2",size:2,weight:"bold",align:"left",className:(0,c.cn)("slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none"),html:s}),o&&o.length>0&&(0,l.jsx)("div",{className:(0,c.cn)("relative w-full max-w-[500px] overflow-hidden",`tablet:h-[${S}px]`),children:(0,l.jsx)("div",{className:(0,c.cn)(["flex flex-col",C?"transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]":"!transition-none"]),style:{transform:`translateY(-${w*S}px)`},children:F.map((i,a)=>(0,l.jsx)("div",{className:(0,c.cn)("laptop:justify-end flex w-full flex-row items-stretch gap-3 overflow-hidden",`tablet:h-[${S}px]`),children:i.map((f,p)=>(0,l.jsxs)(r.default.Fragment,{children:[p>0&&(0,l.jsx)("div",{className:"slogan-feature-divider w-px self-stretch bg-[#E4E5E6]"}),(0,l.jsx)(y.Text,{size:3,align:"left",as:"p",className:"slogan-feature-text laptop:text-[14px] line-clamp-3 text-[12px] leading-[1.4]",html:f.title})]},p))},a))})})]})});L.displayName="Slogan";var rt=(0,D.withStyles)(L);
1
+ "use strict";"use client";var W=Object.create;var h=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var tt=Object.getPrototypeOf,et=Object.prototype.hasOwnProperty;var rt=(t,r)=>{for(var n in r)h(t,n,{get:r[n],enumerable:!0})},D=(t,r,n,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of Z(r))!et.call(t,o)&&o!==n&&h(t,o,{get:()=>r[o],enumerable:!(l=X(r,o))||l.enumerable});return t};var nt=(t,r,n)=>(n=t!=null?W(tt(t)):{},D(r||!t||!t.__esModule?h(n,"default",{value:t,enumerable:!0}):n,t)),ot=t=>D(h({},"__esModule",{value:!0}),t);var it={};rt(it,{componentName:()=>F,componentType:()=>A,default:()=>lt});module.exports=ot(it);var s=require("react/jsx-runtime"),e=nt(require("react")),ct=require("@gsap/react"),g=require("gsap"),k=require("gsap/dist/SplitText"),v=require("gsap/dist/ScrollTrigger"),u=require("../../helpers/utils.js"),w=require("../../components/index.js"),j=require("../../shared/Styles.js"),C=require("react-intersection-observer"),V=require("../../hooks/useExposure.js");const A="copy",F="brand_slogan";function st(t=[],r=3){const n=[];for(let l=0;l<t.length;l+=r)n.push(t.slice(l,l+r));return n}const P=e.default.forwardRef(({data:t,className:r=""},n)=>{const{title:l,features:o=[],featureChunkSize:I=3}=t,[y,M]=e.default.useState(0),[U,T]=e.default.useState(!0),b=(0,e.useRef)(null),E=(0,e.useRef)(null),S=(0,e.useRef)(null),d=st(o,I),R=d.length,p=o.length>I,Y=p?[...d,d[0]]:d,H=40;(0,e.useImperativeHandle)(n,()=>b.current);const{ref:_,inView:L}=(0,C.useInView)();(0,V.useExposure)(b,{componentType:A,componentName:F,componentTitle:l}),e.default.useEffect(()=>{if(!p)return;const i=setInterval(()=>{M(a=>a+1),T(!0)},3e3);return()=>clearInterval(i)},[R,p]),e.default.useEffect(()=>{if(p)if(y===R){const i=setTimeout(()=>{T(!1),M(0)},500);return()=>clearTimeout(i)}else T(!0)},[y,R,p]);const f=(0,e.useRef)(null),$=(0,e.useRef)(null),x=(0,e.useRef)(null);return(0,e.useEffect)(()=>{g.gsap.registerPlugin(v.ScrollTrigger,k.SplitText);function i(){if(!f.current)return;x.current=new k.SplitText(f.current,{type:"words",wordsClass:"word"});const a=f.current?.clientHeight||100,m=x.current.words;g.gsap.set(m,{opacity:0}),E.current=v.ScrollTrigger.create({trigger:f.current,start:"bottom bottom-=4%",end:`bottom+=${a*1.5}px bottom-=4%`,scrub:!0,onUpdate:c=>{const q=c.progress,G=m.length,B=1/G,z=.5;m.forEach((J,K)=>{const O=K/G*(1-z),Q=B*(1+z);let N=(q-O)/Q;N=Math.max(0,Math.min(N,1)),g.gsap.set(J,{opacity:N})})}}),o&&o.length>0&&(S.current=v.ScrollTrigger.create({trigger:$.current,start:`bottom+=${a*2}px bottom-=6%`,end:`bottom+=${a*2+100}px bottom-=6%`,onUpdate:c=>{g.gsap.set($.current,{opacity:c.progress})}}))}return L&&i(),()=>{x.current&&x.current.revert(),E.current&&E.current.kill(),S.current&&S.current.kill()}},[L]),(0,s.jsx)("div",{ref:_,children:(0,s.jsxs)("div",{ref:b,className:(0,u.cn)("slogan-container laptop:flex-row laptop:items-end laptop:justify-between text-info-primary flex h-auto w-full flex-col items-start justify-center gap-[24px] text-center",r),children:[(0,s.jsx)(w.Heading,{ref:f,as:"h2",size:2,weight:"bold",align:"left",className:(0,u.cn)("slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none"),html:l}),o&&o.length>0&&(0,s.jsx)("div",{className:(0,u.cn)("relative w-full max-w-[500px] overflow-hidden",`tablet:h-[${H}px]`),children:(0,s.jsx)("div",{className:(0,u.cn)(["flex flex-col",U?"transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]":"!transition-none"]),style:{transform:`translateY(-${y*H}px)`},children:Y.map((i,a)=>(0,s.jsx)("div",{className:(0,u.cn)("laptop:justify-end flex w-full flex-row items-stretch gap-3 overflow-hidden",`tablet:h-[${H}px]`),children:i.map((m,c)=>(0,s.jsxs)(e.default.Fragment,{children:[c>0&&(0,s.jsx)("div",{className:"slogan-feature-divider w-px self-stretch bg-[#E4E5E6]"}),(0,s.jsx)(w.Text,{size:3,align:"left",as:"p",className:"slogan-feature-text laptop:text-[14px] line-clamp-3 text-[12px] leading-[1.4]",html:m.title})]},c))},a))})})]})})});P.displayName="Slogan";var lt=(0,j.withLayout)(P);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Slogan/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef } from 'react'\nimport { useGSAP } from '@gsap/react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading, Text } from '../../components/index.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport type { SloganProps } from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\n\nexport const componentType = 'copy'\nexport const componentName = 'brand_slogan'\n\nfunction chunkArray(array: { title: string }[] = [], size: number = 3) {\n const result = []\n for (let i = 0; i < array.length; i += size) {\n result.push(array.slice(i, i + size))\n }\n return result\n}\n\nconst Slogan = React.forwardRef<HTMLDivElement, SloganProps>(({ data, className = '' }, ref) => {\n const { title, features = [], featureChunkSize = 3 } = data\n const [groupIndex, setGroupIndex] = React.useState(0)\n const [isTransitioning, setIsTransitioning] = React.useState(true)\n const innerRef = useRef<HTMLDivElement>(null)\n const featuresGroups = chunkArray(features, featureChunkSize)\n const totalGroups = featuresGroups.length\n const needCarousel = features.length > featureChunkSize\n const displayGroups = needCarousel ? [...featuresGroups, featuresGroups[0]] : featuresGroups\n const groupHeight = 40\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: title,\n })\n\n // \u53EA\u5728\u9700\u8981\u8F6E\u64AD\u65F6\u542F\u7528\u5B9A\u65F6\u5668\n React.useEffect(() => {\n if (!needCarousel) return\n const timer = setInterval(() => {\n setGroupIndex(i => i + 1)\n setIsTransitioning(true)\n }, 3000)\n return () => clearInterval(timer)\n }, [totalGroups, needCarousel])\n\n // \u53EA\u5728\u9700\u8981\u8F6E\u64AD\u65F6\u5904\u7406\u65E0\u7F1D\u8DF3\u8F6C\n React.useEffect(() => {\n if (!needCarousel) return\n if (groupIndex === totalGroups) {\n const handle = setTimeout(() => {\n setIsTransitioning(false)\n setGroupIndex(0)\n }, 500) // 500ms\u7B49\u4E8E\u52A8\u753B\u65F6\u957F\n return () => clearTimeout(handle)\n } else {\n setIsTransitioning(true)\n }\n }, [groupIndex, totalGroups, needCarousel])\n\n // \u6807\u9898\u52A8\u753B\u903B\u8F91\u4FDD\u6301\u4E0D\u53D8\n const titleRef = useRef<HTMLHeadingElement>(null)\n const featuresRef = useRef<HTMLDivElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n useGSAP(() => {\n gsap.registerPlugin(ScrollTrigger, SplitText)\n\n function gsapResize() {\n if (!titleRef.current) return\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const height = titleRef.current?.clientHeight || 100\n\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5}px bottom-=4%`,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\n gsap.set(word, { opacity })\n })\n },\n })\n\n if (features && features.length > 0) {\n ScrollTrigger.create({\n trigger: featuresRef.current,\n start: `bottom+=${height * 2}px bottom-=6%`,\n end: `bottom+=${height * 2 + 100}px bottom-=6%`,\n onUpdate: (self: any) => {\n gsap.set(featuresRef.current, { opacity: self.progress })\n },\n })\n }\n }\n\n setTimeout(() => {\n gsapResize()\n }, 1000)\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n ScrollTrigger.getAll().forEach((t: any) => t.kill())\n }\n }, [])\n\n return (\n <div\n ref={innerRef}\n className={cn(\n 'slogan-container laptop:flex-row laptop:items-end laptop:justify-between text-info-primary flex h-auto w-full flex-col items-start justify-center gap-[24px] text-center',\n className\n )}\n >\n <Heading\n ref={titleRef}\n as=\"h2\"\n size={2}\n weight={'bold'}\n align={'left'}\n className={cn(\n 'slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none'\n )}\n html={title}\n />\n {features && features.length > 0 && (\n <div className={cn('relative w-full max-w-[500px] overflow-hidden', `tablet:h-[${groupHeight}px]`)}>\n <div\n className={cn([\n 'flex flex-col',\n isTransitioning ? 'transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]' : '!transition-none',\n ])}\n style={{\n transform: `translateY(-${groupIndex * groupHeight}px)`,\n }}\n >\n {displayGroups.map((group, idx) => (\n <div\n className={cn(\n 'laptop:justify-end flex w-full flex-row items-stretch gap-3 overflow-hidden',\n `tablet:h-[${groupHeight}px]`\n )}\n key={idx}\n >\n {group.map((feature, index) => (\n <React.Fragment key={index}>\n {index > 0 && <div className=\"slogan-feature-divider w-px self-stretch bg-[#E4E5E6]\" />}\n <Text\n size={3}\n align=\"left\"\n as=\"p\"\n className=\"slogan-feature-text laptop:text-[14px] line-clamp-3 text-[12px] leading-[1.4]\"\n html={feature.title}\n />\n </React.Fragment>\n ))}\n </div>\n ))}\n </div>\n </div>\n )}\n </div>\n )\n})\n\nSlogan.displayName = 'Slogan'\n\nexport default withStyles(Slogan)\n"],
5
- "mappings": "wkBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,mBAAAE,EAAA,kBAAAC,EAAA,YAAAC,KAAA,eAAAC,GAAAL,IAoIM,IAAAM,EAAA,6BAnINC,EAAmD,oBACnDA,EAAwB,uBACxBC,EAAqB,gBACrBC,EAA0B,+BAC1BC,EAA8B,mCAC9BC,EAAmB,kCACnBC,EAA8B,qCAC9BC,EAA2B,kCAE3BC,EAA4B,sCAErB,MAAMX,EAAgB,OAChBD,EAAgB,eAE7B,SAASa,GAAWC,EAA6B,CAAC,EAAGC,EAAe,EAAG,CACrE,MAAMC,EAAS,CAAC,EAChB,QAASC,EAAI,EAAGA,EAAIH,EAAM,OAAQG,GAAKF,EACrCC,EAAO,KAAKF,EAAM,MAAMG,EAAGA,EAAIF,CAAI,CAAC,EAEtC,OAAOC,CACT,CAEA,MAAME,EAAS,EAAAC,QAAM,WAAwC,CAAC,CAAE,KAAAC,EAAM,UAAAC,EAAY,EAAG,EAAGC,IAAQ,CAC9F,KAAM,CAAE,MAAAC,EAAO,SAAAC,EAAW,CAAC,EAAG,iBAAAC,EAAmB,CAAE,EAAIL,EACjD,CAACM,EAAYC,CAAa,EAAI,EAAAR,QAAM,SAAS,CAAC,EAC9C,CAACS,EA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F,CAAC,EACD,MAAO,CACL,UAAW,eAAeF,EAAaS,CAAW,KACpD,EAEC,SAAAD,EAAc,IAAI,CAACoB,EAAOC,OACzB,OAAC,OACC,aAAW,MACT,8EACA,aAAapB,CAAW,KAC1B,EAGC,SAAAmB,EAAM,IAAI,CAACE,EAASC,OACnB,QAAC,EAAAtC,QAAM,SAAN,CACE,UAAAsC,EAAQ,MAAK,OAAC,OAAI,UAAU,wDAAwD,KACrF,OAAC,QACC,KAAM,EACN,MAAM,OACN,GAAG,IACH,UAAU,gFACV,KAAMD,EAAQ,MAChB,IARmBC,CASrB,CACD,GAbIF,CAcP,CACD,EACH,EACF,GAEJ,CAEJ,CAAC,EAEDrC,EAAO,YAAc,SAErB,IAAOhB,MAAQ,cAAWgB,CAAM",
6
- "names": ["Slogan_exports", "__export", "componentName", "componentType", "Slogan_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_SplitText", "import_ScrollTrigger", "import_utils", "import_components", "import_Styles", "import_useExposure", "chunkArray", "array", "size", "result", "i", "Slogan", "React", "data", "className", "ref", "title", "features", "featureChunkSize", "groupIndex", "setGroupIndex", "isTransitioning", "setIsTransitioning", "innerRef", "featuresGroups", "totalGroups", "needCarousel", "displayGroups", "groupHeight", "timer", "handle", "titleRef", "featuresRef", "splitTextInstance", "gsapResize", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "start", "width", "opacity", "t", "group", "idx", "feature", "index"]
4
+ "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef, useEffect } from 'react'\nimport { useGSAP } from '@gsap/react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading, Text } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { SloganProps } from './types.js'\nimport { useInView } from 'react-intersection-observer'\nimport { useExposure } from '../../hooks/useExposure.js'\n\nexport const componentType = 'copy'\nexport const componentName = 'brand_slogan'\n\nfunction chunkArray(array: { title: string }[] = [], size: number = 3) {\n const result = []\n for (let i = 0; i < array.length; i += size) {\n result.push(array.slice(i, i + size))\n }\n return result\n}\n\nconst Slogan = React.forwardRef<HTMLDivElement, SloganProps>(({ data, className = '' }, ref) => {\n const { title, features = [], featureChunkSize = 3 } = data\n const [groupIndex, setGroupIndex] = React.useState(0)\n const [isTransitioning, setIsTransitioning] = React.useState(true)\n const innerRef = useRef<HTMLDivElement>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n const featuresTriggerRef = useRef<ScrollTrigger | null>(null)\n const featuresGroups = chunkArray(features, featureChunkSize)\n const totalGroups = featuresGroups.length\n const needCarousel = features.length > featureChunkSize\n const displayGroups = needCarousel ? [...featuresGroups, featuresGroups[0]] : featuresGroups\n const groupHeight = 40\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n const { ref: inViewRef, inView } = useInView()\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: title,\n })\n\n // \u53EA\u5728\u9700\u8981\u8F6E\u64AD\u65F6\u542F\u7528\u5B9A\u65F6\u5668\n React.useEffect(() => {\n if (!needCarousel) return\n const timer = setInterval(() => {\n setGroupIndex(i => i + 1)\n setIsTransitioning(true)\n }, 3000)\n return () => clearInterval(timer)\n }, [totalGroups, needCarousel])\n\n // \u53EA\u5728\u9700\u8981\u8F6E\u64AD\u65F6\u5904\u7406\u65E0\u7F1D\u8DF3\u8F6C\n React.useEffect(() => {\n if (!needCarousel) return\n if (groupIndex === totalGroups) {\n const handle = setTimeout(() => {\n setIsTransitioning(false)\n setGroupIndex(0)\n }, 500) // 500ms\u7B49\u4E8E\u52A8\u753B\u65F6\u957F\n return () => clearTimeout(handle)\n } else {\n setIsTransitioning(true)\n }\n }, [groupIndex, totalGroups, needCarousel])\n\n // \u6807\u9898\u52A8\u753B\u903B\u8F91\u4FDD\u6301\u4E0D\u53D8\n const titleRef = useRef<HTMLHeadingElement>(null)\n const featuresRef = useRef<HTMLDivElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n\n useEffect(() => {\n gsap.registerPlugin(ScrollTrigger, SplitText)\n\n function gsapResize() {\n if (!titleRef.current) return\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const height = titleRef.current?.clientHeight || 100\n\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5}px bottom-=4%`,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\n gsap.set(word, { opacity })\n })\n },\n })\n\n if (features && features.length > 0) {\n featuresTriggerRef.current = ScrollTrigger.create({\n trigger: featuresRef.current,\n start: `bottom+=${height * 2}px bottom-=6%`,\n end: `bottom+=${height * 2 + 100}px bottom-=6%`,\n onUpdate: (self: any) => {\n gsap.set(featuresRef.current, { opacity: self.progress })\n },\n })\n }\n }\n\n if (inView) {\n gsapResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: any) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n featuresTriggerRef.current && featuresTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n <div ref={inViewRef}>\n <div\n ref={innerRef}\n className={cn(\n 'slogan-container laptop:flex-row laptop:items-end laptop:justify-between text-info-primary flex h-auto w-full flex-col items-start justify-center gap-[24px] text-center',\n className\n )}\n >\n <Heading\n ref={titleRef}\n as=\"h2\"\n size={2}\n weight={'bold'}\n align={'left'}\n className={cn(\n 'slogan-title laptop:text-[40px] desktop:text-[48px] lg-desktop:text-[64px] text-[40px] !leading-none'\n )}\n html={title}\n />\n {features && features.length > 0 && (\n <div className={cn('relative w-full max-w-[500px] overflow-hidden', `tablet:h-[${groupHeight}px]`)}>\n <div\n className={cn([\n 'flex flex-col',\n isTransitioning\n ? 'transition-transform duration-500 ease-[cubic-bezier(.4,0,.2,1)]'\n : '!transition-none',\n ])}\n style={{\n transform: `translateY(-${groupIndex * groupHeight}px)`,\n }}\n >\n {displayGroups.map((group, idx) => (\n <div\n className={cn(\n 'laptop:justify-end flex w-full flex-row items-stretch gap-3 overflow-hidden',\n `tablet:h-[${groupHeight}px]`\n )}\n key={idx}\n >\n {group.map((feature, index) => (\n <React.Fragment key={index}>\n {index > 0 && <div className=\"slogan-feature-divider w-px self-stretch bg-[#E4E5E6]\" />}\n <Text\n size={3}\n align=\"left\"\n as=\"p\"\n className=\"slogan-feature-text laptop:text-[14px] line-clamp-3 text-[12px] leading-[1.4]\"\n html={feature.title}\n />\n </React.Fragment>\n ))}\n </div>\n ))}\n </div>\n </div>\n )}\n </div>\n </div>\n )\n})\n\nSlogan.displayName = 'Slogan'\n\nexport default withLayout(Slogan)\n"],
5
+ "mappings": "8kBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,mBAAAE,EAAA,kBAAAC,EAAA,YAAAC,KAAA,eAAAC,GAAAL,IA8IQ,IAAAM,EAAA,6BA7IRC,EAA8D,qBAC9DA,GAAwB,uBACxBC,EAAqB,gBACrBC,EAA0B,+BAC1BC,EAA8B,mCAC9BC,EAAmB,kCACnBC,EAA8B,qCAC9BC,EAA2B,kCAE3BC,EAA0B,uCAC1BC,EAA4B,sCAErB,MAAMZ,EAAgB,OAChBD,EAAgB,eAE7B,SAASc,GAAWC,EAA6B,CAAC,EAAGC,EAAe,EAAG,CACrE,MAAMC,EAAS,CAAC,EAChB,QAASC,EAAI,EAAGA,EAAIH,EAAM,OAAQG,GAAKF,EACrCC,EAAO,KAAKF,EAAM,MAAMG,EAAGA,EAAIF,CAAI,CAAC,EAEtC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AO,EAE9Db,EAAiB,SAAWA,EAAiB,QAAQ,KAAK,EAC1DC,EAAmB,SAAWA,EAAmB,QAAQ,KAAK,CAChE,CACF,EAAG,CAACO,CAAM,CAAC,KAGT,OAAC,OAAI,IAAKD,EACR,oBAAC,OACC,IAAKR,EACL,aAAW,MACT,2KACAT,CACF,EAEA,oBAAC,WACC,IAAKqB,EACL,GAAG,KACH,KAAM,EACN,OAAQ,OACR,MAAO,OACP,aAAW,MACT,sGACF,EACA,KAAMnB,EACR,EACCC,GAAYA,EAAS,OAAS,MAC7B,OAAC,OAAI,aAAW,MAAG,gDAAiD,aAAaa,CAAW,KAAK,EAC/F,mBAAC,OACC,aAAW,MAAG,CACZ,gBACAT,EACI,mEACA,kBACN,CAAC,EACD,MAAO,CACL,UAAW,eAAeF,EAAaW,CAAW,KACpD,EAEC,SAAAD,EAAc,IAAI,CAACqB,EAAOC,OACzB,OAAC,OACC,aAAW,MACT,8EACA,aAAarB,CAAW,KAC1B,EAGC,SAAAoB,EAAM,IAAI,CAACE,EAASC,OACnB,QAAC,EAAAzC,QAAM,SAAN,CACE,UAAAyC,EAAQ,MAAK,OAAC,OAAI,UAAU,wDAAwD,KACrF,OAAC,QACC,KAAM,EACN,MAAM,OACN,GAAG,IACH,UAAU,gFACV,KAAMD,EAAQ,MAChB,IARmBC,CASrB,CACD,GAbIF,CAcP,CACD,EACH,EACF,GAEJ,EACF,CAEJ,CAAC,EAEDxC,EAAO,YAAc,SAErB,IAAOjB,MAAQ,cAAWiB,CAAM",
6
+ "names": ["Slogan_exports", "__export", "componentName", "componentType", "Slogan_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_SplitText", "import_ScrollTrigger", "import_utils", "import_components", "import_Styles", "import_react_intersection_observer", "import_useExposure", "chunkArray", "array", "size", "result", "i", "Slogan", "React", "data", "className", "ref", "title", "features", "featureChunkSize", "groupIndex", "setGroupIndex", "isTransitioning", "setIsTransitioning", "innerRef", "scrollTriggerRef", "featuresTriggerRef", "featuresGroups", "totalGroups", "needCarousel", "displayGroups", "groupHeight", "inViewRef", "inView", "timer", "handle", "titleRef", "featuresRef", "splitTextInstance", "gsapResize", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "start", "width", "opacity", "group", "idx", "feature", "index"]
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { SpacerProps } from './types.js';
3
- declare const _default: React.ForwardRefExoticComponent<Omit<Omit<SpacerProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
3
+ declare const _default: React.ForwardRefExoticComponent<Omit<Omit<SpacerProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & {
4
4
  className?: string;
5
5
  data?: Record<string, any>;
6
6
  }, "ref"> & React.RefAttributes<any>>;
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var m=Object.create;var o=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty;var y=(e,p)=>{for(var t in p)o(e,t,{get:p[t],enumerable:!0})},s=(e,p,t,a)=>{if(p&&typeof p=="object"||typeof p=="function")for(let r of n(p))!u.call(e,r)&&r!==t&&o(e,r,{get:()=>p[r],enumerable:!(a=h(p,r))||a.enumerable});return e};var v=(e,p,t)=>(t=e!=null?m(S(e)):{},s(p||!e||!e.__esModule?o(t,"default",{value:e,enumerable:!0}):t,e)),x=e=>s(o({},"__esModule",{value:!0}),e);var w={};y(w,{default:()=>k});module.exports=x(w);var f=require("react/jsx-runtime"),i=v(require("react")),l=require("../../helpers/utils.js"),d=require("../../shared/Styles.js");const c=i.default.forwardRef(({className:e,data:p})=>{const{space:t="default"}=p;return(0,f.jsx)("div",{className:(0,l.cn)("ipc_spacer",t==="default"&&"laptop:h-16 desktop:h-[96px] lg-desktop:h-[128px] tablet:h-16 h-16",t==="fixed"&&"h-16",e)})});c.displayName="Spacer";var k=(0,d.withStyles)(c);
1
+ "use strict";"use client";var m=Object.create;var r=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var S=(e,p)=>{for(var t in p)r(e,t,{get:p[t],enumerable:!0})},s=(e,p,t,a)=>{if(p&&typeof p=="object"||typeof p=="function")for(let o of n(p))!y.call(e,o)&&o!==t&&r(e,o,{get:()=>p[o],enumerable:!(a=h(p,o))||a.enumerable});return e};var v=(e,p,t)=>(t=e!=null?m(u(e)):{},s(p||!e||!e.__esModule?r(t,"default",{value:e,enumerable:!0}):t,e)),x=e=>s(r({},"__esModule",{value:!0}),e);var w={};S(w,{default:()=>k});module.exports=x(w);var l=require("react/jsx-runtime"),i=v(require("react")),d=require("../../helpers/utils.js"),f=require("../../shared/Styles.js");const c=i.default.forwardRef(({className:e,data:p})=>{const{space:t="default"}=p;return(0,l.jsx)("div",{className:(0,d.cn)("ipc_spacer",t==="default"&&"laptop:h-16 desktop:h-[96px] lg-desktop:h-[128px] tablet:h-16 h-16",t==="fixed"&&"h-16",e)})});c.displayName="Spacer";var k=(0,f.withLayout)(c);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Spacer/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport type { SpacerProps } from './types.js'\n\nconst Spacer = React.forwardRef<HTMLDivElement, SpacerProps>(({ className, data }) => {\n const { space = 'default' } = data\n return (\n <div\n className={cn(\n 'ipc_spacer',\n space === 'default' && 'laptop:h-16 desktop:h-[96px] lg-desktop:h-[128px] tablet:h-16 h-16',\n space === 'fixed' && 'h-16',\n className\n )}\n ></div>\n )\n})\n\nSpacer.displayName = 'Spacer'\n\nexport default withStyles(Spacer)\n"],
4
+ "sourcesContent": ["'use client'\nimport React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { SpacerProps } from './types.js'\n\nconst Spacer = React.forwardRef<HTMLDivElement, SpacerProps>(({ className, data }) => {\n const { space = 'default' } = data\n return (\n <div\n className={cn(\n 'ipc_spacer',\n space === 'default' && 'laptop:h-16 desktop:h-[96px] lg-desktop:h-[128px] tablet:h-16 h-16',\n space === 'fixed' && 'h-16',\n className\n )}\n ></div>\n )\n})\n\nSpacer.displayName = 'Spacer'\n\nexport default withLayout(Spacer)\n"],
5
5
  "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GASI,IAAAI,EAAA,6BARJC,EAAkB,oBAClBC,EAAmB,kCACnBC,EAA2B,kCAG3B,MAAMC,EAAS,EAAAC,QAAM,WAAwC,CAAC,CAAE,UAAAC,EAAW,KAAAC,CAAK,IAAM,CACpF,KAAM,CAAE,MAAAC,EAAQ,SAAU,EAAID,EAC9B,SACE,OAAC,OACC,aAAW,MACT,aACAC,IAAU,WAAa,qEACvBA,IAAU,SAAW,OACrBF,CACF,EACD,CAEL,CAAC,EAEDF,EAAO,YAAc,SAErB,IAAON,KAAQ,cAAWM,CAAM",
6
6
  "names": ["Spacer_exports", "__export", "Spacer_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_utils", "import_Styles", "Spacer", "React", "className", "data", "space"]
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import type { TabsProps } from './types.js';
2
2
  import React from 'react';
3
- declare const _default: React.ForwardRefExoticComponent<Omit<Omit<TabsProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
3
+ declare const _default: React.ForwardRefExoticComponent<Omit<Omit<TabsProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & {
4
4
  className?: string;
5
5
  data?: Record<string, any>;
6
6
  }, "ref"> & React.RefAttributes<any>>;
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var k=Object.create;var l=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var L=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var B=(a,e)=>{for(var s in e)l(a,s,{get:e[s],enumerable:!0})},T=(a,e,s,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of P(e))!w.call(a,r)&&r!==s&&l(a,r,{get:()=>e[r],enumerable:!(o=v(e,r))||o.enumerable});return a};var m=(a,e,s)=>(s=a!=null?k(L(a)):{},T(e||!a||!a.__esModule?l(s,"default",{value:a,enumerable:!0}):s,a)),C=a=>T(l({},"__esModule",{value:!0}),a);var M={};B(M,{default:()=>G});module.exports=C(M);var i=require("react/jsx-runtime"),c=require("../../shared/Styles.js"),b=m(require("../../components/tabs.js")),f=require("../../helpers/index.js"),u=m(require("react")),d=m(require("../ShelfDisplay/index.js")),y=m(require("../MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js")),N=m(require("../Title/index.js"));const D=u.default.forwardRef(({data:a,className:e},s)=>{const{theme:o,shape:r,align:g,tabs:p,sectionTitle:n}=a,h=t=>t.blockType==="ipc-shelfdisplay"?(0,i.jsx)(d.default,{data:t}):t.blockType==="ipc-multiLayoutGraphicBlock"?(0,i.jsx)(y.default,{data:t}):null;return(0,i.jsxs)("section",{ref:s,className:(0,f.cn)(o==="dark"?"aiui-dark":"",e),children:[n&&(0,i.jsx)(N.default,{className:"section-title",data:{title:n}}),(0,i.jsxs)(b.Tabs,{shape:r,align:g,defaultValue:p[0].tabName,children:[(0,i.jsx)(b.TabsList,{className:"tabs-list",children:p.map(t=>(0,i.jsx)(b.TabsTrigger,{value:t.tabName,className:"tabs-trigger",children:t.tabName},t.tabName))}),p.map(t=>(0,i.jsx)(b.TabsContent,{value:t.tabName,className:"tabs-content",children:h(t.tabContent?.[0])},t.tabName))]})]})});var G=(0,c.withStyles)(D);
1
+ "use strict";"use client";var P=Object.create;var l=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty;var D=(e,i)=>{for(var s in i)l(e,s,{get:i[s],enumerable:!0})},b=(e,i,s,m)=>{if(i&&typeof i=="object"||typeof i=="function")for(let t of q(i))!B.call(e,t)&&t!==s&&l(e,t,{get:()=>i[t],enumerable:!(m=L(i,t))||m.enumerable});return e};var o=(e,i,s)=>(s=e!=null?P(w(e)):{},b(i||!e||!e.__esModule?l(s,"default",{value:e,enumerable:!0}):s,e)),G=e=>b(l({},"__esModule",{value:!0}),e);var A={};D(A,{default:()=>R});module.exports=G(A);var r=require("react/jsx-runtime"),n=require("../../shared/Styles.js"),c=o(require("../../components/tabs.js")),f=require("../../helpers/index.js"),u=o(require("react")),d=o(require("../ShelfDisplay/index.js")),y=o(require("../AccordionCards/index.js")),N=o(require("../Faq/index.js")),k=o(require("../MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js")),g=o(require("../Title/index.js"));const M=u.default.forwardRef(({data:e,className:i},s)=>{const{theme:m,shape:t,align:h,tabs:p,sectionTitle:T}=e,v=a=>a?.blockType==="ipc-shelfdisplay"?(0,r.jsx)(d.default,{data:a}):a?.blockType==="ipc-multiLayoutGraphicBlock"?(0,r.jsx)(k.default,{data:a}):a?.blockType==="ipc-accordioncards"?(0,r.jsx)(y.default,{data:a}):a?.blockType==="ipc-faq"?(0,r.jsx)(N.default,{data:a}):null;return(0,r.jsxs)("section",{ref:s,className:(0,f.cn)(m==="dark"?"aiui-dark":"",i),children:[T&&(0,r.jsx)(g.default,{className:"section-title",data:{title:T}}),(0,r.jsxs)(c.Tabs,{shape:t,align:h,defaultValue:p[0].tabName,children:[(0,r.jsx)(c.TabsList,{className:"tabs-list",children:p.map(a=>(0,r.jsx)(c.TabsTrigger,{value:a.tabName,className:"tabs-trigger",children:a.tabName},a.tabName))}),p.map(a=>(0,r.jsx)(c.TabsContent,{value:a.tabName,className:"tabs-content",children:a.tabContent?.[0]?v(a.tabContent?.[0]):null},a.tabName))]})]})});var R=(0,n.withLayout)(M);
2
2
  //# sourceMappingURL=Tabs.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Tabs/Tabs.tsx"],
4
- "sourcesContent": ["'use client'\nimport { withStyles } from '../../shared/Styles.js'\nimport * as TabsPrimitive from '../../components/tabs.js'\nimport { cn } from '../../helpers/index.js'\nimport type { TabsProps } from './types.js'\nimport React from 'react'\nimport ShelfDisplay from '../ShelfDisplay/index.js'\nimport MultiLayoutGraphicBlock from '../MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js'\nimport Title from '../Title/index.js'\n\nconst Tabs = React.forwardRef<HTMLDivElement, TabsProps>(({ data, className }, forwardedRef) => {\n const { theme, shape, align, tabs, sectionTitle } = data\n\n const renderTabContent = (tabContent: TabsProps['data']['tabs'][number]['tabContent'][number]) => {\n if (tabContent.blockType === 'ipc-shelfdisplay') {\n return <ShelfDisplay data={tabContent} />\n } else if (tabContent.blockType === 'ipc-multiLayoutGraphicBlock') {\n return <MultiLayoutGraphicBlock data={tabContent} />\n } else {\n return null\n }\n }\n\n return (\n <section ref={forwardedRef} className={cn(theme === 'dark' ? 'aiui-dark' : '', className)}>\n {sectionTitle && <Title className=\"section-title\" data={{ title: sectionTitle }} />}\n <TabsPrimitive.Tabs shape={shape} align={align} defaultValue={tabs[0].tabName}>\n <TabsPrimitive.TabsList className=\"tabs-list\">\n {tabs.map(tab => (\n <TabsPrimitive.TabsTrigger key={tab.tabName} value={tab.tabName} className=\"tabs-trigger\">\n {tab.tabName}\n </TabsPrimitive.TabsTrigger>\n ))}\n </TabsPrimitive.TabsList>\n {tabs.map(tab => (\n <TabsPrimitive.TabsContent key={tab.tabName} value={tab.tabName} className=\"tabs-content\">\n {renderTabContent(tab.tabContent?.[0])}\n </TabsPrimitive.TabsContent>\n ))}\n </TabsPrimitive.Tabs>\n </section>\n )\n})\n\nexport default withStyles(Tabs)\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAea,IAAAI,EAAA,6BAdbC,EAA2B,kCAC3BC,EAA+B,uCAC/BC,EAAmB,kCAEnBC,EAAkB,oBAClBC,EAAyB,uCACzBC,EAAoC,oEACpCC,EAAkB,gCAElB,MAAMC,EAAO,EAAAC,QAAM,WAAsC,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAGC,IAAiB,CAC9F,KAAM,CAAE,MAAAC,EAAO,MAAAC,EAAO,MAAAC,EAAO,KAAAC,EAAM,aAAAC,CAAa,EAAIP,EAE9CQ,EAAoBC,GACpBA,EAAW,YAAc,sBACpB,OAAC,EAAAC,QAAA,CAAa,KAAMD,EAAY,EAC9BA,EAAW,YAAc,iCAC3B,OAAC,EAAAE,QAAA,CAAwB,KAAMF,EAAY,EAE3C,KAIX,SACE,QAAC,WAAQ,IAAKP,EAAc,aAAW,MAAGC,IAAU,OAAS,YAAc,GAAIF,CAAS,EACrF,UAAAM,MAAgB,OAAC,EAAAK,QAAA,CAAM,UAAU,gBAAgB,KAAM,CAAE,MAAOL,CAAa,EAAG,KACjF,QAACf,EAAc,KAAd,CAAmB,MAAOY,EAAO,MAAOC,EAAO,aAAcC,EAAK,CAAC,EAAE,QACpE,oBAACd,EAAc,SAAd,CAAuB,UAAU,YAC/B,SAAAc,EAAK,IAAIO,MACR,OAACrB,EAAc,YAAd,CAA4C,MAAOqB,EAAI,QAAS,UAAU,eACxE,SAAAA,EAAI,SADyBA,EAAI,OAEpC,CACD,EACH,EACCP,EAAK,IAAIO,MACR,OAACrB,EAAc,YAAd,CAA4C,MAAOqB,EAAI,QAAS,UAAU,eACxE,SAAAL,EAAiBK,EAAI,aAAa,CAAC,CAAC,GADPA,EAAI,OAEpC,CACD,GACH,GACF,CAEJ,CAAC,EAED,IAAOzB,KAAQ,cAAWU,CAAI",
6
- "names": ["Tabs_exports", "__export", "Tabs_default", "__toCommonJS", "import_jsx_runtime", "import_Styles", "TabsPrimitive", "import_helpers", "import_react", "import_ShelfDisplay", "import_MultiLayoutGraphicBlock", "import_Title", "Tabs", "React", "data", "className", "forwardedRef", "theme", "shape", "align", "tabs", "sectionTitle", "renderTabContent", "tabContent", "ShelfDisplay", "MultiLayoutGraphicBlock", "Title", "tab"]
4
+ "sourcesContent": ["'use client'\nimport { withLayout } from '../../shared/Styles.js'\nimport * as TabsPrimitive from '../../components/tabs.js'\nimport { cn } from '../../helpers/index.js'\nimport type { TabsProps } from './types.js'\nimport React from 'react'\nimport ShelfDisplay from '../ShelfDisplay/index.js'\nimport AccordionCards from '../AccordionCards/index.js'\nimport Faq from '../Faq/index.js'\nimport MultiLayoutGraphicBlock from '../MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js'\nimport Title from '../Title/index.js'\n\nconst Tabs = React.forwardRef<HTMLDivElement, TabsProps>(({ data, className }, forwardedRef) => {\n const { theme, shape, align, tabs, sectionTitle } = data\n\n const renderTabContent = (tabContent: TabsProps['data']['tabs'][number]['tabContent'][number]) => {\n if (tabContent?.blockType === 'ipc-shelfdisplay') {\n return <ShelfDisplay data={tabContent} />\n } else if (tabContent?.blockType === 'ipc-multiLayoutGraphicBlock') {\n return <MultiLayoutGraphicBlock data={tabContent} />\n } else if (tabContent?.blockType === 'ipc-accordioncards') {\n return <AccordionCards data={tabContent} />\n } else if (tabContent?.blockType === 'ipc-faq') {\n return <Faq data={tabContent} />\n } else {\n return null\n }\n }\n\n return (\n <section ref={forwardedRef} className={cn(theme === 'dark' ? 'aiui-dark' : '', className)}>\n {sectionTitle && <Title className=\"section-title\" data={{ title: sectionTitle }} />}\n <TabsPrimitive.Tabs shape={shape} align={align} defaultValue={tabs[0].tabName}>\n <TabsPrimitive.TabsList className=\"tabs-list\">\n {tabs.map(tab => (\n <TabsPrimitive.TabsTrigger key={tab.tabName} value={tab.tabName} className=\"tabs-trigger\">\n {tab.tabName}\n </TabsPrimitive.TabsTrigger>\n ))}\n </TabsPrimitive.TabsList>\n {tabs.map(tab => (\n <TabsPrimitive.TabsContent key={tab.tabName} value={tab.tabName} className=\"tabs-content\">\n {tab.tabContent?.[0] ? renderTabContent(tab.tabContent?.[0]) : null}\n </TabsPrimitive.TabsContent>\n ))}\n </TabsPrimitive.Tabs>\n </section>\n )\n})\n\nexport default withLayout(Tabs)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAiBa,IAAAI,EAAA,6BAhBbC,EAA2B,kCAC3BC,EAA+B,uCAC/BC,EAAmB,kCAEnBC,EAAkB,oBAClBC,EAAyB,uCACzBC,EAA2B,yCAC3BC,EAAgB,8BAChBC,EAAoC,oEACpCC,EAAkB,gCAElB,MAAMC,EAAO,EAAAC,QAAM,WAAsC,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAGC,IAAiB,CAC9F,KAAM,CAAE,MAAAC,EAAO,MAAAC,EAAO,MAAAC,EAAO,KAAAC,EAAM,aAAAC,CAAa,EAAIP,EAE9CQ,EAAoBC,GACpBA,GAAY,YAAc,sBACrB,OAAC,EAAAC,QAAA,CAAa,KAAMD,EAAY,EAC9BA,GAAY,YAAc,iCAC5B,OAAC,EAAAE,QAAA,CAAwB,KAAMF,EAAY,EACzCA,GAAY,YAAc,wBAC5B,OAAC,EAAAG,QAAA,CAAe,KAAMH,EAAY,EAChCA,GAAY,YAAc,aAC5B,OAAC,EAAAI,QAAA,CAAI,KAAMJ,EAAY,EAEvB,KAIX,SACE,QAAC,WAAQ,IAAKP,EAAc,aAAW,MAAGC,IAAU,OAAS,YAAc,GAAIF,CAAS,EACrF,UAAAM,MAAgB,OAAC,EAAAO,QAAA,CAAM,UAAU,gBAAgB,KAAM,CAAE,MAAOP,CAAa,EAAG,KACjF,QAACjB,EAAc,KAAd,CAAmB,MAAOc,EAAO,MAAOC,EAAO,aAAcC,EAAK,CAAC,EAAE,QACpE,oBAAChB,EAAc,SAAd,CAAuB,UAAU,YAC/B,SAAAgB,EAAK,IAAIS,MACR,OAACzB,EAAc,YAAd,CAA4C,MAAOyB,EAAI,QAAS,UAAU,eACxE,SAAAA,EAAI,SADyBA,EAAI,OAEpC,CACD,EACH,EACCT,EAAK,IAAIS,MACR,OAACzB,EAAc,YAAd,CAA4C,MAAOyB,EAAI,QAAS,UAAU,eACxE,SAAAA,EAAI,aAAa,CAAC,EAAIP,EAAiBO,EAAI,aAAa,CAAC,CAAC,EAAI,MADjCA,EAAI,OAEpC,CACD,GACH,GACF,CAEJ,CAAC,EAED,IAAO7B,KAAQ,cAAWY,CAAI",
6
+ "names": ["Tabs_exports", "__export", "Tabs_default", "__toCommonJS", "import_jsx_runtime", "import_Styles", "TabsPrimitive", "import_helpers", "import_react", "import_ShelfDisplay", "import_AccordionCards", "import_Faq", "import_MultiLayoutGraphicBlock", "import_Title", "Tabs", "React", "data", "className", "forwardedRef", "theme", "shape", "align", "tabs", "sectionTitle", "renderTabContent", "tabContent", "ShelfDisplay", "MultiLayoutGraphicBlock", "AccordionCards", "Faq", "Title", "tab"]
7
7
  }
@@ -1,6 +1,8 @@
1
1
  import type { Align, Shape, Theme } from '../../types/props.js';
2
2
  import type { MultiLayoutGraphicBlockProps } from '../MultiLayoutGraphicBlock/types.js';
3
3
  import type { ShelfDisplayProps } from '../ShelfDisplay/index.js';
4
+ import type { AccordionCardsType } from '../AccordionCards/index.js';
5
+ import type { FaqProps } from '../Faq/types.js';
4
6
  export type TabsProps = {
5
7
  data: {
6
8
  sectionTitle?: string;
@@ -13,6 +15,10 @@ export type TabsProps = {
13
15
  blockType: 'ipc-shelfdisplay';
14
16
  })[] | (MultiLayoutGraphicBlockProps['data'] & {
15
17
  blockType: 'ipc-multiLayoutGraphicBlock';
18
+ })[] | (AccordionCardsType['data'] & {
19
+ blockType: 'ipc-accordioncards';
20
+ })[] | (FaqProps['data'] & {
21
+ blockType: 'ipc-faq';
16
22
  })[];
17
23
  }[];
18
24
  };
@@ -1,2 +1,2 @@
1
- "use strict";var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var r=Object.prototype.hasOwnProperty;var y=(t,p,o,e)=>{if(p&&typeof p=="object"||typeof p=="function")for(let a of l(p))!r.call(t,a)&&a!==o&&i(t,a,{get:()=>p[a],enumerable:!(e=s(p,a))||e.enumerable});return t};var c=t=>y(i({},"__esModule",{value:!0}),t);var h={};module.exports=c(h);
1
+ "use strict";var e=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var l=(a,p,i,t)=>{if(p&&typeof p=="object"||typeof p=="function")for(let o of s(p))!c.call(a,o)&&o!==i&&e(a,o,{get:()=>p[o],enumerable:!(t=r(p,o))||t.enumerable});return a};var y=a=>l(e({},"__esModule",{value:!0}),a);var d={};module.exports=y(d);
2
2
  //# sourceMappingURL=types.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Tabs/types.ts"],
4
- "sourcesContent": ["import type { Align, Shape, Theme } from '../../types/props.js'\nimport type { MultiLayoutGraphicBlockProps } from '../MultiLayoutGraphicBlock/types.js'\nimport type { ShelfDisplayProps } from '../ShelfDisplay/index.js'\n\nexport type TabsProps = {\n data: {\n sectionTitle?: string\n theme: Theme\n shape: Shape\n align: Align\n tabs: {\n tabName: string\n tabContent:\n | (ShelfDisplayProps['data'] & { blockType: 'ipc-shelfdisplay' })[]\n | (MultiLayoutGraphicBlockProps['data'] & { blockType: 'ipc-multiLayoutGraphicBlock' })[]\n }[]\n }\n className?: string\n}\n"],
4
+ "sourcesContent": ["import type { Align, Shape, Theme } from '../../types/props.js'\nimport type { MultiLayoutGraphicBlockProps } from '../MultiLayoutGraphicBlock/types.js'\nimport type { ShelfDisplayProps } from '../ShelfDisplay/index.js'\nimport type { AccordionCardsType } from '../AccordionCards/index.js'\nimport type { FaqProps } from '../Faq/types.js'\n\nexport type TabsProps = {\n data: {\n sectionTitle?: string\n theme: Theme\n shape: Shape\n align: Align\n tabs: {\n tabName: string\n tabContent:\n | (ShelfDisplayProps['data'] & { blockType: 'ipc-shelfdisplay' })[]\n | (MultiLayoutGraphicBlockProps['data'] & { blockType: 'ipc-multiLayoutGraphicBlock' })[]\n | (AccordionCardsType['data'] & { blockType: 'ipc-accordioncards' })[]\n | (FaqProps['data'] & { blockType: 'ipc-faq' })[]\n }[]\n }\n className?: string\n}\n"],
5
5
  "mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
6
6
  "names": ["types_exports", "__toCommonJS"]
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import type { TitleProps } from './types.js';
3
- declare const _default: React.ForwardRefExoticComponent<Omit<Omit<TitleProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps> & {
3
+ declare const _default: React.ForwardRefExoticComponent<Omit<Omit<TitleProps & React.RefAttributes<HTMLDivElement>, keyof import("../../shared/Styles.js").StylesProps> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & {
4
4
  className?: string;
5
5
  data?: Record<string, any>;
6
6
  }, "ref"> & React.RefAttributes<any>>;
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var A=Object.create;var l=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var N=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var G=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},y=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of N(e))!D.call(t,o)&&o!==r&&l(t,o,{get:()=>e[o],enumerable:!(s=L(e,o))||s.enumerable});return t};var I=(t,e,r)=>(r=t!=null?A(C(t)):{},y(e||!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),U=t=>y(l({},"__esModule",{value:!0}),t);var j={};G(j,{default:()=>$});module.exports=U(j);var d=require("react/jsx-runtime"),n=I(require("react")),w=require("@gsap/react"),a=require("gsap"),f=require("gsap/dist/SplitText"),c=require("gsap/dist/ScrollTrigger"),b=require("../../helpers/utils.js"),v=require("../../components/index.js"),x=require("../../shared/Styles.js");const T=n.default.forwardRef(({data:t,className:e})=>{const{title:r,theme:s}=t,o=(0,n.useRef)(null),i=(0,n.useRef)(null);return(0,w.useGSAP)(()=>{a.gsap.registerPlugin(f.SplitText,c.ScrollTrigger);function H(){if(!o.current)return;const m=o.current?.clientHeight||80;i.current=new f.SplitText(o.current,{type:"words",wordsClass:"word"});const p=i.current.words;a.gsap.set(p,{opacity:0}),c.ScrollTrigger.create({trigger:o.current,start:"bottom bottom-=4%",end:`bottom+=${m*1.5+60}px bottom-=4%`,scrub:!0,onUpdate:R=>{const S=R.progress,g=p.length,k=1/g,h=.5;p.forEach((E,M)=>{const P=M/g*(1-h),z=k*(1+h);let u=(S-P)/z;u=Math.max(0,Math.min(u,1)),a.gsap.set(E,{opacity:u})})}})}return setTimeout(()=>{H()},1e3),()=>{i.current&&i.current.revert(),c.ScrollTrigger.getAll().forEach(m=>m.kill())}},[]),r&&(0,d.jsx)("div",{className:(0,b.cn)("mb-[24px] space-y-4",e,{"aiui-dark":s==="dark"}),children:(0,d.jsx)(v.Heading,{ref:o,as:"h2",size:4,html:r})})});T.displayName="Title";var $=(0,x.withStyles)(T);
1
+ "use strict";"use client";var _=Object.create;var a=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty;var J=(t,e)=>{for(var n in e)a(t,n,{get:e[n],enumerable:!0})},k=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of A(e))!G.call(t,o)&&o!==n&&a(t,o,{get:()=>e[o],enumerable:!(s=q(e,o))||s.enumerable});return t};var K=(t,e,n)=>(n=t!=null?_(B(t)):{},k(e||!t||!t.__esModule?a(n,"default",{value:t,enumerable:!0}):n,t)),O=t=>k(a({},"__esModule",{value:!0}),t);var W={};J(W,{default:()=>Q});module.exports=O(W);var i=require("react/jsx-runtime"),r=K(require("react")),m=require("gsap"),T=require("gsap/dist/SplitText"),h=require("gsap/dist/ScrollTrigger"),w=require("../../helpers/utils.js"),E=require("../../components/index.js"),L=require("../../shared/Styles.js"),M=require("../../hooks/useExposure.js"),D=require("../../shared/trackUrlRef.js"),N=require("react-intersection-observer");const b="link",R="title",H=r.default.forwardRef(({data:t,className:e},n)=>{const{title:s,theme:o,extension:u}=t,p=(0,r.useRef)(null),l=(0,r.useRef)(null),c=(0,r.useRef)(null),f=(0,r.useRef)(null),{ref:S,inView:x}=(0,N.useInView)();return(0,r.useImperativeHandle)(n,()=>p.current),(0,M.useExposure)(p,{componentType:b,componentName:R,componentTitle:t?.title}),(0,r.useEffect)(()=>{m.gsap.registerPlugin(T.SplitText,h.ScrollTrigger);function I(){if(!l.current)return;const P=l.current?.clientHeight||80;c.current=new T.SplitText(l.current,{type:"words",wordsClass:"word"});const d=c.current.words;m.gsap.set(d,{opacity:0}),f.current=h.ScrollTrigger.create({trigger:l.current,start:"bottom bottom-=4%",end:`bottom+=${P*1.5+60}px bottom-=4%`,scrub:!0,onUpdate:V=>{const $=V.progress,v=d.length,z=1/v,y=.5;d.forEach((U,j)=>{const C=j/v*(1-y),F=z*(1+y);let g=($-C)/F;g=Math.max(0,Math.min(g,1)),m.gsap.set(U,{opacity:g})})}})}return x&&I(),()=>{c.current&&c.current.revert(),f.current&&f.current.kill()}},[x]),s&&(0,i.jsxs)("div",{className:"mb-6 flex items-end justify-between",ref:p,children:[(0,i.jsx)("div",{ref:S,className:(0,w.cn)("space-y-4",e,{"aiui-dark":o==="dark"}),children:(0,i.jsx)(E.Heading,{ref:l,as:"h2",size:4,html:s})}),u?.textLink&&(0,i.jsx)("a",{className:(0,w.cn)({"aiui-dark":o==="dark"},"text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#1D1D1F]"),href:(0,D.trackUrlRef)(u?.link,`${b}_${R}`),children:u?.textLink})]})});H.displayName="Title";var Q=(0,L.withLayout)(H);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Title/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useRef } from 'react'\nimport { useGSAP } from '@gsap/react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading } from '../../components/index.js'\nimport { withStyles } from '../../shared/Styles.js'\nimport type { TitleProps } from './types.js'\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(({ data, className }) => {\n const { title, theme } = data\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n useGSAP(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n function gsapResize() {\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5 + 60}px bottom-=4%`,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\n gsap.set(word, { opacity })\n })\n },\n })\n }\n setTimeout(() => {\n gsapResize()\n }, 1000)\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n }\n }, [])\n\n return (\n title && (\n <div className={cn('mb-[24px] space-y-4', className, { 'aiui-dark': theme === 'dark' })}>\n <Heading ref={titleRef} as=\"h2\" size={4} html={title} />\n </div>\n )\n )\n})\n\nTitle.displayName = 'Title'\n\nexport default withStyles(Title)\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA0DQ,IAAAI,EAAA,6BAzDRC,EAA8B,oBAC9BA,EAAwB,uBACxBC,EAAqB,gBACrBC,EAA0B,+BAC1BC,EAA8B,mCAC9BC,EAAmB,kCACnBC,EAAwB,qCACxBC,EAA2B,kCAG3B,MAAMC,EAAQ,EAAAC,QAAM,WAAuC,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,IAAM,CAClF,KAAM,CAAE,MAAAC,EAAO,MAAAC,CAAM,EAAIH,EACnBI,KAAW,UAA2B,IAAI,EAC1CC,KAAoB,UAAyB,IAAI,EACvD,oBAAQ,IAAM,CACZ,OAAK,eAAe,YAAW,eAAa,EAC5C,SAASC,GAAa,CACpB,GAAI,CAACF,EAAS,QAAS,OACvB,MAAMG,EAASH,EAAS,SAAS,cAAgB,GACjDC,EAAkB,QAAU,IAAI,YAAUD,EAAS,QAAS,CAC1D,KAAM,QACN,WAAY,MACd,CAAC,EACD,MAAMI,EAAQH,EAAkB,QAAQ,MACxC,OAAK,IAAIG,EAAO,CAAE,QAAS,CAAE,CAAC,EAC9B,gBAAc,OAAO,CACnB,QAASJ,EAAS,QAClB,MAAO,oBACP,IAAK,WAAWG,EAAS,IAAM,EAAE,gBACjC,MAAO,GACP,SAAWE,GAAc,CACvB,MAAMC,EAAWD,EAAK,SAChBE,EAAQH,EAAM,OACdI,EAAW,EAAID,EACfE,EAAU,GAChBL,EAAM,QAAQ,CAACM,EAAWC,IAAc,CACtC,MAAMC,EAASD,EAAIJ,GAAU,EAAIE,GAC3BI,EAAQL,GAAY,EAAIC,GAC9B,IAAIK,GAAWR,EAAWM,GAASC,EACnCC,EAAU,KAAK,IAAI,EAAG,KAAK,IAAIA,EAAS,CAAC,CAAC,EAC1C,OAAK,IAAIJ,EAAM,CAAE,QAAAI,CAAQ,CAAC,CAC5B,CAAC,CACH,CACF,CAAC,CACH,CACA,kBAAW,IAAM,CACfZ,EAAW,CACb,EAAG,GAAI,EACA,IAAM,CACXD,EAAkB,SAAWA,EAAkB,QAAQ,OAAO,EAC9D,gBAAc,OAAO,EAAE,QAASc,GAA2BA,EAAE,KAAK,CAAC,CACrE,CACF,EAAG,CAAC,CAAC,EAGHjB,MACE,OAAC,OAAI,aAAW,MAAG,sBAAuBD,EAAW,CAAE,YAAaE,IAAU,MAAO,CAAC,EACpF,mBAAC,WAAQ,IAAKC,EAAU,GAAG,KAAK,KAAM,EAAG,KAAMF,EAAO,EACxD,CAGN,CAAC,EAEDJ,EAAM,YAAc,QAEpB,IAAOV,KAAQ,cAAWU,CAAK",
6
- "names": ["Title_exports", "__export", "Title_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_gsap", "import_SplitText", "import_ScrollTrigger", "import_utils", "import_components", "import_Styles", "Title", "React", "data", "className", "title", "theme", "titleRef", "splitTextInstance", "gsapResize", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "i", "start", "width", "opacity", "t"]
4
+ "sourcesContent": ["'use client'\nimport React, { useEffect, useRef, useImperativeHandle } from 'react'\nimport { gsap } from 'gsap'\nimport { SplitText } from 'gsap/dist/SplitText'\nimport { ScrollTrigger } from 'gsap/dist/ScrollTrigger'\nimport { cn } from '../../helpers/utils.js'\nimport { Heading } from '../../components/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport type { TitleProps } from './types.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { useInView } from 'react-intersection-observer'\n\nconst componentType = 'link'\nconst componentName = 'title'\n\nconst Title = React.forwardRef<HTMLDivElement, TitleProps>(({ data, className }, ref) => {\n const { title, theme, extension } = data\n const innerRef = useRef<HTMLDivElement>(null)\n const titleRef = useRef<HTMLHeadingElement>(null)\n const splitTextInstance = useRef<SplitText | null>(null)\n const scrollTriggerRef = useRef<ScrollTrigger | null>(null)\n\n const { ref: inViewRef, inView } = useInView()\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useExposure(innerRef, {\n componentType,\n componentName,\n componentTitle: data?.title,\n })\n\n useEffect(() => {\n gsap.registerPlugin(SplitText, ScrollTrigger)\n function gsapResize() {\n if (!titleRef.current) return\n const height = titleRef.current?.clientHeight || 80\n splitTextInstance.current = new SplitText(titleRef.current, {\n type: 'words',\n wordsClass: 'word',\n })\n const words = splitTextInstance.current.words\n gsap.set(words, { opacity: 0 })\n scrollTriggerRef.current = ScrollTrigger.create({\n trigger: titleRef.current,\n start: 'bottom bottom-=4%',\n end: `bottom+=${height * 1.5 + 60}px bottom-=4%`,\n scrub: true,\n onUpdate: (self: any) => {\n const progress = self.progress\n const total = words.length\n const interval = 1 / total\n const overlap = 0.5\n words.forEach((word: any, i: number) => {\n const start = (i / total) * (1 - overlap)\n const width = interval * (1 + overlap)\n let opacity = (progress - start) / width\n opacity = Math.max(0, Math.min(opacity, 1))\n gsap.set(word, { opacity })\n })\n },\n })\n }\n\n if (inView) {\n gsapResize()\n }\n\n return () => {\n splitTextInstance.current && splitTextInstance.current.revert()\n // ScrollTrigger.getAll().forEach((t: { kill: () => any }) => t.kill())\n scrollTriggerRef.current && scrollTriggerRef.current.kill()\n }\n }, [inView])\n\n return (\n title && (\n <div className=\"mb-6 flex items-end justify-between\" ref={innerRef}>\n <div ref={inViewRef} className={cn('space-y-4', className, { 'aiui-dark': theme === 'dark' })}>\n <Heading ref={titleRef} as=\"h2\" size={4} html={title} />\n </div>\n {extension?.textLink && (\n <a\n className={cn(\n { 'aiui-dark': theme === 'dark' },\n 'text-base font-[700] leading-[1.4] text-[#777] transition-all duration-[0.4s] hover:text-[#1D1D1F]'\n )}\n href={trackUrlRef(extension?.link, `${componentType}_${componentName}`)}\n >\n {extension?.textLink}\n </a>\n )}\n </div>\n )\n )\n})\n\nTitle.displayName = 'Title'\n\nexport default withLayout(Title)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA8EM,IAAAI,EAAA,6BA7ENC,EAA8D,oBAC9DC,EAAqB,gBACrBC,EAA0B,+BAC1BC,EAA8B,mCAC9BC,EAAmB,kCACnBC,EAAwB,qCACxBC,EAA2B,kCAE3BC,EAA4B,sCAC5BC,EAA4B,uCAC5BC,EAA0B,uCAE1B,MAAMC,EAAgB,OAChBC,EAAgB,QAEhBC,EAAQ,EAAAC,QAAM,WAAuC,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAGC,IAAQ,CACvF,KAAM,CAAE,MAAAC,EAAO,MAAAC,EAAO,UAAAC,CAAU,EAAIL,EAC9BM,KAAW,UAAuB,IAAI,EACtCC,KAAW,UAA2B,IAAI,EAC1CC,KAAoB,UAAyB,IAAI,EACjDC,KAAmB,UAA6B,IAAI,EAEpD,CAAE,IAAKC,EAAW,OAAAC,CAAO,KAAI,aAAU,EAE7C,gCAAoBT,EAAK,IAAMI,EAAS,OAAyB,KAEjE,eAAYA,EAAU,CACpB,cAAAV,EACA,cAAAC,EACA,eAAgBG,GAAM,KACxB,CAAC,KAED,aAAU,IAAM,CACd,OAAK,eAAe,YAAW,eAAa,EAC5C,SAASY,GAAa,CACpB,GAAI,CAACL,EAAS,QAAS,OACvB,MAAMM,EAASN,EAAS,SAAS,cAAgB,GACjDC,EAAkB,QAAU,IAAI,YAAUD,EAAS,QAAS,CAC1D,KAAM,QACN,WAAY,MACd,CAAC,EACD,MAAMO,EAAQN,EAAk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import_react", "import_gsap", "import_SplitText", "import_ScrollTrigger", "import_utils", "import_components", "import_Styles", "import_useExposure", "import_trackUrlRef", "import_react_intersection_observer", "componentType", "componentName", "Title", "React", "data", "className", "ref", "title", "theme", "extension", "innerRef", "titleRef", "splitTextInstance", "scrollTriggerRef", "inViewRef", "inView", "gsapResize", "height", "words", "self", "progress", "total", "interval", "overlap", "word", "i", "start", "width", "opacity"]
7
7
  }
@@ -19,6 +19,10 @@ export interface TitleProps {
19
19
  * 主题色
20
20
  */
21
21
  theme?: Theme;
22
+ /**
23
+ * 扩展数据
24
+ */
25
+ extension?: any;
22
26
  };
23
27
  /**
24
28
  * 自定义类名