@anker-in/headless-ui 1.3.84 → 1.3.85
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.
- package/dist/cjs/biz-components/AccordionCards/index.js +1 -1
- package/dist/cjs/biz-components/ActiveShelf/ProductCard.d.ts +4 -3
- package/dist/cjs/biz-components/ActiveShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/ActiveShelf/index.js +1 -1
- package/dist/cjs/biz-components/ActivityMechanism/index.d.ts +4 -7
- package/dist/cjs/biz-components/ActivityMechanism/index.js +1 -1
- package/dist/cjs/biz-components/ActivitySchedule/index.js +1 -1
- package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
- package/dist/cjs/biz-components/AnchorNavigation/index.js +1 -1
- package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/FreeGiftItem.d.ts +2 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/FreeGiftItem.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/GiftSelection.d.ts +2 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/GiftSelection.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/PriceAndActions.d.ts +2 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/PriceAndActions.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +2 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductImage.d.ts +4 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductImage.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductInfo.d.ts +2 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductInfo.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/index.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/tracking.d.ts +20 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/tracking.js +1 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/types.d.ts +2 -0
- package/dist/cjs/biz-components/Category/index.d.ts +4 -2
- package/dist/cjs/biz-components/Category/index.js +1 -1
- package/dist/cjs/biz-components/Chat/action.d.ts +25 -0
- package/dist/cjs/biz-components/Chat/action.js +1 -0
- package/dist/cjs/biz-components/Chat/button.d.ts +3 -0
- package/dist/cjs/biz-components/Chat/button.js +1 -0
- package/dist/cjs/biz-components/Chat/chatContext.d.ts +101 -0
- package/dist/cjs/biz-components/Chat/chatContext.js +1 -0
- package/dist/cjs/biz-components/Chat/exports.d.ts +3 -0
- package/dist/cjs/biz-components/Chat/exports.js +1 -0
- package/dist/cjs/biz-components/Chat/helpers/fetchResponse.d.ts +14 -0
- package/dist/cjs/biz-components/Chat/helpers/fetchResponse.js +1 -0
- package/dist/cjs/biz-components/Chat/helpers/fetcher.d.ts +2 -0
- package/dist/cjs/biz-components/Chat/helpers/fetcher.js +1 -0
- package/dist/cjs/biz-components/Chat/index.d.ts +71 -0
- package/dist/cjs/biz-components/Chat/index.js +1 -0
- package/dist/cjs/biz-components/Chat/markdown.d.ts +5 -0
- package/dist/cjs/biz-components/Chat/markdown.js +1 -0
- package/dist/cjs/biz-components/Chat/messages.d.ts +3 -0
- package/dist/cjs/biz-components/Chat/messages.js +1 -0
- package/dist/cjs/biz-components/Chat/props.d.ts +43 -0
- package/dist/cjs/biz-components/Chat/props.js +1 -0
- package/dist/cjs/biz-components/Chat/response.d.ts +4 -0
- package/dist/cjs/biz-components/Chat/response.js +1 -0
- package/dist/cjs/biz-components/Chat/suggestions.d.ts +3 -0
- package/dist/cjs/biz-components/Chat/suggestions.js +1 -0
- package/dist/cjs/biz-components/Chat/utils.d.ts +3 -0
- package/dist/cjs/biz-components/Chat/utils.js +1 -0
- package/dist/cjs/biz-components/Evaluate/index.js +1 -1
- package/dist/cjs/biz-components/EventSchedule/index.js +1 -1
- package/dist/cjs/biz-components/Faq/Faq.d.ts +3 -1
- package/dist/cjs/biz-components/Faq/Faq.js +2 -2
- package/dist/cjs/biz-components/FeatureCards/FeatureCards.js +1 -1
- package/dist/cjs/biz-components/GiftShelf/index.js +1 -1
- package/dist/cjs/biz-components/GiftTierShelf/index.js +1 -1
- package/dist/cjs/biz-components/Graphic/index.js +1 -1
- package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerMulti/index.js +1 -1
- package/dist/cjs/biz-components/MemberEquity/index.js +2 -2
- package/dist/cjs/biz-components/MiniCart/index.js +1 -1
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/cjs/biz-components/ProductHero/ProductHero.js +1 -1
- package/dist/cjs/biz-components/ProductNav/ProductNav.js +1 -1
- package/dist/cjs/biz-components/PromotionalBar/index.d.ts +3 -2
- package/dist/cjs/biz-components/PromotionalBar/index.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/ProductsPanel.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/Root.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/context.d.ts +11 -1
- package/dist/cjs/biz-components/SceneShelf/context.js +1 -1
- package/dist/cjs/biz-components/SceneShelf/types.d.ts +5 -0
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/cjs/biz-components/Title/index.js +1 -1
- package/dist/cjs/shared/track.d.ts +13 -7
- package/dist/cjs/shared/track.js +1 -1
- package/dist/esm/biz-components/AccordionCards/index.js +1 -1
- package/dist/esm/biz-components/ActiveShelf/ProductCard.d.ts +4 -3
- package/dist/esm/biz-components/ActiveShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/ActiveShelf/index.js +1 -1
- package/dist/esm/biz-components/ActivityMechanism/index.d.ts +4 -7
- package/dist/esm/biz-components/ActivityMechanism/index.js +1 -1
- package/dist/esm/biz-components/ActivitySchedule/index.js +1 -1
- package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
- package/dist/esm/biz-components/AnchorNavigation/index.js +1 -1
- package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/FreeGiftItem.d.ts +2 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/FreeGiftItem.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/GiftSelection.d.ts +2 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/GiftSelection.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/PriceAndActions.d.ts +2 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/PriceAndActions.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +2 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductImage.d.ts +4 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductImage.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductInfo.d.ts +2 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductInfo.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/index.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/tracking.d.ts +20 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/tracking.js +1 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/types.d.ts +2 -0
- package/dist/esm/biz-components/Category/index.d.ts +4 -2
- package/dist/esm/biz-components/Category/index.js +1 -1
- package/dist/esm/biz-components/Chat/action.d.ts +25 -0
- package/dist/esm/biz-components/Chat/action.js +1 -0
- package/dist/esm/biz-components/Chat/button.d.ts +3 -0
- package/dist/esm/biz-components/Chat/button.js +1 -0
- package/dist/esm/biz-components/Chat/chatContext.d.ts +101 -0
- package/dist/esm/biz-components/Chat/chatContext.js +1 -0
- package/dist/esm/biz-components/Chat/exports.d.ts +3 -0
- package/dist/esm/biz-components/Chat/exports.js +1 -0
- package/dist/esm/biz-components/Chat/helpers/fetchResponse.d.ts +14 -0
- package/dist/esm/biz-components/Chat/helpers/fetchResponse.js +1 -0
- package/dist/esm/biz-components/Chat/helpers/fetcher.d.ts +2 -0
- package/dist/esm/biz-components/Chat/helpers/fetcher.js +1 -0
- package/dist/esm/biz-components/Chat/index.d.ts +71 -0
- package/dist/esm/biz-components/Chat/index.js +1 -0
- package/dist/esm/biz-components/Chat/markdown.d.ts +5 -0
- package/dist/esm/biz-components/Chat/markdown.js +1 -0
- package/dist/esm/biz-components/Chat/messages.d.ts +3 -0
- package/dist/esm/biz-components/Chat/messages.js +1 -0
- package/dist/esm/biz-components/Chat/props.d.ts +43 -0
- package/dist/esm/biz-components/Chat/props.js +1 -0
- package/dist/esm/biz-components/Chat/response.d.ts +4 -0
- package/dist/esm/biz-components/Chat/response.js +1 -0
- package/dist/esm/biz-components/Chat/suggestions.d.ts +3 -0
- package/dist/esm/biz-components/Chat/suggestions.js +1 -0
- package/dist/esm/biz-components/Chat/utils.d.ts +3 -0
- package/dist/esm/biz-components/Chat/utils.js +1 -0
- package/dist/esm/biz-components/Evaluate/index.js +1 -1
- package/dist/esm/biz-components/EventSchedule/index.js +1 -1
- package/dist/esm/biz-components/Faq/Faq.d.ts +3 -1
- package/dist/esm/biz-components/Faq/Faq.js +2 -2
- package/dist/esm/biz-components/FeatureCards/FeatureCards.js +1 -1
- package/dist/esm/biz-components/GiftShelf/index.js +1 -1
- package/dist/esm/biz-components/GiftTierShelf/index.js +1 -1
- package/dist/esm/biz-components/Graphic/index.js +1 -1
- package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
- package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
- package/dist/esm/biz-components/MediaPlayerMulti/index.js +1 -1
- package/dist/esm/biz-components/MemberEquity/index.js +2 -2
- package/dist/esm/biz-components/MiniCart/index.js +1 -1
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/esm/biz-components/ProductHero/ProductHero.js +1 -1
- package/dist/esm/biz-components/ProductNav/ProductNav.js +1 -1
- package/dist/esm/biz-components/PromotionalBar/index.d.ts +3 -2
- package/dist/esm/biz-components/PromotionalBar/index.js +1 -1
- package/dist/esm/biz-components/SceneShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/SceneShelf/ProductsPanel.js +1 -1
- package/dist/esm/biz-components/SceneShelf/Root.js +1 -1
- package/dist/esm/biz-components/SceneShelf/context.d.ts +11 -1
- package/dist/esm/biz-components/SceneShelf/context.js +1 -1
- package/dist/esm/biz-components/SceneShelf/types.d.ts +5 -0
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/esm/biz-components/Title/index.js +1 -1
- package/dist/esm/shared/track.d.ts +13 -7
- package/dist/esm/shared/track.js +1 -1
- package/package.json +50 -3
- package/src/biz-components/Chat/styles/chat.css +14 -0
- package/src/biz-components/Chat/styles/css/animations.css +35 -0
- package/src/biz-components/Chat/styles/css/button.css +56 -0
- package/src/biz-components/Chat/styles/css/colors.css +12 -0
- package/src/biz-components/Chat/styles/css/console.css +134 -0
- package/src/biz-components/Chat/styles/css/header.css +43 -0
- package/src/biz-components/Chat/styles/css/input.css +89 -0
- package/src/biz-components/Chat/styles/css/markdown.css +131 -0
- package/src/biz-components/Chat/styles/css/messages.css +85 -0
- package/src/biz-components/Chat/styles/css/panel.css +23 -0
- package/src/biz-components/Chat/styles/css/popup.css +44 -0
- package/src/biz-components/Chat/styles/css/response.css +25 -0
- package/src/biz-components/Chat/styles/css/sidebar.css +31 -0
- package/src/biz-components/Chat/styles/css/suggestions.css +36 -0
- package/src/biz-components/Chat/styles/css/window.css +60 -0
- package/src/biz-components/Chat/styles/image.png +0 -0
|
@@ -3,10 +3,12 @@ import type { FaqProps, FaqItem as ItemType, FaqSemanticName } from './types.js'
|
|
|
3
3
|
interface FaqItemProps {
|
|
4
4
|
data: ItemType;
|
|
5
5
|
index: number;
|
|
6
|
+
/** 当前是否展开,用于点击埋点区分 expand / collapse;不传时按收起处理 */
|
|
7
|
+
isOpen?: boolean;
|
|
6
8
|
classNames?: Partial<Record<FaqSemanticName, string>>;
|
|
7
9
|
}
|
|
8
10
|
declare const FaqItem: {
|
|
9
|
-
({ data, index, classNames }: FaqItemProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
({ data, index, isOpen, classNames }: FaqItemProps): import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
displayName: string;
|
|
11
13
|
};
|
|
12
14
|
declare const _default: React.ForwardRefExoticComponent<Omit<FaqProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../index.js").ContainerProps & React.RefAttributes<unknown>> & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";"use client";var
|
|
1
|
+
"use strict";"use client";var T=Object.create;var m=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var A=Object.getOwnPropertyNames;var C=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var $=(e,t)=>{for(var a in t)m(e,a,{get:t[a],enumerable:!0})},y=(e,t,a,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of A(t))!I.call(e,r)&&r!==a&&m(e,r,{get:()=>t[r],enumerable:!(i=k(t,r))||i.enumerable});return e};var x=(e,t,a)=>(a=e!=null?T(C(e)):{},y(t||!e||!e.__esModule?m(a,"default",{value:e,enumerable:!0}):a,e)),H=e=>y(m({},"__esModule",{value:!0}),e);var P={};$(P,{FaqItem:()=>p,default:()=>L});module.exports=H(P);var o=require("react/jsx-runtime"),n=x(require("react")),c=x(require("@radix-ui/react-accordion")),l=require("../../components/index.js"),s=require("../../helpers/index.js"),w=require("../../shared/Styles.js"),F=require("../../hooks/useExposure.js"),g=require("../../shared/track.js");const v="copy",q="faq",b=n.default.forwardRef(({data:e,className:t,defaultOpenIndex:a,classNames:i={}},r)=>{const d=(0,n.useRef)(null);(0,n.useImperativeHandle)(r,()=>d.current),(0,F.useExposure)(d,{componentType:v,componentName:q,componentTitle:e?.productData?.[0]?.title,componentDescription:e?.productData?.[0]?.richDesc??e?.productData?.[0]?.desc});const D=(Array.isArray(a)?a:a!==void 0?[a]:e?.openFirst??!0?[0]:[]).map(f=>`item-${f}`),[h,N]=n.default.useState(D);return(0,o.jsxs)("div",{ref:d,className:(0,s.cn)(t,i.root),children:[(0,o.jsx)("style",{children:`
|
|
2
2
|
@keyframes faq-slide-down {
|
|
3
3
|
from { height: 0; opacity: 0; }
|
|
4
4
|
to { height: var(--radix-accordion-content-height); opacity: 1; }
|
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
from { height: var(--radix-accordion-content-height); opacity: 1; }
|
|
8
8
|
to { height: 0; opacity: 0; }
|
|
9
9
|
}
|
|
10
|
-
`}),(0,
|
|
10
|
+
`}),(0,o.jsx)(c.Root,{type:"multiple",value:h,onValueChange:N,children:e?.productData?.map((f,u)=>(0,o.jsx)(p,{data:f,index:u,classNames:i,isOpen:h.includes(`item-${u}`)},u))})]})});b.displayName="Faq";const p=({data:e,index:t,isOpen:a=!1,classNames:i={}})=>{const r={"data-headless-type-name":`${v}#${q}`,"data-headless-title-desc-button":`${(0,g.toPlainTrackingText)(e?.title)}#${(0,g.toPlainTrackingText)(e?.richDesc??e?.desc)}#${a?"collapse":"expand"}`,"data-headless-nav-position":`#${t+1}`};return(0,o.jsxs)(c.Item,{value:`item-${t}`,className:(0,s.cn)("tablet:py-6 border-b border-[#E4E5E6] py-4",i.item),children:[(0,o.jsx)(c.Header,{className:"flex",children:(0,o.jsxs)(c.Trigger,{...r,className:(0,s.cn)("tablet:gap-[128px] group flex flex-1 !cursor-pointer items-center justify-between gap-4 text-left",i.itemHeader),children:[(0,o.jsx)(l.Heading,{as:"h3",html:e?.title,className:(0,s.cn)("desktop:text-base lg-desktop:text-lg text-info-primary text-sm font-bold leading-[1.4]",i.title)}),(0,o.jsx)("div",{className:(0,s.cn)("transition-transform duration-300 group-data-[state=open]:rotate-180",i.icon),children:(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-[20px]",width:"20",height:"21",viewBox:"0 0 20 21",fill:"none",children:(0,o.jsx)("path",{d:"M14.4111 7.41107C14.7365 7.08563 15.264 7.08563 15.5895 7.41107C15.9149 7.73651 15.9149 8.26402 15.5895 8.58946L10.5895 13.5895C10.264 13.9149 9.73651 13.9149 9.41107 13.5895L4.41107 8.58946C4.08563 8.26402 4.08563 7.73651 4.41107 7.41107C4.73651 7.08563 5.26402 7.08563 5.58946 7.41107L10.0003 11.8219L14.4111 7.41107Z",fill:"#1D1D1F"})})})]})}),(0,o.jsx)(c.Content,{forceMount:!0,className:(0,s.cn)("overflow-hidden text-[#4A4C56]","data-[state=closed]:h-0 data-[state=closed]:opacity-0","data-[state=open]:animate-[faq-slide-down_300ms_ease-out]","data-[state=closed]:animate-[faq-slide-up_300ms_ease-out]",i.content),children:(0,o.jsx)("div",{className:"mt-2",children:(0,o.jsx)(l.Text,{html:e?.richDesc??e?.desc,className:(0,s.cn)("desktop:text-base lg-desktop:text-lg [&_a]:text-brand-0 text-sm font-bold leading-[1.4] [&_a]:underline",i.description)})})})]})};p.displayName="FaqItem";var L=(0,w.withLayout)(b);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var
|
|
1
|
+
"use strict";"use client";var j=Object.create;var c=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var D=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var P=(e,r)=>{for(var s in r)c(e,s,{get:r[s],enumerable:!0})},k=(e,r,s,d)=>{if(r&&typeof r=="object"||typeof r=="function")for(let p of $(r))!E.call(e,p)&&p!==s&&c(e,p,{get:()=>r[p],enumerable:!(d=L(r,p))||d.enumerable});return e};var I=(e,r,s)=>(s=e!=null?j(D(e)):{},k(r||!e||!e.__esModule?c(s,"default",{value:e,enumerable:!0}):s,e)),M=e=>k(c({},"__esModule",{value:!0}),e);var q={};P(q,{default:()=>V});module.exports=M(q);var t=require("react/jsx-runtime"),o=I(require("react")),l=require("../../components/index.js"),f=require("../../helpers/utils.js"),w=require("../../shared/Styles.js"),y=require("../../hooks/useExposure.js"),C=require("../../shared/trackUrlRef.js"),n=require("swiper/react"),T=require("../../hooks/useTracking.js");const h="image",g="feature_cards",B=(e,r)=>r===2?e===0?"laptop:flex-[2]":"laptop:flex-[3]":r===3?"laptop:flex-[1]":r===4?e===0?"laptop:flex-[2]":e===1||e===2?"laptop:flex-[3]":"laptop:flex-[2]":r===5?e<3?"laptop:flex-[1]":e===3?"laptop:flex-[2]":"laptop:flex-[3]":"laptop:flex-[1]",U=(e,r)=>r===4&&e===1||r===5&&e===2,N=o.default.forwardRef(({data:e,className:r},s)=>{const{buildRef:d}=(0,T.useTracking)(),{title:p,subtitle:x,items:u=[],theme:F="light",titleTag:z}=e,m=(0,o.useRef)(null);(0,y.useExposure)(m,{componentType:h,componentName:g,componentTitle:p,componentDescription:x}),(0,o.useImperativeHandle)(s,()=>m.current);const _="rounded-box",H=(a,i)=>{const v=(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.Picture,{source:a.image?.url,alt:a.image?.alt||a.title,className:"feature-cards__card-image absolute inset-0 !h-full",imgClassName:"!h-full object-cover"}),(0,t.jsxs)("div",{className:"feature-cards__card-content z-10",children:[(0,t.jsx)(l.Heading,{size:3,as:"h2",className:"feature-cards__card-title laptop:text-[20px] desktop:text-[32px] lg-desktop:text-[32px]",children:a.title}),(0,t.jsx)(l.Text,{size:4,as:"p",className:"feature-cards__card-subtitle laptop:h-[42px] lg-desktop:h-[54px] lg-desktop:text-[18px] mt-[4px] line-clamp-2 h-[42px] text-[14px]",children:a.subtitle})]})]}),R="feature-cards__card relative flex h-[360px] max-h-[560px] flex-col justify-end gap-[16px] overflow-hidden px-[16px] py-[12px] text-info-primary tablet:h-[336px] laptop:h-[336px] laptop:px-[16px] laptop:py-[16px] desktop:h-[448px] desktop:px-[32px] desktop:py-[24px] lg-desktop:h-[560px]",S=i!==void 0?B(i,u.length):"flex-1",b=(0,f.cn)(R,_,S,{"aiui-dark":a.theme==="dark","aiui-light":a.theme==="light"});return a.link?(0,t.jsx)("a",{href:(0,C.trackUrlRef)(a.link,d(h,g)),className:b,"data-headless-type-name":`${h}#${g}`,"data-headless-title-desc-button":`${p}#${a.title}#${a.subtitle}`,children:v}):(0,t.jsx)("div",{className:b,children:v})};return(0,t.jsxs)("section",{ref:m,"data-ui-component-id":"FeatureCards",className:(0,f.cn)("feature-cards text-info-primary flex w-full flex-col justify-center",{"aiui-dark":F==="dark"},r),children:[(0,t.jsxs)("div",{className:"feature-cards__header",children:[(0,t.jsx)(l.Heading,{size:4,as:z??"h2",className:"feature-cards__title laptop:text-center text-left",children:p}),x&&(0,t.jsx)(l.Text,{size:2,as:"p",className:"feature-cards__subtitle laptop:text-center desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-left text-[14px]",children:x})]}),(0,t.jsx)("div",{className:"feature-cards__grid laptop:mt-[32px] laptop:flex desktop:mt-[40px] lg-desktop:mt-[24px] mt-[24px] hidden w-full flex-wrap gap-[16px]",children:u.map((a,i)=>(0,t.jsxs)(o.default.Fragment,{children:[H(a,i),U(i,u.length)&&(0,t.jsx)("div",{className:"laptop:basis-full laptop:h-0"})]},a.title))}),(0,t.jsx)("div",{className:"feature-cards__swiper-container laptop:hidden mt-[24px] w-full",children:(0,t.jsx)(n.Swiper,{spaceBetween:12,slidesPerView:"auto",grabCursor:!0,className:"feature-cards__swiper relative w-full !overflow-visible",children:u.map(a=>(0,t.jsx)(n.SwiperSlide,{className:"feature-cards__swiper-slide relative !h-[360px] !w-[296px]",children:(0,t.jsxs)("div",{className:(0,f.cn)("feature-cards__card feature-cards__card--mobile text-info-primary absolute inset-0 flex flex-1 flex-col justify-end gap-[16px] overflow-hidden px-[16px] py-[12px]",_,{"aiui-dark":a.theme==="dark","aiui-light":a.theme==="light"}),children:[(0,t.jsx)(l.Picture,{source:a.image?.url,alt:a.image?.alt||a.title,className:"feature-cards__card-image absolute inset-0 !h-full",imgClassName:"!h-full object-cover"}),(0,t.jsxs)("div",{className:"feature-cards__card-content z-10",children:[(0,t.jsx)(l.Heading,{size:3,as:"h2",className:"feature-cards__card-title",children:a.title}),(0,t.jsx)(l.Text,{size:4,as:"p",className:"feature-cards__card-subtitle laptop:h-[42px] lg-desktop:h-[54px] lg-desktop:text-[18px] mt-[4px] line-clamp-2 h-[42px] overflow-visible text-[14px]",children:a.subtitle})]})]},a.title)},a.title))})})]})});N.displayName="FeatureCards";var V=(0,w.withLayout)(N,{style:"overflow: hidden;"});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var rt=Object.create;var B=Object.defineProperty;var it=Object.getOwnPropertyDescriptor;var lt=Object.getOwnPropertyNames;var ut=Object.getPrototypeOf,ct=Object.prototype.hasOwnProperty;var dt=(t,e)=>{for(var n in e)B(t,n,{get:e[n],enumerable:!0})},U=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of lt(e))!ct.call(t,r)&&r!==n&&B(t,r,{get:()=>e[r],enumerable:!(s=it(e,r))||s.enumerable});return t};var ft=(t,e,n)=>(n=t!=null?rt(ut(t)):{},U(e||!t||!t.__esModule?B(n,"default",{value:t,enumerable:!0}):n,t)),pt=t=>U(B({},"__esModule",{value:!0}),t);var bt={};dt(bt,{default:()=>xt});module.exports=pt(bt);var o=require("react/jsx-runtime"),a=ft(require("react")),p=require("../../helpers/index.js"),u=require("../../components/index.js"),b=require("class-variance-authority"),V=require("swiper/react"),Y=require("../../shared/Styles.js"),Z=require("../Listing/utils/index.js"),tt=require("../AiuiProvider/index.js"),I=require("../Listing/utils/textFormat.js");const mt=(0,b.cva)("desktop:px-6 rounded-card relative min-w-0 overflow-hidden p-4",{variants:{state:{light:"bg-[#EAEAEC]",dark:"bg-[#1E2024]"}},defaultVariants:{state:"light"}}),ht=(0,b.cva)("",{variants:{layout:{vertical:"",horizontal:"desktop:flex desktop:flex-row desktop:items-stretch desktop:gap-10"}},defaultVariants:{layout:"vertical"}}),gt=(0,b.cva)("desktop:max-w-[268px] lg-desktop:max-w-[356px] lg-desktop:h-[171px] relative mx-auto h-[118px] max-w-[256px] ",{variants:{layout:{vertical:"",horizontal:"desktop:flex-1 desktop:h-[122px] lg-desktop:h-[161px]"}},defaultVariants:{layout:"vertical"}}),wt=(0,b.cva)("mt-3",{variants:{layout:{vertical:"",horizontal:"desktop:mt-0 desktop:flex-1 desktop:flex desktop:flex-col desktop:justify-center"}},defaultVariants:{layout:"vertical"}}),St=(0,b.cva)("mt-4 self-start",{variants:{state:{light:"bg-[#080A0F] text-white",dark:"bg-white text-[#080A0F]"}},defaultVariants:{state:"light"}}),N=(0,b.cva)("",{variants:{state:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{state:"light"}}),q=t=>{if(!t)return;const e=[];return t.lgDesktop?.url&&e.push(`${t.lgDesktop.url} 1920`),t.desktop?.url&&e.push(`${t.desktop.url} 1439`),t.laptop?.url&&e.push(`${t.laptop.url} 1024`),t.tablet?.url&&e.push(`${t.tablet.url} 767`),t.default?.url&&e.push(t.default.url),e.length>0?e.join(", "):void 0},O=t=>t&&(t.default?.alt||t.tablet?.alt||t.laptop?.alt||t.desktop?.alt||t.lgDesktop?.alt)||"",vt=t=>{const e=Math.floor(t/3600),n=Math.floor(t%3600/60),s=t%60;return`${e.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`},j=t=>{if(typeof t=="number")return t;const e=new Date(t).getTime();return isNaN(e)?0:e},H=t=>{if(!t)return!1;const e=j(t.startTime),n=(t.durationDays??1)*24*3600*1e3,s=t.rounds??1,r=Date.now();if(r<e)return!1;const g=r-e,d=Math.floor(g/n)+1;if(d>s)return!1;const m=e+d*n-r,i=5*60*1e3;return m<=i&&m>0},W=(t,e)=>{if(!t||!e)return t||"";const n=j(e.startTime),s=(e.durationDays??1)*24*3600*1e3,r=e.rounds??1,g=Date.now();if(g<n){const w=new Date(n),c=`${(w.getUTCMonth()+1).toString().padStart(2,"0")}${w.getUTCDate().toString().padStart(2,"0")}`;return`${t}${c}`}const d=g-n,S=Math.min(Math.floor(d/s)+1,r),m=n+(S-1)*s,i=new Date(m),h=`${(i.getUTCMonth()+1).toString().padStart(2,"0")}${i.getUTCDate().toString().padStart(2,"0")}`;return`${t}${h}`},J=a.memo(({config:t,theme:e="light",className:n,countdownText:s="Next round start time",lastRoundText:r="Last round",beforeStartText:g="Start time",countdownIcon:d,onStateChange:S})=>{const[m,i]=a.useState(0),[h,w]=a.useState("beforeStart"),c=a.useMemo(()=>j(t.startTime),[t.startTime]),v=t.rounds??1,y=(t.durationDays??1)*24*3600*1e3;a.useEffect(()=>{const M=()=>{const k=Date.now();if(k<c){const $=Math.max(0,Math.floor((c-k)/1e3));i($),w("beforeStart");return}const P=k-c,C=Math.floor(P/y)+1;if(C>v){w("finished");return}const G=c+C*y,l=Math.max(0,Math.floor((G-k)/1e3));i(l),w(C===v?"lastRound":"running")};M();const D=setInterval(M,1e3);return()=>clearInterval(D)},[c,y,v]),a.useEffect(()=>{S?.(h)},[h,S]);const A=a.useMemo(()=>{switch(h){case"beforeStart":return g;case"lastRound":return r;default:return s}},[h,g,r,s]);return h==="finished"?null:(0,o.jsxs)("div",{className:(0,p.cn)("desktop:gap-2 laptop:text-base flex items-center gap-1 text-sm",e==="dark"?"text-white":"text-[#080A0F]",n),children:[d&&(0,o.jsx)(u.Picture,{source:d.url,alt:d.alt,className:"laptop:size-5 size-4 shrink-0",imgClassName:"size-full object-contain"}),(0,o.jsx)(u.Text,{html:A,className:"whitespace-nowrap font-bold"}),(0,o.jsx)("span",{className:"font-bold",children:"|"}),(0,o.jsx)(u.Text,{className:"font-bold",html:vt(m)})]})});J.displayName="Countdown";const K=a.memo(({progress:t,theme:e="light",className:n})=>{const s=Math.min(100,Math.max(0,t));return(0,o.jsx)("div",{className:(0,p.cn)("flex h-2 w-full items-stretch overflow-hidden rounded-full",e==="dark"?"bg-white/20":"bg-black/20",n),role:"progressbar","aria-valuenow":s,"aria-valuemin":0,"aria-valuemax":100,children:(0,o.jsx)("div",{className:(0,p.cn)("h-full rounded-full transition-all duration-300",e==="dark"?"bg-white":"bg-[#080A0F]"),style:{width:`${s}%`}})})});K.displayName="ProgressBar";const Q=a.memo(({item:t,theme:e="light",layout:n="vertical",className:s,buttonClassName:r,countdownClassName:g,onButtonClick:d,onProductImageClick:S,buildData:m,buttonText:i,remainText:h,lowStockText:w,soldOutButtonText:c,discountText:v="Only {price}",countdownText:y,countdownIcon:A,lastRoundText:M,beforeStartText:D,comingSoonButtonText:k,loading:P})=>{const{locale:C="us",currencyCode:G}=(0,tt.useAiuiContext)(),l=t.products?.[0],[$,et]=a.useState(()=>H(t.countdown)),[F,ot]=a.useState(()=>W(t.codePrefix,t.countdown)),[z,nt]=a.useState("beforeStart");a.useEffect(()=>{const x=()=>{et(H(t.countdown));const _=W(t.codePrefix,t.countdown);ot(L=>L!==_?_:L)};x();const E=setInterval(x,1e3);return()=>clearInterval(E)},[t.codePrefix,t.countdown]);const at=a.useCallback(x=>{nt(x)},[]),R=a.useMemo(()=>!l?.handle||!m?.products?.length?null:m.products.find(x=>x.handle===l.handle)||null,[l?.handle,m?.products]),f=a.useMemo(()=>R?.variants?.find(x=>x?.sku===l?.sku)||{},[l?.sku,R?.variants]),T=a.useMemo(()=>{const{price:x,basePrice:E}=(0,Z.formatVariantPrice)({locale:G==="CAD"?"us":C||"us",baseAmount:f?.price?.amount,amount:l?.custom_price??f?.price?.amount,currencyCode:R?.price?.currencyCode||"USD"});return{value:E,description:l?.custom_description,salePrice:(0,I.replaceTemplate)(v||"",{price:x})}},[R,f,C,v,l?.custom_price,l?.custom_description]),st=a.useCallback(()=>{d?.({product:l,code:F})},[d,F,l]);return(0,o.jsxs)("div",{className:(0,p.cn)(mt({state:e}),s),"data-ui-component-id":"GiftShelfCard",children:[t.countdown&&(0,o.jsx)("div",{className:"laptop:h-[24px] mb-4 h-[20px]",children:(0,o.jsx)(J,{config:t.countdown,theme:e,className:g,countdownText:y,lastRoundText:M,beforeStartText:D,countdownIcon:A,onStateChange:at})}),(0,o.jsxs)("div",{className:ht({layout:n}),children:[(0,o.jsxs)("div",{className:gt({layout:n}),children:[t.backgroundImage&&(S?(0,o.jsx)("a",{onClick:()=>l&&S(l),className:"cursor-pointer",children:(0,o.jsx)(u.Picture,{source:q(t.backgroundImage),alt:O(t.backgroundImage),className:"rounded-card size-full overflow-hidden object-cover",imgClassName:"h-full w-full object-cover"})}):(0,o.jsx)(u.Picture,{source:q(t.backgroundImage),alt:O(t.backgroundImage),className:"rounded-card size-full overflow-hidden object-cover",imgClassName:"h-full w-full object-cover"})),(0,o.jsx)("div",{className:"absolute top-1/2 z-10 w-full -translate-y-1/2 px-6",children:(0,o.jsxs)("div",{className:"flex flex-col gap-1",children:[T.value&&(0,o.jsx)(u.Heading,{html:T.value,size:4,className:(0,p.cn)("font-bold leading-none",N({state:e}))}),T.description&&(0,o.jsx)(u.Text,{html:T.description,className:(0,p.cn)("text-base font-bold opacity-60",N({state:e}))})]})})]}),(0,o.jsxs)("div",{className:wt({layout:n}),children:[T.salePrice&&(0,o.jsx)(u.Text,{as:"p",html:T.salePrice,className:(0,p.cn)("lg-desktop:text-2xl text-xl font-bold",N({state:e}))}),(0,o.jsx)(K,{progress:l?.custom_inventory?(f?.quantityAvailable||0)/l.custom_inventory*100:0,theme:e,className:(0,p.cn)("mb-1 mt-2",f?.availableForSale&&(f?.quantityAvailable??0)<=0&&"invisible")}),h&&(f?.quantityAvailable??0)>=0&&(0,o.jsx)(u.Text,{html:(0,I.replaceTemplate)(h,{inventory:l?.custom_inventory?.toString()||"",quantity:f?.quantityAvailable?.toString()||"0"}),as:"p",className:(0,p.cn)("laptop:text-base text-sm font-bold",N({state:e}))}),w&&f?.availableForSale&&(f?.quantityAvailable??0)<0&&(0,o.jsx)(u.Text,{html:w,as:"p",className:(0,p.cn)("laptop:text-base text-sm font-bold text-red-500",N({state:e}))}),(0,o.jsx)(u.Button,{size:"lg",className:(0,p.cn)(St({state:e}),r),onClick:st,disabled:!f?.availableForSale||P||$||z==="beforeStart"||z==="finished",loading:P&&f?.availableForSale,children:z==="beforeStart"?k||i:f?.availableForSale?i:c||i})]})]})]})});Q.displayName="GiftShelfCard";const X=a.forwardRef(({classNames:t={},data:e,onButtonClick:n,onProductImageClick:s,buildData:r,loading:g,...d},S)=>{const m=e.theme||"light",i=a.useMemo(()=>e?.items?.length||4,[e?.items]),h=i===2?"horizontal":"vertical",w=a.useMemo(()=>{const c=v=>{switch(v){case"mobile":return{slidesPerView:1.2,spaceBetween:12};case"tablet":return i<=2?{slidesPerView:2,spaceBetween:12}:{slidesPerView:2.5,spaceBetween:12};case"laptop":return i<=3?{slidesPerView:i,spaceBetween:16}:{slidesPerView:3.01,spaceBetween:16};case"desktop":return{slidesPerView:Math.min(i,4),spaceBetween:20}}};return{0:c("mobile"),768:c("tablet"),1025:c("laptop"),1440:c("desktop")}},[i]);return(0,o.jsx)(u.Container,{ref:S,className:(0,p.cn)(t?.root),childClassName:"overflow-hidden","data-ui-component-id":"GiftShelf",...d,children:(0,o.jsx)(V.Swiper,{breakpoints:w,className:"w-full !overflow-visible",children:e.items.map((c,v)=>(0,o.jsx)(V.SwiperSlide,{children:(0,o.jsx)(Q,{item:c,theme:m,layout:h,className:t?.card,buttonClassName:t?.button,countdownClassName:t?.countdown,onButtonClick:n,onProductImageClick:s,buildData:r,buttonText:e.buttonText,discountText:e.discountText,remainText:e.remainText,lowStockText:e.lowStockText,soldOutButtonText:e.soldOutButtonText,countdownText:e.countdownText,lastRoundText:e.lastRoundText,countdownIcon:e?.countdownIcon,beforeStartText:e.beforeStartText,comingSoonButtonText:e.comingSoonButtonText,loading:g})},"giftShelfCardItem"+v))})})});X.displayName="GiftShelf";var xt=(0,Y.withLayout)(X);
|
|
1
|
+
"use strict";"use client";var vt=Object.create;var $=Object.defineProperty;var St=Object.getOwnPropertyDescriptor;var wt=Object.getOwnPropertyNames;var xt=Object.getPrototypeOf,kt=Object.prototype.hasOwnProperty;var bt=(t,e)=>{for(var n in e)$(t,n,{get:e[n],enumerable:!0})},K=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of wt(e))!kt.call(t,r)&&r!==n&&$(t,r,{get:()=>e[r],enumerable:!(i=St(e,r))||i.enumerable});return t};var Ct=(t,e,n)=>(n=t!=null?vt(xt(t)):{},K(e||!t||!t.__esModule?$(n,"default",{value:t,enumerable:!0}):n,t)),Tt=t=>K($({},"__esModule",{value:!0}),t);var At={};bt(At,{default:()=>Vt});module.exports=Tt(At);var o=require("react/jsx-runtime"),s=Ct(require("react")),g=require("../../helpers/index.js"),u=require("../../components/index.js"),y=require("class-variance-authority"),_=require("swiper/react"),rt=require("../../shared/Styles.js"),at=require("../Listing/utils/index.js"),it=require("../AiuiProvider/index.js"),q=require("../Listing/utils/textFormat.js"),lt=require("../../hooks/useExposure.js"),ut=require("../../hooks/useViewItemList.js"),ct=require("../../hooks/useTracking.js"),A=require("../../shared/track.js");const E="image",P="gift_shelf",Q=(t,e,n)=>{const i=n?.find(d=>d.handle===t.handle),r=i?.variants?.find(d=>d?.sku===t.sku);return{item_id:t.sku||"",item_name:r?.title||i?.title||t.name||"",item_variant:r?.title||"",price:String(t.custom_price??r?.price?.amount??""),index:e+1}},yt=(0,y.cva)("desktop:px-6 rounded-card relative min-w-0 overflow-hidden p-4",{variants:{state:{light:"bg-[#EAEAEC]",dark:"bg-[#1E2024]"}},defaultVariants:{state:"light"}}),Nt=(0,y.cva)("",{variants:{layout:{vertical:"",horizontal:"desktop:flex desktop:flex-row desktop:items-stretch desktop:gap-10"}},defaultVariants:{layout:"vertical"}}),Mt=(0,y.cva)("desktop:max-w-[268px] lg-desktop:max-w-[356px] lg-desktop:h-[171px] relative mx-auto h-[118px] max-w-[256px] ",{variants:{layout:{vertical:"",horizontal:"desktop:flex-1 desktop:h-[122px] lg-desktop:h-[161px]"}},defaultVariants:{layout:"vertical"}}),Pt=(0,y.cva)("mt-3",{variants:{layout:{vertical:"",horizontal:"desktop:mt-0 desktop:flex-1 desktop:flex desktop:flex-col desktop:justify-center"}},defaultVariants:{layout:"vertical"}}),Rt=(0,y.cva)("mt-4 self-start",{variants:{state:{light:"bg-[#080A0F] text-white",dark:"bg-white text-[#080A0F]"}},defaultVariants:{state:"light"}}),V=(0,y.cva)("",{variants:{state:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{state:"light"}}),X=t=>{if(!t)return;const e=[];return t.lgDesktop?.url&&e.push(`${t.lgDesktop.url} 1920`),t.desktop?.url&&e.push(`${t.desktop.url} 1439`),t.laptop?.url&&e.push(`${t.laptop.url} 1024`),t.tablet?.url&&e.push(`${t.tablet.url} 767`),t.default?.url&&e.push(t.default.url),e.length>0?e.join(", "):void 0},Y=t=>t&&(t.default?.alt||t.tablet?.alt||t.laptop?.alt||t.desktop?.alt||t.lgDesktop?.alt)||"",Bt=t=>{const e=Math.floor(t/3600),n=Math.floor(t%3600/60),i=t%60;return`${e.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`},U=t=>{if(typeof t=="number")return t;const e=new Date(t).getTime();return isNaN(e)?0:e},Z=t=>{if(!t)return!1;const e=U(t.startTime),n=(t.durationDays??1)*24*3600*1e3,i=t.rounds??1,r=Date.now();if(r<e)return!1;const d=r-e,h=Math.floor(d/n)+1;if(h>i)return!1;const p=e+h*n-r,l=5*60*1e3;return p<=l&&p>0},tt=(t,e)=>{if(!t||!e)return t||"";const n=U(e.startTime),i=(e.durationDays??1)*24*3600*1e3,r=e.rounds??1,d=Date.now();if(d<n){const c=new Date(n),S=`${(c.getUTCMonth()+1).toString().padStart(2,"0")}${c.getUTCDate().toString().padStart(2,"0")}`;return`${t}${S}`}const h=d-n,w=Math.min(Math.floor(h/i)+1,r),p=n+(w-1)*i,l=new Date(p),v=`${(l.getUTCMonth()+1).toString().padStart(2,"0")}${l.getUTCDate().toString().padStart(2,"0")}`;return`${t}${v}`},et=s.memo(({config:t,theme:e="light",className:n,countdownText:i="Next round start time",lastRoundText:r="Last round",beforeStartText:d="Start time",countdownIcon:h,onStateChange:w})=>{const[p,l]=s.useState(0),[v,c]=s.useState("beforeStart"),S=s.useMemo(()=>U(t.startTime),[t.startTime]),C=t.rounds??1,m=(t.durationDays??1)*24*3600*1e3;s.useEffect(()=>{const T=()=>{const N=Date.now();if(N<S){const G=Math.max(0,Math.floor((S-N)/1e3));l(G),c("beforeStart");return}const D=N-S,b=Math.floor(D/m)+1;if(b>C){c("finished");return}const I=S+b*m,R=Math.max(0,Math.floor((I-N)/1e3));l(R),c(b===C?"lastRound":"running")};T();const z=setInterval(T,1e3);return()=>clearInterval(z)},[S,m,C]),s.useEffect(()=>{w?.(v)},[v,w]);const x=s.useMemo(()=>{switch(v){case"beforeStart":return d;case"lastRound":return r;default:return i}},[v,d,r,i]);return v==="finished"?null:(0,o.jsxs)("div",{className:(0,g.cn)("desktop:gap-2 laptop:text-base flex items-center gap-1 text-sm",e==="dark"?"text-white":"text-[#080A0F]",n),children:[h&&(0,o.jsx)(u.Picture,{source:h.url,alt:h.alt,className:"laptop:size-5 size-4 shrink-0",imgClassName:"size-full object-contain"}),(0,o.jsx)(u.Text,{html:x,className:"whitespace-nowrap font-bold"}),(0,o.jsx)("span",{className:"font-bold",children:"|"}),(0,o.jsx)(u.Text,{className:"font-bold",html:Bt(p)})]})});et.displayName="Countdown";const ot=s.memo(({progress:t,theme:e="light",className:n})=>{const i=Math.min(100,Math.max(0,t));return(0,o.jsx)("div",{className:(0,g.cn)("flex h-2 w-full items-stretch overflow-hidden rounded-full",e==="dark"?"bg-white/20":"bg-black/20",n),role:"progressbar","aria-valuenow":i,"aria-valuemin":0,"aria-valuemax":100,children:(0,o.jsx)("div",{className:(0,g.cn)("h-full rounded-full transition-all duration-300",e==="dark"?"bg-white":"bg-[#080A0F]"),style:{width:`${i}%`}})})});ot.displayName="ProgressBar";const nt=s.memo(({item:t,theme:e="light",layout:n="vertical",className:i,buttonClassName:r,countdownClassName:d,onButtonClick:h,onProductImageClick:w,buildData:p,buttonText:l,remainText:v,lowStockText:c,soldOutButtonText:S,discountText:C="Only {price}",countdownText:m,countdownIcon:x,lastRoundText:T,beforeStartText:z,comingSoonButtonText:N,loading:D,position:b})=>{const{locale:I="us",currencyCode:R}=(0,it.useAiuiContext)(),{pageGroup:G}=(0,ct.useTracking)(),a=t.products?.[0],[dt,pt]=s.useState(()=>Z(t.countdown)),[O,mt]=s.useState(()=>tt(t.codePrefix,t.countdown)),[L,ft]=s.useState("beforeStart");s.useEffect(()=>{const k=()=>{pt(Z(t.countdown));const W=tt(t.codePrefix,t.countdown);mt(J=>J!==W?W:J)};k();const F=setInterval(k,1e3);return()=>clearInterval(F)},[t.codePrefix,t.countdown]);const ht=s.useCallback(k=>{ft(k)},[]),B=s.useMemo(()=>!a?.handle||!p?.products?.length?null:p.products.find(k=>k.handle===a.handle)||null,[a?.handle,p?.products]),f=s.useMemo(()=>B?.variants?.find(k=>k?.sku===a?.sku)||{},[a?.sku,B?.variants]),M=s.useMemo(()=>{const{price:k,basePrice:F}=(0,at.formatVariantPrice)({locale:R==="CAD"?"us":I||"us",baseAmount:f?.price?.amount,amount:a?.custom_price??f?.price?.amount,currencyCode:B?.price?.currencyCode||"USD"});return{value:F,description:a?.custom_description,salePrice:(0,q.replaceTemplate)(C||"",{price:k})}},[B,f,I,C,a?.custom_price,a?.custom_description]),j=s.useCallback(()=>{a&&(0,A.trackSelectItem)({pageGroup:G,currency:R||"USD",itemListName:P,position:b+1,items:[Q(a,b,p?.products)]})},[a,G,R,b,p?.products]),gt=s.useCallback(()=>{j(),h?.({product:a,code:O})},[j,h,O,a]),H=f?.title||B?.title||a?.name;return(0,o.jsxs)("div",{className:(0,g.cn)(yt({state:e}),i),"data-ui-component-id":"GiftShelfCard",children:[t.countdown&&(0,o.jsx)("div",{className:"laptop:h-[24px] mb-4 h-[20px]",children:(0,o.jsx)(et,{config:t.countdown,theme:e,className:d,countdownText:m,lastRoundText:T,beforeStartText:z,countdownIcon:x,onStateChange:ht})}),(0,o.jsxs)("div",{className:Nt({layout:n}),children:[(0,o.jsxs)("div",{className:Mt({layout:n}),children:[t.backgroundImage&&(w?(0,o.jsx)("a",{onClick:()=>{a&&(j(),w(a))},className:"cursor-pointer",...(0,A.buildClickTrackingProps)({interactive:!!a,componentType:E,componentName:P,title:H,sku:a?.sku,position:b+1}),children:(0,o.jsx)(u.Picture,{source:X(t.backgroundImage),alt:Y(t.backgroundImage),className:"rounded-card size-full overflow-hidden object-cover",imgClassName:"h-full w-full object-cover"})}):(0,o.jsx)(u.Picture,{source:X(t.backgroundImage),alt:Y(t.backgroundImage),className:"rounded-card size-full overflow-hidden object-cover",imgClassName:"h-full w-full object-cover"})),(0,o.jsx)("div",{className:"absolute top-1/2 z-10 w-full -translate-y-1/2 px-6",children:(0,o.jsxs)("div",{className:"flex flex-col gap-1",children:[M.value&&(0,o.jsx)(u.Heading,{html:M.value,size:4,className:(0,g.cn)("font-bold leading-none",V({state:e}))}),M.description&&(0,o.jsx)(u.Text,{html:M.description,className:(0,g.cn)("text-base font-bold opacity-60",V({state:e}))})]})})]}),(0,o.jsxs)("div",{className:Pt({layout:n}),children:[M.salePrice&&(0,o.jsx)(u.Text,{as:"p",html:M.salePrice,className:(0,g.cn)("lg-desktop:text-2xl text-xl font-bold",V({state:e}))}),(0,o.jsx)(ot,{progress:a?.custom_inventory?(f?.quantityAvailable||0)/a.custom_inventory*100:0,theme:e,className:(0,g.cn)("mb-1 mt-2",f?.availableForSale&&(f?.quantityAvailable??0)<=0&&"invisible")}),v&&(f?.quantityAvailable??0)>=0&&(0,o.jsx)(u.Text,{html:(0,q.replaceTemplate)(v,{inventory:a?.custom_inventory?.toString()||"",quantity:f?.quantityAvailable?.toString()||"0"}),as:"p",className:(0,g.cn)("laptop:text-base text-sm font-bold",V({state:e}))}),c&&f?.availableForSale&&(f?.quantityAvailable??0)<0&&(0,o.jsx)(u.Text,{html:c,as:"p",className:(0,g.cn)("laptop:text-base text-sm font-bold text-red-500",V({state:e}))}),(0,o.jsx)(u.Button,{size:"lg",className:(0,g.cn)(Rt({state:e}),r),onClick:gt,...(0,A.buildClickTrackingProps)({interactive:!!a,componentType:E,componentName:P,title:H,buttonName:l,sku:a?.sku,position:b+1}),disabled:!f?.availableForSale||D||dt||L==="beforeStart"||L==="finished",loading:D&&f?.availableForSale,children:L==="beforeStart"?N||l:f?.availableForSale?l:S||l})]})]})]})});nt.displayName="GiftShelfCard";const st=s.forwardRef(({classNames:t={},data:e,onButtonClick:n,onProductImageClick:i,buildData:r,loading:d,...h},w)=>{const p=e.theme||"light",l=s.useRef(null);s.useImperativeHandle(w,()=>l.current);const v=s.useMemo(()=>e.items.flatMap((m,x)=>{const T=m.products?.[0];return T?[Q(T,x,r?.products)]:[]}),[e.items,r?.products]);(0,lt.useExposure)(l,{componentType:E,componentName:P,componentTitle:e.items?.[0]?.products?.[0]?.name}),(0,ut.useViewItemList)(l,{componentType:E,componentName:P,itemListName:P,items:v});const c=s.useMemo(()=>e?.items?.length||4,[e?.items]),S=c===2?"horizontal":"vertical",C=s.useMemo(()=>{const m=x=>{switch(x){case"mobile":return{slidesPerView:1.2,spaceBetween:12};case"tablet":return c<=2?{slidesPerView:2,spaceBetween:12}:{slidesPerView:2.5,spaceBetween:12};case"laptop":return c<=3?{slidesPerView:c,spaceBetween:16}:{slidesPerView:3.01,spaceBetween:16};case"desktop":return{slidesPerView:Math.min(c,4),spaceBetween:20}}};return{0:m("mobile"),768:m("tablet"),1025:m("laptop"),1440:m("desktop")}},[c]);return(0,o.jsx)(u.Container,{ref:l,className:(0,g.cn)(t?.root),childClassName:"overflow-hidden","data-ui-component-id":"GiftShelf",...h,children:(0,o.jsx)(_.Swiper,{breakpoints:C,className:"w-full !overflow-visible",children:e.items.map((m,x)=>(0,o.jsx)(_.SwiperSlide,{children:(0,o.jsx)(nt,{item:m,theme:p,layout:S,className:t?.card,buttonClassName:t?.button,countdownClassName:t?.countdown,onButtonClick:n,onProductImageClick:i,buildData:r,buttonText:e.buttonText,discountText:e.discountText,remainText:e.remainText,lowStockText:e.lowStockText,soldOutButtonText:e.soldOutButtonText,countdownText:e.countdownText,lastRoundText:e.lastRoundText,countdownIcon:e?.countdownIcon,beforeStartText:e.beforeStartText,comingSoonButtonText:e.comingSoonButtonText,loading:d,position:x})},"giftShelfCardItem"+x))})})});st.displayName="GiftShelf";var Vt=(0,rt.withLayout)(st);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var
|
|
1
|
+
"use strict";"use client";var Z=Object.create;var N=Object.defineProperty;var $=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty;var re=(e,i)=>{for(var l in i)N(e,l,{get:i[l],enumerable:!0})},G=(e,i,l,c)=>{if(i&&typeof i=="object"||typeof i=="function")for(let s of ee(i))!ie.call(e,s)&&s!==l&&N(e,s,{get:()=>i[s],enumerable:!(c=$(i,s))||c.enumerable});return e};var V=(e,i,l)=>(l=e!=null?Z(te(e)):{},G(i||!e||!e.__esModule?N(l,"default",{value:e,enumerable:!0}):l,e)),se=e=>G(N({},"__esModule",{value:!0}),e);var ne={};re(ne,{default:()=>oe});module.exports=se(ne);var t=require("react/jsx-runtime"),o=V(require("react")),f=require("../../helpers/index.js"),a=require("../../components/index.js"),M=require("class-variance-authority"),k=require("swiper/react"),B=V(require("swiper/modules")),E=require("../../shared/Styles.js"),y=require("../AiuiProvider/index.js"),H=require("../Listing/utils/index.js"),R=require("../../hooks/useExposure.js"),U=require("../../hooks/useViewItemList.js"),D=require("../../hooks/useTracking.js"),P=require("../../shared/track.js");const C="image",x="gift_tier_shelf",F=(e,i,l)=>{const c=l?.find(h=>h.handle===e.handle),s=c?.variants?.find(h=>h?.sku===e.sku);return{item_id:e.sku||"",item_name:s?.title||c?.title||e.name||"",item_variant:s?.title||"",price:String(e.custom_price??s?.price?.amount??""),index:i+1}},le=(0,M.cva)("lg-desktop:h-[400px] rounded-card desktop:pt-4 desktop:pb-6 relative flex h-[320px] flex-col items-start gap-1 overflow-hidden p-4",{variants:{theme:{light:"bg-gradient-to-b from-[#FCCA7B] to-[#FFE6BF]",dark:"bg-gradient-to-b from-[#3A3A3A] to-[#1D1D1F]"}},defaultVariants:{theme:"light"}}),z=(0,M.cva)("",{variants:{theme:{light:"text-[#080A0F]",dark:"text-white"}},defaultVariants:{theme:"light"}}),L=o.memo(({image:e})=>e?(0,t.jsx)(a.Picture,{source:e.url,alt:e.alt||"Member Tag",className:"h-full w-auto",imgClassName:"h-full w-auto object-contain"}):null);L.displayName="MemberTag";const _=o.memo(({theme:e="light"})=>{const i=e==="light"?"bg-[#f6cd4e]":"bg-[#F5F6F7]";return(0,t.jsx)("div",{className:"flex h-4 w-full items-center",children:(0,t.jsx)("div",{className:(0,f.cn)("flex h-1 w-full items-center justify-center",i),children:(0,t.jsx)("div",{className:(0,f.cn)("relative size-4 shrink-0 rounded-full",i)})})})});_.displayName="TimelineItem";const j=o.memo(({item:e,theme:i="light",className:l,onClick:c,onProductImageClick:s,interactive:h,buildData:T})=>{const{locale:S="us"}=(0,y.useAiuiContext)(),m=e.products?.[0],u=o.useMemo(()=>!m?.handle||!T?.products?.length?null:T.products.find(v=>v.handle===m.handle)||null,[m?.handle,T?.products]),g=o.useMemo(()=>u?.variants?.find(v=>v?.sku===m?.sku)||{},[m?.sku,u?.variants]),w=(0,H.formatPrice)({locale:S||"us",amount:m?.custom_price??g?.price?.amount,currencyCode:u?.price?.currencyCode||"USD"});return(0,t.jsxs)("div",{className:(0,f.cn)(le({theme:i}),l),onClick:c,"data-ui-component-id":"GiftTierCard",...(0,P.buildClickTrackingProps)({interactive:!!h,componentType:C,componentName:x,title:e.threshold,description:g?.title||u?.title,sku:m?.sku}),children:[(0,t.jsx)("div",{className:"lg-desktop:h-[28px] z-10 h-6",children:e.showMemberTag&&e.memberTagImage&&(0,t.jsx)(L,{image:e.memberTagImage})}),(0,t.jsx)("div",{className:"relative z-10 mx-auto min-h-0 w-fit flex-1",children:s?(0,t.jsx)("a",{onClick:s,className:"cursor-pointer",children:(0,t.jsx)(a.Picture,{source:g?.image?.url||u?.images[0]?.url,className:"size-full",imgClassName:"size-full object-contain"})}):(0,t.jsx)(a.Picture,{source:g?.image?.url||u?.images[0]?.url,className:"size-full",imgClassName:"size-full object-contain"})}),(0,t.jsxs)("div",{className:(0,f.cn)("z-10 flex w-full shrink-0 flex-col gap-2",z({theme:i})),children:[(0,t.jsxs)("div",{className:"flex items-end gap-1",children:[(0,t.jsx)(a.Heading,{html:w,size:4,className:"font-bold leading-[1.2] tracking-[-0.04em]"}),e.valueUnit&&(0,t.jsx)(a.Text,{html:e.valueUnit,className:"lg-desktop:text-2xl text-xl font-bold leading-[1.2] tracking-[-0.04em]"})]}),(0,t.jsx)(a.Text,{html:g?.title||u?.title,className:"lg-desktop:text-2xl line-clamp-2 min-h-[48px] text-wrap text-xl font-bold leading-[1.2] tracking-[-0.04em]"})]})]})});j.displayName="GiftTierCard";const A=o.forwardRef(({classNames:e={},data:i,onCardClick:l,onProductImageClick:c,buildData:s,...h},T)=>{const S=i.theme||"light",m=i.showTimeline!==!1,{pageGroup:u}=(0,D.useTracking)(),{currencyCode:g}=(0,y.useAiuiContext)(),w=o.useRef(null);o.useImperativeHandle(T,()=>w.current);const v=!!(l||c),[q,J]=o.useState(null),[K,O]=o.useState(null),d=o.useMemo(()=>s?.products?.length?i.items.filter(r=>{const n=r.products?.[0];return n?.handle?s.products.find(b=>b.handle===n.handle)?.variants?.find(b=>b?.sku===n?.sku)?.availableForSale!==!1:!0}):i.items,[i.items,s?.products]),Q=o.useMemo(()=>d.flatMap((r,n)=>{const p=r.products?.[0];return p?[F(p,n,s?.products)]:[]}),[d,s?.products]);(0,R.useExposure)(w,{componentType:C,componentName:x,componentTitle:d[0]?.threshold}),(0,U.useViewItemList)(w,{componentType:C,componentName:x,itemListName:x,items:Q});const W=(r,n)=>{const p=r.products?.[0];v&&p&&(0,P.trackSelectItem)({pageGroup:u,currency:g||"USD",itemListName:x,position:n+1,items:[F(p,n,s?.products)]}),l?.(r,n)},X=o.useMemo(()=>{const r=d.length;return{0:{slidesPerView:1.2,spaceBetween:12},768:{slidesPerView:Math.min(r,2.5),spaceBetween:12},1025:{slidesPerView:Math.min(r,3.5),spaceBetween:16},1440:{slidesPerView:Math.min(r,4),spaceBetween:16}}},[d.length]),Y=o.useMemo(()=>{const r=d.length;return{0:{slidesPerView:1.2,spaceBetween:0},768:{slidesPerView:Math.min(r,2.5),spaceBetween:0},1025:{slidesPerView:Math.min(r,3.5),spaceBetween:0},1440:{slidesPerView:Math.min(r,4),spaceBetween:0}}},[d.length]),I=o.useMemo(()=>B.Controller?[B.Controller]:[],[]);return(0,t.jsxs)(a.Container,{ref:w,className:(0,f.cn)(e?.root),childClassName:"overflow-hidden","data-ui-component-id":"GiftTierShelf",...h,children:[(0,t.jsx)(k.Swiper,{modules:I,breakpoints:X,className:"w-full !overflow-visible",onSwiper:J,controller:{control:K},children:d.map((r,n)=>(0,t.jsx)(k.SwiperSlide,{children:(0,t.jsx)(j,{item:r,theme:S,buildData:s,className:e?.card,interactive:v,onClick:()=>W(r,n),onProductImageClick:()=>{const p=r.products?.[0];p&&c?.(p,r)}})},"giftTierItem"+n))}),m&&(0,t.jsx)("div",{className:"mt-4 flex flex-col gap-4",children:(0,t.jsx)("div",{className:(0,f.cn)("w-full",e?.timeline),children:(0,t.jsx)(k.Swiper,{modules:I,breakpoints:Y,className:"w-full !overflow-visible",onSwiper:O,controller:{control:q},children:d.map((r,n)=>(0,t.jsx)(k.SwiperSlide,{children:(0,t.jsxs)("div",{className:"flex flex-col items-center",children:[(0,t.jsx)(_,{theme:S}),(0,t.jsx)(a.Text,{html:r.threshold,className:(0,f.cn)("lg-desktop:text-2xl text-center text-xl font-bold leading-[1.2] tracking-[-0.04em]",z({theme:S}),e?.thresholdText)})]})},"timelineItem"+n))})})})]})});A.displayName="GiftTierShelf";var oe=(0,E.withLayout)(A);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var
|
|
1
|
+
"use strict";"use client";var O=Object.create;var T=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty;var se=(e,o)=>{for(var s in o)T(e,s,{get:o[s],enumerable:!0})},P=(e,o,s,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of ee(o))!oe.call(e,i)&&i!==s&&T(e,i,{get:()=>o[i],enumerable:!(c=W(o,i))||c.enumerable});return e};var I=(e,o,s)=>(s=e!=null?O(te(e)):{},P(o||!e||!e.__esModule?T(s,"default",{value:e,enumerable:!0}):s,e)),le=e=>P(T({},"__esModule",{value:!0}),e);var ne={};se(ne,{default:()=>re});module.exports=le(ne);var t=require("react/jsx-runtime"),U=require("react-responsive"),r=I(require("react")),z=require("react-dom"),a=require("../../helpers/utils.js"),R=require("../../shared/Styles.js"),H=I(require("../SwiperBox/index.js")),l=require("../../components/index.js"),C=I(require("../Title/index.js")),E=require("../VideoModal/index.js"),j=require("../TextModal/index.js"),M=require("../../hooks/useExposure.js"),y=require("../../shared/trackUrlRef.js"),Y=require("../AiuiProvider/index.js"),ce=require("swiper/css"),_=require("../../hooks/useTracking.js");const u="image",h="graphic",B=e=>{let o="";const s=m=>(m?.url&&(o=m.url),o),c=s(e.lgDesktop),i=s(e.desktop),p=s(e.laptop),b=s(e.tablet),g=e.default?.url;return[`${c} 9999`,`${i} 1919`,`${p} 1439`,`${b} 1024`,`${g} 768`].join(", ")},L="descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]",ie=({data:e,configuration:o})=>{const{buildRef:s}=(0,_.useTracking)(),c=(0,r.useRef)(null),[i,p]=(0,r.useState)({visible:!1,x:0,y:0,text:""}),b=o?.descriptionTag||"h3",g=()=>{switch(o.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]"}},m=n=>{e?.description&&p({visible:!0,x:n.clientX,y:n.clientY,text:e.description})},v=()=>{p(n=>({...n,visible:!1}))};(0,M.useExposure)(c,{componentType:u,componentName:h,componentTitle:e?.title,componentDescription:e?.description,position:o?.index+1});const x=e?.href?"a":"div",w=e?.href?{href:(0,y.trackUrlRef)((0,a.getLocalizedPath)(e.href,o?.locale||"us"),s(u,h))}:{};return(0,t.jsx)("div",{ref:c,className:(0,a.cn)(g(),"graphicItem","laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]",{"aiui-dark":e.theme==="dark"}),children:(0,t.jsx)("div",{className:(0,a.cn)("rounded-box absolute inset-0 overflow-hidden"),children:(0,t.jsxs)("div",{className:`graphic-children relative block size-full overflow-hidden ${e?.href?"cursor-pointer":""}`,children:[e?.href?(0,t.jsxs)("a",{"aria-label":e?.title||e?.description,href:(0,y.trackUrlRef)((0,a.getLocalizedPath)(e?.href||"",o?.locale||"us"),s(u,h)),className:"rounded-card block size-full overflow-hidden","data-headless-nav-postion":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:[(0,t.jsx)(l.Picture,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?B(e.backgroundImage):e?.imgUrl?.url,alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""}),(0,t.jsx)("span",{className:"sr-only",children:e?.title||e?.description})]}):(0,t.jsx)("div",{className:"rounded-card block size-full overflow-hidden",children:(0,t.jsx)(l.Picture,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?B(e.backgroundImage):e?.imgUrl?.url||"",alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""})}),(0,t.jsxs)(x,{...w,className:(0,a.cn)("laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4",{"bg-gradient-to-b from-transparent to-black/80":e?.showBottomGradient&&e?.theme==="dark","bg-gradient-to-b from-transparent to-white/80":e?.showBottomGradient&&e?.theme!=="dark"}),children:[(0,t.jsxs)("div",{className:(0,a.cn)("flex items-end gap-1 overflow-hidden","graphic-bottom"),children:[(0,t.jsxs)("div",{className:"flex-1 overflow-hidden",children:[(0,t.jsx)(l.Text,{html:e?.title,style:{color:e?.textColor},className:"spanTitle graphic-title lg-desktop:text-lg desktop:text-base line-clamp-3 text-sm font-bold leading-[1.2]"}),e?.description&&(0,t.jsxs)("div",{onMouseMove:m,onMouseLeave:v,children:[e?.title?(0,t.jsx)(l.Heading,{html:e?.description,style:{color:e?.textColor},as:b,className:`${L} graphic-description`}):(0,t.jsx)(b,{style:{color:e?.textColor},dangerouslySetInnerHTML:{__html:e?.description||""},className:`${L} graphic-description-item`}),typeof window<"u"&&i.visible&&(0,z.createPortal)((0,t.jsx)(l.Text,{as:"div",html:i.text,className:"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200",style:{left:`${i.x+16}px`,top:`${i.y+16}px`}}),document.body)]})]}),!e?.isShowIcon&&(e?.video?.url||e?.youtubeId)&&(0,t.jsx)("button",{"aria-label":"Play Video",onClick:n=>{n.preventDefault(),n.stopPropagation(),o?.onVideoPlayBtnClick?.(o?.index||0,e)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white/20 hover:bg-black/75",children:(0,t.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})}),e?.isShowIcon&&e?.icon?.url&&(0,t.jsx)("button",{onClick:n=>{n.preventDefault(),n.stopPropagation(),o?.onIconClick?.(e,o)},className:"laptop:size-9 flex size-8 items-center justify-center overflow-hidden rounded-full bg-white/20 hover:bg-black/75",children:(0,t.jsx)(l.Picture,{className:"h-full",imgClassName:"h-full object-cover",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),e.buttonText&&(0,t.jsx)(l.Button,{as:"a","aria-label":e?.title||e?.description,variant:"secondary",className:"bgButton mt-[8px] self-start",href:(0,y.trackUrlRef)((0,a.getLocalizedPath)(e?.href||"",o?.locale||"us"),s(u,h)),"data-headless-nav-position":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}#${e?.buttonText}`,children:e.buttonText})]})]})})})},D=({items:e=[],sharedConfig:o})=>{const s=c=>{const i=e.length>3,p=e.length>2;switch(c){case 1440:return i?4:e.length;case 1024:return i?3:e.length;case 768:return e.length===1?1:i||p?2.3:2;default:return e.length===1?1:1.2}};return(0,t.jsx)(H.default,{id:"Graphic",className:(0,a.cn)("!overflow-visible"),data:{list:e,configuration:{...o,num:e.length}},Slide:ie,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:s()},768:{spaceBetween:16,freeMode:!1,slidesPerView:s(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:s(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:s(1440)}}})},A=r.default.forwardRef(({data:e,className:o,...s},c)=>{const i=(0,U.useMediaQuery)({query:"(max-width: 768px)"}),p=(0,r.useRef)(null),[b,g]=(0,r.useState)(!1),[m,v]=(0,r.useState)(""),[x,w]=(0,r.useState)(""),[n,N]=(0,r.useState)(""),[q,S]=(0,r.useState)(null),[Q,V]=(0,r.useState)(!1),{locale:X="us"}=(0,Y.useAiuiContext)(),Z=e?.isShowTab??!1,f=e?.tabs,F=e?.tabAlign??"left",[J,K]=(0,r.useState)(f?.[0]?.id??"");(0,r.useImperativeHandle)(c,()=>p.current),(0,M.useExposure)(p,{componentType:u,componentName:h,componentTitle:e?.title});const $={itemShape:e?.itemShape,descriptionTag:e?.descriptionTag,locale:X,onVideoPlayBtnClick:(d,k)=>{g(!0),k?.isYouTube?(w(k?.youtubeId||""),v(""),N("")):(w(""),v(k?.video?.url||""),N(k?.mobileVideo?.url||""))},onIconClick:d=>{V(!0),S(d)}},G=()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(E.VideoModal,{visible:b,youTubeId:x,onCloseModal:()=>g(!1),videoUrl:x?"":i&&n||m}),(0,t.jsx)(j.TextModal,{textVisible:Q,extension:q?.extension,onCloseModal:()=>{V(!1),S(null)}})]});return!Z||!f||f.length===0?(0,t.jsxs)("div",{...s,ref:p,className:(0,a.cn)("graphicBlock",o),children:[(0,t.jsxs)("div",{className:"graphic-box",children:[e?.title&&(0,t.jsx)(C.default,{data:{title:e.title,align:e?.titleAlign??"left"}}),(0,t.jsx)(D,{items:e?.items,sharedConfig:$})]}),G()]}):(0,t.jsxs)("div",{...s,ref:p,className:(0,a.cn)("graphicBlock",o),children:[e?.title&&(0,t.jsx)(C.default,{data:{title:e.title,align:e?.titleAlign??"left"}}),(0,t.jsxs)(l.Tabs,{value:J,onValueChange:K,align:F,children:[(0,t.jsx)("div",{className:"mb-[24px]",children:(0,t.jsx)(l.TabsList,{children:f.map(d=>(0,t.jsx)(l.TabsTrigger,{value:d.id,children:d.label},d.id))})}),f.map(d=>(0,t.jsx)(l.TabsContent,{value:d.id,children:(0,t.jsx)(D,{items:d.items,sharedConfig:$})},d.id))]}),G()]})});A.displayName="Graphic";var re=(0,R.withLayout)(A);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var Z=Object.create;var P=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var K=(a,t)=>{for(var s in t)P(a,s,{get:t[s],enumerable:!0})},G=(a,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of j(t))!J.call(a,i)&&i!==s&&P(a,i,{get:()=>t[i],enumerable:!(n=_(t,i))||n.enumerable});return a};var V=(a,t,s)=>(s=a!=null?Z(F(a)):{},G(t||!a||!a.__esModule?P(s,"default",{value:a,enumerable:!0}):s,a)),W=a=>G(P({},"__esModule",{value:!0}),a);var te={};K(te,{default:()=>ee});module.exports=W(te);var e=require("react/jsx-runtime"),r=V(require("react")),U=require("react-responsive"),A=require("../../shared/Styles.js"),O=V(require("../../components/picture.js")),I=V(require("../../components/button.js")),L=require("../../components/heading.js"),v=require("../../components/tabs.js"),E=require("../VideoModal/index.js"),p=require("../../helpers/utils.js"),D=V(require("../SwiperBox/index.js")),S=require("../../shared/mimeType.js"),H=require("../../hooks/useExposure.js"),C=require("../../shared/trackUrlRef.js"),Y=require("../AiuiProvider/index.js"),Q=require("../../hooks/useTracking.js");const y="image",k="p1_banner",X=({data:a,configuration:t,jIndex:s})=>{const{buildRef:n}=(0,Q.useTracking)(),[i,h]=(0,r.useState)(!1),c=(0,U.useMediaQuery)({query:"(max-width: 768px)"}),b=(0,r.useRef)(null),d=()=>{switch(t?.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[400] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[426] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[426] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}};(0,H.useExposure)(b,{componentType:y,componentName:k,position:s,componentTitle:a.title,componentDescription:a.description,navigation:t?.activeTab}),(0,r.useEffect)(()=>{h(c)},[c]);const{theme:w="light",title:o,description:m,imageUrl:u,primaryButton:f,secondaryButton:g,imageMobileUrl:x,blockLink:T,video:$,youtubeId:N,isYouTube:M}=a,B="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return(0,e.jsxs)("div",{className:(0,p.cn)("item-wrapper text-info-primary group relative box-border w-full overflow-hidden",d(),{"rounded-box":!0,"aiui-dark":w==="dark","h-[400px]":i},"text-info-primary"),ref:b,children:[T&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:(0,C.trackUrlRef)((0,p.getLocalizedPath)(T||"",t?.locale||"us"),n(y,k)),"data-headless-type-name":`${y}#${k}`,"data-headless-title-desc-button":`${o}#${m}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,"aria-hidden":"true",tabIndex:-1}),(0,e.jsxs)("div",{className:"absolute inset-0",children:[(0,S.isVideo)(u?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:block hidden h-full overflow-hidden",children:(0,e.jsx)("source",{src:u?.url,type:"video/mp4"})}):(0,e.jsx)(O.default,{source:u?.url,alt:u?.alt||"",className:"tablet:block hidden h-full overflow-hidden",imgClassName:(0,p.cn)("h-full object-cover",T&&"transition-all duration-300 group-hover:scale-105"),style:{aspectRatio:`${u?.width}/${u?.height}`}}),(0,S.isVideo)(x?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:hidden block h-full overflow-hidden",children:(0,e.jsx)("source",{src:x?.url,type:"video/mp4"})}):(0,e.jsx)(O.default,{source:x?.url||u?.url,alt:x?.alt||u?.alt||"",className:"tablet:hidden block h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 object-cover"}),(0,e.jsxs)("div",{className:(0,p.cn)("laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 pointer-events-none absolute inset-x-0 bottom-0 z-20 flex w-fit flex-col gap-6 p-4",{"laptop:top-1/2 laptop:-translate-y-1/2 laptop:bottom-auto":a?.width==="full"}),children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(L.Heading,{size:3,as:"h3",className:"item-title",html:o}),(0,e.jsx)(L.Heading,{as:"h4",className:"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-3 text-[14px]",html:m})]}),(0,e.jsxs)("div",{className:"lg-desktop:gap-3 flex gap-2",children:[g&&g.text&&(0,e.jsxs)(I.default,{"aria-label":o??m,className:(0,p.cn)(B,"link-left pointer-events-auto"),variant:"secondary",as:"a",href:(0,C.trackUrlRef)((0,p.getLocalizedPath)(g.link||"",t?.locale||"us"),n(y,k)),"data-headless-type-name":`${y}#${k}`,"data-headless-title-desc-button":`${o}#${m}#${g?.text}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,children:[g.text,(0,e.jsx)("span",{className:"sr-only",children:o??m})]}),f&&f.text&&(0,e.jsx)(I.default,{"aria-label":o??m,className:(0,p.cn)(B,"link-right pointer-events-auto"),variant:"primary",as:"a",href:(0,C.trackUrlRef)((0,p.getLocalizedPath)(f.link||"",t?.locale||"us"),n(y,k)),"data-headless-type-name":`${y}#${k}`,"data-headless-title-desc-button":`${o}#${m}#${f.text}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,children:f.text})]})]})]}),(0,e.jsx)("div",{children:(0,e.jsx)("div",{className:"laptop:bottom-[32px] laptop:right-[32px] absolute bottom-[16px] right-[16px]",children:($?.url||N)&&(0,e.jsx)("button",{onClick:()=>{t?.onVideoPlayBtnClick?.($?.url||N,M)},className:"laptop:size-12 hover:bg-current/75 bg-info-primary flex size-8 items-center justify-center rounded-full opacity-80",children:(0,e.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:w==="dark"?"black":"white",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z"})})})})})]})},z=({items:a=[],shape:t,locale:s,activeTab:n,onVideoPlayBtnClick:i})=>{const h=c=>{const b=a?.length,d=b>3,w=b>2,o=b>1;switch(!0){case c>=1440:case c>=1024:return d?3:b;case c>=768:return d||w?2.3:o?2:1;default:return o?1.2:1}};return(0,e.jsx)(D.default,{className:"!overflow-visible",id:"GraphicOverlaySwiper",data:{list:a||[],configuration:{shape:t,num:a.length,locale:s,activeTab:n,onVideoPlayBtnClick:i}},Slide:X,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:h(374)},768:{spaceBetween:16,freeMode:!1,slidesPerView:h(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:h(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:h(1440)}}})},R=r.default.forwardRef((a,t)=>{const{data:s,className:n,...i}=a,{shape:h,items:c=[],isShowTab:b=!1,tabs:d,tabAlign:w="left"}=s,[o,m]=(0,r.useState)(!1),[u,f]=(0,r.useState)(""),[g,x]=(0,r.useState)(""),[T,$]=(0,r.useState)(d?.[0]?.id??""),{locale:N="us"}=(0,Y.useAiuiContext)(),M=(l,q)=>{m(!0),q?x?.(l||""):f?.(l||"")},B=()=>(0,e.jsx)(E.VideoModal,{visible:o,youTubeId:g,videoUrl:u,onCloseModal:()=>m(!1)});return!b||!d||d.length===0?(0,e.jsxs)("section",{"data-ui-component-id":"GraphicOverlay",ref:t,...i,className:(0,p.cn)("graphicOverlayBlock text-info-primary ",n),children:[c&&c.length>0?(0,e.jsx)(z,{items:c,shape:h,locale:N,onVideoPlayBtnClick:M}):null,o&&B()]}):(0,e.jsxs)("section",{"data-ui-component-id":"GraphicOverlay",ref:t,...i,className:(0,p.cn)("graphicOverlayBlock text-info-primary ",n),children:[(0,e.jsxs)(v.Tabs,{value:T,onValueChange:$,align:w,children:[(0,e.jsx)("div",{className:"mb-6",children:(0,e.jsx)(v.TabsList,{children:d.map(l=>(0,e.jsx)(v.TabsTrigger,{value:l.id,children:l.label},l.id))})}),d.map(l=>(0,e.jsx)(v.TabsContent,{value:l.id,children:l.items&&l.items.length>0?(0,e.jsx)(z,{items:l.items,shape:h,locale:N,activeTab:l.id,onVideoPlayBtnClick:M}):null},l.id))]}),o&&B()]})});R.displayName="GraphicOverlayBlock";var ee=(0,A.withLayout)(R);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var fe=Object.create;var S=Object.defineProperty;var he=Object.getOwnPropertyDescriptor;var ge=Object.getOwnPropertyNames;var ve=Object.getPrototypeOf,be=Object.prototype.hasOwnProperty;var we=(n,p)=>{for(var g in p)S(n,g,{get:p[g],enumerable:!0})},U=(n,p,g,b)=>{if(p&&typeof p=="object"||typeof p=="function")for(let v of ge(p))!be.call(n,v)&&v!==g&&S(n,v,{get:()=>p[v],enumerable:!(b=he(p,v))||b.enumerable});return n};var _e=(n,p,g)=>(g=n!=null?fe(ve(n)):{},U(p||!n||!n.__esModule?S(g,"default",{value:n,enumerable:!0}):g,n)),ye=n=>U(S({},"__esModule",{value:!0}),n);var Ie={};we(Ie,{default:()=>Te});module.exports=ye(Ie);var e=require("react/jsx-runtime"),a=_e(require("react")),r=require("../../components/index.js"),l=require("../../helpers/utils.js"),ee=require("../../shared/Styles.js"),te=require("../../hooks/useExposure.js"),ie=require("../../hooks/useIntersectionObserver.js"),ae=require("../AiuiProvider/index.js"),k=require("framer-motion");const ke="image",Ne="image_with_text",X=(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:(0,e.jsx)("path",{d:"M6.91009 4.41058C7.23553 4.08514 7.76304 4.08514 8.08848 4.41058L13.0885 9.41058C13.4139 9.73602 13.4139 10.2635 13.0885 10.589L8.08848 15.589C7.76304 15.9144 7.23553 15.9144 6.91009 15.589C6.58466 15.2635 6.58466 14.736 6.91009 14.4106L11.3209 9.99977L6.91009 5.58897C6.58466 5.26353 6.58466 4.73602 6.91009 4.41058Z",fill:"currentColor"})}),Y=a.default.forwardRef(({data:n,className:p},g)=>{const{title:b,subtitle:v,desc:_,descIcon:M,image:N,padImage:z,mobileImage:E,theme:oe="dark",items:H=[],layout:le="left",mediaType:se="image",datalist:d=[],video:j,padVideo:R,mobVideo:W,button:w,textAlign:m="left",titleTag:re}=n,i=le,{locale:C="us"}=(0,ae.useAiuiContext)(),D=(0,a.useRef)(null),I=(0,a.useRef)(null),L=(0,a.useRef)(null),P=(0,a.useRef)(null),A=(0,a.useRef)(null),[u,ne]=(0,a.useState)(0),q=(0,a.useRef)([]),[$,me]=(0,a.useState)({left:0,width:0}),[y,B]=(0,a.useState)(""),[F,O]=(0,a.useState)(""),[Z,G]=(0,a.useState)(""),c=d.length>0,T=se==="video";(0,te.useExposure)(D,{componentType:ke,componentName:Ne,componentTitle:b,componentDescription:v}),(0,a.useImperativeHandle)(g,()=>D.current),(0,a.useEffect)(()=>{if(d.length>0){const t=q.current[u];if(t){const{offsetLeft:s,offsetWidth:o}=t;me({left:s,width:o})}}},[u,d.length]);const[J,de]=(0,a.useState)(!1);(0,ie.useIntersectionObserverDelay)(A,{once:!0,threshold:.01,callback:()=>{de(!0)}}),(0,a.useEffect)(()=>{if(!J||!T)return;let t="",s="",o="";if(c&&d[u]){const f=d[u];t=f.video?.url||"",s=f.padVideo?.url||t,o=f.mobVideo?.url||t}else t=j?.url||"",s=R?.url||t,o=W?.url||t;t&&B(t),s&&O(s),o&&G(o),setTimeout(()=>{[I.current?.querySelector("video"),L.current?.querySelector("video"),P.current?.querySelector("video")].forEach(h=>{h&&(h.load(),h.play().catch(()=>{}))})},200)},[J,T,c,u,d,j?.url,R?.url,W?.url]);const pe=(t,s)=>{if(ne(t),s.target.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),T&&c&&d[t]){const o=d[t];o.video?.url&&B(o.video.url),o.padVideo?.url&&O(o.padVideo.url),o.mobVideo?.url&&G(o.mobVideo.url),setTimeout(()=>{[I.current?.querySelector("video"),L.current?.querySelector("video"),P.current?.querySelector("video")].forEach(h=>{h&&(h.load(),h.play().catch(()=>{}))})},300)}},ce=()=>!V||!w?.text||i==="top"||i==="bottom"?null:(0,e.jsx)("div",{className:(0,l.cn)("image-with-text__button-wrapper laptop:mt-[32px] mt-[24px]",{"flex justify-center":m==="center","flex justify-start":m==="left"}),children:(0,e.jsx)(r.Link,{href:(0,l.getLocalizedPath)(w.link||"",C),className:"image-with-text__button whitespace-nowrap no-underline",suffixIcon:X,children:w.text})}),x=H.length>0,V=!!w,K=()=>{if(c&&d[u]){const t=d[u];return`${t.image?.url} ,${t.imgPad?.url||t.image?.url} 1440, ${t.imageMob?.url||t.image?.url} 767`}return N?`${N?.url},${z?.url||N?.url} 1024, ${E?.url||N?.url} 768`:""},Q=()=>{if(c){const f=d[u],h=f.image?.url,xe=f.imgPad?.url||h,ue=f.imageMob?.url||h;return(0,e.jsx)(k.AnimatePresence,{mode:"wait",children:(0,e.jsx)(k.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"image-with-text__video-motion absolute left-0 top-0 w-full",children:(0,e.jsxs)("div",{className:"image-with-text__video-wrapper rounded-box overflow-hidden",children:[(0,e.jsx)("div",{ref:I,className:"image-with-text__desktop-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:h,src:y,loop:!0,className:"image-with-text__video image-with-text__video--desktop lg-desktop:block hidden size-full object-cover"})}),(0,e.jsx)("div",{ref:L,className:"image-with-text__tablet-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:xe,src:F||y,loop:!0,className:"image-with-text__video image-with-text__video--tablet tablet:block lg-desktop:hidden hidden"})}),(0,e.jsx)("div",{ref:P,className:"image-with-text__mobile-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:ue,src:Z||y,loop:!0,className:"image-with-text__video image-with-text__video--mobile tablet:hidden block"})})]})},f.video?.url||f.image?.url)})}const t=N?.url,s=z?.url||t,o=E?.url||t;return(0,e.jsxs)("div",{className:"image-with-text__video-wrapper rounded-box laptop:rounded-box overflow-hidden",children:[(0,e.jsx)("div",{ref:I,className:"image-with-text__desktop-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:t,src:y,loop:!0,className:"image-with-text__video image-with-text__video--desktop lg-desktop:block hidden size-full object-cover"})}),(0,e.jsx)("div",{ref:L,className:"image-with-text__tablet-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:s,src:F||y,loop:!0,className:"image-with-text__video image-with-text__video--tablet tablet:block lg-desktop:hidden hidden"})}),(0,e.jsx)("div",{ref:P,className:"image-with-text__mobile-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:o,src:Z||y,loop:!0,className:"image-with-text__video image-with-text__video--mobile tablet:hidden block"})})]})};return(0,e.jsxs)("section",{ref:D,"data-ui-component-id":"ImageWithText",className:(0,l.cn)("image-with-text text-info-primary",{"flex gap-[24px] laptop:gap-[48px] lg-desktop:gap-[64px]":!c,"flex-col":!c&&(i==="top"||i==="bottom"),"items-center":i==="left"||i==="right","flex-col laptop:flex-row":!c&&(i==="left"||i==="right"),"flex l:gap-[24px] xl:flex-col min-md:justify-between min-l:gap-[20px]":c,"aiui-dark":oe==="dark"},p),children:[c&&(b||_||d.length>0)&&(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__tab-content min-md:gap-[24px] laptop:basis-[36%] inline-flex flex-col justify-center",{"text-left":m==="left","text-center":m==="center"}),children:[(0,e.jsxs)("div",{className:"image-with-text__header",children:[(0,e.jsx)(r.Heading,{as:"h3",size:4,html:b,className:"image-with-text__title"}),(0,e.jsx)(r.Text,{as:"p",size:1,html:_,className:"image-with-text__description tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-[14px]"})]}),(0,e.jsx)("div",{className:(0,l.cn)("image-with-text__tabs-wrapper md:scrollbar-hidden relative md:overflow-hidden md:overflow-x-scroll",{"flex justify-center":m==="center"}),children:(0,e.jsxs)("div",{className:"image-with-text__tabs rounded-btn relative inline-flex bg-[#1D1D1F] px-[4px] md:my-[24px]",children:[(0,e.jsx)("div",{className:"image-with-text__slider rounded-btn absolute inset-y-0 bg-white transition-all duration-300 ease-in-out",style:{left:$.left,width:$.width}}),d.map((t,s)=>(0,e.jsx)("div",{ref:o=>{q.current[s]=o},onClick:o=>pe(s,o),className:(0,l.cn)("image-with-text__tab rounded-btn min-xxl:px-[28px] min-xxl:py-[15px] relative z-10 cursor-pointer px-[20px] py-[10px] text-center text-[12px] font-medium transition-colors duration-300 md:px-[20px] md:py-[10px]",u===s?"image-with-text__tab--active text-black":"text-white"),children:(0,e.jsx)(r.Heading,{as:re??"h3",size:1,html:t?.title,className:"image-with-text__tab-title text-balance-normal !whitespace-nowrap md:text-[14px]"})},s))]})})]}),!c&&(b||v||_)&&(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__content flex w-full flex-col",{"justify-center":!V,"justify-between":V,"items-start":m==="left"&&x,"items-center":m==="center"&&x,"text-left":m==="left","text-center":m==="center","laptop:order-1":i==="left"}),children:[(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__main-content",{"flex flex-col":V}),children:[(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__header",{"laptop:flex laptop:items-end laptop:justify-between laptop:gap-16":(i==="top"||i==="bottom")&&w?.text}),children:[(0,e.jsxs)("div",{className:"image-with-text__title-wrapper flex min-w-0 flex-1 flex-col",children:[(0,e.jsx)(r.Heading,{as:"h2",size:4,html:b,className:(0,l.cn)("image-with-text__title",{"text-left":x&&m==="left","text-center":x&&m==="center"})}),v&&(0,e.jsx)(r.Text,{as:"p",size:x?4:3,html:v,className:(0,l.cn)("image-with-text__subtitle tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-[14px]",{"laptop:mt-[16px]":!x,"min-xxl:mt-[8px] laptop:text-[16px] lg-desktop:text-[18px]":x,"text-left":x&&m==="left","text-center":x&&m==="center"})})]}),(i==="top"||i==="bottom")&&w?.text&&(0,e.jsx)(r.Link,{href:(0,l.getLocalizedPath)(w.link||"",C),className:"laptop:flex hidden whitespace-nowrap no-underline",suffixIcon:X,children:w.text})]}),!x&&(_||M)&&(0,e.jsxs)("div",{className:"image-with-text__description flex flex-row gap-[8px]",children:[M&&(0,e.jsx)("img",{src:M,alt:"icon",className:"image-with-text__description-icon desktop:size-[48px] size-[36px]"}),_&&(0,e.jsx)(r.Heading,{as:"h4",size:5,html:_,className:"image-with-text__description-text min-md:text-[40px] min-l:text-[40px] min-xl:text-[56px] min-xxl:text-[64px] text-[#3AD1FF] md:text-[40px]"})]}),x&&(0,e.jsx)("div",{className:(0,l.cn)("image-with-text__items laptop:mt-[32px] desktop:mt-[48px] mt-[24px] grid w-full gap-6",{"!mt-6":i==="top"||i==="bottom","grid-cols-2 tablet:grid-cols-4":i==="top"||i==="bottom","grid-cols-2 tablet:grid-cols-4 laptop:grid-cols-2":i==="left"||i==="right"}),children:H.map((t,s)=>(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__item",{"text-center":m==="center"}),children:[(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__item-header flex flex-row items-center gap-[8px]",{"justify-center":m==="center","justify-start":m==="left"}),children:[t.icon?.url&&(0,e.jsx)(r.Picture,{source:t.icon.url,alt:t.icon?.alt,className:"image-with-text__item-icon min-md:text-[40px] min-l:text-[40px] min-xl:text-[56px] min-xxl:text-[64px] desktop:h-[44px] lg-desktop:h-[52px] h-[28px] translate-y-[-12%] md:text-[40px]",imgClassName:"h-full !w-full"}),(0,e.jsx)(r.Heading,{size:4,as:"h6",className:"image-with-text__item-text bg-gradient-to-r from-[#3ad1ff] to-[#008cd6] bg-clip-text text-transparent",children:t.text})]}),(0,e.jsx)(r.Text,{size:4,as:"p",html:t.desc,className:"image-with-text__item-desc tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[-2px] text-[14px]"})]},s))})]}),ce()]}),(0,e.jsx)("div",{ref:A,className:(0,l.cn)("image-with-text__media-wrapper",{"laptop:w-[60%] w-full shrink-0":i==="left"||i==="right","aspect-[716/720] max-h-[560px] max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[824/560] shrink-0":x,"laptop:basis-[63%] desktop:basis-[57%]":x&&i==="left","relative w-full shrink md:aspect-[358/360] min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] laptop:basis-[64%] desktop:aspect-[648/448]":c,"!max-w-none !max-h-none aspect-auto":i==="top"||i==="bottom"}),children:c?T?Q():(0,e.jsx)(k.AnimatePresence,{mode:"wait",children:(0,e.jsx)(k.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"image-with-text__image-motion absolute left-0 top-0 w-full",children:(0,e.jsx)(r.Picture,{source:K(),alt:d[u].image?.alt,className:"image-with-text__image rounded-box min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] desktop:aspect-[648/448] md:aspect-[358/360]"})},d[u].image?.url)}):T?Q():(0,e.jsx)(r.Picture,{source:K(),className:(0,l.cn)("image-with-text__image rounded-box laptop:rounded-box")})})]})});Y.displayName="ImageWithText";var Te=(0,ee.withLayout)(Y);
|
|
1
|
+
"use strict";"use client";var Ne=Object.create;var S=Object.defineProperty;var Te=Object.getOwnPropertyDescriptor;var Ie=Object.getOwnPropertyNames;var Le=Object.getPrototypeOf,Pe=Object.prototype.hasOwnProperty;var Ve=(n,c)=>{for(var v in c)S(n,v,{get:c[v],enumerable:!0})},te=(n,c,v,w)=>{if(c&&typeof c=="object"||typeof c=="function")for(let u of Ie(c))!Pe.call(n,u)&&u!==v&&S(n,u,{get:()=>c[u],enumerable:!(w=Te(c,u))||w.enumerable});return n};var Se=(n,c,v)=>(v=n!=null?Ne(Le(n)):{},te(c||!n||!n.__esModule?S(v,"default",{value:n,enumerable:!0}):v,n)),Me=n=>te(S({},"__esModule",{value:!0}),n);var ze={};Ve(ze,{default:()=>De});module.exports=Me(ze);var e=require("react/jsx-runtime"),o=Se(require("react")),r=require("../../components/index.js"),l=require("../../helpers/utils.js"),ae=require("../../shared/Styles.js"),le=require("../../hooks/useExposure.js"),se=require("../../hooks/useIntersectionObserver.js"),re=require("../AiuiProvider/index.js"),ne=require("../../hooks/useTracking.js"),me=require("../../shared/trackUrlRef.js"),de=require("../../shared/track.js"),y=require("framer-motion");const z="image",H="image_with_text",ie=(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:(0,e.jsx)("path",{d:"M6.91009 4.41058C7.23553 4.08514 7.76304 4.08514 8.08848 4.41058L13.0885 9.41058C13.4139 9.73602 13.4139 10.2635 13.0885 10.589L8.08848 15.589C7.76304 15.9144 7.23553 15.9144 6.91009 15.589C6.58466 15.2635 6.58466 14.736 6.91009 14.4106L11.3209 9.99977L6.91009 5.58897C6.58466 5.26353 6.58466 4.73602 6.91009 4.41058Z",fill:"currentColor"})}),oe=o.default.forwardRef(({data:n,className:c},v)=>{const{title:w,subtitle:u,desc:_,descIcon:M,image:N,padImage:E,mobileImage:R,theme:ce="dark",items:j=[],layout:pe="left",mediaType:xe="image",datalist:d=[],video:C,padVideo:W,mobVideo:A,button:b,textAlign:m="left",titleTag:ue}=n,i=pe,{locale:fe="us"}=(0,re.useAiuiContext)(),{buildRef:ge}=(0,ne.useTracking)(),D=(0,o.useRef)(null),I=(0,o.useRef)(null),L=(0,o.useRef)(null),P=(0,o.useRef)(null),q=(0,o.useRef)(null),[f,he]=(0,o.useState)(0),B=(0,o.useRef)([]),[$,ve]=(0,o.useState)({left:0,width:0}),[k,F]=(0,o.useState)(""),[O,U]=(0,o.useState)(""),[Z,G]=(0,o.useState)(""),p=d.length>0,T=xe==="video";(0,le.useExposure)(D,{componentType:z,componentName:H,componentTitle:w,componentDescription:u}),(0,o.useImperativeHandle)(v,()=>D.current),(0,o.useEffect)(()=>{if(d.length>0){const t=B.current[f];if(t){const{offsetLeft:s,offsetWidth:a}=t;ve({left:s,width:a})}}},[f,d.length]);const[J,be]=(0,o.useState)(!1);(0,se.useIntersectionObserverDelay)(q,{once:!0,threshold:.01,callback:()=>{be(!0)}}),(0,o.useEffect)(()=>{if(!J||!T)return;let t="",s="",a="";if(p&&d[f]){const g=d[f];t=g.video?.url||"",s=g.padVideo?.url||t,a=g.mobVideo?.url||t}else t=C?.url||"",s=W?.url||t,a=A?.url||t;t&&F(t),s&&U(s),a&&G(a),setTimeout(()=>{[I.current?.querySelector("video"),L.current?.querySelector("video"),P.current?.querySelector("video")].forEach(h=>{h&&(h.load(),h.play().catch(()=>{}))})},200)},[J,T,p,f,d,C?.url,W?.url,A?.url]);const we=(t,s)=>{if(he(t),s.target.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),T&&p&&d[t]){const a=d[t];a.video?.url&&F(a.video.url),a.padVideo?.url&&U(a.padVideo.url),a.mobVideo?.url&&G(a.mobVideo.url),setTimeout(()=>{[I.current?.querySelector("video"),L.current?.querySelector("video"),P.current?.querySelector("video")].forEach(h=>{h&&(h.load(),h.play().catch(()=>{}))})},300)}},K=(0,l.getLocalizedPath)(b?.link||"",fe),Q=b?.link?(0,me.trackUrlRef)(K,ge(z,H)):K,X=(0,de.buildClickTrackingProps)({interactive:!!b?.link,componentType:z,componentName:H,title:w,description:u,buttonName:b?.text}),_e=()=>!V||!b?.text||i==="top"||i==="bottom"?null:(0,e.jsx)("div",{className:(0,l.cn)("image-with-text__button-wrapper laptop:mt-[32px] mt-[24px]",{"flex justify-center":m==="center","flex justify-start":m==="left"}),children:(0,e.jsx)(r.Link,{href:Q,...X,className:"image-with-text__button whitespace-nowrap no-underline",suffixIcon:ie,children:b.text})}),x=j.length>0,V=!!b,Y=()=>{if(p&&d[f]){const t=d[f];return`${t.image?.url} ,${t.imgPad?.url||t.image?.url} 1440, ${t.imageMob?.url||t.image?.url} 767`}return N?`${N?.url},${E?.url||N?.url} 1024, ${R?.url||N?.url} 768`:""},ee=()=>{if(p){const g=d[f],h=g.image?.url,ke=g.imgPad?.url||h,ye=g.imageMob?.url||h;return(0,e.jsx)(y.AnimatePresence,{mode:"wait",children:(0,e.jsx)(y.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"image-with-text__video-motion absolute left-0 top-0 w-full",children:(0,e.jsxs)("div",{className:"image-with-text__video-wrapper rounded-box overflow-hidden",children:[(0,e.jsx)("div",{ref:I,className:"image-with-text__desktop-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:h,src:k,loop:!0,className:"image-with-text__video image-with-text__video--desktop lg-desktop:block hidden size-full object-cover"})}),(0,e.jsx)("div",{ref:L,className:"image-with-text__tablet-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:ke,src:O||k,loop:!0,className:"image-with-text__video image-with-text__video--tablet tablet:block lg-desktop:hidden hidden"})}),(0,e.jsx)("div",{ref:P,className:"image-with-text__mobile-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:ye,src:Z||k,loop:!0,className:"image-with-text__video image-with-text__video--mobile tablet:hidden block"})})]})},g.video?.url||g.image?.url)})}const t=N?.url,s=E?.url||t,a=R?.url||t;return(0,e.jsxs)("div",{className:"image-with-text__video-wrapper rounded-box laptop:rounded-box overflow-hidden",children:[(0,e.jsx)("div",{ref:I,className:"image-with-text__desktop-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:t,src:k,loop:!0,className:"image-with-text__video image-with-text__video--desktop lg-desktop:block hidden size-full object-cover"})}),(0,e.jsx)("div",{ref:L,className:"image-with-text__tablet-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:s,src:O||k,loop:!0,className:"image-with-text__video image-with-text__video--tablet tablet:block lg-desktop:hidden hidden"})}),(0,e.jsx)("div",{ref:P,className:"image-with-text__mobile-video-container",children:(0,e.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:a,src:Z||k,loop:!0,className:"image-with-text__video image-with-text__video--mobile tablet:hidden block"})})]})};return(0,e.jsxs)("section",{ref:D,"data-ui-component-id":"ImageWithText",className:(0,l.cn)("image-with-text text-info-primary",{"flex gap-[24px] laptop:gap-[48px] lg-desktop:gap-[64px]":!p,"flex-col":!p&&(i==="top"||i==="bottom"),"items-center":i==="left"||i==="right","flex-col laptop:flex-row":!p&&(i==="left"||i==="right"),"flex l:gap-[24px] xl:flex-col min-md:justify-between min-l:gap-[20px]":p,"aiui-dark":ce==="dark"},c),children:[p&&(w||_||d.length>0)&&(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__tab-content min-md:gap-[24px] laptop:basis-[36%] inline-flex flex-col justify-center",{"text-left":m==="left","text-center":m==="center"}),children:[(0,e.jsxs)("div",{className:"image-with-text__header",children:[(0,e.jsx)(r.Heading,{as:"h3",size:4,html:w,className:"image-with-text__title"}),(0,e.jsx)(r.Text,{as:"p",size:1,html:_,className:"image-with-text__description tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-[14px]"})]}),(0,e.jsx)("div",{className:(0,l.cn)("image-with-text__tabs-wrapper md:scrollbar-hidden relative md:overflow-hidden md:overflow-x-scroll",{"flex justify-center":m==="center"}),children:(0,e.jsxs)("div",{className:"image-with-text__tabs rounded-btn relative inline-flex bg-[#1D1D1F] px-[4px] md:my-[24px]",children:[(0,e.jsx)("div",{className:"image-with-text__slider rounded-btn absolute inset-y-0 bg-white transition-all duration-300 ease-in-out",style:{left:$.left,width:$.width}}),d.map((t,s)=>(0,e.jsx)("div",{ref:a=>{B.current[s]=a},onClick:a=>we(s,a),className:(0,l.cn)("image-with-text__tab rounded-btn min-xxl:px-[28px] min-xxl:py-[15px] relative z-10 cursor-pointer px-[20px] py-[10px] text-center text-[12px] font-medium transition-colors duration-300 md:px-[20px] md:py-[10px]",f===s?"image-with-text__tab--active text-black":"text-white"),children:(0,e.jsx)(r.Heading,{as:ue??"h3",size:1,html:t?.title,className:"image-with-text__tab-title text-balance-normal !whitespace-nowrap md:text-[14px]"})},s))]})})]}),!p&&(w||u||_)&&(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__content flex w-full flex-col",{"justify-center":!V,"justify-between":V,"items-start":m==="left"&&x,"items-center":m==="center"&&x,"text-left":m==="left","text-center":m==="center","laptop:order-1":i==="left"}),children:[(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__main-content",{"flex flex-col":V}),children:[(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__header",{"laptop:flex laptop:items-end laptop:justify-between laptop:gap-16":(i==="top"||i==="bottom")&&b?.text}),children:[(0,e.jsxs)("div",{className:"image-with-text__title-wrapper flex min-w-0 flex-1 flex-col",children:[(0,e.jsx)(r.Heading,{as:"h2",size:4,html:w,className:(0,l.cn)("image-with-text__title",{"text-left":x&&m==="left","text-center":x&&m==="center"})}),u&&(0,e.jsx)(r.Text,{as:"p",size:x?4:3,html:u,className:(0,l.cn)("image-with-text__subtitle tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[4px] text-[14px]",{"laptop:mt-[16px]":!x,"min-xxl:mt-[8px] laptop:text-[16px] lg-desktop:text-[18px]":x,"text-left":x&&m==="left","text-center":x&&m==="center"})})]}),(i==="top"||i==="bottom")&&b?.text&&(0,e.jsx)(r.Link,{href:Q,...X,className:"laptop:flex hidden whitespace-nowrap no-underline",suffixIcon:ie,children:b.text})]}),!x&&(_||M)&&(0,e.jsxs)("div",{className:"image-with-text__description flex flex-row gap-[8px]",children:[M&&(0,e.jsx)("img",{src:M,alt:"icon",className:"image-with-text__description-icon desktop:size-[48px] size-[36px]"}),_&&(0,e.jsx)(r.Heading,{as:"h4",size:5,html:_,className:"image-with-text__description-text min-md:text-[40px] min-l:text-[40px] min-xl:text-[56px] min-xxl:text-[64px] text-[#3AD1FF] md:text-[40px]"})]}),x&&(0,e.jsx)("div",{className:(0,l.cn)("image-with-text__items laptop:mt-[32px] desktop:mt-[48px] mt-[24px] grid w-full gap-6",{"!mt-6":i==="top"||i==="bottom","grid-cols-2 tablet:grid-cols-4":i==="top"||i==="bottom","grid-cols-2 tablet:grid-cols-4 laptop:grid-cols-2":i==="left"||i==="right"}),children:j.map((t,s)=>(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__item",{"text-center":m==="center"}),children:[(0,e.jsxs)("div",{className:(0,l.cn)("image-with-text__item-header flex flex-row items-center gap-[8px]",{"justify-center":m==="center","justify-start":m==="left"}),children:[t.icon?.url&&(0,e.jsx)(r.Picture,{source:t.icon.url,alt:t.icon?.alt,className:"image-with-text__item-icon min-md:text-[40px] min-l:text-[40px] min-xl:text-[56px] min-xxl:text-[64px] desktop:h-[44px] lg-desktop:h-[52px] h-[28px] translate-y-[-12%] md:text-[40px]",imgClassName:"h-full !w-full"}),(0,e.jsx)(r.Heading,{size:4,as:"h6",className:"image-with-text__item-text bg-gradient-to-r from-[#3ad1ff] to-[#008cd6] bg-clip-text text-transparent",children:t.text})]}),(0,e.jsx)(r.Text,{size:4,as:"p",html:t.desc,className:"image-with-text__item-desc tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px] mt-[-2px] text-[14px]"})]},s))})]}),_e()]}),(0,e.jsx)("div",{ref:q,className:(0,l.cn)("image-with-text__media-wrapper",{"laptop:w-[60%] w-full shrink-0":i==="left"||i==="right","aspect-[716/720] max-h-[560px] max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[824/560] shrink-0":x,"laptop:basis-[63%] desktop:basis-[57%]":x&&i==="left","relative w-full shrink md:aspect-[358/360] min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] laptop:basis-[64%] desktop:aspect-[648/448]":p,"!max-w-none !max-h-none aspect-auto":i==="top"||i==="bottom"}),children:p?T?ee():(0,e.jsx)(y.AnimatePresence,{mode:"wait",children:(0,e.jsx)(y.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"image-with-text__image-motion absolute left-0 top-0 w-full",children:(0,e.jsx)(r.Picture,{source:Y(),alt:d[f].image?.alt,className:"image-with-text__image rounded-box min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] desktop:aspect-[648/448] md:aspect-[358/360]"})},d[f].image?.url)}):T?ee():(0,e.jsx)(r.Picture,{source:Y(),className:(0,l.cn)("image-with-text__image rounded-box laptop:rounded-box")})})]})});oe.displayName="ImageWithText";var De=(0,ae.withLayout)(oe);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";"use client";var
|
|
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
|
|
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:
|
|
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=_;
|