@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
@@ -1 +1 @@
1
- "use strict";var q=Object.create;var u=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var G=(t,o)=>{for(var e in o)u(t,e,{get:o[e],enumerable:!0})},S=(t,o,e,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of U(o))!$.call(t,c)&&c!==e&&u(t,c,{get:()=>o[c],enumerable:!(r=z(o,c))||r.enumerable});return t};var H=(t,o,e)=>(e=t!=null?q(W(t)):{},S(o||!t||!t.__esModule?u(e,"default",{value:t,enumerable:!0}):e,t)),I=t=>S(u({},"__esModule",{value:!0}),t);var Q={};G(Q,{default:()=>K});module.exports=I(Q);var a=require("react/jsx-runtime"),l=require("../../../../../components/index.js"),P=require("../../../../AiuiProvider/index.js"),k=require("../../../BizProductProvider.js"),f=require("react"),i=require("../../../utils/index.js"),g=require("../../../utils/textFormat.js"),T=require("../../../hooks/useBenefits.js"),A=H(require("../../CartActionButtons/index.js"));const J=({totalSavingsSlot:t,renderComparePrice:o}={})=>{const{copyWriting:e,locale:r="us",trackingData:c,currencyCode:d}=(0,P.useAiuiContext)(),{variant:n,finalPrice:M,totalSavings:s,isLogin:x,comparePrice:C,onAddToCart:D,onBuyNow:B,savingDetail:b,addToCartLoading:F,buyNowLoading:R,notifyMeMode:L,onNotifyMeClick:E,discount:V,memberFunctionResult:y}=(0,k.useBizProductContext)(),O=(0,T.useBenefits)({variant:n}),{commonCoupon:p,memberDiscount:m}=O,_=c?.showComparePrice??!0,j=(0,f.useMemo)(()=>(0,g.replaceTemplate)(e?.totalSavings||"",{amount:(0,i.formatPrice)({amount:s,currencyCode:n.price.currencyCode,locale:d==="CAD"?"us":r||"us"})}),[e?.totalSavings,s,n.price.currencyCode,r]),v=(0,f.useMemo)(()=>{if(!e?.unlockedSaving)return;const h=p?.enable?Number(p?.config?.fixed_value||0):0,N=m?.enable?m.config?.amount??0:0,w=Math.round((y?.withoutCouponMaxMemberTotalSave?Math.max(N,h):N+h)*100)/100;if(!(w<=0))return(0,g.replaceTemplate)(e.unlockedSaving,{amount:(0,i.formatPrice)({amount:w,currencyCode:n.price.currencyCode,locale:d==="CAD"?"us":r||"us"})})},[e?.unlockedSaving,p?.enable,p?.config?.fixed_value,m?.enable,m?.config?.amount,y,n.price.currencyCode,r]);return(0,a.jsxs)(l.Container,{childClassName:"tablet:flex tablet:justify-end tablet:gap-8 laptop-md:px-0 desktop:px-0 tablet:items-center tablet:gap-4",className:"laptop-md:border-none laptop-md:py-0 border-t border-[#E4E5E6] bg-white py-3",children:[n.availableForSale?(0,a.jsxs)("div",{className:"ipc-purchase-bar-price laptop-md:items-end flex flex-col justify-between",children:[(0,a.jsxs)("div",{className:"ipc-purchase-bar-price-row flex items-center gap-1",children:[(0,a.jsx)(l.Text,{className:"ipc-purchase-bar-final-price tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2]",html:(0,i.formatPrice)({amount:parseFloat(M.toFixed(2)),currencyCode:n.price.currencyCode,locale:d==="CAD"?"us":r||"us"})}),o?o({comparePrice:C}):_&&(s>0||b?.member>0&&x)&&(0,a.jsx)(l.Text,{className:"ipc-purchase-bar-compare-price tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2] text-[#4A4C56] line-through",html:(0,i.formatPrice)({amount:C,currencyCode:n.price.currencyCode,locale:d==="CAD"?"us":r||"us"})}),b?.member>0&&x&&(0,a.jsx)(l.Text,{className:"ipc-purchase-bar-member-badge bg-brand-0 rounded px-1 py-[2px] text-sm font-bold text-white",html:e?.memberPrice||"Member Price"})]}),t||(s>0||b?.member>0&&x?(0,a.jsx)(l.Text,{className:"ipc-purchase-bar-total-savings text-brand-0 tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:`${j}`}):v?(0,a.jsx)(l.Text,{className:"ipc-purchase-bar-unlocked-saving text-info-quaternary tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:v}):null)]}):(0,a.jsx)(l.Text,{className:"text-[20px] font-bold text-[#999999]",html:e?.soldOut??"Sold Out"}),(0,a.jsx)("div",{className:"tablet:mt-0 mt-2 flex items-center gap-2",children:(0,a.jsx)(A.default,{mode:L,availableForSale:n.availableForSale,addToCartText:e?.addToCart??"Add to Cart",buyNowText:e?.buyNow??"Buy Now",addToCartLoading:F,buyNowLoading:R,onAddToCart:D,onBuyNow:B,onNotifyMeClick:E,notifyMeText:e?.notifyMe,notifyMeClassName:"w-full"})})]})};var K=J;
1
+ "use strict";var q=Object.create;var u=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var G=(t,o)=>{for(var e in o)u(t,e,{get:o[e],enumerable:!0})},S=(t,o,e,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of U(o))!$.call(t,c)&&c!==e&&u(t,c,{get:()=>o[c],enumerable:!(r=z(o,c))||r.enumerable});return t};var H=(t,o,e)=>(e=t!=null?q(W(t)):{},S(o||!t||!t.__esModule?u(e,"default",{value:t,enumerable:!0}):e,t)),I=t=>S(u({},"__esModule",{value:!0}),t);var Q={};G(Q,{default:()=>K});module.exports=I(Q);var a=require("react/jsx-runtime"),l=require("../../../../../components/index.js"),P=require("../../../../AiuiProvider/index.js"),k=require("../../../BizProductProvider.js"),f=require("react"),i=require("../../../utils/index.js"),g=require("../../../utils/textFormat.js"),T=require("../../../hooks/useBenefits.js"),A=H(require("../../CartActionButtons/index.js"));const J=({totalSavingsSlot:t,renderComparePrice:o}={})=>{const{copyWriting:e,locale:r="us",trackingData:c,currencyCode:d}=(0,P.useAiuiContext)(),{variant:n,finalPrice:M,totalSavings:s,isLogin:x,comparePrice:C,onAddToCart:D,onBuyNow:B,savingDetail:b,addToCartLoading:F,buyNowLoading:R,notifyMeMode:L,onNotifyMeClick:E,discount:V,memberFunctionResult:y}=(0,k.useBizProductContext)(),O=(0,T.useBenefits)({variant:n}),{commonCoupon:p,memberDiscount:m}=O,_=c?.showComparePrice??!0,j=(0,f.useMemo)(()=>(0,g.replaceTemplate)(e?.totalSavings||"",{amount:(0,i.formatPrice)({amount:s,currencyCode:n.price.currencyCode,locale:d==="CAD"?"us":r||"us"})}),[e?.totalSavings,s,n.price.currencyCode,r]),v=(0,f.useMemo)(()=>{if(!e?.unlockedSaving)return;const h=p?.enable?Number(p?.config?.fixed_value||0):0,N=m?.enable?m.config?.amount??0:0,w=Math.round((y?.withoutCouponMaxMemberTotalSave?Math.max(N,h):N+h)*100)/100;if(!(w<=0))return(0,g.replaceTemplate)(e.unlockedSaving,{amount:(0,i.formatPrice)({amount:w,currencyCode:n.price.currencyCode,locale:d==="CAD"?"us":r||"us"})})},[e?.unlockedSaving,p?.enable,p?.config?.fixed_value,m?.enable,m?.config?.amount,y,n.price.currencyCode,r]);return(0,a.jsxs)(l.Container,{childClassName:"tablet:flex tablet:justify-end tablet:gap-8 laptop-md:px-0 desktop:px-0 lg-desktop:px-grid tablet:items-center tablet:gap-4",className:"laptop-md:border-none laptop-md:py-0 border-t border-[#E4E5E6] bg-white py-3",children:[n.availableForSale?(0,a.jsxs)("div",{className:"ipc-purchase-bar-price laptop-md:items-end flex flex-col justify-between",children:[(0,a.jsxs)("div",{className:"ipc-purchase-bar-price-row flex items-center gap-1",children:[(0,a.jsx)(l.Text,{className:"ipc-purchase-bar-final-price tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2]",html:(0,i.formatPrice)({amount:parseFloat(M.toFixed(2)),currencyCode:n.price.currencyCode,locale:d==="CAD"?"us":r||"us"})}),o?o({comparePrice:C}):_&&(s>0||b?.member>0&&x)&&(0,a.jsx)(l.Text,{className:"ipc-purchase-bar-compare-price tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2] text-[#4A4C56] line-through",html:(0,i.formatPrice)({amount:C,currencyCode:n.price.currencyCode,locale:d==="CAD"?"us":r||"us"})}),b?.member>0&&x&&(0,a.jsx)(l.Text,{className:"ipc-purchase-bar-member-badge bg-brand-0 rounded px-1 py-[2px] text-sm font-bold text-white",html:e?.memberPrice||"Member Price"})]}),t||(s>0||b?.member>0&&x?(0,a.jsx)(l.Text,{className:"ipc-purchase-bar-total-savings text-brand-0 tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:`${j}`}):v?(0,a.jsx)(l.Text,{className:"ipc-purchase-bar-unlocked-saving text-info-quaternary tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:v}):null)]}):(0,a.jsx)(l.Text,{className:"text-[20px] font-bold text-[#999999]",html:e?.soldOut??"Sold Out"}),(0,a.jsx)("div",{className:"tablet:mt-0 mt-2 flex items-center gap-2",children:(0,a.jsx)(A.default,{mode:L,availableForSale:n.availableForSale,addToCartText:e?.addToCart??"Add to Cart",buyNowText:e?.buyNow??"Buy Now",addToCartLoading:F,buyNowLoading:R,onAddToCart:D,onBuyNow:B,onNotifyMeClick:E,notifyMeText:e?.notifyMe,notifyMeClassName:"w-full"})})]})};var K=J;
@@ -1 +1 @@
1
- "use strict";"use client";var _=Object.create;var p=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var Y=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var Z=(e,t)=>{for(var o in t)p(e,o,{get:t[o],enumerable:!0})},g=(e,t,o,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of q(t))!A.call(e,s)&&s!==o&&p(e,s,{get:()=>t[s],enumerable:!(a=j(t,s))||a.enumerable});return e};var w=(e,t,o)=>(o=e!=null?_(Y(e)):{},g(t||!e||!e.__esModule?p(o,"default",{value:e,enumerable:!0}):o,e)),F=e=>g(p({},"__esModule",{value:!0}),e);var K={};Z(K,{default:()=>J});module.exports=F(K);var l=require("react/jsx-runtime"),i=require("react"),n=require("../../helpers/utils.js"),M=require("../../shared/Styles.js"),r=require("../../components/index.js"),k=w(require("../Title/index.js")),P=w(require("../SwiperBox/index.js")),N=require("../../components/container.js"),L=require("../VideoModal/index.js"),T=require("@payloadcms/richtext-lexical/html"),I=require("../../hooks/useExposure.js"),C=require("../AiuiProvider/index.js"),V=require("../../shared/trackUrlRef.js");const d="video",c="media_player_multi",G=({data:e,configuration:t})=>{const o=(0,i.useRef)(null);return(0,I.useExposure)(o,{componentType:d,componentName:c,componentTitle:e?.title,position:t?.index+1,componentDescription:e?.description}),(0,l.jsxs)("div",{ref:o,className:(0,n.cn)("laptop:max-w-full w-full overflow-hidden","laptop:flex-row flex shrink-0 flex-col","lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] h-auto","rounded-box"),children:[(0,l.jsxs)("div",{className:"laptop:w-[49%] laptop:h-full tablet:h-[18.22vw] relative h-[35.9vw] w-full flex-none",children:[(0,l.jsx)(r.Picture,{source:e.img?.url,alt:e.img?.alt||"",className:"tablet:block hidden size-full",imgClassName:"w-full h-full object-cover tablet:hover:scale-110 transition-all duration-300"}),(0,l.jsx)(r.Picture,{source:e.mobileImg?.url||e.img?.url,alt:e.mobileImg?.alt||e.img?.alt||"",className:"tablet:hidden block size-full",imgClassName:"w-full h-full object-cover"}),(0,l.jsx)("div",{className:"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4",children:(e?.video?.url||e?.youtubeId)&&(0,l.jsx)("button",{onClick:()=>{t?.onVideoPlayBtnClick?.(t?.index||0,e)},className:"laptop:size-14 bg-opacity/20 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:(0,l.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})]}),(0,l.jsxs)("div",{className:"laptop:gap-[60px] lg-desktop:p-8 tablet:p-6 bg-container-secondary-1 flex min-h-[200px] flex-1 flex-col gap-4 overflow-hidden p-4",children:[(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("h3",{className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary mb-2 text-[14px] font-bold leading-[1.2] tracking-[-0.02em]",children:e.title}),e.quote&&(0,l.jsx)(r.Link,{asChild:!e?.href,href:(0,V.trackUrlRef)((0,n.getLocalizedPath)(e?.href||"",t?.locale||"us"),`${d}_${c}`),"data-headless-type-name":`${d}#${c}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:(0,l.jsx)(r.Text,{html:e.quote,weight:"bold",className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-sm"})})]}),(0,l.jsx)("p",{className:"lg-desktop:text-2xl lg-desktop:leading-[1.2] text-info-primary desktop:max-h-[186px] line-clamp-6 max-h-[144px] min-h-[100px] text-xl font-bold leading-[1.2] tracking-[-0.04em]",children:e.description})]})]})},y=(0,i.forwardRef)(({data:{items:e=[],shape:t="square",title:o,containerProps:a},className:s="",key:B,onVideoPlayBtnClick:$,...z},D)=>{const[f,u]=(0,i.useState)(!1),[E,x]=(0,i.useState)(""),[H,h]=(0,i.useState)(""),{locale:R="us"}=(0,C.useAiuiContext)(),v=typeof o=="string"?o:o&&(0,T.convertLexicalToHTML)({data:o}),S=(0,i.useRef)(null),b=e.length===2;return(0,l.jsxs)("div",{...z,ref:S,className:s,children:[(0,l.jsx)("div",{className:"mediaplayermulti-box",children:(0,l.jsx)(N.Container,{...a||{},className:"overflow-hidden",children:(0,l.jsxs)("div",{className:s,ref:D,children:[o&&(0,l.jsx)(k.default,{className:"mediaplayermulti-title",data:{title:v||""}}),(0,l.jsx)(P.default,{className:"!overflow-visible",id:"MediaPlayerMultiSwiper"+B,data:{list:e,configuration:{shape:t,locale:R,onVideoPlayBtnClick:(U,m)=>{u(!0),m?.isYouTube?(h(m?.youtubeId||""),x("")):(x(m?.video?.url||""),h("")),$?.(U)},title:v}},Slide:G,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:b?2:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:b?2:1.5},1440:{spaceBetween:16,freeMode:!1,slidesPerView:2}}})]})})}),f&&(0,l.jsx)(L.VideoModal,{visible:f,youTubeId:H,videoUrl:E,onCloseModal:()=>u(!1)})]})});y.displayName="MediaPlayerMulti";var J=(0,M.withLayout)(y);
1
+ "use strict";"use client";var q=Object.create;var p=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var A=Object.getPrototypeOf,Z=Object.prototype.hasOwnProperty;var F=(e,t)=>{for(var o in t)p(e,o,{get:t[o],enumerable:!0})},g=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Y(t))!Z.call(e,s)&&s!==o&&p(e,s,{get:()=>t[s],enumerable:!(r=_(t,s))||r.enumerable});return e};var w=(e,t,o)=>(o=e!=null?q(A(e)):{},g(t||!e||!e.__esModule?p(o,"default",{value:e,enumerable:!0}):o,e)),G=e=>g(p({},"__esModule",{value:!0}),e);var O={};F(O,{default:()=>K});module.exports=G(O);var l=require("react/jsx-runtime"),i=require("react"),n=require("../../helpers/utils.js"),M=require("../../shared/Styles.js"),a=require("../../components/index.js"),k=w(require("../Title/index.js")),P=w(require("../SwiperBox/index.js")),N=require("../../components/container.js"),T=require("../VideoModal/index.js"),L=require("@payloadcms/richtext-lexical/html"),I=require("../../hooks/useExposure.js"),C=require("../AiuiProvider/index.js"),V=require("../../shared/trackUrlRef.js"),B=require("../../hooks/useTracking.js");const d="video",c="media_player_multi",J=({data:e,configuration:t})=>{const{buildRef:o}=(0,B.useTracking)(),r=(0,i.useRef)(null);return(0,I.useExposure)(r,{componentType:d,componentName:c,componentTitle:e?.title,position:t?.index+1,componentDescription:e?.description}),(0,l.jsxs)("div",{ref:r,className:(0,n.cn)("laptop:max-w-full w-full overflow-hidden","laptop:flex-row flex shrink-0 flex-col","lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] h-auto","rounded-box"),children:[(0,l.jsxs)("div",{className:"laptop:w-[49%] laptop:h-full tablet:h-[18.22vw] relative h-[35.9vw] w-full flex-none",children:[(0,l.jsx)(a.Picture,{source:e.img?.url,alt:e.img?.alt||"",className:"tablet:block hidden size-full",imgClassName:"w-full h-full object-cover tablet:hover:scale-110 transition-all duration-300"}),(0,l.jsx)(a.Picture,{source:e.mobileImg?.url||e.img?.url,alt:e.mobileImg?.alt||e.img?.alt||"",className:"tablet:hidden block size-full",imgClassName:"w-full h-full object-cover"}),(0,l.jsx)("div",{className:"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4",children:(e?.video?.url||e?.youtubeId)&&(0,l.jsx)("button",{onClick:()=>{t?.onVideoPlayBtnClick?.(t?.index||0,e)},className:"laptop:size-14 bg-opacity/20 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:(0,l.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})]}),(0,l.jsxs)("div",{className:"laptop:gap-[60px] lg-desktop:p-8 tablet:p-6 bg-container-secondary-1 flex min-h-[200px] flex-1 flex-col gap-4 overflow-hidden p-4",children:[(0,l.jsxs)("div",{className:"flex flex-col",children:[(0,l.jsx)("h3",{className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary mb-2 text-[14px] font-bold leading-[1.2] tracking-[-0.02em]",children:e.title}),e.quote&&(0,l.jsx)(a.Link,{asChild:!e?.href,href:(0,V.trackUrlRef)((0,n.getLocalizedPath)(e?.href||"",t?.locale||"us"),o(d,c)),"data-headless-type-name":`${d}#${c}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:(0,l.jsx)(a.Text,{html:e.quote,weight:"bold",className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-sm"})})]}),(0,l.jsx)("p",{className:"lg-desktop:text-2xl lg-desktop:leading-[1.2] text-info-primary desktop:max-h-[186px] line-clamp-6 max-h-[144px] min-h-[100px] text-xl font-bold leading-[1.2] tracking-[-0.04em]",children:e.description})]})]})},y=(0,i.forwardRef)(({data:{items:e=[],shape:t="square",title:o,containerProps:r},className:s="",key:z,onVideoPlayBtnClick:R,...D},E)=>{const[f,u]=(0,i.useState)(!1),[H,x]=(0,i.useState)(""),[S,h]=(0,i.useState)(""),{locale:U="us"}=(0,C.useAiuiContext)(),b=typeof o=="string"?o:o&&(0,L.convertLexicalToHTML)({data:o}),$=(0,i.useRef)(null),v=e.length===2;return(0,l.jsxs)("div",{...D,ref:$,className:s,children:[(0,l.jsx)("div",{className:"mediaplayermulti-box",children:(0,l.jsx)(N.Container,{...r||{},className:"overflow-hidden",children:(0,l.jsxs)("div",{className:s,ref:E,children:[o&&(0,l.jsx)(k.default,{className:"mediaplayermulti-title",data:{title:b||""}}),(0,l.jsx)(P.default,{className:"!overflow-visible",id:"MediaPlayerMultiSwiper"+z,data:{list:e,configuration:{shape:t,locale:U,onVideoPlayBtnClick:(j,m)=>{u(!0),m?.isYouTube?(h(m?.youtubeId||""),x("")):(x(m?.video?.url||""),h("")),R?.(j)},title:b}},Slide:J,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:v?2:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:v?2:1.5},1440:{spaceBetween:16,freeMode:!1,slidesPerView:2}}})]})})}),f&&(0,l.jsx)(T.VideoModal,{visible:f,youTubeId:S,videoUrl:H,onCloseModal:()=>u(!1)})]})});y.displayName="MediaPlayerMulti";var K=(0,M.withLayout)(y);
@@ -1,4 +1,4 @@
1
- "use strict";"use client";var C=Object.create;var x=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var I=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty;var D=(t,o)=>{for(var l in o)x(t,l,{get:o[l],enumerable:!0})},h=(t,o,l,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of _(o))!L.call(t,a)&&a!==l&&x(t,a,{get:()=>o[a],enumerable:!(n=R(o,a))||n.enumerable});return t};var S=(t,o,l)=>(l=t!=null?C(I(t)):{},h(o||!t||!t.__esModule?x(l,"default",{value:t,enumerable:!0}):l,t)),A=t=>h(x({},"__esModule",{value:!0}),t);var Q={};D(Q,{default:()=>F});module.exports=A(Q);var e=require("react/jsx-runtime"),r=S(require("react")),B=require("react-responsive"),s=require("../../components/index.js"),$=require("../../shared/Styles.js"),i=require("../../helpers/utils.js"),g=require("../../shared/mimeType.js"),q=require("../../hooks/useExposure.js"),M=require("../../shared/trackUrlRef.js"),E=require("../AiuiProvider/index.js");const y="image",b="member_area",N=r.default.forwardRef(({data:t,className:o="",...l},n)=>{const{title:a,description:p,backgroundImage:c,mobileBackgroundImage:d,primaryButton:u,secondaryButton:m,theme:w,shape:U,primaryButtonHandler:k,secondaryButtonHandler:z}=t,H=(0,B.useMediaQuery)({query:"(max-width: 768px)"}),f=(0,r.useRef)(null),{locale:P="us"}=(0,E.useAiuiContext)();(0,r.useImperativeHandle)(n,()=>f.current),(0,q.useExposure)(f,{componentType:y,componentName:b,componentTitle:a,componentDescription:p});const T=()=>{console.log("primaryButtonHandler",k),k?.()},j=()=>{z?.()},v="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return(0,e.jsxs)("section",{"data-ui-component-id":"MemberEquity",...l,className:(0,i.cn)("lg-desktop:aspect-[1384/560] desktop:aspect-[1090/488] laptop:aspect-[774/336] tablet:aspect-[704/480]","text-info-primary relative overflow-hidden",o,{"aiui-dark":w==="dark","rounded-box":!0,"h-[480px]":H}),ref:f,children:[(0,g.isVideo)(c?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"laptop:block absolute inset-0 hidden size-full object-cover",children:(0,e.jsx)("source",{src:c?.url,type:"video/mp4"})}):(0,e.jsx)(s.Picture,{source:c?.url,alt:c?.alt,className:"laptop:block absolute inset-0 hidden size-full object-cover [&_img]:h-full [&_img]:object-cover"}),(0,g.isVideo)(d?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"laptop:hidden absolute inset-0 size-full object-cover",children:(0,e.jsx)("source",{src:d?.url,type:"video/mp4"})}):(0,e.jsx)(s.Picture,{source:d?.url,alt:d?.alt,className:"laptop:hidden absolute inset-0 size-full object-cover [&_img]:h-full [&_img]:object-cover"}),(0,e.jsx)("div",{className:"laptop:items-center absolute inset-0 flex w-full items-end py-[16px]",children:(0,e.jsxs)("div",{className:`
1
+ "use strict";"use client";var I=Object.create;var y=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var A=(t,o)=>{for(var a in o)y(t,a,{get:o[a],enumerable:!0})},N=(t,o,a,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of _(o))!S.call(t,l)&&l!==a&&y(t,l,{get:()=>o[l],enumerable:!(c=L(o,l))||c.enumerable});return t};var F=(t,o,a)=>(a=t!=null?I(D(t)):{},N(o||!t||!t.__esModule?y(a,"default",{value:t,enumerable:!0}):a,t)),Q=t=>N(y({},"__esModule",{value:!0}),t);var V={};A(V,{default:()=>U});module.exports=Q(V);var e=require("react/jsx-runtime"),m=F(require("react")),q=require("react-responsive"),s=require("../../components/index.js"),M=require("../../shared/Styles.js"),r=require("../../helpers/utils.js"),k=require("../../shared/mimeType.js"),E=require("../../hooks/useExposure.js"),$=require("../../shared/trackUrlRef.js"),w=require("../AiuiProvider/index.js"),T=require("../../hooks/useTracking.js");const b="image",f="member_area",B=m.default.forwardRef(({data:t,className:o="",...a},c)=>{const{buildRef:l}=(0,T.useTracking)(),{title:p,description:i,backgroundImage:d,mobileBackgroundImage:u,primaryButton:x,secondaryButton:n,theme:z,shape:G,primaryButtonHandler:v,secondaryButtonHandler:H}=t,P=(0,q.useMediaQuery)({query:"(max-width: 768px)"}),g=(0,m.useRef)(null),{locale:R="us"}=(0,w.useAiuiContext)();(0,m.useImperativeHandle)(c,()=>g.current),(0,E.useExposure)(g,{componentType:b,componentName:f,componentTitle:p,componentDescription:i});const j=()=>{console.log("primaryButtonHandler",v),v?.()},C=()=>{H?.()},h="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return(0,e.jsxs)("section",{"data-ui-component-id":"MemberEquity",...a,className:(0,r.cn)("lg-desktop:aspect-[1384/560] desktop:aspect-[1090/488] laptop:aspect-[774/336] tablet:aspect-[704/480]","text-info-primary relative overflow-hidden",o,{"aiui-dark":z==="dark","rounded-box":!0,"h-[480px]":P}),ref:g,children:[(0,k.isVideo)(d?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"laptop:block absolute inset-0 hidden size-full object-cover",children:(0,e.jsx)("source",{src:d?.url,type:"video/mp4"})}):(0,e.jsx)(s.Picture,{source:d?.url,alt:d?.alt,className:"laptop:block absolute inset-0 hidden size-full object-cover [&_img]:h-full [&_img]:object-cover"}),(0,k.isVideo)(u?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"laptop:hidden absolute inset-0 size-full object-cover",children:(0,e.jsx)("source",{src:u?.url,type:"video/mp4"})}):(0,e.jsx)(s.Picture,{source:u?.url,alt:u?.alt,className:"laptop:hidden absolute inset-0 size-full object-cover [&_img]:h-full [&_img]:object-cover"}),(0,e.jsx)("div",{className:"laptop:items-center absolute inset-0 flex w-full items-end py-[16px]",children:(0,e.jsxs)("div",{className:`
2
2
  tablet:px-6 laptop:px-[76px] desktop:px-[111px] lg-desktop:px-[139px] tablet:gap-5
3
3
  laptop:gap-4 desktop:gap-6 lg-desktop:gap-8 flex w-full flex-col gap-6 px-4
4
- `,children:[(0,e.jsxs)("div",{className:"desktop:gap-2 lg-desktop:gap-4 laptop:max-w-[286px] desktop:max-w-[426px] lg-desktop:max-w-[547px] flex flex-col",children:[(0,e.jsx)(s.Heading,{as:"h2",size:3,className:"member-equity-title ",html:a}),(0,e.jsx)(s.Text,{size:2,className:"member-equity-description lg-desktop:text-[18px] desktop:text-[16px] text-[14px]",html:p})]}),(0,e.jsxs)("div",{className:"lg-desktop:gap-3 flex items-center gap-2",children:[m&&m.text&&(0,e.jsxs)(s.Button,{"aria-label":a??p,variant:"secondary",onClick:j,className:(0,i.cn)("member-equity-button-secondary ",v),as:"a",href:(0,M.trackUrlRef)((0,i.getLocalizedPath)(m.link||"",P),`${y}_${b}`),"data-headless-type-name":`${y}#${b}`,"data-headless-title-desc-button":`${a}#${p}#${m.text}`,children:[m.text,(0,e.jsx)("span",{className:"sr-only",children:a??p})]}),u&&u.text&&(0,e.jsx)(s.Button,{variant:"primary",onClick:T,className:(0,i.cn)("member-equity-button-primary ",v),"data-headless-type-name":`${y}#${b}`,"data-headless-title-desc-button":`${a}#${p}#${u.text}`,children:u.text})]})]})})]})});N.displayName="MemberEquity";var F=(0,$.withLayout)(N);
4
+ `,children:[(0,e.jsxs)("div",{className:"desktop:gap-2 lg-desktop:gap-4 laptop:max-w-[286px] desktop:max-w-[426px] lg-desktop:max-w-[547px] flex flex-col",children:[(0,e.jsx)(s.Heading,{as:"h2",size:3,className:"member-equity-title ",html:p}),(0,e.jsx)(s.Text,{size:2,className:"member-equity-description lg-desktop:text-[18px] desktop:text-[16px] text-[14px]",html:i})]}),(0,e.jsxs)("div",{className:"lg-desktop:gap-3 flex items-center gap-2",children:[n&&n.text&&(0,e.jsxs)(s.Button,{"aria-label":p??i,variant:"secondary",onClick:C,className:(0,r.cn)("member-equity-button-secondary ",h),as:"a",href:(0,$.trackUrlRef)((0,r.getLocalizedPath)(n.link||"",R),l(b,f)),"data-headless-type-name":`${b}#${f}`,"data-headless-title-desc-button":`${p}#${i}#${n.text}`,children:[n.text,(0,e.jsx)("span",{className:"sr-only",children:p??i})]}),x&&x.text&&(0,e.jsx)(s.Button,{variant:"primary",onClick:j,className:(0,r.cn)("member-equity-button-primary ",h),"data-headless-type-name":`${b}#${f}`,"data-headless-title-desc-button":`${p}#${i}#${x.text}`,children:x.text})]})]})})]})});B.displayName="MemberEquity";var U=(0,M.withLayout)(B);
@@ -1 +1 @@
1
- "use strict";"use client";var It=Object.create;var w=Object.defineProperty;var zt=Object.getOwnPropertyDescriptor;var At=Object.getOwnPropertyNames;var Bt=Object.getPrototypeOf,Et=Object.prototype.hasOwnProperty;var Dt=(i,e)=>{for(var p in e)w(i,p,{get:e[p],enumerable:!0})},X=(i,e,p,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of At(e))!Et.call(i,n)&&n!==p&&w(i,n,{get:()=>e[n],enumerable:!(s=zt(e,n))||s.enumerable});return i};var S=(i,e,p)=>(p=i!=null?It(Bt(i)):{},X(e||!i||!i.__esModule?w(p,"default",{value:i,enumerable:!0}):p,i)),jt=i=>X(w({},"__esModule",{value:!0}),i);var Wt={};Dt(Wt,{default:()=>Vt,resolveCartLineLabelStyle:()=>K});module.exports=jt(Wt);var t=require("react/jsx-runtime"),l=S(require("react")),Q=S(require("fitty")),r=require("../../helpers/index.js"),O=require("../../components/index.js"),b=require("../../components/index.js"),g=require("../../components/index.js"),Y=S(require("./CircleProgress.js")),$=require("../../hooks/useExposure.js");const Rt="cart",Ht="mini_cart",K=(i,e)=>i==="notEligible"?{backgroundColor:e?.notEligibleLabelColor??"rgba(118, 120, 128, 0.60)"}:i==="gift"?{backgroundColor:e?.giftLabelColor??"rgba(251, 148, 63, 0.60)"}:{backgroundColor:"rgba(251, 148, 63, 0.60)"},F=l.forwardRef(({className:i,classNames:e={},data:p,cart:s,progressConfig:n,onRemoveItem:Z,onCheckout:_,onClickToView:N,...J},tt)=>{const x=l.useRef(null),{copy:d,theme:P="light",locale:qt="us",showMobileViewMore:et=!0,maxQuantityDisplay:C,labelStyles:ot}=p||{};(0,$.useExposure)(x,{componentType:Rt,componentName:Ht,componentTitle:d?.itemsInCart||"Mini Cart",componentDescription:d?.description}),l.useImperativeHandle(tt,()=>x.current);const rt=d?.emptyCart||"Your Cart is Empty",T=d?.description||"",at=d?.itemsInCart||"You have selected {count} items",nt=d?.total||"Total {total}",Gt=d?.totalWithCoupon||"total: {total} ({subtotal})",I=d?.clickToView||"Click to view cart",it=d?.buyNowText||"Buy Now",lt=d?.savingText||"Saving {amount}",u=l.useMemo(()=>s?.lineItems||[],[s?.lineItems]),z=u.reduce((o,a)=>o+(a?.quantity||0),0),st=z===0,ct=parseFloat(s?.cost?.totalAmount?.amount||"0"),pt=parseFloat(s?.cost?.subtotalAmount?.amount||"0"),dt=parseFloat(s?.cost?.savingAmount?.amount||"0"),mt=s?.cost?.totalAmount?.formattedPrice||"",A=pt>ct?s?.cost?.subtotalAmount?.formattedPrice:null,B=dt>0?s?.cost?.savingAmount?.formattedPrice:null,m=l.useRef(null),[h,ut]=l.useState(!1),[E,D]=l.useState(!1),[j,R]=l.useState(null),H=async o=>{if(!j){R(o);try{await Z?.(o,s)}finally{R(null)}}},[V,k]=l.useState(!1),[gt,ft]=l.useState(0),[bt,xt]=l.useState(0),[W,ht]=l.useState(!1),[q,vt]=l.useState(!0),v=l.useCallback(()=>{const o=m.current;if(!o)return;const{scrollLeft:a,scrollWidth:c,clientWidth:y}=o;ht(a>0),vt(a<c-y-1)},[]),yt=l.useCallback(()=>{v()},[v]);l.useEffect(()=>{v()},[u.length,v]);const wt=u.map(o=>o.productLabel??"").join("|");l.useEffect(()=>{const o=x.current?.querySelectorAll("[data-fit-label]");if(!o?.length)return;const a=Array.from(o,c=>(0,Q.default)(c,{minSize:8,maxSize:12,multiLine:!1}));return()=>a.forEach(c=>c.unsubscribe())},[wt,h]);const Ct=o=>{m.current&&(k(!0),ft(o.pageX-m.current.offsetLeft),xt(m.current.scrollLeft))},kt=o=>{if(!V||!m.current)return;o.preventDefault();const c=(o.pageX-m.current.offsetLeft-gt)*1.5;m.current.scrollLeft=bt-c},Lt=()=>{k(!1)},Mt=()=>{k(!1)},G=o=>{if(m.current){const a=m.current,c=100;a.scrollBy({left:o==="right"?c:-c,behavior:"smooth"})}},L=({className:o})=>(0,t.jsx)("svg",{className:o,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"})}),St=({className:o})=>(0,t.jsx)("svg",{className:o,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M2.5 5H17.5M8.33333 9.16667V14.1667M11.6667 9.16667V14.1667M3.33333 5L4.16667 16.6667C4.16667 17.1087 4.34226 17.5326 4.65482 17.8452C4.96738 18.1577 5.39131 18.3333 5.83333 18.3333H14.1667C14.6087 18.3333 15.0326 18.1577 15.3452 17.8452C15.6577 17.5326 15.8333 17.1087 15.8333 16.6667L16.6667 5M7.5 5V2.5C7.5 2.27899 7.5878 2.06702 7.74408 1.91074C7.90036 1.75446 8.11232 1.66667 8.33333 1.66667H11.6667C11.8877 1.66667 12.0996 1.75446 12.2559 1.91074C12.4122 2.06702 12.5 2.27899 12.5 2.5V5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),Nt=o=>u.length?(0,t.jsxs)("div",{className:(0,r.cn)("laptop:bg-container-secondary-0 rounded-box-small flex gap-1 p-1",e?.itemsGrid),children:[u.length>=5&&(0,t.jsx)("button",{onClick:()=>G("left"),className:(0,r.cn)("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!W&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-ml-1 laptop:py-1 laptop:pl-1 laptop:rounded-r-none",e?.expandButton,{"laptop:bg-container-secondary-0":o==="dark","laptop:bg-container-primary":o==="dark"&&!W}),"aria-label":"Scroll left to see more items",children:(0,t.jsx)(L,{className:"laptop:size-4 size-5 rotate-180"})}),(0,t.jsxs)("div",{ref:m,onMouseDown:Ct,onMouseMove:kt,onMouseUp:Lt,onMouseLeave:Mt,onScroll:yt,className:(0,r.cn)("scrollbar-hide laptop:gap-1 laptop:w-[156px] desktop:w-[256px] laptop:shrink-0 flex w-full gap-1 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",V?"cursor-grabbing":"cursor-grab",e?.itemGridContainer),children:[u.filter(a=>a&&a.id).map(a=>{const y=(a.merchandise||{}).image||{},U=y.url,Tt=y.altText||"Product image",M=j===a.id;return(0,t.jsxs)("div",{className:(0,r.cn)("laptop:size-12 bg-container-primary laptop:bg-white rounded-box-small group relative size-16 shrink-0 overflow-hidden",e?.gridItem),children:[U&&(0,t.jsx)("img",{src:U,alt:Tt,draggable:!1,className:"rounded-box-small pointer-events-none size-full select-none object-cover"}),M&&(0,t.jsx)("div",{className:"rounded-box-small absolute inset-0 z-20 flex items-center justify-center bg-black/50",children:(0,t.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin text-white",children:[(0,t.jsx)("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),(0,t.jsx)("path",{d:"M14 8a6 6 0 0 0-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}),(0,t.jsx)("span",{role:"button",onClick:()=>H(a.id),className:(0,r.cn)("laptop:hidden absolute right-[2px] top-[2px] cursor-pointer",M&&"pointer-events-none opacity-0"),"aria-label":"delete",children:(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"pointer-events-none",children:[(0,t.jsx)("rect",{x:"1.33301",y:"1.33301",width:"13.3333",height:"13.3333",rx:"6.66667",fill:"white"}),(0,t.jsx)("path",{d:"M5.37705 5.28896C5.57234 5.09402 5.88839 5.09442 6.08347 5.28965L8.08602 7.29358L10.0906 5.28896C10.2858 5.09402 10.6026 5.09395 10.7977 5.28896C10.9928 5.48418 10.9926 5.80078 10.7977 5.99607L8.79312 8.00069L10.7964 10.0053C10.9913 10.2007 10.9909 10.5179 10.7957 10.7131C10.6005 10.908 10.2844 10.9074 10.0893 10.7124L8.08602 8.7078L6.08347 10.7103C5.88821 10.9056 5.57155 10.9057 5.37636 10.7103C5.18148 10.515 5.18132 10.1984 5.37636 10.0032L7.37891 8.00069L5.37636 5.99676C5.18119 5.80143 5.18181 5.48423 5.37705 5.28896Z",fill:"#767880"})]})}),a.productLabel&&(0,t.jsx)("div",{className:"absolute inset-x-0 bottom-0 flex items-center justify-center",children:(0,t.jsx)("div",{className:"rounded-b-box-small relative flex max-h-4 w-full items-center justify-center overflow-hidden px-1 py-0 backdrop-blur-sm",style:K(a.labelVariant,ot),children:(0,t.jsx)("div",{className:"w-full text-center",children:(0,t.jsx)(b.Text,{size:1,"data-fit-label":!0,className:"relative leading-[16px] text-white",html:a.productLabel})})})}),a.quantity>1&&(0,t.jsx)("div",{className:"mini-cart-quantity bg-brand-0 absolute bottom-0 right-0 z-10 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-white",children:(0,t.jsx)(b.Text,{className:"whitespace-nowrap text-sm leading-none",html:Pt(a.quantity)})}),(0,t.jsx)("div",{role:"button",onClick:()=>H(a.id),className:(0,r.cn)("rounded-box-small absolute inset-0 hidden cursor-pointer items-center justify-center bg-black/60 transition-opacity","laptop:flex laptop:opacity-0 laptop:group-hover:opacity-100",M&&"laptop:hidden",e?.gridItemOverlay),"aria-label":"Remove item",children:(0,t.jsx)(St,{className:"pointer-events-none size-[20px] text-white"})})]},a.id)}),et&&(0,t.jsx)("button",{onClick:()=>N?.(s),className:(0,r.cn)("bg-container-secondary-0 laptop:hidden flex size-16 shrink-0 items-center justify-center rounded-md",e?.mobileViewMoreButton),"aria-label":I,children:(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-quaternary",children:(0,t.jsx)("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),u.length>=5&&(0,t.jsx)("button",{onClick:()=>G("right"),className:(0,r.cn)("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!q&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-mr-1 laptop:py-1 laptop:pr-1 laptop:rounded-l-none",e?.expandButton,{"laptop:bg-container-secondary-0":o==="dark","laptop:bg-container-primary":o==="dark"&&!q}),"aria-label":"Scroll right to see more items",children:(0,t.jsx)(L,{className:"laptop:size-4 size-5"})})]}):null,f=!st&&u.length>0,Pt=o=>C!==void 0&&o>C?`${C}+`:String(o);return(0,t.jsx)("div",{ref:x,className:(0,r.cn)("bg-container-secondary-1 text-info-primary tablet:px-6 laptop:px-12 desktop:px-12 lg-desktop:px-[128px] laptop:py-[16px] flex w-full px-4 py-[12px]","flex-col items-stretch gap-3","laptop:flex-row laptop:items-center laptop:justify-around","laptop:items-center laptop:gap-4","tablet:gap-6 laptop:gap-8",i,e?.root,{"aiui-dark bg-container-primary":P==="dark"}),...J,children:(0,t.jsxs)("div",{className:(0,r.cn)("laptop:flex-row flex w-full flex-col gap-4","laptop:flex-1 laptop:items-center laptop:justify-between","tablet:gap-6 laptop:gap-8",e?.content),children:[(0,t.jsxs)("div",{className:(0,r.cn)("relative flex shrink flex-row items-center gap-2","desktop:gap-4",n&&"laptop:pl-[104px] pl-[72px]"),children:[n&&(0,t.jsx)(Y.default,{totalSteps:n.totalSteps,currentStep:n.currentStep,image:n.image,label:n.label,progressColor:n.progressColor,labelColor:n.labelColor,backgroundColor:n.backgroundColor,size:n.size,laptopSize:n.laptopSize,centerText:n.centerText,dimmed:n.dimmed,dimmedBadge:n.dimmedBadge,trackColor:n.trackColor,classNames:n.classNames,className:(0,r.cn)("mini-cart-progress absolute bottom-0 left-0","lg-desktop:bottom-auto lg-desktop:top-[-46px] desktop:bottom-auto desktop:top-[-52px]",e?.circleProgress)}),(0,t.jsxs)("div",{className:"laptop:flex-1 flex w-full flex-col",children:[(0,t.jsx)("div",{className:(0,r.cn)("tablet:gap-2 flex flex-col gap-1",e?.cartInfo),children:f?(0,t.jsxs)("div",{className:"flex w-full items-center gap-2",children:[(0,t.jsx)(g.Heading,{size:2,as:"h3",className:(0,r.cn)("",e?.cartTitle),html:at.replace("{count}",`<span class="mini-cart-count text-brand-0">${z||0}</span>`)}),(0,t.jsxs)(g.Heading,{size:1,as:"h5",onClick:()=>{window.innerWidth<1025?ut(!h):N?.(s)},className:(0,r.cn)("flex cursor-pointer items-center gap-1",e?.expandButton),children:[(0,t.jsx)(b.Text,{as:"span",size:1,className:"desktop:block hidden text-nowrap text-[16px] ",html:I}),(0,t.jsx)(L,{className:(0,r.cn)("size-4 transition-transform",h?"laptop:rotate-0 -rotate-90":"laptop:rotate-0 rotate-90")})]})]}):(0,t.jsx)(g.Heading,{as:"h3",size:2,className:(0,r.cn)("tablet:text-2xl text-xl",e?.cartTitle),html:rt})}),T&&(0,t.jsx)(b.Text,{size:2,className:(0,r.cn)("mini-cart-description text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[14px]",e?.cartDescription),html:T})]})]}),f&&(0,t.jsx)("div",{className:(0,r.cn)("laptop:block laptop:shrink",h?"block":"hidden"),children:Nt(P)}),f&&(0,t.jsx)("hr",{className:"laptop:hidden border-lines w-full border-t"}),(0,t.jsxs)("div",{className:(0,r.cn)("tablet:gap-6 laptop:gap-4 laptop:justify-end flex flex-row items-stretch justify-between gap-4",e?.priceSection),children:[(0,t.jsxs)("div",{className:"flex flex-col items-end justify-center",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.Heading,{as:"h6",size:2,className:(0,r.cn)("whitespace-nowrap text-nowrap",e?.totalPrice),html:nt.replace("{total}",mt)}),A&&(0,t.jsx)(g.Heading,{as:"h6",size:2,className:(0,r.cn)("text-info-tertiary whitespace-nowrap line-through",e?.originalPrice),html:A})]}),B&&(0,t.jsx)(g.Heading,{size:2,as:"h6",className:(0,r.cn)("mini-cart-saving laptop:text-right text-marketing-1 w-full whitespace-nowrap text-nowrap text-left",e?.saveAmount),html:lt.replace("{amount}",B)})]}),(0,t.jsx)(O.Button,{disabled:!f,loading:E,onClick:async()=>{if(!E){D(!0);try{await _?.(s)}finally{D(!1)}}},className:(0,r.cn)("mini-cart-action-button whitespace-nowrap",e?.actionButton),children:it})]})]})})});F.displayName="MiniCart";var Vt=F;
1
+ "use strict";"use client";var Rt=Object.create;var L=Object.defineProperty;var Ht=Object.getOwnPropertyDescriptor;var Vt=Object.getOwnPropertyNames;var Wt=Object.getPrototypeOf,$t=Object.prototype.hasOwnProperty;var qt=(i,e)=>{for(var d in e)L(i,d,{get:e[d],enumerable:!0})},Y=(i,e,d,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Vt(e))!$t.call(i,n)&&n!==d&&L(i,n,{get:()=>e[n],enumerable:!(c=Ht(e,n))||c.enumerable});return i};var I=(i,e,d)=>(d=i!=null?Rt(Wt(i)):{},Y(e||!i||!i.__esModule?L(d,"default",{value:i,enumerable:!0}):d,i)),Gt=i=>Y(L({},"__esModule",{value:!0}),i);var Xt={};qt(Xt,{default:()=>Ut,resolveCartLineLabelStyle:()=>rt});module.exports=Gt(Xt);var t=require("react/jsx-runtime"),s=I(require("react")),J=I(require("fitty")),a=require("../../helpers/index.js"),tt=require("../../components/index.js"),v=require("../../components/index.js"),b=require("../../components/index.js"),et=I(require("./CircleProgress.js")),ot=require("../../hooks/useExposure.js"),x=require("../../shared/track.js");const K="cart",Z="mini_cart",rt=(i,e)=>i==="notEligible"?{backgroundColor:e?.notEligibleLabelColor??"rgba(118, 120, 128, 0.60)"}:i==="gift"?{backgroundColor:e?.giftLabelColor??"rgba(251, 148, 63, 0.60)"}:{backgroundColor:"rgba(251, 148, 63, 0.60)"},_=s.forwardRef(({className:i,classNames:e={},data:d,cart:c,progressConfig:n,onRemoveItem:at,onCheckout:nt,onClickToView:z,...it},lt)=>{const y=s.useRef(null),{copy:p,theme:A="light",locale:Ft="us",showMobileViewMore:st=!0,maxQuantityDisplay:M,labelStyles:ct}=d||{};(0,ot.useExposure)(y,{componentType:K,componentName:Z,componentTitle:p?.itemsInCart||"Mini Cart",componentDescription:p?.description}),s.useImperativeHandle(lt,()=>y.current);const pt=p?.emptyCart||"Your Cart is Empty",B=p?.description||"",dt=p?.itemsInCart||"You have selected {count} items",mt=p?.total||"Total {total}",Qt=p?.totalWithCoupon||"total: {total} ({subtotal})",w=p?.clickToView||"Click to view cart",E=p?.buyNowText||"Buy Now",ut=(0,x.toPlainTrackingText)(p?.itemsInCart||"Mini Cart"),gt=(0,x.toPlainTrackingText)(p?.description),g=(o,r=1,l)=>({"data-headless-type-name":`${K}#${Z}`,"data-headless-title-desc-button":`${l?.title??ut}#${gt}#${(0,x.toPlainTrackingText)(o)}`,"data-headless-nav-position":`#${r}`,...l?.sku?{"data-headless-sku":l.sku}:{}}),ft=p?.savingText||"Saving {amount}",u=s.useMemo(()=>c?.lineItems||[],[c?.lineItems]),D=u.reduce((o,r)=>o+(r?.quantity||0),0),bt=D===0,xt=parseFloat(c?.cost?.totalAmount?.amount||"0"),ht=parseFloat(c?.cost?.subtotalAmount?.amount||"0"),vt=parseFloat(c?.cost?.savingAmount?.amount||"0"),yt=c?.cost?.totalAmount?.formattedPrice||"",j=ht>xt?c?.cost?.subtotalAmount?.formattedPrice:null,R=vt>0?c?.cost?.savingAmount?.formattedPrice:null,m=s.useRef(null),[C,wt]=s.useState(!1),[H,V]=s.useState(!1),[W,$]=s.useState(null),q=async o=>{if(!W){$(o);try{await at?.(o,c)}finally{$(null)}}},[G,S]=s.useState(!1),[Ct,kt]=s.useState(0),[Lt,Mt]=s.useState(0),[U,St]=s.useState(!1),[X,Nt]=s.useState(!0),k=s.useCallback(()=>{const o=m.current;if(!o)return;const{scrollLeft:r,scrollWidth:l,clientWidth:f}=o;St(r>0),Nt(r<l-f-1)},[]),Pt=s.useCallback(()=>{k()},[k]);s.useEffect(()=>{k()},[u.length,k]);const Tt=u.map(o=>o.productLabel??"").join("|");s.useEffect(()=>{const o=y.current?.querySelectorAll("[data-fit-label]");if(!o?.length)return;const r=Array.from(o,l=>(0,J.default)(l,{minSize:8,maxSize:12,multiLine:!1}));return()=>r.forEach(l=>l.unsubscribe())},[Tt,C]);const It=o=>{m.current&&(S(!0),kt(o.pageX-m.current.offsetLeft),Mt(m.current.scrollLeft))},zt=o=>{if(!G||!m.current)return;o.preventDefault();const l=(o.pageX-m.current.offsetLeft-Ct)*1.5;m.current.scrollLeft=Lt-l},At=()=>{S(!1)},Bt=()=>{S(!1)},F=o=>{if(m.current){const r=m.current,l=100;r.scrollBy({left:o==="right"?l:-l,behavior:"smooth"})}},N=({className:o})=>(0,t.jsx)("svg",{className:o,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M6 4L10 8L6 12",stroke:"currentColor",strokeWidth:"1.33",strokeLinecap:"round",strokeLinejoin:"round"})}),Et=({className:o})=>(0,t.jsx)("svg",{className:o,width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M2.5 5H17.5M8.33333 9.16667V14.1667M11.6667 9.16667V14.1667M3.33333 5L4.16667 16.6667C4.16667 17.1087 4.34226 17.5326 4.65482 17.8452C4.96738 18.1577 5.39131 18.3333 5.83333 18.3333H14.1667C14.6087 18.3333 15.0326 18.1577 15.3452 17.8452C15.6577 17.5326 15.8333 17.1087 15.8333 16.6667L16.6667 5M7.5 5V2.5C7.5 2.27899 7.5878 2.06702 7.74408 1.91074C7.90036 1.75446 8.11232 1.66667 8.33333 1.66667H11.6667C11.8877 1.66667 12.0996 1.75446 12.2559 1.91074C12.4122 2.06702 12.5 2.27899 12.5 2.5V5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})}),Dt=o=>u.length?(0,t.jsxs)("div",{className:(0,a.cn)("laptop:bg-container-secondary-0 rounded-box-small flex gap-1 p-1",e?.itemsGrid),children:[u.length>=5&&(0,t.jsx)("button",{onClick:()=>F("left"),...g("prev"),className:(0,a.cn)("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!U&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-ml-1 laptop:py-1 laptop:pl-1 laptop:rounded-r-none",e?.expandButton,{"laptop:bg-container-secondary-0":o==="dark","laptop:bg-container-primary":o==="dark"&&!U}),"aria-label":"Scroll left to see more items",children:(0,t.jsx)(N,{className:"laptop:size-4 size-5 rotate-180"})}),(0,t.jsxs)("div",{ref:m,onMouseDown:It,onMouseMove:zt,onMouseUp:At,onMouseLeave:Bt,onScroll:Pt,className:(0,a.cn)("scrollbar-hide laptop:gap-1 laptop:w-[156px] desktop:w-[256px] laptop:shrink-0 flex w-full gap-1 overflow-x-auto [-ms-overflow-style:none] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",G?"cursor-grabbing":"cursor-grab",e?.itemGridContainer),children:[u.filter(r=>r&&r.id).map((r,l)=>{const f=r.merchandise||{},Q=f.image||{},O=Q.url,P=Q.altText||"Product image",T=W===r.id;return(0,t.jsxs)("div",{className:(0,a.cn)("laptop:size-12 bg-container-primary laptop:bg-white rounded-box-small group relative size-16 shrink-0 overflow-hidden",e?.gridItem),children:[O&&(0,t.jsx)("img",{src:O,alt:P,draggable:!1,className:"rounded-box-small pointer-events-none size-full select-none object-cover"}),T&&(0,t.jsx)("div",{className:"rounded-box-small absolute inset-0 z-20 flex items-center justify-center bg-black/50",children:(0,t.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"animate-spin text-white",children:[(0,t.jsx)("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),(0,t.jsx)("path",{d:"M14 8a6 6 0 0 0-6-6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}),(0,t.jsx)("span",{role:"button",onClick:()=>q(r.id),...g("delete",l+1,{title:(0,x.toPlainTrackingText)(f.title??P),sku:f.sku}),className:(0,a.cn)("laptop:hidden absolute right-[2px] top-[2px] cursor-pointer",T&&"pointer-events-none opacity-0"),"aria-label":"delete",children:(0,t.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"pointer-events-none",children:[(0,t.jsx)("rect",{x:"1.33301",y:"1.33301",width:"13.3333",height:"13.3333",rx:"6.66667",fill:"white"}),(0,t.jsx)("path",{d:"M5.37705 5.28896C5.57234 5.09402 5.88839 5.09442 6.08347 5.28965L8.08602 7.29358L10.0906 5.28896C10.2858 5.09402 10.6026 5.09395 10.7977 5.28896C10.9928 5.48418 10.9926 5.80078 10.7977 5.99607L8.79312 8.00069L10.7964 10.0053C10.9913 10.2007 10.9909 10.5179 10.7957 10.7131C10.6005 10.908 10.2844 10.9074 10.0893 10.7124L8.08602 8.7078L6.08347 10.7103C5.88821 10.9056 5.57155 10.9057 5.37636 10.7103C5.18148 10.515 5.18132 10.1984 5.37636 10.0032L7.37891 8.00069L5.37636 5.99676C5.18119 5.80143 5.18181 5.48423 5.37705 5.28896Z",fill:"#767880"})]})}),r.productLabel&&(0,t.jsx)("div",{className:"absolute inset-x-0 bottom-0 flex items-center justify-center",children:(0,t.jsx)("div",{className:"rounded-b-box-small relative flex max-h-4 w-full items-center justify-center overflow-hidden px-1 py-0 backdrop-blur-sm",style:rt(r.labelVariant,ct),children:(0,t.jsx)("div",{className:"w-full text-center",children:(0,t.jsx)(v.Text,{size:1,"data-fit-label":!0,className:"relative leading-[16px] text-white",html:r.productLabel})})})}),r.quantity>1&&(0,t.jsx)("div",{className:"mini-cart-quantity bg-brand-0 absolute bottom-0 right-0 z-10 flex h-4 min-w-4 items-center justify-center rounded-full px-1 text-white",children:(0,t.jsx)(v.Text,{className:"whitespace-nowrap text-sm leading-none",html:jt(r.quantity)})}),(0,t.jsx)("div",{role:"button",onClick:()=>q(r.id),...g("delete",l+1,{title:(0,x.toPlainTrackingText)(f.title??P),sku:f.sku}),className:(0,a.cn)("rounded-box-small absolute inset-0 hidden cursor-pointer items-center justify-center bg-black/60 transition-opacity","laptop:flex laptop:opacity-0 laptop:group-hover:opacity-100",T&&"laptop:hidden",e?.gridItemOverlay),"aria-label":"Remove item",children:(0,t.jsx)(Et,{className:"pointer-events-none size-[20px] text-white"})})]},r.id)}),st&&(0,t.jsx)("button",{onClick:()=>z?.(c),...g(w),className:(0,a.cn)("bg-container-secondary-0 laptop:hidden flex size-16 shrink-0 items-center justify-center rounded-md",e?.mobileViewMoreButton),"aria-label":w,children:(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-quaternary",children:(0,t.jsx)("path",{d:"M7.5 5L12.5 10L7.5 15",stroke:"currentColor",strokeWidth:"1.67",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),u.length>=5&&(0,t.jsx)("button",{onClick:()=>F("right"),...g("next"),className:(0,a.cn)("border-border laptop:flex hover:bg-muted-foreground/10 rounded-box-small hidden w-[32px] shrink-0 items-center justify-center px-2 transition-colors",!X&&"laptop:bg-container-secondary-1 laptop:text-transparent laptop:pointer-events-none laptop:-my-1 laptop:-mr-1 laptop:py-1 laptop:pr-1 laptop:rounded-l-none",e?.expandButton,{"laptop:bg-container-secondary-0":o==="dark","laptop:bg-container-primary":o==="dark"&&!X}),"aria-label":"Scroll right to see more items",children:(0,t.jsx)(N,{className:"laptop:size-4 size-5"})})]}):null,h=!bt&&u.length>0,jt=o=>M!==void 0&&o>M?`${M}+`:String(o);return(0,t.jsx)("div",{ref:y,className:(0,a.cn)("bg-container-secondary-1 text-info-primary tablet:px-6 laptop:px-12 desktop:px-12 lg-desktop:px-[128px] laptop:py-[16px] flex w-full px-4 py-[12px]","flex-col items-stretch gap-3","laptop:flex-row laptop:items-center laptop:justify-around","laptop:items-center laptop:gap-4","tablet:gap-6 laptop:gap-8",i,e?.root,{"aiui-dark bg-container-primary":A==="dark"}),...it,children:(0,t.jsxs)("div",{className:(0,a.cn)("laptop:flex-row flex w-full flex-col gap-4","laptop:flex-1 laptop:items-center laptop:justify-between","tablet:gap-6 laptop:gap-8",e?.content),children:[(0,t.jsxs)("div",{className:(0,a.cn)("relative flex shrink flex-row items-center gap-2","desktop:gap-4",n&&"laptop:pl-[104px] pl-[72px]"),children:[n&&(0,t.jsx)(et.default,{totalSteps:n.totalSteps,currentStep:n.currentStep,image:n.image,label:n.label,progressColor:n.progressColor,labelColor:n.labelColor,backgroundColor:n.backgroundColor,size:n.size,laptopSize:n.laptopSize,centerText:n.centerText,dimmed:n.dimmed,dimmedBadge:n.dimmedBadge,trackColor:n.trackColor,classNames:n.classNames,className:(0,a.cn)("mini-cart-progress absolute bottom-0 left-0","lg-desktop:bottom-auto lg-desktop:top-[-46px] desktop:bottom-auto desktop:top-[-52px]",e?.circleProgress)}),(0,t.jsxs)("div",{className:"laptop:flex-1 flex w-full flex-col",children:[(0,t.jsx)("div",{className:(0,a.cn)("tablet:gap-2 flex flex-col gap-1",e?.cartInfo),children:h?(0,t.jsxs)("div",{className:"flex w-full items-center gap-2",children:[(0,t.jsx)(b.Heading,{size:2,as:"h3",className:(0,a.cn)("",e?.cartTitle),html:dt.replace("{count}",`<span class="mini-cart-count text-brand-0">${D||0}</span>`)}),(0,t.jsxs)(b.Heading,{size:1,as:"h5",onClick:()=>{window.innerWidth<1025?wt(!C):z?.(c)},...g(w),className:(0,a.cn)("flex cursor-pointer items-center gap-1",e?.expandButton),children:[(0,t.jsx)(v.Text,{as:"span",size:1,className:"desktop:block hidden text-nowrap text-[16px] ",html:w}),(0,t.jsx)(N,{className:(0,a.cn)("size-4 transition-transform",C?"laptop:rotate-0 -rotate-90":"laptop:rotate-0 rotate-90")})]})]}):(0,t.jsx)(b.Heading,{as:"h3",size:2,className:(0,a.cn)("tablet:text-2xl text-xl",e?.cartTitle),html:pt})}),B&&(0,t.jsx)(v.Text,{size:2,className:(0,a.cn)("mini-cart-description text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] text-[14px]",e?.cartDescription),html:B})]})]}),h&&(0,t.jsx)("div",{className:(0,a.cn)("laptop:block laptop:shrink",C?"block":"hidden"),children:Dt(A)}),h&&(0,t.jsx)("hr",{className:"laptop:hidden border-lines w-full border-t"}),(0,t.jsxs)("div",{className:(0,a.cn)("tablet:gap-6 laptop:gap-4 laptop:justify-end flex flex-row items-stretch justify-between gap-4",e?.priceSection),children:[(0,t.jsxs)("div",{className:"flex flex-col items-end justify-center",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(b.Heading,{as:"h6",size:2,className:(0,a.cn)("whitespace-nowrap text-nowrap",e?.totalPrice),html:mt.replace("{total}",yt)}),j&&(0,t.jsx)(b.Heading,{as:"h6",size:2,className:(0,a.cn)("text-info-tertiary whitespace-nowrap line-through",e?.originalPrice),html:j})]}),R&&(0,t.jsx)(b.Heading,{size:2,as:"h6",className:(0,a.cn)("mini-cart-saving laptop:text-right text-marketing-1 w-full whitespace-nowrap text-nowrap text-left",e?.saveAmount),html:ft.replace("{amount}",R)})]}),(0,t.jsx)(tt.Button,{disabled:!h,loading:H,onClick:async()=>{if(!H){V(!0);try{await nt?.(c)}finally{V(!1)}}},...g(E),className:(0,a.cn)("mini-cart-action-button whitespace-nowrap",e?.actionButton),children:E})]})]})})});_.displayName="MiniCart";var Ut=_;
@@ -1 +1 @@
1
- "use strict";var W=Object.create;var S=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ae=Object.prototype.hasOwnProperty;var se=(o,a)=>{for(var l in a)S(o,l,{get:a[l],enumerable:!0})},U=(o,a,l,u)=>{if(a&&typeof a=="object"||typeof a=="function")for(let p of ee(a))!ae.call(o,p)&&p!==l&&S(o,p,{get:()=>a[p],enumerable:!(u=X(a,p))||u.enumerable});return o};var $=(o,a,l)=>(l=o!=null?W(te(o)):{},U(a||!o||!o.__esModule?S(l,"default",{value:o,enumerable:!0}):l,o)),oe=o=>U(S({},"__esModule",{value:!0}),o);var ie={};se(ie,{default:()=>le});module.exports=oe(ie);var e=require("react/jsx-runtime"),r=$(require("react")),A=require("react-responsive"),Q=$(require("./MultiLayoutGraphicBlockCarousel.js")),Y=require("../../shared/Styles.js"),R=$(require("../../components/picture.js")),j=$(require("../../components/button.js")),E=require("../../components/heading.js"),q=require("../VideoModal/index.js"),V=require("../../components/grid.js"),O=$(require("../Title/index.js")),i=require("../../helpers/utils.js"),_=$(require("../SwiperBox/index.js")),H=require("../../shared/mimeType.js"),v=require("../../components/tabs.js"),Z=require("../../hooks/useExposure.js"),z=require("../../shared/trackUrlRef.js"),F=require("../AiuiProvider/index.js"),J=require("../../shared/track.js");const g="image",y="p1_banner",C=({data:o,configuration:a,jIndex:l,spanType:u,title:p,onSecondaryButtonClick:k,onPrimaryButtonClick:L})=>{const[c,N]=(0,r.useState)(!1),b=(0,A.useMediaQuery)({query:"(max-width: 768px)"}),m=(0,r.useRef)(null),I=()=>{if(u)switch(u){case"full":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"half":return"tablet:aspect-w-[704] tablet:aspect-h-[480] 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"one-third":return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] 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-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}else switch(a?.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-[704] tablet:aspect-h-[480] 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-[427] 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-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}};(0,Z.useExposure)(m,{componentType:g,componentName:y,position:l,componentTitle:o.title,componentDescription:o.description,navigation:a?.activeTab}),(0,r.useEffect)(()=>{N(b)},[b]);const{theme:G="light",title:f,description:h,imageUrl:d,primaryButton:B,secondaryButton:n,imageMobileUrl:x,blockLink:T,video:w,youtubeId:M,isYouTube:P,id:t}=o,s="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return(0,e.jsxs)("div",{className:(0,i.cn)("item-wrapper cursor-pointer","text-info-primary group relative box-border w-full overflow-hidden",I(),{"rounded-box":!0,"aiui-dark":G==="dark","h-[400px]":c},"text-info-primary"),ref:m,children:[(T||n.link)&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:(0,z.trackUrlRef)((0,i.getLocalizedPath)(T||n.link||"",a?.locale||"us"),`${g}_${y}`),"data-headless-type-name":`${g}#${y}`,"data-headless-title-desc-button":`${f}#${h}`,"data-headless-nav-position":`${a?.activeTab}#${l}`,"aria-hidden":"true",tabIndex:-1}),(0,e.jsxs)("div",{className:"absolute inset-0",children:[(0,H.isVideo)(d?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:block hidden size-full overflow-hidden object-cover",children:(0,e.jsx)("source",{src:d?.url,type:"video/mp4"})}):(0,e.jsx)(R.default,{source:d?.url,alt:d?.alt||"",className:"tablet:block hidden h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 group-hover:scale-105 object-cover",style:{aspectRatio:`${d?.width}/${d?.height}`}}),(0,H.isVideo)(x?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:hidden block size-full overflow-hidden object-cover",children:(0,e.jsx)("source",{src:x?.url,type:"video/mp4"})}):(0,e.jsx)(R.default,{source:x?.url||d?.url,alt:x?.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,i.cn)("pointer-events-none absolute inset-0 z-20 flex flex-col",u==="full"?"laptop:justify-center justify-end":"justify-end"),children:[(0,e.jsxs)("div",{className:"laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 pointer-events-auto flex w-fit flex-col gap-6 p-4",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(E.Heading,{size:3,as:"h3",className:"item-title",html:f}),(0,e.jsx)(E.Heading,{as:"h4",className:"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px]",html:h})]}),(0,e.jsxs)("div",{className:"lg-desktop:gap-3 flex gap-2",children:[n&&n.text&&(0,e.jsxs)(j.default,{"aria-label":f??h,className:(0,i.cn)(s,"link-left"),variant:"secondary",as:"a","data-track":`${t}-link-left`,onClick:()=>{k?.(o)},href:(0,z.trackUrlRef)((0,i.getLocalizedPath)(n.link||"",a?.locale||"us"),`${g}_${y}`),"data-headless-type-name":`${g}#${y}`,"data-headless-title-desc-button":`${f}#${h}#${n.text}`,"data-headless-nav-position":`${a?.activeTab}#${l}`,children:[n.text,(0,e.jsx)("span",{className:"sr-only",children:f??h})]}),B&&B.text&&(0,e.jsx)(j.default,{"aria-label":f??h,className:(0,i.cn)(s,"link-right"),variant:"primary","data-track":`${t}-link-right`,as:"a",onClick:()=>{L?.(o)},href:(0,z.trackUrlRef)((0,i.getLocalizedPath)(B.link||"",a?.locale||"us"),`${g}_${y}`),"data-headless-type-name":`${g}#${y}`,"data-headless-title-desc-button":`${f}#${h}#${B.text}`,"data-headless-nav-position":`${a?.activeTab}#${l}`,children:B.text})]})]}),(w?.url||M)&&(0,e.jsx)("div",{className:"laptop:bottom-6 laptop:right-6 pointer-events-auto absolute bottom-4 right-4",children:(0,e.jsx)("button",{onClick:()=>{a?.onVideoPlayBtnClick?.(P&&M?M:w?.url||M,P)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:(0,e.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})]})]})},D=r.default.forwardRef((o,a)=>{const{data:l,className:u,onSecondaryButtonClick:p,onPrimaryButtonClick:k,...L}=o,{sectionTitle:c,groupByTab:N=!1,items:b=[],carousel:m}=l,[I,G]=(0,r.useState)(!1),[f,h]=(0,r.useState)(""),[d,B]=(0,r.useState)(""),{locale:n="us"}=(0,F.useAiuiContext)(),x=t=>{switch(t){case"full":return 12;case"half":return 6;case"one-third":return 4}},T=b.map(t=>t.tabName).filter(Boolean).filter((t,s,K)=>K.indexOf(t)===s),w=(t,s)=>{G(!0),s?B?.(t||""):h?.(t||"")},M=(t,s)=>{switch(t){case 1:return 1;case 2:return 2;default:return s?2.3:3}},P=T.map(t=>({tabName:t,items:b.filter(s=>s.tabName===t)})).reduce((t,s)=>(t[s.tabName]=s.items,t),{});return l.mode==="carousel"&&b.length>0?(0,e.jsx)(Q.default,{data:l,onPrimaryButtonClick:k,onSecondaryButtonClick:p,className:u,ref:a,...L}):(0,e.jsxs)("section",{"data-ui-component-id":"MultiLayoutGraphicBlock",ref:a,...L,className:(0,i.cn)("multiLayoutGraphicBlock","text-info-primary",u),children:[c&&(0,e.jsx)(O.default,{data:{title:c},className:"section-title"}),N?(0,e.jsxs)(v.Tabs,{align:"left",defaultValue:(0,i.spaceToHyphen)(T[0]),children:[(0,e.jsx)(v.TabsList,{children:T.map((t,s)=>(0,e.jsx)(v.TabsTrigger,{value:(0,i.spaceToHyphen)(t),onClick:()=>{(0,J.gaTrack)({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:"Home Page",component_type:g,component_name:y,component_title:c,component_position:1,navigation:t,button_name:t}})},children:t},s))}),T.map((t,s)=>(0,e.jsx)(v.TabsContent,{value:(0,i.spaceToHyphen)(t),className:"desktop:mt-[36px] mt-[24px] w-full",children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(_.default,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock1",data:{list:P?.[t]||[],configuration:{isTab:N,activeTab:t,title:c,num:P?.[t]?.length||0,locale:n,onVideoPlayBtnClick:w,onSecondaryButtonClick:p,onPrimaryButtonClick:k}},Slide:C,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:M(P?.[t]?.length||0,!0)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:M(P?.[t]?.length||0)}}}),m&&m?.items.length>0?(0,e.jsx)(_.default,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock2",data:{list:m?.items||[],configuration:{isTab:N,locale:n,onVideoPlayBtnClick:w,title:c,onSecondaryButtonClick:p,onPrimaryButtonClick:k}},Slide:C,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3.1},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}}):null]})},s))]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(V.Grid,{className:"w-full",children:[b.map((t,s)=>(0,e.jsx)(V.GridItem,{span:x(t.width??"full"),className:"laptop:block hidden",children:(0,e.jsx)(C,{data:t,configuration:{locale:n,onVideoPlayBtnClick:w,title:c},jIndex:s,spanType:t.width,onSecondaryButtonClick:p,onPrimaryButtonClick:k})},`${t?.title||""}${s}`)),b.map((t,s)=>(0,e.jsx)(V.GridItem,{span:x("full"),className:"laptop:hidden block",children:(0,e.jsx)(C,{data:t,configuration:{locale:n,onVideoPlayBtnClick:w,title:c},jIndex:s,spanType:"full",onSecondaryButtonClick:p,onPrimaryButtonClick:k})},`${t?.title||""}${s}`))]}),m&&m?.items.length>0?(0,e.jsx)(_.default,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock3",data:{list:m?.items||[],configuration:{locale:n,onVideoPlayBtnClick:w,title:c,onSecondaryButtonClick:p,onPrimaryButtonClick:k}},Slide:C,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3.1},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}}):null]}),I&&(0,e.jsx)(q.VideoModal,{visible:I,youTubeId:d,videoUrl:f,onCloseModal:()=>G(!1)})]})});D.displayName="MultiLayoutGraphicBlock";var le=(0,Y.withLayout)(D,{container:{desktopSpan:12,mobileSpan:12}});
1
+ "use strict";var X=Object.create;var S=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var ae=Object.getPrototypeOf,se=Object.prototype.hasOwnProperty;var oe=(o,a)=>{for(var l in a)S(o,l,{get:a[l],enumerable:!0})},D=(o,a,l,m)=>{if(a&&typeof a=="object"||typeof a=="function")for(let p of te(a))!se.call(o,p)&&p!==l&&S(o,p,{get:()=>a[p],enumerable:!(m=ee(a,p))||m.enumerable});return o};var M=(o,a,l)=>(l=o!=null?X(ae(o)):{},D(a||!o||!o.__esModule?S(l,"default",{value:o,enumerable:!0}):l,o)),le=o=>D(S({},"__esModule",{value:!0}),o);var pe={};oe(pe,{default:()=>ie});module.exports=le(pe);var e=require("react/jsx-runtime"),c=M(require("react")),Q=require("react-responsive"),Y=M(require("./MultiLayoutGraphicBlockCarousel.js")),q=require("../../shared/Styles.js"),j=M(require("../../components/picture.js")),E=M(require("../../components/button.js")),H=require("../../components/heading.js"),O=require("../VideoModal/index.js"),V=require("../../components/grid.js"),Z=M(require("../Title/index.js")),i=require("../../helpers/utils.js"),_=M(require("../SwiperBox/index.js")),U=require("../../shared/mimeType.js"),x=require("../../components/tabs.js"),F=require("../../hooks/useExposure.js"),z=require("../../shared/trackUrlRef.js"),J=require("../AiuiProvider/index.js"),K=require("../../shared/track.js"),W=require("../../hooks/useTracking.js");const v="image",B="p1_banner",$=({data:o,configuration:a,jIndex:l,spanType:m,title:p,onSecondaryButtonClick:g,onPrimaryButtonClick:L})=>{const{buildRef:n}=(0,W.useTracking)(),[P,T]=(0,c.useState)(!1),f=(0,Q.useMediaQuery)({query:"(max-width: 768px)"}),N=(0,c.useRef)(null),I=()=>{if(m)switch(m){case"full":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"half":return"tablet:aspect-w-[704] tablet:aspect-h-[480] 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"one-third":return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] 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-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}else switch(a?.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-[704] tablet:aspect-h-[480] 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-[427] 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-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}};(0,F.useExposure)(N,{componentType:v,componentName:B,position:l,componentTitle:o.title,componentDescription:o.description,navigation:a?.activeTab}),(0,c.useEffect)(()=>{T(f)},[f]);const{theme:R="light",title:h,description:k,imageUrl:d,primaryButton:r,secondaryButton:u,imageMobileUrl:b,blockLink:y,video:C,youtubeId:w,isYouTube:t,id:s}=o,G="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return(0,e.jsxs)("div",{className:(0,i.cn)("item-wrapper cursor-pointer","text-info-primary group relative box-border w-full overflow-hidden",I(),{"rounded-box":!0,"aiui-dark":R==="dark","h-[400px]":P},"text-info-primary"),ref:N,children:[(y||u.link)&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:(0,z.trackUrlRef)((0,i.getLocalizedPath)(y||u.link||"",a?.locale||"us"),n(v,B)),"data-headless-type-name":`${v}#${B}`,"data-headless-title-desc-button":`${h}#${k}`,"data-headless-nav-position":`${a?.activeTab}#${l}`,"aria-hidden":"true",tabIndex:-1}),(0,e.jsxs)("div",{className:"absolute inset-0",children:[(0,U.isVideo)(d?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:block hidden size-full overflow-hidden object-cover",children:(0,e.jsx)("source",{src:d?.url,type:"video/mp4"})}):(0,e.jsx)(j.default,{source:d?.url,alt:d?.alt||"",className:"tablet:block hidden h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 group-hover:scale-105 object-cover",style:{aspectRatio:`${d?.width}/${d?.height}`}}),(0,U.isVideo)(b?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:hidden block size-full overflow-hidden object-cover",children:(0,e.jsx)("source",{src:b?.url,type:"video/mp4"})}):(0,e.jsx)(j.default,{source:b?.url||d?.url,alt:b?.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,i.cn)("pointer-events-none absolute inset-0 z-20 flex flex-col",m==="full"?"laptop:justify-center justify-end":"justify-end"),children:[(0,e.jsxs)("div",{className:"laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 pointer-events-auto flex w-fit flex-col gap-6 p-4",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(H.Heading,{size:3,as:"h3",className:"item-title",html:h}),(0,e.jsx)(H.Heading,{as:"h4",className:"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px]",html:k})]}),(0,e.jsxs)("div",{className:"lg-desktop:gap-3 flex gap-2",children:[u&&u.text&&(0,e.jsxs)(E.default,{"aria-label":h??k,className:(0,i.cn)(G,"link-left"),variant:"secondary",as:"a","data-track":`${s}-link-left`,onClick:()=>{g?.(o)},href:(0,z.trackUrlRef)((0,i.getLocalizedPath)(u.link||"",a?.locale||"us"),n(v,B)),"data-headless-type-name":`${v}#${B}`,"data-headless-title-desc-button":`${h}#${k}#${u.text}`,"data-headless-nav-position":`${a?.activeTab}#${l}`,children:[u.text,(0,e.jsx)("span",{className:"sr-only",children:h??k})]}),r&&r.text&&(0,e.jsx)(E.default,{"aria-label":h??k,className:(0,i.cn)(G,"link-right"),variant:"primary","data-track":`${s}-link-right`,as:"a",onClick:()=>{L?.(o)},href:(0,z.trackUrlRef)((0,i.getLocalizedPath)(r.link||"",a?.locale||"us"),n(v,B)),"data-headless-type-name":`${v}#${B}`,"data-headless-title-desc-button":`${h}#${k}#${r.text}`,"data-headless-nav-position":`${a?.activeTab}#${l}`,children:r.text})]})]}),(C?.url||w)&&(0,e.jsx)("div",{className:"laptop:bottom-6 laptop:right-6 pointer-events-auto absolute bottom-4 right-4",children:(0,e.jsx)("button",{onClick:()=>{a?.onVideoPlayBtnClick?.(t&&w?w:C?.url||w,t)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:(0,e.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})]})]})},A=c.default.forwardRef((o,a)=>{const{data:l,className:m,onSecondaryButtonClick:p,onPrimaryButtonClick:g,...L}=o,{sectionTitle:n,groupByTab:P=!1,items:T=[],carousel:f}=l,[N,I]=(0,c.useState)(!1),[R,h]=(0,c.useState)(""),[k,d]=(0,c.useState)(""),{locale:r="us"}=(0,J.useAiuiContext)(),u=t=>{switch(t){case"full":return 12;case"half":return 6;case"one-third":return 4}},b=T.map(t=>t.tabName).filter(Boolean).filter((t,s,G)=>G.indexOf(t)===s),y=(t,s)=>{I(!0),s?d?.(t||""):h?.(t||"")},C=(t,s)=>{switch(t){case 1:return 1;case 2:return 2;default:return s?2.3:3}},w=b.map(t=>({tabName:t,items:T.filter(s=>s.tabName===t)})).reduce((t,s)=>(t[s.tabName]=s.items,t),{});return l.mode==="carousel"&&T.length>0?(0,e.jsx)(Y.default,{data:l,onPrimaryButtonClick:g,onSecondaryButtonClick:p,className:m,ref:a,...L}):(0,e.jsxs)("section",{"data-ui-component-id":"MultiLayoutGraphicBlock",ref:a,...L,className:(0,i.cn)("multiLayoutGraphicBlock","text-info-primary",m),children:[n&&(0,e.jsx)(Z.default,{data:{title:n},className:"section-title"}),P?(0,e.jsxs)(x.Tabs,{align:"left",defaultValue:(0,i.spaceToHyphen)(b[0]),children:[(0,e.jsx)(x.TabsList,{children:b.map((t,s)=>(0,e.jsx)(x.TabsTrigger,{value:(0,i.spaceToHyphen)(t),onClick:()=>{(0,K.gaTrack)({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:"Home Page",component_type:v,component_name:B,component_title:n,component_position:1,navigation:t,button_name:t}})},children:t},s))}),b.map((t,s)=>(0,e.jsx)(x.TabsContent,{value:(0,i.spaceToHyphen)(t),className:"desktop:mt-[36px] mt-[24px] w-full",children:(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(_.default,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock1",data:{list:w?.[t]||[],configuration:{isTab:P,activeTab:t,title:n,num:w?.[t]?.length||0,locale:r,onVideoPlayBtnClick:y,onSecondaryButtonClick:p,onPrimaryButtonClick:g}},Slide:$,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:C(w?.[t]?.length||0,!0)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:C(w?.[t]?.length||0)}}}),f&&f?.items.length>0?(0,e.jsx)(_.default,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock2",data:{list:f?.items||[],configuration:{isTab:P,locale:r,onVideoPlayBtnClick:y,title:n,onSecondaryButtonClick:p,onPrimaryButtonClick:g}},Slide:$,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3.1},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}}):null]})},s))]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(V.Grid,{className:"w-full",children:[T.map((t,s)=>(0,e.jsx)(V.GridItem,{span:u(t.width??"full"),className:"laptop:block hidden",children:(0,e.jsx)($,{data:t,configuration:{locale:r,onVideoPlayBtnClick:y,title:n},jIndex:s,spanType:t.width,onSecondaryButtonClick:p,onPrimaryButtonClick:g})},`${t?.title||""}${s}`)),T.map((t,s)=>(0,e.jsx)(V.GridItem,{span:u("full"),className:"laptop:hidden block",children:(0,e.jsx)($,{data:t,configuration:{locale:r,onVideoPlayBtnClick:y,title:n},jIndex:s,spanType:"full",onSecondaryButtonClick:p,onPrimaryButtonClick:g})},`${t?.title||""}${s}`))]}),f&&f?.items.length>0?(0,e.jsx)(_.default,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock3",data:{list:f?.items||[],configuration:{locale:r,onVideoPlayBtnClick:y,title:n,onSecondaryButtonClick:p,onPrimaryButtonClick:g}},Slide:$,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3.1},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}}):null]}),N&&(0,e.jsx)(O.VideoModal,{visible:N,youTubeId:k,videoUrl:R,onCloseModal:()=>I(!1)})]})});A.displayName="MultiLayoutGraphicBlock";var ie=(0,q.withLayout)(A,{container:{desktopSpan:12,mobileSpan:12}});
@@ -1 +1 @@
1
- "use strict";"use client";var k=Object.create;var c=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var w=(t,e)=>{for(var r in e)c(t,r,{get:e[r],enumerable:!0})},u=(t,e,r,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of H(e))!P.call(t,s)&&s!==r&&c(t,s,{get:()=>e[s],enumerable:!(l=g(e,s))||l.enumerable});return t};var y=(t,e,r)=>(r=t!=null?k(v(t)):{},u(e||!t||!t.__esModule?c(r,"default",{value:t,enumerable:!0}):r,t)),T=t=>u(c({},"__esModule",{value:!0}),t);var R={};w(R,{default:()=>E});module.exports=T(R);var o=require("react/jsx-runtime"),p=y(require("react")),a=require("../../components/index.js"),d=require("../../helpers/utils.js"),h=require("../../shared/Styles.js"),f=require("../../hooks/useExposure.js");const L="image",D="product_hero",n=p.default.forwardRef(({data:t,className:e},r)=>{const{title:l,subtitle:s,ctaText:m,poster:b,mobPoster:x,ctaLink:_,theme:N="light"}=t,i=(0,p.useRef)(null);return(0,f.useExposure)(i,{componentType:L,componentName:D,componentTitle:l,componentDescription:s}),(0,p.useImperativeHandle)(r,()=>i.current),(0,o.jsxs)("section",{ref:i,"data-ui-component-id":"ProductHero",className:(0,d.cn)("product-hero text-info-primary tablet:flex-row tablet:gap-[16px] lg-desktop:gap-[64px] flex w-full flex-col items-center justify-between gap-[32px]",{"aiui-dark":N==="dark"},e),children:[(0,o.jsxs)("div",{className:"product-hero__content tablet:basis-[42%] laptop:basis-[36%] flex w-full flex-col items-start gap-[24px]",children:[(0,o.jsxs)("div",{className:"product-hero__text",children:[(0,o.jsx)(a.Heading,{as:"h3",size:4,html:l,className:"product-hero__title"}),(0,o.jsx)(a.Heading,{as:"h4",size:2,html:s,className:"product-hero__subtitle product-hero__subtitle--desktop laptop:mt-[12px] laptop:block desktop:mt-[16px] mt-[4px] hidden"}),(0,o.jsx)(a.Text,{as:"p",size:2,html:s,className:"product-hero__subtitle product-hero__subtitle--mobile laptop:mt-[12px] laptop:hidden desktop:mt-[16px] mt-[4px] block"})]}),m&&(0,o.jsx)("a",{href:_,className:"product-hero__cta-link",children:(0,o.jsx)(a.Button,{className:"product-hero__cta-button w-fit",children:m})})]}),(0,o.jsx)(a.Picture,{className:"product-hero__image tablet:aspect-[824/640] tablet:basis-[58%] laptop:basis-[64%] rounded-box aspect-[358/360] shrink",source:`${b?.url}, ${x?.url} 768`,imgClassName:"h-full object-cover"})]})});n.displayName="ProductHero";var E=(0,h.withLayout)(n);
1
+ "use strict";"use client";var w=Object.create;var l=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var L=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var E=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},f=(t,e,r,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of R(e))!D.call(t,a)&&a!==r&&l(t,a,{get:()=>e[a],enumerable:!(p=y(e,a))||p.enumerable});return t};var z=(t,e,r)=>(r=t!=null?w(L(t)):{},f(e||!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),B=t=>f(l({},"__esModule",{value:!0}),t);var j={};E(j,{default:()=>M});module.exports=B(j);var o=require("react/jsx-runtime"),i=z(require("react")),s=require("../../components/index.js"),h=require("../../helpers/utils.js"),x=require("../../shared/Styles.js"),_=require("../../hooks/useExposure.js"),k=require("../../hooks/useTracking.js"),N=require("../../shared/trackUrlRef.js"),g=require("../../shared/track.js");const u="image",d="product_hero",b=i.default.forwardRef(({data:t,className:e},r)=>{const{title:p,subtitle:a,ctaText:c,poster:v,mobPoster:H,ctaLink:m,theme:P="light"}=t,n=(0,i.useRef)(null),{buildRef:T}=(0,k.useTracking)();return(0,_.useExposure)(n,{componentType:u,componentName:d,componentTitle:p,componentDescription:a}),(0,i.useImperativeHandle)(r,()=>n.current),(0,o.jsxs)("section",{ref:n,"data-ui-component-id":"ProductHero",className:(0,h.cn)("product-hero text-info-primary tablet:flex-row tablet:gap-[16px] lg-desktop:gap-[64px] flex w-full flex-col items-center justify-between gap-[32px]",{"aiui-dark":P==="dark"},e),children:[(0,o.jsxs)("div",{className:"product-hero__content tablet:basis-[42%] laptop:basis-[36%] flex w-full flex-col items-start gap-[24px]",children:[(0,o.jsxs)("div",{className:"product-hero__text",children:[(0,o.jsx)(s.Heading,{as:"h3",size:4,html:p,className:"product-hero__title"}),(0,o.jsx)(s.Heading,{as:"h4",size:2,html:a,className:"product-hero__subtitle product-hero__subtitle--desktop laptop:mt-[12px] laptop:block desktop:mt-[16px] mt-[4px] hidden"}),(0,o.jsx)(s.Text,{as:"p",size:2,html:a,className:"product-hero__subtitle product-hero__subtitle--mobile laptop:mt-[12px] laptop:hidden desktop:mt-[16px] mt-[4px] block"})]}),c&&(0,o.jsx)("a",{href:m?(0,N.trackUrlRef)(m,T(u,d)):void 0,className:"product-hero__cta-link",...(0,g.buildClickTrackingProps)({interactive:!!m,componentType:u,componentName:d,title:p,description:a,buttonName:c}),children:(0,o.jsx)(s.Button,{className:"product-hero__cta-button w-fit",children:c})})]}),(0,o.jsx)(s.Picture,{className:"product-hero__image tablet:aspect-[824/640] tablet:basis-[58%] laptop:basis-[64%] rounded-box aspect-[358/360] shrink",source:`${v?.url}, ${H?.url} 768`,imgClassName:"h-full object-cover"})]})});b.displayName="ProductHero";var M=(0,x.withLayout)(b);
@@ -1 +1 @@
1
- "use strict";"use client";var G=Object.create;var E=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var $=Object.getPrototypeOf,q=Object.prototype.hasOwnProperty;var O=(n,l)=>{for(var c in l)E(n,c,{get:l[c],enumerable:!0})},M=(n,l,c,h)=>{if(l&&typeof l=="object"||typeof l=="function")for(let p of _(l))!q.call(n,p)&&p!==c&&E(n,p,{get:()=>l[p],enumerable:!(h=V(l,p))||h.enumerable});return n};var W=(n,l,c)=>(c=n!=null?G($(n)):{},M(l||!n||!n.__esModule?E(c,"default",{value:n,enumerable:!0}):c,n)),J=n=>M(E({},"__esModule",{value:!0}),n);var Z={};O(Z,{default:()=>X});module.exports=J(Z);var e=require("react/jsx-runtime"),r=require("react"),S=require("../../helpers/utils.js"),H=require("../../shared/Styles.js"),u=require("../../components/index.js"),I=require("../../hooks/useExposure.js"),L=W(require("@radix-ui/react-popover"));const K="navigation",Q="product_nav",P=n=>n.anchorId??n.id??"",U=n=>(0,e.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:(0,e.jsx)("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),D=(0,r.forwardRef)(({className:n="",data:l,id:c,onAnchorClick:h,scrollOffsetExtra:p=0},B)=>{const{tabLinks:k=[],anchorList:a=[],textLink:m,buyBtn:f,theme:z="light"}=l||{},[j,b]=(0,r.useState)(""),x=(0,r.useRef)(null),y=(0,r.useRef)(!1),g=(0,r.useRef)(""),w=(0,r.useRef)(null),R=(0,r.useRef)(new Map);(0,r.useImperativeHandle)(B,()=>x.current),(0,I.useExposure)(x,{componentType:K,componentName:Q});const T=(0,r.useCallback)(()=>{if(a.length===0)return;const t=window.scrollY;window.scrollTo({top:0,behavior:"instant"}),requestAnimationFrame(()=>{const o=new Map;a.forEach(i=>{const s=P(i),d=document.getElementById(s);if(d){const N=d.getBoundingClientRect();o.set(s,N.top+window.scrollY)}}),R.current=o,window.scrollTo({top:t,behavior:"instant"})})},[a]);(0,r.useEffect)(()=>{if(a.length===0)return;const t=setTimeout(T,100);return()=>clearTimeout(t)},[a,T]),(0,r.useEffect)(()=>{if(a.length===0)return;let t=null;const o=new ResizeObserver(()=>{t&&clearTimeout(t),t=setTimeout(T,150)});return o.observe(document.body),()=>{o.disconnect(),t&&clearTimeout(t)}},[a,T]),(0,r.useEffect)(()=>{if(a.length===0)return;const t=()=>{if(y.current){w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{y.current=!1,g.current&&(b(g.current),g.current="")},100);return}const i=x.current?.offsetHeight||0,s=window.scrollY+i+p+10;let d="";const N=R.current;for(let v=a.length-1;v>=0;v--){const F=a[v],A=P(F),C=N.get(A);if(C!==void 0&&s>=C){d=A;break}}if(!d&&a.length>0){const v=N.get(P(a[0]));v!==void 0&&s<v&&(d="")}b(d)},o=setTimeout(()=>{t()},200);return window.addEventListener("scroll",t,{passive:!0}),()=>{clearTimeout(o),window.removeEventListener("scroll",t),w.current&&clearTimeout(w.current)}},[a,p]),(0,r.useEffect)(()=>{const t=document.querySelectorAll(".header"),o=[];return t.forEach(i=>{const s=i;o.push({element:s,originalPosition:s.style.position||getComputedStyle(s).position}),s.style.position="relative"}),()=>{o.forEach(({element:i,originalPosition:s})=>{i.style.position=s==="static"?"":s})}},[]);const Y=(t,o)=>{t.preventDefault();const i=R.current.get(o);if(i===void 0){console.warn(`Cached position for "${o}" not found`);return}b(o),g.current=o,y.current=!0;const s=x.current?.offsetHeight||0,d=i-s-p;window.scrollTo({top:d,behavior:"smooth"}),window.history.pushState(null,"",`#${o}`)};return(0,e.jsxs)("div",{id:c,ref:x,className:(0,S.cn)("product-nav text-info-primary bg-container-primary tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden px-4 py-0",{"aiui-dark":z==="dark"},n),children:[(0,e.jsxs)("div",{className:"product-nav-main desktop:flex-row desktop:gap-[48px] flex w-full flex-col justify-start",children:[(0,e.jsxs)("div",{className:"product-nav-header laptop:w-full desktop:w-fit desktop:gap-[24px] desktop:py-0 flex w-full flex-row items-center justify-between gap-[16px] pt-[14px]",children:[(0,e.jsxs)("div",{className:"product-nav-tabs flex flex-row items-center gap-[8px]",children:[k.map((t,o)=>(0,e.jsxs)("div",{className:"product-nav-tab-item flex items-center gap-[8px]",children:[(0,e.jsx)("a",{href:t.link,className:(0,S.cn)("product-nav-tab-link hover:text-brand-color text-nowrap text-[14px] font-bold tracking-[-0.04em]",{"text-[#6D6D6F]":o!==0,"hidden desktop:block":o===1}),children:(0,e.jsx)("span",{children:t.label})}),o!==k.length-1&&(0,e.jsx)("div",{className:"product-nav-tab-divider desktop:inline-block hidden h-[14px] w-px bg-[#E4E5E6]"})]},t.link||o)),k.length>1&&(0,e.jsxs)(L.Root,{children:[(0,e.jsx)(L.Trigger,{asChild:!0,children:(0,e.jsx)("button",{className:"product-nav-dropdown-trigger desktop:hidden -ml-1 inline-block","aria-label":"More products",children:(0,e.jsx)(U,{className:"text-[#1D1D1F]"})})}),(0,e.jsx)(L.Content,{className:"product-nav-dropdown-content rounded-[6px] border border-[#E4E5E6] bg-white p-[6px] px-[8px] py-[4px]",style:{boxShadow:"0px 4px 8px 0px rgba(0,0,0,0.12)"},side:"bottom",align:"end",alignOffset:10,sideOffset:10,children:k.slice(1).map(t=>(0,e.jsx)("a",{href:t.link,className:"product-nav-dropdown-link hover:text-brand-color text-nowrap",children:(0,e.jsx)("span",{children:t.label})},t.link))})]})]}),(0,e.jsxs)("div",{className:"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]",children:[m?.link&&(0,e.jsx)("a",{href:m.link,target:m.target||"_self",className:"product-nav-text-link hover:text-brand-color cursor-pointer",children:(0,e.jsx)(u.Text,{size:2,className:"text-nowrap",children:m.text})}),f?.link&&(0,e.jsx)(u.Button,{as:"a",href:f.link,size:"sm",className:"product-nav-buy-button text-nowrap",children:f.text})]})]}),(0,e.jsx)("div",{className:"product-nav-anchors laptop:w-fit desktop:gap-[24px] desktop:py-[8px] flex w-full items-center gap-[16px] overflow-x-scroll py-[12px] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:a.map((t,o)=>{const i=P(t);return(0,e.jsxs)("a",{href:`#${i}`,className:"product-nav-anchor-link",onClick:s=>{h?(s.preventDefault(),b(i),g.current=i,y.current=!0,h(t,o)):Y(s,i)},children:[(0,e.jsx)(u.Text,{size:2,className:"product-nav-anchor-text text-nowrap",children:t.label}),(0,e.jsx)("div",{className:(0,S.cn)("product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent",{"!bg-brand-0":j===i})})]},i)})})]}),(0,e.jsxs)("div",{className:"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]",children:[m?.link&&(0,e.jsx)(u.Link,{href:m.link,target:m.target||"_self",className:"product-nav-text-link no-underline",children:(0,e.jsx)(u.Text,{size:2,className:"text-nowrap",children:m.text})}),f?.link&&(0,e.jsx)(u.Button,{as:"a",href:f.link,size:"sm",className:"product-nav-buy-button text-nowrap",children:f.text})]})]})});D.displayName="ProductNav";var X=(0,H.withLayout)(D);
1
+ "use strict";"use client";var W=Object.create;var R=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var Q=Object.getPrototypeOf,X=Object.prototype.hasOwnProperty;var Z=(n,l)=>{for(var p in l)R(n,p,{get:l[p],enumerable:!0})},L=(n,l,p,g)=>{if(l&&typeof l=="object"||typeof l=="function")for(let d of K(l))!X.call(n,d)&&d!==p&&R(n,d,{get:()=>l[d],enumerable:!(g=J(l,d))||g.enumerable});return n};var ee=(n,l,p)=>(p=n!=null?W(Q(n)):{},L(l||!n||!n.__esModule?R(p,"default",{value:n,enumerable:!0}):p,n)),te=n=>L(R({},"__esModule",{value:!0}),n);var re={};Z(re,{default:()=>ne});module.exports=te(re);var t=require("react/jsx-runtime"),s=require("react"),C=require("../../helpers/utils.js"),z=require("../../shared/Styles.js"),f=require("../../components/index.js"),j=require("../../hooks/useExposure.js"),Y=require("../../hooks/useTracking.js"),F=require("../../shared/trackUrlRef.js"),y=require("../../shared/track.js"),M=ee(require("@radix-ui/react-popover"));const S="navigation",$="product_nav",A=n=>n.anchorId??n.id??"",oe=n=>(0,t.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:(0,t.jsx)("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),B=(0,s.forwardRef)(({className:n="",data:l,id:p,onAnchorClick:g,scrollOffsetExtra:d=0},G)=>{const{tabLinks:v=[],anchorList:a=[],textLink:c,buyBtn:u,theme:O="light"}=l||{},{buildRef:V}=(0,Y.useTracking)(),x=(e,o,r=1)=>({href:(0,F.trackUrlRef)(e,V(S,$)),"data-headless-type-name":`${S}#${$}`,"data-headless-title-desc-button":`##${(0,y.toPlainTrackingText)(o)}`,"data-headless-nav-position":`${(0,y.toPlainTrackingText)(o)}#${r}`}),[_,T]=(0,s.useState)(""),w=(0,s.useRef)(null),N=(0,s.useRef)(!1),b=(0,s.useRef)(""),k=(0,s.useRef)(null),D=(0,s.useRef)(new Map);(0,s.useImperativeHandle)(G,()=>w.current),(0,j.useExposure)(w,{componentType:S,componentName:$,componentTitle:[...v.map(e=>e.label),...a.map(e=>e.label)].join(" | "),componentDescription:u?.text??c?.text??""});const E=(0,s.useCallback)(()=>{if(a.length===0)return;const e=window.scrollY;window.scrollTo({top:0,behavior:"instant"}),requestAnimationFrame(()=>{const o=new Map;a.forEach(r=>{const i=A(r),m=document.getElementById(i);if(m){const P=m.getBoundingClientRect();o.set(i,P.top+window.scrollY)}}),D.current=o,window.scrollTo({top:e,behavior:"instant"})})},[a]);(0,s.useEffect)(()=>{if(a.length===0)return;const e=setTimeout(E,100);return()=>clearTimeout(e)},[a,E]),(0,s.useEffect)(()=>{if(a.length===0)return;let e=null;const o=new ResizeObserver(()=>{e&&clearTimeout(e),e=setTimeout(E,150)});return o.observe(document.body),()=>{o.disconnect(),e&&clearTimeout(e)}},[a,E]),(0,s.useEffect)(()=>{if(a.length===0)return;const e=()=>{if(N.current){k.current&&clearTimeout(k.current),k.current=setTimeout(()=>{N.current=!1,b.current&&(T(b.current),b.current="")},100);return}const r=w.current?.offsetHeight||0,i=window.scrollY+r+d+10;let m="";const P=D.current;for(let h=a.length-1;h>=0;h--){const U=a[h],H=A(U),I=P.get(H);if(I!==void 0&&i>=I){m=H;break}}if(!m&&a.length>0){const h=P.get(A(a[0]));h!==void 0&&i<h&&(m="")}T(m)},o=setTimeout(()=>{e()},200);return window.addEventListener("scroll",e,{passive:!0}),()=>{clearTimeout(o),window.removeEventListener("scroll",e),k.current&&clearTimeout(k.current)}},[a,d]),(0,s.useEffect)(()=>{const e=document.querySelectorAll(".header"),o=[];return e.forEach(r=>{const i=r;o.push({element:i,originalPosition:i.style.position||getComputedStyle(i).position}),i.style.position="relative"}),()=>{o.forEach(({element:r,originalPosition:i})=>{r.style.position=i==="static"?"":i})}},[]);const q=(e,o)=>{e.preventDefault();const r=D.current.get(o);if(r===void 0){console.warn(`Cached position for "${o}" not found`);return}T(o),b.current=o,N.current=!0;const i=w.current?.offsetHeight||0,m=r-i-d;window.scrollTo({top:m,behavior:"smooth"}),window.history.pushState(null,"",`#${o}`)};return(0,t.jsxs)("div",{id:p,ref:w,className:(0,C.cn)("product-nav text-info-primary bg-container-primary px-grid !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden py-0",{"aiui-dark":O==="dark"},n),children:[(0,t.jsxs)("div",{className:"product-nav-main desktop:flex-row desktop:gap-[48px] flex w-full flex-col justify-start",children:[(0,t.jsxs)("div",{className:"product-nav-header laptop:w-full desktop:w-fit desktop:gap-[24px] desktop:py-0 flex w-full flex-row items-center justify-between gap-[16px] pt-[14px]",children:[(0,t.jsxs)("div",{className:"product-nav-tabs flex flex-row items-center gap-[8px]",children:[v.map((e,o)=>(0,t.jsxs)("div",{className:"product-nav-tab-item flex items-center gap-[8px]",children:[(0,t.jsx)("a",{...x(e.link,e.label,v.indexOf(e)+1),className:(0,C.cn)("product-nav-tab-link hover:text-brand-color text-nowrap text-[14px] font-bold tracking-[-0.04em]",{"text-[#6D6D6F]":o!==0,"hidden desktop:block":o===1}),children:(0,t.jsx)("span",{children:e.label})}),o!==v.length-1&&(0,t.jsx)("div",{className:"product-nav-tab-divider desktop:inline-block hidden h-[14px] w-px bg-[#E4E5E6]"})]},e.link||o)),v.length>1&&(0,t.jsxs)(M.Root,{children:[(0,t.jsx)(M.Trigger,{asChild:!0,children:(0,t.jsx)("button",{className:"product-nav-dropdown-trigger desktop:hidden -ml-1 inline-block","aria-label":"More products",children:(0,t.jsx)(oe,{className:"text-[#1D1D1F]"})})}),(0,t.jsx)(M.Content,{className:"product-nav-dropdown-content rounded-[6px] border border-[#E4E5E6] bg-white p-[6px] px-[8px] py-[4px]",style:{boxShadow:"0px 4px 8px 0px rgba(0,0,0,0.12)"},side:"bottom",align:"end",alignOffset:10,sideOffset:10,children:v.slice(1).map(e=>(0,t.jsx)("a",{...x(e.link,e.label,v.indexOf(e)+1),className:"product-nav-dropdown-link hover:text-brand-color text-nowrap",children:(0,t.jsx)("span",{children:e.label})},e.link))})]})]}),(0,t.jsxs)("div",{className:"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]",children:[c?.link&&(0,t.jsx)("a",{...x(c.link,c.text),target:c.target||"_self",className:"product-nav-text-link hover:text-brand-color cursor-pointer",children:(0,t.jsx)(f.Text,{size:2,className:"text-nowrap",children:c.text})}),u?.link&&(0,t.jsx)(f.Button,{as:"a",...x(u.link,u.text),size:"sm",className:"product-nav-buy-button text-nowrap",children:u.text})]})]}),(0,t.jsx)("div",{className:"product-nav-anchors laptop:w-fit desktop:gap-[24px] desktop:py-[8px] flex w-full items-center gap-[16px] overflow-x-scroll py-[12px] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:a.map((e,o)=>{const r=A(e);return(0,t.jsxs)("a",{href:`#${r}`,className:"product-nav-anchor-link","data-headless-type-name":`${S}#${$}`,"data-headless-title-desc-button":`##${(0,y.toPlainTrackingText)(e.label)}`,"data-headless-nav-position":`${(0,y.toPlainTrackingText)(e.label)}#${o+1}`,onClick:i=>{g?(i.preventDefault(),T(r),b.current=r,N.current=!0,g(e,o)):q(i,r)},children:[(0,t.jsx)(f.Text,{size:2,className:"product-nav-anchor-text text-nowrap",children:e.label}),(0,t.jsx)("div",{className:(0,C.cn)("product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent",{"!bg-brand-0":_===r})})]},r)})})]}),(0,t.jsxs)("div",{className:"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]",children:[c?.link&&(0,t.jsx)(f.Link,{...x(c.link,c.text),target:c.target||"_self",className:"product-nav-text-link no-underline",children:(0,t.jsx)(f.Text,{size:2,className:"text-nowrap",children:c.text})}),u?.link&&(0,t.jsx)(f.Button,{as:"a",...x(u.link,u.text),size:"sm",className:"product-nav-buy-button text-nowrap",children:u.text})]})]})});B.displayName="ProductNav";var ne=(0,z.withLayout)(B);
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { Media, Theme } from '../../types/props.js';
3
+ import type { SerializedEditorState } from '@payloadcms/richtext-lexical/lexical';
3
4
  export interface PromotionalBarSemanticName {
4
5
  root: 'root';
5
6
  content: 'content';
@@ -27,8 +28,8 @@ export interface ResponsiveBackgroundImage {
27
28
  */
28
29
  export interface PromotionalBarData {
29
30
  theme: Theme;
30
- /** 组件内容标题 */
31
- contentTitle?: string;
31
+ /** 组件内容标题(HTML 字符串或 CMS 的 Lexical 富文本) */
32
+ contentTitle?: string | SerializedEditorState;
32
33
  /** 组件内容描述 */
33
34
  contentDesc?: string;
34
35
  /** 按钮文本 */
@@ -1 +1 @@
1
- "use strict";"use client";var N=Object.create;var g=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var L=(t,e)=>{for(var n in e)g(t,n,{get:e[n],enumerable:!0})},h=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of y(e))!F.call(t,r)&&r!==n&&g(t,r,{get:()=>e[r],enumerable:!(s=D(e,r))||s.enumerable});return t};var U=(t,e,n)=>(n=t!=null?N(R(t)):{},h(e||!t||!t.__esModule?g(n,"default",{value:t,enumerable:!0}):n,t)),$=t=>h(g({},"__esModule",{value:!0}),t);var S={};L(S,{default:()=>z});module.exports=$(S);var i=require("react/jsx-runtime"),b=U(require("react")),m=require("../../helpers/index.js"),u=require("../../components/index.js"),v=require("../../shared/Styles.js"),B=require("../../helpers/index.js"),P=require("../AiuiProvider/index.js"),T=require("../../shared/trackUrlRef.js");const w="image",H="PromotionalBar",I=t=>{if(!t)return;const{mobile:e,tablet:n,laptop:s,desktop:r,lgDesktop:x}=t,o=[],p=M=>M?.url,a=p(x),l=p(r),c=p(s),d=p(n),f=p(e);return a?o.push(a):l?o.push(l):c?o.push(c):d?o.push(d):f&&o.push(f),l&&a&&o.push(`${l} 1920`),c&&(l||a)&&o.push(`${c} 1440`),d&&(c||l||a)&&o.push(`${d} 1024`),f&&(d||c||l||a)&&o.push(`${f} 768`),o.length>0?o.join(", "):void 0},k=b.forwardRef(({classNames:t,data:e,className:n,...s},r)=>{const{locale:x="us",pageHandle:o}=(0,P.useAiuiContext)(),{backgroundImage:p,theme:a="dark"}=e,l=b.useMemo(()=>I(p),[p]);return(0,i.jsx)("div",{ref:r,...s,className:(0,m.cn)("laptop:h-[192px] lg-desktop:h-[240px] h-[240px] text-[#080A0F]",{"text-[#F5F6F7]":a==="dark"},t?.root,n),children:(0,i.jsxs)("div",{className:"promotional-bar-content rounded-card relative h-full overflow-hidden",children:[(0,i.jsxs)("div",{className:(0,m.cn)("laptop:px-8 laptop:justify-center laptop:box-content lg-desktop:max-w-[686px] laptop:max-w-[392px] desktop:max-w-[584px] laptop:py-0 tablet:px-8 laptop:pr-0 relative z-20 flex h-full flex-col p-4",t?.content),children:[e.contentTitle&&(0,i.jsx)(u.Heading,{className:(0,m.cn)("line-clamp-2 ",t?.title),html:e.contentTitle,size:3}),e.contentDesc&&(0,i.jsx)("p",{className:(0,m.cn)("laptop:text-[16px] laptop:mt-2 lg-desktop:text-[18px] mt-1 line-clamp-2 text-[14px] font-bold leading-[1.4] ",t?.description),dangerouslySetInnerHTML:{__html:e.contentDesc}}),(0,i.jsx)("div",{className:"laptop:mt-4 mt-2",children:e.buttonText&&(0,i.jsx)(u.Button,{as:"a",variant:"link",className:(0,m.cn)("!p-0 text-[#F5F6F7]",{"text-[#080A0F]":a==="light"},t?.button),href:(0,T.trackUrlRef)((0,B.getLocalizedPath)(e.buttonLink||"",x),`${o}_${w}_${H}`),iconClassName:"size-4",children:e.buttonText})})]}),(0,i.jsx)(u.Picture,{source:l,className:"absolute inset-0 z-10 ",imgClassName:"h-full object-cover transition-transform duration-300 ease-in-out hover:scale-[1.05]"})]})})});k.displayName="PromotionalBar";var z=(0,v.withLayout)(k);
1
+ "use strict";"use client";var S=Object.create;var x=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var I=(e,t)=>{for(var n in t)x(e,n,{get:t[n],enumerable:!0})},v=(e,t,n,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of H(t))!E.call(e,l)&&l!==n&&x(e,l,{get:()=>t[l],enumerable:!(c=F(t,l))||c.enumerable});return e};var U=(e,t,n)=>(n=e!=null?S(z(e)):{},v(t||!e||!e.__esModule?x(n,"default",{value:e,enumerable:!0}):n,e)),w=e=>v(x({},"__esModule",{value:!0}),e);var $={};I($,{default:()=>C});module.exports=w($);var r=require("react/jsx-runtime"),g=U(require("react")),m=require("../../helpers/index.js"),u=require("../../components/index.js"),B=require("../../shared/Styles.js"),D=require("../../helpers/index.js"),P=require("../AiuiProvider/index.js"),M=require("../../shared/trackUrlRef.js"),N=require("../../shared/track.js"),R=require("../../hooks/useExposure.js"),y=require("../../hooks/useTracking.js");const b="image",k="PromotionalBar",A=e=>{if(!e)return;const{mobile:t,tablet:n,laptop:c,desktop:l,lgDesktop:h}=e,o=[],p=L=>L?.url,a=p(h),s=p(l),i=p(c),d=p(n),f=p(t);return a?o.push(a):s?o.push(s):i?o.push(i):d?o.push(d):f&&o.push(f),s&&a&&o.push(`${s} 1920`),i&&(s||a)&&o.push(`${i} 1440`),d&&(i||s||a)&&o.push(`${d} 1024`),f&&(d||i||s||a)&&o.push(`${f} 768`),o.length>0?o.join(", "):void 0},T=g.forwardRef(({classNames:e,data:t,className:n,...c},l)=>{const{locale:h="us"}=(0,P.useAiuiContext)(),{buildRef:o}=(0,y.useTracking)(),{backgroundImage:p,theme:a="dark"}=t,s=g.useMemo(()=>A(p),[p]),i=g.useRef(null);return g.useImperativeHandle(l,()=>i.current),(0,R.useExposure)(i,{componentType:b,componentName:k,componentTitle:t.contentTitle,componentDescription:t.contentDesc}),(0,r.jsx)("div",{ref:i,...c,className:(0,m.cn)("laptop:h-[192px] lg-desktop:h-[240px] h-[240px] text-[#080A0F]",{"text-[#F5F6F7]":a==="dark"},e?.root,n),children:(0,r.jsxs)("div",{className:"promotional-bar-content rounded-card relative h-full overflow-hidden",children:[(0,r.jsxs)("div",{className:(0,m.cn)("laptop:px-8 laptop:justify-center laptop:box-content lg-desktop:max-w-[686px] laptop:max-w-[392px] desktop:max-w-[584px] laptop:py-0 tablet:px-8 laptop:pr-0 relative z-20 flex h-full flex-col p-4",e?.content),children:[t.contentTitle&&(0,r.jsx)(u.Heading,{className:(0,m.cn)("line-clamp-2 ",e?.title),html:t.contentTitle,size:3}),t.contentDesc&&(0,r.jsx)("p",{className:(0,m.cn)("laptop:text-[16px] laptop:mt-2 lg-desktop:text-[18px] mt-1 line-clamp-2 text-[14px] font-bold leading-[1.4] ",e?.description),dangerouslySetInnerHTML:{__html:t.contentDesc}}),(0,r.jsx)("div",{className:"laptop:mt-4 mt-2",children:t.buttonText&&(0,r.jsx)(u.Button,{as:"a",variant:"link",className:(0,m.cn)("!p-0 text-[#F5F6F7]",{"text-[#080A0F]":a==="light"},e?.button),href:(0,M.trackUrlRef)((0,D.getLocalizedPath)(t.buttonLink||"",h),o(b,k)),...(0,N.buildClickTrackingProps)({interactive:!!t.buttonLink,componentType:b,componentName:k,title:t.contentTitle,description:t.contentDesc,buttonName:t.buttonText}),iconClassName:"size-4",children:t.buttonText})})]}),(0,r.jsx)(u.Picture,{source:s,className:"absolute inset-0 z-10 ",imgClassName:"h-full object-cover transition-transform duration-300 ease-in-out hover:scale-[1.05]"})]})})});T.displayName="PromotionalBar";var C=(0,B.withLayout)(T);
@@ -1 +1 @@
1
- "use strict";"use client";var j=Object.create;var g=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var H=(t,r)=>{for(var e in r)g(t,e,{get:r[e],enumerable:!0})},b=(t,r,e,m)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of O(r))!A.call(t,l)&&l!==e&&g(t,l,{get:()=>r[l],enumerable:!(m=D(r,l))||m.enumerable});return t};var I=(t,r,e)=>(e=t!=null?j(q(t)):{},b(r||!t||!t.__esModule?g(e,"default",{value:t,enumerable:!0}):e,t)),R=t=>b(g({},"__esModule",{value:!0}),t);var U={};H(U,{SceneProductCard:()=>x});module.exports=R(U);var a=require("react/jsx-runtime"),M=I(require("react")),i=require("../../helpers/index.js"),s=require("../../components/index.js"),k=require("./context.js"),C=require("../../shared/LocalizedLink.js");const x=M.forwardRef(({className:t,classNames:r,product:e,selected:m,onSelectChange:l,showTags:P,showOriginalPrice:u,onProductImageClick:N,...S},v)=>{const c=(0,k.useSceneShelfContext)(),w=P??c?.showTags??!0,y=u??c?.showOriginalPrice??!0,o=r??c?.classNames??{},p=m??(c?c.selectedIds.has(e.id):!1),h=l??c?.onSelectChange,f=N??c?.onProductImageClick,d=e.soldOut??!1,z=n=>{d||typeof n=="boolean"&&h?.(n,e)},T=()=>{d||h?.(!p,e)};return(0,a.jsxs)("div",{ref:v,className:(0,i.cn)("scene-shelf-product-card","lg-desktop:gap-2 lg-desktop:h-[362px] lg-desktop:px-6 lg-desktop:pb-6 lg-desktop:pt-4 rounded-box box-border flex h-[284px] flex-col justify-between gap-2 border-2 border-solid p-4 pb-6 transition-colors",d?"cursor-not-allowed opacity-50":"cursor-pointer",p?(0,i.cn)("border-brand-0 bg-container-secondary-0",o?.cardSelected):(0,i.cn)("border-lines bg-container-primary",!d&&"hover:bg-container-secondary",o?.card),t),onClick:T,"data-headless-type-name":"SceneShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name??e.title}##Select`,"data-headless-sku":e.id,...S,children:[(0,a.jsx)("div",{className:(0,i.cn)("scene-shelf-product-card-tags","lg-desktop:left-6 lg-desktop:top-6 flex max-h-[24px] min-h-[24px] flex-wrap gap-1 overflow-visible pr-9",o?.tags),children:w&&e.tags?.map((n,L)=>(0,a.jsx)(s.Badge,{variant:n.variant||"outline",size:"sm",className:"scene-shelf-product-card-badge",children:n.label},L))}),(0,a.jsx)(s.Checkbox,{checked:p,disabled:d,onCheckedChange:z,onClick:n=>n.stopPropagation(),className:(0,i.cn)("scene-shelf-product-card-checkbox","text-brand-0 border-brand-0 lg-desktop:right-6 lg-desktop:top-6 absolute right-4 top-4 size-5 shrink-0",o?.checkbox)}),(0,a.jsx)("div",{className:(0,i.cn)("flex flex-1 grow-0 items-center justify-center",o?.image),children:f?(0,a.jsx)("a",{onClick:()=>f(e),role:"button",children:(0,a.jsx)(s.Picture,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):e?.href?(0,a.jsx)(C.LocalizedLink,{href:e.href,children:(0,a.jsx)(s.Picture,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):(0,a.jsx)(s.Picture,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}),(0,a.jsxs)("div",{className:"flex grow flex-col justify-start gap-4",children:[(0,a.jsx)(s.Heading,{as:"h3",size:2,className:(0,i.cn)("text-info-primary line-clamp-2",o?.title),html:e.custom_name??e.title}),(0,a.jsxs)("div",{className:(0,i.cn)("flex flex-wrap items-center gap-1",o?.priceWrapper),children:[(0,a.jsx)(s.Text,{as:"span",size:2,className:(0,i.cn)("text-info-primary lg-desktop:text-[24px] whitespace-nowrap text-[20px]",o?.currentPrice),children:e.currentPrice.formatted}),y&&e.originalPrice&&e.originalPrice.value>e.currentPrice.value&&(0,a.jsx)(s.Text,{as:"span",size:2,className:(0,i.cn)("text-info-quaternary lg-desktop:text-[24px] whitespace-nowrap text-[20px] line-through",o?.originalPrice),children:e.originalPrice.formatted})]}),e?.priceLabel&&(0,a.jsx)(s.Text,{size:4,className:(0,i.cn)("text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] mt-2 text-[14px]",o?.productPriceLabel),children:e.priceLabel})]})]})});x.displayName="SceneShelf.ProductCard";
1
+ "use strict";"use client";var _=Object.create;var p=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var M=(t,i)=>{for(var e in i)p(t,e,{get:i[e],enumerable:!0})},P=(t,i,e,m)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of A(i))!I.call(t,r)&&r!==e&&p(t,r,{get:()=>i[r],enumerable:!(m=q(i,r))||m.enumerable});return t};var B=(t,i,e)=>(e=t!=null?_(H(t)):{},P(i||!t||!t.__esModule?p(e,"default",{value:t,enumerable:!0}):e,t)),E=t=>P(p({},"__esModule",{value:!0}),t);var F={};M(F,{SceneProductCard:()=>b});module.exports=E(F);var a=require("react/jsx-runtime"),W=B(require("react")),l=require("../../helpers/index.js"),s=require("../../components/index.js"),u=require("./context.js"),N=require("../../shared/LocalizedLink.js"),v=require("../../shared/trackUrlRef.js"),f=require("../../shared/track.js"),S=require("../../hooks/useTracking.js");const h="shelf",x="scene_shelf",b=W.forwardRef(({className:t,classNames:i,product:e,selected:m,onSelectChange:r,showTags:w,showOriginalPrice:y,onProductImageClick:T,...z},L)=>{const n=(0,u.useSceneShelfContext)(),{buildRef:$}=(0,S.useTracking)(),j=w??n?.showTags??!0,D=y??n?.showOriginalPrice??!0,o=i??n?.classNames??{},g=m??(n?n.selectedIds.has(e.id):!1),k=r??n?.onSelectChange,C=T??n?.onProductImageClick,d=e.soldOut??!1,O=c=>{d||typeof c=="boolean"&&k?.(c,e)},R=()=>{d||k?.(!g,e)};return(0,a.jsxs)("div",{ref:L,className:(0,l.cn)("scene-shelf-product-card","lg-desktop:gap-2 lg-desktop:h-[362px] lg-desktop:px-6 lg-desktop:pb-6 lg-desktop:pt-4 rounded-box box-border flex h-[284px] flex-col justify-between gap-2 border-2 border-solid p-4 pb-6 transition-colors",d?"cursor-not-allowed opacity-50":"cursor-pointer",g?(0,l.cn)("border-brand-0 bg-container-secondary-0",o?.cardSelected):(0,l.cn)("border-lines bg-container-primary",!d&&"hover:bg-container-secondary",o?.card),t),onClick:R,"data-headless-type-name":`${h}#${x}`,"data-headless-title-desc-button":`${(0,f.toPlainTrackingText)(e.custom_name??e.title)}##${g?"Unselect":"Select"}`,"data-headless-sku":e.sku??e.id,...z,children:[(0,a.jsx)("div",{className:(0,l.cn)("scene-shelf-product-card-tags","lg-desktop:left-6 lg-desktop:top-6 flex max-h-[24px] min-h-[24px] flex-wrap gap-1 overflow-visible pr-9",o?.tags),children:j&&e.tags?.map((c,U)=>(0,a.jsx)(s.Badge,{variant:c.variant||"outline",size:"sm",className:"scene-shelf-product-card-badge",children:c.label},U))}),(0,a.jsx)(s.Checkbox,{checked:g,disabled:d,onCheckedChange:O,onClick:c=>c.stopPropagation(),className:(0,l.cn)("scene-shelf-product-card-checkbox","text-brand-0 border-brand-0 lg-desktop:right-6 lg-desktop:top-6 absolute right-4 top-4 size-5 shrink-0",o?.checkbox)}),(0,a.jsx)("div",{className:(0,l.cn)("flex flex-1 grow-0 items-center justify-center",o?.image),children:C?(0,a.jsx)("a",{onClick:()=>C(e),role:"button","data-headless-type-name":`${h}#${x}`,"data-headless-title-desc-button":`${(0,f.toPlainTrackingText)(e.custom_name??e.title)}##image`,"data-headless-sku":e.sku??e.id,children:(0,a.jsx)(s.Picture,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):e?.href?(0,a.jsx)(N.LocalizedLink,{href:(0,v.trackUrlRef)(e.href,$(h,x)),"data-headless-type-name":`${h}#${x}`,"data-headless-title-desc-button":`${(0,f.toPlainTrackingText)(e.custom_name??e.title)}##image`,"data-headless-sku":e.sku??e.id,children:(0,a.jsx)(s.Picture,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):(0,a.jsx)(s.Picture,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}),(0,a.jsxs)("div",{className:"flex grow flex-col justify-start gap-4",children:[(0,a.jsx)(s.Heading,{as:"h3",size:2,className:(0,l.cn)("text-info-primary line-clamp-2",o?.title),html:e.custom_name??e.title}),(0,a.jsxs)("div",{className:(0,l.cn)("flex flex-wrap items-center gap-1",o?.priceWrapper),children:[(0,a.jsx)(s.Text,{as:"span",size:2,className:(0,l.cn)("text-info-primary lg-desktop:text-[24px] whitespace-nowrap text-[20px]",o?.currentPrice),children:e.currentPrice.formatted}),D&&e.originalPrice&&e.originalPrice.value>e.currentPrice.value&&(0,a.jsx)(s.Text,{as:"span",size:2,className:(0,l.cn)("text-info-quaternary lg-desktop:text-[24px] whitespace-nowrap text-[20px] line-through",o?.originalPrice),children:e.originalPrice.formatted})]}),e?.priceLabel&&(0,a.jsx)(s.Text,{size:4,className:(0,l.cn)("text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] mt-2 text-[14px]",o?.productPriceLabel),children:e.priceLabel})]})]})});b.displayName="SceneShelf.ProductCard";
@@ -1 +1 @@
1
- "use strict";"use client";var Y=Object.create;var f=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var ae=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty;var ne=(t,r)=>{for(var n in r)f(t,n,{get:r[n],enumerable:!0})},R=(t,r,n,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of te(r))!re.call(t,l)&&l!==n&&f(t,l,{get:()=>r[l],enumerable:!(p=ee(r,l))||p.enumerable});return t};var oe=(t,r,n)=>(n=t!=null?Y(ae(t)):{},R(r||!t||!t.__esModule?f(n,"default",{value:t,enumerable:!0}):n,t)),se=t=>R(f({},"__esModule",{value:!0}),t);var ie={};ne(ie,{SceneShelfProductsPanel:()=>S});module.exports=se(ie);var e=require("react/jsx-runtime"),c=oe(require("react")),y=require("swiper/react"),P=require("swiper/modules"),o=require("../../helpers/index.js"),s=require("../../components/index.js"),z=require("../SwiperBox/buildSsrSlideCss.js"),H=require("./context.js"),ce=require("swiper/css");const S=c.forwardRef(({title:t,totalPriceLabel:r,totalCurrentPrice:n,totalOriginalPrice:p,primaryButtonText:l,primaryButtonFun:O,secondaryButtonText:V,secondaryButtonFun:_,bundleDiscountLabel:j,className:E,children:I,...$},q)=>{const a=(0,H.useSceneShelfContext)(),i=a?.classNames,T=r??a?.totalPriceLabel??"Total Price:",m=n??a?.totalCurrentPrice,w=p??a?.totalOriginalPrice,N=l??a?.primaryButtonText??"Shop Now",L=O??a?.primaryButtonFun??"buyNow",C=V??a?.secondaryButtonText??"Add to Cart",k=_??a?.secondaryButtonFun??"addCart",x=j??a?.bundleDiscountLabel,u=a?.selectedProducts??[],G=a?.onLearnMore,W=a?.onShopNow,Z=a?.onAddToCart,J=a?.showOriginalPrice??!0,[K,Q]=c.useState(!1),[U,X]=c.useState(!1),v=c.Children.toArray(I),D=v.length,g=c.useMemo(()=>({0:{slidesPerView:1.5,spaceBetween:10},768:{slidesPerView:2.8,spaceBetween:16},1024:{slidesPerView:2.3,spaceBetween:10},1440:{slidesPerView:D<=3?3:3.2,spaceBetween:16}}),[D]),b=`swiper-ssr-${c.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,h=c.useMemo(()=>(0,z.buildSsrSlideCss)(`.${b}`,g),[b,g]),F=async(d,B)=>{if(!d)return;const A=B==="primary"?Q:X;A(!0);try{switch(d){case"buyNow":await W?.(u);break;case"addCart":await Z?.(u);break;case"learnMore":await G?.(u);break;default:break}}finally{A(!1)}},M=d=>d==="learnMore"?!1:u.length===0;return(0,e.jsxs)("div",{ref:q,className:(0,o.cn)("bg-container-primary laptop:p-6 lg-desktop:p-8 flex min-w-0 flex-1 flex-col justify-between overflow-hidden p-4",E,i?.content),...$,children:[t&&(0,e.jsx)(s.Heading,{as:"h2",size:3,className:(0,o.cn)("text-info-primary flex-0 mb-[16px] line-clamp-1 shrink-0",i?.title),html:t}),(0,e.jsxs)("div",{className:(0,o.cn)("lg-desktop:mb-[24px] mb-[16px] flex-1 ",i?.productList),children:[h&&(0,e.jsx)("style",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:h}}),(0,e.jsx)(y.Swiper,{modules:[P.FreeMode,P.Mousewheel],freeMode:!0,mousewheel:{forceToAxis:!0},className:h?b:void 0,breakpoints:g,children:v.map((d,B)=>(0,e.jsx)(y.SwiperSlide,{className:"h-fit shrink-0",children:d},B))})]}),(0,e.jsxs)("div",{className:(0,o.cn)("tablet:items-end tablet:flex-row flex-0 flex flex-col items-start justify-between gap-2",i?.footer),children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsxs)("div",{className:(0,o.cn)("flex flex-wrap items-center gap-1",i?.totalPrice),children:[T&&(0,e.jsx)(s.Text,{as:"span",size:2,className:"text-info-primary lg-desktop:text-[24px] text-[20px]",children:T}),m&&(0,e.jsx)(s.Text,{as:"span",size:2,className:(0,o.cn)("text-info-primary lg-desktop:text-[24px] text-[20px]",i?.currentTotalPrice),children:m.formatted}),J&&w&&m&&w.value>m.value&&(0,e.jsx)(s.Text,{as:"span",size:2,className:(0,o.cn)("text-info-quaternary lg-desktop:text-[24px] text-[20px] line-through",i?.originalTotalPrice),children:w.formatted})]}),x&&(0,e.jsx)(s.Text,{as:"span",size:2,className:(0,o.cn)("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 text-[14px]",i?.bundleDiscountLabel),children:typeof x=="function"?x(u):x})]}),(0,e.jsxs)("div",{className:(0,o.cn)("flex items-stretch gap-3",i?.buttonGroup),children:[C&&(0,e.jsx)(s.Button,{variant:"secondary",className:"min-w-0 whitespace-normal text-center",onClick:()=>F(k,"secondary"),disabled:M(k),loading:U,children:C}),N&&(0,e.jsx)(s.Button,{variant:"primary",className:"min-w-0 whitespace-normal text-center",onClick:()=>F(L,"primary"),disabled:M(L),loading:K,children:N})]})]})]})});S.displayName="SceneShelf.ProductsPanel";
1
+ "use strict";"use client";var ae=Object.create;var y=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var se=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty;var ie=(e,n)=>{for(var o in n)y(e,o,{get:n[o],enumerable:!0})},O=(e,n,o,m)=>{if(n&&typeof n=="object"||typeof n=="function")for(let c of oe(n))!re.call(e,c)&&c!==o&&y(e,c,{get:()=>n[c],enumerable:!(m=ne(n,c))||m.enumerable});return e};var le=(e,n,o)=>(o=e!=null?ae(se(e)):{},O(n||!e||!e.__esModule?y(o,"default",{value:e,enumerable:!0}):o,e)),ce=e=>O(y({},"__esModule",{value:!0}),e);var pe={};ie(pe,{SceneShelfProductsPanel:()=>L});module.exports=ce(pe);var t=require("react/jsx-runtime"),u=le(require("react")),g=require("swiper/react"),h=require("swiper/modules"),s=require("../../helpers/index.js"),r=require("../../components/index.js"),I=require("../SwiperBox/buildSsrSlideCss.js"),w=require("./context.js"),P=require("../../shared/track.js"),fe=require("swiper/css");const de="shelf",ue="scene_shelf",L=u.forwardRef(({title:e,totalPriceLabel:n,totalCurrentPrice:o,totalOriginalPrice:m,primaryButtonText:c,primaryButtonFun:V,secondaryButtonText:_,secondaryButtonFun:j,bundleDiscountLabel:E,className:q,children:G,...W},Z)=>{const a=(0,w.useSceneShelfContext)(),v=(0,w.useSceneShelfRootInfo)(),i=a?.classNames,C=n??a?.totalPriceLabel??"Total Price:",f=o??a?.totalCurrentPrice,b=m??a?.totalOriginalPrice,T=c??a?.primaryButtonText??"Shop Now",D=V??a?.primaryButtonFun??"buyNow",B=_??a?.secondaryButtonText??"Add to Cart",F=j??a?.secondaryButtonFun??"addCart",x=E??a?.bundleDiscountLabel,d=a?.selectedProducts??[],J=a?.onLearnMore,K=a?.onShopNow,Q=a?.onAddToCart,U=a?.showOriginalPrice??!0,[X,Y]=u.useState(!1),[ee,te]=u.useState(!1),M=u.Children.toArray(G),A=M.length,S=u.useMemo(()=>({0:{slidesPerView:1.5,spaceBetween:10},768:{slidesPerView:2.8,spaceBetween:16},1024:{slidesPerView:2.3,spaceBetween:10},1440:{slidesPerView:A<=3?3:3.2,spaceBetween:16}}),[A]),N=`swiper-ssr-${u.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,k=u.useMemo(()=>(0,I.buildSsrSlideCss)(`.${N}`,S),[N,S]),R=async(l,p)=>{if(!l)return;const H=p==="primary"?Y:te;H(!0);try{switch(l){case"buyNow":await K?.(d);break;case"addCart":await Q?.(d);break;case"learnMore":await J?.(d);break;default:break}}finally{H(!1)}},$=l=>({"data-headless-type-name":`${de}#${ue}`,"data-headless-title-desc-button":`${(0,P.toPlainTrackingText)(v?.title??e)}#${(0,P.toPlainTrackingText)(v?.subtitle)}#${(0,P.toPlainTrackingText)(l)}`,"data-headless-nav-position":"#1",...d.length>0?{"data-headless-sku":d.map(p=>p.sku??p.id).join(",")}:{}}),z=l=>l==="learnMore"?!1:d.length===0;return(0,t.jsxs)("div",{ref:Z,className:(0,s.cn)("bg-container-primary laptop:p-6 lg-desktop:p-8 flex min-w-0 flex-1 flex-col justify-between overflow-hidden p-4",q,i?.content),...W,children:[e&&(0,t.jsx)(r.Heading,{as:"h2",size:3,className:(0,s.cn)("text-info-primary flex-0 mb-[16px] line-clamp-1 shrink-0",i?.title),html:e}),(0,t.jsxs)("div",{className:(0,s.cn)("lg-desktop:mb-[24px] mb-[16px] flex-1 ",i?.productList),children:[k&&(0,t.jsx)("style",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:k}}),(0,t.jsx)(g.Swiper,{modules:[h.FreeMode,h.Mousewheel],freeMode:!0,mousewheel:{forceToAxis:!0},className:k?N:void 0,breakpoints:S,children:M.map((l,p)=>(0,t.jsx)(g.SwiperSlide,{className:"h-fit shrink-0",children:l},p))})]}),(0,t.jsxs)("div",{className:(0,s.cn)("tablet:items-end tablet:flex-row flex-0 flex flex-col items-start justify-between gap-2",i?.footer),children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)("div",{className:(0,s.cn)("flex flex-wrap items-center gap-1",i?.totalPrice),children:[C&&(0,t.jsx)(r.Text,{as:"span",size:2,className:"text-info-primary lg-desktop:text-[24px] text-[20px]",children:C}),f&&(0,t.jsx)(r.Text,{as:"span",size:2,className:(0,s.cn)("text-info-primary lg-desktop:text-[24px] text-[20px]",i?.currentTotalPrice),children:f.formatted}),U&&b&&f&&b.value>f.value&&(0,t.jsx)(r.Text,{as:"span",size:2,className:(0,s.cn)("text-info-quaternary lg-desktop:text-[24px] text-[20px] line-through",i?.originalTotalPrice),children:b.formatted})]}),x&&(0,t.jsx)(r.Text,{as:"span",size:2,className:(0,s.cn)("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 text-[14px]",i?.bundleDiscountLabel),children:typeof x=="function"?x(d):x})]}),(0,t.jsxs)("div",{className:(0,s.cn)("flex items-stretch gap-3",i?.buttonGroup),children:[B&&(0,t.jsx)(r.Button,{variant:"secondary",className:"min-w-0 whitespace-normal text-center",onClick:()=>R(F,"secondary"),...$(B),disabled:z(F),loading:ee,children:B}),T&&(0,t.jsx)(r.Button,{variant:"primary",className:"min-w-0 whitespace-normal text-center",onClick:()=>R(D,"primary"),...$(T),disabled:z(D),loading:X,children:T})]})]})]})});L.displayName="SceneShelf.ProductsPanel";
@@ -1 +1 @@
1
- "use strict";"use client";var h=Object.create;var n=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var R=Object.getOwnPropertyNames;var v=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var y=(e,t)=>{for(var i in t)n(e,i,{get:t[i],enumerable:!0})},s=(e,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of R(t))!g.call(e,a)&&a!==i&&n(e,a,{get:()=>t[a],enumerable:!(r=S(t,a))||r.enumerable});return e};var N=(e,t,i)=>(i=e!=null?h(v(e)):{},s(t||!e||!e.__esModule?n(i,"default",{value:e,enumerable:!0}):i,e)),x=e=>s(n({},"__esModule",{value:!0}),e);var H={};y(H,{SceneShelfRoot:()=>l});module.exports=x(H);var o=require("react/jsx-runtime"),u=N(require("react")),m=require("../../helpers/index.js"),c=require("../../components/index.js");const l=u.forwardRef(({title:e,subtitle:t,theme:i="light",classNames:r,className:a,children:d,...f},p)=>(0,o.jsxs)("div",{ref:p,className:(0,m.cn)("text-info-primary w-full",{"aiui-dark":i==="dark"},a,r?.root),...f,children:[(e||t)&&(0,o.jsxs)("div",{className:(0,m.cn)("mb-6",r?.header),children:[e&&(0,o.jsx)(c.Heading,{as:"h2",size:4,className:(0,m.cn)("text-info-primary mb-2",r?.title),html:e}),t&&(0,o.jsx)(c.Text,{as:"p",size:3,className:(0,m.cn)("",r?.subtitle),html:t})]}),(0,o.jsx)("div",{className:(0,m.cn)("space-y-6",r?.sceneList),children:d})]}));l.displayName="SceneShelf.Root";
1
+ "use strict";"use client";var x=Object.create;var a=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var g=(e,o)=>{for(var t in o)a(e,t,{get:o[t],enumerable:!0})},p=(e,o,t,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of y(o))!N.call(e,i)&&i!==t&&a(e,i,{get:()=>o[i],enumerable:!(n=T(o,i))||n.enumerable});return e};var L=(e,o,t)=>(t=e!=null?x(H(e)):{},p(o||!e||!e.__esModule?a(t,"default",{value:e,enumerable:!0}):t,e)),M=e=>p(a({},"__esModule",{value:!0}),e);var P={};g(P,{SceneShelfRoot:()=>l});module.exports=M(P);var r=require("react/jsx-runtime"),c=L(require("react")),m=require("../../helpers/index.js"),s=require("../../components/index.js"),d=require("../../hooks/useExposure.js"),h=require("./context.js");const D="shelf",E="scene_shelf",l=c.forwardRef(({title:e,subtitle:o,theme:t="light",classNames:n,className:i,children:S,...v},R)=>{const f=c.useRef(null);c.useImperativeHandle(R,()=>f.current),(0,d.useExposure)(f,{componentType:D,componentName:E,componentTitle:e,componentDescription:o});const u=c.useMemo(()=>({title:e,subtitle:o}),[e,o]);return(0,r.jsx)(h.SceneShelfRootInfoContext.Provider,{value:u,children:(0,r.jsxs)("div",{ref:f,className:(0,m.cn)("text-info-primary w-full",{"aiui-dark":t==="dark"},i,n?.root),...v,children:[(e||o)&&(0,r.jsxs)("div",{className:(0,m.cn)("mb-6",n?.header),children:[e&&(0,r.jsx)(s.Heading,{as:"h2",size:4,className:(0,m.cn)("text-info-primary mb-2",n?.title),html:e}),o&&(0,r.jsx)(s.Text,{as:"p",size:3,className:(0,m.cn)("",n?.subtitle),html:o})]}),(0,r.jsx)("div",{className:(0,m.cn)("space-y-6",n?.sceneList),children:S})]})})});l.displayName="SceneShelf.Root";
@@ -48,4 +48,14 @@ declare const SceneShelfContext: React.Context<SceneShelfContextValue | null>;
48
48
  * @returns Context 值,如果在 Root 外使用则返回 null
49
49
  */
50
50
  export declare function useSceneShelfContext(): SceneShelfContextValue | null;
51
- export { SceneShelfContext };
51
+ /**
52
+ * SceneShelf Root 级信息,用于让深层按钮的点击埋点与 Root 的曝光保持一致
53
+ * (Root 位于 Scene Context 外层,ProductsPanel 无法直接读到 Root 的标题)
54
+ */
55
+ export interface SceneShelfRootInfo {
56
+ title?: string;
57
+ subtitle?: string;
58
+ }
59
+ declare const SceneShelfRootInfoContext: React.Context<SceneShelfRootInfo | null>;
60
+ export declare function useSceneShelfRootInfo(): SceneShelfRootInfo | null;
61
+ export { SceneShelfContext, SceneShelfRootInfoContext };
@@ -1 +1 @@
1
- "use strict";"use client";var u=Object.create;var n=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty;var C=(e,t)=>{for(var o in t)n(e,o,{get:t[o],enumerable:!0})},d=(e,t,o,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of l(t))!S.call(e,r)&&r!==o&&n(e,r,{get:()=>t[r],enumerable:!(c=s(t,r))||c.enumerable});return e};var m=(e,t,o)=>(o=e!=null?u(P(e)):{},d(t||!e||!e.__esModule?n(o,"default",{value:e,enumerable:!0}):o,e)),p=e=>d(n({},"__esModule",{value:!0}),e);var f={};C(f,{SceneShelfContext:()=>a,useSceneShelfContext:()=>D});module.exports=p(f);var i=m(require("react"));const a=i.createContext(null);function D(){return i.useContext(a)}
1
+ "use strict";"use client";var l=Object.create;var r=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty;var C=(e,t)=>{for(var o in t)r(e,o,{get:t[o],enumerable:!0})},u=(e,t,o,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of S(t))!f.call(e,n)&&n!==o&&r(e,n,{get:()=>t[n],enumerable:!(d=s(t,n))||d.enumerable});return e};var p=(e,t,o)=>(o=e!=null?l(P(e)):{},u(t||!e||!e.__esModule?r(o,"default",{value:e,enumerable:!0}):o,e)),m=e=>u(r({},"__esModule",{value:!0}),e);var g={};C(g,{SceneShelfContext:()=>a,SceneShelfRootInfoContext:()=>i,useSceneShelfContext:()=>x,useSceneShelfRootInfo:()=>h});module.exports=m(g);var c=p(require("react"));const a=c.createContext(null);function x(){return c.useContext(a)}const i=c.createContext(null);function h(){return c.useContext(i)}
@@ -34,6 +34,11 @@ export interface PriceData {
34
34
  export interface SceneProductCardData {
35
35
  /** 产品唯一标识 */
36
36
  id: string;
37
+ /**
38
+ * 产品 SKU,用于埋点 data-headless-sku。
39
+ * 未传时回退到 id(兼容旧数据),但 id 不一定是 SKU,建议由数据层显式传入
40
+ */
41
+ sku?: string;
37
42
  /** 产品名称 */
38
43
  title: string;
39
44
  /** 自定义产品名称 */
@@ -1 +1 @@
1
- "use strict";var B=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var W=Object.prototype.hasOwnProperty;var F=(t,l)=>{for(var i in l)B(t,i,{get:l[i],enumerable:!0})},U=(t,l,i,d)=>{if(l&&typeof l=="object"||typeof l=="function")for(let p of K(l))!W.call(t,p)&&p!==i&&B(t,p,{get:()=>l[p],enumerable:!(d=G(l,p))||d.enumerable});return t};var H=t=>U(B({},"__esModule",{value:!0}),t);var Y={};F(Y,{default:()=>X});module.exports=H(Y);var e=require("react/jsx-runtime"),a=require("../../components/index.js"),j=require("../HeaderNavigation/icons/index.js"),c=require("react"),n=require("../../helpers/utils.js"),S=require("../AiuiProvider/index.js"),R=require("../ShelfDisplay/shelfDisplay.js"),b=require("./types.js"),T=require("../../helpers/utils.js");const O=({product:t,onSecondaryButton:l,onPrimaryButton:i,searchValue:d,variantData:p,shopNowLoadingProductId:k,badgeVariant:x})=>{const o=(0,c.useMemo)(()=>p||t?.variants?.[0],[t,p]),{locale:v="us",copyWriting:u,currencyCode:f}=(0,S.useAiuiContext)(),h=k===t?.id,w=(0,c.useMemo)(()=>(0,T.getLocalizedPath)(`/products/${t?.handle}`,v,`variant=${(0,n.atobID)(o?.id)}&ref=search_result_${d?.toLowerCase()}`),[t?.handle,o?.id,d,v]),_=o?.coupons?.[0],{price:N,basePrice:r}=(0,R.formatVariantPrice)({locale:f==="CAD"?"us":v||"us",amount:_?_.variant_price4wscode:o?.price?.amount??o?.price,baseAmount:_?o?.price?.amount??o?.price:0,currencyCode:t?.price?.currencyCode||"USD"}),C=(0,c.useMemo)(()=>t?.tags?.filter?.(m=>m?.startsWith?.("CLtag"))?.map?.(m=>m?.replace?.("CLtag:",""))?.slice?.(0,2),[t?.tags]);return(0,e.jsx)("div",{className:"rounded-image-text ipc_search_product_item lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] relative h-auto overflow-hidden",children:t?.type==="advertising"&&t?.advertisingLink?(0,e.jsxs)(a.Link,{href:(0,T.getLocalizedPath)(t?.advertisingLink,v),className:"h-full",children:[(0,e.jsx)(a.Picture,{source:`${t?.advertisingBgImg}`,className:"size-full",imgClassName:"size-full object-cover"}),(0,e.jsxs)("div",{className:"desktop:p-6 absolute inset-0 z-[2] p-4 [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[(0,e.jsx)(a.Text,{html:t?.advertisingTitle,className:(0,n.cn)("desktop:text-base text-sm font-bold leading-[1.2]",{"text-white":t?.advertisingTheme==="light","text-info-primary":t?.advertisingTheme==="dark"})}),t?.advertisingSubtitle&&(0,e.jsx)(a.Heading,{size:3,html:t?.advertisingSubtitle,className:(0,n.cn)("laptop:line-clamp-3 mt-2 line-clamp-4 font-bold",{"text-white":t?.advertisingTheme==="light","text-info-primary":t?.advertisingTheme==="dark"})})]})]}):(0,e.jsxs)("a",{href:w,className:"tablet:hover:bg-info-white desktop:p-6 desktop:pt-4 tablet:p-4 flex h-full flex-col bg-[#EAEAEC] px-2 py-4 no-underline duration-300",children:[(0,e.jsx)("div",{className:"ipc_search_product_item_image",children:(0,e.jsx)(a.Picture,{className:"lg-desktop:size-[196px] mx-auto size-[138px]",source:o?.image?.url||t?.images?.[0]?.url,alt:t?.title,imgClassName:"object-cover size-full"})}),(0,e.jsxs)("div",{className:"ipc_search_product_item_content desktop:mt-2 lg-desktop:mt-3 desktop:gap-6 mt-1 flex flex-1 flex-col justify-between gap-4",children:[(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)("div",{className:"lg-desktop:h-[28px] mb-2 flex h-[24px] gap-2",children:C?.map((m,L)=>(0,e.jsx)(a.Badge,{size:"lg",variant:x,children:m},L))}),(0,e.jsx)(a.Text,{className:"lg-desktop:text-2xl tablet:line-clamp-2 line-clamp-3 text-xl font-bold !leading-[1.2]",weight:"bold",html:(0,n.highlightSearchWord)(t?.title||"",d||"")}),(0,e.jsx)(a.Text,{as:"p",className:"lg-desktop:text-[18px] tablet:line-clamp-1 mt-1 line-clamp-2 text-sm font-bold",html:(0,n.highlightSearchWord)(t?.description,d||"")})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-2 flex items-center",children:o?.availableForSale?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"final-price text-info-primary tablet:text-xl lg-desktop:text-2xl text-[18px] font-bold",children:o?.availableForSale&&N||""}),(0,e.jsx)("div",{className:"origin-price tablet:text-xl lg-desktop:text-2xl text-info-secondary ml-1 text-[18px] font-bold line-through",children:o?.availableForSale&&r||""})]}):(0,e.jsx)("div",{className:"text-info-primary tablet:text-xl lg-desktop:text-2xl text-[18px] font-bold",children:u?.soldOutText||"Sold Out"})}),(0,e.jsxs)("div",{className:(0,n.cn)("ipc_search_product_item_button_group","lg-desktop:gap-3 laptop:flex-row flex flex-col items-center gap-2"),children:[u?.learnMoreText&&(0,e.jsx)(a.Button,{variant:"secondary",className:"laptop:w-auto w-full",size:"lg",onClick:m=>{m.preventDefault(),m.stopPropagation(),l?.()},children:u?.learnMoreText}),u?.shopNowText&&(0,e.jsx)(a.Button,{variant:"primary",className:"laptop:w-auto w-full",size:"lg",disabled:!o?.availableForSale,loading:h,onClick:m=>{m.preventDefault(),m.stopPropagation(),i?.()},children:u?.shopNowText})]})]})]})]})})},q=({blog:t,searchValue:l})=>{const{copyWriting:i,locale:d="us"}=(0,S.useAiuiContext)(),p=(0,c.useMemo)(()=>(0,T.getLocalizedPath)(`/blogs/${t?.blog?.handle}/${t?.handle.replace("storefront-","")}`,d),[t,d]);return(0,e.jsx)("div",{className:"ipc_search_blog_item border-b border-[#E4E5E6] py-6",children:(0,e.jsxs)("div",{className:"ipc_search_blog_item_content laptop:flex-row-reverse laptop:gap-8 desktop:gap-16 flex flex-col gap-4",children:[(0,e.jsx)("div",{className:"rounded-image-text laptop:flex-[440] desktop:flex-[540] desktop:h-[280px] h-[240px] overflow-hidden",children:(0,e.jsx)(a.Picture,{source:t?.image?.url,className:"size-full",imgClassName:"size-full object-cover",alt:t?.title})}),(0,e.jsxs)("div",{className:"laptop:flex-[424] desktop:flex-[704] lg-desktop:flex-[1056] flex flex-col justify-center",children:[(0,e.jsx)(a.Heading,{size:3,html:(0,n.highlightSearchWord)(t?.title,l)}),(0,e.jsx)(a.Text,{html:(0,n.highlightSearchWord)(t?.content,l),className:"lg-desktop:text-[18px] desktop:text-[16px] mt-1 line-clamp-2 text-sm font-bold leading-[1.4]"}),(0,e.jsx)("div",{className:"desktop:mt-6 mt-4",children:(0,e.jsx)(a.Button,{as:"a",href:p,variant:"secondary",size:"lg",children:i?.learnMoreText||"Learn More"})})]})]})})},J=({searchValue:t,page:l})=>{const{copyWriting:i,locale:d="us"}=(0,S.useAiuiContext)(),p=(0,c.useMemo)(()=>(0,T.getLocalizedPath)(`/${l?.handle}`,d),[l,d]);return(0,e.jsxs)("div",{className:"ipc_search_page_items border-b border-[#E4E5E6] py-6",children:[(0,e.jsx)(a.Heading,{size:3,html:(0,n.highlightSearchWord)(l?.name,t)}),(0,e.jsx)(a.Text,{as:"p",html:(0,n.highlightSearchWord)(l?.bodySummary||"",t),className:"lg-desktop:text-[18px] desktop:text-[16px] mt-1 text-sm font-bold leading-[1.4]"}),(0,e.jsx)(a.Button,{as:"a",href:p,variant:"secondary",size:"lg",className:"desktop:mt-6 mt-4",children:i?.learnMoreText||"Learn More"})]})},I=({url:t,label:l})=>(0,e.jsxs)("div",{className:"flex flex-col items-center justify-center gap-4",children:[(0,e.jsx)(a.Picture,{source:t,className:"h-[180px] w-[240px]",imgClassName:"object-cover"}),(0,e.jsx)(a.Text,{html:l,className:"desktop:text-[18px] text-sm font-bold leading-[1.4]"})]}),D=({products:t,title:l,buildProps:i,onSecondaryButton:d,onPrimaryButton:p,badgeVariant:k})=>{const{products:x}=i||{};return console.log(x,"buildProducts"),(0,e.jsxs)("div",{className:"ipc_search_recommend_product tablet:pt-[80px] laptop:pt-[96px] desktop:pt-[112px] lg-desktop:pt-[128px] pt-[64px]",children:[(0,e.jsx)(a.Heading,{size:4,weight:"bold",html:l}),(0,e.jsx)("div",{className:" tablet:grid-cols-3 desktop:grid-cols-4 desktop:gap-4 mt-6 grid grid-cols-2 gap-x-3 gap-y-4",children:t?.map((o,v)=>{const u=x?.find(h=>h.handle===o.handle);if(!u)return null;const f=u?.variants?.find(h=>h.sku===o.sku);return(0,e.jsx)(O,{product:u,variantData:f,badgeVariant:k,onSecondaryButton:()=>d?.(),onPrimaryButton:()=>p?.()},o.sku+v)})})]})},Q=({searchResult:t,searchValue:l,data:i,onSecondaryButton:d,onPrimaryButton:p,onChangeSort:k,loading:x,shopNowLoadingProductId:o,searchResultCount:v,onChangeTab:u,buildProps:f,componentOverrides:h,className:w,..._})=>{const N=h?.badge?.variant,[r,C]=(0,c.useState)(i?.tabs?.[0]),[m,L]=(0,c.useState)(!1),[z,E]=(0,c.useState)({[b.SearchPageTabType.PRODUCTS]:i?.tabs?.find(s=>s.tabType===b.SearchPageTabType.PRODUCTS)?.sortKeys?.[0],[b.SearchPageTabType.BLOGS]:i?.tabs?.find(s=>s.tabType===b.SearchPageTabType.BLOGS)?.sortKeys?.[0],[b.SearchPageTabType.PAGES]:i?.tabs?.find(s=>s.tabType===b.SearchPageTabType.PAGES)?.sortKeys?.[0]}),P=(0,c.useMemo)(()=>t?.products||[],[t]),A=(0,c.useMemo)(()=>t?.blogs||[],[t]),M=(0,c.useMemo)(()=>t?.pages||[],[t]),$=(0,c.useMemo)(()=>Object.values(v||{}).reduce((s,g)=>s+g,0),[v]),V=(0,c.useMemo)(()=>{const s={advertisingBgImg:`${r?.advertisingBgImg?.url}, ${r?.advertisingMobBgImg?.url} 768`,advertisingTitle:r?.advertisingTitle,advertisingSubtitle:r?.advertisingSubtitle,advertisingLink:r?.advertisingLink,advertisingTheme:r?.advertisingTheme,type:"advertising"};if(!!r?.advertisingBgImg?.url||!!r?.advertisingTitle||!!r?.advertisingLink){const y=[...P||[]];return y.length>=8?y.splice(7,0,s):y.length>0&&y.push(s),y}else return P},[r,P]);return(0,e.jsxs)("div",{..._,className:(0,n.cn)("ipc_search_page desktop:py-[128px] tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] px-4 py-16",w),children:[(0,e.jsx)(a.Heading,{size:4,weight:"bold",html:(0,n.replaceTemplate)(i?.title,{totalCount:$?.toString(),inputValue:`"${l}"`})}),(0,e.jsx)("div",{className:"mt-6",children:(0,e.jsxs)(a.Tabs,{className:"ipc_search_page_tabs",defaultValue:"products",children:[(0,e.jsxs)("div",{className:" desktop:flex desktop:items-center desktop:flex-row desktop:gap-6 desktop:justify-between",children:[(0,e.jsx)(a.TabsList,{children:i?.tabs?.map(s=>(0,e.jsxs)(a.TabsTrigger,{onClick:()=>{C(s);const g=s?.sortKeys?.[0];g&&(E(y=>({...y,[s?.tabType]:g})),k?.(s?.tabType,g)),u?.(s?.tabType)},defaultValue:"products",value:s.tabType,children:[s.label," (",v?.[s.tabType],")"]},s.id))}),(0,e.jsxs)(a.DropdownMenu,{onOpenChange:L,children:[(0,e.jsx)(a.DropdownMenuTrigger,{asChild:!0,children:(0,e.jsxs)("button",{className:"desktop:mt-0 mt-6 flex items-center text-base font-bold leading-[1.2] focus-visible:!outline-none",children:[r?.sortLabel," ",z?.[r?.tabType]?.label," ",(0,e.jsx)(j.DownArrow,{className:(0,n.cn)("inline-block size-4",{"rotate-180":m})})]})}),(0,e.jsx)(a.DropdownMenuContent,{align:"start",sideOffset:8,className:"rounded-sidebar-shelf bg-white !px-0 py-2 focus-visible:!outline-none",children:r?.sortKeys?.map(s=>(0,e.jsx)(a.DropdownMenuItem,{className:(0,n.cn)("laptop:px-4 laptop:text-base px-3 py-4 text-sm font-bold hover:bg-[#EAEAEC] hover:text-current hover:!outline-none",{"bg-[#EAEAEC]":z?.[r?.tabType]?.value===s.value}),onClick:()=>{k?.(r?.tabType,s),E(g=>({...g,[r?.tabType]:s}))},children:s.label},s.id))})]})]}),(0,e.jsxs)(a.TabsContent,{value:b.SearchPageTabType.PRODUCTS,className:"ipc_search_page_tabs_products_content mt-6",children:[(0,e.jsx)("div",{className:" tablet:grid-cols-3 desktop:grid-cols-4 desktop:gap-4 grid grid-cols-2 gap-x-3 gap-y-4",children:V?.map((s,g)=>(0,e.jsx)(O,{searchValue:l,product:s,shopNowLoadingProductId:o,badgeVariant:N,onSecondaryButton:()=>d?.(s),onPrimaryButton:()=>p?.(s)},(s.id||"")+g))}),x?(0,e.jsx)("div",{className:"mt-6 flex w-full justify-center",children:(0,e.jsx)(a.LoadingDots,{})}):!P?.length&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(I,{url:i?.noResultImage?.url,label:i?.noResultLabel}),(0,e.jsx)(D,{products:i?.recommendProducts||[],buildProps:f,title:i?.recommendProductsTitle,shopNowLoadingProductId:o,badgeVariant:N})]})]}),(0,e.jsx)(a.TabsContent,{value:b.SearchPageTabType.BLOGS,className:"ipc_search_page_tabs_blogs_content",children:(0,e.jsxs)("div",{children:[A?.map(s=>(0,e.jsx)(q,{blog:s,searchValue:l},s.id)),x?(0,e.jsx)("div",{className:"mt-6 flex justify-center",children:(0,e.jsx)(a.LoadingDots,{})}):!A?.length&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(I,{url:i?.noResultImage?.url,label:i?.noResultLabel}),(0,e.jsx)(D,{products:i?.recommendProducts||[],buildProps:f,title:i?.recommendProductsTitle,badgeVariant:N})]})]})}),(0,e.jsxs)(a.TabsContent,{value:b.SearchPageTabType.PAGES,className:"ipc_search_page_tabs_pages_content",children:[(0,e.jsx)("div",{children:M?.map((s,g)=>(0,e.jsx)(J,{page:s,searchValue:l},(s.global_id||s.id)+g))}),x?(0,e.jsx)("div",{className:"mt-6 flex justify-center",children:(0,e.jsx)(a.LoadingDots,{})}):!M?.length&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(I,{url:i?.noResultImage?.url,label:i?.noResultLabel}),(0,e.jsx)(D,{products:i?.recommendProducts||[],buildProps:f,title:i?.recommendProductsTitle,shopNowLoadingProductId:o,badgeVariant:N})]})]})]})})]})};var X=Q;
1
+ "use strict";var B=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var W=Object.prototype.hasOwnProperty;var F=(t,l)=>{for(var i in l)B(t,i,{get:l[i],enumerable:!0})},U=(t,l,i,d)=>{if(l&&typeof l=="object"||typeof l=="function")for(let c of K(l))!W.call(t,c)&&c!==i&&B(t,c,{get:()=>l[c],enumerable:!(d=G(l,c))||d.enumerable});return t};var H=t=>U(B({},"__esModule",{value:!0}),t);var Y={};F(Y,{default:()=>X});module.exports=H(Y);var e=require("react/jsx-runtime"),a=require("../../components/index.js"),j=require("../HeaderNavigation/icons/index.js"),p=require("react"),n=require("../../helpers/utils.js"),S=require("../AiuiProvider/index.js"),R=require("../ShelfDisplay/shelfDisplay.js"),b=require("./types.js"),T=require("../../helpers/utils.js");const O=({product:t,onSecondaryButton:l,onPrimaryButton:i,searchValue:d,variantData:c,shopNowLoadingProductId:k,badgeVariant:x})=>{const o=(0,p.useMemo)(()=>c||t?.variants?.[0],[t,c]),{locale:v="us",copyWriting:u,currencyCode:f}=(0,S.useAiuiContext)(),h=k===t?.id,w=(0,p.useMemo)(()=>(0,T.getLocalizedPath)(`/products/${t?.handle}`,v,`variant=${(0,n.atobID)(o?.id)}&ref=search_result_${d?.toLowerCase()}`),[t?.handle,o?.id,d,v]),_=o?.coupons?.[0],{price:N,basePrice:r}=(0,R.formatVariantPrice)({locale:f==="CAD"?"us":v||"us",amount:_?_.variant_price4wscode:o?.price?.amount??o?.price,baseAmount:_?o?.price?.amount??o?.price:0,currencyCode:t?.price?.currencyCode||"USD"}),C=(0,p.useMemo)(()=>t?.tags?.filter?.(m=>m?.startsWith?.("CLtag"))?.map?.(m=>m?.replace?.("CLtag:",""))?.slice?.(0,2),[t?.tags]);return(0,e.jsx)("div",{className:"rounded-image-text ipc_search_product_item lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] relative h-auto overflow-hidden",children:t?.type==="advertising"&&t?.advertisingLink?(0,e.jsxs)(a.Link,{href:(0,T.getLocalizedPath)(t?.advertisingLink,v),className:"h-full",children:[(0,e.jsx)(a.Picture,{source:`${t?.advertisingBgImg}`,className:"size-full",imgClassName:"size-full object-cover"}),(0,e.jsxs)("div",{className:"desktop:p-6 absolute inset-0 z-[2] p-4 [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[(0,e.jsx)(a.Text,{html:t?.advertisingTitle,className:(0,n.cn)("desktop:text-base text-sm font-bold leading-[1.2]",{"text-white":t?.advertisingTheme==="light","text-info-primary":t?.advertisingTheme==="dark"})}),t?.advertisingSubtitle&&(0,e.jsx)(a.Heading,{size:3,html:t?.advertisingSubtitle,className:(0,n.cn)("laptop:line-clamp-3 mt-2 line-clamp-4 font-bold",{"text-white":t?.advertisingTheme==="light","text-info-primary":t?.advertisingTheme==="dark"})})]})]}):(0,e.jsxs)("a",{href:w,className:"tablet:hover:bg-info-white desktop:p-6 desktop:pt-4 tablet:p-4 flex h-full flex-col bg-[#EAEAEC] px-2 py-4 no-underline duration-300",children:[(0,e.jsx)("div",{className:"ipc_search_product_item_image",children:(0,e.jsx)(a.Picture,{className:"lg-desktop:size-[196px] mx-auto size-[138px]",source:o?.image?.url||t?.images?.[0]?.url,alt:t?.title,imgClassName:"object-cover size-full"})}),(0,e.jsxs)("div",{className:"ipc_search_product_item_content desktop:mt-2 lg-desktop:mt-3 desktop:gap-6 mt-1 flex flex-1 flex-col justify-between gap-4",children:[(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)("div",{className:"lg-desktop:h-[28px] mb-2 flex h-[24px] gap-2",children:C?.map((m,L)=>(0,e.jsx)(a.Badge,{size:"lg",variant:x,children:m},L))}),(0,e.jsx)(a.Text,{className:"lg-desktop:text-2xl tablet:line-clamp-2 line-clamp-3 text-xl font-bold !leading-[1.2]",weight:"bold",html:(0,n.highlightSearchWord)(t?.title||"",d||"")}),(0,e.jsx)(a.Text,{as:"p",className:"lg-desktop:text-[18px] tablet:line-clamp-1 mt-1 line-clamp-2 text-sm font-bold",html:(0,n.highlightSearchWord)(t?.description,d||"")})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"mb-2 flex items-center",children:o?.availableForSale?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"final-price text-info-primary tablet:text-xl lg-desktop:text-2xl text-[18px] font-bold",children:o?.availableForSale&&N||""}),(0,e.jsx)("div",{className:"origin-price tablet:text-xl lg-desktop:text-2xl text-info-secondary ml-1 text-[18px] font-bold line-through",children:o?.availableForSale&&r||""})]}):(0,e.jsx)("div",{className:"text-info-primary tablet:text-xl lg-desktop:text-2xl text-[18px] font-bold",children:u?.soldOutText||"Sold Out"})}),(0,e.jsxs)("div",{className:(0,n.cn)("ipc_search_product_item_button_group","lg-desktop:gap-3 laptop:flex-row flex flex-col items-center gap-2"),children:[u?.learnMoreText&&(0,e.jsx)(a.Button,{variant:"secondary",className:"laptop:w-auto w-full",size:"lg",onClick:m=>{m.preventDefault(),m.stopPropagation(),l?.()},children:u?.learnMoreText}),u?.shopNowText&&(0,e.jsx)(a.Button,{variant:"primary",className:"laptop:w-auto w-full",size:"lg",disabled:!o?.availableForSale,loading:h,onClick:m=>{m.preventDefault(),m.stopPropagation(),i?.()},children:u?.shopNowText})]})]})]})]})})},q=({blog:t,searchValue:l})=>{const{copyWriting:i,locale:d="us"}=(0,S.useAiuiContext)(),c=(0,p.useMemo)(()=>(0,T.getLocalizedPath)(`/blogs/${t?.blog?.handle}/${t?.handle.replace("storefront-","")}`,d),[t,d]);return(0,e.jsx)("div",{className:"ipc_search_blog_item border-b border-[#E4E5E6] py-6",children:(0,e.jsxs)("div",{className:"ipc_search_blog_item_content laptop:flex-row-reverse laptop:gap-8 desktop:gap-16 flex flex-col gap-4",children:[(0,e.jsx)("div",{className:"rounded-image-text laptop:flex-[440] desktop:flex-[540] desktop:h-[280px] h-[240px] overflow-hidden",children:(0,e.jsx)(a.Picture,{source:t?.image?.url,className:"size-full",imgClassName:"size-full object-cover",alt:t?.title})}),(0,e.jsxs)("div",{className:"laptop:flex-[424] desktop:flex-[704] lg-desktop:flex-[1056] flex flex-col justify-center",children:[(0,e.jsx)(a.Heading,{size:3,html:(0,n.highlightSearchWord)(t?.title,l)}),(0,e.jsx)(a.Text,{html:(0,n.highlightSearchWord)(t?.content,l),className:"lg-desktop:text-[18px] desktop:text-[16px] mt-1 line-clamp-2 text-sm font-bold leading-[1.4]"}),(0,e.jsx)("div",{className:"desktop:mt-6 mt-4",children:(0,e.jsx)(a.Button,{as:"a",href:c,variant:"secondary",size:"lg",children:i?.learnMoreText||"Learn More"})})]})]})})},J=({searchValue:t,page:l})=>{const{copyWriting:i,locale:d="us"}=(0,S.useAiuiContext)(),c=(0,p.useMemo)(()=>(0,T.getLocalizedPath)(`/${l?.handle}`,d),[l,d]);return(0,e.jsxs)("div",{className:"ipc_search_page_items border-b border-[#E4E5E6] py-6",children:[(0,e.jsx)(a.Heading,{size:3,html:(0,n.highlightSearchWord)(l?.name,t)}),(0,e.jsx)(a.Text,{as:"p",html:(0,n.highlightSearchWord)(l?.bodySummary||"",t),className:"lg-desktop:text-[18px] desktop:text-[16px] mt-1 text-sm font-bold leading-[1.4]"}),(0,e.jsx)(a.Button,{as:"a",href:c,variant:"secondary",size:"lg",className:"desktop:mt-6 mt-4",children:i?.learnMoreText||"Learn More"})]})},I=({url:t,label:l})=>(0,e.jsxs)("div",{className:"flex flex-col items-center justify-center gap-4",children:[(0,e.jsx)(a.Picture,{source:t,className:"h-[180px] w-[240px]",imgClassName:"object-cover"}),(0,e.jsx)(a.Text,{html:l,className:"desktop:text-[18px] text-sm font-bold leading-[1.4]"})]}),D=({products:t,title:l,buildProps:i,onSecondaryButton:d,onPrimaryButton:c,badgeVariant:k})=>{const{products:x}=i||{};return console.log(x,"buildProducts"),(0,e.jsxs)("div",{className:"ipc_search_recommend_product tablet:pt-[80px] laptop:pt-[96px] desktop:pt-[112px] lg-desktop:pt-[128px] pt-[64px]",children:[(0,e.jsx)(a.Heading,{size:4,weight:"bold",html:l}),(0,e.jsx)("div",{className:" tablet:grid-cols-3 desktop:grid-cols-4 desktop:gap-4 mt-6 grid grid-cols-2 gap-x-3 gap-y-4",children:t?.map((o,v)=>{const u=x?.find(h=>h.handle===o.handle);if(!u)return null;const f=u?.variants?.find(h=>h.sku===o.sku);return(0,e.jsx)(O,{product:u,variantData:f,badgeVariant:k,onSecondaryButton:()=>d?.(),onPrimaryButton:()=>c?.()},o.sku+v)})})]})},Q=({searchResult:t,searchValue:l,data:i,onSecondaryButton:d,onPrimaryButton:c,onChangeSort:k,loading:x,shopNowLoadingProductId:o,searchResultCount:v,onChangeTab:u,buildProps:f,componentOverrides:h,className:w,..._})=>{const N=h?.badge?.variant,[r,C]=(0,p.useState)(i?.tabs?.[0]),[m,L]=(0,p.useState)(!1),[z,E]=(0,p.useState)({[b.SearchPageTabType.PRODUCTS]:i?.tabs?.find(s=>s.tabType===b.SearchPageTabType.PRODUCTS)?.sortKeys?.[0],[b.SearchPageTabType.BLOGS]:i?.tabs?.find(s=>s.tabType===b.SearchPageTabType.BLOGS)?.sortKeys?.[0],[b.SearchPageTabType.PAGES]:i?.tabs?.find(s=>s.tabType===b.SearchPageTabType.PAGES)?.sortKeys?.[0]}),P=(0,p.useMemo)(()=>t?.products||[],[t]),A=(0,p.useMemo)(()=>t?.blogs||[],[t]),M=(0,p.useMemo)(()=>t?.pages||[],[t]),$=(0,p.useMemo)(()=>Object.values(v||{}).reduce((s,g)=>s+g,0),[v]),V=(0,p.useMemo)(()=>{const s={advertisingBgImg:`${r?.advertisingBgImg?.url}, ${r?.advertisingMobBgImg?.url} 768`,advertisingTitle:r?.advertisingTitle,advertisingSubtitle:r?.advertisingSubtitle,advertisingLink:r?.advertisingLink,advertisingTheme:r?.advertisingTheme,type:"advertising"};if(!!r?.advertisingBgImg?.url||!!r?.advertisingTitle||!!r?.advertisingLink){const y=[...P||[]];return y.length>=8?y.splice(7,0,s):y.length>0&&y.push(s),y}else return P},[r,P]);return(0,e.jsxs)("div",{..._,className:(0,n.cn)("ipc_search_page desktop:py-[128px] px-grid py-16",w),children:[(0,e.jsx)(a.Heading,{size:4,weight:"bold",html:(0,n.replaceTemplate)(i?.title,{totalCount:$?.toString(),inputValue:`"${l}"`})}),(0,e.jsx)("div",{className:"mt-6",children:(0,e.jsxs)(a.Tabs,{className:"ipc_search_page_tabs",defaultValue:"products",children:[(0,e.jsxs)("div",{className:" desktop:flex desktop:items-center desktop:flex-row desktop:gap-6 desktop:justify-between",children:[(0,e.jsx)(a.TabsList,{children:i?.tabs?.map(s=>(0,e.jsxs)(a.TabsTrigger,{onClick:()=>{C(s);const g=s?.sortKeys?.[0];g&&(E(y=>({...y,[s?.tabType]:g})),k?.(s?.tabType,g)),u?.(s?.tabType)},defaultValue:"products",value:s.tabType,children:[s.label," (",v?.[s.tabType],")"]},s.id))}),(0,e.jsxs)(a.DropdownMenu,{onOpenChange:L,children:[(0,e.jsx)(a.DropdownMenuTrigger,{asChild:!0,children:(0,e.jsxs)("button",{className:"desktop:mt-0 mt-6 flex items-center text-base font-bold leading-[1.2] focus-visible:!outline-none",children:[r?.sortLabel," ",z?.[r?.tabType]?.label," ",(0,e.jsx)(j.DownArrow,{className:(0,n.cn)("inline-block size-4",{"rotate-180":m})})]})}),(0,e.jsx)(a.DropdownMenuContent,{align:"start",sideOffset:8,className:"rounded-sidebar-shelf bg-white !px-0 py-2 focus-visible:!outline-none",children:r?.sortKeys?.map(s=>(0,e.jsx)(a.DropdownMenuItem,{className:(0,n.cn)("laptop:px-4 laptop:text-base px-3 py-4 text-sm font-bold hover:bg-[#EAEAEC] hover:text-current hover:!outline-none",{"bg-[#EAEAEC]":z?.[r?.tabType]?.value===s.value}),onClick:()=>{k?.(r?.tabType,s),E(g=>({...g,[r?.tabType]:s}))},children:s.label},s.id))})]})]}),(0,e.jsxs)(a.TabsContent,{value:b.SearchPageTabType.PRODUCTS,className:"ipc_search_page_tabs_products_content mt-6",children:[(0,e.jsx)("div",{className:" tablet:grid-cols-3 desktop:grid-cols-4 desktop:gap-4 grid grid-cols-2 gap-x-3 gap-y-4",children:V?.map((s,g)=>(0,e.jsx)(O,{searchValue:l,product:s,shopNowLoadingProductId:o,badgeVariant:N,onSecondaryButton:()=>d?.(s),onPrimaryButton:()=>c?.(s)},(s.id||"")+g))}),x?(0,e.jsx)("div",{className:"mt-6 flex w-full justify-center",children:(0,e.jsx)(a.LoadingDots,{})}):!P?.length&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(I,{url:i?.noResultImage?.url,label:i?.noResultLabel}),(0,e.jsx)(D,{products:i?.recommendProducts||[],buildProps:f,title:i?.recommendProductsTitle,shopNowLoadingProductId:o,badgeVariant:N})]})]}),(0,e.jsx)(a.TabsContent,{value:b.SearchPageTabType.BLOGS,className:"ipc_search_page_tabs_blogs_content",children:(0,e.jsxs)("div",{children:[A?.map(s=>(0,e.jsx)(q,{blog:s,searchValue:l},s.id)),x?(0,e.jsx)("div",{className:"mt-6 flex justify-center",children:(0,e.jsx)(a.LoadingDots,{})}):!A?.length&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(I,{url:i?.noResultImage?.url,label:i?.noResultLabel}),(0,e.jsx)(D,{products:i?.recommendProducts||[],buildProps:f,title:i?.recommendProductsTitle,badgeVariant:N})]})]})}),(0,e.jsxs)(a.TabsContent,{value:b.SearchPageTabType.PAGES,className:"ipc_search_page_tabs_pages_content",children:[(0,e.jsx)("div",{children:M?.map((s,g)=>(0,e.jsx)(J,{page:s,searchValue:l},(s.global_id||s.id)+g))}),x?(0,e.jsx)("div",{className:"mt-6 flex justify-center",children:(0,e.jsx)(a.LoadingDots,{})}):!M?.length&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(I,{url:i?.noResultImage?.url,label:i?.noResultLabel}),(0,e.jsx)(D,{products:i?.recommendProducts||[],buildProps:f,title:i?.recommendProductsTitle,shopNowLoadingProductId:o,badgeVariant:N})]})]})]})})]})};var X=Q;