@anker-in/headless-ui 1.1.80 → 1.1.81

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 (179) hide show
  1. package/dist/cjs/biz-components/AccordionCards/index.d.ts +36 -1
  2. package/dist/cjs/biz-components/ActivitySchedule/index.d.ts +3 -1
  3. package/dist/cjs/biz-components/AiuiProvider/index.d.ts +13 -1
  4. package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
  5. package/dist/cjs/biz-components/AiuiProvider/index.js.map +3 -3
  6. package/dist/cjs/biz-components/AiuiProvider/useAutoTracking.d.ts +17 -0
  7. package/dist/cjs/biz-components/AiuiProvider/useAutoTracking.js +2 -0
  8. package/dist/cjs/biz-components/AiuiProvider/useAutoTracking.js.map +7 -0
  9. package/dist/cjs/biz-components/AnchorNavigation/index.d.ts +2 -7
  10. package/dist/cjs/biz-components/AnchorNavigation/index.js +1 -1
  11. package/dist/cjs/biz-components/AnchorNavigation/index.js.map +3 -3
  12. package/dist/cjs/biz-components/AplusDesc/index.d.ts +17 -1
  13. package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.d.ts +2 -1
  14. package/dist/cjs/biz-components/BrandEquity/BrandEquity.d.ts +2 -1
  15. package/dist/cjs/biz-components/Category/index.d.ts +1 -1
  16. package/dist/cjs/biz-components/CreativeModule/index.d.ts +7 -1
  17. package/dist/cjs/biz-components/DownLoad/index.d.ts +6 -1
  18. package/dist/cjs/biz-components/Evaluate/index.d.ts +1 -1
  19. package/dist/cjs/biz-components/Faq/Faq.d.ts +3 -2
  20. package/dist/cjs/biz-components/FeatureCards/FeatureCards.d.ts +3 -1
  21. package/dist/cjs/biz-components/FeatureShowcase/FeatureShowcase.d.ts +3 -1
  22. package/dist/cjs/biz-components/Features/index.d.ts +8 -1
  23. package/dist/cjs/biz-components/FootCharger/index.d.ts +7 -1
  24. package/dist/cjs/biz-components/FooterNavigation/index.d.ts +2 -1
  25. package/dist/cjs/biz-components/GiftBox/index.d.ts +3 -1
  26. package/dist/cjs/biz-components/GiftShelf/index.d.ts +3 -1
  27. package/dist/cjs/biz-components/GiftTierShelf/index.d.ts +3 -1
  28. package/dist/cjs/biz-components/Graphic/index.d.ts +1 -1
  29. package/dist/cjs/biz-components/GraphicAttractionBlock/index.d.ts +1 -1
  30. package/dist/cjs/biz-components/GraphicMore/index.d.ts +7 -1
  31. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.d.ts +10 -2
  32. package/dist/cjs/biz-components/HeaderNavigation/index.d.ts +3 -1
  33. package/dist/cjs/biz-components/HeroBanner/HeroBanner.d.ts +5 -1
  34. package/dist/cjs/biz-components/ImageTextFeature/ImageTextFeature.d.ts +3 -1
  35. package/dist/cjs/biz-components/ImageWithText/ImageWithText.d.ts +3 -1
  36. package/dist/cjs/biz-components/Ksp/index.d.ts +1 -1
  37. package/dist/cjs/biz-components/Listing/components/PaidShipping/index.d.ts +11 -1
  38. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +26 -1
  39. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +1 -1
  40. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +1 -1
  41. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +1 -1
  42. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +1 -1
  43. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +1 -1
  44. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +1 -1
  45. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.d.ts +11 -1
  46. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +1 -1
  47. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.d.ts +2 -1
  48. package/dist/cjs/biz-components/Marquee/Marquee.d.ts +3 -2
  49. package/dist/cjs/biz-components/MarqueeReview/index.d.ts +1 -1
  50. package/dist/cjs/biz-components/MediaEndorsement/index.d.ts +2 -1
  51. package/dist/cjs/biz-components/MediaPlayerBase/index.d.ts +2 -1
  52. package/dist/cjs/biz-components/MediaPlayerBase/index.js +1 -1
  53. package/dist/cjs/biz-components/MediaPlayerBase/index.js.map +2 -2
  54. package/dist/cjs/biz-components/MediaPlayerMulti/index.d.ts +2 -1
  55. package/dist/cjs/biz-components/MediaPlayerSticky/index.d.ts +5 -1
  56. package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.d.ts +2 -1
  57. package/dist/cjs/biz-components/MediaSceneSwitcherV2/index.d.ts +1 -1
  58. package/dist/cjs/biz-components/MemberEquity/index.d.ts +3 -1
  59. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +17 -2
  60. package/dist/cjs/biz-components/NavigationSearch/index.d.ts +2 -2
  61. package/dist/cjs/biz-components/NavigationSearch/index.js +2 -2
  62. package/dist/cjs/biz-components/NavigationSearch/index.js.map +3 -3
  63. package/dist/cjs/biz-components/ProductCompare/index.d.ts +1 -1
  64. package/dist/cjs/biz-components/ProductHero/ProductHero.d.ts +3 -1
  65. package/dist/cjs/biz-components/ProductNav/ProductNav.d.ts +2 -1
  66. package/dist/cjs/biz-components/PromotionalBar/index.d.ts +1 -1
  67. package/dist/cjs/biz-components/SecondaryBanner/index.d.ts +2 -7
  68. package/dist/cjs/biz-components/SecondaryBanner/index.js +1 -1
  69. package/dist/cjs/biz-components/SecondaryBanner/index.js.map +3 -3
  70. package/dist/cjs/biz-components/SelectStore/index.d.ts +7 -1
  71. package/dist/cjs/biz-components/ShelfDisplay/index.d.ts +3 -1
  72. package/dist/cjs/biz-components/Slogan/index.d.ts +3 -1
  73. package/dist/cjs/biz-components/Spacer/index.d.ts +3 -1
  74. package/dist/cjs/biz-components/Specs/index.d.ts +1 -1
  75. package/dist/cjs/biz-components/SpecsComparison/SpecsComparison.d.ts +3 -1
  76. package/dist/cjs/biz-components/TabWithImage/TabWithImage.d.ts +3 -1
  77. package/dist/cjs/biz-components/Tabs/Tabs.d.ts +3 -1
  78. package/dist/cjs/biz-components/TabsGroup/index.d.ts +3 -1
  79. package/dist/cjs/biz-components/TabsWithMedia/TabsWithMedia.d.ts +3 -1
  80. package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.d.ts +3 -1
  81. package/dist/cjs/biz-components/Title/index.d.ts +1 -1
  82. package/dist/cjs/biz-components/VideoFeature/VideoFeature.d.ts +3 -1
  83. package/dist/cjs/biz-components/WheelLottery/index.d.ts +1 -1
  84. package/dist/cjs/biz-components/WhyChoose/WhyChoose.d.ts +3 -2
  85. package/dist/cjs/helpers/ScrollLoadVideo.js +1 -1
  86. package/dist/cjs/helpers/ScrollLoadVideo.js.map +2 -2
  87. package/dist/cjs/shared/Styles.d.ts +2 -1
  88. package/dist/cjs/shared/Styles.js +1 -1
  89. package/dist/cjs/shared/Styles.js.map +2 -2
  90. package/dist/esm/biz-components/AccordionCards/index.d.ts +36 -1
  91. package/dist/esm/biz-components/ActivitySchedule/index.d.ts +3 -1
  92. package/dist/esm/biz-components/AiuiProvider/index.d.ts +13 -1
  93. package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
  94. package/dist/esm/biz-components/AiuiProvider/index.js.map +3 -3
  95. package/dist/esm/biz-components/AiuiProvider/useAutoTracking.d.ts +17 -0
  96. package/dist/esm/biz-components/AiuiProvider/useAutoTracking.js +2 -0
  97. package/dist/esm/biz-components/AiuiProvider/useAutoTracking.js.map +7 -0
  98. package/dist/esm/biz-components/AnchorNavigation/index.d.ts +2 -7
  99. package/dist/esm/biz-components/AnchorNavigation/index.js +1 -1
  100. package/dist/esm/biz-components/AnchorNavigation/index.js.map +3 -3
  101. package/dist/esm/biz-components/AplusDesc/index.d.ts +17 -1
  102. package/dist/esm/biz-components/BrandCardLink/BrandCardLink.d.ts +2 -1
  103. package/dist/esm/biz-components/BrandEquity/BrandEquity.d.ts +2 -1
  104. package/dist/esm/biz-components/Category/index.d.ts +1 -1
  105. package/dist/esm/biz-components/CreativeModule/index.d.ts +7 -1
  106. package/dist/esm/biz-components/DownLoad/index.d.ts +6 -1
  107. package/dist/esm/biz-components/Evaluate/index.d.ts +1 -1
  108. package/dist/esm/biz-components/Faq/Faq.d.ts +3 -2
  109. package/dist/esm/biz-components/FeatureCards/FeatureCards.d.ts +3 -1
  110. package/dist/esm/biz-components/FeatureShowcase/FeatureShowcase.d.ts +3 -1
  111. package/dist/esm/biz-components/Features/index.d.ts +8 -1
  112. package/dist/esm/biz-components/FootCharger/index.d.ts +7 -1
  113. package/dist/esm/biz-components/FooterNavigation/index.d.ts +2 -1
  114. package/dist/esm/biz-components/GiftBox/index.d.ts +3 -1
  115. package/dist/esm/biz-components/GiftShelf/index.d.ts +3 -1
  116. package/dist/esm/biz-components/GiftTierShelf/index.d.ts +3 -1
  117. package/dist/esm/biz-components/Graphic/index.d.ts +1 -1
  118. package/dist/esm/biz-components/GraphicAttractionBlock/index.d.ts +1 -1
  119. package/dist/esm/biz-components/GraphicMore/index.d.ts +7 -1
  120. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.d.ts +10 -2
  121. package/dist/esm/biz-components/HeaderNavigation/index.d.ts +3 -1
  122. package/dist/esm/biz-components/HeroBanner/HeroBanner.d.ts +5 -1
  123. package/dist/esm/biz-components/ImageTextFeature/ImageTextFeature.d.ts +3 -1
  124. package/dist/esm/biz-components/ImageWithText/ImageWithText.d.ts +3 -1
  125. package/dist/esm/biz-components/Ksp/index.d.ts +1 -1
  126. package/dist/esm/biz-components/Listing/components/PaidShipping/index.d.ts +11 -1
  127. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +26 -1
  128. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +1 -1
  129. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +1 -1
  130. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +1 -1
  131. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +1 -1
  132. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +1 -1
  133. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +1 -1
  134. package/dist/esm/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.d.ts +11 -1
  135. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +1 -1
  136. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.d.ts +2 -1
  137. package/dist/esm/biz-components/Marquee/Marquee.d.ts +3 -2
  138. package/dist/esm/biz-components/MarqueeReview/index.d.ts +1 -1
  139. package/dist/esm/biz-components/MediaEndorsement/index.d.ts +2 -1
  140. package/dist/esm/biz-components/MediaPlayerBase/index.d.ts +2 -1
  141. package/dist/esm/biz-components/MediaPlayerBase/index.js +1 -1
  142. package/dist/esm/biz-components/MediaPlayerBase/index.js.map +2 -2
  143. package/dist/esm/biz-components/MediaPlayerMulti/index.d.ts +2 -1
  144. package/dist/esm/biz-components/MediaPlayerSticky/index.d.ts +5 -1
  145. package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.d.ts +2 -1
  146. package/dist/esm/biz-components/MediaSceneSwitcherV2/index.d.ts +1 -1
  147. package/dist/esm/biz-components/MemberEquity/index.d.ts +3 -1
  148. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +17 -2
  149. package/dist/esm/biz-components/NavigationSearch/index.d.ts +2 -2
  150. package/dist/esm/biz-components/NavigationSearch/index.js +2 -2
  151. package/dist/esm/biz-components/NavigationSearch/index.js.map +3 -3
  152. package/dist/esm/biz-components/ProductCompare/index.d.ts +1 -1
  153. package/dist/esm/biz-components/ProductHero/ProductHero.d.ts +3 -1
  154. package/dist/esm/biz-components/ProductNav/ProductNav.d.ts +2 -1
  155. package/dist/esm/biz-components/PromotionalBar/index.d.ts +1 -1
  156. package/dist/esm/biz-components/SecondaryBanner/index.d.ts +2 -7
  157. package/dist/esm/biz-components/SecondaryBanner/index.js +1 -1
  158. package/dist/esm/biz-components/SecondaryBanner/index.js.map +3 -3
  159. package/dist/esm/biz-components/SelectStore/index.d.ts +7 -1
  160. package/dist/esm/biz-components/ShelfDisplay/index.d.ts +3 -1
  161. package/dist/esm/biz-components/Slogan/index.d.ts +3 -1
  162. package/dist/esm/biz-components/Spacer/index.d.ts +3 -1
  163. package/dist/esm/biz-components/Specs/index.d.ts +1 -1
  164. package/dist/esm/biz-components/SpecsComparison/SpecsComparison.d.ts +3 -1
  165. package/dist/esm/biz-components/TabWithImage/TabWithImage.d.ts +3 -1
  166. package/dist/esm/biz-components/Tabs/Tabs.d.ts +3 -1
  167. package/dist/esm/biz-components/TabsGroup/index.d.ts +3 -1
  168. package/dist/esm/biz-components/TabsWithMedia/TabsWithMedia.d.ts +3 -1
  169. package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.d.ts +3 -1
  170. package/dist/esm/biz-components/Title/index.d.ts +1 -1
  171. package/dist/esm/biz-components/VideoFeature/VideoFeature.d.ts +3 -1
  172. package/dist/esm/biz-components/WheelLottery/index.d.ts +1 -1
  173. package/dist/esm/biz-components/WhyChoose/WhyChoose.d.ts +3 -2
  174. package/dist/esm/helpers/ScrollLoadVideo.js +1 -1
  175. package/dist/esm/helpers/ScrollLoadVideo.js.map +2 -2
  176. package/dist/esm/shared/Styles.d.ts +2 -1
  177. package/dist/esm/shared/Styles.js +1 -1
  178. package/dist/esm/shared/Styles.js.map +2 -2
  179. package/package.json +1 -1
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/biz-components/AiuiProvider/useAutoTracking.ts"],
4
+ "sourcesContent": ["import { useEffect, useRef } from 'react'\nimport { gaTrack } from '../../shared/track.js'\n\n/**\n * \u81EA\u52A8\u70B9\u51FB\u57CB\u70B9 Hook\n *\n * \u901A\u8FC7\u4E8B\u4EF6\u59D4\u6258\u76D1\u542C\u6240\u6709\u5E26\u6709 `data-headless-type-name` \u5C5E\u6027\u7684\u5143\u7D20\u70B9\u51FB\u4E8B\u4EF6\n *\n * @param trackingData - \u57CB\u70B9\u6570\u636E\u5BF9\u8C61\uFF0C\u5305\u542B pageGroup \u7B49\u5B57\u6BB5\n * @param enabled - \u662F\u5426\u542F\u7528\u81EA\u52A8\u57CB\u70B9\uFF0C\u9ED8\u8BA4\u4E3A true\n *\n * @example\n * ```tsx\n * function App() {\n * useAutoTracking({ pageGroup: 'Home Page' }, true)\n * return <div>...</div>\n * }\n * ```\n */\nexport function useAutoTracking(trackingData: Record<string, any>, enabled: boolean = true) {\n // \u4F7F\u7528 ref \u4FDD\u5B58\u6700\u65B0\u7684 trackingData\uFF0C\u907F\u514D\u95ED\u5305\u9648\u65E7\n const trackingDataRef = useRef(trackingData)\n\n useEffect(() => {\n trackingDataRef.current = trackingData\n }, [trackingData])\n\n useEffect(() => {\n // \u5982\u679C\u5173\u95ED\u4E86\u81EA\u52A8\u57CB\u70B9\uFF0C\u76F4\u63A5\u8FD4\u56DE\n if (!enabled) return\n\n // SSR \u73AF\u5883\u68C0\u6D4B\n if (typeof window === 'undefined') return\n\n // \u5168\u5C40\u6807\u8BB0\uFF1A\u9632\u6B62\u591A\u4E2A Provider \u5B9E\u4F8B\u91CD\u590D\u7ED1\u5B9A\n const TRACKING_KEY = '__headless_ui_tracking_bound__'\n if ((window as any)[TRACKING_KEY]) return\n\n /**\n * \u4E8B\u4EF6\u59D4\u6258\u5904\u7406\u51FD\u6570\n * \u70B9\u51FB\u4E8B\u4EF6\u5192\u6CE1\u5230 document\uFF0C\u68C0\u6D4B\u662F\u5426\u70B9\u51FB\u4E86\u8FFD\u8E2A\u5143\u7D20\n */\n const handleClick = (e: MouseEvent) => {\n const target = e.target as Element\n const el = target.closest('[data-headless-type-name]')\n if (!el) return\n\n // \u63D0\u53D6 data-headless-* \u5C5E\u6027\n const out: Record<string, string> = {}\n for (const attr of Array.from(el.attributes)) {\n const name = (attr as Attr)?.name\n if (name?.startsWith('data-headless-')) {\n out[name] = el.getAttribute(name) || ''\n }\n }\n\n // \u89E3\u6790\u8FFD\u8E2A\u6570\u636E\n const sku = out['data-headless-sku']\n const nameType = out['data-headless-type-name']?.split?.('#')\n const titleDesc = out['data-headless-title-desc-button']?.split?.('#')\n const navPosition = out['data-headless-nav-position']?.split?.('#')\n\n // \u53D1\u9001 GA \u57CB\u70B9\u4E8B\u4EF6\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: trackingDataRef.current?.pageGroup || 'Home Page',\n component_type: nameType?.[0] || '',\n component_name: nameType?.[1] || '',\n position: navPosition?.[1] || '',\n navigation: navPosition?.[0] || '',\n button_name: titleDesc?.[2] || '',\n SKU: sku || '',\n component_title: titleDesc?.[0] || '',\n component_description: titleDesc?.[1] || '',\n },\n })\n }\n\n // \u7ED1\u5B9A\u5168\u5C40\u70B9\u51FB\u4E8B\u4EF6\n document.addEventListener('click', handleClick)\n ;(window as any)[TRACKING_KEY] = true\n\n // \u6E05\u7406\u51FD\u6570\n return () => {\n document.removeEventListener('click', handleClick)\n delete (window as any)[TRACKING_KEY]\n }\n }, [enabled])\n}\n"],
5
+ "mappings": "AAAA,OAAS,aAAAA,EAAW,UAAAC,MAAc,QAClC,OAAS,WAAAC,MAAe,wBAkBjB,SAASC,EAAgBC,EAAmCC,EAAmB,GAAM,CAE1F,MAAMC,EAAkBL,EAAOG,CAAY,EAE3CJ,EAAU,IAAM,CACdM,EAAgB,QAAUF,CAC5B,EAAG,CAACA,CAAY,CAAC,EAEjBJ,EAAU,IAAM,CAKd,GAHI,CAACK,GAGD,OAAO,OAAW,IAAa,OAGnC,MAAME,EAAe,iCACrB,GAAK,OAAeA,CAAY,EAAG,OAMnC,MAAMC,EAAeC,GAAkB,CAErC,MAAMC,EADSD,EAAE,OACC,QAAQ,2BAA2B,EACrD,GAAI,CAACC,EAAI,OAGT,MAAMC,EAA8B,CAAC,EACrC,UAAWC,KAAQ,MAAM,KAAKF,EAAG,UAAU,EAAG,CAC5C,MAAMG,EAAQD,GAAe,KACzBC,GAAM,WAAW,gBAAgB,IACnCF,EAAIE,CAAI,EAAIH,EAAG,aAAaG,CAAI,GAAK,GAEzC,CAGA,MAAMC,EAAMH,EAAI,mBAAmB,EAC7BI,EAAWJ,EAAI,yBAAyB,GAAG,QAAQ,GAAG,EACtDK,EAAYL,EAAI,iCAAiC,GAAG,QAAQ,GAAG,EAC/DM,EAAcN,EAAI,4BAA4B,GAAG,QAAQ,GAAG,EAGlET,EAAQ,CACN,MAAO,WACP,WAAY,kBACZ,iBAAkB,CAChB,WAAYI,EAAgB,SAAS,WAAa,YAClD,eAAgBS,IAAW,CAAC,GAAK,GACjC,eAAgBA,IAAW,CAAC,GAAK,GACjC,SAAUE,IAAc,CAAC,GAAK,GAC9B,WAAYA,IAAc,CAAC,GAAK,GAChC,YAAaD,IAAY,CAAC,GAAK,GAC/B,IAAKF,GAAO,GACZ,gBAAiBE,IAAY,CAAC,GAAK,GACnC,sBAAuBA,IAAY,CAAC,GAAK,EAC3C,CACF,CAAC,CACH,EAGA,gBAAS,iBAAiB,QAASR,CAAW,EAC5C,OAAeD,CAAY,EAAI,GAG1B,IAAM,CACX,SAAS,oBAAoB,QAASC,CAAW,EACjD,OAAQ,OAAeD,CAAY,CACrC,CACF,EAAG,CAACF,CAAO,CAAC,CACd",
6
+ "names": ["useEffect", "useRef", "gaTrack", "useAutoTracking", "trackingData", "enabled", "trackingDataRef", "TRACKING_KEY", "handleClick", "e", "el", "out", "attr", "name", "sku", "nameType", "titleDesc", "navPosition"]
7
+ }
@@ -60,10 +60,5 @@ export interface AnchorNavigationProps extends React.HTMLAttributes<HTMLDivEleme
60
60
  */
61
61
  buttonStyle?: AnchorButtonStyle;
62
62
  }
63
- /**
64
- * AnchorNavigation - 锚点导航
65
- *
66
- * @description 锚点导航
67
- */
68
- declare const AnchorNavigation: React.ForwardRefExoticComponent<AnchorNavigationProps & React.RefAttributes<HTMLDivElement>>;
69
- export default AnchorNavigation;
63
+ declare const _default: React.ForwardRefExoticComponent<AnchorNavigationProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
64
+ export default _default;
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as p}from"react/jsx-runtime";import*as n from"react";import{cn as g}from"../../helpers/utils.js";import{cva as h}from"class-variance-authority";import S from"./useAnchorPosition.js";import{Container as w}from"../../components/container.js";const D=h("anchor-navigation-content flex items-center overflow-x-auto [&::-webkit-scrollbar]:hidden",{variants:{alignment:{start:"tablet:justify-start",center:"tablet:justify-center",end:"tablet:justify-end"},size:{small:"gap-3",large:"gap-6"}},defaultVariants:{alignment:"start",size:"small"}}),E=h("anchor-navigation-item relative shrink-0 text-sm font-bold after:absolute after:bottom-0 after:left-0 after:h-1 after:w-0 after:opacity-0 after:transition-all after:duration-300",{variants:{size:{small:"py-3",large:"py-4"}},defaultVariants:{size:"small"}}),L=h("!sticky top-0 !z-40 w-full",{variants:{theme:{light:"bg-white",dark:"bg-[#1E2024]"}},defaultVariants:{theme:"light"}}),H={defaultColor:"text-[#4A4C56]",activeColor:"text-[#080A0F]",activeIndicatorColor:"after:bg-brand-0"},k={defaultColor:"text-[#8A8D92]",activeColor:"text-white",activeIndicatorColor:"after:bg-brand-0"},y=n.forwardRef(({classNames:l={},data:a,onItemClick:I,buttonStyle:s,className:B,...N},R)=>{const{alignment:x="start",theme:C="light",size:A="small"}=a,i=S(a.sectionIds?.map(t=>t.targetId)||[]),c=n.useRef(null),f=n.useRef(null),b=n.useRef([]);n.useImperativeHandle(R,()=>c.current);const d=C==="dark"?k:H,u={defaultColor:s?.defaultColor??d.defaultColor,activeColor:s?.activeColor??d.activeColor,activeIndicatorColor:s?.activeIndicatorColor??d.activeIndicatorColor},m=n.useCallback(t=>{const e=b.current[t];if(e&&f.current){const r=f.current,o=e,v=o.offsetLeft-r.offsetWidth/2+o.offsetWidth/2;typeof r.scrollTo=="function"&&r.scrollTo({left:v,behavior:"smooth"})}},[]);return n.useEffect(()=>{if(!i)return;const t=a.sectionIds?.findIndex(e=>e.targetId===i);t!==void 0&&t!==-1&&m(t)},[i,a.sectionIds,m]),p(w,{ref:c,className:g(L({theme:C}),l?.root),...N,children:p("div",{ref:f,className:g(D({alignment:x,size:A}),"relative",l?.content),children:a.sectionIds?.map((t,e)=>{const r=i===t.targetId;return p("button",{ref:o=>{o&&(b.current[e]=o)},"aria-current":r?!0:void 0,onClick:()=>{if(m(e),I){I(t,e);return}const o=document.getElementById(t.targetId);if(o&&c.current){const v=c.current.offsetHeight,T=o.getBoundingClientRect().top+window.scrollY-v;window.scrollTo({top:T,behavior:"smooth"})}},className:g(E({size:A}),r?[u.activeColor,u.activeIndicatorColor,"after:w-full after:opacity-100"]:u.defaultColor,l?.item),children:t.label},t.targetId)})})})});y.displayName="AnchorNavigation";var q=y;export{q as default};
1
+ "use client";import{jsx as p}from"react/jsx-runtime";import*as r from"react";import{cn as g}from"../../helpers/utils.js";import{cva as h}from"class-variance-authority";import w from"./useAnchorPosition.js";import{Container as L}from"../../components/container.js";import{withLayout as S}from"../../shared/Styles.js";const D=h("anchor-navigation-content flex items-center overflow-x-auto [&::-webkit-scrollbar]:hidden",{variants:{alignment:{start:"tablet:justify-start",center:"tablet:justify-center",end:"tablet:justify-end"},size:{small:"gap-3",large:"gap-6"}},defaultVariants:{alignment:"start",size:"small"}}),E=h("anchor-navigation-item relative shrink-0 text-sm font-bold after:absolute after:bottom-0 after:left-0 after:h-1 after:w-0 after:opacity-0 after:transition-all after:duration-300",{variants:{size:{small:"py-3",large:"py-4"}},defaultVariants:{size:"small"}}),H=h("!sticky top-0 !z-40 w-full",{variants:{theme:{light:"bg-white",dark:"bg-[#1E2024]"}},defaultVariants:{theme:"light"}}),k={defaultColor:"text-[#4A4C56]",activeColor:"text-[#080A0F]",activeIndicatorColor:"after:bg-brand-0"},B={defaultColor:"text-[#8A8D92]",activeColor:"text-white",activeIndicatorColor:"after:bg-brand-0"},y=r.forwardRef(({classNames:l={},data:a,onItemClick:I,buttonStyle:s,className:V,...N},R)=>{const{alignment:x="start",theme:C="light",size:A="small"}=a,i=w(a.sectionIds?.map(t=>t.targetId)||[]),c=r.useRef(null),f=r.useRef(null),b=r.useRef([]);r.useImperativeHandle(R,()=>c.current);const u=C==="dark"?B:k,d={defaultColor:s?.defaultColor??u.defaultColor,activeColor:s?.activeColor??u.activeColor,activeIndicatorColor:s?.activeIndicatorColor??u.activeIndicatorColor},m=r.useCallback(t=>{const e=b.current[t];if(e&&f.current){const n=f.current,o=e,v=o.offsetLeft-n.offsetWidth/2+o.offsetWidth/2;typeof n.scrollTo=="function"&&n.scrollTo({left:v,behavior:"smooth"})}},[]);return r.useEffect(()=>{if(!i)return;const t=a.sectionIds?.findIndex(e=>e.targetId===i);t!==void 0&&t!==-1&&m(t)},[i,a.sectionIds,m]),p(L,{ref:c,className:g(H({theme:C}),l?.root),...N,children:p("div",{ref:f,className:g(D({alignment:x,size:A}),"relative",l?.content),children:a.sectionIds?.map((t,e)=>{const n=i===t.targetId;return p("button",{ref:o=>{o&&(b.current[e]=o)},"aria-current":n?!0:void 0,onClick:()=>{if(m(e),I){I(t,e);return}const o=document.getElementById(t.targetId);if(o&&c.current){const v=c.current.offsetHeight,T=o.getBoundingClientRect().top+window.scrollY-v;window.scrollTo({top:T,behavior:"smooth"})}},className:g(E({size:A}),n?[d.activeColor,d.activeIndicatorColor,"after:w-full after:opacity-100"]:d.defaultColor,l?.item),children:t.label},t.targetId)})})})});y.displayName="AnchorNavigation";var j=S(y);export{j as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/AnchorNavigation/index.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport useAnchorPosition from './useAnchorPosition.js'\nimport { Container } from '../../components/container.js'\n\nexport interface AnchorNavigationSemanticName {\n root: 'root'\n content: 'content'\n item: 'item'\n}\n\n/**\n * \u5BFC\u822A\u9879\u5BF9\u9F50\u65B9\u5411\u6837\u5F0F\u53D8\u4F53\n */\nconst anchorNavigationVariants = cva(\n 'anchor-navigation-content flex items-center overflow-x-auto [&::-webkit-scrollbar]:hidden',\n {\n variants: {\n alignment: {\n start: 'tablet:justify-start',\n center: 'tablet:justify-center',\n end: 'tablet:justify-end',\n },\n size: {\n small: 'gap-3',\n large: 'gap-6',\n },\n },\n defaultVariants: {\n alignment: 'start',\n size: 'small',\n },\n }\n)\n\n/**\n * \u5BFC\u822A\u9879\u6837\u5F0F\u53D8\u4F53\uFF08\u4E0D\u542B\u989C\u8272\uFF0C\u989C\u8272\u7531 buttonStyle \u63A7\u5236\uFF09\n */\nconst anchorItemVariants = cva(\n 'anchor-navigation-item relative shrink-0 text-sm font-bold after:absolute after:bottom-0 after:left-0 after:h-1 after:w-0 after:opacity-0 after:transition-all after:duration-300',\n {\n variants: {\n size: {\n small: 'py-3',\n large: 'py-4',\n },\n },\n defaultVariants: {\n size: 'small',\n },\n }\n)\n\n/**\n * \u5BB9\u5668\u4E3B\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst containerVariants = cva('!sticky top-0 !z-40 w-full', {\n variants: {\n theme: {\n light: 'bg-white',\n dark: 'bg-[#1E2024]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n})\n\n/**\n * \u6309\u94AE\u989C\u8272\u914D\u7F6E\uFF0C\u5141\u8BB8\u6309 theme \u5206\u522B\u8986\u76D6\u9ED8\u8BA4\u8272\u3001\u6FC0\u6D3B\u6587\u5B57\u8272\u3001\u6FC0\u6D3B\u6307\u793A\u5668\u8272\n */\nexport interface AnchorButtonStyle {\n /** \u9ED8\u8BA4\uFF08\u672A\u6FC0\u6D3B\uFF09\u6587\u5B57\u8272\uFF0CTailwind class\uFF0C\u5982 'text-info-secondary' */\n defaultColor?: string\n /** \u6FC0\u6D3B\u6587\u5B57\u8272\uFF0CTailwind class\uFF0C\u5982 'text-info-primary' */\n activeColor?: string\n /** \u6FC0\u6D3B\u6307\u793A\u5668\uFF08\u4E0B\u5212\u7EBF\uFF09\u80CC\u666F\u8272\uFF0CTailwind class\uFF0C\u5982 'after:bg-brand-0' */\n activeIndicatorColor?: string\n}\n\n/**\n * \u951A\u70B9\u9879\u63A5\u53E3\n */\nexport interface AnchorSectionItem {\n targetId: string\n label: string\n}\n\n/**\n * AnchorNavigation \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface AnchorNavigationData {\n /** \u951A\u70B9\u5217\u8868 */\n sectionIds: AnchorSectionItem[]\n /** \u5BFC\u822A\u9879\u6C34\u5E73\u5BF9\u9F50\u65B9\u5F0F */\n alignment?: 'start' | 'center' | 'end'\n /** \u4E3B\u9898\u6A21\u5F0F */\n theme?: 'light' | 'dark'\n /** \u5BFC\u822A\u5927\u5C0F */\n size?: 'small' | 'large'\n}\n\nexport interface AnchorNavigationProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof anchorNavigationVariants> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: AnchorNavigationData\n /** \u8BED\u4E49\u5316\u7C7B\u540D */\n classNames?: Partial<Record<keyof AnchorNavigationSemanticName, string>>\n /** \u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6\uFF0C\u4F20\u5165\u65F6\u4F1A\u66FF\u4EE3\u9ED8\u8BA4\u7684\u6EDA\u52A8\u884C\u4E3A */\n onItemClick?: (item: AnchorSectionItem, index: number) => void\n /**\n * \u6309\u94AE\u989C\u8272\u914D\u7F6E\uFF0C\u8986\u76D6 light/dark \u4E3B\u9898\u4E0B\u7684\u9ED8\u8BA4\u989C\u8272\u3002\n * \u672A\u4F20\u65F6\u6309\u4E3B\u9898\u4F7F\u7528\u5185\u7F6E\u9ED8\u8BA4\u503C\u3002\n *\n * @example\n * // \u81EA\u5B9A\u4E49\u989C\u8272\n * buttonStyle={{ defaultColor: 'text-info-secondary', activeColor: 'text-info-primary', activeIndicatorColor: 'after:bg-brand-3' }}\n */\n buttonStyle?: AnchorButtonStyle\n}\n\n/** light \u4E3B\u9898\u9ED8\u8BA4\u989C\u8272 */\nconst LIGHT_DEFAULTS: Required<AnchorButtonStyle> = {\n defaultColor: 'text-[#4A4C56]',\n activeColor: 'text-[#080A0F]',\n activeIndicatorColor: 'after:bg-brand-0',\n}\n\n/** dark \u4E3B\u9898\u9ED8\u8BA4\u989C\u8272 */\nconst DARK_DEFAULTS: Required<AnchorButtonStyle> = {\n defaultColor: 'text-[#8A8D92]',\n activeColor: 'text-white',\n activeIndicatorColor: 'after:bg-brand-0',\n}\n\n/**\n * AnchorNavigation - \u951A\u70B9\u5BFC\u822A\n *\n * @description \u951A\u70B9\u5BFC\u822A\n */\nconst AnchorNavigation = React.forwardRef<HTMLDivElement, AnchorNavigationProps>(\n ({ classNames = {}, data, onItemClick, buttonStyle, className, ...rest }, ref) => {\n const { alignment = 'start', theme = 'light', size = 'small' } = data\n const activeId = useAnchorPosition(data.sectionIds?.map(item => item.targetId) || [])\n const rootRef = React.useRef<HTMLDivElement>(null)\n const containerRef = React.useRef<HTMLDivElement>(null)\n const sectionRefs = React.useRef<HTMLButtonElement[]>([])\n\n // \u66B4\u9732 rootRef \u7ED9\u5916\u90E8 ref\n React.useImperativeHandle(ref, () => rootRef.current as HTMLDivElement)\n\n // \u5408\u5E76\u4E3B\u9898\u9ED8\u8BA4\u503C\u4E0E\u5916\u90E8\u4F20\u5165\u7684 buttonStyle\n const themeDefaults = theme === 'dark' ? DARK_DEFAULTS : LIGHT_DEFAULTS\n const resolvedButtonStyle: Required<AnchorButtonStyle> = {\n defaultColor: buttonStyle?.defaultColor ?? themeDefaults.defaultColor,\n activeColor: buttonStyle?.activeColor ?? themeDefaults.activeColor,\n activeIndicatorColor: buttonStyle?.activeIndicatorColor ?? themeDefaults.activeIndicatorColor,\n }\n\n const autoScrollToActiveItem = React.useCallback((activeIdIndex: number) => {\n const curRef = sectionRefs.current[activeIdIndex]\n\n if (curRef && containerRef.current) {\n const container = containerRef.current\n const button = curRef\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n\n // \u68C0\u67E5 scrollTo \u65B9\u6CD5\u662F\u5426\u5B58\u5728\uFF08\u517C\u5BB9\u6D4B\u8BD5\u73AF\u5883\u548C\u65E7\u6D4F\u89C8\u5668\uFF09\n if (typeof container.scrollTo === 'function') {\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }\n }, [])\n\n // \u5F53\u5C4F\u5E55\u6EDA\u52A8\u5BFC\u81F4 activeId \u53D8\u5316\u65F6\uFF0C\u81EA\u52A8\u6EDA\u52A8\u5BFC\u822A\u680F\u5230\u5BF9\u5E94\u9879\n React.useEffect(() => {\n if (!activeId) return\n\n const activeIndex = data.sectionIds?.findIndex(item => item.targetId === activeId)\n if (activeIndex !== undefined && activeIndex !== -1) {\n autoScrollToActiveItem(activeIndex)\n }\n }, [activeId, data.sectionIds, autoScrollToActiveItem])\n\n return (\n <Container ref={rootRef} className={cn(containerVariants({ theme }), classNames?.root)} {...rest}>\n <div\n ref={containerRef}\n className={cn(anchorNavigationVariants({ alignment, size }), 'relative', classNames?.content)}\n >\n {data.sectionIds?.map((item, index) => {\n const isActive = activeId === item.targetId\n\n return (\n <button\n key={item.targetId}\n ref={el => {\n if (el) {\n sectionRefs.current[index] = el\n }\n }}\n aria-current={isActive ? true : undefined}\n onClick={() => {\n // \u9ED8\u8BA4\u884C\u4E3A\uFF1A\u6EDA\u52A8\u5230\u5BF9\u5E94\u951A\u70B9\n autoScrollToActiveItem(index)\n\n // \u5982\u679C\u6709\u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6\uFF0C\u4F7F\u7528\u81EA\u5B9A\u4E49\u4E8B\u4EF6\n if (onItemClick) {\n onItemClick(item, index)\n return\n }\n\n // \u624B\u52A8\u8BA1\u7B97\u6EDA\u52A8\u4F4D\u7F6E\uFF0C\u8003\u8651\u5BFC\u822A\u680F\u9AD8\u5EA6\n const targetElement = document.getElementById(item.targetId)\n if (targetElement && rootRef.current) {\n const navHeight = rootRef.current.offsetHeight\n const targetPosition = targetElement.getBoundingClientRect().top + window.scrollY - navHeight\n\n window.scrollTo({\n top: targetPosition,\n behavior: 'smooth',\n })\n }\n }}\n className={cn(\n anchorItemVariants({ size }),\n isActive\n ? [\n resolvedButtonStyle.activeColor,\n resolvedButtonStyle.activeIndicatorColor,\n 'after:w-full after:opacity-100',\n ]\n : resolvedButtonStyle.defaultColor,\n classNames?.item\n )}\n >\n {item.label}\n </button>\n )\n })}\n </div>\n </Container>\n )\n }\n)\n\nAnchorNavigation.displayName = 'AnchorNavigation'\nexport default AnchorNavigation\n"],
5
- "mappings": "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",
6
- "names": ["jsx", "React", "cn", "cva", "useAnchorPosition", "Container", "anchorNavigationVariants", "anchorItemVariants", "containerVariants", "LIGHT_DEFAULTS", "DARK_DEFAULTS", "AnchorNavigation", "classNames", "data", "onItemClick", "buttonStyle", "className", "rest", "ref", "alignment", "theme", "size", "activeId", "item", "rootRef", "containerRef", "sectionRefs", "themeDefaults", "resolvedButtonStyle", "autoScrollToActiveItem", "activeIdIndex", "curRef", "container", "button", "scrollLeft", "activeIndex", "index", "isActive", "el", "targetElement", "navHeight", "targetPosition", "AnchorNavigation_default"]
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/utils.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport useAnchorPosition from './useAnchorPosition.js'\nimport { Container } from '../../components/container.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nexport interface AnchorNavigationSemanticName {\n root: 'root'\n content: 'content'\n item: 'item'\n}\n\n/**\n * \u5BFC\u822A\u9879\u5BF9\u9F50\u65B9\u5411\u6837\u5F0F\u53D8\u4F53\n */\nconst anchorNavigationVariants = cva(\n 'anchor-navigation-content flex items-center overflow-x-auto [&::-webkit-scrollbar]:hidden',\n {\n variants: {\n alignment: {\n start: 'tablet:justify-start',\n center: 'tablet:justify-center',\n end: 'tablet:justify-end',\n },\n size: {\n small: 'gap-3',\n large: 'gap-6',\n },\n },\n defaultVariants: {\n alignment: 'start',\n size: 'small',\n },\n }\n)\n\n/**\n * \u5BFC\u822A\u9879\u6837\u5F0F\u53D8\u4F53\uFF08\u4E0D\u542B\u989C\u8272\uFF0C\u989C\u8272\u7531 buttonStyle \u63A7\u5236\uFF09\n */\nconst anchorItemVariants = cva(\n 'anchor-navigation-item relative shrink-0 text-sm font-bold after:absolute after:bottom-0 after:left-0 after:h-1 after:w-0 after:opacity-0 after:transition-all after:duration-300',\n {\n variants: {\n size: {\n small: 'py-3',\n large: 'py-4',\n },\n },\n defaultVariants: {\n size: 'small',\n },\n }\n)\n\n/**\n * \u5BB9\u5668\u4E3B\u9898\u6837\u5F0F\u53D8\u4F53\n */\nconst containerVariants = cva('!sticky top-0 !z-40 w-full', {\n variants: {\n theme: {\n light: 'bg-white',\n dark: 'bg-[#1E2024]',\n },\n },\n defaultVariants: {\n theme: 'light',\n },\n})\n\n/**\n * \u6309\u94AE\u989C\u8272\u914D\u7F6E\uFF0C\u5141\u8BB8\u6309 theme \u5206\u522B\u8986\u76D6\u9ED8\u8BA4\u8272\u3001\u6FC0\u6D3B\u6587\u5B57\u8272\u3001\u6FC0\u6D3B\u6307\u793A\u5668\u8272\n */\nexport interface AnchorButtonStyle {\n /** \u9ED8\u8BA4\uFF08\u672A\u6FC0\u6D3B\uFF09\u6587\u5B57\u8272\uFF0CTailwind class\uFF0C\u5982 'text-info-secondary' */\n defaultColor?: string\n /** \u6FC0\u6D3B\u6587\u5B57\u8272\uFF0CTailwind class\uFF0C\u5982 'text-info-primary' */\n activeColor?: string\n /** \u6FC0\u6D3B\u6307\u793A\u5668\uFF08\u4E0B\u5212\u7EBF\uFF09\u80CC\u666F\u8272\uFF0CTailwind class\uFF0C\u5982 'after:bg-brand-0' */\n activeIndicatorColor?: string\n}\n\n/**\n * \u951A\u70B9\u9879\u63A5\u53E3\n */\nexport interface AnchorSectionItem {\n targetId: string\n label: string\n}\n\n/**\n * AnchorNavigation \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface AnchorNavigationData {\n /** \u951A\u70B9\u5217\u8868 */\n sectionIds: AnchorSectionItem[]\n /** \u5BFC\u822A\u9879\u6C34\u5E73\u5BF9\u9F50\u65B9\u5F0F */\n alignment?: 'start' | 'center' | 'end'\n /** \u4E3B\u9898\u6A21\u5F0F */\n theme?: 'light' | 'dark'\n /** \u5BFC\u822A\u5927\u5C0F */\n size?: 'small' | 'large'\n}\n\nexport interface AnchorNavigationProps\n extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof anchorNavigationVariants> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: AnchorNavigationData\n /** \u8BED\u4E49\u5316\u7C7B\u540D */\n classNames?: Partial<Record<keyof AnchorNavigationSemanticName, string>>\n /** \u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6\uFF0C\u4F20\u5165\u65F6\u4F1A\u66FF\u4EE3\u9ED8\u8BA4\u7684\u6EDA\u52A8\u884C\u4E3A */\n onItemClick?: (item: AnchorSectionItem, index: number) => void\n /**\n * \u6309\u94AE\u989C\u8272\u914D\u7F6E\uFF0C\u8986\u76D6 light/dark \u4E3B\u9898\u4E0B\u7684\u9ED8\u8BA4\u989C\u8272\u3002\n * \u672A\u4F20\u65F6\u6309\u4E3B\u9898\u4F7F\u7528\u5185\u7F6E\u9ED8\u8BA4\u503C\u3002\n *\n * @example\n * // \u81EA\u5B9A\u4E49\u989C\u8272\n * buttonStyle={{ defaultColor: 'text-info-secondary', activeColor: 'text-info-primary', activeIndicatorColor: 'after:bg-brand-3' }}\n */\n buttonStyle?: AnchorButtonStyle\n}\n\n/** light \u4E3B\u9898\u9ED8\u8BA4\u989C\u8272 */\nconst LIGHT_DEFAULTS: Required<AnchorButtonStyle> = {\n defaultColor: 'text-[#4A4C56]',\n activeColor: 'text-[#080A0F]',\n activeIndicatorColor: 'after:bg-brand-0',\n}\n\n/** dark \u4E3B\u9898\u9ED8\u8BA4\u989C\u8272 */\nconst DARK_DEFAULTS: Required<AnchorButtonStyle> = {\n defaultColor: 'text-[#8A8D92]',\n activeColor: 'text-white',\n activeIndicatorColor: 'after:bg-brand-0',\n}\n\n/**\n * AnchorNavigation - \u951A\u70B9\u5BFC\u822A\n *\n * @description \u951A\u70B9\u5BFC\u822A\n */\nconst AnchorNavigation = React.forwardRef<HTMLDivElement, AnchorNavigationProps>(\n ({ classNames = {}, data, onItemClick, buttonStyle, className, ...rest }, ref) => {\n const { alignment = 'start', theme = 'light', size = 'small' } = data\n const activeId = useAnchorPosition(data.sectionIds?.map(item => item.targetId) || [])\n const rootRef = React.useRef<HTMLDivElement>(null)\n const containerRef = React.useRef<HTMLDivElement>(null)\n const sectionRefs = React.useRef<HTMLButtonElement[]>([])\n\n // \u66B4\u9732 rootRef \u7ED9\u5916\u90E8 ref\n React.useImperativeHandle(ref, () => rootRef.current as HTMLDivElement)\n\n // \u5408\u5E76\u4E3B\u9898\u9ED8\u8BA4\u503C\u4E0E\u5916\u90E8\u4F20\u5165\u7684 buttonStyle\n const themeDefaults = theme === 'dark' ? DARK_DEFAULTS : LIGHT_DEFAULTS\n const resolvedButtonStyle: Required<AnchorButtonStyle> = {\n defaultColor: buttonStyle?.defaultColor ?? themeDefaults.defaultColor,\n activeColor: buttonStyle?.activeColor ?? themeDefaults.activeColor,\n activeIndicatorColor: buttonStyle?.activeIndicatorColor ?? themeDefaults.activeIndicatorColor,\n }\n\n const autoScrollToActiveItem = React.useCallback((activeIdIndex: number) => {\n const curRef = sectionRefs.current[activeIdIndex]\n\n if (curRef && containerRef.current) {\n const container = containerRef.current\n const button = curRef\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n\n // \u68C0\u67E5 scrollTo \u65B9\u6CD5\u662F\u5426\u5B58\u5728\uFF08\u517C\u5BB9\u6D4B\u8BD5\u73AF\u5883\u548C\u65E7\u6D4F\u89C8\u5668\uFF09\n if (typeof container.scrollTo === 'function') {\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }\n }, [])\n\n // \u5F53\u5C4F\u5E55\u6EDA\u52A8\u5BFC\u81F4 activeId \u53D8\u5316\u65F6\uFF0C\u81EA\u52A8\u6EDA\u52A8\u5BFC\u822A\u680F\u5230\u5BF9\u5E94\u9879\n React.useEffect(() => {\n if (!activeId) return\n\n const activeIndex = data.sectionIds?.findIndex(item => item.targetId === activeId)\n if (activeIndex !== undefined && activeIndex !== -1) {\n autoScrollToActiveItem(activeIndex)\n }\n }, [activeId, data.sectionIds, autoScrollToActiveItem])\n\n return (\n <Container ref={rootRef} className={cn(containerVariants({ theme }), classNames?.root)} {...rest}>\n <div\n ref={containerRef}\n className={cn(anchorNavigationVariants({ alignment, size }), 'relative', classNames?.content)}\n >\n {data.sectionIds?.map((item, index) => {\n const isActive = activeId === item.targetId\n\n return (\n <button\n key={item.targetId}\n ref={el => {\n if (el) {\n sectionRefs.current[index] = el\n }\n }}\n aria-current={isActive ? true : undefined}\n onClick={() => {\n // \u9ED8\u8BA4\u884C\u4E3A\uFF1A\u6EDA\u52A8\u5230\u5BF9\u5E94\u951A\u70B9\n autoScrollToActiveItem(index)\n\n // \u5982\u679C\u6709\u81EA\u5B9A\u4E49\u70B9\u51FB\u4E8B\u4EF6\uFF0C\u4F7F\u7528\u81EA\u5B9A\u4E49\u4E8B\u4EF6\n if (onItemClick) {\n onItemClick(item, index)\n return\n }\n\n // \u624B\u52A8\u8BA1\u7B97\u6EDA\u52A8\u4F4D\u7F6E\uFF0C\u8003\u8651\u5BFC\u822A\u680F\u9AD8\u5EA6\n const targetElement = document.getElementById(item.targetId)\n if (targetElement && rootRef.current) {\n const navHeight = rootRef.current.offsetHeight\n const targetPosition = targetElement.getBoundingClientRect().top + window.scrollY - navHeight\n\n window.scrollTo({\n top: targetPosition,\n behavior: 'smooth',\n })\n }\n }}\n className={cn(\n anchorItemVariants({ size }),\n isActive\n ? [\n resolvedButtonStyle.activeColor,\n resolvedButtonStyle.activeIndicatorColor,\n 'after:w-full after:opacity-100',\n ]\n : resolvedButtonStyle.defaultColor,\n classNames?.item\n )}\n >\n {item.label}\n </button>\n )\n })}\n </div>\n </Container>\n )\n }\n)\n\nAnchorNavigation.displayName = 'AnchorNavigation'\nexport default withLayout(AnchorNavigation)\n"],
5
+ "mappings": "aAyMc,cAAAA,MAAA,oBAvMd,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,yBACnB,OAAS,OAAAC,MAA8B,2BACvC,OAAOC,MAAuB,yBAC9B,OAAS,aAAAC,MAAiB,gCAC1B,OAAS,cAAAC,MAAkB,yBAW3B,MAAMC,EAA2BJ,EAC/B,4FACA,CACE,SAAU,CACR,UAAW,CACT,MAAO,uBACP,OAAQ,wBACR,IAAK,oBACP,EACA,KAAM,CACJ,MAAO,QACP,MAAO,OACT,CACF,EACA,gBAAiB,CACf,UAAW,QACX,KAAM,OACR,CACF,CACF,EAKMK,EAAqBL,EACzB,oLACA,CACE,SAAU,CACR,KAAM,CACJ,MAAO,OACP,MAAO,MACT,CACF,EACA,gBAAiB,CACf,KAAM,OACR,CACF,CACF,EAKMM,EAAoBN,EAAI,6BAA8B,CAC1D,SAAU,CACR,MAAO,CACL,MAAO,WACP,KAAM,cACR,CACF,EACA,gBAAiB,CACf,MAAO,OACT,CACF,CAAC,EAwDKO,EAA8C,CAClD,aAAc,iBACd,YAAa,iBACb,qBAAsB,kBACxB,EAGMC,EAA6C,CACjD,aAAc,iBACd,YAAa,aACb,qBAAsB,kBACxB,EAOMC,EAAmBX,EAAM,WAC7B,CAAC,CAAE,WAAAY,EAAa,CAAC,EAAG,KAAAC,EAAM,YAAAC,EAAa,YAAAC,EAAa,UAAAC,EAAW,GAAGC,CAAK,EAAGC,IAAQ,CAChF,KAAM,CAAE,UAAAC,EAAY,QAAS,MAAAC,EAAQ,QAAS,KAAAC,EAAO,OAAQ,EAAIR,EAC3DS,EAAWnB,EAAkBU,EAAK,YAAY,IAAIU,GAAQA,EAAK,QAAQ,GAAK,CAAC,CAAC,EAC9EC,EAAUxB,EAAM,OAAuB,IAAI,EAC3CyB,EAAezB,EAAM,OAAuB,IAAI,EAChD0B,EAAc1B,EAAM,OAA4B,CAAC,CAAC,EAGxDA,EAAM,oBAAoBkB,EAAK,IAAMM,EAAQ,OAAyB,EAGtE,MAAMG,EAAgBP,IAAU,OAASV,EAAgBD,EACnDmB,EAAmD,CACvD,aAAcb,GAAa,cAAgBY,EAAc,aACzD,YAAaZ,GAAa,aAAeY,EAAc,YACvD,qBAAsBZ,GAAa,sBAAwBY,EAAc,oBAC3E,EAEME,EAAyB7B,EAAM,YAAa8B,GAA0B,CAC1E,MAAMC,EAASL,EAAY,QAAQI,CAAa,EAEhD,GAAIC,GAAUN,EAAa,QAAS,CAClC,MAAMO,EAAYP,EAAa,QACzBQ,EAASF,EACTG,EAAaD,EAAO,WAAaD,EAAU,YAAc,EAAIC,EAAO,YAAc,EAGpF,OAAOD,EAAU,UAAa,YAChCA,EAAU,SAAS,CACjB,KAAME,EACN,SAAU,QACZ,CAAC,CAEL,CACF,EAAG,CAAC,CAAC,EAGL,OAAAlC,EAAM,UAAU,IAAM,CACpB,GAAI,CAACsB,EAAU,OAEf,MAAMa,EAActB,EAAK,YAAY,UAAUU,GAAQA,EAAK,WAAaD,CAAQ,EAC7Ea,IAAgB,QAAaA,IAAgB,IAC/CN,EAAuBM,CAAW,CAEtC,EAAG,CAACb,EAAUT,EAAK,WAAYgB,CAAsB,CAAC,EAGpD9B,EAACK,EAAA,CAAU,IAAKoB,EAAS,UAAWvB,EAAGO,EAAkB,CAAE,MAAAY,CAAM,CAAC,EAAGR,GAAY,IAAI,EAAI,GAAGK,EAC1F,SAAAlB,EAAC,OACC,IAAK0B,EACL,UAAWxB,EAAGK,EAAyB,CAAE,UAAAa,EAAW,KAAAE,CAAK,CAAC,EAAG,WAAYT,GAAY,OAAO,EAE3F,SAAAC,EAAK,YAAY,IAAI,CAACU,EAAMa,IAAU,CACrC,MAAMC,EAAWf,IAAaC,EAAK,SAEnC,OACExB,EAAC,UAEC,IAAKuC,GAAM,CACLA,IACFZ,EAAY,QAAQU,CAAK,EAAIE,EAEjC,EACA,eAAcD,EAAW,GAAO,OAChC,QAAS,IAAM,CAKb,GAHAR,EAAuBO,CAAK,EAGxBtB,EAAa,CACfA,EAAYS,EAAMa,CAAK,EACvB,MACF,CAGA,MAAMG,EAAgB,SAAS,eAAehB,EAAK,QAAQ,EAC3D,GAAIgB,GAAiBf,EAAQ,QAAS,CACpC,MAAMgB,EAAYhB,EAAQ,QAAQ,aAC5BiB,EAAiBF,EAAc,sBAAsB,EAAE,IAAM,OAAO,QAAUC,EAEpF,OAAO,SAAS,CACd,IAAKC,EACL,SAAU,QACZ,CAAC,CACH,CACF,EACA,UAAWxC,EACTM,EAAmB,CAAE,KAAAc,CAAK,CAAC,EAC3BgB,EACI,CACET,EAAoB,YACpBA,EAAoB,qBACpB,gCACF,EACAA,EAAoB,aACxBhB,GAAY,IACd,EAEC,SAAAW,EAAK,OAzCDA,EAAK,QA0CZ,CAEJ,CAAC,EACH,EACF,CAEJ,CACF,EAEAZ,EAAiB,YAAc,mBAC/B,IAAO+B,EAAQrC,EAAWM,CAAgB",
6
+ "names": ["jsx", "React", "cn", "cva", "useAnchorPosition", "Container", "withLayout", "anchorNavigationVariants", "anchorItemVariants", "containerVariants", "LIGHT_DEFAULTS", "DARK_DEFAULTS", "AnchorNavigation", "classNames", "data", "onItemClick", "buttonStyle", "className", "rest", "ref", "alignment", "theme", "size", "activeId", "item", "rootRef", "containerRef", "sectionRefs", "themeDefaults", "resolvedButtonStyle", "autoScrollToActiveItem", "activeIdIndex", "curRef", "container", "button", "scrollLeft", "activeIndex", "index", "isActive", "el", "targetElement", "navHeight", "targetPosition", "AnchorNavigation_default"]
7
7
  }
@@ -1,2 +1,18 @@
1
- declare const _default: any;
1
+ import type { Img } from '../../types/props.js';
2
+ type AplusItem = {
3
+ img: Img;
4
+ mobileImg: Img;
5
+ title: string;
6
+ desc: string;
7
+ theme: 'light' | 'dark';
8
+ };
9
+ interface AplusDescType extends React.HTMLAttributes<HTMLDivElement> {
10
+ data: {
11
+ title: string;
12
+ img: Img;
13
+ mobileImg: Img;
14
+ list: AplusItem[];
15
+ };
16
+ }
17
+ declare const _default: import("react").ForwardRefExoticComponent<AplusDescType & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
2
18
  export default _default;
@@ -1,2 +1,3 @@
1
- declare const _default: any;
1
+ import type { BrandCardLinkProps } from './types.js';
2
+ declare const _default: import("react").ForwardRefExoticComponent<BrandCardLinkProps & import("react").RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
2
3
  export default _default;
@@ -1,2 +1,3 @@
1
- declare const _default: any;
1
+ import type { BrandEquityProps } from './types.js';
2
+ declare const _default: import("react").ForwardRefExoticComponent<BrandEquityProps & import("react").RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
2
3
  export default _default;
@@ -27,5 +27,5 @@ export interface CategoryProps extends React.HTMLAttributes<HTMLDivElement> {
27
27
  };
28
28
  key?: string;
29
29
  }
30
- declare const _default: any;
30
+ declare const _default: React.ForwardRefExoticComponent<CategoryProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
31
31
  export default _default;
@@ -7,5 +7,11 @@ export type CreativeModuleDataType = {
7
7
  theme: 'light' | 'dark';
8
8
  span: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
9
9
  };
10
- declare const _default: any;
10
+ interface CreativeModuleType extends React.HTMLAttributes<HTMLDivElement> {
11
+ data: {
12
+ shape?: 'rounded' | 'square';
13
+ productsTab: CreativeModuleDataType[];
14
+ };
15
+ }
16
+ declare const _default: import("react").ForwardRefExoticComponent<CreativeModuleType & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
11
17
  export default _default;
@@ -7,5 +7,10 @@ export type DownLoadDataType = {
7
7
  line: Img;
8
8
  icon: Img;
9
9
  };
10
- declare const _default: any;
10
+ interface DownLoadType extends React.HTMLAttributes<HTMLDivElement> {
11
+ data: {
12
+ list: DownLoadDataType[];
13
+ };
14
+ }
15
+ declare const _default: import("react").ForwardRefExoticComponent<DownLoadType & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
11
16
  export default _default;
@@ -29,5 +29,5 @@ export interface EvaluateProps extends React.HTMLAttributes<HTMLDivElement> {
29
29
  };
30
30
  key?: string;
31
31
  }
32
- declare const _default: any;
32
+ declare const _default: React.ForwardRefExoticComponent<EvaluateProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
33
33
  export default _default;
@@ -1,4 +1,5 @@
1
- import type { FaqItem as ItemType, FaqSemanticName } from './types.js';
1
+ import React from 'react';
2
+ import type { FaqProps, FaqItem as ItemType, FaqSemanticName } from './types.js';
2
3
  interface FaqItemProps {
3
4
  data: ItemType;
4
5
  defaultOpen?: boolean;
@@ -8,6 +9,6 @@ declare const FaqItem: {
8
9
  ({ data, defaultOpen, classNames }: FaqItemProps): import("react/jsx-runtime").JSX.Element;
9
10
  displayName: string;
10
11
  };
11
- declare const _default: any;
12
+ declare const _default: React.ForwardRefExoticComponent<FaqProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
12
13
  export default _default;
13
14
  export { FaqItem };
@@ -1,2 +1,4 @@
1
- declare const _default: any;
1
+ import React from 'react';
2
+ import type { FeatureCardsProps } from './types.js';
3
+ declare const _default: React.ForwardRefExoticComponent<FeatureCardsProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
2
4
  export default _default;
@@ -1,2 +1,4 @@
1
- declare const _default: any;
1
+ import React from 'react';
2
+ import type { FeatureShowcaseProps } from './types.js';
3
+ declare const _default: React.ForwardRefExoticComponent<FeatureShowcaseProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
2
4
  export default _default;
@@ -10,5 +10,12 @@ export type FeaturesDataType = {
10
10
  textTwo: string;
11
11
  icon: Img;
12
12
  };
13
- declare const _default: any;
13
+ declare const _default: import("react").ForwardRefExoticComponent<import("react").HTMLAttributes<HTMLDivElement> & {
14
+ data: {
15
+ title: string;
16
+ img: Img;
17
+ mobileImg: Img;
18
+ list: FeaturesDataType[];
19
+ };
20
+ } & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
14
21
  export default _default;
@@ -1,2 +1,8 @@
1
- declare const _default: any;
1
+ interface FootChargerType extends React.HTMLAttributes<HTMLDivElement> {
2
+ data: {
3
+ title: string;
4
+ text: string;
5
+ };
6
+ }
7
+ declare const _default: import("react").ForwardRefExoticComponent<FootChargerType & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
2
8
  export default _default;
@@ -1,2 +1,3 @@
1
- declare const _default: any;
1
+ import type { FooterNavigationProps } from './types.js';
2
+ declare const _default: import("react").ForwardRefExoticComponent<FooterNavigationProps & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
2
3
  export default _default;
@@ -1,5 +1,7 @@
1
+ import React from 'react';
1
2
  import 'swiper/css';
2
3
  import 'swiper/css/navigation';
3
4
  import 'swiper/css/pagination';
4
- declare const _default: any;
5
+ import type { GiftBoxType } from './types.js';
6
+ declare const _default: React.ForwardRefExoticComponent<GiftBoxType & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & React.RefAttributes<any>>;
5
7
  export default _default;
@@ -1,3 +1,5 @@
1
- declare const _default: any;
1
+ import * as React from 'react';
2
+ import type { GiftShelfProps } from './types.js';
3
+ declare const _default: React.ForwardRefExoticComponent<GiftShelfProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
2
4
  export default _default;
3
5
  export type { GiftShelfProps, GiftShelfData, GiftShelfItem, GiftShelfProduct, CountdownConfig, ResponsiveBackgroundImage, } from './types.js';
@@ -1,3 +1,5 @@
1
- declare const _default: any;
1
+ import * as React from 'react';
2
+ import type { GiftTierShelfProps } from './types.js';
3
+ declare const _default: React.ForwardRefExoticComponent<GiftTierShelfProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
2
4
  export default _default;
3
5
  export type { GiftTierShelfProps, GiftTierShelfData, GiftTierItem, GiftTierProduct } from './types.js';
@@ -37,5 +37,5 @@ export interface GraphicProps extends ComponentCommonProps, React.HTMLAttributes
37
37
  itemTheme?: Theme;
38
38
  };
39
39
  }
40
- declare const _default: any;
40
+ declare const _default: React.ForwardRefExoticComponent<GraphicProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
41
41
  export default _default;
@@ -17,6 +17,6 @@ interface GraphicAttractionBlockProps extends React.HTMLAttributes<HTMLElement>
17
17
  attractionItems?: AttractionItem[];
18
18
  };
19
19
  }
20
- declare const _default: any;
20
+ declare const _default: React.ForwardRefExoticComponent<GraphicAttractionBlockProps & React.RefAttributes<HTMLElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
21
21
  export default _default;
22
22
  export type { GraphicAttractionBlockProps };
@@ -8,5 +8,11 @@ export type GraphicMoreDataType = {
8
8
  fullWidth: 'true' | 'false';
9
9
  span: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
10
10
  };
11
- declare const _default: any;
11
+ interface GraphicMoreType extends React.HTMLAttributes<HTMLDivElement> {
12
+ data: {
13
+ shape?: 'rounded' | 'square';
14
+ productsTab: GraphicMoreDataType[];
15
+ };
16
+ }
17
+ declare const _default: import("react").ForwardRefExoticComponent<GraphicMoreType & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
12
18
  export default _default;
@@ -1,4 +1,12 @@
1
- import type { GraphicOverlayProps } from './types';
2
- declare const _default: any;
1
+ import React from 'react';
2
+ import type { GraphicOverlayProps, Item } from './types';
3
+ declare const _default: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
4
+ data: {
5
+ shape?: import("../../types/props").Shape;
6
+ items: ({
7
+ width?: "full" | "half" | "one-third";
8
+ } & Item)[];
9
+ };
10
+ } & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
3
11
  export default _default;
4
12
  export type { GraphicOverlayProps };
@@ -1,2 +1,4 @@
1
- declare const _default: any;
1
+ import React from 'react';
2
+ import type { HeaderNavigationProps } from './types.js';
3
+ declare const _default: React.ForwardRefExoticComponent<HeaderNavigationProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
2
4
  export default _default;
@@ -1,3 +1,7 @@
1
+ import React from 'react';
2
+ import type { HeroBannerProps } from './types.js';
1
3
  export type HeroBannerSemanticName = 'root' | 'title' | 'subtitle' | 'buttonGroup' | 'primaryButton' | 'secondaryButton' | 'captionGroup';
2
- declare const _default: any;
4
+ declare const _default: React.ForwardRefExoticComponent<HeroBannerProps & {
5
+ classNames?: Partial<Record<HeroBannerSemanticName, string>>;
6
+ } & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
3
7
  export default _default;
@@ -1,2 +1,4 @@
1
- declare const _default: any;
1
+ import React from 'react';
2
+ import type { ImageTextFeatureProps } from './types.js';
3
+ declare const _default: React.ForwardRefExoticComponent<ImageTextFeatureProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
2
4
  export default _default;
@@ -1,2 +1,4 @@
1
- declare const _default: any;
1
+ import React from 'react';
2
+ import type { ImageWithTextProps } from './types.js';
3
+ declare const _default: React.ForwardRefExoticComponent<ImageWithTextProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
2
4
  export default _default;
@@ -75,5 +75,5 @@ export interface KspProps extends Omit<React.HTMLAttributes<HTMLElement>, 'class
75
75
  /** 语义化类名配置 */
76
76
  classNames?: KspClassNames;
77
77
  }
78
- declare const _default: any;
78
+ declare const _default: import("react").ForwardRefExoticComponent<KspProps & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
79
79
  export default _default;
@@ -1,2 +1,12 @@
1
- declare const _default: any;
1
+ import type { Product, ProductVariant } from '../../types/product';
2
+ import type { DeliveryCustom } from './type';
3
+ declare const _default: import("react").ForwardRefExoticComponent<{
4
+ metafields: any;
5
+ productList: Array<Product & {
6
+ variant: ProductVariant;
7
+ }>;
8
+ variant: ProductVariant;
9
+ onShippingInfoChange: (deliveryCustom: DeliveryCustom) => void;
10
+ className?: string;
11
+ } & Partial<import("../../../../shared/Styles.js").StylesProps & import("../../../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
2
12
  export default _default;
@@ -1,4 +1,26 @@
1
1
  import React from 'react';
2
+ interface BenefitsTabTextConfig {
3
+ couponCode?: string;
4
+ copyCode?: string;
5
+ copied?: string;
6
+ expired?: string;
7
+ offCoupon?: string;
8
+ offMemberOnly?: string;
9
+ loginNow?: string;
10
+ selectFreeGift?: string;
11
+ bundleSaveUpTo?: string;
12
+ bundleOffer?: string;
13
+ creditsTitle?: string;
14
+ creditsDesc?: string;
15
+ off?: string;
16
+ memberBenefitsNotLogin?: string;
17
+ memberBenefitsNotLoginText?: string;
18
+ forNewMember?: string;
19
+ expressShipping?: string;
20
+ creditsAfterActivation?: string;
21
+ active?: string;
22
+ flexibleInstallment?: string;
23
+ }
2
24
  export type ProductBenefitsTabsValueType = 'coupon' | 'membership' | 'pay' | 'installment';
3
25
  export type ModalData = {
4
26
  needClickAway?: boolean;
@@ -7,5 +29,8 @@ export type ModalData = {
7
29
  content?: string;
8
30
  domContent?: React.ReactNode;
9
31
  };
10
- declare const _default: any;
32
+ interface BenefitsTabProps {
33
+ textConfig?: BenefitsTabTextConfig;
34
+ }
35
+ declare const _default: React.ForwardRefExoticComponent<BenefitsTabProps & Partial<import("../../../../../shared/Styles.js").StylesProps & import("../../../../../shared/Styles.js").ContainerProps> & React.RefAttributes<any>>;
11
36
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: any;
1
+ declare const _default: import("react").ForwardRefExoticComponent<Partial<import("../../../../../../shared/Styles.js").StylesProps & import("../../../../../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: any;
1
+ declare const _default: import("react").ForwardRefExoticComponent<Partial<import("../../../../../../shared/Styles.js").StylesProps & import("../../../../../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: any;
1
+ declare const _default: import("react").ForwardRefExoticComponent<Partial<import("../../../../../../shared/Styles.js").StylesProps & import("../../../../../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: any;
1
+ declare const _default: import("react").ForwardRefExoticComponent<Partial<import("../../../../../../shared/Styles.js").StylesProps & import("../../../../../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: any;
1
+ declare const _default: import("react").ForwardRefExoticComponent<Partial<import("../../../../../../shared/Styles.js").StylesProps & import("../../../../../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
2
2
  export default _default;
@@ -1,5 +1,5 @@
1
1
  export interface ProductGalleryTabRef {
2
2
  scrollToTab: (index: number) => void;
3
3
  }
4
- declare const _default: any;
4
+ declare const _default: import("react").ForwardRefExoticComponent<Partial<import("../../../../../shared/Styles.js").StylesProps & import("../../../../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
5
5
  export default _default;
@@ -1,2 +1,12 @@
1
- declare const _default: any;
1
+ import type { Product, ProductVariant } from '../../../types/product.js';
2
+ import type { DeliveryCustom } from '../../PaidShipping/type.js';
3
+ declare const _default: import("react").ForwardRefExoticComponent<{
4
+ metafields: any;
5
+ productList: Array<Product & {
6
+ variant: ProductVariant;
7
+ }>;
8
+ variant: ProductVariant;
9
+ onShippingInfoChange: (deliveryCustom: DeliveryCustom) => void;
10
+ className?: string;
11
+ } & Partial<import("../../../../../shared/Styles.js").StylesProps & import("../../../../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
2
12
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: any;
1
+ declare const _default: import("react").ForwardRefExoticComponent<Partial<import("../../../../../shared/Styles.js").StylesProps & import("../../../../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
2
2
  export default _default;
@@ -1,2 +1,3 @@
1
- declare const _default: any;
1
+ import type { PurchaseBarProps } from './types.js';
2
+ declare const _default: import("react").ForwardRefExoticComponent<PurchaseBarProps & Partial<import("../../../../shared/Styles.js").StylesProps & import("../../../../shared/Styles.js").ContainerProps> & import("react").RefAttributes<any>>;
2
3
  export default _default;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import type { MarqueeItemProps, MarqueeImageContentProps, MarqueeTextContentProps } from './type.js';
2
+ import type { MarqueeProps, MarqueeItemProps, MarqueeImageContentProps, MarqueeTextContentProps } from './type.js';
3
+ import { type SwiperRef } from 'swiper/react';
3
4
  declare const MarqueeItem: {
4
5
  ({ data, configuration }: MarqueeItemProps): import("react/jsx-runtime").JSX.Element;
5
6
  displayName: string;
@@ -9,6 +10,6 @@ declare const MarqueeImageContent: {
9
10
  displayName: string;
10
11
  };
11
12
  declare const MarqueeTextContent: React.ForwardRefExoticComponent<MarqueeTextContentProps & React.RefAttributes<HTMLDivElement>>;
12
- declare const _default: any;
13
+ declare const _default: React.ForwardRefExoticComponent<MarqueeProps & React.RefAttributes<SwiperRef> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
13
14
  export default _default;
14
15
  export { MarqueeItem, MarqueeImageContent, MarqueeTextContent };
@@ -33,5 +33,5 @@ export interface MarqueeReviewProps extends React.HTMLAttributes<HTMLElement> {
33
33
  /** 评论数据 */
34
34
  data: MarqueeReviewData;
35
35
  }
36
- declare const _default: any;
36
+ declare const _default: React.ForwardRefExoticComponent<MarqueeReviewProps & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps> & React.RefAttributes<any>>;
37
37
  export default _default;
@@ -1,5 +1,6 @@
1
+ import * as React from 'react';
1
2
  import 'swiper/css/pagination';
2
3
  import type { MediaEndorsementProps, MediaEndorsementData, MediaEndorsementItem, MediaEndorsementSemanticName } from './types.js';
3
- declare const _default: any;
4
+ declare const _default: React.ForwardRefExoticComponent<MediaEndorsementProps & React.RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
4
5
  export default _default;
5
6
  export type { MediaEndorsementProps, MediaEndorsementData, MediaEndorsementItem, MediaEndorsementSemanticName };
@@ -1,2 +1,3 @@
1
- declare const _default: any;
1
+ import type { MediaPlayerBaseProps } from './types.js';
2
+ declare const _default: import("react").ForwardRefExoticComponent<MediaPlayerBaseProps & import("react").RefAttributes<HTMLDivElement> & Partial<import("../../shared/Styles.js").StylesProps & import("../../shared/Styles.js").ContainerProps>>;
2
3
  export default _default;
@@ -1,2 +1,2 @@
1
- "use client";import{Fragment as Ne,jsx as e,jsxs as p}from"react/jsx-runtime";import{useState as v,useRef as r,useMemo as ye,useEffect as S,forwardRef as xe,useImperativeHandle as he}from"react";import{debounce as be}from"lodash";import{cn as i}from"../../helpers/utils.js";import{withLayout as we}from"../../shared/Styles.js";import X from"../../components/button.js";import{VideoModal as He}from"../VideoModal/index.js";import{convertLexicalToHTML as Z}from"@payloadcms/richtext-lexical/html";import{useInView as Te}from"react-intersection-observer";import{useExposure as ke}from"../../hooks/useExposure.js";import A from"../../helpers/ScrollLoadVideo.js";import{gsap as d}from"gsap";import{SplitText as ee}from"gsap/dist/SplitText";import{ScrollTrigger as V}from"gsap/dist/ScrollTrigger";const Me="media_player_base",Le="video";d.registerPlugin(V,ee);const te=({defaultConverters:y})=>({...y,text:L=>{const{node:t}=L;return t.$&&t.$.color?`<span class="lexical-${t.$.color}">${t.text}</span>`:t.text}}),re=xe(({className:y="",id:L,onBtnClick:t,data:{title:x,videoTitle:h,btnText:b,youtubeId:_,video:$,mobileVideo:ne,theme:B,img:C,shape:D,titleAnimation:w="fade-in",...oe},...F},se)=>{const{sticky:n}=oe,[j,q]=v(!1),[U,le]=v(0),[ie,ae]=v(0),[H,ce]=v(0),[Y,N]=v(!1),T=r(null),O=r(null),o=r(null),k=r(null),G=r(null),M=r(null),u=r(null),R=r(null),I=r(null),{ref:de,inView:s}=Te();he(se,()=>o.current);const m=typeof x=="string"?x:x&&Z({data:x,converters:te}),J=typeof h=="string"?h:h&&Z({data:h,converters:te});S(()=>{s?(T.current?.play(),q(!0)):(T.current?.pause(),q(!1))},[s]);const z=be(()=>{if(o.current){const f=o.current.getBoundingClientRect(),a=window.innerHeight,g=window.scrollY||window.pageYOffset,l=f.bottom+g,c=document.documentElement.scrollHeight-l;le(c>a?a:c)}if(o.current){const f=o.current.clientHeight,a=window.innerHeight;ae(f+a)}},600);S(()=>(z(),window.addEventListener("resize",z),()=>{window.removeEventListener("resize",z)}),[]),S(()=>{function f(){if(!k.current||w!=="fade-in")return;const g=k.current?.clientHeight||80;M.current=new ee(k.current,{type:"words",wordsClass:"word"});const l=M.current.words;d.set(l,{opacity:0}),u.current&&d.set(u.current,{opacity:0}),R.current=V.create({trigger:o.current,start:"top center-=10%",end:`top+=${g*1.5+80}px center-=10%`,scrub:!0,onUpdate:K=>{const c=K.progress,Q=l.length,ue=1/Q,W=.5;l.forEach((me,fe)=>{const ge=fe/Q*(1-W),ve=ue*(1+W);let P=(c-ge)/ve;P=Math.max(0,Math.min(P,1)),d.set(me,{opacity:P})}),d.set(O.current,{opacity:c}),u.current&&d.set(u.current,{opacity:c>=.6?1:0})}})}function a(){I.current=V.create({trigger:o.current,start:"bottom bottom",end:"bottom top",scrub:!0,onUpdate:g=>{const l=g.progress;ce(l)}})}return s&&(f(),a()),()=>{M.current&&M.current.revert(),R.current&&R.current.kill(),I.current&&I.current.kill()}},[w,s]),ke(G,{componentType:Le,componentName:Me,componentTitle:m});const pe=ye(()=>s&&H>0&&H<.9?3:s?2:1,[H,s]),E="lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] laptop:aspect-w-[1024] laptop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]";return p(Ne,{children:[n&&e("div",{...F,ref:o,className:i("pointer-events-none relative z-10",E,{"aiui-dark":B==="dark","rounded-box":D==="rounded"},y),children:e("div",{ref:de,children:!w&&p("div",{className:"media-content absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 px-4 text-center",children:[m&&!j&&e("div",{className:"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:m}}),J&&j&&e("div",{className:"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:J}}),b&&e(X,{variant:"link",className:i("member-equity-button-secondary text-info-primary"),onClick:()=>{N(!0),t&&t?.()},children:b})]})})}),p("div",{...n?{}:F,style:n?{marginBottom:`-${U}px`,marginTop:`-${ie}px`,zIndex:pe}:{zIndex:5},className:i("relative",y),children:[e("div",{className:"sticky top-0 ",children:p("div",{id:L,className:i("relative overflow-hidden",n?"h-screen w-full":E,{"aiui-dark":B==="dark","rounded-box":D==="rounded"}),children:[w==="fade-in"&&p("div",{className:i("absolute z-30 flex w-full flex-col items-center justify-center gap-4 px-4 text-center",n?"left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2":"left-0 top-0"),children:[m&&e("div",{ref:k,className:"media-player-base-title lg-desktop:text-[64px] text-info-primary text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:m}}),b&&e(X,{ref:u,variant:"link",className:i("media-player-base-button member-equity-button-secondary text-info-primary"),onClick:()=>{N(!0),t&&t?.()},children:b})]}),p("div",{className:"media-cover left-0 top-0 h-screen w-screen overflow-hidden",style:{height:`${102-H*100}vh`},children:[e(A,{videoRef:T,poster:C?.url||"",src:$?.url,className:"tablet:block hidden size-full !h-auto",videoClassName:"object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),e(A,{videoRef:T,poster:C?.url||"",src:ne?.url||$?.url,className:"tablet:hidden block min-h-screen w-full",videoClassName:"object-cover w-full h-auto",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":!0,"x5-playsinline":!0}),e("div",{ref:O,className:"absolute left-0 top-0 z-10 size-full opacity-0",style:{background:"rgba(0, 0, 0, 0.2)"}})]})]})}),n&&e("div",{className:i(n&&"pointer-events-none relative box-content block",E),style:n?{height:`${U}px`}:{},ref:G})]}),Y&&_&&e(He,{visible:Y,youTubeId:_,onCloseModal:()=>N(!1)})]})});re.displayName="MediaPlayerBase";var je=we(re);export{je as default};
1
+ "use client";import{Fragment as Ne,jsx as e,jsxs as p}from"react/jsx-runtime";import{useState as v,useRef as r,useMemo as ye,useEffect as S,forwardRef as xe,useImperativeHandle as he}from"react";import{debounce as be}from"lodash";import{cn as i}from"../../helpers/utils.js";import{withLayout as we}from"../../shared/Styles.js";import X from"../../components/button.js";import{VideoModal as He}from"../VideoModal/index.js";import{convertLexicalToHTML as Z}from"@payloadcms/richtext-lexical/html";import{useInView as Te}from"react-intersection-observer";import{useExposure as ke}from"../../hooks/useExposure.js";import A from"../../helpers/ScrollLoadVideo.js";import{gsap as d}from"gsap";import{SplitText as ee}from"gsap/dist/SplitText";import{ScrollTrigger as V}from"gsap/dist/ScrollTrigger";const Me="media_player_base",Le="video";d.registerPlugin(V,ee);const te=({defaultConverters:y})=>({...y,text:L=>{const{node:t}=L;return t.$&&t.$.color?`<span class="lexical-${t.$.color}">${t.text}</span>`:t.text}}),re=xe(({className:y="",id:L,onBtnClick:t,data:{title:x,videoTitle:h,btnText:b,youtubeId:_,video:$,mobileVideo:ne,theme:B,img:C,shape:D,titleAnimation:w="fade-in",...oe},...F},se)=>{const{sticky:n}=oe,[j,q]=v(!1),[U,le]=v(0),[ie,ae]=v(0),[H,ce]=v(0),[Y,N]=v(!1),T=r(null),O=r(null),o=r(null),k=r(null),G=r(null),M=r(null),u=r(null),R=r(null),I=r(null),{ref:de,inView:s}=Te();he(se,()=>o.current);const m=typeof x=="string"?x:x&&Z({data:x,converters:te}),J=typeof h=="string"?h:h&&Z({data:h,converters:te});S(()=>{s?(T.current?.play(),q(!0)):(T.current?.pause(),q(!1))},[s]);const z=be(()=>{if(o.current){const f=o.current.getBoundingClientRect(),a=window.innerHeight,g=window.scrollY||window.pageYOffset,l=f.bottom+g,c=document.documentElement.scrollHeight-l;le(c>a?a:c)}if(o.current){const f=o.current.clientHeight,a=window.innerHeight;ae(f+a)}},600);S(()=>(z(),window.addEventListener("resize",z),()=>{window.removeEventListener("resize",z)}),[]),S(()=>{function f(){if(!k.current||w!=="fade-in")return;const g=k.current?.clientHeight||80;M.current=new ee(k.current,{type:"words",wordsClass:"word"});const l=M.current.words;d.set(l,{opacity:0}),u.current&&d.set(u.current,{opacity:0}),R.current=V.create({trigger:o.current,start:"top center-=10%",end:`top+=${g*1.5+80}px center-=10%`,scrub:!0,onUpdate:K=>{const c=K.progress,Q=l.length,ue=1/Q,W=.5;l.forEach((me,fe)=>{const ge=fe/Q*(1-W),ve=ue*(1+W);let P=(c-ge)/ve;P=Math.max(0,Math.min(P,1)),d.set(me,{opacity:P})}),d.set(O.current,{opacity:c}),u.current&&d.set(u.current,{opacity:c>=.6?1:0})}})}function a(){I.current=V.create({trigger:o.current,start:"bottom bottom",end:"bottom top",scrub:!0,onUpdate:g=>{const l=g.progress;ce(l)}})}return s&&(f(),a()),()=>{M.current&&M.current.revert(),R.current&&R.current.kill(),I.current&&I.current.kill()}},[w,s]),ke(G,{componentType:Le,componentName:Me,componentTitle:m});const pe=ye(()=>s&&H>0&&H<.9?3:s?2:1,[H,s]),E="lg-desktop:aspect-w-[1920] lg-desktop:aspect-h-[930] desktop:aspect-w-[1024] desktop:aspect-h-[520] laptop:aspect-w-[1024] laptop:aspect-h-[520] tablet:aspect-w-[768] tablet:aspect-h-[660] aspect-w-[390] aspect-h-[660]";return p(Ne,{children:[n&&e("div",{...F,ref:o,className:i("pointer-events-none relative z-10",E,{"aiui-dark":B==="dark","rounded-box":D==="rounded"},y),children:e("div",{ref:de,children:!w&&p("div",{className:"media-content absolute left-1/2 top-1/2 z-20 w-full -translate-x-1/2 -translate-y-1/2 px-4 text-center",children:[m&&!j&&e("div",{className:"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:m}}),J&&j&&e("div",{className:"lg-desktop:text-[64px] text-info-primary text-center text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:J}}),b&&e(X,{variant:"link",className:i("member-equity-button-secondary text-info-primary"),onClick:()=>{N(!0),t&&t?.()},children:b})]})})}),p("div",{...n?{}:F,style:n?{marginBottom:`-${U}px`,marginTop:`-${ie}px`,zIndex:pe}:{zIndex:5},className:i("relative",y),children:[e("div",{className:"sticky top-0 ",children:p("div",{id:L,className:i("relative overflow-hidden",n?"h-screen w-full":E,{"aiui-dark":B==="dark","rounded-box":D==="rounded"}),children:[w==="fade-in"&&p("div",{className:i("absolute z-30 flex w-full flex-col items-center justify-center gap-4 px-4 text-center",n?"left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2":"left-0 top-0"),children:[m&&e("div",{ref:k,className:"media-player-base-title lg-desktop:text-[64px] text-info-primary text-[40px] font-bold leading-none lg:text-5xl",dangerouslySetInnerHTML:{__html:m}}),b&&e(X,{ref:u,variant:"link",className:i("media-player-base-button member-equity-button-secondary text-info-primary"),onClick:()=>{N(!0),t&&t?.()},children:b})]}),p("div",{className:"media-cover left-0 top-0 h-screen w-screen overflow-hidden",style:{height:`${102-H*100}vh`},children:[e(A,{videoRef:T,poster:C?.url||"",src:$?.url,className:"tablet:block hidden size-full !h-auto",videoClassName:"object-cover",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":"true","x5-playsinline":"true"}),e(A,{videoRef:T,poster:C?.url||"",src:ne?.url||$?.url,className:"tablet:hidden block min-h-screen w-full",videoClassName:"object-cover w-full h-auto",muted:!0,loop:!0,playsInline:!0,autoplay:!0,"webkit-playsinline":"true","x5-playsinline":"true"}),e("div",{ref:O,className:"absolute left-0 top-0 z-10 size-full opacity-0",style:{background:"rgba(0, 0, 0, 0.2)"}})]})]})}),n&&e("div",{className:i(n&&"pointer-events-none relative box-content block",E),style:n?{height:`${U}px`}:{},ref:G})]}),Y&&_&&e(He,{visible:Y,youTubeId:_,onCloseModal:()=>N(!1)})]})});re.displayName="MediaPlayerBase";var je=we(re);export{je as default};
2
2
  //# sourceMappingURL=index.js.map