@anker-in/headless-ui 1.3.84 → 1.3.86

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 (203) hide show
  1. package/README.md +6 -0
  2. package/dist/cjs/biz-components/AccordionCards/index.js +1 -1
  3. package/dist/cjs/biz-components/ActiveShelf/ProductCard.d.ts +4 -3
  4. package/dist/cjs/biz-components/ActiveShelf/ProductCard.js +1 -1
  5. package/dist/cjs/biz-components/ActiveShelf/index.js +1 -1
  6. package/dist/cjs/biz-components/ActivityMechanism/index.d.ts +4 -7
  7. package/dist/cjs/biz-components/ActivityMechanism/index.js +1 -1
  8. package/dist/cjs/biz-components/ActivitySchedule/index.js +1 -1
  9. package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
  10. package/dist/cjs/biz-components/AnchorNavigation/index.js +1 -1
  11. package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js +1 -1
  12. package/dist/cjs/biz-components/BuyOneGetOneShelf/FreeGiftItem.d.ts +2 -0
  13. package/dist/cjs/biz-components/BuyOneGetOneShelf/FreeGiftItem.js +1 -1
  14. package/dist/cjs/biz-components/BuyOneGetOneShelf/GiftSelection.d.ts +2 -0
  15. package/dist/cjs/biz-components/BuyOneGetOneShelf/GiftSelection.js +1 -1
  16. package/dist/cjs/biz-components/BuyOneGetOneShelf/PriceAndActions.d.ts +2 -0
  17. package/dist/cjs/biz-components/BuyOneGetOneShelf/PriceAndActions.js +1 -1
  18. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +2 -0
  19. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
  20. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductImage.d.ts +4 -0
  21. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductImage.js +1 -1
  22. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductInfo.d.ts +2 -0
  23. package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductInfo.js +1 -1
  24. package/dist/cjs/biz-components/BuyOneGetOneShelf/index.js +1 -1
  25. package/dist/cjs/biz-components/BuyOneGetOneShelf/tracking.d.ts +20 -0
  26. package/dist/cjs/biz-components/BuyOneGetOneShelf/tracking.js +1 -0
  27. package/dist/cjs/biz-components/BuyOneGetOneShelf/types.d.ts +2 -0
  28. package/dist/cjs/biz-components/Category/index.d.ts +4 -2
  29. package/dist/cjs/biz-components/Category/index.js +1 -1
  30. package/dist/cjs/biz-components/Chat/action.d.ts +25 -0
  31. package/dist/cjs/biz-components/Chat/action.js +1 -0
  32. package/dist/cjs/biz-components/Chat/button.d.ts +3 -0
  33. package/dist/cjs/biz-components/Chat/button.js +1 -0
  34. package/dist/cjs/biz-components/Chat/chatContext.d.ts +101 -0
  35. package/dist/cjs/biz-components/Chat/chatContext.js +1 -0
  36. package/dist/cjs/biz-components/Chat/exports.d.ts +3 -0
  37. package/dist/cjs/biz-components/Chat/exports.js +1 -0
  38. package/dist/cjs/biz-components/Chat/helpers/fetchResponse.d.ts +14 -0
  39. package/dist/cjs/biz-components/Chat/helpers/fetchResponse.js +1 -0
  40. package/dist/cjs/biz-components/Chat/helpers/fetcher.d.ts +2 -0
  41. package/dist/cjs/biz-components/Chat/helpers/fetcher.js +1 -0
  42. package/dist/cjs/biz-components/Chat/index.d.ts +71 -0
  43. package/dist/cjs/biz-components/Chat/index.js +1 -0
  44. package/dist/cjs/biz-components/Chat/markdown.d.ts +5 -0
  45. package/dist/cjs/biz-components/Chat/markdown.js +1 -0
  46. package/dist/cjs/biz-components/Chat/messages.d.ts +3 -0
  47. package/dist/cjs/biz-components/Chat/messages.js +1 -0
  48. package/dist/cjs/biz-components/Chat/props.d.ts +43 -0
  49. package/dist/cjs/biz-components/Chat/props.js +1 -0
  50. package/dist/cjs/biz-components/Chat/response.d.ts +4 -0
  51. package/dist/cjs/biz-components/Chat/response.js +1 -0
  52. package/dist/cjs/biz-components/Chat/suggestions.d.ts +3 -0
  53. package/dist/cjs/biz-components/Chat/suggestions.js +1 -0
  54. package/dist/cjs/biz-components/Chat/utils.d.ts +3 -0
  55. package/dist/cjs/biz-components/Chat/utils.js +1 -0
  56. package/dist/cjs/biz-components/Evaluate/index.js +1 -1
  57. package/dist/cjs/biz-components/EventSchedule/index.js +1 -1
  58. package/dist/cjs/biz-components/Faq/Faq.d.ts +3 -1
  59. package/dist/cjs/biz-components/Faq/Faq.js +2 -2
  60. package/dist/cjs/biz-components/FeatureCards/FeatureCards.js +1 -1
  61. package/dist/cjs/biz-components/GiftShelf/index.js +1 -1
  62. package/dist/cjs/biz-components/GiftTierShelf/index.js +1 -1
  63. package/dist/cjs/biz-components/Graphic/index.js +1 -1
  64. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  65. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
  66. package/dist/cjs/biz-components/HeroBanner/HeroBannerCarousel.js +1 -1
  67. package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
  68. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js +1 -1
  69. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  70. package/dist/cjs/biz-components/MediaPlayerMulti/index.js +1 -1
  71. package/dist/cjs/biz-components/MemberEquity/index.js +2 -2
  72. package/dist/cjs/biz-components/MiniCart/index.js +1 -1
  73. package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  74. package/dist/cjs/biz-components/ProductHero/ProductHero.js +1 -1
  75. package/dist/cjs/biz-components/ProductNav/ProductNav.js +1 -1
  76. package/dist/cjs/biz-components/PromotionalBar/index.d.ts +3 -2
  77. package/dist/cjs/biz-components/PromotionalBar/index.js +1 -1
  78. package/dist/cjs/biz-components/SceneShelf/ProductCard.js +1 -1
  79. package/dist/cjs/biz-components/SceneShelf/ProductsPanel.js +1 -1
  80. package/dist/cjs/biz-components/SceneShelf/Root.js +1 -1
  81. package/dist/cjs/biz-components/SceneShelf/context.d.ts +11 -1
  82. package/dist/cjs/biz-components/SceneShelf/context.js +1 -1
  83. package/dist/cjs/biz-components/SceneShelf/types.d.ts +5 -0
  84. package/dist/cjs/biz-components/SearchPage/index.js +1 -1
  85. package/dist/cjs/biz-components/SecondaryBanner/index.js +1 -1
  86. package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
  87. package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
  88. package/dist/cjs/biz-components/Title/index.js +1 -1
  89. package/dist/cjs/components/container.js +1 -1
  90. package/dist/cjs/helpers/utils.js +1 -1
  91. package/dist/cjs/shared/track.d.ts +13 -7
  92. package/dist/cjs/shared/track.js +1 -1
  93. package/dist/esm/biz-components/AccordionCards/index.js +1 -1
  94. package/dist/esm/biz-components/ActiveShelf/ProductCard.d.ts +4 -3
  95. package/dist/esm/biz-components/ActiveShelf/ProductCard.js +1 -1
  96. package/dist/esm/biz-components/ActiveShelf/index.js +1 -1
  97. package/dist/esm/biz-components/ActivityMechanism/index.d.ts +4 -7
  98. package/dist/esm/biz-components/ActivityMechanism/index.js +1 -1
  99. package/dist/esm/biz-components/ActivitySchedule/index.js +1 -1
  100. package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
  101. package/dist/esm/biz-components/AnchorNavigation/index.js +1 -1
  102. package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js +1 -1
  103. package/dist/esm/biz-components/BuyOneGetOneShelf/FreeGiftItem.d.ts +2 -0
  104. package/dist/esm/biz-components/BuyOneGetOneShelf/FreeGiftItem.js +1 -1
  105. package/dist/esm/biz-components/BuyOneGetOneShelf/GiftSelection.d.ts +2 -0
  106. package/dist/esm/biz-components/BuyOneGetOneShelf/GiftSelection.js +1 -1
  107. package/dist/esm/biz-components/BuyOneGetOneShelf/PriceAndActions.d.ts +2 -0
  108. package/dist/esm/biz-components/BuyOneGetOneShelf/PriceAndActions.js +1 -1
  109. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +2 -0
  110. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
  111. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductImage.d.ts +4 -0
  112. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductImage.js +1 -1
  113. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductInfo.d.ts +2 -0
  114. package/dist/esm/biz-components/BuyOneGetOneShelf/ProductInfo.js +1 -1
  115. package/dist/esm/biz-components/BuyOneGetOneShelf/index.js +1 -1
  116. package/dist/esm/biz-components/BuyOneGetOneShelf/tracking.d.ts +20 -0
  117. package/dist/esm/biz-components/BuyOneGetOneShelf/tracking.js +1 -0
  118. package/dist/esm/biz-components/BuyOneGetOneShelf/types.d.ts +2 -0
  119. package/dist/esm/biz-components/Category/index.d.ts +4 -2
  120. package/dist/esm/biz-components/Category/index.js +1 -1
  121. package/dist/esm/biz-components/Chat/action.d.ts +25 -0
  122. package/dist/esm/biz-components/Chat/action.js +1 -0
  123. package/dist/esm/biz-components/Chat/button.d.ts +3 -0
  124. package/dist/esm/biz-components/Chat/button.js +1 -0
  125. package/dist/esm/biz-components/Chat/chatContext.d.ts +101 -0
  126. package/dist/esm/biz-components/Chat/chatContext.js +1 -0
  127. package/dist/esm/biz-components/Chat/exports.d.ts +3 -0
  128. package/dist/esm/biz-components/Chat/exports.js +1 -0
  129. package/dist/esm/biz-components/Chat/helpers/fetchResponse.d.ts +14 -0
  130. package/dist/esm/biz-components/Chat/helpers/fetchResponse.js +1 -0
  131. package/dist/esm/biz-components/Chat/helpers/fetcher.d.ts +2 -0
  132. package/dist/esm/biz-components/Chat/helpers/fetcher.js +1 -0
  133. package/dist/esm/biz-components/Chat/index.d.ts +71 -0
  134. package/dist/esm/biz-components/Chat/index.js +1 -0
  135. package/dist/esm/biz-components/Chat/markdown.d.ts +5 -0
  136. package/dist/esm/biz-components/Chat/markdown.js +1 -0
  137. package/dist/esm/biz-components/Chat/messages.d.ts +3 -0
  138. package/dist/esm/biz-components/Chat/messages.js +1 -0
  139. package/dist/esm/biz-components/Chat/props.d.ts +43 -0
  140. package/dist/esm/biz-components/Chat/props.js +1 -0
  141. package/dist/esm/biz-components/Chat/response.d.ts +4 -0
  142. package/dist/esm/biz-components/Chat/response.js +1 -0
  143. package/dist/esm/biz-components/Chat/suggestions.d.ts +3 -0
  144. package/dist/esm/biz-components/Chat/suggestions.js +1 -0
  145. package/dist/esm/biz-components/Chat/utils.d.ts +3 -0
  146. package/dist/esm/biz-components/Chat/utils.js +1 -0
  147. package/dist/esm/biz-components/Evaluate/index.js +1 -1
  148. package/dist/esm/biz-components/EventSchedule/index.js +1 -1
  149. package/dist/esm/biz-components/Faq/Faq.d.ts +3 -1
  150. package/dist/esm/biz-components/Faq/Faq.js +2 -2
  151. package/dist/esm/biz-components/FeatureCards/FeatureCards.js +1 -1
  152. package/dist/esm/biz-components/GiftShelf/index.js +1 -1
  153. package/dist/esm/biz-components/GiftTierShelf/index.js +1 -1
  154. package/dist/esm/biz-components/Graphic/index.js +1 -1
  155. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  156. package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
  157. package/dist/esm/biz-components/HeroBanner/HeroBannerCarousel.js +1 -1
  158. package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
  159. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js +1 -1
  160. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  161. package/dist/esm/biz-components/MediaPlayerMulti/index.js +1 -1
  162. package/dist/esm/biz-components/MemberEquity/index.js +2 -2
  163. package/dist/esm/biz-components/MiniCart/index.js +1 -1
  164. package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
  165. package/dist/esm/biz-components/ProductHero/ProductHero.js +1 -1
  166. package/dist/esm/biz-components/ProductNav/ProductNav.js +1 -1
  167. package/dist/esm/biz-components/PromotionalBar/index.d.ts +3 -2
  168. package/dist/esm/biz-components/PromotionalBar/index.js +1 -1
  169. package/dist/esm/biz-components/SceneShelf/ProductCard.js +1 -1
  170. package/dist/esm/biz-components/SceneShelf/ProductsPanel.js +1 -1
  171. package/dist/esm/biz-components/SceneShelf/Root.js +1 -1
  172. package/dist/esm/biz-components/SceneShelf/context.d.ts +11 -1
  173. package/dist/esm/biz-components/SceneShelf/context.js +1 -1
  174. package/dist/esm/biz-components/SceneShelf/types.d.ts +5 -0
  175. package/dist/esm/biz-components/SearchPage/index.js +1 -1
  176. package/dist/esm/biz-components/SecondaryBanner/index.js +1 -1
  177. package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
  178. package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
  179. package/dist/esm/biz-components/Title/index.js +1 -1
  180. package/dist/esm/components/container.js +1 -1
  181. package/dist/esm/helpers/utils.js +1 -1
  182. package/dist/esm/shared/track.d.ts +13 -7
  183. package/dist/esm/shared/track.js +1 -1
  184. package/dist/tokens/base.css +48 -0
  185. package/package.json +50 -3
  186. package/src/biz-components/Chat/styles/chat.css +14 -0
  187. package/src/biz-components/Chat/styles/css/animations.css +35 -0
  188. package/src/biz-components/Chat/styles/css/button.css +56 -0
  189. package/src/biz-components/Chat/styles/css/colors.css +12 -0
  190. package/src/biz-components/Chat/styles/css/console.css +134 -0
  191. package/src/biz-components/Chat/styles/css/header.css +43 -0
  192. package/src/biz-components/Chat/styles/css/input.css +89 -0
  193. package/src/biz-components/Chat/styles/css/markdown.css +131 -0
  194. package/src/biz-components/Chat/styles/css/messages.css +85 -0
  195. package/src/biz-components/Chat/styles/css/panel.css +23 -0
  196. package/src/biz-components/Chat/styles/css/popup.css +44 -0
  197. package/src/biz-components/Chat/styles/css/response.css +25 -0
  198. package/src/biz-components/Chat/styles/css/sidebar.css +31 -0
  199. package/src/biz-components/Chat/styles/css/suggestions.css +36 -0
  200. package/src/biz-components/Chat/styles/css/window.css +60 -0
  201. package/src/biz-components/Chat/styles/image.png +0 -0
  202. package/style.css +9 -12
  203. package/tailwind.config.js +3 -0
@@ -3,10 +3,12 @@ import type { FaqProps, FaqItem as ItemType, FaqSemanticName } from './types.js'
3
3
  interface FaqItemProps {
4
4
  data: ItemType;
5
5
  index: number;
6
+ /** 当前是否展开,用于点击埋点区分 expand / collapse;不传时按收起处理 */
7
+ isOpen?: boolean;
6
8
  classNames?: Partial<Record<FaqSemanticName, string>>;
7
9
  }
8
10
  declare const FaqItem: {
9
- ({ data, index, classNames }: FaqItemProps): import("react/jsx-runtime").JSX.Element;
11
+ ({ data, index, isOpen, classNames }: FaqItemProps): import("react/jsx-runtime").JSX.Element;
10
12
  displayName: string;
11
13
  };
12
14
  declare const _default: React.ForwardRefExoticComponent<Omit<FaqProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../index.js").ContainerProps & React.RefAttributes<unknown>> & {
@@ -1,4 +1,4 @@
1
- "use strict";"use client";var q=Object.create;var d=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var A=(e,o)=>{for(var t in o)d(e,t,{get:o[t],enumerable:!0})},u=(e,o,t,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of w(o))!N.call(e,i)&&i!==t&&d(e,i,{get:()=>o[i],enumerable:!(s=b(o,i))||s.enumerable});return e};var y=(e,o,t)=>(t=e!=null?q(F(e)):{},u(o||!e||!e.__esModule?d(t,"default",{value:e,enumerable:!0}):t,e)),I=e=>u(d({},"__esModule",{value:!0}),e);var k={};A(k,{FaqItem:()=>c,default:()=>C});module.exports=I(k);var a=require("react/jsx-runtime"),n=y(require("react")),m=y(require("@radix-ui/react-accordion")),l=require("../../components/index.js"),r=require("../../helpers/index.js"),x=require("../../shared/Styles.js");const h=n.default.forwardRef(({data:e,className:o,defaultOpenIndex:t,classNames:s={}},i)=>{const f=(0,n.useRef)(null);(0,n.useImperativeHandle)(i,()=>f.current);const v=(Array.isArray(t)?t:t!==void 0?[t]:e?.openFirst??!0?[0]:[]).map(p=>`item-${p}`);return(0,a.jsxs)("div",{ref:f,className:(0,r.cn)(o,s.root),children:[(0,a.jsx)("style",{children:`
1
+ "use strict";"use client";var T=Object.create;var m=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var $=(e,t)=>{for(var a in t)m(e,a,{get:t[a],enumerable:!0})},y=(e,t,a,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of A(t))!I.call(e,r)&&r!==a&&m(e,r,{get:()=>t[r],enumerable:!(i=k(t,r))||i.enumerable});return e};var x=(e,t,a)=>(a=e!=null?T(C(e)):{},y(t||!e||!e.__esModule?m(a,"default",{value:e,enumerable:!0}):a,e)),H=e=>y(m({},"__esModule",{value:!0}),e);var P={};$(P,{FaqItem:()=>p,default:()=>L});module.exports=H(P);var o=require("react/jsx-runtime"),n=x(require("react")),c=x(require("@radix-ui/react-accordion")),l=require("../../components/index.js"),s=require("../../helpers/index.js"),w=require("../../shared/Styles.js"),F=require("../../hooks/useExposure.js"),g=require("../../shared/track.js");const v="copy",q="faq",b=n.default.forwardRef(({data:e,className:t,defaultOpenIndex:a,classNames:i={}},r)=>{const d=(0,n.useRef)(null);(0,n.useImperativeHandle)(r,()=>d.current),(0,F.useExposure)(d,{componentType:v,componentName:q,componentTitle:e?.productData?.[0]?.title,componentDescription:e?.productData?.[0]?.richDesc??e?.productData?.[0]?.desc});const D=(Array.isArray(a)?a:a!==void 0?[a]:e?.openFirst??!0?[0]:[]).map(f=>`item-${f}`),[h,N]=n.default.useState(D);return(0,o.jsxs)("div",{ref:d,className:(0,s.cn)(t,i.root),children:[(0,o.jsx)("style",{children:`
2
2
  @keyframes faq-slide-down {
3
3
  from { height: 0; opacity: 0; }
4
4
  to { height: var(--radix-accordion-content-height); opacity: 1; }
@@ -7,4 +7,4 @@
7
7
  from { height: var(--radix-accordion-content-height); opacity: 1; }
8
8
  to { height: 0; opacity: 0; }
9
9
  }
10
- `}),(0,a.jsx)(m.Root,{type:"multiple",defaultValue:v,children:e?.productData?.map((p,g)=>(0,a.jsx)(c,{data:p,index:g,classNames:s},g))})]})});h.displayName="Faq";const c=({data:e,index:o,classNames:t={}})=>(0,a.jsxs)(m.Item,{value:`item-${o}`,className:(0,r.cn)("tablet:py-6 border-b border-[#E4E5E6] py-4",t.item),children:[(0,a.jsx)(m.Header,{className:"flex",children:(0,a.jsxs)(m.Trigger,{className:(0,r.cn)("tablet:gap-[128px] group flex flex-1 !cursor-pointer items-center justify-between gap-4 text-left",t.itemHeader),children:[(0,a.jsx)(l.Heading,{as:"h3",html:e?.title,className:(0,r.cn)("desktop:text-base lg-desktop:text-lg text-info-primary text-sm font-bold leading-[1.4]",t.title)}),(0,a.jsx)("div",{className:(0,r.cn)("transition-transform duration-300 group-data-[state=open]:rotate-180",t.icon),children:(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-[20px]",width:"20",height:"21",viewBox:"0 0 20 21",fill:"none",children:(0,a.jsx)("path",{d:"M14.4111 7.41107C14.7365 7.08563 15.264 7.08563 15.5895 7.41107C15.9149 7.73651 15.9149 8.26402 15.5895 8.58946L10.5895 13.5895C10.264 13.9149 9.73651 13.9149 9.41107 13.5895L4.41107 8.58946C4.08563 8.26402 4.08563 7.73651 4.41107 7.41107C4.73651 7.08563 5.26402 7.08563 5.58946 7.41107L10.0003 11.8219L14.4111 7.41107Z",fill:"#1D1D1F"})})})]})}),(0,a.jsx)(m.Content,{forceMount:!0,className:(0,r.cn)("overflow-hidden text-[#4A4C56]","data-[state=closed]:h-0 data-[state=closed]:opacity-0","data-[state=open]:animate-[faq-slide-down_300ms_ease-out]","data-[state=closed]:animate-[faq-slide-up_300ms_ease-out]",t.content),children:(0,a.jsx)("div",{className:"mt-2",children:(0,a.jsx)(l.Text,{html:e?.richDesc??e?.desc,className:(0,r.cn)("desktop:text-base lg-desktop:text-lg [&_a]:text-brand-0 text-sm font-bold leading-[1.4] [&_a]:underline",t.description)})})})]});c.displayName="FaqItem";var C=(0,x.withLayout)(h);
10
+ `}),(0,o.jsx)(c.Root,{type:"multiple",value:h,onValueChange:N,children:e?.productData?.map((f,u)=>(0,o.jsx)(p,{data:f,index:u,classNames:i,isOpen:h.includes(`item-${u}`)},u))})]})});b.displayName="Faq";const p=({data:e,index:t,isOpen:a=!1,classNames:i={}})=>{const r={"data-headless-type-name":`${v}#${q}`,"data-headless-title-desc-button":`${(0,g.toPlainTrackingText)(e?.title)}#${(0,g.toPlainTrackingText)(e?.richDesc??e?.desc)}#${a?"collapse":"expand"}`,"data-headless-nav-position":`#${t+1}`};return(0,o.jsxs)(c.Item,{value:`item-${t}`,className:(0,s.cn)("tablet:py-6 border-b border-[#E4E5E6] py-4",i.item),children:[(0,o.jsx)(c.Header,{className:"flex",children:(0,o.jsxs)(c.Trigger,{...r,className:(0,s.cn)("tablet:gap-[128px] group flex flex-1 !cursor-pointer items-center justify-between gap-4 text-left",i.itemHeader),children:[(0,o.jsx)(l.Heading,{as:"h3",html:e?.title,className:(0,s.cn)("desktop:text-base lg-desktop:text-lg text-info-primary text-sm font-bold leading-[1.4]",i.title)}),(0,o.jsx)("div",{className:(0,s.cn)("transition-transform duration-300 group-data-[state=open]:rotate-180",i.icon),children:(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-[20px]",width:"20",height:"21",viewBox:"0 0 20 21",fill:"none",children:(0,o.jsx)("path",{d:"M14.4111 7.41107C14.7365 7.08563 15.264 7.08563 15.5895 7.41107C15.9149 7.73651 15.9149 8.26402 15.5895 8.58946L10.5895 13.5895C10.264 13.9149 9.73651 13.9149 9.41107 13.5895L4.41107 8.58946C4.08563 8.26402 4.08563 7.73651 4.41107 7.41107C4.73651 7.08563 5.26402 7.08563 5.58946 7.41107L10.0003 11.8219L14.4111 7.41107Z",fill:"#1D1D1F"})})})]})}),(0,o.jsx)(c.Content,{forceMount:!0,className:(0,s.cn)("overflow-hidden text-[#4A4C56]","data-[state=closed]:h-0 data-[state=closed]:opacity-0","data-[state=open]:animate-[faq-slide-down_300ms_ease-out]","data-[state=closed]:animate-[faq-slide-up_300ms_ease-out]",i.content),children:(0,o.jsx)("div",{className:"mt-2",children:(0,o.jsx)(l.Text,{html:e?.richDesc??e?.desc,className:(0,s.cn)("desktop:text-base lg-desktop:text-lg [&_a]:text-brand-0 text-sm font-bold leading-[1.4] [&_a]:underline",i.description)})})})]})};p.displayName="FaqItem";var L=(0,w.withLayout)(b);
@@ -1 +1 @@
1
- "use strict";"use client";var R=Object.create;var c=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty;var D=(e,r)=>{for(var s in r)c(e,s,{get:r[s],enumerable:!0})},b=(e,r,s,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let p of S(r))!L.call(e,p)&&p!==s&&c(e,p,{get:()=>r[p],enumerable:!(i=$(r,p))||i.enumerable});return e};var E=(e,r,s)=>(s=e!=null?R(j(e)):{},b(r||!e||!e.__esModule?c(s,"default",{value:e,enumerable:!0}):s,e)),P=e=>b(c({},"__esModule",{value:!0}),e);var U={};D(U,{default:()=>B});module.exports=P(U);var t=require("react/jsx-runtime"),o=E(require("react")),l=require("../../components/index.js"),f=require("../../helpers/utils.js"),N=require("../../shared/Styles.js"),w=require("../../hooks/useExposure.js"),y=require("../../shared/trackUrlRef.js"),n=require("swiper/react");const m="image",h="feature_cards",I=(e,r)=>r===2?e===0?"laptop:flex-[2]":"laptop:flex-[3]":r===3?"laptop:flex-[1]":r===4?e===0?"laptop:flex-[2]":e===1||e===2?"laptop:flex-[3]":"laptop:flex-[2]":r===5?e<3?"laptop:flex-[1]":e===3?"laptop:flex-[2]":"laptop:flex-[3]":"laptop:flex-[1]",M=(e,r)=>r===4&&e===1||r===5&&e===2,k=o.default.forwardRef(({data:e,className:r},s)=>{const{title:i,subtitle:p,items:u=[],theme:C="light",titleTag:T}=e,x=(0,o.useRef)(null);(0,w.useExposure)(x,{componentType:m,componentName:h,componentTitle:i,componentDescription:p}),(0,o.useImperativeHandle)(s,()=>x.current);const g="rounded-box",F=(a,d)=>{const _=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Picture,{source:a.image?.url,alt:a.image?.alt||a.title,className:"feature-cards__card-image absolute inset-0 !h-full",imgClassName:"!h-full object-cover"}),(0,t.jsxs)("div",{className:"feature-cards__card-content z-10",children:[(0,t.jsx)(l.Heading,{size:3,as:"h2",className:"feature-cards__card-title laptop:text-[20px] desktop:text-[32px] lg-desktop:text-[32px]",children:a.title}),(0,t.jsx)(l.Text,{size:4,as:"p",className:"feature-cards__card-subtitle laptop:h-[42px] lg-desktop:h-[54px] lg-desktop:text-[18px] mt-[4px] line-clamp-2 h-[42px] text-[14px]",children:a.subtitle})]})]}),z="feature-cards__card relative flex h-[360px] max-h-[560px] flex-col justify-end gap-[16px] overflow-hidden px-[16px] py-[12px] text-info-primary tablet:h-[336px] laptop:h-[336px] laptop:px-[16px] laptop:py-[16px] desktop:h-[448px] desktop:px-[32px] desktop:py-[24px] lg-desktop:h-[560px]",H=d!==void 0?I(d,u.length):"flex-1",v=(0,f.cn)(z,g,H,{"aiui-dark":a.theme==="dark","aiui-light":a.theme==="light"});return a.link?(0,t.jsx)("a",{href:(0,y.trackUrlRef)(a.link,`${m}_${h}`),className:v,"data-headless-type-name":`${m}#${h}`,"data-headless-title-desc-button":`${i}#${a.title}#${a.subtitle}`,children:_}):(0,t.jsx)("div",{className:v,children:_})};return(0,t.jsxs)("section",{ref:x,"data-ui-component-id":"FeatureCards",className:(0,f.cn)("feature-cards text-info-primary flex w-full flex-col justify-center",{"aiui-dark":C==="dark"},r),children:[(0,t.jsxs)("div",{className:"feature-cards__header",children:[(0,t.jsx)(l.Heading,{size:4,as:T??"h2",className:"feature-cards__title laptop:text-center text-left",children:i}),p&&(0,t.jsx)(l.Text,{size:2,as:"p",className:"feature-cards__subtitle laptop:text-center desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-left text-[14px]",children:p})]}),(0,t.jsx)("div",{className:"feature-cards__grid laptop:mt-[32px] laptop:flex desktop:mt-[40px] lg-desktop:mt-[24px] mt-[24px] hidden w-full flex-wrap gap-[16px]",children:u.map((a,d)=>(0,t.jsxs)(o.default.Fragment,{children:[F(a,d),M(d,u.length)&&(0,t.jsx)("div",{className:"laptop:basis-full laptop:h-0"})]},a.title))}),(0,t.jsx)("div",{className:"feature-cards__swiper-container laptop:hidden mt-[24px] w-full",children:(0,t.jsx)(n.Swiper,{spaceBetween:12,slidesPerView:"auto",grabCursor:!0,className:"feature-cards__swiper relative w-full !overflow-visible",children:u.map(a=>(0,t.jsx)(n.SwiperSlide,{className:"feature-cards__swiper-slide relative !h-[360px] !w-[296px]",children:(0,t.jsxs)("div",{className:(0,f.cn)("feature-cards__card feature-cards__card--mobile text-info-primary absolute inset-0 flex flex-1 flex-col justify-end gap-[16px] overflow-hidden px-[16px] py-[12px]",g,{"aiui-dark":a.theme==="dark","aiui-light":a.theme==="light"}),children:[(0,t.jsx)(l.Picture,{source:a.image?.url,alt:a.image?.alt||a.title,className:"feature-cards__card-image absolute inset-0 !h-full",imgClassName:"!h-full object-cover"}),(0,t.jsxs)("div",{className:"feature-cards__card-content z-10",children:[(0,t.jsx)(l.Heading,{size:3,as:"h2",className:"feature-cards__card-title",children:a.title}),(0,t.jsx)(l.Text,{size:4,as:"p",className:"feature-cards__card-subtitle laptop:h-[42px] lg-desktop:h-[54px] lg-desktop:text-[18px] mt-[4px] line-clamp-2 h-[42px] overflow-visible text-[14px]",children:a.subtitle})]})]},a.title)},a.title))})})]})});k.displayName="FeatureCards";var B=(0,N.withLayout)(k,{style:"overflow: hidden;"});
1
+ "use strict";"use client";var j=Object.create;var c=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var P=(e,r)=>{for(var s in r)c(e,s,{get:r[s],enumerable:!0})},k=(e,r,s,d)=>{if(r&&typeof r=="object"||typeof r=="function")for(let p of $(r))!E.call(e,p)&&p!==s&&c(e,p,{get:()=>r[p],enumerable:!(d=L(r,p))||d.enumerable});return e};var I=(e,r,s)=>(s=e!=null?j(D(e)):{},k(r||!e||!e.__esModule?c(s,"default",{value:e,enumerable:!0}):s,e)),M=e=>k(c({},"__esModule",{value:!0}),e);var q={};P(q,{default:()=>V});module.exports=M(q);var t=require("react/jsx-runtime"),o=I(require("react")),l=require("../../components/index.js"),f=require("../../helpers/utils.js"),w=require("../../shared/Styles.js"),y=require("../../hooks/useExposure.js"),C=require("../../shared/trackUrlRef.js"),n=require("swiper/react"),T=require("../../hooks/useTracking.js");const h="image",g="feature_cards",B=(e,r)=>r===2?e===0?"laptop:flex-[2]":"laptop:flex-[3]":r===3?"laptop:flex-[1]":r===4?e===0?"laptop:flex-[2]":e===1||e===2?"laptop:flex-[3]":"laptop:flex-[2]":r===5?e<3?"laptop:flex-[1]":e===3?"laptop:flex-[2]":"laptop:flex-[3]":"laptop:flex-[1]",U=(e,r)=>r===4&&e===1||r===5&&e===2,N=o.default.forwardRef(({data:e,className:r},s)=>{const{buildRef:d}=(0,T.useTracking)(),{title:p,subtitle:x,items:u=[],theme:F="light",titleTag:z}=e,m=(0,o.useRef)(null);(0,y.useExposure)(m,{componentType:h,componentName:g,componentTitle:p,componentDescription:x}),(0,o.useImperativeHandle)(s,()=>m.current);const _="rounded-box",H=(a,i)=>{const v=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Picture,{source:a.image?.url,alt:a.image?.alt||a.title,className:"feature-cards__card-image absolute inset-0 !h-full",imgClassName:"!h-full object-cover"}),(0,t.jsxs)("div",{className:"feature-cards__card-content z-10",children:[(0,t.jsx)(l.Heading,{size:3,as:"h2",className:"feature-cards__card-title laptop:text-[20px] desktop:text-[32px] lg-desktop:text-[32px]",children:a.title}),(0,t.jsx)(l.Text,{size:4,as:"p",className:"feature-cards__card-subtitle laptop:h-[42px] lg-desktop:h-[54px] lg-desktop:text-[18px] mt-[4px] line-clamp-2 h-[42px] text-[14px]",children:a.subtitle})]})]}),R="feature-cards__card relative flex h-[360px] max-h-[560px] flex-col justify-end gap-[16px] overflow-hidden px-[16px] py-[12px] text-info-primary tablet:h-[336px] laptop:h-[336px] laptop:px-[16px] laptop:py-[16px] desktop:h-[448px] desktop:px-[32px] desktop:py-[24px] lg-desktop:h-[560px]",S=i!==void 0?B(i,u.length):"flex-1",b=(0,f.cn)(R,_,S,{"aiui-dark":a.theme==="dark","aiui-light":a.theme==="light"});return a.link?(0,t.jsx)("a",{href:(0,C.trackUrlRef)(a.link,d(h,g)),className:b,"data-headless-type-name":`${h}#${g}`,"data-headless-title-desc-button":`${p}#${a.title}#${a.subtitle}`,children:v}):(0,t.jsx)("div",{className:b,children:v})};return(0,t.jsxs)("section",{ref:m,"data-ui-component-id":"FeatureCards",className:(0,f.cn)("feature-cards text-info-primary flex w-full flex-col justify-center",{"aiui-dark":F==="dark"},r),children:[(0,t.jsxs)("div",{className:"feature-cards__header",children:[(0,t.jsx)(l.Heading,{size:4,as:z??"h2",className:"feature-cards__title laptop:text-center text-left",children:p}),x&&(0,t.jsx)(l.Text,{size:2,as:"p",className:"feature-cards__subtitle laptop:text-center desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-left text-[14px]",children:x})]}),(0,t.jsx)("div",{className:"feature-cards__grid laptop:mt-[32px] laptop:flex desktop:mt-[40px] lg-desktop:mt-[24px] mt-[24px] hidden w-full flex-wrap gap-[16px]",children:u.map((a,i)=>(0,t.jsxs)(o.default.Fragment,{children:[H(a,i),U(i,u.length)&&(0,t.jsx)("div",{className:"laptop:basis-full laptop:h-0"})]},a.title))}),(0,t.jsx)("div",{className:"feature-cards__swiper-container laptop:hidden mt-[24px] w-full",children:(0,t.jsx)(n.Swiper,{spaceBetween:12,slidesPerView:"auto",grabCursor:!0,className:"feature-cards__swiper relative w-full !overflow-visible",children:u.map(a=>(0,t.jsx)(n.SwiperSlide,{className:"feature-cards__swiper-slide relative !h-[360px] !w-[296px]",children:(0,t.jsxs)("div",{className:(0,f.cn)("feature-cards__card feature-cards__card--mobile text-info-primary absolute inset-0 flex flex-1 flex-col justify-end gap-[16px] overflow-hidden px-[16px] py-[12px]",_,{"aiui-dark":a.theme==="dark","aiui-light":a.theme==="light"}),children:[(0,t.jsx)(l.Picture,{source:a.image?.url,alt:a.image?.alt||a.title,className:"feature-cards__card-image absolute inset-0 !h-full",imgClassName:"!h-full object-cover"}),(0,t.jsxs)("div",{className:"feature-cards__card-content z-10",children:[(0,t.jsx)(l.Heading,{size:3,as:"h2",className:"feature-cards__card-title",children:a.title}),(0,t.jsx)(l.Text,{size:4,as:"p",className:"feature-cards__card-subtitle laptop:h-[42px] lg-desktop:h-[54px] lg-desktop:text-[18px] mt-[4px] line-clamp-2 h-[42px] overflow-visible text-[14px]",children:a.subtitle})]})]},a.title)},a.title))})})]})});N.displayName="FeatureCards";var V=(0,w.withLayout)(N,{style:"overflow: hidden;"});
@@ -1 +1 @@
1
- "use strict";"use client";var rt=Object.create;var B=Object.defineProperty;var it=Object.getOwnPropertyDescriptor;var lt=Object.getOwnPropertyNames;var ut=Object.getPrototypeOf,ct=Object.prototype.hasOwnProperty;var dt=(t,e)=>{for(var n in e)B(t,n,{get:e[n],enumerable:!0})},U=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of lt(e))!ct.call(t,r)&&r!==n&&B(t,r,{get:()=>e[r],enumerable:!(s=it(e,r))||s.enumerable});return t};var ft=(t,e,n)=>(n=t!=null?rt(ut(t)):{},U(e||!t||!t.__esModule?B(n,"default",{value:t,enumerable:!0}):n,t)),pt=t=>U(B({},"__esModule",{value:!0}),t);var bt={};dt(bt,{default:()=>xt});module.exports=pt(bt);var o=require("react/jsx-runtime"),a=ft(require("react")),p=require("../../helpers/index.js"),u=require("../../components/index.js"),b=require("class-variance-authority"),V=require("swiper/react"),Y=require("../../shared/Styles.js"),Z=require("../Listing/utils/index.js"),tt=require("../AiuiProvider/index.js"),I=require("../Listing/utils/textFormat.js");const mt=(0,b.cva)("desktop:px-6 rounded-card relative min-w-0 overflow-hidden p-4",{variants:{state:{light:"bg-[#EAEAEC]",dark:"bg-[#1E2024]"}},defaultVariants:{state:"light"}}),ht=(0,b.cva)("",{variants:{layout:{vertical:"",horizontal:"desktop:flex desktop:flex-row desktop:items-stretch desktop:gap-10"}},defaultVariants:{layout:"vertical"}}),gt=(0,b.cva)("desktop:max-w-[268px] lg-desktop:max-w-[356px] lg-desktop:h-[171px] relative mx-auto h-[118px] max-w-[256px] ",{variants:{layout:{vertical:"",horizontal:"desktop:flex-1 desktop:h-[122px] lg-desktop:h-[161px]"}},defaultVariants:{layout:"vertical"}}),wt=(0,b.cva)("mt-3",{variants:{layout:{vertical:"",horizontal:"desktop:mt-0 desktop:flex-1 desktop:flex desktop:flex-col desktop:justify-center"}},defaultVariants:{layout:"vertical"}}),St=(0,b.cva)("mt-4 self-start",{variants:{state:{light:"bg-[#080A0F] text-white",dark:"bg-white text-[#080A0F]"}},defaultVariants:{state:"light"}}),N=(0,b.cva)("",{variants:{state:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{state:"light"}}),q=t=>{if(!t)return;const e=[];return t.lgDesktop?.url&&e.push(`${t.lgDesktop.url} 1920`),t.desktop?.url&&e.push(`${t.desktop.url} 1439`),t.laptop?.url&&e.push(`${t.laptop.url} 1024`),t.tablet?.url&&e.push(`${t.tablet.url} 767`),t.default?.url&&e.push(t.default.url),e.length>0?e.join(", "):void 0},O=t=>t&&(t.default?.alt||t.tablet?.alt||t.laptop?.alt||t.desktop?.alt||t.lgDesktop?.alt)||"",vt=t=>{const e=Math.floor(t/3600),n=Math.floor(t%3600/60),s=t%60;return`${e.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`},j=t=>{if(typeof t=="number")return t;const e=new Date(t).getTime();return isNaN(e)?0:e},H=t=>{if(!t)return!1;const e=j(t.startTime),n=(t.durationDays??1)*24*3600*1e3,s=t.rounds??1,r=Date.now();if(r<e)return!1;const g=r-e,d=Math.floor(g/n)+1;if(d>s)return!1;const m=e+d*n-r,i=5*60*1e3;return m<=i&&m>0},W=(t,e)=>{if(!t||!e)return t||"";const n=j(e.startTime),s=(e.durationDays??1)*24*3600*1e3,r=e.rounds??1,g=Date.now();if(g<n){const w=new Date(n),c=`${(w.getUTCMonth()+1).toString().padStart(2,"0")}${w.getUTCDate().toString().padStart(2,"0")}`;return`${t}${c}`}const d=g-n,S=Math.min(Math.floor(d/s)+1,r),m=n+(S-1)*s,i=new Date(m),h=`${(i.getUTCMonth()+1).toString().padStart(2,"0")}${i.getUTCDate().toString().padStart(2,"0")}`;return`${t}${h}`},J=a.memo(({config:t,theme:e="light",className:n,countdownText:s="Next round start time",lastRoundText:r="Last round",beforeStartText:g="Start time",countdownIcon:d,onStateChange:S})=>{const[m,i]=a.useState(0),[h,w]=a.useState("beforeStart"),c=a.useMemo(()=>j(t.startTime),[t.startTime]),v=t.rounds??1,y=(t.durationDays??1)*24*3600*1e3;a.useEffect(()=>{const M=()=>{const k=Date.now();if(k<c){const $=Math.max(0,Math.floor((c-k)/1e3));i($),w("beforeStart");return}const P=k-c,C=Math.floor(P/y)+1;if(C>v){w("finished");return}const G=c+C*y,l=Math.max(0,Math.floor((G-k)/1e3));i(l),w(C===v?"lastRound":"running")};M();const D=setInterval(M,1e3);return()=>clearInterval(D)},[c,y,v]),a.useEffect(()=>{S?.(h)},[h,S]);const A=a.useMemo(()=>{switch(h){case"beforeStart":return g;case"lastRound":return r;default:return s}},[h,g,r,s]);return h==="finished"?null:(0,o.jsxs)("div",{className:(0,p.cn)("desktop:gap-2 laptop:text-base flex items-center gap-1 text-sm",e==="dark"?"text-white":"text-[#080A0F]",n),children:[d&&(0,o.jsx)(u.Picture,{source:d.url,alt:d.alt,className:"laptop:size-5 size-4 shrink-0",imgClassName:"size-full object-contain"}),(0,o.jsx)(u.Text,{html:A,className:"whitespace-nowrap font-bold"}),(0,o.jsx)("span",{className:"font-bold",children:"|"}),(0,o.jsx)(u.Text,{className:"font-bold",html:vt(m)})]})});J.displayName="Countdown";const K=a.memo(({progress:t,theme:e="light",className:n})=>{const s=Math.min(100,Math.max(0,t));return(0,o.jsx)("div",{className:(0,p.cn)("flex h-2 w-full items-stretch overflow-hidden rounded-full",e==="dark"?"bg-white/20":"bg-black/20",n),role:"progressbar","aria-valuenow":s,"aria-valuemin":0,"aria-valuemax":100,children:(0,o.jsx)("div",{className:(0,p.cn)("h-full rounded-full transition-all duration-300",e==="dark"?"bg-white":"bg-[#080A0F]"),style:{width:`${s}%`}})})});K.displayName="ProgressBar";const Q=a.memo(({item:t,theme:e="light",layout:n="vertical",className:s,buttonClassName:r,countdownClassName:g,onButtonClick:d,onProductImageClick:S,buildData:m,buttonText:i,remainText:h,lowStockText:w,soldOutButtonText:c,discountText:v="Only {price}",countdownText:y,countdownIcon:A,lastRoundText:M,beforeStartText:D,comingSoonButtonText:k,loading:P})=>{const{locale:C="us",currencyCode:G}=(0,tt.useAiuiContext)(),l=t.products?.[0],[$,et]=a.useState(()=>H(t.countdown)),[F,ot]=a.useState(()=>W(t.codePrefix,t.countdown)),[z,nt]=a.useState("beforeStart");a.useEffect(()=>{const x=()=>{et(H(t.countdown));const _=W(t.codePrefix,t.countdown);ot(L=>L!==_?_:L)};x();const E=setInterval(x,1e3);return()=>clearInterval(E)},[t.codePrefix,t.countdown]);const at=a.useCallback(x=>{nt(x)},[]),R=a.useMemo(()=>!l?.handle||!m?.products?.length?null:m.products.find(x=>x.handle===l.handle)||null,[l?.handle,m?.products]),f=a.useMemo(()=>R?.variants?.find(x=>x?.sku===l?.sku)||{},[l?.sku,R?.variants]),T=a.useMemo(()=>{const{price:x,basePrice:E}=(0,Z.formatVariantPrice)({locale:G==="CAD"?"us":C||"us",baseAmount:f?.price?.amount,amount:l?.custom_price??f?.price?.amount,currencyCode:R?.price?.currencyCode||"USD"});return{value:E,description:l?.custom_description,salePrice:(0,I.replaceTemplate)(v||"",{price:x})}},[R,f,C,v,l?.custom_price,l?.custom_description]),st=a.useCallback(()=>{d?.({product:l,code:F})},[d,F,l]);return(0,o.jsxs)("div",{className:(0,p.cn)(mt({state:e}),s),"data-ui-component-id":"GiftShelfCard",children:[t.countdown&&(0,o.jsx)("div",{className:"laptop:h-[24px] mb-4 h-[20px]",children:(0,o.jsx)(J,{config:t.countdown,theme:e,className:g,countdownText:y,lastRoundText:M,beforeStartText:D,countdownIcon:A,onStateChange:at})}),(0,o.jsxs)("div",{className:ht({layout:n}),children:[(0,o.jsxs)("div",{className:gt({layout:n}),children:[t.backgroundImage&&(S?(0,o.jsx)("a",{onClick:()=>l&&S(l),className:"cursor-pointer",children:(0,o.jsx)(u.Picture,{source:q(t.backgroundImage),alt:O(t.backgroundImage),className:"rounded-card size-full overflow-hidden object-cover",imgClassName:"h-full w-full object-cover"})}):(0,o.jsx)(u.Picture,{source:q(t.backgroundImage),alt:O(t.backgroundImage),className:"rounded-card size-full overflow-hidden object-cover",imgClassName:"h-full w-full object-cover"})),(0,o.jsx)("div",{className:"absolute top-1/2 z-10 w-full -translate-y-1/2 px-6",children:(0,o.jsxs)("div",{className:"flex flex-col gap-1",children:[T.value&&(0,o.jsx)(u.Heading,{html:T.value,size:4,className:(0,p.cn)("font-bold leading-none",N({state:e}))}),T.description&&(0,o.jsx)(u.Text,{html:T.description,className:(0,p.cn)("text-base font-bold opacity-60",N({state:e}))})]})})]}),(0,o.jsxs)("div",{className:wt({layout:n}),children:[T.salePrice&&(0,o.jsx)(u.Text,{as:"p",html:T.salePrice,className:(0,p.cn)("lg-desktop:text-2xl text-xl font-bold",N({state:e}))}),(0,o.jsx)(K,{progress:l?.custom_inventory?(f?.quantityAvailable||0)/l.custom_inventory*100:0,theme:e,className:(0,p.cn)("mb-1 mt-2",f?.availableForSale&&(f?.quantityAvailable??0)<=0&&"invisible")}),h&&(f?.quantityAvailable??0)>=0&&(0,o.jsx)(u.Text,{html:(0,I.replaceTemplate)(h,{inventory:l?.custom_inventory?.toString()||"",quantity:f?.quantityAvailable?.toString()||"0"}),as:"p",className:(0,p.cn)("laptop:text-base text-sm font-bold",N({state:e}))}),w&&f?.availableForSale&&(f?.quantityAvailable??0)<0&&(0,o.jsx)(u.Text,{html:w,as:"p",className:(0,p.cn)("laptop:text-base text-sm font-bold text-red-500",N({state:e}))}),(0,o.jsx)(u.Button,{size:"lg",className:(0,p.cn)(St({state:e}),r),onClick:st,disabled:!f?.availableForSale||P||$||z==="beforeStart"||z==="finished",loading:P&&f?.availableForSale,children:z==="beforeStart"?k||i:f?.availableForSale?i:c||i})]})]})]})});Q.displayName="GiftShelfCard";const X=a.forwardRef(({classNames:t={},data:e,onButtonClick:n,onProductImageClick:s,buildData:r,loading:g,...d},S)=>{const m=e.theme||"light",i=a.useMemo(()=>e?.items?.length||4,[e?.items]),h=i===2?"horizontal":"vertical",w=a.useMemo(()=>{const c=v=>{switch(v){case"mobile":return{slidesPerView:1.2,spaceBetween:12};case"tablet":return i<=2?{slidesPerView:2,spaceBetween:12}:{slidesPerView:2.5,spaceBetween:12};case"laptop":return i<=3?{slidesPerView:i,spaceBetween:16}:{slidesPerView:3.01,spaceBetween:16};case"desktop":return{slidesPerView:Math.min(i,4),spaceBetween:20}}};return{0:c("mobile"),768:c("tablet"),1025:c("laptop"),1440:c("desktop")}},[i]);return(0,o.jsx)(u.Container,{ref:S,className:(0,p.cn)(t?.root),childClassName:"overflow-hidden","data-ui-component-id":"GiftShelf",...d,children:(0,o.jsx)(V.Swiper,{breakpoints:w,className:"w-full !overflow-visible",children:e.items.map((c,v)=>(0,o.jsx)(V.SwiperSlide,{children:(0,o.jsx)(Q,{item:c,theme:m,layout:h,className:t?.card,buttonClassName:t?.button,countdownClassName:t?.countdown,onButtonClick:n,onProductImageClick:s,buildData:r,buttonText:e.buttonText,discountText:e.discountText,remainText:e.remainText,lowStockText:e.lowStockText,soldOutButtonText:e.soldOutButtonText,countdownText:e.countdownText,lastRoundText:e.lastRoundText,countdownIcon:e?.countdownIcon,beforeStartText:e.beforeStartText,comingSoonButtonText:e.comingSoonButtonText,loading:g})},"giftShelfCardItem"+v))})})});X.displayName="GiftShelf";var xt=(0,Y.withLayout)(X);
1
+ "use strict";"use client";var vt=Object.create;var $=Object.defineProperty;var St=Object.getOwnPropertyDescriptor;var wt=Object.getOwnPropertyNames;var xt=Object.getPrototypeOf,kt=Object.prototype.hasOwnProperty;var bt=(t,e)=>{for(var n in e)$(t,n,{get:e[n],enumerable:!0})},K=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of wt(e))!kt.call(t,r)&&r!==n&&$(t,r,{get:()=>e[r],enumerable:!(i=St(e,r))||i.enumerable});return t};var Ct=(t,e,n)=>(n=t!=null?vt(xt(t)):{},K(e||!t||!t.__esModule?$(n,"default",{value:t,enumerable:!0}):n,t)),Tt=t=>K($({},"__esModule",{value:!0}),t);var At={};bt(At,{default:()=>Vt});module.exports=Tt(At);var o=require("react/jsx-runtime"),s=Ct(require("react")),g=require("../../helpers/index.js"),u=require("../../components/index.js"),y=require("class-variance-authority"),_=require("swiper/react"),rt=require("../../shared/Styles.js"),at=require("../Listing/utils/index.js"),it=require("../AiuiProvider/index.js"),q=require("../Listing/utils/textFormat.js"),lt=require("../../hooks/useExposure.js"),ut=require("../../hooks/useViewItemList.js"),ct=require("../../hooks/useTracking.js"),A=require("../../shared/track.js");const E="image",P="gift_shelf",Q=(t,e,n)=>{const i=n?.find(d=>d.handle===t.handle),r=i?.variants?.find(d=>d?.sku===t.sku);return{item_id:t.sku||"",item_name:r?.title||i?.title||t.name||"",item_variant:r?.title||"",price:String(t.custom_price??r?.price?.amount??""),index:e+1}},yt=(0,y.cva)("desktop:px-6 rounded-card relative min-w-0 overflow-hidden p-4",{variants:{state:{light:"bg-[#EAEAEC]",dark:"bg-[#1E2024]"}},defaultVariants:{state:"light"}}),Nt=(0,y.cva)("",{variants:{layout:{vertical:"",horizontal:"desktop:flex desktop:flex-row desktop:items-stretch desktop:gap-10"}},defaultVariants:{layout:"vertical"}}),Mt=(0,y.cva)("desktop:max-w-[268px] lg-desktop:max-w-[356px] lg-desktop:h-[171px] relative mx-auto h-[118px] max-w-[256px] ",{variants:{layout:{vertical:"",horizontal:"desktop:flex-1 desktop:h-[122px] lg-desktop:h-[161px]"}},defaultVariants:{layout:"vertical"}}),Pt=(0,y.cva)("mt-3",{variants:{layout:{vertical:"",horizontal:"desktop:mt-0 desktop:flex-1 desktop:flex desktop:flex-col desktop:justify-center"}},defaultVariants:{layout:"vertical"}}),Rt=(0,y.cva)("mt-4 self-start",{variants:{state:{light:"bg-[#080A0F] text-white",dark:"bg-white text-[#080A0F]"}},defaultVariants:{state:"light"}}),V=(0,y.cva)("",{variants:{state:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{state:"light"}}),X=t=>{if(!t)return;const e=[];return t.lgDesktop?.url&&e.push(`${t.lgDesktop.url} 1920`),t.desktop?.url&&e.push(`${t.desktop.url} 1439`),t.laptop?.url&&e.push(`${t.laptop.url} 1024`),t.tablet?.url&&e.push(`${t.tablet.url} 767`),t.default?.url&&e.push(t.default.url),e.length>0?e.join(", "):void 0},Y=t=>t&&(t.default?.alt||t.tablet?.alt||t.laptop?.alt||t.desktop?.alt||t.lgDesktop?.alt)||"",Bt=t=>{const e=Math.floor(t/3600),n=Math.floor(t%3600/60),i=t%60;return`${e.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`},U=t=>{if(typeof t=="number")return t;const e=new Date(t).getTime();return isNaN(e)?0:e},Z=t=>{if(!t)return!1;const e=U(t.startTime),n=(t.durationDays??1)*24*3600*1e3,i=t.rounds??1,r=Date.now();if(r<e)return!1;const d=r-e,h=Math.floor(d/n)+1;if(h>i)return!1;const p=e+h*n-r,l=5*60*1e3;return p<=l&&p>0},tt=(t,e)=>{if(!t||!e)return t||"";const n=U(e.startTime),i=(e.durationDays??1)*24*3600*1e3,r=e.rounds??1,d=Date.now();if(d<n){const c=new Date(n),S=`${(c.getUTCMonth()+1).toString().padStart(2,"0")}${c.getUTCDate().toString().padStart(2,"0")}`;return`${t}${S}`}const h=d-n,w=Math.min(Math.floor(h/i)+1,r),p=n+(w-1)*i,l=new Date(p),v=`${(l.getUTCMonth()+1).toString().padStart(2,"0")}${l.getUTCDate().toString().padStart(2,"0")}`;return`${t}${v}`},et=s.memo(({config:t,theme:e="light",className:n,countdownText:i="Next round start time",lastRoundText:r="Last round",beforeStartText:d="Start time",countdownIcon:h,onStateChange:w})=>{const[p,l]=s.useState(0),[v,c]=s.useState("beforeStart"),S=s.useMemo(()=>U(t.startTime),[t.startTime]),C=t.rounds??1,m=(t.durationDays??1)*24*3600*1e3;s.useEffect(()=>{const T=()=>{const N=Date.now();if(N<S){const G=Math.max(0,Math.floor((S-N)/1e3));l(G),c("beforeStart");return}const D=N-S,b=Math.floor(D/m)+1;if(b>C){c("finished");return}const I=S+b*m,R=Math.max(0,Math.floor((I-N)/1e3));l(R),c(b===C?"lastRound":"running")};T();const z=setInterval(T,1e3);return()=>clearInterval(z)},[S,m,C]),s.useEffect(()=>{w?.(v)},[v,w]);const x=s.useMemo(()=>{switch(v){case"beforeStart":return d;case"lastRound":return r;default:return i}},[v,d,r,i]);return v==="finished"?null:(0,o.jsxs)("div",{className:(0,g.cn)("desktop:gap-2 laptop:text-base flex items-center gap-1 text-sm",e==="dark"?"text-white":"text-[#080A0F]",n),children:[h&&(0,o.jsx)(u.Picture,{source:h.url,alt:h.alt,className:"laptop:size-5 size-4 shrink-0",imgClassName:"size-full object-contain"}),(0,o.jsx)(u.Text,{html:x,className:"whitespace-nowrap font-bold"}),(0,o.jsx)("span",{className:"font-bold",children:"|"}),(0,o.jsx)(u.Text,{className:"font-bold",html:Bt(p)})]})});et.displayName="Countdown";const ot=s.memo(({progress:t,theme:e="light",className:n})=>{const i=Math.min(100,Math.max(0,t));return(0,o.jsx)("div",{className:(0,g.cn)("flex h-2 w-full items-stretch overflow-hidden rounded-full",e==="dark"?"bg-white/20":"bg-black/20",n),role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:(0,o.jsx)("div",{className:(0,g.cn)("h-full rounded-full transition-all duration-300",e==="dark"?"bg-white":"bg-[#080A0F]"),style:{width:`${i}%`}})})});ot.displayName="ProgressBar";const nt=s.memo(({item:t,theme:e="light",layout:n="vertical",className:i,buttonClassName:r,countdownClassName:d,onButtonClick:h,onProductImageClick:w,buildData:p,buttonText:l,remainText:v,lowStockText:c,soldOutButtonText:S,discountText:C="Only {price}",countdownText:m,countdownIcon:x,lastRoundText:T,beforeStartText:z,comingSoonButtonText:N,loading:D,position:b})=>{const{locale:I="us",currencyCode:R}=(0,it.useAiuiContext)(),{pageGroup:G}=(0,ct.useTracking)(),a=t.products?.[0],[dt,pt]=s.useState(()=>Z(t.countdown)),[O,mt]=s.useState(()=>tt(t.codePrefix,t.countdown)),[L,ft]=s.useState("beforeStart");s.useEffect(()=>{const k=()=>{pt(Z(t.countdown));const W=tt(t.codePrefix,t.countdown);mt(J=>J!==W?W:J)};k();const F=setInterval(k,1e3);return()=>clearInterval(F)},[t.codePrefix,t.countdown]);const ht=s.useCallback(k=>{ft(k)},[]),B=s.useMemo(()=>!a?.handle||!p?.products?.length?null:p.products.find(k=>k.handle===a.handle)||null,[a?.handle,p?.products]),f=s.useMemo(()=>B?.variants?.find(k=>k?.sku===a?.sku)||{},[a?.sku,B?.variants]),M=s.useMemo(()=>{const{price:k,basePrice:F}=(0,at.formatVariantPrice)({locale:R==="CAD"?"us":I||"us",baseAmount:f?.price?.amount,amount:a?.custom_price??f?.price?.amount,currencyCode:B?.price?.currencyCode||"USD"});return{value:F,description:a?.custom_description,salePrice:(0,q.replaceTemplate)(C||"",{price:k})}},[B,f,I,C,a?.custom_price,a?.custom_description]),j=s.useCallback(()=>{a&&(0,A.trackSelectItem)({pageGroup:G,currency:R||"USD",itemListName:P,position:b+1,items:[Q(a,b,p?.products)]})},[a,G,R,b,p?.products]),gt=s.useCallback(()=>{j(),h?.({product:a,code:O})},[j,h,O,a]),H=f?.title||B?.title||a?.name;return(0,o.jsxs)("div",{className:(0,g.cn)(yt({state:e}),i),"data-ui-component-id":"GiftShelfCard",children:[t.countdown&&(0,o.jsx)("div",{className:"laptop:h-[24px] mb-4 h-[20px]",children:(0,o.jsx)(et,{config:t.countdown,theme:e,className:d,countdownText:m,lastRoundText:T,beforeStartText:z,countdownIcon:x,onStateChange:ht})}),(0,o.jsxs)("div",{className:Nt({layout:n}),children:[(0,o.jsxs)("div",{className:Mt({layout:n}),children:[t.backgroundImage&&(w?(0,o.jsx)("a",{onClick:()=>{a&&(j(),w(a))},className:"cursor-pointer",...(0,A.buildClickTrackingProps)({interactive:!!a,componentType:E,componentName:P,title:H,sku:a?.sku,position:b+1}),children:(0,o.jsx)(u.Picture,{source:X(t.backgroundImage),alt:Y(t.backgroundImage),className:"rounded-card size-full overflow-hidden object-cover",imgClassName:"h-full w-full object-cover"})}):(0,o.jsx)(u.Picture,{source:X(t.backgroundImage),alt:Y(t.backgroundImage),className:"rounded-card size-full overflow-hidden object-cover",imgClassName:"h-full w-full object-cover"})),(0,o.jsx)("div",{className:"absolute top-1/2 z-10 w-full -translate-y-1/2 px-6",children:(0,o.jsxs)("div",{className:"flex flex-col gap-1",children:[M.value&&(0,o.jsx)(u.Heading,{html:M.value,size:4,className:(0,g.cn)("font-bold leading-none",V({state:e}))}),M.description&&(0,o.jsx)(u.Text,{html:M.description,className:(0,g.cn)("text-base font-bold opacity-60",V({state:e}))})]})})]}),(0,o.jsxs)("div",{className:Pt({layout:n}),children:[M.salePrice&&(0,o.jsx)(u.Text,{as:"p",html:M.salePrice,className:(0,g.cn)("lg-desktop:text-2xl text-xl font-bold",V({state:e}))}),(0,o.jsx)(ot,{progress:a?.custom_inventory?(f?.quantityAvailable||0)/a.custom_inventory*100:0,theme:e,className:(0,g.cn)("mb-1 mt-2",f?.availableForSale&&(f?.quantityAvailable??0)<=0&&"invisible")}),v&&(f?.quantityAvailable??0)>=0&&(0,o.jsx)(u.Text,{html:(0,q.replaceTemplate)(v,{inventory:a?.custom_inventory?.toString()||"",quantity:f?.quantityAvailable?.toString()||"0"}),as:"p",className:(0,g.cn)("laptop:text-base text-sm font-bold",V({state:e}))}),c&&f?.availableForSale&&(f?.quantityAvailable??0)<0&&(0,o.jsx)(u.Text,{html:c,as:"p",className:(0,g.cn)("laptop:text-base text-sm font-bold text-red-500",V({state:e}))}),(0,o.jsx)(u.Button,{size:"lg",className:(0,g.cn)(Rt({state:e}),r),onClick:gt,...(0,A.buildClickTrackingProps)({interactive:!!a,componentType:E,componentName:P,title:H,buttonName:l,sku:a?.sku,position:b+1}),disabled:!f?.availableForSale||D||dt||L==="beforeStart"||L==="finished",loading:D&&f?.availableForSale,children:L==="beforeStart"?N||l:f?.availableForSale?l:S||l})]})]})]})});nt.displayName="GiftShelfCard";const st=s.forwardRef(({classNames:t={},data:e,onButtonClick:n,onProductImageClick:i,buildData:r,loading:d,...h},w)=>{const p=e.theme||"light",l=s.useRef(null);s.useImperativeHandle(w,()=>l.current);const v=s.useMemo(()=>e.items.flatMap((m,x)=>{const T=m.products?.[0];return T?[Q(T,x,r?.products)]:[]}),[e.items,r?.products]);(0,lt.useExposure)(l,{componentType:E,componentName:P,componentTitle:e.items?.[0]?.products?.[0]?.name}),(0,ut.useViewItemList)(l,{componentType:E,componentName:P,itemListName:P,items:v});const c=s.useMemo(()=>e?.items?.length||4,[e?.items]),S=c===2?"horizontal":"vertical",C=s.useMemo(()=>{const m=x=>{switch(x){case"mobile":return{slidesPerView:1.2,spaceBetween:12};case"tablet":return c<=2?{slidesPerView:2,spaceBetween:12}:{slidesPerView:2.5,spaceBetween:12};case"laptop":return c<=3?{slidesPerView:c,spaceBetween:16}:{slidesPerView:3.01,spaceBetween:16};case"desktop":return{slidesPerView:Math.min(c,4),spaceBetween:20}}};return{0:m("mobile"),768:m("tablet"),1025:m("laptop"),1440:m("desktop")}},[c]);return(0,o.jsx)(u.Container,{ref:l,className:(0,g.cn)(t?.root),childClassName:"overflow-hidden","data-ui-component-id":"GiftShelf",...h,children:(0,o.jsx)(_.Swiper,{breakpoints:C,className:"w-full !overflow-visible",children:e.items.map((m,x)=>(0,o.jsx)(_.SwiperSlide,{children:(0,o.jsx)(nt,{item:m,theme:p,layout:S,className:t?.card,buttonClassName:t?.button,countdownClassName:t?.countdown,onButtonClick:n,onProductImageClick:i,buildData:r,buttonText:e.buttonText,discountText:e.discountText,remainText:e.remainText,lowStockText:e.lowStockText,soldOutButtonText:e.soldOutButtonText,countdownText:e.countdownText,lastRoundText:e.lastRoundText,countdownIcon:e?.countdownIcon,beforeStartText:e.beforeStartText,comingSoonButtonText:e.comingSoonButtonText,loading:d,position:x})},"giftShelfCardItem"+x))})})});st.displayName="GiftShelf";var Vt=(0,rt.withLayout)(st);
@@ -1 +1 @@
1
- "use strict";"use client";var D=Object.create;var v=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty;var q=(e,i)=>{for(var s in i)v(e,s,{get:i[s],enumerable:!0})},b=(e,i,s,u)=>{if(i&&typeof i=="object"||typeof i=="function")for(let l of H(i))!_.call(e,l)&&l!==s&&v(e,l,{get:()=>i[l],enumerable:!(u=E(i,l))||u.enumerable});return e};var P=(e,i,s)=>(s=e!=null?D(R(e)):{},b(i||!e||!e.__esModule?v(s,"default",{value:e,enumerable:!0}):s,e)),J=e=>b(v({},"__esModule",{value:!0}),e);var Q={};q(Q,{default:()=>O});module.exports=J(Q);var t=require("react/jsx-runtime"),o=P(require("react")),d=require("../../helpers/index.js"),a=require("../../components/index.js"),N=require("class-variance-authority"),h=require("swiper/react"),M=P(require("swiper/modules")),F=require("../../shared/Styles.js"),z=require("../AiuiProvider/index.js"),j=require("../Listing/utils/index.js");const K=(0,N.cva)("lg-desktop:h-[400px] rounded-card desktop:pt-4 desktop:pb-6 relative flex h-[320px] flex-col items-start gap-1 overflow-hidden p-4",{variants:{theme:{light:"bg-gradient-to-b from-[#FCCA7B] to-[#FFE6BF]",dark:"bg-gradient-to-b from-[#3A3A3A] to-[#1D1D1F]"}},defaultVariants:{theme:"light"}}),y=(0,N.cva)("",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{theme:"light"}}),V=o.memo(({image:e})=>e?(0,t.jsx)(a.Picture,{source:e.url,alt:e.alt||"Member Tag",className:"h-full w-auto",imgClassName:"h-full w-auto object-contain"}):null);V.displayName="MemberTag";const G=o.memo(({theme:e="light"})=>{const i=e==="light"?"bg-[#f6cd4e]":"bg-[#F5F6F7]";return(0,t.jsx)("div",{className:"flex h-4 w-full items-center",children:(0,t.jsx)("div",{className:(0,d.cn)("flex h-1 w-full items-center justify-center",i),children:(0,t.jsx)("div",{className:(0,d.cn)("relative size-4 shrink-0 rounded-full",i)})})})});G.displayName="TimelineItem";const B=o.memo(({item:e,theme:i="light",className:s,onClick:u,onProductImageClick:l,buildData:g})=>{const{locale:x="us"}=(0,z.useAiuiContext)(),n=e.products?.[0],m=o.useMemo(()=>!n?.handle||!g?.products?.length?null:g.products.find(w=>w.handle===n.handle)||null,[n?.handle,g?.products]),p=o.useMemo(()=>m?.variants?.find(w=>w?.sku===n?.sku)||{},[n?.sku,m?.variants]),k=(0,j.formatPrice)({locale:x||"us",amount:n?.custom_price??p?.price?.amount,currencyCode:m?.price?.currencyCode||"USD"});return(0,t.jsxs)("div",{className:(0,d.cn)(K({theme:i}),s),onClick:u,"data-ui-component-id":"GiftTierCard",children:[(0,t.jsx)("div",{className:"lg-desktop:h-[28px] z-10 h-6",children:e.showMemberTag&&e.memberTagImage&&(0,t.jsx)(V,{image:e.memberTagImage})}),(0,t.jsx)("div",{className:"relative z-10 mx-auto min-h-0 w-fit flex-1",children:l?(0,t.jsx)("a",{onClick:l,className:"cursor-pointer",children:(0,t.jsx)(a.Picture,{source:p?.image?.url||m?.images[0]?.url,className:"size-full",imgClassName:"size-full object-contain"})}):(0,t.jsx)(a.Picture,{source:p?.image?.url||m?.images[0]?.url,className:"size-full",imgClassName:"size-full object-contain"})}),(0,t.jsxs)("div",{className:(0,d.cn)("z-10 flex w-full shrink-0 flex-col gap-2",y({theme:i})),children:[(0,t.jsxs)("div",{className:"flex items-end gap-1",children:[(0,t.jsx)(a.Heading,{html:k,size:4,className:"font-bold leading-[1.2] tracking-[-0.04em]"}),e.valueUnit&&(0,t.jsx)(a.Text,{html:e.valueUnit,className:"lg-desktop:text-2xl text-xl font-bold leading-[1.2] tracking-[-0.04em]"})]}),(0,t.jsx)(a.Text,{html:p?.title||m?.title,className:"lg-desktop:text-2xl line-clamp-2 min-h-[48px] text-wrap text-xl font-bold leading-[1.2] tracking-[-0.04em]"})]})]})});B.displayName="GiftTierCard";const I=o.forwardRef(({classNames:e={},data:i,onCardClick:s,onProductImageClick:u,buildData:l,...g},x)=>{const n=i.theme||"light",m=i.showTimeline!==!1,[p,k]=o.useState(null),[w,A]=o.useState(null),f=o.useMemo(()=>l?.products?.length?i.items.filter(r=>{const c=r.products?.[0];return c?.handle?l.products.find(T=>T.handle===c.handle)?.variants?.find(T=>T?.sku===c?.sku)?.availableForSale!==!1:!0}):i.items,[i.items,l?.products]),L=o.useMemo(()=>{const r=f.length;return{0:{slidesPerView:1.2,spaceBetween:12},768:{slidesPerView:Math.min(r,2.5),spaceBetween:12},1025:{slidesPerView:Math.min(r,3.5),spaceBetween:16},1440:{slidesPerView:Math.min(r,4),spaceBetween:16}}},[f.length]),U=o.useMemo(()=>{const r=f.length;return{0:{slidesPerView:1.2,spaceBetween:0},768:{slidesPerView:Math.min(r,2.5),spaceBetween:0},1025:{slidesPerView:Math.min(r,3.5),spaceBetween:0},1440:{slidesPerView:Math.min(r,4),spaceBetween:0}}},[f.length]),C=o.useMemo(()=>M.Controller?[M.Controller]:[],[]);return(0,t.jsxs)(a.Container,{ref:x,className:(0,d.cn)(e?.root),childClassName:"overflow-hidden","data-ui-component-id":"GiftTierShelf",...g,children:[(0,t.jsx)(h.Swiper,{modules:C,breakpoints:L,className:"w-full !overflow-visible",onSwiper:k,controller:{control:w},children:f.map((r,c)=>(0,t.jsx)(h.SwiperSlide,{children:(0,t.jsx)(B,{item:r,theme:n,buildData:l,className:e?.card,onClick:()=>s?.(r,c),onProductImageClick:()=>{const S=r.products?.[0];S&&u?.(S,r)}})},"giftTierItem"+c))}),m&&(0,t.jsx)("div",{className:"mt-4 flex flex-col gap-4",children:(0,t.jsx)("div",{className:(0,d.cn)("w-full",e?.timeline),children:(0,t.jsx)(h.Swiper,{modules:C,breakpoints:U,className:"w-full !overflow-visible",onSwiper:A,controller:{control:p},children:f.map((r,c)=>(0,t.jsx)(h.SwiperSlide,{children:(0,t.jsxs)("div",{className:"flex flex-col items-center",children:[(0,t.jsx)(G,{theme:n}),(0,t.jsx)(a.Text,{html:r.threshold,className:(0,d.cn)("lg-desktop:text-2xl text-center text-xl font-bold leading-[1.2] tracking-[-0.04em]",y({theme:n}),e?.thresholdText)})]})},"timelineItem"+c))})})})]})});I.displayName="GiftTierShelf";var O=(0,F.withLayout)(I);
1
+ "use strict";"use client";var Z=Object.create;var N=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty;var re=(e,i)=>{for(var l in i)N(e,l,{get:i[l],enumerable:!0})},G=(e,i,l,c)=>{if(i&&typeof i=="object"||typeof i=="function")for(let s of ee(i))!ie.call(e,s)&&s!==l&&N(e,s,{get:()=>i[s],enumerable:!(c=$(i,s))||c.enumerable});return e};var V=(e,i,l)=>(l=e!=null?Z(te(e)):{},G(i||!e||!e.__esModule?N(l,"default",{value:e,enumerable:!0}):l,e)),se=e=>G(N({},"__esModule",{value:!0}),e);var ne={};re(ne,{default:()=>oe});module.exports=se(ne);var t=require("react/jsx-runtime"),o=V(require("react")),f=require("../../helpers/index.js"),a=require("../../components/index.js"),M=require("class-variance-authority"),k=require("swiper/react"),B=V(require("swiper/modules")),E=require("../../shared/Styles.js"),y=require("../AiuiProvider/index.js"),H=require("../Listing/utils/index.js"),R=require("../../hooks/useExposure.js"),U=require("../../hooks/useViewItemList.js"),D=require("../../hooks/useTracking.js"),P=require("../../shared/track.js");const C="image",x="gift_tier_shelf",F=(e,i,l)=>{const c=l?.find(h=>h.handle===e.handle),s=c?.variants?.find(h=>h?.sku===e.sku);return{item_id:e.sku||"",item_name:s?.title||c?.title||e.name||"",item_variant:s?.title||"",price:String(e.custom_price??s?.price?.amount??""),index:i+1}},le=(0,M.cva)("lg-desktop:h-[400px] rounded-card desktop:pt-4 desktop:pb-6 relative flex h-[320px] flex-col items-start gap-1 overflow-hidden p-4",{variants:{theme:{light:"bg-gradient-to-b from-[#FCCA7B] to-[#FFE6BF]",dark:"bg-gradient-to-b from-[#3A3A3A] to-[#1D1D1F]"}},defaultVariants:{theme:"light"}}),z=(0,M.cva)("",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{theme:"light"}}),L=o.memo(({image:e})=>e?(0,t.jsx)(a.Picture,{source:e.url,alt:e.alt||"Member Tag",className:"h-full w-auto",imgClassName:"h-full w-auto object-contain"}):null);L.displayName="MemberTag";const _=o.memo(({theme:e="light"})=>{const i=e==="light"?"bg-[#f6cd4e]":"bg-[#F5F6F7]";return(0,t.jsx)("div",{className:"flex h-4 w-full items-center",children:(0,t.jsx)("div",{className:(0,f.cn)("flex h-1 w-full items-center justify-center",i),children:(0,t.jsx)("div",{className:(0,f.cn)("relative size-4 shrink-0 rounded-full",i)})})})});_.displayName="TimelineItem";const j=o.memo(({item:e,theme:i="light",className:l,onClick:c,onProductImageClick:s,interactive:h,buildData:T})=>{const{locale:S="us"}=(0,y.useAiuiContext)(),m=e.products?.[0],u=o.useMemo(()=>!m?.handle||!T?.products?.length?null:T.products.find(v=>v.handle===m.handle)||null,[m?.handle,T?.products]),g=o.useMemo(()=>u?.variants?.find(v=>v?.sku===m?.sku)||{},[m?.sku,u?.variants]),w=(0,H.formatPrice)({locale:S||"us",amount:m?.custom_price??g?.price?.amount,currencyCode:u?.price?.currencyCode||"USD"});return(0,t.jsxs)("div",{className:(0,f.cn)(le({theme:i}),l),onClick:c,"data-ui-component-id":"GiftTierCard",...(0,P.buildClickTrackingProps)({interactive:!!h,componentType:C,componentName:x,title:e.threshold,description:g?.title||u?.title,sku:m?.sku}),children:[(0,t.jsx)("div",{className:"lg-desktop:h-[28px] z-10 h-6",children:e.showMemberTag&&e.memberTagImage&&(0,t.jsx)(L,{image:e.memberTagImage})}),(0,t.jsx)("div",{className:"relative z-10 mx-auto min-h-0 w-fit flex-1",children:s?(0,t.jsx)("a",{onClick:s,className:"cursor-pointer",children:(0,t.jsx)(a.Picture,{source:g?.image?.url||u?.images[0]?.url,className:"size-full",imgClassName:"size-full object-contain"})}):(0,t.jsx)(a.Picture,{source:g?.image?.url||u?.images[0]?.url,className:"size-full",imgClassName:"size-full object-contain"})}),(0,t.jsxs)("div",{className:(0,f.cn)("z-10 flex w-full shrink-0 flex-col gap-2",z({theme:i})),children:[(0,t.jsxs)("div",{className:"flex items-end gap-1",children:[(0,t.jsx)(a.Heading,{html:w,size:4,className:"font-bold leading-[1.2] tracking-[-0.04em]"}),e.valueUnit&&(0,t.jsx)(a.Text,{html:e.valueUnit,className:"lg-desktop:text-2xl text-xl font-bold leading-[1.2] tracking-[-0.04em]"})]}),(0,t.jsx)(a.Text,{html:g?.title||u?.title,className:"lg-desktop:text-2xl line-clamp-2 min-h-[48px] text-wrap text-xl font-bold leading-[1.2] tracking-[-0.04em]"})]})]})});j.displayName="GiftTierCard";const A=o.forwardRef(({classNames:e={},data:i,onCardClick:l,onProductImageClick:c,buildData:s,...h},T)=>{const S=i.theme||"light",m=i.showTimeline!==!1,{pageGroup:u}=(0,D.useTracking)(),{currencyCode:g}=(0,y.useAiuiContext)(),w=o.useRef(null);o.useImperativeHandle(T,()=>w.current);const v=!!(l||c),[q,J]=o.useState(null),[K,O]=o.useState(null),d=o.useMemo(()=>s?.products?.length?i.items.filter(r=>{const n=r.products?.[0];return n?.handle?s.products.find(b=>b.handle===n.handle)?.variants?.find(b=>b?.sku===n?.sku)?.availableForSale!==!1:!0}):i.items,[i.items,s?.products]),Q=o.useMemo(()=>d.flatMap((r,n)=>{const p=r.products?.[0];return p?[F(p,n,s?.products)]:[]}),[d,s?.products]);(0,R.useExposure)(w,{componentType:C,componentName:x,componentTitle:d[0]?.threshold}),(0,U.useViewItemList)(w,{componentType:C,componentName:x,itemListName:x,items:Q});const W=(r,n)=>{const p=r.products?.[0];v&&p&&(0,P.trackSelectItem)({pageGroup:u,currency:g||"USD",itemListName:x,position:n+1,items:[F(p,n,s?.products)]}),l?.(r,n)},X=o.useMemo(()=>{const r=d.length;return{0:{slidesPerView:1.2,spaceBetween:12},768:{slidesPerView:Math.min(r,2.5),spaceBetween:12},1025:{slidesPerView:Math.min(r,3.5),spaceBetween:16},1440:{slidesPerView:Math.min(r,4),spaceBetween:16}}},[d.length]),Y=o.useMemo(()=>{const r=d.length;return{0:{slidesPerView:1.2,spaceBetween:0},768:{slidesPerView:Math.min(r,2.5),spaceBetween:0},1025:{slidesPerView:Math.min(r,3.5),spaceBetween:0},1440:{slidesPerView:Math.min(r,4),spaceBetween:0}}},[d.length]),I=o.useMemo(()=>B.Controller?[B.Controller]:[],[]);return(0,t.jsxs)(a.Container,{ref:w,className:(0,f.cn)(e?.root),childClassName:"overflow-hidden","data-ui-component-id":"GiftTierShelf",...h,children:[(0,t.jsx)(k.Swiper,{modules:I,breakpoints:X,className:"w-full !overflow-visible",onSwiper:J,controller:{control:K},children:d.map((r,n)=>(0,t.jsx)(k.SwiperSlide,{children:(0,t.jsx)(j,{item:r,theme:S,buildData:s,className:e?.card,interactive:v,onClick:()=>W(r,n),onProductImageClick:()=>{const p=r.products?.[0];p&&c?.(p,r)}})},"giftTierItem"+n))}),m&&(0,t.jsx)("div",{className:"mt-4 flex flex-col gap-4",children:(0,t.jsx)("div",{className:(0,f.cn)("w-full",e?.timeline),children:(0,t.jsx)(k.Swiper,{modules:I,breakpoints:Y,className:"w-full !overflow-visible",onSwiper:O,controller:{control:q},children:d.map((r,n)=>(0,t.jsx)(k.SwiperSlide,{children:(0,t.jsxs)("div",{className:"flex flex-col items-center",children:[(0,t.jsx)(_,{theme:S}),(0,t.jsx)(a.Text,{html:r.threshold,className:(0,f.cn)("lg-desktop:text-2xl text-center text-xl font-bold leading-[1.2] tracking-[-0.04em]",z({theme:S}),e?.thresholdText)})]})},"timelineItem"+n))})})})]})});A.displayName="GiftTierShelf";var oe=(0,E.withLayout)(A);
@@ -1 +1 @@
1
- "use strict";"use client";var K=Object.create;var k=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var ee=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty;var oe=(e,o)=>{for(var s in o)k(e,s,{get:o[s],enumerable:!0})},G=(e,o,s,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of W(o))!te.call(e,i)&&i!==s&&k(e,i,{get:()=>o[i],enumerable:!(n=O(o,i))||n.enumerable});return e};var y=(e,o,s)=>(s=e!=null?K(ee(e)):{},G(o||!e||!e.__esModule?k(s,"default",{value:e,enumerable:!0}):s,e)),se=e=>G(k({},"__esModule",{value:!0}),e);var re={};oe(re,{default:()=>ie});module.exports=se(re);var t=require("react/jsx-runtime"),A=require("react-responsive"),r=y(require("react")),U=require("react-dom"),c=require("../../helpers/utils.js"),z=require("../../shared/Styles.js"),H=y(require("../SwiperBox/index.js")),l=require("../../components/index.js"),I=y(require("../Title/index.js")),R=require("../VideoModal/index.js"),E=require("../TextModal/index.js"),C=require("../../hooks/useExposure.js"),T=require("../../shared/trackUrlRef.js"),j=require("../AiuiProvider/index.js"),ae=require("swiper/css");const u="image",h="graphic",P=e=>{let o="";const s=m=>(m?.url&&(o=m.url),o),n=s(e.lgDesktop),i=s(e.desktop),p=s(e.laptop),g=s(e.tablet),b=e.default?.url;return[`${n} 9999`,`${i} 1919`,`${p} 1439`,`${g} 1024`,`${b} 768`].join(", ")},B="descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]",le=({data:e,configuration:o})=>{const s=(0,r.useRef)(null),[n,i]=(0,r.useState)({visible:!1,x:0,y:0,text:""}),p=o?.descriptionTag||"h3",g=()=>{switch(o.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]"}},b=a=>{e?.description&&i({visible:!0,x:a.clientX,y:a.clientY,text:e.description})},m=()=>{i(a=>({...a,visible:!1}))};(0,C.useExposure)(s,{componentType:u,componentName:h,componentTitle:e?.title,componentDescription:e?.description,position:o?.index+1});const v=e?.href?"a":"div",x=e?.href?{href:(0,T.trackUrlRef)((0,c.getLocalizedPath)(e.href,o?.locale||"us"),`${u}_${h}`)}:{};return(0,t.jsx)("div",{ref:s,className:(0,c.cn)(g(),"graphicItem","laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]",{"aiui-dark":e.theme==="dark"}),children:(0,t.jsx)("div",{className:(0,c.cn)("rounded-box absolute inset-0 overflow-hidden"),children:(0,t.jsxs)("div",{className:`graphic-children relative block size-full overflow-hidden ${e?.href?"cursor-pointer":""}`,children:[e?.href?(0,t.jsxs)("a",{"aria-label":e?.title||e?.description,href:(0,T.trackUrlRef)((0,c.getLocalizedPath)(e?.href||"",o?.locale||"us"),`${u}_${h}`),className:"rounded-card block size-full overflow-hidden","data-headless-nav-postion":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:[(0,t.jsx)(l.Picture,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?P(e.backgroundImage):e?.imgUrl?.url,alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""}),(0,t.jsx)("span",{className:"sr-only",children:e?.title||e?.description})]}):(0,t.jsx)("div",{className:"rounded-card block size-full overflow-hidden",children:(0,t.jsx)(l.Picture,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?P(e.backgroundImage):e?.imgUrl?.url||"",alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""})}),(0,t.jsxs)(v,{...x,className:(0,c.cn)("laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4",{"bg-gradient-to-b from-transparent to-black/80":e?.showBottomGradient&&e?.theme==="dark","bg-gradient-to-b from-transparent to-white/80":e?.showBottomGradient&&e?.theme!=="dark"}),children:[(0,t.jsxs)("div",{className:(0,c.cn)("flex items-end gap-1 overflow-hidden","graphic-bottom"),children:[(0,t.jsxs)("div",{className:"flex-1 overflow-hidden",children:[(0,t.jsx)(l.Text,{html:e?.title,style:{color:e?.textColor},className:"spanTitle graphic-title lg-desktop:text-lg desktop:text-base line-clamp-3 text-sm font-bold leading-[1.2]"}),e?.description&&(0,t.jsxs)("div",{onMouseMove:b,onMouseLeave:m,children:[e?.title?(0,t.jsx)(l.Heading,{html:e?.description,style:{color:e?.textColor},as:p,className:`${B} graphic-description`}):(0,t.jsx)(p,{style:{color:e?.textColor},dangerouslySetInnerHTML:{__html:e?.description||""},className:`${B} graphic-description-item`}),typeof window<"u"&&n.visible&&(0,U.createPortal)((0,t.jsx)(l.Text,{as:"div",html:n.text,className:"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200",style:{left:`${n.x+16}px`,top:`${n.y+16}px`}}),document.body)]})]}),!e?.isShowIcon&&(e?.video?.url||e?.youtubeId)&&(0,t.jsx)("button",{"aria-label":"Play Video",onClick:a=>{a.preventDefault(),a.stopPropagation(),o?.onVideoPlayBtnClick?.(o?.index||0,e)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white/20 hover:bg-black/75",children:(0,t.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})}),e?.isShowIcon&&e?.icon?.url&&(0,t.jsx)("button",{onClick:a=>{a.preventDefault(),a.stopPropagation(),o?.onIconClick?.(e,o)},className:"laptop:size-9 flex size-8 items-center justify-center overflow-hidden rounded-full bg-white/20 hover:bg-black/75",children:(0,t.jsx)(l.Picture,{className:"h-full",imgClassName:"h-full object-cover",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),e.buttonText&&(0,t.jsx)(l.Button,{as:"a","aria-label":e?.title||e?.description,variant:"secondary",className:"bgButton mt-[8px] self-start",href:(0,T.trackUrlRef)((0,c.getLocalizedPath)(e?.href||"",o?.locale||"us"),`${u}_${h}`),"data-headless-nav-position":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}#${e?.buttonText}`,children:e.buttonText})]})]})})})},L=({items:e=[],sharedConfig:o})=>{const s=n=>{const i=e.length>3,p=e.length>2;switch(n){case 1440:return i?4:e.length;case 1024:return i?3:e.length;case 768:return e.length===1?1:i||p?2.3:2;default:return e.length===1?1:1.2}};return(0,t.jsx)(H.default,{id:"Graphic",className:(0,c.cn)("!overflow-visible"),data:{list:e,configuration:{...o,num:e.length}},Slide:le,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:s()},768:{spaceBetween:16,freeMode:!1,slidesPerView:s(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:s(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:s(1440)}}})},D=r.default.forwardRef(({data:e,className:o,...s},n)=>{const i=(0,A.useMediaQuery)({query:"(max-width: 768px)"}),p=(0,r.useRef)(null),[g,b]=(0,r.useState)(!1),[m,v]=(0,r.useState)(""),[x,a]=(0,r.useState)(""),[_,M]=(0,r.useState)(""),[Y,N]=(0,r.useState)(null),[q,$]=(0,r.useState)(!1),{locale:Q="us"}=(0,j.useAiuiContext)(),X=e?.isShowTab??!1,f=e?.tabs,Z=e?.tabAlign??"left",[F,J]=(0,r.useState)(f?.[0]?.id??"");(0,r.useImperativeHandle)(n,()=>p.current),(0,C.useExposure)(p,{componentType:u,componentName:h,componentTitle:e?.title});const S={itemShape:e?.itemShape,descriptionTag:e?.descriptionTag,locale:Q,onVideoPlayBtnClick:(d,w)=>{b(!0),w?.isYouTube?(a(w?.youtubeId||""),v(""),M("")):(a(""),v(w?.video?.url||""),M(w?.mobileVideo?.url||""))},onIconClick:d=>{$(!0),N(d)}},V=()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(R.VideoModal,{visible:g,youTubeId:x,onCloseModal:()=>b(!1),videoUrl:x?"":i&&_||m}),(0,t.jsx)(E.TextModal,{textVisible:q,extension:Y?.extension,onCloseModal:()=>{$(!1),N(null)}})]});return!X||!f||f.length===0?(0,t.jsxs)("div",{...s,ref:p,className:(0,c.cn)("graphicBlock",o),children:[(0,t.jsxs)("div",{className:"graphic-box",children:[e?.title&&(0,t.jsx)(I.default,{data:{title:e.title,align:e?.titleAlign??"left"}}),(0,t.jsx)(L,{items:e?.items,sharedConfig:S})]}),V()]}):(0,t.jsxs)("div",{...s,ref:p,className:(0,c.cn)("graphicBlock",o),children:[e?.title&&(0,t.jsx)(I.default,{data:{title:e.title,align:e?.titleAlign??"left"}}),(0,t.jsxs)(l.Tabs,{value:F,onValueChange:J,align:Z,children:[(0,t.jsx)("div",{className:"mb-[24px]",children:(0,t.jsx)(l.TabsList,{children:f.map(d=>(0,t.jsx)(l.TabsTrigger,{value:d.id,children:d.label},d.id))})}),f.map(d=>(0,t.jsx)(l.TabsContent,{value:d.id,children:(0,t.jsx)(L,{items:d.items,sharedConfig:S})},d.id))]}),V()]})});D.displayName="Graphic";var ie=(0,z.withLayout)(D);
1
+ "use strict";"use client";var O=Object.create;var T=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty;var se=(e,o)=>{for(var s in o)T(e,s,{get:o[s],enumerable:!0})},P=(e,o,s,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of ee(o))!oe.call(e,i)&&i!==s&&T(e,i,{get:()=>o[i],enumerable:!(c=W(o,i))||c.enumerable});return e};var I=(e,o,s)=>(s=e!=null?O(te(e)):{},P(o||!e||!e.__esModule?T(s,"default",{value:e,enumerable:!0}):s,e)),le=e=>P(T({},"__esModule",{value:!0}),e);var ne={};se(ne,{default:()=>re});module.exports=le(ne);var t=require("react/jsx-runtime"),U=require("react-responsive"),r=I(require("react")),z=require("react-dom"),a=require("../../helpers/utils.js"),R=require("../../shared/Styles.js"),H=I(require("../SwiperBox/index.js")),l=require("../../components/index.js"),C=I(require("../Title/index.js")),E=require("../VideoModal/index.js"),j=require("../TextModal/index.js"),M=require("../../hooks/useExposure.js"),y=require("../../shared/trackUrlRef.js"),Y=require("../AiuiProvider/index.js"),ce=require("swiper/css"),_=require("../../hooks/useTracking.js");const u="image",h="graphic",B=e=>{let o="";const s=m=>(m?.url&&(o=m.url),o),c=s(e.lgDesktop),i=s(e.desktop),p=s(e.laptop),b=s(e.tablet),g=e.default?.url;return[`${c} 9999`,`${i} 1919`,`${p} 1439`,`${b} 1024`,`${g} 768`].join(", ")},L="descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]",ie=({data:e,configuration:o})=>{const{buildRef:s}=(0,_.useTracking)(),c=(0,r.useRef)(null),[i,p]=(0,r.useState)({visible:!1,x:0,y:0,text:""}),b=o?.descriptionTag||"h3",g=()=>{switch(o.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]"}},m=n=>{e?.description&&p({visible:!0,x:n.clientX,y:n.clientY,text:e.description})},v=()=>{p(n=>({...n,visible:!1}))};(0,M.useExposure)(c,{componentType:u,componentName:h,componentTitle:e?.title,componentDescription:e?.description,position:o?.index+1});const x=e?.href?"a":"div",w=e?.href?{href:(0,y.trackUrlRef)((0,a.getLocalizedPath)(e.href,o?.locale||"us"),s(u,h))}:{};return(0,t.jsx)("div",{ref:c,className:(0,a.cn)(g(),"graphicItem","laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]",{"aiui-dark":e.theme==="dark"}),children:(0,t.jsx)("div",{className:(0,a.cn)("rounded-box absolute inset-0 overflow-hidden"),children:(0,t.jsxs)("div",{className:`graphic-children relative block size-full overflow-hidden ${e?.href?"cursor-pointer":""}`,children:[e?.href?(0,t.jsxs)("a",{"aria-label":e?.title||e?.description,href:(0,y.trackUrlRef)((0,a.getLocalizedPath)(e?.href||"",o?.locale||"us"),s(u,h)),className:"rounded-card block size-full overflow-hidden","data-headless-nav-postion":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:[(0,t.jsx)(l.Picture,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?B(e.backgroundImage):e?.imgUrl?.url,alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""}),(0,t.jsx)("span",{className:"sr-only",children:e?.title||e?.description})]}):(0,t.jsx)("div",{className:"rounded-card block size-full overflow-hidden",children:(0,t.jsx)(l.Picture,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?B(e.backgroundImage):e?.imgUrl?.url||"",alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""})}),(0,t.jsxs)(x,{...w,className:(0,a.cn)("laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4",{"bg-gradient-to-b from-transparent to-black/80":e?.showBottomGradient&&e?.theme==="dark","bg-gradient-to-b from-transparent to-white/80":e?.showBottomGradient&&e?.theme!=="dark"}),children:[(0,t.jsxs)("div",{className:(0,a.cn)("flex items-end gap-1 overflow-hidden","graphic-bottom"),children:[(0,t.jsxs)("div",{className:"flex-1 overflow-hidden",children:[(0,t.jsx)(l.Text,{html:e?.title,style:{color:e?.textColor},className:"spanTitle graphic-title lg-desktop:text-lg desktop:text-base line-clamp-3 text-sm font-bold leading-[1.2]"}),e?.description&&(0,t.jsxs)("div",{onMouseMove:m,onMouseLeave:v,children:[e?.title?(0,t.jsx)(l.Heading,{html:e?.description,style:{color:e?.textColor},as:b,className:`${L} graphic-description`}):(0,t.jsx)(b,{style:{color:e?.textColor},dangerouslySetInnerHTML:{__html:e?.description||""},className:`${L} graphic-description-item`}),typeof window<"u"&&i.visible&&(0,z.createPortal)((0,t.jsx)(l.Text,{as:"div",html:i.text,className:"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200",style:{left:`${i.x+16}px`,top:`${i.y+16}px`}}),document.body)]})]}),!e?.isShowIcon&&(e?.video?.url||e?.youtubeId)&&(0,t.jsx)("button",{"aria-label":"Play Video",onClick:n=>{n.preventDefault(),n.stopPropagation(),o?.onVideoPlayBtnClick?.(o?.index||0,e)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white/20 hover:bg-black/75",children:(0,t.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})}),e?.isShowIcon&&e?.icon?.url&&(0,t.jsx)("button",{onClick:n=>{n.preventDefault(),n.stopPropagation(),o?.onIconClick?.(e,o)},className:"laptop:size-9 flex size-8 items-center justify-center overflow-hidden rounded-full bg-white/20 hover:bg-black/75",children:(0,t.jsx)(l.Picture,{className:"h-full",imgClassName:"h-full object-cover",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),e.buttonText&&(0,t.jsx)(l.Button,{as:"a","aria-label":e?.title||e?.description,variant:"secondary",className:"bgButton mt-[8px] self-start",href:(0,y.trackUrlRef)((0,a.getLocalizedPath)(e?.href||"",o?.locale||"us"),s(u,h)),"data-headless-nav-position":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}#${e?.buttonText}`,children:e.buttonText})]})]})})})},D=({items:e=[],sharedConfig:o})=>{const s=c=>{const i=e.length>3,p=e.length>2;switch(c){case 1440:return i?4:e.length;case 1024:return i?3:e.length;case 768:return e.length===1?1:i||p?2.3:2;default:return e.length===1?1:1.2}};return(0,t.jsx)(H.default,{id:"Graphic",className:(0,a.cn)("!overflow-visible"),data:{list:e,configuration:{...o,num:e.length}},Slide:ie,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:s()},768:{spaceBetween:16,freeMode:!1,slidesPerView:s(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:s(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:s(1440)}}})},A=r.default.forwardRef(({data:e,className:o,...s},c)=>{const i=(0,U.useMediaQuery)({query:"(max-width: 768px)"}),p=(0,r.useRef)(null),[b,g]=(0,r.useState)(!1),[m,v]=(0,r.useState)(""),[x,w]=(0,r.useState)(""),[n,N]=(0,r.useState)(""),[q,S]=(0,r.useState)(null),[Q,V]=(0,r.useState)(!1),{locale:X="us"}=(0,Y.useAiuiContext)(),Z=e?.isShowTab??!1,f=e?.tabs,F=e?.tabAlign??"left",[J,K]=(0,r.useState)(f?.[0]?.id??"");(0,r.useImperativeHandle)(c,()=>p.current),(0,M.useExposure)(p,{componentType:u,componentName:h,componentTitle:e?.title});const $={itemShape:e?.itemShape,descriptionTag:e?.descriptionTag,locale:X,onVideoPlayBtnClick:(d,k)=>{g(!0),k?.isYouTube?(w(k?.youtubeId||""),v(""),N("")):(w(""),v(k?.video?.url||""),N(k?.mobileVideo?.url||""))},onIconClick:d=>{V(!0),S(d)}},G=()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(E.VideoModal,{visible:b,youTubeId:x,onCloseModal:()=>g(!1),videoUrl:x?"":i&&n||m}),(0,t.jsx)(j.TextModal,{textVisible:Q,extension:q?.extension,onCloseModal:()=>{V(!1),S(null)}})]});return!Z||!f||f.length===0?(0,t.jsxs)("div",{...s,ref:p,className:(0,a.cn)("graphicBlock",o),children:[(0,t.jsxs)("div",{className:"graphic-box",children:[e?.title&&(0,t.jsx)(C.default,{data:{title:e.title,align:e?.titleAlign??"left"}}),(0,t.jsx)(D,{items:e?.items,sharedConfig:$})]}),G()]}):(0,t.jsxs)("div",{...s,ref:p,className:(0,a.cn)("graphicBlock",o),children:[e?.title&&(0,t.jsx)(C.default,{data:{title:e.title,align:e?.titleAlign??"left"}}),(0,t.jsxs)(l.Tabs,{value:J,onValueChange:K,align:F,children:[(0,t.jsx)("div",{className:"mb-[24px]",children:(0,t.jsx)(l.TabsList,{children:f.map(d=>(0,t.jsx)(l.TabsTrigger,{value:d.id,children:d.label},d.id))})}),f.map(d=>(0,t.jsx)(l.TabsContent,{value:d.id,children:(0,t.jsx)(D,{items:d.items,sharedConfig:$})},d.id))]}),G()]})});A.displayName="Graphic";var re=(0,R.withLayout)(A);
@@ -1 +1 @@
1
- "use strict";var Q=Object.create;var M=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var J=(a,t)=>{for(var s in t)M(a,s,{get:t[s],enumerable:!0})},G=(a,t,s,h)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Z(t))!F.call(a,i)&&i!==s&&M(a,i,{get:()=>t[i],enumerable:!(h=q(t,i))||h.enumerable});return a};var P=(a,t,s)=>(s=a!=null?Q(j(a)):{},G(t||!a||!a.__esModule?M(s,"default",{value:a,enumerable:!0}):s,a)),K=a=>G(M({},"__esModule",{value:!0}),a);var ee={};J(ee,{default:()=>X});module.exports=K(ee);var e=require("react/jsx-runtime"),r=P(require("react")),R=require("react-responsive"),A=require("../../shared/Styles.js"),C=P(require("../../components/picture.js")),O=P(require("../../components/button.js")),I=require("../../components/heading.js"),v=require("../../components/tabs.js"),E=require("../VideoModal/index.js"),p=require("../../helpers/utils.js"),_=P(require("../SwiperBox/index.js")),L=require("../../shared/mimeType.js"),D=require("../../hooks/useExposure.js"),V=require("../../shared/trackUrlRef.js"),H=require("../AiuiProvider/index.js");const y="image",w="p1_banner",W=({data:a,configuration:t,jIndex:s})=>{const[h,i]=(0,r.useState)(!1),m=(0,R.useMediaQuery)({query:"(max-width: 768px)"}),u=(0,r.useRef)(null),b=()=>{switch(t?.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[400] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[426] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[426] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}};(0,D.useExposure)(u,{componentType:y,componentName:w,position:s,componentTitle:a.title,componentDescription:a.description,navigation:t?.activeTab}),(0,r.useEffect)(()=>{i(m)},[m]);const{theme:n="light",title:c,description:o,imageUrl:d,primaryButton:f,secondaryButton:g,imageMobileUrl:k,blockLink:x,video:$,youtubeId:N,isYouTube:B}=a,T="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return(0,e.jsxs)("div",{className:(0,p.cn)("item-wrapper text-info-primary group relative box-border w-full overflow-hidden",b(),{"rounded-box":!0,"aiui-dark":n==="dark","h-[400px]":h},"text-info-primary"),ref:u,children:[x&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:(0,V.trackUrlRef)((0,p.getLocalizedPath)(x||"",t?.locale||"us"),`${y}_${w}`),"data-headless-type-name":`${y}#${w}`,"data-headless-title-desc-button":`${c}#${o}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,"aria-hidden":"true",tabIndex:-1}),(0,e.jsxs)("div",{className:"absolute inset-0",children:[(0,L.isVideo)(d?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:block hidden h-full overflow-hidden",children:(0,e.jsx)("source",{src:d?.url,type:"video/mp4"})}):(0,e.jsx)(C.default,{source:d?.url,alt:d?.alt||"",className:"tablet:block hidden h-full overflow-hidden",imgClassName:(0,p.cn)("h-full object-cover",x&&"transition-all duration-300 group-hover:scale-105"),style:{aspectRatio:`${d?.width}/${d?.height}`}}),(0,L.isVideo)(k?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:hidden block h-full overflow-hidden",children:(0,e.jsx)("source",{src:k?.url,type:"video/mp4"})}):(0,e.jsx)(C.default,{source:k?.url||d?.url,alt:k?.alt||d?.alt||"",className:"tablet:hidden block h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 object-cover"}),(0,e.jsxs)("div",{className:(0,p.cn)("laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 pointer-events-none absolute inset-x-0 bottom-0 z-20 flex w-fit flex-col gap-6 p-4",{"laptop:top-1/2 laptop:-translate-y-1/2 laptop:bottom-auto":a?.width==="full"}),children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(I.Heading,{size:3,as:"h3",className:"item-title",html:c}),(0,e.jsx)(I.Heading,{as:"h4",className:"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-3 text-[14px]",html:o})]}),(0,e.jsxs)("div",{className:"lg-desktop:gap-3 flex gap-2",children:[g&&g.text&&(0,e.jsxs)(O.default,{"aria-label":c??o,className:(0,p.cn)(T,"link-left pointer-events-auto"),variant:"secondary",as:"a",href:(0,V.trackUrlRef)((0,p.getLocalizedPath)(g.link||"",t?.locale||"us"),`${y}_${w}`),"data-headless-type-name":`${y}#${w}`,"data-headless-title-desc-button":`${c}#${o}#${g?.text}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,children:[g.text,(0,e.jsx)("span",{className:"sr-only",children:c??o})]}),f&&f.text&&(0,e.jsx)(O.default,{"aria-label":c??o,className:(0,p.cn)(T,"link-right pointer-events-auto"),variant:"primary",as:"a",href:(0,V.trackUrlRef)((0,p.getLocalizedPath)(f.link||"",t?.locale||"us"),`${y}_${w}`),"data-headless-type-name":`${y}#${w}`,"data-headless-title-desc-button":`${c}#${o}#${f.text}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,children:f.text})]})]})]}),(0,e.jsx)("div",{children:(0,e.jsx)("div",{className:"laptop:bottom-[32px] laptop:right-[32px] absolute bottom-[16px] right-[16px]",children:($?.url||N)&&(0,e.jsx)("button",{onClick:()=>{t?.onVideoPlayBtnClick?.($?.url||N,B)},className:"laptop:size-12 hover:bg-current/75 bg-info-primary flex size-8 items-center justify-center rounded-full opacity-80",children:(0,e.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:n==="dark"?"black":"white",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z"})})})})})]})},z=({items:a=[],shape:t,locale:s,activeTab:h,onVideoPlayBtnClick:i})=>{const m=u=>{const b=a?.length,n=b>3,c=b>2,o=b>1;switch(!0){case u>=1440:case u>=1024:return n?3:b;case u>=768:return n||c?2.3:o?2:1;default:return o?1.2:1}};return(0,e.jsx)(_.default,{className:"!overflow-visible",id:"GraphicOverlaySwiper",data:{list:a||[],configuration:{shape:t,num:a.length,locale:s,activeTab:h,onVideoPlayBtnClick:i}},Slide:W,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:m(374)},768:{spaceBetween:16,freeMode:!1,slidesPerView:m(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:m(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:m(1440)}}})},U=r.default.forwardRef((a,t)=>{const{data:s,className:h,...i}=a,{shape:m,items:u=[],isShowTab:b=!1,tabs:n,tabAlign:c="left"}=s,[o,d]=(0,r.useState)(!1),[f,g]=(0,r.useState)(""),[k,x]=(0,r.useState)(""),[$,N]=(0,r.useState)(n?.[0]?.id??""),{locale:B="us"}=(0,H.useAiuiContext)(),T=(l,Y)=>{d(!0),Y?x?.(l||""):g?.(l||"")},S=()=>(0,e.jsx)(E.VideoModal,{visible:o,youTubeId:k,videoUrl:f,onCloseModal:()=>d(!1)});return!b||!n||n.length===0?(0,e.jsxs)("section",{"data-ui-component-id":"GraphicOverlay",ref:t,...i,className:(0,p.cn)("graphicOverlayBlock text-info-primary ",h),children:[u&&u.length>0?(0,e.jsx)(z,{items:u,shape:m,locale:B,onVideoPlayBtnClick:T}):null,o&&S()]}):(0,e.jsxs)("section",{"data-ui-component-id":"GraphicOverlay",ref:t,...i,className:(0,p.cn)("graphicOverlayBlock text-info-primary ",h),children:[(0,e.jsxs)(v.Tabs,{value:$,onValueChange:N,align:c,children:[(0,e.jsx)("div",{className:"mb-6",children:(0,e.jsx)(v.TabsList,{children:n.map(l=>(0,e.jsx)(v.TabsTrigger,{value:l.id,children:l.label},l.id))})}),n.map(l=>(0,e.jsx)(v.TabsContent,{value:l.id,children:l.items&&l.items.length>0?(0,e.jsx)(z,{items:l.items,shape:m,locale:B,activeTab:l.id,onVideoPlayBtnClick:T}):null},l.id))]}),o&&S()]})});U.displayName="GraphicOverlayBlock";var X=(0,A.withLayout)(U);
1
+ "use strict";var Z=Object.create;var P=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var K=(a,t)=>{for(var s in t)P(a,s,{get:t[s],enumerable:!0})},G=(a,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of j(t))!J.call(a,i)&&i!==s&&P(a,i,{get:()=>t[i],enumerable:!(n=_(t,i))||n.enumerable});return a};var V=(a,t,s)=>(s=a!=null?Z(F(a)):{},G(t||!a||!a.__esModule?P(s,"default",{value:a,enumerable:!0}):s,a)),W=a=>G(P({},"__esModule",{value:!0}),a);var te={};K(te,{default:()=>ee});module.exports=W(te);var e=require("react/jsx-runtime"),r=V(require("react")),U=require("react-responsive"),A=require("../../shared/Styles.js"),O=V(require("../../components/picture.js")),I=V(require("../../components/button.js")),L=require("../../components/heading.js"),v=require("../../components/tabs.js"),E=require("../VideoModal/index.js"),p=require("../../helpers/utils.js"),D=V(require("../SwiperBox/index.js")),S=require("../../shared/mimeType.js"),H=require("../../hooks/useExposure.js"),C=require("../../shared/trackUrlRef.js"),Y=require("../AiuiProvider/index.js"),Q=require("../../hooks/useTracking.js");const y="image",k="p1_banner",X=({data:a,configuration:t,jIndex:s})=>{const{buildRef:n}=(0,Q.useTracking)(),[i,h]=(0,r.useState)(!1),c=(0,U.useMediaQuery)({query:"(max-width: 768px)"}),b=(0,r.useRef)(null),d=()=>{switch(t?.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[400] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[426] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[426] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}};(0,H.useExposure)(b,{componentType:y,componentName:k,position:s,componentTitle:a.title,componentDescription:a.description,navigation:t?.activeTab}),(0,r.useEffect)(()=>{h(c)},[c]);const{theme:w="light",title:o,description:m,imageUrl:u,primaryButton:f,secondaryButton:g,imageMobileUrl:x,blockLink:T,video:$,youtubeId:N,isYouTube:M}=a,B="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return(0,e.jsxs)("div",{className:(0,p.cn)("item-wrapper text-info-primary group relative box-border w-full overflow-hidden",d(),{"rounded-box":!0,"aiui-dark":w==="dark","h-[400px]":i},"text-info-primary"),ref:b,children:[T&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:(0,C.trackUrlRef)((0,p.getLocalizedPath)(T||"",t?.locale||"us"),n(y,k)),"data-headless-type-name":`${y}#${k}`,"data-headless-title-desc-button":`${o}#${m}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,"aria-hidden":"true",tabIndex:-1}),(0,e.jsxs)("div",{className:"absolute inset-0",children:[(0,S.isVideo)(u?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:block hidden h-full overflow-hidden",children:(0,e.jsx)("source",{src:u?.url,type:"video/mp4"})}):(0,e.jsx)(O.default,{source:u?.url,alt:u?.alt||"",className:"tablet:block hidden h-full overflow-hidden",imgClassName:(0,p.cn)("h-full object-cover",T&&"transition-all duration-300 group-hover:scale-105"),style:{aspectRatio:`${u?.width}/${u?.height}`}}),(0,S.isVideo)(x?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:hidden block h-full overflow-hidden",children:(0,e.jsx)("source",{src:x?.url,type:"video/mp4"})}):(0,e.jsx)(O.default,{source:x?.url||u?.url,alt:x?.alt||u?.alt||"",className:"tablet:hidden block h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 object-cover"}),(0,e.jsxs)("div",{className:(0,p.cn)("laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 pointer-events-none absolute inset-x-0 bottom-0 z-20 flex w-fit flex-col gap-6 p-4",{"laptop:top-1/2 laptop:-translate-y-1/2 laptop:bottom-auto":a?.width==="full"}),children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(L.Heading,{size:3,as:"h3",className:"item-title",html:o}),(0,e.jsx)(L.Heading,{as:"h4",className:"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-3 text-[14px]",html:m})]}),(0,e.jsxs)("div",{className:"lg-desktop:gap-3 flex gap-2",children:[g&&g.text&&(0,e.jsxs)(I.default,{"aria-label":o??m,className:(0,p.cn)(B,"link-left pointer-events-auto"),variant:"secondary",as:"a",href:(0,C.trackUrlRef)((0,p.getLocalizedPath)(g.link||"",t?.locale||"us"),n(y,k)),"data-headless-type-name":`${y}#${k}`,"data-headless-title-desc-button":`${o}#${m}#${g?.text}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,children:[g.text,(0,e.jsx)("span",{className:"sr-only",children:o??m})]}),f&&f.text&&(0,e.jsx)(I.default,{"aria-label":o??m,className:(0,p.cn)(B,"link-right pointer-events-auto"),variant:"primary",as:"a",href:(0,C.trackUrlRef)((0,p.getLocalizedPath)(f.link||"",t?.locale||"us"),n(y,k)),"data-headless-type-name":`${y}#${k}`,"data-headless-title-desc-button":`${o}#${m}#${f.text}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,children:f.text})]})]})]}),(0,e.jsx)("div",{children:(0,e.jsx)("div",{className:"laptop:bottom-[32px] laptop:right-[32px] absolute bottom-[16px] right-[16px]",children:($?.url||N)&&(0,e.jsx)("button",{onClick:()=>{t?.onVideoPlayBtnClick?.($?.url||N,M)},className:"laptop:size-12 hover:bg-current/75 bg-info-primary flex size-8 items-center justify-center rounded-full opacity-80",children:(0,e.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:w==="dark"?"black":"white",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z"})})})})})]})},z=({items:a=[],shape:t,locale:s,activeTab:n,onVideoPlayBtnClick:i})=>{const h=c=>{const b=a?.length,d=b>3,w=b>2,o=b>1;switch(!0){case c>=1440:case c>=1024:return d?3:b;case c>=768:return d||w?2.3:o?2:1;default:return o?1.2:1}};return(0,e.jsx)(D.default,{className:"!overflow-visible",id:"GraphicOverlaySwiper",data:{list:a||[],configuration:{shape:t,num:a.length,locale:s,activeTab:n,onVideoPlayBtnClick:i}},Slide:X,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:h(374)},768:{spaceBetween:16,freeMode:!1,slidesPerView:h(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:h(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:h(1440)}}})},R=r.default.forwardRef((a,t)=>{const{data:s,className:n,...i}=a,{shape:h,items:c=[],isShowTab:b=!1,tabs:d,tabAlign:w="left"}=s,[o,m]=(0,r.useState)(!1),[u,f]=(0,r.useState)(""),[g,x]=(0,r.useState)(""),[T,$]=(0,r.useState)(d?.[0]?.id??""),{locale:N="us"}=(0,Y.useAiuiContext)(),M=(l,q)=>{m(!0),q?x?.(l||""):f?.(l||"")},B=()=>(0,e.jsx)(E.VideoModal,{visible:o,youTubeId:g,videoUrl:u,onCloseModal:()=>m(!1)});return!b||!d||d.length===0?(0,e.jsxs)("section",{"data-ui-component-id":"GraphicOverlay",ref:t,...i,className:(0,p.cn)("graphicOverlayBlock text-info-primary ",n),children:[c&&c.length>0?(0,e.jsx)(z,{items:c,shape:h,locale:N,onVideoPlayBtnClick:M}):null,o&&B()]}):(0,e.jsxs)("section",{"data-ui-component-id":"GraphicOverlay",ref:t,...i,className:(0,p.cn)("graphicOverlayBlock text-info-primary ",n),children:[(0,e.jsxs)(v.Tabs,{value:T,onValueChange:$,align:w,children:[(0,e.jsx)("div",{className:"mb-6",children:(0,e.jsx)(v.TabsList,{children:d.map(l=>(0,e.jsx)(v.TabsTrigger,{value:l.id,children:l.label},l.id))})}),d.map(l=>(0,e.jsx)(v.TabsContent,{value:l.id,children:l.items&&l.items.length>0?(0,e.jsx)(z,{items:l.items,shape:h,locale:N,activeTab:l.id,onVideoPlayBtnClick:M}):null},l.id))]}),o&&B()]})});R.displayName="GraphicOverlayBlock";var ee=(0,A.withLayout)(R);
@@ -1 +1 @@
1
- "use strict";"use client";var Ue=Object.create;var M=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var Je=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,qe=Object.prototype.hasOwnProperty;var Fe=(t,c)=>{for(var o in c)M(t,o,{get:c[o],enumerable:!0})},le=(t,c,o,T)=>{if(c&&typeof c=="object"||typeof c=="function")for(let g of Je(c))!qe.call(t,g)&&g!==o&&M(t,g,{get:()=>c[g],enumerable:!(T=Ge(c,g))||T.enumerable});return t};var C=(t,c,o)=>(o=t!=null?Ue(_e(t)):{},le(c||!t||!t.__esModule?M(o,"default",{value:t,enumerable:!0}):o,t)),We=t=>le(M({},"__esModule",{value:!0}),t);var et={};Fe(et,{default:()=>$e});module.exports=We(et);var e=require("react/jsx-runtime"),m=C(require("react")),L=C(require("gsap")),V=require("gsap/dist/ScrollTrigger"),P=C(require("jump.js")),f=require("./mediaResolver.js"),ce=require("react-intersection-observer"),ue=C(require("../../helpers/ScrollLoadVideo.js")),p=require("../../components/index.js"),d=require("../../helpers/index.js"),S=require("class-variance-authority"),me=require("../../shared/Styles.js"),de=require("../../hooks/useExposure.js"),k=require("../../shared/trackUrlRef.js"),v=require("../../shared/track.js"),fe=require("../../helpers/utils.js"),ge=require("../AiuiProvider/index.js"),be=require("../../components/button.js"),ve=require("../VideoModal/index.js"),ye=C(require("./HeroBannerCarousel.js"));const x="hero_banner",Ye=(0,S.cva)("hero-banner-content lg-desktop:gap-[32px] pointer-events-none absolute top-24 z-10 flex w-full flex-col gap-[24px]",{variants:{align:{left:"tablet:px-[32px] laptop:top-1/2 laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] laptop:-translate-y-1/2 left-0 px-[16px]",center:"tablet:top-[84px] laptop:top-[76px] desktop:top-[176px] lg-desktop:top-[192px] left-1/2 top-[84px] -translate-x-1/2 translate-y-0 items-center text-center"}},defaultVariants:{align:"left"}}),Ze=(0,S.cva)("hero-banner-wrap-text lg-desktop:max-w-[824px] desktop:max-w-[648px] laptop:max-w-[440px] tablet:max-w-[704px] max-w-[358px]",{variants:{align:{left:"laptop:text-left",center:"text-center"}},defaultVariants:{align:"left"}}),Ke=(0,S.cva)("hero-banner-button-group lg-desktop:gap-x-3 pointer-events-auto flex flex-wrap items-center gap-x-2 gap-y-3",{variants:{align:{left:"laptop:justify-start",center:"justify-center"}},defaultVariants:{align:"left"}}),Qe=(0,S.cva)("hero-banner-icon-group flex items-center gap-2",{variants:{align:{left:"justify-start",center:"justify-center"}},defaultVariants:{align:"left"}}),Xe=({size:t="base"})=>{const{width:c,height:o}=be.sizeMap[t];return(0,e.jsx)("svg",{width:c,height:o,viewBox:"0 0 20 20",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z",fill:"currentcolor"})})},pe=m.default.forwardRef(({data:t,className:c,classNames:o={},onSecondaryClick:T,onPrimaryClick:g,onTertiaryClick:_,jumpOptions:xe={},a11yLabels:ke,...q},F)=>{const{locale:W,pageHandle:he}=(0,ge.useAiuiContext)(),Y=t.mode!=="single"&&!!t.items&&t.items.length>0,R={...{duration:500,offset:0},...xe},z=r=>!r||!W?r:(0,fe.getLocalizedPath)(r,W),{label:Z,title:u,subtitle:i,endDate:K,endDate_tz:Te,dateFormat:we,pcImage:D,isShowVideo:Q,isVideoLoop:Be=!0,primaryButton:s,secondaryButton:n,tertiaryButton:l,theme:He="light",size:j="default",titleSize:A,caption:X=[],blockLink:I,iconArray:$,align:w="left",enableParallax:ee=!0}=t,O=Array.isArray(X)?X:[],Ne=Array.isArray($)?$:void 0,te=(0,f.useMediaTier)(),re=(0,f.buildPictureSource)(t),Ce=(0,f.resolveTierMedia)(t,te,"video")?.url||"",[ne,oe]=(0,m.useState)(!1),{ref:Le,inView:ae}=(0,ce.useInView)(),U=(0,m.useRef)(null),G=(0,m.useRef)(null),J=(0,m.useRef)(null),B=(0,m.useRef)(null),y=(0,m.useRef)(null),b=(0,v.resolveComponentMediaType)(Q),E=(0,k.buildTrackingRef)(he??"",b,x),h=(0,f.resolveTierMedia)(t,te,b==="video"?"video":"image")?.id||D?.id||"",Ve=u?.trim()||i?.trim()||D?.alt?.trim()||void 0,Se=u!==void 0?u?.trim()||i?.trim()||D?.alt?.trim()||void 0:i&&i.trim()||"",ze=i&&i.trim()||"";(0,de.useExposure)(y,{componentType:b,componentName:x,componentTitle:Se,componentDescription:ze,creativeId:h,position:1});const Ie=I?(0,k.trackUrlRef)(z(I),E):void 0,Ee=n?.link?(0,k.trackUrlRef)(z(n.link),E):void 0,Me=s?.link?(0,k.trackUrlRef)(z(s.link),E):void 0,Pe=l?.link?(0,k.trackUrlRef)(z(l.link),E):void 0,Re=(0,v.buildClickTrackingProps)({interactive:!!I,componentType:b,componentName:x,title:u,description:i,position:1,creativeId:h}),De=(0,v.buildClickTrackingProps)({interactive:!0,componentType:b,componentName:x,title:u,description:i,buttonName:"video play",position:1,creativeId:h}),je=(0,v.buildClickTrackingProps)({interactive:!!(n?.link||n?.isCustomSecondaryButton),componentType:b,componentName:x,title:u,description:i,buttonName:n?.text,position:1,creativeId:h}),Ae=(0,v.buildClickTrackingProps)({interactive:!!(s?.link||s?.isCustomPrimaryButton),componentType:b,componentName:x,title:u,description:i,buttonName:s?.text,position:1,creativeId:h}),Oe=(0,v.buildClickTrackingProps)({interactive:!!(l?.link||l?.isCustomTertiaryButton),componentType:b,componentName:x,title:u,description:i,buttonName:l?.text,position:1,creativeId:h});return(0,m.useImperativeHandle)(F,()=>y.current),(0,m.useEffect)(()=>{if(Y||!ee)return;L.default.registerPlugin(V.ScrollTrigger);function r(){if(!B.current)return;const a=y.current?.clientHeight||100;window.innerHeight<=a?U.current=V.ScrollTrigger.create({trigger:y.current,start:"top bottom",end:"bottom top",scrub:!0,onUpdate:H=>{const N=H.progress*40-20;L.default.set(B.current,{yPercent:N})}}):(J.current=V.ScrollTrigger.create({trigger:y.current,start:"top bottom",end:"bottom bottom",scrub:!0,onUpdate:H=>{const N=H.progress*20-20;L.default.set(B.current,{yPercent:N})}}),G.current=V.ScrollTrigger.create({trigger:y.current,start:"top top",end:"bottom top",scrub:!0,onUpdate:H=>{const N=H.progress*20;L.default.set(B.current,{yPercent:N})}}))}return ae&&r(),()=>{U.current&&U.current.kill(),J.current&&J.current.kill(),G.current&&G.current.kill()}},[ae,t.items,ee]),Y?(0,e.jsx)(ye.default,{data:t,className:c,classNames:o,onPrimaryClick:g,onSecondaryClick:T,onTertiaryClick:_,a11yLabels:ke,ref:F,...q}):(0,e.jsx)("div",{...q,ref:Le,"data-ui-component-id":"HeroBanner",className:(0,d.cn)(o.root),children:(0,e.jsxs)("div",{ref:y,className:(0,d.cn)(He==="dark"?"aiui-dark":"","text-info-primary relative w-full overflow-hidden",{"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":j==="default","lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]":j==="sm"},c),children:[I&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:Ie,tabIndex:-1,"aria-hidden":"true","aria-label":Ve,...Re}),(0,e.jsx)("div",{ref:B,className:(0,d.cn)("absolute left-0 top-0 size-full"),children:Q?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ue.default,{poster:void 0,src:Ce,className:"laptop:w-full absolute inset-0 h-full transition-opacity duration-500",videoLayerClassName:"opacity-0",videoClassName:"h-full object-cover",muted:!0,loop:Be,playsInline:!0,onPlaying:r=>{const a=r.currentTarget;a.parentElement?.classList.remove("opacity-0"),a.closest('[data-ui-component-id="HeroBanner"]')?.querySelector('[data-video-poster="true"]')?.classList.add("opacity-0")},onWaiting:r=>{const a=r.currentTarget;if(a.currentTime>=.5)return;a.parentElement?.classList.add("opacity-0"),a.closest('[data-ui-component-id="HeroBanner"]')?.querySelector('[data-video-poster="true"]')?.classList.remove("opacity-0")}}),(0,e.jsx)("div",{"data-video-poster":"true",className:"laptop:w-full bg-container-primary pointer-events-none absolute inset-0 h-full transition-opacity duration-500",children:(0,e.jsx)(p.Picture,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:"eager",fetchPriority:"high",alt:(0,f.resolveTierMedia)(t,"lgDesktop","image")?.alt||"",source:re})})]}):(0,e.jsx)(p.Picture,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",fetchPriority:"high",alt:(0,f.resolveTierMedia)(t,"lgDesktop","image")?.alt||"",source:re})}),(0,e.jsxs)("div",{className:Ye({align:w}),children:[(0,e.jsxs)("div",{className:Ze({align:w}),children:[Z&&(0,e.jsx)(p.Text,{size:2,as:"p",className:(0,d.cn)("hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm"),html:Z}),u&&(0,e.jsx)(p.Heading,{as:A==="4"?"h1":"h2",html:u,className:(0,d.cn)("hero-banner-title",o.title),size:A?Number(A||"5"):j==="sm"?4:5}),i&&(0,e.jsx)(p.Text,{as:"p",size:2,className:(0,d.cn)("hero-banner-subtitle font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm",o.subtitle),html:i}),K&&(0,e.jsx)("div",{className:"mt-3",children:(0,e.jsx)(p.Countdown,{endDate:K,endDate_tz:Te,dateFormat:we,variant:"spacious",align:w})})]}),(0,e.jsxs)("div",{className:(0,d.cn)(Ke({align:w}),o.buttonGroup),children:[(0,e.jsxs)("div",{className:"lg-desktop:gap-3 flex items-center gap-2",children:[n?.isShowPlayVideoButton&&n?.playVideoButtonText?(0,e.jsxs)(p.Button,{onClick:()=>oe(!0),size:"lg",variant:"secondary",className:"hero-banner-play-video-button",...De,children:[n?.playVideoButtonText," ",(0,e.jsx)(Xe,{size:"lg"})]}):n?.text?(0,e.jsxs)(p.Button,{"aria-label":u??i,size:"lg",variant:"secondary",className:(0,d.cn)("hero-banner-secondary-button",o.secondaryButton),as:n?.isCustomSecondaryButton?"button":"a",href:Ee,target:n?.target,rel:n?.target==="_blank"?n?.rel??"noopener noreferrer":n?.rel,onClick:r=>{if(n.link?.startsWith("#")){r.preventDefault();const a=document.querySelector(n.link);a&&(0,P.default)(a,R)}n?.isCustomSecondaryButton&&T?.(t,r,n?.customSecondaryEventId)},...je,children:[n?.text,(0,e.jsx)("span",{className:"sr-only",children:u??i})]}):null,s&&s.text&&(0,e.jsx)(p.Button,{"aria-label":u??i,size:"lg",variant:"primary",className:(0,d.cn)("hero-banner-primary-button",o.primaryButton),as:s?.isCustomPrimaryButton?"button":"a",href:Me,target:s?.target,rel:s?.target==="_blank"?s?.rel??"noopener noreferrer":s?.rel,onClick:r=>{if(s.link?.startsWith("#")){r.preventDefault();const a=document.querySelector(s.link);a&&(0,P.default)(a,R)}s?.isCustomPrimaryButton&&g?.(t,r,s?.customPrimaryEventId)},...Ae,children:s.text})]}),l&&l.text&&(0,e.jsxs)(p.Button,{"aria-label":u??i,size:"lg",variant:"link",className:(0,d.cn)("hero-banner-tertiary-button w-auto p-0",o.tertiaryButton),as:l?.isCustomTertiaryButton?"button":"a",href:Pe,target:l?.target,rel:l?.target==="_blank"?l?.rel??"noopener noreferrer":l?.rel,onClick:r=>{if(l.link?.startsWith("#")){r.preventDefault();const a=document.querySelector(l.link);a&&(0,P.default)(a,R)}l?.isCustomTertiaryButton&&_?.(t,r,l?.customTertiaryEventId)},...Oe,children:[l.text,(0,e.jsx)("span",{className:"sr-only",children:u??i})]})]}),(0,e.jsx)("div",{className:Qe({align:w}),children:Ne?.map(r=>(0,e.jsx)("div",{className:"h-12",children:(0,e.jsx)(p.Picture,{className:"!inline-block h-full !w-auto",imgClassName:"!w-auto h-full object-contain",loading:"eager",alt:r?.pcImage?.alt||"",source:r?.pcImage?.url})},r?.pcImage?.url||r?.pcImage?.alt))})]}),O.length>0&&(0,e.jsx)("div",{className:(0,d.cn)("hero-banner-caption-group laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] pointer-events-none absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]",o.captionGroup),children:O.map((r,a)=>(0,e.jsxs)(m.default.Fragment,{children:[(0,e.jsx)(p.Text,{size:2,className:(0,d.cn)("hero-banner-product-text tablet:w-[108px] loptop:w-[150px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]"),html:r.title}),a<O.length-1&&(0,e.jsx)("div",{className:(0,d.cn)("bg-info-primary w-px")})]},r.title))}),ne&&(0,e.jsx)(ve.VideoModal,{visible:ne,videoUrl:n?.isYoutubeVideo?void 0:n?.videoUrl?.url,youTubeId:n?.isYoutubeVideo?n?.youtubeId:void 0,onCloseModal:()=>oe(!1)})]})})});pe.displayName="HeroBanner";var $e=(0,me.withLayout)(pe);
1
+ "use strict";"use client";var Ue=Object.create;var M=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var Je=Object.getOwnPropertyNames;var _e=Object.getPrototypeOf,qe=Object.prototype.hasOwnProperty;var Fe=(t,p)=>{for(var o in p)M(t,o,{get:p[o],enumerable:!0})},le=(t,p,o,T)=>{if(p&&typeof p=="object"||typeof p=="function")for(let g of Je(p))!qe.call(t,g)&&g!==o&&M(t,g,{get:()=>p[g],enumerable:!(T=Ge(p,g))||T.enumerable});return t};var C=(t,p,o)=>(o=t!=null?Ue(_e(t)):{},le(p||!t||!t.__esModule?M(o,"default",{value:t,enumerable:!0}):o,t)),We=t=>le(M({},"__esModule",{value:!0}),t);var et={};Fe(et,{default:()=>$e});module.exports=We(et);var e=require("react/jsx-runtime"),m=C(require("react")),L=C(require("gsap")),V=require("gsap/dist/ScrollTrigger"),P=C(require("jump.js")),f=require("./mediaResolver.js"),pe=require("react-intersection-observer"),ue=C(require("../../helpers/ScrollLoadVideo.js")),c=require("../../components/index.js"),d=require("../../helpers/index.js"),S=require("class-variance-authority"),me=require("../../shared/Styles.js"),de=require("../../hooks/useExposure.js"),k=require("../../shared/trackUrlRef.js"),v=require("../../shared/track.js"),fe=require("../../helpers/utils.js"),ge=require("../AiuiProvider/index.js"),be=require("../../components/button.js"),ve=require("../VideoModal/index.js"),ye=C(require("./HeroBannerCarousel.js"));const x="hero_banner",Ye=(0,S.cva)("hero-banner-content lg-desktop:gap-[32px] pointer-events-none absolute top-24 z-10 flex w-full flex-col gap-[24px]",{variants:{align:{left:"laptop:top-1/2 px-grid laptop:-translate-y-1/2 left-0",center:"tablet:top-[84px] laptop:top-[76px] desktop:top-[176px] lg-desktop:top-[192px] left-1/2 top-[84px] -translate-x-1/2 translate-y-0 items-center text-center"}},defaultVariants:{align:"left"}}),Ze=(0,S.cva)("hero-banner-wrap-text lg-desktop:max-w-[824px] desktop:max-w-[648px] laptop:max-w-[440px] tablet:max-w-[704px] max-w-[358px]",{variants:{align:{left:"laptop:text-left",center:"text-center"}},defaultVariants:{align:"left"}}),Ke=(0,S.cva)("hero-banner-button-group lg-desktop:gap-x-3 pointer-events-auto flex flex-wrap items-center gap-x-2 gap-y-3",{variants:{align:{left:"laptop:justify-start",center:"justify-center"}},defaultVariants:{align:"left"}}),Qe=(0,S.cva)("hero-banner-icon-group flex items-center gap-2",{variants:{align:{left:"justify-start",center:"justify-center"}},defaultVariants:{align:"left"}}),Xe=({size:t="base"})=>{const{width:p,height:o}=be.sizeMap[t];return(0,e.jsx)("svg",{width:p,height:o,viewBox:"0 0 20 20",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z",fill:"currentcolor"})})},ce=m.default.forwardRef(({data:t,className:p,classNames:o={},onSecondaryClick:T,onPrimaryClick:g,onTertiaryClick:_,jumpOptions:xe={},a11yLabels:ke,...q},F)=>{const{locale:W,pageHandle:he}=(0,ge.useAiuiContext)(),Y=t.mode!=="single"&&!!t.items&&t.items.length>0,R={...{duration:500,offset:0},...xe},z=r=>!r||!W?r:(0,fe.getLocalizedPath)(r,W),{label:Z,title:u,subtitle:i,endDate:K,endDate_tz:Te,dateFormat:we,pcImage:D,isShowVideo:Q,isVideoLoop:Be=!0,primaryButton:s,secondaryButton:n,tertiaryButton:l,theme:He="light",size:j="default",titleSize:A,caption:X=[],blockLink:I,iconArray:$,align:w="left",enableParallax:ee=!0}=t,O=Array.isArray(X)?X:[],Ne=Array.isArray($)?$:void 0,te=(0,f.useMediaTier)(),re=(0,f.buildPictureSource)(t),Ce=(0,f.resolveTierMedia)(t,te,"video")?.url||"",[ne,oe]=(0,m.useState)(!1),{ref:Le,inView:ae}=(0,pe.useInView)(),U=(0,m.useRef)(null),G=(0,m.useRef)(null),J=(0,m.useRef)(null),B=(0,m.useRef)(null),y=(0,m.useRef)(null),b=(0,v.resolveComponentMediaType)(Q),E=(0,k.buildTrackingRef)(he??"",b,x),h=(0,f.resolveTierMedia)(t,te,b==="video"?"video":"image")?.id||D?.id||"",Ve=u?.trim()||i?.trim()||D?.alt?.trim()||void 0,Se=u!==void 0?u?.trim()||i?.trim()||D?.alt?.trim()||void 0:i&&i.trim()||"",ze=i&&i.trim()||"";(0,de.useExposure)(y,{componentType:b,componentName:x,componentTitle:Se,componentDescription:ze,creativeId:h,position:1});const Ie=I?(0,k.trackUrlRef)(z(I),E):void 0,Ee=n?.link?(0,k.trackUrlRef)(z(n.link),E):void 0,Me=s?.link?(0,k.trackUrlRef)(z(s.link),E):void 0,Pe=l?.link?(0,k.trackUrlRef)(z(l.link),E):void 0,Re=(0,v.buildClickTrackingProps)({interactive:!!I,componentType:b,componentName:x,title:u,description:i,position:1,creativeId:h}),De=(0,v.buildClickTrackingProps)({interactive:!0,componentType:b,componentName:x,title:u,description:i,buttonName:"video play",position:1,creativeId:h}),je=(0,v.buildClickTrackingProps)({interactive:!!(n?.link||n?.isCustomSecondaryButton),componentType:b,componentName:x,title:u,description:i,buttonName:n?.text,position:1,creativeId:h}),Ae=(0,v.buildClickTrackingProps)({interactive:!!(s?.link||s?.isCustomPrimaryButton),componentType:b,componentName:x,title:u,description:i,buttonName:s?.text,position:1,creativeId:h}),Oe=(0,v.buildClickTrackingProps)({interactive:!!(l?.link||l?.isCustomTertiaryButton),componentType:b,componentName:x,title:u,description:i,buttonName:l?.text,position:1,creativeId:h});return(0,m.useImperativeHandle)(F,()=>y.current),(0,m.useEffect)(()=>{if(Y||!ee)return;L.default.registerPlugin(V.ScrollTrigger);function r(){if(!B.current)return;const a=y.current?.clientHeight||100;window.innerHeight<=a?U.current=V.ScrollTrigger.create({trigger:y.current,start:"top bottom",end:"bottom top",scrub:!0,onUpdate:H=>{const N=H.progress*40-20;L.default.set(B.current,{yPercent:N})}}):(J.current=V.ScrollTrigger.create({trigger:y.current,start:"top bottom",end:"bottom bottom",scrub:!0,onUpdate:H=>{const N=H.progress*20-20;L.default.set(B.current,{yPercent:N})}}),G.current=V.ScrollTrigger.create({trigger:y.current,start:"top top",end:"bottom top",scrub:!0,onUpdate:H=>{const N=H.progress*20;L.default.set(B.current,{yPercent:N})}}))}return ae&&r(),()=>{U.current&&U.current.kill(),J.current&&J.current.kill(),G.current&&G.current.kill()}},[ae,t.items,ee]),Y?(0,e.jsx)(ye.default,{data:t,className:p,classNames:o,onPrimaryClick:g,onSecondaryClick:T,onTertiaryClick:_,a11yLabels:ke,ref:F,...q}):(0,e.jsx)("div",{...q,ref:Le,"data-ui-component-id":"HeroBanner",className:(0,d.cn)(o.root),children:(0,e.jsxs)("div",{ref:y,className:(0,d.cn)(He==="dark"?"aiui-dark":"","text-info-primary relative w-full overflow-hidden",{"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":j==="default","lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]":j==="sm"},p),children:[I&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:Ie,tabIndex:-1,"aria-hidden":"true","aria-label":Ve,...Re}),(0,e.jsx)("div",{ref:B,className:(0,d.cn)("absolute left-0 top-0 size-full"),children:Q?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ue.default,{poster:void 0,src:Ce,className:"laptop:w-full absolute inset-0 h-full transition-opacity duration-500",videoLayerClassName:"opacity-0",videoClassName:"h-full object-cover",muted:!0,loop:Be,playsInline:!0,onPlaying:r=>{const a=r.currentTarget;a.parentElement?.classList.remove("opacity-0"),a.closest('[data-ui-component-id="HeroBanner"]')?.querySelector('[data-video-poster="true"]')?.classList.add("opacity-0")},onWaiting:r=>{const a=r.currentTarget;if(a.currentTime>=.5)return;a.parentElement?.classList.add("opacity-0"),a.closest('[data-ui-component-id="HeroBanner"]')?.querySelector('[data-video-poster="true"]')?.classList.remove("opacity-0")}}),(0,e.jsx)("div",{"data-video-poster":"true",className:"laptop:w-full bg-container-primary pointer-events-none absolute inset-0 h-full transition-opacity duration-500",children:(0,e.jsx)(c.Picture,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:"eager",fetchPriority:"high",alt:(0,f.resolveTierMedia)(t,"lgDesktop","image")?.alt||"",source:re})})]}):(0,e.jsx)(c.Picture,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",fetchPriority:"high",alt:(0,f.resolveTierMedia)(t,"lgDesktop","image")?.alt||"",source:re})}),(0,e.jsxs)("div",{className:Ye({align:w}),children:[(0,e.jsxs)("div",{className:Ze({align:w}),children:[Z&&(0,e.jsx)(c.Text,{size:2,as:"p",className:(0,d.cn)("hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm"),html:Z}),u&&(0,e.jsx)(c.Heading,{as:A==="4"?"h1":"h2",html:u,className:(0,d.cn)("hero-banner-title",o.title),size:A?Number(A||"5"):j==="sm"?4:5}),i&&(0,e.jsx)(c.Text,{as:"p",size:2,className:(0,d.cn)("hero-banner-subtitle font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm",o.subtitle),html:i}),K&&(0,e.jsx)("div",{className:"mt-3",children:(0,e.jsx)(c.Countdown,{endDate:K,endDate_tz:Te,dateFormat:we,variant:"spacious",align:w})})]}),(0,e.jsxs)("div",{className:(0,d.cn)(Ke({align:w}),o.buttonGroup),children:[(0,e.jsxs)("div",{className:"lg-desktop:gap-3 flex items-center gap-2",children:[n?.isShowPlayVideoButton&&n?.playVideoButtonText?(0,e.jsxs)(c.Button,{onClick:()=>oe(!0),size:"lg",variant:"secondary",className:"hero-banner-play-video-button",...De,children:[n?.playVideoButtonText," ",(0,e.jsx)(Xe,{size:"lg"})]}):n?.text?(0,e.jsxs)(c.Button,{"aria-label":u??i,size:"lg",variant:"secondary",className:(0,d.cn)("hero-banner-secondary-button",o.secondaryButton),as:n?.isCustomSecondaryButton?"button":"a",href:Ee,target:n?.target,rel:n?.target==="_blank"?n?.rel??"noopener noreferrer":n?.rel,onClick:r=>{if(n.link?.startsWith("#")){r.preventDefault();const a=document.querySelector(n.link);a&&(0,P.default)(a,R)}n?.isCustomSecondaryButton&&T?.(t,r,n?.customSecondaryEventId)},...je,children:[n?.text,(0,e.jsx)("span",{className:"sr-only",children:u??i})]}):null,s&&s.text&&(0,e.jsx)(c.Button,{"aria-label":u??i,size:"lg",variant:"primary",className:(0,d.cn)("hero-banner-primary-button",o.primaryButton),as:s?.isCustomPrimaryButton?"button":"a",href:Me,target:s?.target,rel:s?.target==="_blank"?s?.rel??"noopener noreferrer":s?.rel,onClick:r=>{if(s.link?.startsWith("#")){r.preventDefault();const a=document.querySelector(s.link);a&&(0,P.default)(a,R)}s?.isCustomPrimaryButton&&g?.(t,r,s?.customPrimaryEventId)},...Ae,children:s.text})]}),l&&l.text&&(0,e.jsxs)(c.Button,{"aria-label":u??i,size:"lg",variant:"link",className:(0,d.cn)("hero-banner-tertiary-button w-auto p-0",o.tertiaryButton),as:l?.isCustomTertiaryButton?"button":"a",href:Pe,target:l?.target,rel:l?.target==="_blank"?l?.rel??"noopener noreferrer":l?.rel,onClick:r=>{if(l.link?.startsWith("#")){r.preventDefault();const a=document.querySelector(l.link);a&&(0,P.default)(a,R)}l?.isCustomTertiaryButton&&_?.(t,r,l?.customTertiaryEventId)},...Oe,children:[l.text,(0,e.jsx)("span",{className:"sr-only",children:u??i})]})]}),(0,e.jsx)("div",{className:Qe({align:w}),children:Ne?.map(r=>(0,e.jsx)("div",{className:"h-12",children:(0,e.jsx)(c.Picture,{className:"!inline-block h-full !w-auto",imgClassName:"!w-auto h-full object-contain",loading:"eager",alt:r?.pcImage?.alt||"",source:r?.pcImage?.url})},r?.pcImage?.url||r?.pcImage?.alt))})]}),O.length>0&&(0,e.jsx)("div",{className:(0,d.cn)("hero-banner-caption-group laptop:gap-3 px-grid desktop:pb-[24px] pointer-events-none absolute bottom-0 z-10 flex items-stretch gap-2 pb-[16px]",o.captionGroup),children:O.map((r,a)=>(0,e.jsxs)(m.default.Fragment,{children:[(0,e.jsx)(c.Text,{size:2,className:(0,d.cn)("hero-banner-product-text tablet:w-[108px] loptop:w-[150px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]"),html:r.title}),a<O.length-1&&(0,e.jsx)("div",{className:(0,d.cn)("bg-info-primary w-px")})]},r.title))}),ne&&(0,e.jsx)(ve.VideoModal,{visible:ne,videoUrl:n?.isYoutubeVideo?void 0:n?.videoUrl?.url,youTubeId:n?.isYoutubeVideo?n?.youtubeId:void 0,onCloseModal:()=>oe(!1)})]})})});ce.displayName="HeroBanner";var $e=(0,me.withLayout)(ce);
@@ -1 +1 @@
1
- "use strict";"use client";var et=Object.create;var de=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var nt=Object.getOwnPropertyNames;var ot=Object.getPrototypeOf,at=Object.prototype.hasOwnProperty;var rt=(a,c)=>{for(var f in c)de(a,f,{get:c[f],enumerable:!0})},Ee=(a,c,f,A)=>{if(c&&typeof c=="object"||typeof c=="function")for(let k of nt(c))!at.call(a,k)&&k!==f&&de(a,k,{get:()=>c[k],enumerable:!(A=tt(c,k))||A.enumerable});return a};var Ve=(a,c,f)=>(f=a!=null?et(ot(a)):{},Ee(c||!a||!a.__esModule?de(f,"default",{value:a,enumerable:!0}):f,a)),it=a=>Ee(de({},"__esModule",{value:!0}),a);var ut={};rt(ut,{default:()=>ct});module.exports=it(ut);var o=require("react/jsx-runtime"),i=Ve(require("react")),ue=require("swiper/react"),Pe=Ve(require("../../helpers/ScrollLoadVideo.js")),w=require("../../helpers/index.js"),T=require("./mediaResolver.js"),u=require("../../components/index.js"),Ne=require("../../hooks/useCarouselPlayback.js"),j=require("../../shared/CarouselControls.js"),E=require("../../shared/track.js"),q=require("../../shared/trackUrlRef.js"),_e=require("../../hooks/useExposure.js"),He=require("../AiuiProvider/index.js"),Ae=require("../VideoModal/index.js"),mt=require("swiper/css");const st=({size:a="base"})=>{const c=a==="lg"?"20":a==="sm"?"16":"18";return(0,o.jsx)("svg",{width:c,height:c,viewBox:"0 0 20 20",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,o.jsx)("path",{d:"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z",fill:"currentcolor"})})},ce="hero_banner",lt=({data:a,isActive:c,isAdjacent:f=!1,videoRef:A,slideIndex:k,containerSize:Q="default",theme:pe="light",slideLabel:me,position:V,locale:s,pageHandle:$,onPlayVideo:X,onPrimaryClick:y,onSecondaryClick:ge,onTertiaryClick:ee})=>{const{pcImage:te,isVideoLoop:O=!0,isShowVideo:I,title:B,subtitle:C,label:G,endDate:U,endDate_tz:ne,dateFormat:P,iconArray:R,caption:x,blockLink:Y,primaryButton:l,secondaryButton:d,tertiaryButton:p,align:N="left",titleSize:M}=a,z=(0,T.useMediaTier)(),v=(0,T.buildPictureSource)(a),W=(0,T.resolveTierMedia)(a,"lgDesktop","image")?.alt||te?.alt||"",S=(0,T.resolveTierMedia)(a,z,"video")?.url||"",_=!!v&&!/\.(mp4|mov|webm|m4v)(\?|$)/i.test(v),oe=(0,E.resolveComponentMediaType)(I),ve=(0,T.resolveTierMedia)(a,z,I?"video":"image")?.id||te?.id||"",ae=`${(0,q.buildTrackingRef)($??"",oe,ce)}_${V}`,fe=n=>n&&s?(0,w.getLocalizedPath)(n,s):n,F=n=>n?(0,q.trackUrlRef)(fe(n),ae):void 0,L=(n,b)=>(0,E.buildClickTrackingProps)({interactive:n,componentType:oe,componentName:ce,title:B,description:C,buttonName:b,position:V,creativeId:ve});return(0,o.jsxs)("div",{"data-ui-component-id":"HeroBannerSlide",role:"group","aria-roledescription":"slide","aria-label":me,className:(0,w.cn)("text-info-primary relative w-full overflow-hidden transition-colors duration-500",pe==="dark"&&"aiui-dark",Q==="default"?"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":"lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]"),children:[Y&&(0,o.jsx)("a",{className:"absolute inset-0 z-10",href:F(Y),tabIndex:-1,"aria-hidden":"true","aria-label":B?.trim()||C?.trim()||W||void 0,...L(!0)}),I?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Pe.default,{videoRef:A,src:S,poster:void 0,className:"absolute inset-0 size-full transition-opacity duration-500",videoClassName:"size-full object-cover",videoLayerClassName:"opacity-0",muted:!0,loop:O,playsInline:!0,onPlaying:n=>{const b=n.currentTarget;b.parentElement?.classList.remove("opacity-0"),b.closest('[data-ui-component-id="HeroBannerSlide"]')?.querySelector('[data-video-poster="true"]')?.classList.add("opacity-0")},onWaiting:n=>{const b=n.currentTarget;if(b.currentTime>=.5)return;b.parentElement?.classList.add("opacity-0"),b.closest('[data-ui-component-id="HeroBannerSlide"]')?.querySelector('[data-video-poster="true"]')?.classList.remove("opacity-0")}}),_&&(0,o.jsx)("div",{"data-video-poster":"true",className:"bg-container-primary pointer-events-none absolute inset-0 size-full transition-opacity duration-500",children:(0,o.jsx)(u.Picture,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:k===0||f?"eager":"lazy",fetchPriority:k===0?"high":"auto",alt:W,source:v})})]}):(0,o.jsx)(u.Picture,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:"eager",fetchPriority:"high",alt:W,source:v}),(0,o.jsxs)("div",{className:(0,w.cn)("laptop:top-1/2 laptop:-translate-y-1/2 lg-desktop:gap-[32px] pointer-events-none absolute top-24 z-10 flex w-full flex-col gap-[24px] transition-colors duration-500",N==="center"?"left-1/2 -translate-x-1/2 items-center text-center":"tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] left-0 px-[16px]"),children:[(0,o.jsxs)("div",{className:(0,w.cn)("tablet:max-w-[704px] laptop:max-w-[440px] desktop:max-w-[648px] lg-desktop:max-w-[824px] max-w-[358px] transition-colors duration-500",N==="center"?"text-center":"laptop:text-left"),children:[G&&(0,o.jsx)(u.Text,{size:2,as:"p",className:(0,w.cn)("hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm"),html:G}),B&&(0,o.jsx)(u.Heading,{as:M==="4"?"h1":"h2",html:B,size:M?Number(M||"5"):Q==="sm"?4:5}),C&&(0,o.jsx)(u.Text,{as:"p",size:2,className:"font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm",html:C}),U&&(0,o.jsx)("div",{className:"mt-3",children:(0,o.jsx)(u.Countdown,{endDate:U,endDate_tz:ne,dateFormat:P,variant:"spacious",align:N})})]}),(l?.text||d?.text||p?.text)&&(0,o.jsxs)("div",{className:(0,w.cn)("lg-desktop:gap-3 pointer-events-auto flex flex-wrap items-center gap-2",N==="center"?"justify-center":"laptop:justify-start"),children:[d?.isShowPlayVideoButton&&d?.playVideoButtonText?(0,o.jsxs)(u.Button,{size:"lg",variant:"secondary",className:"hero-banner-play-video-button",onClick:()=>X?.(),...L(!0,"video play"),children:[d.playVideoButtonText," ",(0,o.jsx)(st,{size:"lg"})]}):d?.text?(0,o.jsxs)(u.Button,{size:"lg",variant:"secondary",as:d?.isCustomSecondaryButton?"button":"a",href:F(d.link),target:d?.target,rel:d?.target==="_blank"?d?.rel??"noopener noreferrer":d?.rel,onClick:n=>d?.isCustomSecondaryButton&&ge?.(a,n,d?.customSecondaryEventId),...L(!!(d.link||d.isCustomSecondaryButton),d.text),children:[d.text,(0,o.jsx)("span",{className:"sr-only",children:B??C})]}):null,l?.text&&(0,o.jsx)(u.Button,{size:"lg",variant:"primary",as:l?.isCustomPrimaryButton?"button":"a",href:F(l.link),target:l?.target,rel:l?.target==="_blank"?l?.rel??"noopener noreferrer":l?.rel,onClick:n=>l?.isCustomPrimaryButton&&y?.(a,n,l?.customPrimaryEventId),...L(!!(l.link||l.isCustomPrimaryButton),l.text),children:l.text}),p?.text&&(0,o.jsxs)(u.Button,{size:"lg",variant:"link",className:"tablet:basis-auto basis-full",as:p?.isCustomTertiaryButton?"button":"a",href:F(p.link),target:p?.target,rel:p?.target==="_blank"?p?.rel??"noopener noreferrer":p?.rel,onClick:n=>p?.isCustomTertiaryButton&&ee?.(a,n,p?.customTertiaryEventId),...L(!!(p.link||p.isCustomTertiaryButton),p.text),children:[p.text,(0,o.jsx)("span",{className:"sr-only",children:B??C})]})]}),R&&R.length>0&&(0,o.jsx)("div",{className:(0,w.cn)("flex items-center gap-2",N==="center"?"justify-center":"justify-start"),children:R.map(n=>(0,o.jsx)("div",{className:"h-12",children:(0,o.jsx)(u.Picture,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",alt:n?.pcImage?.alt||"",source:n?.pcImage?.url})},n?.pcImage?.url||n?.pcImage?.alt))})]}),x&&x.length>0&&(0,o.jsx)("div",{className:"hero-banner-caption-group laptop:gap-3 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] desktop:pb-[24px] pointer-events-none absolute bottom-0 z-10 flex items-stretch gap-2 px-[16px] pb-[16px]",children:x.map((n,b)=>(0,o.jsxs)(i.default.Fragment,{children:[(0,o.jsx)(u.Text,{size:2,className:"hero-banner-product-text tablet:w-[108px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]",html:n.title}),b<x.length-1&&(0,o.jsx)("div",{className:"bg-info-primary w-px"})]},n.title))})]})},dt={prevSlide:"Previous slide",nextSlide:"Next slide",pauseAutoplay:"Pause autoplay",playAutoplay:"Play autoplay",pauseVideo:"Pause video",playVideo:"Play video",slideStatus:"Slide",carouselLabel:"Banner carousel"},Be=i.default.forwardRef(({data:a,className:c,classNames:f={},a11yLabels:A,onPrimaryClick:k,onSecondaryClick:Q,onTertiaryClick:pe,...me},V)=>{const s=a.items||[],$=a.carousel,X=$?.size??a.size??"default",y={...dt,...A},{locale:ge,pageHandle:ee,trackingData:te}=(0,He.useAiuiContext)(),O=(0,T.useMediaTier)(),I=(0,q.buildPageGroup)({pageHandle:ee,pageGroup:te?.pageGroup}),B=(0,i.useRef)(null),[C,G]=(0,i.useState)(null),[U,ne]=(0,i.useState)(null),[P,R]=(0,i.useState)(null),[x,Y]=(0,i.useState)(null),l=(0,i.useRef)(s);(0,i.useEffect)(()=>{l.current=s});const d=e=>e!==void 0&&e!==999&&e>=5,p=e=>e!==void 0&&e!==999&&e>=1&&e<=30,N=$?.autoplaySeconds,M=e=>{const t=e?.autoplaySeconds;return p(t)?t:d(N)?N:void 0},z=s.length>1&&s.some(e=>M(e)!==void 0),v=(0,i.useRef)(s.map(()=>i.default.createRef())),W=($?.showArrows??!0)&&s.length>1,S=(0,i.useCallback)((e,t)=>{(0,E.gaTrack)({event:"ga4Event",event_name:e,event_parameters:t})},[]),_=(0,i.useCallback)(e=>l.current[e]?.isShowVideo?"video":"image",[]),oe=(0,i.useCallback)((e,t)=>{t==="swipe"&&S("hero_banner_swipe",{to_index:e}),S("hero_banner_slide_view",{index:e,total:l.current.length,media_type:_(e),trigger:t})},[S,_]),ve=(0,i.useCallback)((e,t,r,g="arrow")=>{S("hero_banner_arrow_click",{direction:e,from_index:t,to_index:r,source:g})},[S]),ae=(0,i.useCallback)((e,t)=>{S(e?"hero_banner_pause":"hero_banner_resume",{index:t,media_type:_(t)})},[S,_]),fe=(0,i.useCallback)((e,t)=>{const r=l.current[t];r&&(0,E.trackComponentClick)({pageGroup:I,componentType:"video",componentName:ce,position:t+1,buttonName:e?"video pause":"video play",componentTitle:r.title,componentDescription:r.subtitle,creativeId:(0,T.resolveTierMedia)(r,O,"video")?.id||r.pcImage?.id||""})},[I,O]),F=(0,i.useCallback)(e=>{v.current.forEach((r,g)=>{g!==e&&r.current&&(r.current.pause(),r.current.currentTime=0)});const t=v.current[e];t?.current&&(t.current.currentTime=0,t.current.play()?.catch(()=>{}))},[]),{rootRef:L,activeIndex:n,playbackState:b,resetNonce:ye,announcement:Ie,activeFrameIntervalSec:Se,isTimerRunning:Re,handleSwiperInit:Me,handleSlideChange:ze,handleTransitionEnd:Fe,handleSliderFirstMove:De,goToSlide:Te,goToSlideIndex:je,handlePausePlayClick:qe,notifyVideoPlaying:ke,handleFocus:$e,handleBlur:Oe}=(0,Ne.useCarouselPlayback)({frameCount:s.length,resolveFrameIntervalSec:e=>M(s[e]),isAutoplayEnabled:z,swiperRef:B,slideStatusLabel:y.slideStatus,onSlideMediaSync:F,onSlideChange:oe,onArrowNavigate:ve,delaysCountdownForVideo:e=>!!l.current[e]?.isShowVideo,onPauseToggle:(e,t)=>{ae(e,t);const r=v.current[t]?.current;r&&(e?r.pause():r.ended||r.play()?.catch(()=>{}))}}),Ge=(0,i.useCallback)(e=>{L.current=e,typeof V=="function"?V(e):V&&(V.current=e)},[V,L]),h=s[n]??s[0],Ue=(0,E.resolveComponentMediaType)(h?.isShowVideo),Ye=h?.title!==void 0?h?.title?.trim()||h?.subtitle?.trim()||h?.pcImage?.alt?.trim()||void 0:h?.subtitle&&h.subtitle.trim()||"",We=h&&((0,T.resolveTierMedia)(h,O,h.isShowVideo?"video":"image")?.id||h.pcImage?.id)||"";(0,_e.useExposure)(L,{componentType:Ue,componentName:ce,componentTitle:Ye,componentDescription:h?.subtitle?.trim()||"",creativeId:We,position:1}),(0,i.useEffect)(()=>{G(null),ne(null);const e=l.current[n],t=v.current[n]?.current;if(!e?.isShowVideo||!t)return;const r=()=>G(t.ended?"ended":t.paused?"paused":"playing"),g=()=>ne(Number.isFinite(t.duration)?t.duration:null),D=()=>{r(),ke(n)};return r(),g(),t.addEventListener("playing",D),t.addEventListener("pause",r),t.addEventListener("ended",r),t.addEventListener("loadedmetadata",g),()=>{t.removeEventListener("playing",D),t.removeEventListener("pause",r),t.removeEventListener("ended",r),t.removeEventListener("loadedmetadata",g)}},[n,ke]),(0,i.useEffect)(()=>{const e=l.current[n];if(!e?.isShowVideo||!e?.isMultiThemeEnabled)return;const t=v.current[n]?.current;if(!t)return;const r=(m,H,le,xe)=>{if(!(!m||typeof H!="number"||typeof le!="number"||typeof xe!="number"))return xe>=H&&xe<le?m:void 0};let g=null;const D=m=>{g=m,R(H=>H&&H.index===n&&H.theme===m?H:{index:n,theme:m})},re=m=>{D(r(e.theme_1,e.star_time_1,e.end_time_1,m)??r(e.theme_2,e.star_time_2,e.end_time_2,m)??e.theme??"light")},ie=t;let J=0,K=0;const be=typeof ie.requestVideoFrameCallback=="function",Xe=()=>be?K!==0:J!==0,he=()=>{if(!Xe())if(be){const m=(H,le)=>{re(le.mediaTime),K=ie.requestVideoFrameCallback(m)};K=ie.requestVideoFrameCallback(m)}else{const m=()=>{re(t.currentTime),J=requestAnimationFrame(m)};J=requestAnimationFrame(m)}},se=()=>{be?(ie.cancelVideoFrameCallback?.(K),K=0):(cancelAnimationFrame(J),J=0)},Le=()=>{se(),g&&R({index:n,theme:g})};return t.addEventListener("play",he),t.addEventListener("pause",se),t.addEventListener("ended",Le),!t.paused&&!t.ended&&he(),()=>{se(),t.removeEventListener("play",he),t.removeEventListener("pause",se),t.removeEventListener("ended",Le)}},[n]),(0,i.useEffect)(()=>{v.current.forEach((e,t)=>{t!==0&&e.current&&(e.current.pause(),e.current.currentTime=0)})},[]),(0,i.useEffect)(()=>{l.current.length!==0&&S("hero_banner_slide_view",{index:0,total:l.current.length,media_type:_(0),trigger:"initial"})},[S,_]);const Ze=!!s[n]?.isShowVideo,Ce=Se!==void 0,Z=!Ce&&Ze&&U!==null&&U>5&&C!=="ended"&&C!==null,Je=Ce||Z,Ke=Z?C==="paused":b==="STOPPED",Qe=()=>{if(!Z){qe();return}const e=v.current[n]?.current;if(!e)return;const t=!e.paused;t?e.pause():e.play()?.catch(()=>{}),ae(t,n),fe(t,n)},we=P&&P.index===n?P.theme:s[n]?.theme;return(0,o.jsxs)("div",{ref:Ge,role:"region","aria-roledescription":"carousel","aria-label":y.carouselLabel,"data-ui-component-id":"HeroBanner",onFocus:$e,onBlur:Oe,className:(0,w.cn)("hero-banner-carousel group relative w-full overflow-hidden",X==="default"?"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":"lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]",f.root,c),...me,children:[(0,o.jsx)(ue.Swiper,{onSwiper:Me,onSlideChange:ze,onSlideChangeTransitionEnd:Fe,onSliderFirstMove:De,slidesPerView:1,loop:!0,initialSlide:0,allowTouchMove:!0,children:s.map((e,t)=>{const r=P&&P.index===t?P.theme:e.theme??"light";return(0,o.jsx)(ue.SwiperSlide,{children:({isActive:g,isPrev:D,isNext:re})=>(0,o.jsx)(lt,{data:e,isActive:g,isAdjacent:D||re,slideIndex:t,slideLabel:`${y.slideStatus} ${t+1} / ${s.length}`,videoRef:v.current[t],containerSize:X,theme:r,position:t+1,locale:ge,pageHandle:ee,onPlayVideo:()=>Y(t),onPrimaryClick:k,onSecondaryClick:Q,onTertiaryClick:pe})},t)})}),W&&(0,o.jsx)(j.CarouselArrows,{onPrev:()=>Te("prev"),onNext:()=>Te("next"),prevLabel:y.prevSlide,nextLabel:y.nextSlide}),z&&(0,o.jsx)(j.CarouselProgressControls,{frameCount:s.length,activeIndex:n,resetNonce:ye,activeFrameIntervalSec:Se,isAutoplayEnabled:z,isTimerRunning:Re,onSegmentClick:je,segmentLabel:e=>`${y.slideStatus} ${e+1} / ${s.length}`,classPrefix:"hero-banner",theme:we}),Je&&(0,o.jsx)(j.CarouselCornerToggle,{isPaused:Ke,onToggle:Qe,pausedLabel:Z?y.playVideo:y.playAutoplay,playingLabel:Z?y.pauseVideo:y.pauseAutoplay,classPrefix:"hero-banner",theme:we}),(0,o.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:Ie}),x!==null&&s[x]?.secondaryButton&&(0,o.jsx)(Ae.VideoModal,{visible:!0,videoUrl:s[x].secondaryButton?.isYoutubeVideo?void 0:s[x].secondaryButton?.videoUrl?.url,youTubeId:s[x].secondaryButton?.isYoutubeVideo?s[x].secondaryButton?.youtubeId:void 0,onCloseModal:()=>Y(null)})]})});Be.displayName="HeroBannerCarousel";var ct=Be;
1
+ "use strict";"use client";var et=Object.create;var de=Object.defineProperty;var tt=Object.getOwnPropertyDescriptor;var nt=Object.getOwnPropertyNames;var ot=Object.getPrototypeOf,at=Object.prototype.hasOwnProperty;var rt=(a,c)=>{for(var f in c)de(a,f,{get:c[f],enumerable:!0})},Ee=(a,c,f,A)=>{if(c&&typeof c=="object"||typeof c=="function")for(let k of nt(c))!at.call(a,k)&&k!==f&&de(a,k,{get:()=>c[k],enumerable:!(A=tt(c,k))||A.enumerable});return a};var Ve=(a,c,f)=>(f=a!=null?et(ot(a)):{},Ee(c||!a||!a.__esModule?de(f,"default",{value:a,enumerable:!0}):f,a)),it=a=>Ee(de({},"__esModule",{value:!0}),a);var ut={};rt(ut,{default:()=>ct});module.exports=it(ut);var o=require("react/jsx-runtime"),i=Ve(require("react")),ue=require("swiper/react"),Pe=Ve(require("../../helpers/ScrollLoadVideo.js")),w=require("../../helpers/index.js"),x=require("./mediaResolver.js"),u=require("../../components/index.js"),Ne=require("../../hooks/useCarouselPlayback.js"),j=require("../../shared/CarouselControls.js"),E=require("../../shared/track.js"),q=require("../../shared/trackUrlRef.js"),_e=require("../../hooks/useExposure.js"),He=require("../AiuiProvider/index.js"),Ae=require("../VideoModal/index.js"),mt=require("swiper/css");const st=({size:a="base"})=>{const c=a==="lg"?"20":a==="sm"?"16":"18";return(0,o.jsx)("svg",{width:c,height:c,viewBox:"0 0 20 20",fill:"currentcolor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,o.jsx)("path",{d:"M13.9599 9.30662C14.4547 9.63647 14.4547 10.3635 13.9599 10.6934L6.29558 15.8029C5.74179 16.1721 5 15.7751 5 15.1096V4.89042C5 4.22484 5.74179 3.82785 6.29558 4.19705L13.9599 9.30662Z",fill:"currentcolor"})})},ce="hero_banner",lt=({data:a,isActive:c,isAdjacent:f=!1,videoRef:A,slideIndex:k,containerSize:Q="default",theme:pe="light",slideLabel:me,position:V,locale:s,pageHandle:$,onPlayVideo:X,onPrimaryClick:y,onSecondaryClick:ge,onTertiaryClick:ee})=>{const{pcImage:te,isVideoLoop:O=!0,isShowVideo:I,title:B,subtitle:C,label:G,endDate:U,endDate_tz:ne,dateFormat:P,iconArray:R,caption:S,blockLink:Y,primaryButton:l,secondaryButton:d,tertiaryButton:p,align:N="left",titleSize:M}=a,z=(0,x.useMediaTier)(),v=(0,x.buildPictureSource)(a),W=(0,x.resolveTierMedia)(a,"lgDesktop","image")?.alt||te?.alt||"",T=(0,x.resolveTierMedia)(a,z,"video")?.url||"",_=!!v&&!/\.(mp4|mov|webm|m4v)(\?|$)/i.test(v),oe=(0,E.resolveComponentMediaType)(I),ve=(0,x.resolveTierMedia)(a,z,I?"video":"image")?.id||te?.id||"",ae=`${(0,q.buildTrackingRef)($??"",oe,ce)}_${V}`,fe=n=>n&&s?(0,w.getLocalizedPath)(n,s):n,F=n=>n?(0,q.trackUrlRef)(fe(n),ae):void 0,L=(n,b)=>(0,E.buildClickTrackingProps)({interactive:n,componentType:oe,componentName:ce,title:B,description:C,buttonName:b,position:V,creativeId:ve});return(0,o.jsxs)("div",{"data-ui-component-id":"HeroBannerSlide",role:"group","aria-roledescription":"slide","aria-label":me,className:(0,w.cn)("text-info-primary relative w-full overflow-hidden transition-colors duration-500",pe==="dark"&&"aiui-dark",Q==="default"?"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":"lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]"),children:[Y&&(0,o.jsx)("a",{className:"absolute inset-0 z-10",href:F(Y),tabIndex:-1,"aria-hidden":"true","aria-label":B?.trim()||C?.trim()||W||void 0,...L(!0)}),I?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Pe.default,{videoRef:A,src:T,poster:void 0,className:"absolute inset-0 size-full transition-opacity duration-500",videoClassName:"size-full object-cover",videoLayerClassName:"opacity-0",muted:!0,loop:O,playsInline:!0,onPlaying:n=>{const b=n.currentTarget;b.parentElement?.classList.remove("opacity-0"),b.closest('[data-ui-component-id="HeroBannerSlide"]')?.querySelector('[data-video-poster="true"]')?.classList.add("opacity-0")},onWaiting:n=>{const b=n.currentTarget;if(b.currentTime>=.5)return;b.parentElement?.classList.add("opacity-0"),b.closest('[data-ui-component-id="HeroBannerSlide"]')?.querySelector('[data-video-poster="true"]')?.classList.remove("opacity-0")}}),_&&(0,o.jsx)("div",{"data-video-poster":"true",className:"bg-container-primary pointer-events-none absolute inset-0 size-full transition-opacity duration-500",children:(0,o.jsx)(u.Picture,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:k===0||f?"eager":"lazy",fetchPriority:k===0?"high":"auto",alt:W,source:v})})]}):(0,o.jsx)(u.Picture,{className:"absolute inset-0 size-full",imgClassName:"size-full object-cover",loading:"eager",fetchPriority:"high",alt:W,source:v}),(0,o.jsxs)("div",{className:(0,w.cn)("laptop:top-1/2 laptop:-translate-y-1/2 lg-desktop:gap-[32px] pointer-events-none absolute top-24 z-10 flex w-full flex-col gap-[24px] transition-colors duration-500",N==="center"?"left-1/2 -translate-x-1/2 items-center text-center":"px-grid left-0"),children:[(0,o.jsxs)("div",{className:(0,w.cn)("tablet:max-w-[704px] laptop:max-w-[440px] desktop:max-w-[648px] lg-desktop:max-w-[824px] max-w-[358px] transition-colors duration-500",N==="center"?"text-center":"laptop:text-left"),children:[G&&(0,o.jsx)(u.Text,{size:2,as:"p",className:(0,w.cn)("hero-banner-label font-heading lg-desktop:text-[18px] desktop:text-base text-sm"),html:G}),B&&(0,o.jsx)(u.Heading,{as:M==="4"?"h1":"h2",html:B,size:M?Number(M||"5"):Q==="sm"?4:5}),C&&(0,o.jsx)(u.Text,{as:"p",size:2,className:"font-heading lg-desktop:text-[18px] desktop:text-base laptop:mt-2 lg-desktop:mt-4 mt-1 text-sm",html:C}),U&&(0,o.jsx)("div",{className:"mt-3",children:(0,o.jsx)(u.Countdown,{endDate:U,endDate_tz:ne,dateFormat:P,variant:"spacious",align:N})})]}),(l?.text||d?.text||p?.text)&&(0,o.jsxs)("div",{className:(0,w.cn)("lg-desktop:gap-3 pointer-events-auto flex flex-wrap items-center gap-2",N==="center"?"justify-center":"laptop:justify-start"),children:[d?.isShowPlayVideoButton&&d?.playVideoButtonText?(0,o.jsxs)(u.Button,{size:"lg",variant:"secondary",className:"hero-banner-play-video-button",onClick:()=>X?.(),...L(!0,"video play"),children:[d.playVideoButtonText," ",(0,o.jsx)(st,{size:"lg"})]}):d?.text?(0,o.jsxs)(u.Button,{size:"lg",variant:"secondary",as:d?.isCustomSecondaryButton?"button":"a",href:F(d.link),target:d?.target,rel:d?.target==="_blank"?d?.rel??"noopener noreferrer":d?.rel,onClick:n=>d?.isCustomSecondaryButton&&ge?.(a,n,d?.customSecondaryEventId),...L(!!(d.link||d.isCustomSecondaryButton),d.text),children:[d.text,(0,o.jsx)("span",{className:"sr-only",children:B??C})]}):null,l?.text&&(0,o.jsx)(u.Button,{size:"lg",variant:"primary",as:l?.isCustomPrimaryButton?"button":"a",href:F(l.link),target:l?.target,rel:l?.target==="_blank"?l?.rel??"noopener noreferrer":l?.rel,onClick:n=>l?.isCustomPrimaryButton&&y?.(a,n,l?.customPrimaryEventId),...L(!!(l.link||l.isCustomPrimaryButton),l.text),children:l.text}),p?.text&&(0,o.jsxs)(u.Button,{size:"lg",variant:"link",className:"tablet:basis-auto basis-full",as:p?.isCustomTertiaryButton?"button":"a",href:F(p.link),target:p?.target,rel:p?.target==="_blank"?p?.rel??"noopener noreferrer":p?.rel,onClick:n=>p?.isCustomTertiaryButton&&ee?.(a,n,p?.customTertiaryEventId),...L(!!(p.link||p.isCustomTertiaryButton),p.text),children:[p.text,(0,o.jsx)("span",{className:"sr-only",children:B??C})]})]}),R&&R.length>0&&(0,o.jsx)("div",{className:(0,w.cn)("flex items-center gap-2",N==="center"?"justify-center":"justify-start"),children:R.map(n=>(0,o.jsx)("div",{className:"h-12",children:(0,o.jsx)(u.Picture,{className:"laptop:w-full h-full",imgClassName:"h-full object-cover",loading:"eager",alt:n?.pcImage?.alt||"",source:n?.pcImage?.url})},n?.pcImage?.url||n?.pcImage?.alt))})]}),S&&S.length>0&&(0,o.jsx)("div",{className:"hero-banner-caption-group laptop:gap-3 px-grid desktop:pb-[24px] pointer-events-none absolute bottom-0 z-10 flex items-stretch gap-2 pb-[16px]",children:S.map((n,b)=>(0,o.jsxs)(i.default.Fragment,{children:[(0,o.jsx)(u.Text,{size:2,className:"hero-banner-product-text tablet:w-[108px] desktop:w-[156px] lg-desktop:w-[180px] laptop:text-[14px] flex-1 text-[12px]",html:n.title}),b<S.length-1&&(0,o.jsx)("div",{className:"bg-info-primary w-px"})]},n.title))})]})},dt={prevSlide:"Previous slide",nextSlide:"Next slide",pauseAutoplay:"Pause autoplay",playAutoplay:"Play autoplay",pauseVideo:"Pause video",playVideo:"Play video",slideStatus:"Slide",carouselLabel:"Banner carousel"},Be=i.default.forwardRef(({data:a,className:c,classNames:f={},a11yLabels:A,onPrimaryClick:k,onSecondaryClick:Q,onTertiaryClick:pe,...me},V)=>{const s=a.items||[],$=a.carousel,X=$?.size??a.size??"default",y={...dt,...A},{locale:ge,pageHandle:ee,trackingData:te}=(0,He.useAiuiContext)(),O=(0,x.useMediaTier)(),I=(0,q.buildPageGroup)({pageHandle:ee,pageGroup:te?.pageGroup}),B=(0,i.useRef)(null),[C,G]=(0,i.useState)(null),[U,ne]=(0,i.useState)(null),[P,R]=(0,i.useState)(null),[S,Y]=(0,i.useState)(null),l=(0,i.useRef)(s);(0,i.useEffect)(()=>{l.current=s});const d=e=>e!==void 0&&e!==999&&e>=5,p=e=>e!==void 0&&e!==999&&e>=1&&e<=30,N=$?.autoplaySeconds,M=e=>{const t=e?.autoplaySeconds;return p(t)?t:d(N)?N:void 0},z=s.length>1&&s.some(e=>M(e)!==void 0),v=(0,i.useRef)(s.map(()=>i.default.createRef())),W=($?.showArrows??!0)&&s.length>1,T=(0,i.useCallback)((e,t)=>{(0,E.gaTrack)({event:"ga4Event",event_name:e,event_parameters:t})},[]),_=(0,i.useCallback)(e=>l.current[e]?.isShowVideo?"video":"image",[]),oe=(0,i.useCallback)((e,t)=>{t==="swipe"&&T("hero_banner_swipe",{to_index:e}),T("hero_banner_slide_view",{index:e,total:l.current.length,media_type:_(e),trigger:t})},[T,_]),ve=(0,i.useCallback)((e,t,r,g="arrow")=>{T("hero_banner_arrow_click",{direction:e,from_index:t,to_index:r,source:g})},[T]),ae=(0,i.useCallback)((e,t)=>{T(e?"hero_banner_pause":"hero_banner_resume",{index:t,media_type:_(t)})},[T,_]),fe=(0,i.useCallback)((e,t)=>{const r=l.current[t];r&&(0,E.trackComponentClick)({pageGroup:I,componentType:"video",componentName:ce,position:t+1,buttonName:e?"video pause":"video play",componentTitle:r.title,componentDescription:r.subtitle,creativeId:(0,x.resolveTierMedia)(r,O,"video")?.id||r.pcImage?.id||""})},[I,O]),F=(0,i.useCallback)(e=>{v.current.forEach((r,g)=>{g!==e&&r.current&&(r.current.pause(),r.current.currentTime=0)});const t=v.current[e];t?.current&&(t.current.currentTime=0,t.current.play()?.catch(()=>{}))},[]),{rootRef:L,activeIndex:n,playbackState:b,resetNonce:ye,announcement:Ie,activeFrameIntervalSec:Te,isTimerRunning:Re,handleSwiperInit:Me,handleSlideChange:ze,handleTransitionEnd:Fe,handleSliderFirstMove:De,goToSlide:xe,goToSlideIndex:je,handlePausePlayClick:qe,notifyVideoPlaying:ke,handleFocus:$e,handleBlur:Oe}=(0,Ne.useCarouselPlayback)({frameCount:s.length,resolveFrameIntervalSec:e=>M(s[e]),isAutoplayEnabled:z,swiperRef:B,slideStatusLabel:y.slideStatus,onSlideMediaSync:F,onSlideChange:oe,onArrowNavigate:ve,delaysCountdownForVideo:e=>!!l.current[e]?.isShowVideo,onPauseToggle:(e,t)=>{ae(e,t);const r=v.current[t]?.current;r&&(e?r.pause():r.ended||r.play()?.catch(()=>{}))}}),Ge=(0,i.useCallback)(e=>{L.current=e,typeof V=="function"?V(e):V&&(V.current=e)},[V,L]),h=s[n]??s[0],Ue=(0,E.resolveComponentMediaType)(h?.isShowVideo),Ye=h?.title!==void 0?h?.title?.trim()||h?.subtitle?.trim()||h?.pcImage?.alt?.trim()||void 0:h?.subtitle&&h.subtitle.trim()||"",We=h&&((0,x.resolveTierMedia)(h,O,h.isShowVideo?"video":"image")?.id||h.pcImage?.id)||"";(0,_e.useExposure)(L,{componentType:Ue,componentName:ce,componentTitle:Ye,componentDescription:h?.subtitle?.trim()||"",creativeId:We,position:1}),(0,i.useEffect)(()=>{G(null),ne(null);const e=l.current[n],t=v.current[n]?.current;if(!e?.isShowVideo||!t)return;const r=()=>G(t.ended?"ended":t.paused?"paused":"playing"),g=()=>ne(Number.isFinite(t.duration)?t.duration:null),D=()=>{r(),ke(n)};return r(),g(),t.addEventListener("playing",D),t.addEventListener("pause",r),t.addEventListener("ended",r),t.addEventListener("loadedmetadata",g),()=>{t.removeEventListener("playing",D),t.removeEventListener("pause",r),t.removeEventListener("ended",r),t.removeEventListener("loadedmetadata",g)}},[n,ke]),(0,i.useEffect)(()=>{const e=l.current[n];if(!e?.isShowVideo||!e?.isMultiThemeEnabled)return;const t=v.current[n]?.current;if(!t)return;const r=(m,H,le,Se)=>{if(!(!m||typeof H!="number"||typeof le!="number"||typeof Se!="number"))return Se>=H&&Se<le?m:void 0};let g=null;const D=m=>{g=m,R(H=>H&&H.index===n&&H.theme===m?H:{index:n,theme:m})},re=m=>{D(r(e.theme_1,e.star_time_1,e.end_time_1,m)??r(e.theme_2,e.star_time_2,e.end_time_2,m)??e.theme??"light")},ie=t;let J=0,K=0;const be=typeof ie.requestVideoFrameCallback=="function",Xe=()=>be?K!==0:J!==0,he=()=>{if(!Xe())if(be){const m=(H,le)=>{re(le.mediaTime),K=ie.requestVideoFrameCallback(m)};K=ie.requestVideoFrameCallback(m)}else{const m=()=>{re(t.currentTime),J=requestAnimationFrame(m)};J=requestAnimationFrame(m)}},se=()=>{be?(ie.cancelVideoFrameCallback?.(K),K=0):(cancelAnimationFrame(J),J=0)},Le=()=>{se(),g&&R({index:n,theme:g})};return t.addEventListener("play",he),t.addEventListener("pause",se),t.addEventListener("ended",Le),!t.paused&&!t.ended&&he(),()=>{se(),t.removeEventListener("play",he),t.removeEventListener("pause",se),t.removeEventListener("ended",Le)}},[n]),(0,i.useEffect)(()=>{v.current.forEach((e,t)=>{t!==0&&e.current&&(e.current.pause(),e.current.currentTime=0)})},[]),(0,i.useEffect)(()=>{l.current.length!==0&&T("hero_banner_slide_view",{index:0,total:l.current.length,media_type:_(0),trigger:"initial"})},[T,_]);const Ze=!!s[n]?.isShowVideo,Ce=Te!==void 0,Z=!Ce&&Ze&&U!==null&&U>5&&C!=="ended"&&C!==null,Je=Ce||Z,Ke=Z?C==="paused":b==="STOPPED",Qe=()=>{if(!Z){qe();return}const e=v.current[n]?.current;if(!e)return;const t=!e.paused;t?e.pause():e.play()?.catch(()=>{}),ae(t,n),fe(t,n)},we=P&&P.index===n?P.theme:s[n]?.theme;return(0,o.jsxs)("div",{ref:Ge,role:"region","aria-roledescription":"carousel","aria-label":y.carouselLabel,"data-ui-component-id":"HeroBanner",onFocus:$e,onBlur:Oe,className:(0,w.cn)("hero-banner-carousel group relative w-full overflow-hidden",X==="default"?"tablet:aspect-[768/560] laptop:aspect-[1024/400] desktop:aspect-[1440/560] lg-desktop:aspect-[1920/800] aspect-[390/560]":"lg-desktop:aspect-[1920/800] desktop:aspect-[1440/640] laptop:aspect-[1024/480] tablet:aspect-[768/560] aspect-[390/560]",f.root,c),...me,children:[(0,o.jsx)(ue.Swiper,{onSwiper:Me,onSlideChange:ze,onSlideChangeTransitionEnd:Fe,onSliderFirstMove:De,slidesPerView:1,loop:!0,initialSlide:0,allowTouchMove:!0,children:s.map((e,t)=>{const r=P&&P.index===t?P.theme:e.theme??"light";return(0,o.jsx)(ue.SwiperSlide,{children:({isActive:g,isPrev:D,isNext:re})=>(0,o.jsx)(lt,{data:e,isActive:g,isAdjacent:D||re,slideIndex:t,slideLabel:`${y.slideStatus} ${t+1} / ${s.length}`,videoRef:v.current[t],containerSize:X,theme:r,position:t+1,locale:ge,pageHandle:ee,onPlayVideo:()=>Y(t),onPrimaryClick:k,onSecondaryClick:Q,onTertiaryClick:pe})},t)})}),W&&(0,o.jsx)(j.CarouselArrows,{onPrev:()=>xe("prev"),onNext:()=>xe("next"),prevLabel:y.prevSlide,nextLabel:y.nextSlide}),z&&(0,o.jsx)(j.CarouselProgressControls,{frameCount:s.length,activeIndex:n,resetNonce:ye,activeFrameIntervalSec:Te,isAutoplayEnabled:z,isTimerRunning:Re,onSegmentClick:je,segmentLabel:e=>`${y.slideStatus} ${e+1} / ${s.length}`,classPrefix:"hero-banner",theme:we}),Je&&(0,o.jsx)(j.CarouselCornerToggle,{isPaused:Ke,onToggle:Qe,pausedLabel:Z?y.playVideo:y.playAutoplay,playingLabel:Z?y.pauseVideo:y.pauseAutoplay,classPrefix:"hero-banner",theme:we}),(0,o.jsx)("div",{"aria-live":"polite","aria-atomic":"true",className:"sr-only",children:Ie}),S!==null&&s[S]?.secondaryButton&&(0,o.jsx)(Ae.VideoModal,{visible:!0,videoUrl:s[S].secondaryButton?.isYoutubeVideo?void 0:s[S].secondaryButton?.videoUrl?.url,youTubeId:s[S].secondaryButton?.isYoutubeVideo?s[S].secondaryButton?.youtubeId:void 0,onCloseModal:()=>Y(null)})]})});Be.displayName="HeroBannerCarousel";var ct=Be;
@@ -1 +1 @@
1
- "use strict";"use client";var fe=Object.create;var S=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var ge=Object.getOwnPropertyNames;var ve=Object.getPrototypeOf,be=Object.prototype.hasOwnProperty;var we=(n,p)=>{for(var g in p)S(n,g,{get:p[g],enumerable:!0})},U=(n,p,g,b)=>{if(p&&typeof p=="object"||typeof p=="function")for(let v of ge(p))!be.call(n,v)&&v!==g&&S(n,v,{get:()=>p[v],enumerable:!(b=he(p,v))||b.enumerable});return n};var _e=(n,p,g)=>(g=n!=null?fe(ve(n)):{},U(p||!n||!n.__esModule?S(g,"default",{value:n,enumerable:!0}):g,n)),ye=n=>U(S({},"__esModule",{value:!0}),n);var Ie={};we(Ie,{default:()=>Te});module.exports=ye(Ie);var e=require("react/jsx-runtime"),a=_e(require("react")),r=require("../../components/index.js"),l=require("../../helpers/utils.js"),ee=require("../../shared/Styles.js"),te=require("../../hooks/useExposure.js"),ie=require("../../hooks/useIntersectionObserver.js"),ae=require("../AiuiProvider/index.js"),k=require("framer-motion");const ke="image",Ne="image_with_text",X=(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:(0,e.jsx)("path",{d:"M6.91009 4.41058C7.23553 4.08514 7.76304 4.08514 8.08848 4.41058L13.0885 9.41058C13.4139 9.73602 13.4139 10.2635 13.0885 10.589L8.08848 15.589C7.76304 15.9144 7.23553 15.9144 6.91009 15.589C6.58466 15.2635 6.58466 14.736 6.91009 14.4106L11.3209 9.99977L6.91009 5.58897C6.58466 5.26353 6.58466 4.73602 6.91009 4.41058Z",fill:"currentColor"})}),Y=a.default.forwardRef(({data:n,className:p},g)=>{const{title:b,subtitle:v,desc:_,descIcon:M,image:N,padImage:z,mobileImage:E,theme:oe="dark",items:H=[],layout:le="left",mediaType:se="image",datalist:d=[],video:j,padVideo:R,mobVideo:W,button:w,textAlign:m="left",titleTag:re}=n,i=le,{locale:C="us"}=(0,ae.useAiuiContext)(),D=(0,a.useRef)(null),I=(0,a.useRef)(null),L=(0,a.useRef)(null),P=(0,a.useRef)(null),A=(0,a.useRef)(null),[u,ne]=(0,a.useState)(0),q=(0,a.useRef)([]),[$,me]=(0,a.useState)({left:0,width:0}),[y,B]=(0,a.useState)(""),[F,O]=(0,a.useState)(""),[Z,G]=(0,a.useState)(""),c=d.length>0,T=se==="video";(0,te.useExposure)(D,{componentType:ke,componentName:Ne,componentTitle:b,componentDescription:v}),(0,a.useImperativeHandle)(g,()=>D.current),(0,a.useEffect)(()=>{if(d.length>0){const t=q.current[u];if(t){const{offsetLeft:s,offsetWidth:o}=t;me({left:s,width:o})}}},[u,d.length]);const[J,de]=(0,a.useState)(!1);(0,ie.useIntersectionObserverDelay)(A,{once:!0,threshold:.01,callback:()=>{de(!0)}}),(0,a.useEffect)(()=>{if(!J||!T)return;let t="",s="",o="";if(c&&d[u]){const f=d[u];t=f.video?.url||"",s=f.padVideo?.url||t,o=f.mobVideo?.url||t}else t=j?.url||"",s=R?.url||t,o=W?.url||t;t&&B(t),s&&O(s),o&&G(o),setTimeout(()=>{[I.current?.querySelector("video"),L.current?.querySelector("video"),P.current?.querySelector("video")].forEach(h=>{h&&(h.load(),h.play().catch(()=>{}))})},200)},[J,T,c,u,d,j?.url,R?.url,W?.url]);const pe=(t,s)=>{if(ne(t),s.target.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),T&&c&&d[t]){const o=d[t];o.video?.url&&B(o.video.url),o.padVideo?.url&&O(o.padVideo.url),o.mobVideo?.url&&G(o.mobVideo.url),setTimeout(()=>{[I.current?.querySelector("video"),L.current?.querySelector("video"),P.current?.querySelector("video")].forEach(h=>{h&&(h.load(),h.play().catch(()=>{}))})},300)}},ce=()=>!V||!w?.text||i==="top"||i==="bottom"?null:(0,e.jsx)("div",{className:(0,l.cn)("image-with-text__button-wrapper laptop:mt-[32px] mt-[24px]",{"flex justify-center":m==="center","flex justify-start":m==="left"}),children:(0,e.jsx)(r.Link,{href:(0,l.getLocalizedPath)(w.link||"",C),className:"image-with-text__button whitespace-nowrap no-underline",suffixIcon:X,children:w.text})}),x=H.length>0,V=!!w,K=()=>{if(c&&d[u]){const t=d[u];return`${t.image?.url} ,${t.imgPad?.url||t.image?.url} 1440, ${t.imageMob?.url||t.image?.url} 767`}return N?`${N?.url},${z?.url||N?.url} 1024, ${E?.url||N?.url} 768`:""},Q=()=>{if(c){const f=d[u],h=f.image?.url,xe=f.imgPad?.url||h,ue=f.imageMob?.url||h;return(0,e.jsx)(k.AnimatePresence,{mode:"wait",children:(0,e.jsx)(k.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"image-with-text__video-motion absolute left-0 top-0 w-full",children:(0,e.jsxs)("div",{className:"image-with-text__video-wrapper rounded-box overflow-hidden",children:[(0,e.jsx)("div",{ref:I,className:"image-with-text__desktop-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:h,src:y,loop:!0,className:"image-with-text__video image-with-text__video--desktop lg-desktop:block hidden size-full object-cover"})}),(0,e.jsx)("div",{ref:L,className:"image-with-text__tablet-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:xe,src:F||y,loop:!0,className:"image-with-text__video image-with-text__video--tablet tablet:block lg-desktop:hidden hidden"})}),(0,e.jsx)("div",{ref:P,className:"image-with-text__mobile-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:ue,src:Z||y,loop:!0,className:"image-with-text__video image-with-text__video--mobile tablet:hidden block"})})]})},f.video?.url||f.image?.url)})}const t=N?.url,s=z?.url||t,o=E?.url||t;return(0,e.jsxs)("div",{className:"image-with-text__video-wrapper rounded-box laptop:rounded-box overflow-hidden",children:[(0,e.jsx)("div",{ref:I,className:"image-with-text__desktop-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:t,src:y,loop:!0,className:"image-with-text__video image-with-text__video--desktop lg-desktop:block hidden size-full object-cover"})}),(0,e.jsx)("div",{ref:L,className:"image-with-text__tablet-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:s,src:F||y,loop:!0,className:"image-with-text__video image-with-text__video--tablet tablet:block lg-desktop:hidden hidden"})}),(0,e.jsx)("div",{ref:P,className:"image-with-text__mobile-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:o,src:Z||y,loop:!0,className:"image-with-text__video image-with-text__video--mobile tablet:hidden block"})})]})};return(0,e.jsxs)("section",{ref:D,"data-ui-component-id":"ImageWithText",className:(0,l.cn)("image-with-text text-info-primary",{"flex gap-[24px] laptop:gap-[48px] lg-desktop:gap-[64px]":!c,"flex-col":!c&&(i==="top"||i==="bottom"),"items-center":i==="left"||i==="right","flex-col laptop:flex-row":!c&&(i==="left"||i==="right"),"flex l:gap-[24px] xl:flex-col min-md:justify-between min-l:gap-[20px]":c,"aiui-dark":oe==="dark"},p),children:[c&&(b||_||d.length>0)&&(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__tab-content min-md:gap-[24px] laptop:basis-[36%] inline-flex flex-col justify-center",{"text-left":m==="left","text-center":m==="center"}),children:[(0,e.jsxs)("div",{className:"image-with-text__header",children:[(0,e.jsx)(r.Heading,{as:"h3",size:4,html:b,className:"image-with-text__title"}),(0,e.jsx)(r.Text,{as:"p",size:1,html:_,className:"image-with-text__description tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-[14px]"})]}),(0,e.jsx)("div",{className:(0,l.cn)("image-with-text__tabs-wrapper md:scrollbar-hidden relative md:overflow-hidden md:overflow-x-scroll",{"flex justify-center":m==="center"}),children:(0,e.jsxs)("div",{className:"image-with-text__tabs rounded-btn relative inline-flex bg-[#1D1D1F] px-[4px] md:my-[24px]",children:[(0,e.jsx)("div",{className:"image-with-text__slider rounded-btn absolute inset-y-0 bg-white transition-all duration-300 ease-in-out",style:{left:$.left,width:$.width}}),d.map((t,s)=>(0,e.jsx)("div",{ref:o=>{q.current[s]=o},onClick:o=>pe(s,o),className:(0,l.cn)("image-with-text__tab rounded-btn min-xxl:px-[28px] min-xxl:py-[15px] relative z-10 cursor-pointer px-[20px] py-[10px] text-center text-[12px] font-medium transition-colors duration-300 md:px-[20px] md:py-[10px]",u===s?"image-with-text__tab--active text-black":"text-white"),children:(0,e.jsx)(r.Heading,{as:re??"h3",size:1,html:t?.title,className:"image-with-text__tab-title text-balance-normal !whitespace-nowrap md:text-[14px]"})},s))]})})]}),!c&&(b||v||_)&&(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__content flex w-full flex-col",{"justify-center":!V,"justify-between":V,"items-start":m==="left"&&x,"items-center":m==="center"&&x,"text-left":m==="left","text-center":m==="center","laptop:order-1":i==="left"}),children:[(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__main-content",{"flex flex-col":V}),children:[(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__header",{"laptop:flex laptop:items-end laptop:justify-between laptop:gap-16":(i==="top"||i==="bottom")&&w?.text}),children:[(0,e.jsxs)("div",{className:"image-with-text__title-wrapper flex min-w-0 flex-1 flex-col",children:[(0,e.jsx)(r.Heading,{as:"h2",size:4,html:b,className:(0,l.cn)("image-with-text__title",{"text-left":x&&m==="left","text-center":x&&m==="center"})}),v&&(0,e.jsx)(r.Text,{as:"p",size:x?4:3,html:v,className:(0,l.cn)("image-with-text__subtitle tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-[14px]",{"laptop:mt-[16px]":!x,"min-xxl:mt-[8px] laptop:text-[16px] lg-desktop:text-[18px]":x,"text-left":x&&m==="left","text-center":x&&m==="center"})})]}),(i==="top"||i==="bottom")&&w?.text&&(0,e.jsx)(r.Link,{href:(0,l.getLocalizedPath)(w.link||"",C),className:"laptop:flex hidden whitespace-nowrap no-underline",suffixIcon:X,children:w.text})]}),!x&&(_||M)&&(0,e.jsxs)("div",{className:"image-with-text__description flex flex-row gap-[8px]",children:[M&&(0,e.jsx)("img",{src:M,alt:"icon",className:"image-with-text__description-icon desktop:size-[48px] size-[36px]"}),_&&(0,e.jsx)(r.Heading,{as:"h4",size:5,html:_,className:"image-with-text__description-text min-md:text-[40px] min-l:text-[40px] min-xl:text-[56px] min-xxl:text-[64px] text-[#3AD1FF] md:text-[40px]"})]}),x&&(0,e.jsx)("div",{className:(0,l.cn)("image-with-text__items laptop:mt-[32px] desktop:mt-[48px] mt-[24px] grid w-full gap-6",{"!mt-6":i==="top"||i==="bottom","grid-cols-2 tablet:grid-cols-4":i==="top"||i==="bottom","grid-cols-2 tablet:grid-cols-4 laptop:grid-cols-2":i==="left"||i==="right"}),children:H.map((t,s)=>(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__item",{"text-center":m==="center"}),children:[(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__item-header flex flex-row items-center gap-[8px]",{"justify-center":m==="center","justify-start":m==="left"}),children:[t.icon?.url&&(0,e.jsx)(r.Picture,{source:t.icon.url,alt:t.icon?.alt,className:"image-with-text__item-icon min-md:text-[40px] min-l:text-[40px] min-xl:text-[56px] min-xxl:text-[64px] desktop:h-[44px] lg-desktop:h-[52px] h-[28px] translate-y-[-12%] md:text-[40px]",imgClassName:"h-full !w-full"}),(0,e.jsx)(r.Heading,{size:4,as:"h6",className:"image-with-text__item-text bg-gradient-to-r from-[#3ad1ff] to-[#008cd6] bg-clip-text text-transparent",children:t.text})]}),(0,e.jsx)(r.Text,{size:4,as:"p",html:t.desc,className:"image-with-text__item-desc tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[-2px] text-[14px]"})]},s))})]}),ce()]}),(0,e.jsx)("div",{ref:A,className:(0,l.cn)("image-with-text__media-wrapper",{"laptop:w-[60%] w-full shrink-0":i==="left"||i==="right","aspect-[716/720] max-h-[560px] max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[824/560] shrink-0":x,"laptop:basis-[63%] desktop:basis-[57%]":x&&i==="left","relative w-full shrink md:aspect-[358/360] min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] laptop:basis-[64%] desktop:aspect-[648/448]":c,"!max-w-none !max-h-none aspect-auto":i==="top"||i==="bottom"}),children:c?T?Q():(0,e.jsx)(k.AnimatePresence,{mode:"wait",children:(0,e.jsx)(k.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"image-with-text__image-motion absolute left-0 top-0 w-full",children:(0,e.jsx)(r.Picture,{source:K(),alt:d[u].image?.alt,className:"image-with-text__image rounded-box min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] desktop:aspect-[648/448] md:aspect-[358/360]"})},d[u].image?.url)}):T?Q():(0,e.jsx)(r.Picture,{source:K(),className:(0,l.cn)("image-with-text__image rounded-box laptop:rounded-box")})})]})});Y.displayName="ImageWithText";var Te=(0,ee.withLayout)(Y);
1
+ "use strict";"use client";var Ne=Object.create;var S=Object.defineProperty;var Te=Object.getOwnPropertyDescriptor;var Ie=Object.getOwnPropertyNames;var Le=Object.getPrototypeOf,Pe=Object.prototype.hasOwnProperty;var Ve=(n,c)=>{for(var v in c)S(n,v,{get:c[v],enumerable:!0})},te=(n,c,v,w)=>{if(c&&typeof c=="object"||typeof c=="function")for(let u of Ie(c))!Pe.call(n,u)&&u!==v&&S(n,u,{get:()=>c[u],enumerable:!(w=Te(c,u))||w.enumerable});return n};var Se=(n,c,v)=>(v=n!=null?Ne(Le(n)):{},te(c||!n||!n.__esModule?S(v,"default",{value:n,enumerable:!0}):v,n)),Me=n=>te(S({},"__esModule",{value:!0}),n);var ze={};Ve(ze,{default:()=>De});module.exports=Me(ze);var e=require("react/jsx-runtime"),o=Se(require("react")),r=require("../../components/index.js"),l=require("../../helpers/utils.js"),ae=require("../../shared/Styles.js"),le=require("../../hooks/useExposure.js"),se=require("../../hooks/useIntersectionObserver.js"),re=require("../AiuiProvider/index.js"),ne=require("../../hooks/useTracking.js"),me=require("../../shared/trackUrlRef.js"),de=require("../../shared/track.js"),y=require("framer-motion");const z="image",H="image_with_text",ie=(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:(0,e.jsx)("path",{d:"M6.91009 4.41058C7.23553 4.08514 7.76304 4.08514 8.08848 4.41058L13.0885 9.41058C13.4139 9.73602 13.4139 10.2635 13.0885 10.589L8.08848 15.589C7.76304 15.9144 7.23553 15.9144 6.91009 15.589C6.58466 15.2635 6.58466 14.736 6.91009 14.4106L11.3209 9.99977L6.91009 5.58897C6.58466 5.26353 6.58466 4.73602 6.91009 4.41058Z",fill:"currentColor"})}),oe=o.default.forwardRef(({data:n,className:c},v)=>{const{title:w,subtitle:u,desc:_,descIcon:M,image:N,padImage:E,mobileImage:R,theme:ce="dark",items:j=[],layout:pe="left",mediaType:xe="image",datalist:d=[],video:C,padVideo:W,mobVideo:A,button:b,textAlign:m="left",titleTag:ue}=n,i=pe,{locale:fe="us"}=(0,re.useAiuiContext)(),{buildRef:ge}=(0,ne.useTracking)(),D=(0,o.useRef)(null),I=(0,o.useRef)(null),L=(0,o.useRef)(null),P=(0,o.useRef)(null),q=(0,o.useRef)(null),[f,he]=(0,o.useState)(0),B=(0,o.useRef)([]),[$,ve]=(0,o.useState)({left:0,width:0}),[k,F]=(0,o.useState)(""),[O,U]=(0,o.useState)(""),[Z,G]=(0,o.useState)(""),p=d.length>0,T=xe==="video";(0,le.useExposure)(D,{componentType:z,componentName:H,componentTitle:w,componentDescription:u}),(0,o.useImperativeHandle)(v,()=>D.current),(0,o.useEffect)(()=>{if(d.length>0){const t=B.current[f];if(t){const{offsetLeft:s,offsetWidth:a}=t;ve({left:s,width:a})}}},[f,d.length]);const[J,be]=(0,o.useState)(!1);(0,se.useIntersectionObserverDelay)(q,{once:!0,threshold:.01,callback:()=>{be(!0)}}),(0,o.useEffect)(()=>{if(!J||!T)return;let t="",s="",a="";if(p&&d[f]){const g=d[f];t=g.video?.url||"",s=g.padVideo?.url||t,a=g.mobVideo?.url||t}else t=C?.url||"",s=W?.url||t,a=A?.url||t;t&&F(t),s&&U(s),a&&G(a),setTimeout(()=>{[I.current?.querySelector("video"),L.current?.querySelector("video"),P.current?.querySelector("video")].forEach(h=>{h&&(h.load(),h.play().catch(()=>{}))})},200)},[J,T,p,f,d,C?.url,W?.url,A?.url]);const we=(t,s)=>{if(he(t),s.target.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),T&&p&&d[t]){const a=d[t];a.video?.url&&F(a.video.url),a.padVideo?.url&&U(a.padVideo.url),a.mobVideo?.url&&G(a.mobVideo.url),setTimeout(()=>{[I.current?.querySelector("video"),L.current?.querySelector("video"),P.current?.querySelector("video")].forEach(h=>{h&&(h.load(),h.play().catch(()=>{}))})},300)}},K=(0,l.getLocalizedPath)(b?.link||"",fe),Q=b?.link?(0,me.trackUrlRef)(K,ge(z,H)):K,X=(0,de.buildClickTrackingProps)({interactive:!!b?.link,componentType:z,componentName:H,title:w,description:u,buttonName:b?.text}),_e=()=>!V||!b?.text||i==="top"||i==="bottom"?null:(0,e.jsx)("div",{className:(0,l.cn)("image-with-text__button-wrapper laptop:mt-[32px] mt-[24px]",{"flex justify-center":m==="center","flex justify-start":m==="left"}),children:(0,e.jsx)(r.Link,{href:Q,...X,className:"image-with-text__button whitespace-nowrap no-underline",suffixIcon:ie,children:b.text})}),x=j.length>0,V=!!b,Y=()=>{if(p&&d[f]){const t=d[f];return`${t.image?.url} ,${t.imgPad?.url||t.image?.url} 1440, ${t.imageMob?.url||t.image?.url} 767`}return N?`${N?.url},${E?.url||N?.url} 1024, ${R?.url||N?.url} 768`:""},ee=()=>{if(p){const g=d[f],h=g.image?.url,ke=g.imgPad?.url||h,ye=g.imageMob?.url||h;return(0,e.jsx)(y.AnimatePresence,{mode:"wait",children:(0,e.jsx)(y.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"image-with-text__video-motion absolute left-0 top-0 w-full",children:(0,e.jsxs)("div",{className:"image-with-text__video-wrapper rounded-box overflow-hidden",children:[(0,e.jsx)("div",{ref:I,className:"image-with-text__desktop-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:h,src:k,loop:!0,className:"image-with-text__video image-with-text__video--desktop lg-desktop:block hidden size-full object-cover"})}),(0,e.jsx)("div",{ref:L,className:"image-with-text__tablet-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:ke,src:O||k,loop:!0,className:"image-with-text__video image-with-text__video--tablet tablet:block lg-desktop:hidden hidden"})}),(0,e.jsx)("div",{ref:P,className:"image-with-text__mobile-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:ye,src:Z||k,loop:!0,className:"image-with-text__video image-with-text__video--mobile tablet:hidden block"})})]})},g.video?.url||g.image?.url)})}const t=N?.url,s=E?.url||t,a=R?.url||t;return(0,e.jsxs)("div",{className:"image-with-text__video-wrapper rounded-box laptop:rounded-box overflow-hidden",children:[(0,e.jsx)("div",{ref:I,className:"image-with-text__desktop-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:t,src:k,loop:!0,className:"image-with-text__video image-with-text__video--desktop lg-desktop:block hidden size-full object-cover"})}),(0,e.jsx)("div",{ref:L,className:"image-with-text__tablet-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:s,src:O||k,loop:!0,className:"image-with-text__video image-with-text__video--tablet tablet:block lg-desktop:hidden hidden"})}),(0,e.jsx)("div",{ref:P,className:"image-with-text__mobile-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:a,src:Z||k,loop:!0,className:"image-with-text__video image-with-text__video--mobile tablet:hidden block"})})]})};return(0,e.jsxs)("section",{ref:D,"data-ui-component-id":"ImageWithText",className:(0,l.cn)("image-with-text text-info-primary",{"flex gap-[24px] laptop:gap-[48px] lg-desktop:gap-[64px]":!p,"flex-col":!p&&(i==="top"||i==="bottom"),"items-center":i==="left"||i==="right","flex-col laptop:flex-row":!p&&(i==="left"||i==="right"),"flex l:gap-[24px] xl:flex-col min-md:justify-between min-l:gap-[20px]":p,"aiui-dark":ce==="dark"},c),children:[p&&(w||_||d.length>0)&&(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__tab-content min-md:gap-[24px] laptop:basis-[36%] inline-flex flex-col justify-center",{"text-left":m==="left","text-center":m==="center"}),children:[(0,e.jsxs)("div",{className:"image-with-text__header",children:[(0,e.jsx)(r.Heading,{as:"h3",size:4,html:w,className:"image-with-text__title"}),(0,e.jsx)(r.Text,{as:"p",size:1,html:_,className:"image-with-text__description tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-[14px]"})]}),(0,e.jsx)("div",{className:(0,l.cn)("image-with-text__tabs-wrapper md:scrollbar-hidden relative md:overflow-hidden md:overflow-x-scroll",{"flex justify-center":m==="center"}),children:(0,e.jsxs)("div",{className:"image-with-text__tabs rounded-btn relative inline-flex bg-[#1D1D1F] px-[4px] md:my-[24px]",children:[(0,e.jsx)("div",{className:"image-with-text__slider rounded-btn absolute inset-y-0 bg-white transition-all duration-300 ease-in-out",style:{left:$.left,width:$.width}}),d.map((t,s)=>(0,e.jsx)("div",{ref:a=>{B.current[s]=a},onClick:a=>we(s,a),className:(0,l.cn)("image-with-text__tab rounded-btn min-xxl:px-[28px] min-xxl:py-[15px] relative z-10 cursor-pointer px-[20px] py-[10px] text-center text-[12px] font-medium transition-colors duration-300 md:px-[20px] md:py-[10px]",f===s?"image-with-text__tab--active text-black":"text-white"),children:(0,e.jsx)(r.Heading,{as:ue??"h3",size:1,html:t?.title,className:"image-with-text__tab-title text-balance-normal !whitespace-nowrap md:text-[14px]"})},s))]})})]}),!p&&(w||u||_)&&(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__content flex w-full flex-col",{"justify-center":!V,"justify-between":V,"items-start":m==="left"&&x,"items-center":m==="center"&&x,"text-left":m==="left","text-center":m==="center","laptop:order-1":i==="left"}),children:[(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__main-content",{"flex flex-col":V}),children:[(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__header",{"laptop:flex laptop:items-end laptop:justify-between laptop:gap-16":(i==="top"||i==="bottom")&&b?.text}),children:[(0,e.jsxs)("div",{className:"image-with-text__title-wrapper flex min-w-0 flex-1 flex-col",children:[(0,e.jsx)(r.Heading,{as:"h2",size:4,html:w,className:(0,l.cn)("image-with-text__title",{"text-left":x&&m==="left","text-center":x&&m==="center"})}),u&&(0,e.jsx)(r.Text,{as:"p",size:x?4:3,html:u,className:(0,l.cn)("image-with-text__subtitle tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-[14px]",{"laptop:mt-[16px]":!x,"min-xxl:mt-[8px] laptop:text-[16px] lg-desktop:text-[18px]":x,"text-left":x&&m==="left","text-center":x&&m==="center"})})]}),(i==="top"||i==="bottom")&&b?.text&&(0,e.jsx)(r.Link,{href:Q,...X,className:"laptop:flex hidden whitespace-nowrap no-underline",suffixIcon:ie,children:b.text})]}),!x&&(_||M)&&(0,e.jsxs)("div",{className:"image-with-text__description flex flex-row gap-[8px]",children:[M&&(0,e.jsx)("img",{src:M,alt:"icon",className:"image-with-text__description-icon desktop:size-[48px] size-[36px]"}),_&&(0,e.jsx)(r.Heading,{as:"h4",size:5,html:_,className:"image-with-text__description-text min-md:text-[40px] min-l:text-[40px] min-xl:text-[56px] min-xxl:text-[64px] text-[#3AD1FF] md:text-[40px]"})]}),x&&(0,e.jsx)("div",{className:(0,l.cn)("image-with-text__items laptop:mt-[32px] desktop:mt-[48px] mt-[24px] grid w-full gap-6",{"!mt-6":i==="top"||i==="bottom","grid-cols-2 tablet:grid-cols-4":i==="top"||i==="bottom","grid-cols-2 tablet:grid-cols-4 laptop:grid-cols-2":i==="left"||i==="right"}),children:j.map((t,s)=>(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__item",{"text-center":m==="center"}),children:[(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__item-header flex flex-row items-center gap-[8px]",{"justify-center":m==="center","justify-start":m==="left"}),children:[t.icon?.url&&(0,e.jsx)(r.Picture,{source:t.icon.url,alt:t.icon?.alt,className:"image-with-text__item-icon min-md:text-[40px] min-l:text-[40px] min-xl:text-[56px] min-xxl:text-[64px] desktop:h-[44px] lg-desktop:h-[52px] h-[28px] translate-y-[-12%] md:text-[40px]",imgClassName:"h-full !w-full"}),(0,e.jsx)(r.Heading,{size:4,as:"h6",className:"image-with-text__item-text bg-gradient-to-r from-[#3ad1ff] to-[#008cd6] bg-clip-text text-transparent",children:t.text})]}),(0,e.jsx)(r.Text,{size:4,as:"p",html:t.desc,className:"image-with-text__item-desc tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[-2px] text-[14px]"})]},s))})]}),_e()]}),(0,e.jsx)("div",{ref:q,className:(0,l.cn)("image-with-text__media-wrapper",{"laptop:w-[60%] w-full shrink-0":i==="left"||i==="right","aspect-[716/720] max-h-[560px] max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[824/560] shrink-0":x,"laptop:basis-[63%] desktop:basis-[57%]":x&&i==="left","relative w-full shrink md:aspect-[358/360] min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] laptop:basis-[64%] desktop:aspect-[648/448]":p,"!max-w-none !max-h-none aspect-auto":i==="top"||i==="bottom"}),children:p?T?ee():(0,e.jsx)(y.AnimatePresence,{mode:"wait",children:(0,e.jsx)(y.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"image-with-text__image-motion absolute left-0 top-0 w-full",children:(0,e.jsx)(r.Picture,{source:Y(),alt:d[f].image?.alt,className:"image-with-text__image rounded-box min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] desktop:aspect-[648/448] md:aspect-[358/360]"})},d[f].image?.url)}):T?ee():(0,e.jsx)(r.Picture,{source:Y(),className:(0,l.cn)("image-with-text__image rounded-box laptop:rounded-box")})})]})});oe.displayName="ImageWithText";var De=(0,ae.withLayout)(oe);
@@ -1 +1 @@
1
- "use strict";"use client";var i=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var g=(p,t)=>{for(var a in t)i(p,a,{get:t[a],enumerable:!0})},x=(p,t,a,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of s(t))!f.call(p,o)&&o!==a&&i(p,o,{get:()=>t[o],enumerable:!(l=r(t,o))||l.enumerable});return p};var n=p=>x(i({},"__esModule",{value:!0}),p);var G={};g(G,{default:()=>u});module.exports=n(G);var e=require("react/jsx-runtime"),c=require("react"),d=require("../../../../components/index.js"),m=require("../../hooks/useStickyFlip.js");const R=({BoxLeftGallery:p,BoxRightDetail:t,BoxBottomSummary:a})=>{const l=(0,c.useRef)(null),o=(0,c.useRef)(null);return(0,m.useStickyFlip)(l,o),(0,e.jsxs)("div",{id:"ipc-product-card",className:"laptop-md:pt-6 laptop-md:px-16 lg-desktop:px-[calc(50%-832px)]",children:[(0,e.jsxs)(d.Grid,{className:"ipc-box-grid laptop-md:gap-x-4 lg-desktop:gap-6 gap-8 laptop:gap-y-8 laptop-md:gap-y-8",children:[(0,e.jsx)(d.GridItem,{ref:l,className:"ipc-box-left-grid-item laptop:px-0 laptop-md:col-start-1 laptop-md:col-span-8 laptop-md:sticky laptop-md:top-[124px] col-span-12 h-fit",children:p}),(0,e.jsx)(d.GridItem,{ref:o,className:"ipc-box-right-grid-item laptop-md:col-start-9 laptop-md:col-span-4 col-span-12",children:t})]}),a]})};var u=R;
1
+ "use strict";"use client";var d=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var g=(p,t)=>{for(var a in t)d(p,a,{get:t[a],enumerable:!0})},n=(p,t,a,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of s(t))!f.call(p,o)&&o!==a&&d(p,o,{get:()=>t[o],enumerable:!(l=r(t,o))||l.enumerable});return p};var x=p=>n(d({},"__esModule",{value:!0}),p);var G={};g(G,{default:()=>u});module.exports=x(G);var e=require("react/jsx-runtime"),m=require("react"),i=require("../../../../components/index.js"),c=require("../../hooks/useStickyFlip.js");const R=({BoxLeftGallery:p,BoxRightDetail:t,BoxBottomSummary:a})=>{const l=(0,m.useRef)(null),o=(0,m.useRef)(null);return(0,c.useStickyFlip)(l,o),(0,e.jsxs)("div",{id:"ipc-product-card",className:"laptop-md:pt-6 laptop-md:px-grid",children:[(0,e.jsxs)(i.Grid,{className:"ipc-box-grid laptop-md:gap-x-4 lg-desktop:gap-6 gap-8 laptop:gap-y-8 laptop-md:gap-y-8",children:[(0,e.jsx)(i.GridItem,{ref:l,className:"ipc-box-left-grid-item laptop:px-0 laptop-md:col-start-1 laptop-md:col-span-8 laptop-md:sticky laptop-md:top-[124px] col-span-12 h-fit",children:p}),(0,e.jsx)(i.GridItem,{ref:o,className:"ipc-box-right-grid-item laptop-md:col-start-9 laptop-md:col-span-4 col-span-12",children:t})]}),a]})};var u=R;