@anker-in/headless-ui 1.3.82 → 1.3.83

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.
@@ -1 +1 @@
1
- "use strict";"use client";var v=Object.create;var d=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var y=(e,r)=>{for(var i in r)d(e,i,{get:r[i],enumerable:!0})},c=(e,r,i,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of g(r))!k.call(e,s)&&s!==i&&d(e,s,{get:()=>r[s],enumerable:!(l=u(r,s))||l.enumerable});return e};var x=(e,r,i)=>(i=e!=null?v(b(e)):{},c(r||!e||!e.__esModule?d(i,"default",{value:e,enumerable:!0}):i,e)),w=e=>c(d({},"__esModule",{value:!0}),e);var G={};y(G,{default:()=>z});module.exports=w(G);var t=require("react/jsx-runtime"),F=x(require("react")),o=require("../../helpers/index.js"),B=require("../../components/badge.js"),h=x(require("../../components/picture.js")),a=require("../../components/text.js");const N=({checked:e,theme:r})=>{const i=r==="dark";return e?(0,t.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",fill:i?"#F5F6F7":"#080A0F"}),(0,t.jsx)("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",stroke:i?"#F5F6F7":"#080A0F",strokeWidth:"1.6"}),(0,t.jsx)("path",{d:"M8 11.5833L10.9474 14.5L16 9.5",stroke:i?"#1E2024":"white",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]}):(0,t.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",stroke:i?"#B5B7BB":"#2A2C32",strokeWidth:"1.6"})})},m=F.forwardRef(({gift:e,onClick:r,className:i,giftType:l,theme:s,tagBgColor:n,tagTextColor:p},f)=>(0,t.jsx)("div",{ref:f,className:(0,o.cn)("bg-container-primary laptop:rounded-[8px] border-lines relative flex w-full flex-col overflow-hidden rounded-[6px] border-2 transition-all",l===2?"border-brand-0 bg-container-secondary-0 cursor-default":`cursor-pointer hover:shadow-sm ${e.selected?"border-brand-0 bg-container-secondary-0":"border-lines bg-secondary-0 hover:bg-container-secondary"}`,i),onClick:()=>{l===1&&r?.(e)},children:(0,t.jsxs)("div",{className:"flex size-full flex-col",children:[(0,t.jsx)("div",{className:"tablet:h-[24px] lg-desktop:h-[28px] flex h-[18px] justify-end",children:e.tag&&(0,t.jsx)("div",{className:"bg-brand-0 lg-desktop:text-[16px] laptop:rounded-bl-[8px] text-badge-foreground absolute rounded-bl-[6px] px-[6px] pb-[4px] pt-[3px] text-[14px] font-bold leading-[1.2]",style:{...n?{backgroundColor:n}:{},...p?{color:p}:{}},children:e.tag})}),(0,t.jsxs)("div",{className:(0,o.cn)("laptop:pb-4 laptop:px-4 flex size-full items-center gap-4 px-2 pb-2"),children:[(0,t.jsx)("div",{className:"flex size-5 shrink-0 items-center justify-center",children:(0,t.jsx)(N,{checked:!!e.selected,theme:s})}),(0,t.jsx)("div",{className:(0,o.cn)("size-14 shrink-0","tablet:size-12"),children:(0,t.jsx)(h.default,{source:e.image,alt:e.name,className:"size-full rounded object-cover"})}),(0,t.jsxs)("div",{className:"flex h-full min-w-0 flex-1 flex-col justify-center gap-1 py-1",children:[(0,t.jsx)(a.Text,{size:2,html:e.name,className:(0,o.cn)("text-info-primary desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1")}),(0,t.jsxs)("div",{className:"mt-auto flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.Text,{size:2,className:(0,o.cn)("text-info-primary desktop:text-[16px] lg-desktop:text-[18px]"),children:e.currentPrice}),e.originalPrice&&e.originalPrice!==e.currentPrice&&(0,t.jsx)(a.Text,{size:2,className:(0,o.cn)("text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] pr-6 line-through"),children:e.originalPrice})]}),e.quantity>=1&&(0,t.jsxs)(a.Text,{size:4,className:(0,o.cn)("text-info-primary laptop:text-[16px] lg-desktop:text-[18px] self-end text-[14px]"),children:["x",e.quantity]})]})]})]})]})}));m.displayName="FreeGiftItem";var z=m;
1
+ "use strict";"use client";var g=Object.create;var n=Object.defineProperty;var v=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,y=Object.prototype.hasOwnProperty;var w=(e,r)=>{for(var i in r)n(e,i,{get:r[i],enumerable:!0})},p=(e,r,i,l)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of b(r))!y.call(e,s)&&s!==i&&n(e,s,{get:()=>r[s],enumerable:!(l=v(r,s))||l.enumerable});return e};var x=(e,r,i)=>(i=e!=null?g(k(e)):{},p(r||!e||!e.__esModule?n(i,"default",{value:e,enumerable:!0}):i,e)),F=e=>p(n({},"__esModule",{value:!0}),e);var P={};w(P,{default:()=>G});module.exports=F(P);var t=require("react/jsx-runtime"),N=x(require("react")),o=require("../../helpers/index.js"),L=require("../../components/badge.js"),f=x(require("../../components/picture.js")),a=require("../../components/text.js");const z=({checked:e,theme:r})=>{const i=r==="dark";return e?(0,t.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",fill:i?"#F5F6F7":"#080A0F"}),(0,t.jsx)("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",stroke:i?"#F5F6F7":"#080A0F",strokeWidth:"1.6"}),(0,t.jsx)("path",{d:"M8 11.5833L10.9474 14.5L16 9.5",stroke:i?"#1E2024":"white",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]}):(0,t.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",stroke:i?"#B5B7BB":"#2A2C32",strokeWidth:"1.6"})})},m=N.forwardRef(({gift:e,onClick:r,className:i,giftType:l,theme:s,tagBgColor:d,tagTextColor:c},h)=>{const u=l===2||!!e.selected;return(0,t.jsx)("div",{ref:h,className:(0,o.cn)("bg-container-primary laptop:rounded-[8px] border-lines relative flex w-full flex-col overflow-hidden rounded-[6px] border-2 transition-all","buy-one-get-one-shelf-free-gift-item",u?"buy-one-get-one-shelf-free-gift-item-selected":"buy-one-get-one-shelf-free-gift-item-unselected",l===2?"border-brand-0 bg-container-secondary-0 cursor-default":`cursor-pointer hover:shadow-sm ${e.selected?"border-brand-0 bg-container-secondary-0":"border-lines bg-secondary-0 hover:bg-container-secondary"}`,i),onClick:()=>{l===1&&r?.(e)},children:(0,t.jsxs)("div",{className:"flex size-full flex-col",children:[(0,t.jsx)("div",{className:"tablet:h-[24px] lg-desktop:h-[28px] flex h-[18px] justify-end",children:e.tag&&(0,t.jsx)("div",{className:"bg-brand-0 lg-desktop:text-[16px] laptop:rounded-bl-[8px] text-badge-foreground absolute rounded-bl-[6px] px-[6px] pb-[4px] pt-[3px] text-[14px] font-bold leading-[1.2]",style:{...d?{backgroundColor:d}:{},...c?{color:c}:{}},children:e.tag})}),(0,t.jsxs)("div",{className:(0,o.cn)("laptop:pb-4 laptop:px-4 flex size-full items-center gap-4 px-2 pb-2"),children:[(0,t.jsx)("div",{className:"flex size-5 shrink-0 items-center justify-center",children:(0,t.jsx)(z,{checked:!!e.selected,theme:s})}),(0,t.jsx)("div",{className:(0,o.cn)("size-14 shrink-0","tablet:size-12"),children:(0,t.jsx)(f.default,{source:e.image,alt:e.name,className:"size-full rounded object-cover"})}),(0,t.jsxs)("div",{className:"flex h-full min-w-0 flex-1 flex-col justify-center gap-1 py-1",children:[(0,t.jsx)(a.Text,{size:2,html:e.name,className:(0,o.cn)("text-info-primary desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1")}),(0,t.jsxs)("div",{className:"mt-auto flex items-center justify-between gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(a.Text,{size:2,className:(0,o.cn)("text-info-primary desktop:text-[16px] lg-desktop:text-[18px]"),children:e.currentPrice}),e.originalPrice&&e.originalPrice!==e.currentPrice&&(0,t.jsx)(a.Text,{size:2,className:(0,o.cn)("text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] pr-6 line-through"),children:e.originalPrice})]}),e.quantity>=1&&(0,t.jsxs)(a.Text,{size:4,className:(0,o.cn)("text-info-primary laptop:text-[16px] lg-desktop:text-[18px] self-end text-[14px]"),children:["x",e.quantity]})]})]})]})]})})});m.displayName="FreeGiftItem";var G=m;
@@ -1 +1 @@
1
- "use strict";var L=Object.create;var y=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var E=(t,l)=>{for(var s in l)y(t,s,{get:l[s],enumerable:!0})},w=(t,l,s,p)=>{if(l&&typeof l=="object"||typeof l=="function")for(let i of S(l))!A.call(t,i)&&i!==s&&y(t,i,{get:()=>l[i],enumerable:!(p=D(l,i))||p.enumerable});return t};var T=(t,l,s)=>(s=t!=null?L(z(t)):{},w(l||!t||!t.__esModule?y(s,"default",{value:t,enumerable:!0}):s,t)),P=t=>w(y({},"__esModule",{value:!0}),t);var R={};E(R,{default:()=>q});module.exports=P(R);var e=require("react/jsx-runtime"),m=require("react"),o=require("../../components/index.js"),M=T(require("../Subscribe/index.js")),k=require("./types.js"),x=require("./icons/index.js"),N=require("react-responsive"),d=require("../../helpers/utils.js"),b=require("../AiuiProvider/index.js"),F=require("../../shared/Styles.js");const $=({data:{footer:t}={},currentCountry:l,event:s,subscribeLoading:p,classNames:i,className:n,moduleIds:r,...u})=>{const[f,c]=(0,m.useState)(!1),g=(0,N.useMediaQuery)({query:"(max-width: 1439px)"});(0,m.useEffect)(()=>{c(g)},[g]);const h=(0,m.useMemo)(()=>t?.blocks?.find(a=>a?.blockType===k.FooterNavigationBlockType.Brand)?.country||{},[t]);return(0,e.jsx)("footer",{...u,className:(0,d.cn)(i?.root,n),children:(0,e.jsxs)(o.Container,{className:(0,d.cn)(i?.child),childClassName:(0,d.cn)("laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8"),children:[(0,e.jsx)(o.Text,{html:t?.story,className:"desktop:text-sm text-xs font-bold text-[#6D6D6F]"}),t?.blocks?.map(a=>{if(a?.blockType===k.FooterNavigationBlockType.Signup)return(0,e.jsx)(O,{subscribeLoading:p,data:a,onSubmit:s?.signup,id:r?.marketingConversion},a.id);if(a?.blockType===k.FooterNavigationBlockType.Brand)return(0,e.jsx)(Q,{data:a,isMobile:f,event:s,currentCountry:l,id:r?.footerBrand},a?.id);if(a?.blockType===k.FooterNavigationBlockType.Main)return(0,e.jsx)(j,{data:{...a,country:h},event:s,isMobile:f,currentCountry:l,id:r?.mainServices},a.id)})]})})},O=({data:t,onSubmit:l,subscribeLoading:s,id:p="footer-marketing-conversion"})=>{const{locale:i="us"}=(0,b.useAiuiContext)();return(0,e.jsxs)("div",{id:p,className:"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8",children:[(0,e.jsx)(M.default,{subscribeMetadata:t?.signup,className:"desktop:flex-[744]",onSubmit:l,loading:s}),(0,e.jsx)("div",{className:"desktop:hidden h-px w-full bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(o.Text,{html:t?.enjoy?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.enjoy?.enjoys?.map(n=>(0,e.jsxs)("div",{className:"flex-start flex gap-2",children:[(0,e.jsx)("img",{src:n?.icon?.url,loading:"lazy",alt:n?.icon?.alt||"",className:"size-5 shrink-0"}),(0,e.jsx)(o.Text,{html:n?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})]},n?.id))})]}),(0,e.jsx)("div",{className:"desktop:block hidden w-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(o.Text,{html:t?.benefit?.title,className:"text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.benefit?.benefits?.map(n=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(n?.link,i,"ref=footer"),asChild:!n?.link,className:"no-underline",children:(0,e.jsx)(o.Text,{html:n?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},n?.id))})]})]})]})},j=({data:t,event:l,isMobile:s,currentCountry:p,id:i="footer-main-services"})=>{const{locale:n="us"}=(0,b.useAiuiContext)(),[r,u]=(0,m.useState)(!1),{services:f,mainNav:c,country:g}=t,h="contact-section";return(0,e.jsxs)("nav",{id:i,className:"flex flex-col gap-8","aria-label":"Main navigation",children:[(0,e.jsxs)("div",{className:(0,d.cn)({"desktop:gap-16 flex":f?.download?.title}),children:[(0,e.jsxs)("div",{className:(0,d.cn)("w-full",{"desktop:flex-[1260]":f?.download?.title}),children:[(0,e.jsx)(o.Text,{html:f?.storeBenefits?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:(0,d.cn)("laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2",{"desktop:max-w-[648px]":f?.download?.title}),children:f?.storeBenefits?.reasons?.map(a=>(0,e.jsxs)("div",{className:"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2",children:[(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt||"",className:"size-5 shrink-0"}),(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(a?.link,n,"ref=footer"),asChild:!a?.link,className:"no-underline",children:(0,e.jsx)(o.Text,{html:a?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})})]},a?.id))})]}),(0,e.jsx)(B,{className:(0,d.cn)({"desktop:flex-[404] hidden desktop:block":f?.download?.title}),title:f?.download?.title,apps:f?.download?.apps})]}),(0,e.jsx)("div",{className:"desktop:block hidden h-px bg-[#3D3E3F]","aria-hidden":"true"}),(0,e.jsxs)("div",{className:"desktop:grid grid-cols-4 gap-4",children:[(0,e.jsx)(v,{title:c?.products?.title,lists:c?.products?.products}),(0,e.jsx)(v,{title:c?.explore?.title,lists:c?.explore?.explores}),(0,e.jsx)(v,{title:c?.support?.title,lists:c?.support?.supports}),(0,e.jsxs)("div",{className:"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4",children:[(0,e.jsxs)("div",{className:"desktop:pb-0 flex items-center justify-between pb-4",children:[(0,e.jsx)(o.Text,{as:"p",html:c?.contact?.title,className:"text-xl font-bold leading-[1.2] text-white",id:h}),s&&(0,e.jsx)("button",{onClick:()=>u(!r),"aria-expanded":r,"aria-controls":h,"aria-label":r?"Collapse contact section":"Expand contact section",children:r?(0,e.jsx)(x.SubtractIcon,{width:20,height:20}):(0,e.jsx)(x.AddIcon,{width:20,height:20})})]}),(r&&s||!s)&&(0,e.jsx)("div",{className:"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2",role:"region","aria-labelledby":h,children:c?.contact?.contacts?.map(a=>(0,e.jsxs)(o.Link,{href:a?.link,className:"group flex items-start gap-2 no-underline",children:[(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt,className:"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),(0,e.jsx)(o.Text,{html:a?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white"})]},a?.id))}),(0,e.jsx)(C,{country:p||g,className:"desktop:hidden border-b border-[#3D3E3F]",isMobile:s,onChangeCountry:l?.country}),(0,e.jsx)("div",{className:"desktop:hidden mt-8",children:(0,e.jsx)(B,{title:f?.download?.title,apps:f?.download?.apps})}),!!c?.socials?.length&&(0,e.jsx)("div",{className:"mt-8 flex items-center gap-2",role:"list","aria-label":"Social media links",children:c?.socials?.map(a=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(a?.link,n,"ref=footer"),className:"group",role:"listitem","aria-label":a?.icon?.alt||"Social media",children:(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt,className:"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"})},a?.id))}),(0,e.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",role:"list","aria-label":"Payment methods",children:c?.payment?.map(a=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(a?.link,n,"ref=footer"),asChild:!a?.link,role:"listitem","aria-label":a?.icon?.alt||"Payment method",children:(0,e.jsx)("img",{src:a?.icon?.url,loading:"lazy",alt:a?.icon?.alt||"",className:"h-[28px] w-[44px] shrink-0"})},a?.id))})]})]})]})},Q=({data:t,isMobile:l,event:s,currentCountry:p,id:i="footer-brand"})=>{const{locale:n="us"}=(0,b.useAiuiContext)();return(0,e.jsxs)("div",{id:i,className:"flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"desktop:items-center desktop:flex desktop:gap-4",children:[(0,e.jsx)("div",{className:"laptop:flex-row aiui-dark laptop:items-center desktop:flex-[980] flex flex-col items-start gap-3",children:(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,e.jsx)(o.Link,{variant:"secondary",href:(0,d.getLocalizedPath)(t?.brand?.link,n,"ref=footer"),asChild:!t?.brand?.link,children:(0,e.jsx)(o.Text,{html:t?.brand?.currentBrand,"aria-hidden":"true"})}),!!t?.brand?.brands?.length&&t?.brand?.brands?.map((r,u)=>(0,e.jsxs)(m.Fragment,{children:[u<=0&&(0,e.jsx)("span",{className:"bg-lines h-3 w-px","aria-hidden":"true"}),(0,e.jsx)(o.Link,{variant:"secondary",href:(0,d.getLocalizedPath)(r?.link,n,"ref=footer"),className:"text-base leading-normal no-underline",children:(0,e.jsx)(o.Text,{html:r?.icon,"aria-hidden":"true"})},r?.id)]},u))]})}),(0,e.jsx)(C,{country:p||t?.country,className:"desktop:flex-[316] desktop:block hidden",isMobile:l,onChangeCountry:s?.country})]}),(0,e.jsx)("div",{className:"h-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1",children:[(0,e.jsx)(o.Text,{html:t?.copyright?.label,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[t?.policy?.policies?.map(r=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(r?.link,n,"ref=footer"),className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white",children:r?.label},r?.id)),t?.policy?.cookies&&(0,e.jsx)("button",{"data-cc":"show-preferencesModal",onClick:s?.cookiesSet,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Cookie preferences: ${t?.policy?.cookies}`,children:t?.policy?.cookies})]})]})]})},v=({title:t,lists:l,className:s})=>{const{locale:p="us"}=(0,b.useAiuiContext)(),[i,n]=(0,m.useState)(!1),[r,u]=(0,m.useState)(!1),f=(0,N.useMediaQuery)({query:"(max-width: 1439px)"});(0,m.useEffect)(()=>{u(f)},[f]);const c=`nav-section-${t?.replace(/\s+/g,"-").toLowerCase()}`;return(0,e.jsxs)("div",{className:(0,d.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",s),children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)(o.Text,{as:"p",html:t,className:"text-xl font-bold leading-[1.2] text-white",id:c}),r&&(0,e.jsx)("button",{onClick:()=>n(!i),"aria-expanded":i,"aria-controls":c,"aria-label":i?`Collapse ${t}`:`Expand ${t}`,className:"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black",children:i?(0,e.jsx)(x.SubtractIcon,{width:20,height:20}):(0,e.jsx)(x.AddIcon,{width:20,height:20})})]}),(i&&r||!r)&&(0,e.jsx)("nav",{className:"mt-4 flex flex-col gap-2",role:"region","aria-labelledby":c,children:l?.map(g=>(0,e.jsx)(o.Link,{href:(0,d.getLocalizedPath)(g?.link,p,"ref=footer"),className:"no-underline",children:(0,e.jsx)(o.Text,{html:g?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},g?.id))})]})},B=({title:t,apps:l,className:s})=>{const{locale:p="us"}=(0,b.useAiuiContext)();return l?.length?(0,e.jsxs)("div",{className:s,children:[(0,e.jsx)(o.Text,{html:t,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex items-center gap-4",role:"list","aria-label":"Download apps",children:l?.map(i=>(0,e.jsxs)(o.Link,{href:(0,d.getLocalizedPath)(i?.link,p,"ref=footer"),className:"group flex flex-col items-center gap-[6px]",role:"listitem","aria-label":i?.icon?.alt||i?.label||"Download app",children:[(0,e.jsx)("img",{src:i?.icon?.url,loading:"lazy",alt:i?.icon?.alt,className:"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),i?.label&&(0,e.jsx)(o.Text,{html:i?.label,className:"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white"})]},i?.id))})]}):null},C=({country:t,isMobile:l,className:s,onChangeCountry:p})=>(0,e.jsx)("div",{className:(0,d.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",s),children:(0,e.jsxs)("button",{onClick:()=>p?.(),className:"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Change country/region, current: ${t?.countryName||t?.country}`,children:[(0,e.jsxs)("div",{className:"group flex items-center gap-2",children:[(0,e.jsx)(x.CountryIcon,{width:20,height:20,className:"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100","aria-hidden":"true"}),(0,e.jsx)(o.Text,{as:"span",html:t?.countryName||t?.country,className:"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200"})]}),l&&(0,e.jsx)(x.ArrowRightIcon,{width:20,height:20,"aria-hidden":"true"})]})});var q=(0,F.withLayout)($);
1
+ "use strict";var z=Object.create;var N=Object.defineProperty;var A=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var O=(t,s)=>{for(var i in s)N(t,i,{get:s[i],enumerable:!0})},C=(t,s,i,p)=>{if(s&&typeof s=="object"||typeof s=="function")for(let o of T(s))!$.call(t,o)&&o!==i&&N(t,o,{get:()=>s[o],enumerable:!(p=A(s,o))||p.enumerable});return t};var j=(t,s,i)=>(i=t!=null?z(P(t)):{},C(s||!t||!t.__esModule?N(i,"default",{value:t,enumerable:!0}):i,t)),Q=t=>C(N({},"__esModule",{value:!0}),t);var J={};O(J,{default:()=>H});module.exports=Q(J);var e=require("react/jsx-runtime"),u=require("react"),a=require("../../components/index.js"),L=j(require("../Subscribe/index.js")),v=require("./types.js"),x=require("./icons/index.js"),B=require("react-responsive"),d=require("../../helpers/utils.js"),k=require("../AiuiProvider/index.js"),S=require("../../shared/Styles.js");const M=t=>!!(t?.countryName||t?.country),q=({data:{footer:t}={},currentCountry:s,event:i,subscribeLoading:p,classNames:o,className:n,moduleIds:r,...h})=>{const[f,c]=(0,u.useState)(!1),g=(0,B.useMediaQuery)({query:"(max-width: 1439px)"});(0,u.useEffect)(()=>{c(g)},[g]);const y=(0,u.useMemo)(()=>t?.blocks?.find(m=>m?.blockType===v.FooterNavigationBlockType.Brand)?.country,[t]);return(0,e.jsx)("footer",{...h,className:(0,d.cn)(o?.root,n),children:(0,e.jsxs)(a.Container,{className:(0,d.cn)(o?.child),childClassName:(0,d.cn)("laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8"),children:[(0,e.jsx)(a.Text,{html:t?.story,className:"desktop:text-sm text-xs font-bold text-[#6D6D6F]"}),t?.blocks?.map(m=>{if(m?.blockType===v.FooterNavigationBlockType.Signup)return(0,e.jsx)(R,{subscribeLoading:p,data:m,onSubmit:i?.signup,id:r?.marketingConversion},m.id);if(m?.blockType===v.FooterNavigationBlockType.Brand)return(0,e.jsx)(G,{data:m,isMobile:f,event:i,currentCountry:s,id:r?.footerBrand},m?.id);if(m?.blockType===v.FooterNavigationBlockType.Main)return(0,e.jsx)(_,{data:{...m,country:y},event:i,isMobile:f,currentCountry:s,id:r?.mainServices},m.id)})]})})},R=({data:t,onSubmit:s,subscribeLoading:i,id:p="footer-marketing-conversion"})=>{const{locale:o="us"}=(0,k.useAiuiContext)();return(0,e.jsxs)("div",{id:p,className:"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8",children:[(0,e.jsx)(L.default,{subscribeMetadata:t?.signup,className:"desktop:flex-[744]",onSubmit:s,loading:i}),(0,e.jsx)("div",{className:"desktop:hidden h-px w-full bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(a.Text,{html:t?.enjoy?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.enjoy?.enjoys?.map(n=>(0,e.jsxs)("div",{className:"flex-start flex gap-2",children:[(0,e.jsx)("img",{src:n?.icon?.url,loading:"lazy",alt:n?.icon?.alt||"",className:"size-5 shrink-0"}),(0,e.jsx)(a.Text,{html:n?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})]},n?.id))})]}),(0,e.jsx)("div",{className:"desktop:block hidden w-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsx)(a.Text,{html:t?.benefit?.title,className:"text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex flex-col gap-2",children:t?.benefit?.benefits?.map(n=>(0,e.jsx)(a.Link,{href:(0,d.getLocalizedPath)(n?.link,o,"ref=footer"),asChild:!n?.link,className:"no-underline",children:(0,e.jsx)(a.Text,{html:n?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},n?.id))})]})]})]})},_=({data:t,event:s,isMobile:i,currentCountry:p,id:o="footer-main-services"})=>{const{locale:n="us"}=(0,k.useAiuiContext)(),[r,h]=(0,u.useState)(!1),{services:f,mainNav:c,country:g}=t,y="contact-section",m=!!f?.storeBenefits?.title&&!!f?.storeBenefits?.reasons?.length,b=!!f?.download?.title&&!!f?.download?.apps?.length,E=M(p||g);return(0,e.jsxs)("nav",{id:o,className:"flex flex-col gap-8","aria-label":"Main navigation",children:[(m||b)&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:(0,d.cn)({"desktop:gap-16 flex":b}),children:[m&&(0,e.jsxs)("div",{className:(0,d.cn)("w-full",{"desktop:flex-[1260]":b}),children:[(0,e.jsx)(a.Text,{html:f?.storeBenefits?.title,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:(0,d.cn)("laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2",{"desktop:max-w-[648px]":b}),children:f?.storeBenefits?.reasons?.map(l=>(0,e.jsxs)("div",{className:"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2",children:[(0,e.jsx)("img",{src:l?.icon?.url,loading:"lazy",alt:l?.icon?.alt||"",className:"size-5 shrink-0"}),(0,e.jsx)(a.Link,{href:(0,d.getLocalizedPath)(l?.link,n,"ref=footer"),asChild:!l?.link,className:"no-underline",children:(0,e.jsx)(a.Text,{html:l?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})})]},l?.id))})]}),(0,e.jsx)(F,{className:(0,d.cn)({"desktop:flex-[404] hidden desktop:block":b}),title:f?.download?.title,apps:f?.download?.apps})]}),(0,e.jsx)("div",{className:"desktop:block hidden h-px bg-[#3D3E3F]","aria-hidden":"true"})]}),(0,e.jsxs)("div",{className:"desktop:grid grid-cols-4 gap-4",children:[(0,e.jsx)(w,{title:c?.products?.title,lists:c?.products?.products}),(0,e.jsx)(w,{title:c?.explore?.title,lists:c?.explore?.explores}),(0,e.jsx)(w,{title:c?.support?.title,lists:c?.support?.supports}),(0,e.jsxs)("div",{className:"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4",children:[(0,e.jsxs)("div",{className:"desktop:pb-0 flex items-center justify-between pb-4",children:[(0,e.jsx)(a.Text,{as:"p",html:c?.contact?.title,className:"text-xl font-bold leading-[1.2] text-white",id:y}),i&&(0,e.jsx)("button",{onClick:()=>h(!r),"aria-expanded":r,"aria-controls":y,"aria-label":r?"Collapse contact section":"Expand contact section",children:r?(0,e.jsx)(x.SubtractIcon,{width:20,height:20}):(0,e.jsx)(x.AddIcon,{width:20,height:20})})]}),(r&&i||!i)&&(0,e.jsx)("div",{className:"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2",role:"region","aria-labelledby":y,children:c?.contact?.contacts?.map(l=>(0,e.jsxs)(a.Link,{href:l?.link,className:"group flex items-start gap-2 no-underline",children:[(0,e.jsx)("img",{src:l?.icon?.url,loading:"lazy",alt:l?.icon?.alt,className:"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),(0,e.jsx)(a.Text,{html:l?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white"})]},l?.id))}),E?(0,e.jsx)(D,{country:p||g,className:"desktop:hidden border-b border-[#3D3E3F]",isMobile:i,onChangeCountry:s?.country}):(0,e.jsx)("div",{className:"desktop:hidden border-b border-[#3D3E3F]","aria-hidden":"true"}),b&&(0,e.jsx)("div",{className:"desktop:hidden mt-8",children:(0,e.jsx)(F,{title:f?.download?.title,apps:f?.download?.apps})}),!!c?.socials?.length&&(0,e.jsx)("div",{className:"mt-8 flex items-center gap-2",role:"list","aria-label":"Social media links",children:c?.socials?.map(l=>(0,e.jsx)(a.Link,{href:(0,d.getLocalizedPath)(l?.link,n,"ref=footer"),className:"group",role:"listitem","aria-label":l?.icon?.alt||"Social media",children:(0,e.jsx)("img",{src:l?.icon?.url,loading:"lazy",alt:l?.icon?.alt,className:"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"})},l?.id))}),!!c?.payment?.length&&(0,e.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",role:"list","aria-label":"Payment methods",children:c?.payment?.map(l=>(0,e.jsx)(a.Link,{href:(0,d.getLocalizedPath)(l?.link,n,"ref=footer"),asChild:!l?.link,role:"listitem","aria-label":l?.icon?.alt||"Payment method",children:(0,e.jsx)("img",{src:l?.icon?.url,loading:"lazy",alt:l?.icon?.alt||"",className:"h-[28px] w-[44px] shrink-0"})},l?.id))})]})]})]})},G=({data:t,isMobile:s,event:i,currentCountry:p,id:o="footer-brand"})=>{const{locale:n="us"}=(0,k.useAiuiContext)();return(0,e.jsxs)("div",{id:o,className:"flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"desktop:items-center desktop:flex desktop:gap-4",children:[(0,e.jsx)("div",{className:"laptop:flex-row aiui-dark laptop:items-center desktop:flex-[980] flex flex-col items-start gap-3",children:(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,e.jsx)(a.Link,{variant:"secondary",href:(0,d.getLocalizedPath)(t?.brand?.link,n,"ref=footer"),asChild:!t?.brand?.link,children:(0,e.jsx)(a.Text,{html:t?.brand?.currentBrand,"aria-hidden":"true"})}),!!t?.brand?.brands?.length&&t?.brand?.brands?.map((r,h)=>(0,e.jsxs)(u.Fragment,{children:[h<=0&&(0,e.jsx)("span",{className:"bg-lines h-3 w-px","aria-hidden":"true"}),(0,e.jsx)(a.Link,{variant:"secondary",href:(0,d.getLocalizedPath)(r?.link,n,"ref=footer"),className:"text-base leading-normal no-underline",children:(0,e.jsx)(a.Text,{html:r?.icon,"aria-hidden":"true"})},r?.id)]},h))]})}),(0,e.jsx)(D,{country:p||t?.country,className:"desktop:flex-[316] desktop:block hidden",isMobile:s,onChangeCountry:i?.country})]}),(0,e.jsx)("div",{className:"h-px bg-[#3D3E3F]"}),(0,e.jsxs)("div",{className:"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1",children:[(0,e.jsx)(a.Text,{html:t?.copyright?.label,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[t?.policy?.policies?.map(r=>(0,e.jsx)(a.Link,{href:(0,d.getLocalizedPath)(r?.link,n,"ref=footer"),className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white",children:r?.label},r?.id)),t?.policy?.cookies&&(0,e.jsx)("button",{"data-cc":"show-preferencesModal",onClick:i?.cookiesSet,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Cookie preferences: ${t?.policy?.cookies}`,children:t?.policy?.cookies})]})]})]})},w=({title:t,lists:s,className:i})=>{const{locale:p="us"}=(0,k.useAiuiContext)(),[o,n]=(0,u.useState)(!1),[r,h]=(0,u.useState)(!1),f=(0,B.useMediaQuery)({query:"(max-width: 1439px)"});if((0,u.useEffect)(()=>{h(f)},[f]),!t)return null;const c=`nav-section-${t.replace(/\s+/g,"-").toLowerCase()}`;return(0,e.jsxs)("div",{className:(0,d.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",i),children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)(a.Text,{as:"p",html:t,className:"text-xl font-bold leading-[1.2] text-white",id:c}),r&&(0,e.jsx)("button",{onClick:()=>n(!o),"aria-expanded":o,"aria-controls":c,"aria-label":o?`Collapse ${t}`:`Expand ${t}`,className:"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black",children:o?(0,e.jsx)(x.SubtractIcon,{width:20,height:20}):(0,e.jsx)(x.AddIcon,{width:20,height:20})})]}),(o&&r||!r)&&(0,e.jsx)("nav",{className:"mt-4 flex flex-col gap-2",role:"region","aria-labelledby":c,children:s?.map(g=>(0,e.jsx)(a.Link,{href:(0,d.getLocalizedPath)(g?.link,p,"ref=footer"),className:"no-underline",children:(0,e.jsx)(a.Text,{html:g?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},g?.id))})]})},F=({title:t,apps:s,className:i})=>{const{locale:p="us"}=(0,k.useAiuiContext)();return!t||!s?.length?null:(0,e.jsxs)("div",{className:i,children:[(0,e.jsx)(a.Text,{html:t,className:" text-xl font-bold leading-[1.2] text-white"}),(0,e.jsx)("div",{className:"mt-4 flex items-center gap-4",role:"list","aria-label":"Download apps",children:s?.map(o=>(0,e.jsxs)(a.Link,{href:(0,d.getLocalizedPath)(o?.link,p,"ref=footer"),className:"group flex flex-col items-center gap-[6px]",role:"listitem","aria-label":o?.icon?.alt||o?.label||"Download app",children:[(0,e.jsx)("img",{src:o?.icon?.url,loading:"lazy",alt:o?.icon?.alt,className:"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),o?.label&&(0,e.jsx)(a.Text,{html:o?.label,className:"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white"})]},o?.id))})]})},D=({country:t,isMobile:s,className:i,onChangeCountry:p})=>M(t)?(0,e.jsx)("div",{className:(0,d.cn)("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",i),children:(0,e.jsxs)("button",{onClick:()=>p?.(),className:"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Change country/region, current: ${t?.countryName||t?.country}`,children:[(0,e.jsxs)("div",{className:"group flex items-center gap-2",children:[(0,e.jsx)(x.CountryIcon,{width:20,height:20,className:"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100","aria-hidden":"true"}),(0,e.jsx)(a.Text,{as:"span",html:t?.countryName||t?.country,className:"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200"})]}),s&&(0,e.jsx)(x.ArrowRightIcon,{width:20,height:20,"aria-hidden":"true"})]})}):null;var H=(0,S.withLayout)(q);
@@ -1 +1 @@
1
- "use strict";"use client";var K=Object.create;var x=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var ee=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty;var oe=(e,o)=>{for(var s in o)x(e,s,{get:o[s],enumerable:!0})},V=(e,o,s,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of W(o))!te.call(e,i)&&i!==s&&x(e,i,{get:()=>o[i],enumerable:!(n=O(o,i))||n.enumerable});return e};var y=(e,o,s)=>(s=e!=null?K(ee(e)):{},V(o||!e||!e.__esModule?x(s,"default",{value:e,enumerable:!0}):s,e)),se=e=>V(x({},"__esModule",{value:!0}),e);var re={};oe(re,{default:()=>ie});module.exports=se(re);var t=require("react/jsx-runtime"),D=require("react-responsive"),r=y(require("react")),A=require("react-dom"),c=require("../../helpers/utils.js"),U=require("../../shared/Styles.js"),z=y(require("../SwiperBox/index.js")),l=require("../../components/index.js"),I=y(require("../Title/index.js")),H=require("../VideoModal/index.js"),R=require("../TextModal/index.js"),C=require("../../hooks/useExposure.js"),w=require("../../shared/trackUrlRef.js"),E=require("../AiuiProvider/index.js"),ae=require("swiper/css");const u="image",h="graphic",G=e=>{let o="";const s=m=>(m?.url&&(o=m.url),o),n=s(e.lgDesktop),i=s(e.desktop),p=s(e.laptop),g=s(e.tablet),b=e.default?.url;return[`${n} 9999`,`${i} 1919`,`${p} 1439`,`${g} 1024`,`${b} 768`].join(", ")},P="descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]",le=({data:e,configuration:o})=>{const s=(0,r.useRef)(null),[n,i]=(0,r.useState)({visible:!1,x:0,y:0,text:""}),p=o?.descriptionTag||"h3",g=()=>{switch(o.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]"}},b=a=>{e?.description&&i({visible:!0,x:a.clientX,y:a.clientY,text:e.description})},m=()=>{i(a=>({...a,visible:!1}))};(0,C.useExposure)(s,{componentType:u,componentName:h,componentTitle:e?.title,componentDescription:e?.description,position:o?.index+1});const k=e?.href?"a":"div",T=e?.href?{href:(0,w.trackUrlRef)((0,c.getLocalizedPath)(e.href,o?.locale||"us"),`${u}_${h}`)}:{};return(0,t.jsx)("div",{ref:s,className:(0,c.cn)(g(),"graphicItem","laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]",{"aiui-dark":e.theme==="dark"}),children:(0,t.jsx)("div",{className:(0,c.cn)("rounded-box absolute inset-0 overflow-hidden"),children:(0,t.jsxs)("div",{className:`graphic-children relative block size-full overflow-hidden ${e?.href?"cursor-pointer":""}`,children:[e?.href?(0,t.jsxs)("a",{"aria-label":e?.title||e?.description,href:(0,w.trackUrlRef)((0,c.getLocalizedPath)(e?.href||"",o?.locale||"us"),`${u}_${h}`),className:"rounded-card block size-full overflow-hidden","data-headless-nav-postion":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:[(0,t.jsx)(l.Picture,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?G(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?G(e.backgroundImage):e?.imgUrl?.url||"",alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""})}),(0,t.jsxs)(k,{...T,className:(0,c.cn)("laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4",{"bg-gradient-to-b from-transparent to-black/80":e?.showBottomGradient&&e?.theme==="dark","bg-gradient-to-b from-transparent to-white/80":e?.showBottomGradient&&e?.theme!=="dark"}),children:[(0,t.jsxs)("div",{className:(0,c.cn)("flex items-end gap-1 overflow-hidden","graphic-bottom"),children:[(0,t.jsxs)("div",{className:"flex-1 overflow-hidden",children:[(0,t.jsx)(l.Text,{html:e?.title,style:{color:e?.textColor},className:"spanTitle graphic-title lg-desktop:text-lg desktop:text-base line-clamp-3 text-sm font-bold leading-[1.2]"}),e?.description&&(0,t.jsxs)("div",{onMouseMove:b,onMouseLeave:m,children:[e?.title?(0,t.jsx)(l.Heading,{html:e?.description,style:{color:e?.textColor},as:p,className:`${P} graphic-description`}):(0,t.jsx)(p,{style:{color:e?.textColor},dangerouslySetInnerHTML:{__html:e?.description||""},className:`${P} graphic-description-item`}),typeof window<"u"&&n.visible&&(0,A.createPortal)((0,t.jsx)(l.Text,{as:"div",html:n.text,className:"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200",style:{left:`${n.x+16}px`,top:`${n.y+16}px`}}),document.body)]})]}),!e?.isShowIcon&&(e?.video?.url||e?.youtubeId)&&(0,t.jsx)("button",{"aria-label":"Play Video",onClick:a=>{a.preventDefault(),a.stopPropagation(),o?.onVideoPlayBtnClick?.(o?.index||0,e)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white/20 hover:bg-black/75",children:(0,t.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})}),e?.isShowIcon&&e?.icon?.url&&(0,t.jsx)("button",{onClick:a=>{a.preventDefault(),a.stopPropagation(),o?.onIconClick?.(e,o)},className:"laptop:size-9 flex size-8 items-center justify-center overflow-hidden rounded-full bg-white/20 hover:bg-black/75",children:(0,t.jsx)(l.Picture,{className:"h-full",imgClassName:"h-full object-cover",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),e.buttonText&&(0,t.jsx)(l.Button,{as:"a","aria-label":e?.title||e?.description,variant:"secondary",className:"bgButton mt-[8px] self-start",href:(0,w.trackUrlRef)((0,c.getLocalizedPath)(e?.href||"",o?.locale||"us"),`${u}_${h}`),"data-headless-nav-position":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}#${e?.buttonText}`,children:e.buttonText})]})]})})})},B=({items:e=[],sharedConfig:o})=>{const s=n=>{const i=e.length>3,p=e.length>2;switch(n){case 1440:return i?4:e.length;case 1024:return i?3:e.length;case 768:return e.length===1?1:i||p?2.3:2;default:return e.length===1?1:1.2}};return(0,t.jsx)(z.default,{id:"Graphic",className:(0,c.cn)("!overflow-visible"),data:{list:e,configuration:{...o,num:e.length}},Slide:le,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:s()},768:{spaceBetween:16,freeMode:!1,slidesPerView:s(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:s(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:s(1440)}}})},L=r.default.forwardRef(({data:e,className:o,...s},n)=>{const i=(0,D.useMediaQuery)({query:"(max-width: 768px)"}),p=(0,r.useRef)(null),[g,b]=(0,r.useState)(!1),[m,k]=(0,r.useState)(""),[T,a]=(0,r.useState)(""),[j,_]=(0,r.useState)(""),[Y,M]=(0,r.useState)(null),[q,N]=(0,r.useState)(!1),{locale:Q="us"}=(0,E.useAiuiContext)(),X=e?.isShowTab??!1,f=e?.tabs,Z=e?.tabAlign??"left",[F,J]=(0,r.useState)(f?.[0]?.id??"");(0,r.useImperativeHandle)(n,()=>p.current),(0,C.useExposure)(p,{componentType:u,componentName:h,componentTitle:e?.title});const $={itemShape:e?.itemShape,descriptionTag:e?.descriptionTag,locale:Q,onVideoPlayBtnClick:(d,v)=>{b(!0),v?.isYouTube?a?.(v?.youtubeId||""):(k?.(v?.video?.url||""),_?.(v?.mobileVideo?.url||""))},onIconClick:d=>{N(!0),M(d)}},S=()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(H.VideoModal,{visible:g,youTubeId:T,onCloseModal:()=>b(!1),videoUrl:i&&j||m}),(0,t.jsx)(R.TextModal,{textVisible:q,extension:Y?.extension,onCloseModal:()=>{N(!1),M(null)}})]});return!X||!f||f.length===0?(0,t.jsxs)("div",{...s,ref:p,className:(0,c.cn)("graphicBlock",o),children:[(0,t.jsxs)("div",{className:"graphic-box",children:[e?.title&&(0,t.jsx)(I.default,{data:{title:e.title,align:e?.titleAlign??"left"}}),(0,t.jsx)(B,{items:e?.items,sharedConfig:$})]}),S()]}):(0,t.jsxs)("div",{...s,ref:p,className:(0,c.cn)("graphicBlock",o),children:[e?.title&&(0,t.jsx)(I.default,{data:{title:e.title,align:e?.titleAlign??"left"}}),(0,t.jsxs)(l.Tabs,{value:F,onValueChange:J,align:Z,children:[(0,t.jsx)("div",{className:"mb-[24px]",children:(0,t.jsx)(l.TabsList,{children:f.map(d=>(0,t.jsx)(l.TabsTrigger,{value:d.id,children:d.label},d.id))})}),f.map(d=>(0,t.jsx)(l.TabsContent,{value:d.id,children:(0,t.jsx)(B,{items:d.items,sharedConfig:$})},d.id))]}),S()]})});L.displayName="Graphic";var ie=(0,U.withLayout)(L);
1
+ "use strict";"use client";var K=Object.create;var k=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var ee=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty;var oe=(e,o)=>{for(var s in o)k(e,s,{get:o[s],enumerable:!0})},G=(e,o,s,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of W(o))!te.call(e,i)&&i!==s&&k(e,i,{get:()=>o[i],enumerable:!(n=O(o,i))||n.enumerable});return e};var y=(e,o,s)=>(s=e!=null?K(ee(e)):{},G(o||!e||!e.__esModule?k(s,"default",{value:e,enumerable:!0}):s,e)),se=e=>G(k({},"__esModule",{value:!0}),e);var re={};oe(re,{default:()=>ie});module.exports=se(re);var t=require("react/jsx-runtime"),A=require("react-responsive"),r=y(require("react")),U=require("react-dom"),c=require("../../helpers/utils.js"),z=require("../../shared/Styles.js"),H=y(require("../SwiperBox/index.js")),l=require("../../components/index.js"),I=y(require("../Title/index.js")),R=require("../VideoModal/index.js"),E=require("../TextModal/index.js"),C=require("../../hooks/useExposure.js"),T=require("../../shared/trackUrlRef.js"),j=require("../AiuiProvider/index.js"),ae=require("swiper/css");const u="image",h="graphic",P=e=>{let o="";const s=m=>(m?.url&&(o=m.url),o),n=s(e.lgDesktop),i=s(e.desktop),p=s(e.laptop),g=s(e.tablet),b=e.default?.url;return[`${n} 9999`,`${i} 1919`,`${p} 1439`,`${g} 1024`,`${b} 768`].join(", ")},B="descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]",le=({data:e,configuration:o})=>{const s=(0,r.useRef)(null),[n,i]=(0,r.useState)({visible:!1,x:0,y:0,text:""}),p=o?.descriptionTag||"h3",g=()=>{switch(o.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]"}},b=a=>{e?.description&&i({visible:!0,x:a.clientX,y:a.clientY,text:e.description})},m=()=>{i(a=>({...a,visible:!1}))};(0,C.useExposure)(s,{componentType:u,componentName:h,componentTitle:e?.title,componentDescription:e?.description,position:o?.index+1});const v=e?.href?"a":"div",x=e?.href?{href:(0,T.trackUrlRef)((0,c.getLocalizedPath)(e.href,o?.locale||"us"),`${u}_${h}`)}:{};return(0,t.jsx)("div",{ref:s,className:(0,c.cn)(g(),"graphicItem","laptop:h-auto text-info-primary md-tablet:h-[360px] flex-1 shrink-0 md:basis-[296px]",{"aiui-dark":e.theme==="dark"}),children:(0,t.jsx)("div",{className:(0,c.cn)("rounded-box absolute inset-0 overflow-hidden"),children:(0,t.jsxs)("div",{className:`graphic-children relative block size-full overflow-hidden ${e?.href?"cursor-pointer":""}`,children:[e?.href?(0,t.jsxs)("a",{"aria-label":e?.title||e?.description,href:(0,T.trackUrlRef)((0,c.getLocalizedPath)(e?.href||"",o?.locale||"us"),`${u}_${h}`),className:"rounded-card block size-full overflow-hidden","data-headless-nav-postion":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:[(0,t.jsx)(l.Picture,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?P(e.backgroundImage):e?.imgUrl?.url,alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""}),(0,t.jsx)("span",{className:"sr-only",children:e?.title||e?.description})]}):(0,t.jsx)("div",{className:"rounded-card block size-full overflow-hidden",children:(0,t.jsx)(l.Picture,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?P(e.backgroundImage):e?.imgUrl?.url||"",alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""})}),(0,t.jsxs)(v,{...x,className:(0,c.cn)("laptop:p-6 absolute bottom-0 z-[1] box-border flex w-full flex-col p-4",{"bg-gradient-to-b from-transparent to-black/80":e?.showBottomGradient&&e?.theme==="dark","bg-gradient-to-b from-transparent to-white/80":e?.showBottomGradient&&e?.theme!=="dark"}),children:[(0,t.jsxs)("div",{className:(0,c.cn)("flex items-end gap-1 overflow-hidden","graphic-bottom"),children:[(0,t.jsxs)("div",{className:"flex-1 overflow-hidden",children:[(0,t.jsx)(l.Text,{html:e?.title,style:{color:e?.textColor},className:"spanTitle graphic-title lg-desktop:text-lg desktop:text-base line-clamp-3 text-sm font-bold leading-[1.2]"}),e?.description&&(0,t.jsxs)("div",{onMouseMove:b,onMouseLeave:m,children:[e?.title?(0,t.jsx)(l.Heading,{html:e?.description,style:{color:e?.textColor},as:p,className:`${B} graphic-description`}):(0,t.jsx)(p,{style:{color:e?.textColor},dangerouslySetInnerHTML:{__html:e?.description||""},className:`${B} graphic-description-item`}),typeof window<"u"&&n.visible&&(0,U.createPortal)((0,t.jsx)(l.Text,{as:"div",html:n.text,className:"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200",style:{left:`${n.x+16}px`,top:`${n.y+16}px`}}),document.body)]})]}),!e?.isShowIcon&&(e?.video?.url||e?.youtubeId)&&(0,t.jsx)("button",{"aria-label":"Play Video",onClick:a=>{a.preventDefault(),a.stopPropagation(),o?.onVideoPlayBtnClick?.(o?.index||0,e)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white/20 hover:bg-black/75",children:(0,t.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})}),e?.isShowIcon&&e?.icon?.url&&(0,t.jsx)("button",{onClick:a=>{a.preventDefault(),a.stopPropagation(),o?.onIconClick?.(e,o)},className:"laptop:size-9 flex size-8 items-center justify-center overflow-hidden rounded-full bg-white/20 hover:bg-black/75",children:(0,t.jsx)(l.Picture,{className:"h-full",imgClassName:"h-full object-cover",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),e.buttonText&&(0,t.jsx)(l.Button,{as:"a","aria-label":e?.title||e?.description,variant:"secondary",className:"bgButton mt-[8px] self-start",href:(0,T.trackUrlRef)((0,c.getLocalizedPath)(e?.href||"",o?.locale||"us"),`${u}_${h}`),"data-headless-nav-position":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}#${e?.buttonText}`,children:e.buttonText})]})]})})})},L=({items:e=[],sharedConfig:o})=>{const s=n=>{const i=e.length>3,p=e.length>2;switch(n){case 1440:return i?4:e.length;case 1024:return i?3:e.length;case 768:return e.length===1?1:i||p?2.3:2;default:return e.length===1?1:1.2}};return(0,t.jsx)(H.default,{id:"Graphic",className:(0,c.cn)("!overflow-visible"),data:{list:e,configuration:{...o,num:e.length}},Slide:le,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:s()},768:{spaceBetween:16,freeMode:!1,slidesPerView:s(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:s(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:s(1440)}}})},D=r.default.forwardRef(({data:e,className:o,...s},n)=>{const i=(0,A.useMediaQuery)({query:"(max-width: 768px)"}),p=(0,r.useRef)(null),[g,b]=(0,r.useState)(!1),[m,v]=(0,r.useState)(""),[x,a]=(0,r.useState)(""),[_,M]=(0,r.useState)(""),[Y,N]=(0,r.useState)(null),[q,$]=(0,r.useState)(!1),{locale:Q="us"}=(0,j.useAiuiContext)(),X=e?.isShowTab??!1,f=e?.tabs,Z=e?.tabAlign??"left",[F,J]=(0,r.useState)(f?.[0]?.id??"");(0,r.useImperativeHandle)(n,()=>p.current),(0,C.useExposure)(p,{componentType:u,componentName:h,componentTitle:e?.title});const S={itemShape:e?.itemShape,descriptionTag:e?.descriptionTag,locale:Q,onVideoPlayBtnClick:(d,w)=>{b(!0),w?.isYouTube?(a(w?.youtubeId||""),v(""),M("")):(a(""),v(w?.video?.url||""),M(w?.mobileVideo?.url||""))},onIconClick:d=>{$(!0),N(d)}},V=()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(R.VideoModal,{visible:g,youTubeId:x,onCloseModal:()=>b(!1),videoUrl:x?"":i&&_||m}),(0,t.jsx)(E.TextModal,{textVisible:q,extension:Y?.extension,onCloseModal:()=>{$(!1),N(null)}})]});return!X||!f||f.length===0?(0,t.jsxs)("div",{...s,ref:p,className:(0,c.cn)("graphicBlock",o),children:[(0,t.jsxs)("div",{className:"graphic-box",children:[e?.title&&(0,t.jsx)(I.default,{data:{title:e.title,align:e?.titleAlign??"left"}}),(0,t.jsx)(L,{items:e?.items,sharedConfig:S})]}),V()]}):(0,t.jsxs)("div",{...s,ref:p,className:(0,c.cn)("graphicBlock",o),children:[e?.title&&(0,t.jsx)(I.default,{data:{title:e.title,align:e?.titleAlign??"left"}}),(0,t.jsxs)(l.Tabs,{value:F,onValueChange:J,align:Z,children:[(0,t.jsx)("div",{className:"mb-[24px]",children:(0,t.jsx)(l.TabsList,{children:f.map(d=>(0,t.jsx)(l.TabsTrigger,{value:d.id,children:d.label},d.id))})}),f.map(d=>(0,t.jsx)(l.TabsContent,{value:d.id,children:(0,t.jsx)(L,{items:d.items,sharedConfig:S})},d.id))]}),V()]})});D.displayName="Graphic";var ie=(0,z.withLayout)(D);
@@ -1 +1 @@
1
- "use strict";var c=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var r=Object.prototype.hasOwnProperty;var s=(t,p)=>{for(var a in p)c(t,a,{get:p[a],enumerable:!0})},x=(t,p,a,e)=>{if(p&&typeof p=="object"||typeof p=="function")for(let d of m(p))!r.call(t,d)&&d!==a&&c(t,d,{get:()=>p[d],enumerable:!(e=i(p,d))||e.enumerable});return t};var g=t=>x(c({},"__esModule",{value:!0}),t);var R={};s(R,{default:()=>N});module.exports=g(R);var o=require("react/jsx-runtime"),l=require("../../../../components/index.js");const G=({BoxLeftGallery:t,BoxRightDetail:p,BoxBottomSummary:a})=>(0,o.jsxs)("div",{id:"ipc-product-card",className:"laptop-md:pt-6 laptop-md:px-16 lg-desktop:px-[calc(50%-832px)]",children:[(0,o.jsxs)(l.Grid,{className:"ipc-box-grid laptop-md:gap-x-4 lg-desktop:gap-6 gap-8 laptop:gap-y-8 laptop-md:gap-y-8",children:[(0,o.jsx)(l.GridItem,{className:"ipc-box-left-grid-item laptop:px-0 laptop-md:col-start-1 laptop-md:col-span-8 laptop-md:sticky laptop-md:top-[124px] col-span-12 h-fit",children:t}),(0,o.jsx)(l.GridItem,{className:"ipc-box-right-grid-item laptop-md:col-start-9 laptop-md:col-span-4 col-span-12",children:p})]}),a]});var N=G;
1
+ "use strict";"use client";var i=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var g=(p,t)=>{for(var a in t)i(p,a,{get:t[a],enumerable:!0})},x=(p,t,a,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of s(t))!f.call(p,o)&&o!==a&&i(p,o,{get:()=>t[o],enumerable:!(l=r(t,o))||l.enumerable});return p};var n=p=>x(i({},"__esModule",{value:!0}),p);var G={};g(G,{default:()=>u});module.exports=n(G);var e=require("react/jsx-runtime"),c=require("react"),d=require("../../../../components/index.js"),m=require("../../hooks/useStickyFlip.js");const R=({BoxLeftGallery:p,BoxRightDetail:t,BoxBottomSummary:a})=>{const l=(0,c.useRef)(null),o=(0,c.useRef)(null);return(0,m.useStickyFlip)(l,o),(0,e.jsxs)("div",{id:"ipc-product-card",className:"laptop-md:pt-6 laptop-md:px-16 lg-desktop:px-[calc(50%-832px)]",children:[(0,e.jsxs)(d.Grid,{className:"ipc-box-grid laptop-md:gap-x-4 lg-desktop:gap-6 gap-8 laptop:gap-y-8 laptop-md:gap-y-8",children:[(0,e.jsx)(d.GridItem,{ref:l,className:"ipc-box-left-grid-item laptop:px-0 laptop-md:col-start-1 laptop-md:col-span-8 laptop-md:sticky laptop-md:top-[124px] col-span-12 h-fit",children:p}),(0,e.jsx)(d.GridItem,{ref:o,className:"ipc-box-right-grid-item laptop-md:col-start-9 laptop-md:col-span-4 col-span-12",children:t})]}),a]})};var u=R;
@@ -1 +1 @@
1
- "use strict";var q=Object.create;var p=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var G=(t,o)=>{for(var e in o)p(t,e,{get:o[e],enumerable:!0})},S=(t,o,e,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of U(o))!$.call(t,i)&&i!==e&&p(t,i,{get:()=>o[i],enumerable:!(n=z(o,i))||n.enumerable});return t};var H=(t,o,e)=>(e=t!=null?q(W(t)):{},S(o||!t||!t.__esModule?p(e,"default",{value:t,enumerable:!0}):e,t)),I=t=>S(p({},"__esModule",{value:!0}),t);var Q={};G(Q,{default:()=>K});module.exports=I(Q);var a=require("react/jsx-runtime"),l=require("../../../../../components/index.js"),P=require("../../../../AiuiProvider/index.js"),T=require("../../../BizProductProvider.js"),f=require("react"),c=require("../../../utils/index.js"),g=require("../../../utils/textFormat.js"),k=require("../../../hooks/useBenefits.js"),A=H(require("../../CartActionButtons/index.js"));const J=({totalSavingsSlot:t,renderComparePrice:o}={})=>{const{copyWriting:e,locale:n="us",trackingData:i,currencyCode:d}=(0,P.useAiuiContext)(),{variant:r,finalPrice:M,totalSavings:m,isLogin:x,comparePrice:C,onAddToCart:D,onBuyNow:B,savingDetail:b,addToCartLoading:F,buyNowLoading:R,notifyMeMode:L,onNotifyMeClick:E,discount:V,memberFunctionResult:y}=(0,T.useBizProductContext)(),O=(0,k.useBenefits)({variant:r}),{commonCoupon:s,memberDiscount:u}=O,_=i?.showComparePrice??!0,j=(0,f.useMemo)(()=>(0,g.replaceTemplate)(e?.totalSavings||"",{amount:(0,c.formatPrice)({amount:m,currencyCode:r.price.currencyCode,locale:d==="CAD"?"us":n||"us"})}),[e?.totalSavings,m,r.price.currencyCode,n]),v=(0,f.useMemo)(()=>{if(!e?.unlockedSaving)return;const N=s?.enable?Number(s?.config?.fixed_value||0):0,h=u?.enable?u.config?.amount??0:0,w=Math.round((y?.withoutCouponMaxMemberTotalSave?Math.max(h,N):h+N)*100)/100;if(!(w<=0))return(0,g.replaceTemplate)(e.unlockedSaving,{amount:(0,c.formatPrice)({amount:w,currencyCode:r.price.currencyCode,locale:d==="CAD"?"us":n||"us"})})},[e?.unlockedSaving,s?.enable,s?.config?.fixed_value,u?.enable,u?.config?.amount,y,r.price.currencyCode,n]);return(0,a.jsxs)(l.Container,{childClassName:"tablet:flex tablet:justify-end tablet:gap-8 laptop-md:px-0 desktop:px-0 tablet:items-center tablet:gap-4",className:"laptop-md:border-none laptop-md:py-0 border-t border-[#E4E5E6] bg-white py-3",children:[r.availableForSale?(0,a.jsxs)("div",{className:"laptop-md:items-end flex flex-col justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(l.Text,{className:"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2]",html:(0,c.formatPrice)({amount:parseFloat(M.toFixed(2)),currencyCode:r.price.currencyCode,locale:d==="CAD"?"us":n||"us"})}),o?o({comparePrice:C}):_&&(m>0||b?.member>0&&x)&&(0,a.jsx)(l.Text,{className:"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2] text-[#4A4C56] line-through",html:(0,c.formatPrice)({amount:C,currencyCode:r.price.currencyCode,locale:d==="CAD"?"us":n||"us"})}),b?.member>0&&x&&(0,a.jsx)(l.Text,{className:"bg-brand-0 rounded px-1 py-[2px] text-sm font-bold text-white",html:e?.memberPrice||"Member Price"})]}),t||(m>0||b?.member>0&&x?(0,a.jsx)(l.Text,{className:"text-brand-0 tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:`${j}`}):v?(0,a.jsx)(l.Text,{className:"text-info-quaternary tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:v}):null)]}):(0,a.jsx)(l.Text,{className:"text-[20px] font-bold text-[#999999]",html:e?.soldOut??"Sold Out"}),(0,a.jsx)("div",{className:"tablet:mt-0 mt-2 flex items-center gap-2",children:(0,a.jsx)(A.default,{mode:L,availableForSale:r.availableForSale,addToCartText:e?.addToCart??"Add to Cart",buyNowText:e?.buyNow??"Buy Now",addToCartLoading:F,buyNowLoading:R,onAddToCart:D,onBuyNow:B,onNotifyMeClick:E,notifyMeText:e?.notifyMe,notifyMeClassName:"w-full"})})]})};var K=J;
1
+ "use strict";var q=Object.create;var u=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var W=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var G=(t,o)=>{for(var e in o)u(t,e,{get:o[e],enumerable:!0})},S=(t,o,e,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of U(o))!$.call(t,c)&&c!==e&&u(t,c,{get:()=>o[c],enumerable:!(r=z(o,c))||r.enumerable});return t};var H=(t,o,e)=>(e=t!=null?q(W(t)):{},S(o||!t||!t.__esModule?u(e,"default",{value:t,enumerable:!0}):e,t)),I=t=>S(u({},"__esModule",{value:!0}),t);var Q={};G(Q,{default:()=>K});module.exports=I(Q);var a=require("react/jsx-runtime"),l=require("../../../../../components/index.js"),P=require("../../../../AiuiProvider/index.js"),k=require("../../../BizProductProvider.js"),f=require("react"),i=require("../../../utils/index.js"),g=require("../../../utils/textFormat.js"),T=require("../../../hooks/useBenefits.js"),A=H(require("../../CartActionButtons/index.js"));const J=({totalSavingsSlot:t,renderComparePrice:o}={})=>{const{copyWriting:e,locale:r="us",trackingData:c,currencyCode:d}=(0,P.useAiuiContext)(),{variant:n,finalPrice:M,totalSavings:s,isLogin:x,comparePrice:C,onAddToCart:D,onBuyNow:B,savingDetail:b,addToCartLoading:F,buyNowLoading:R,notifyMeMode:L,onNotifyMeClick:E,discount:V,memberFunctionResult:y}=(0,k.useBizProductContext)(),O=(0,T.useBenefits)({variant:n}),{commonCoupon:p,memberDiscount:m}=O,_=c?.showComparePrice??!0,j=(0,f.useMemo)(()=>(0,g.replaceTemplate)(e?.totalSavings||"",{amount:(0,i.formatPrice)({amount:s,currencyCode:n.price.currencyCode,locale:d==="CAD"?"us":r||"us"})}),[e?.totalSavings,s,n.price.currencyCode,r]),v=(0,f.useMemo)(()=>{if(!e?.unlockedSaving)return;const h=p?.enable?Number(p?.config?.fixed_value||0):0,N=m?.enable?m.config?.amount??0:0,w=Math.round((y?.withoutCouponMaxMemberTotalSave?Math.max(N,h):N+h)*100)/100;if(!(w<=0))return(0,g.replaceTemplate)(e.unlockedSaving,{amount:(0,i.formatPrice)({amount:w,currencyCode:n.price.currencyCode,locale:d==="CAD"?"us":r||"us"})})},[e?.unlockedSaving,p?.enable,p?.config?.fixed_value,m?.enable,m?.config?.amount,y,n.price.currencyCode,r]);return(0,a.jsxs)(l.Container,{childClassName:"tablet:flex tablet:justify-end tablet:gap-8 laptop-md:px-0 desktop:px-0 tablet:items-center tablet:gap-4",className:"laptop-md:border-none laptop-md:py-0 border-t border-[#E4E5E6] bg-white py-3",children:[n.availableForSale?(0,a.jsxs)("div",{className:"ipc-purchase-bar-price laptop-md:items-end flex flex-col justify-between",children:[(0,a.jsxs)("div",{className:"ipc-purchase-bar-price-row flex items-center gap-1",children:[(0,a.jsx)(l.Text,{className:"ipc-purchase-bar-final-price tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2]",html:(0,i.formatPrice)({amount:parseFloat(M.toFixed(2)),currencyCode:n.price.currencyCode,locale:d==="CAD"?"us":r||"us"})}),o?o({comparePrice:C}):_&&(s>0||b?.member>0&&x)&&(0,a.jsx)(l.Text,{className:"ipc-purchase-bar-compare-price tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2] text-[#4A4C56] line-through",html:(0,i.formatPrice)({amount:C,currencyCode:n.price.currencyCode,locale:d==="CAD"?"us":r||"us"})}),b?.member>0&&x&&(0,a.jsx)(l.Text,{className:"ipc-purchase-bar-member-badge bg-brand-0 rounded px-1 py-[2px] text-sm font-bold text-white",html:e?.memberPrice||"Member Price"})]}),t||(s>0||b?.member>0&&x?(0,a.jsx)(l.Text,{className:"ipc-purchase-bar-total-savings text-brand-0 tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:`${j}`}):v?(0,a.jsx)(l.Text,{className:"ipc-purchase-bar-unlocked-saving text-info-quaternary tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:v}):null)]}):(0,a.jsx)(l.Text,{className:"text-[20px] font-bold text-[#999999]",html:e?.soldOut??"Sold Out"}),(0,a.jsx)("div",{className:"tablet:mt-0 mt-2 flex items-center gap-2",children:(0,a.jsx)(A.default,{mode:L,availableForSale:n.availableForSale,addToCartText:e?.addToCart??"Add to Cart",buyNowText:e?.buyNow??"Buy Now",addToCartLoading:F,buyNowLoading:R,onAddToCart:D,onBuyNow:B,onNotifyMeClick:E,notifyMeText:e?.notifyMe,notifyMeClassName:"w-full"})})]})};var K=J;
@@ -0,0 +1,20 @@
1
+ import { type RefObject } from 'react';
2
+ export declare const FLIP_DURATION = 250;
3
+ export declare const FLIP_EASING = "cubic-bezier(0.2, 0, 0, 1)";
4
+ export declare const FLIP_DESKTOP_QUERY = "(min-width: 1280px)";
5
+ export declare function parseTranslateY(transform: string | null | undefined): number;
6
+ /** 旧视觉位置与新布局位置的差值,小于 MIN_DELTA 视为没有位移 */
7
+ export declare function computeFlipDelta(prevVisualTop: number, nextLayoutTop: number): number;
8
+ /**
9
+ * sticky 元素被容器底部顶住时,观察元素高度变化会让它瞬间跳位。
10
+ * 这里在布局变化后、绘制前,用 FLIP 把这次跳动变成平滑过渡,不改变滚动位置。
11
+ *
12
+ * - 仅在 `query` 命中且未开启 prefers-reduced-motion 时生效
13
+ * - resize 期间不播放动画,避免拖动窗口时拖尾
14
+ * - 动画中再次触发会从当前视觉位置重新起动画
15
+ */
16
+ export declare function useStickyFlip(targetRef: RefObject<HTMLElement | null>, observedRef: RefObject<HTMLElement | null>, options?: {
17
+ query?: string;
18
+ duration?: number;
19
+ easing?: string;
20
+ }): void;
@@ -0,0 +1 @@
1
+ "use strict";var f=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var N=(e,t)=>{for(var n in t)f(e,n,{get:t[n],enumerable:!0})},P=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Y(t))!q.call(e,r)&&r!==n&&f(e,r,{get:()=>t[r],enumerable:!(s=C(t,r))||s.enumerable});return e};var U=e=>P(f({},"__esModule",{value:!0}),e);var H={};N(H,{FLIP_DESKTOP_QUERY:()=>z,FLIP_DURATION:()=>M,FLIP_EASING:()=>O,computeFlipDelta:()=>I,parseTranslateY:()=>_,useStickyFlip:()=>k});module.exports=U(H);var h=require("react");const M=250,O="cubic-bezier(0.2, 0, 0, 1)",z="(min-width: 1280px)",j="(prefers-reduced-motion: reduce)",B=.5,$=150;function _(e){if(!e||e==="none")return 0;const t=e.match(/^matrix3d\((.+)\)$/);if(t)return parseFloat(t[1].split(",")[13])||0;const n=e.match(/^matrix\((.+)\)$/);return n&&parseFloat(n[1].split(",")[5])||0}function I(e,t){const n=e-t;return Math.abs(n)<B?0:n}function k(e,t,n={}){const{query:s=z,duration:r=M,easing:T=O}=n;(0,h.useEffect)(()=>{const o=e.current,E=t.current;if(!o||!E||typeof ResizeObserver>"u")return;const S=window.matchMedia(s),F=window.matchMedia(j),D=()=>S.matches&&!F.matches&&typeof o.animate=="function";let i=null,u=!1,d,b=!1;const w=()=>i?_(getComputedStyle(o).transform):0;let m=o.getBoundingClientRect().top;const c=()=>{m=o.getBoundingClientRect().top-w()},a=()=>{const p=i;i=null,p?.cancel()},A=()=>{if(!b){b=!0,c();return}if(u||!D()){a(),c();return}const p=m+w();a();const v=o.getBoundingClientRect().top;m=v;const y=I(p,v);if(!y)return;const l=o.animate([{transform:`translateY(${y}px)`},{transform:"translateY(0)"}],{duration:r,easing:T}),L=()=>{i===l&&(i=null)};l.onfinish=L,l.oncancel=L,i=l},g=()=>c(),x=()=>{u=!0,a(),c(),clearTimeout(d),d=setTimeout(()=>{u=!1,c()},$)},R=new ResizeObserver(A);return R.observe(E),window.addEventListener("scroll",g,{passive:!0}),window.addEventListener("resize",x),()=>{R.disconnect(),window.removeEventListener("scroll",g),window.removeEventListener("resize",x),clearTimeout(d),a()}},[e,t,s,r,T])}
@@ -1 +1 @@
1
- "use strict";"use client";var j=Object.create;var g=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var H=(t,r)=>{for(var e in r)g(t,e,{get:r[e],enumerable:!0})},b=(t,r,e,m)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of O(r))!A.call(t,l)&&l!==e&&g(t,l,{get:()=>r[l],enumerable:!(m=D(r,l))||m.enumerable});return t};var I=(t,r,e)=>(e=t!=null?j(q(t)):{},b(r||!t||!t.__esModule?g(e,"default",{value:t,enumerable:!0}):e,t)),R=t=>b(g({},"__esModule",{value:!0}),t);var U={};H(U,{SceneProductCard:()=>x});module.exports=R(U);var a=require("react/jsx-runtime"),M=I(require("react")),i=require("../../helpers/index.js"),s=require("../../components/index.js"),k=require("./context.js"),C=require("../../shared/LocalizedLink.js");const x=M.forwardRef(({className:t,classNames:r,product:e,selected:m,onSelectChange:l,showTags:P,showOriginalPrice:u,onProductImageClick:N,...S},v)=>{const c=(0,k.useSceneShelfContext)(),w=P??c?.showTags??!0,y=u??c?.showOriginalPrice??!0,o=r??c?.classNames??{},p=m??(c?c.selectedIds.has(e.id):!1),h=l??c?.onSelectChange,f=N??c?.onProductImageClick,d=e.soldOut??!1,z=n=>{d||typeof n=="boolean"&&h?.(n,e)},T=()=>{d||h?.(!p,e)};return(0,a.jsxs)("div",{ref:v,className:(0,i.cn)("scene-shelf-product-card","lg-desktop:gap-2 lg-desktop:h-[362px] lg-desktop:px-6 lg-desktop:pb-6 lg-desktop:pt-4 rounded-box box-border flex h-[284px] flex-col justify-between gap-2 border-2 border-solid p-4 pb-6 transition-colors",d?"cursor-not-allowed opacity-50":"cursor-pointer",p?(0,i.cn)("border-brand-0 bg-container-secondary-0",o?.cardSelected):(0,i.cn)("border-lines bg-container-primary",!d&&"hover:bg-container-secondary",o?.card),t),onClick:T,"data-headless-type-name":"SceneShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name??e.title}##Select`,"data-headless-sku":e.id,...S,children:[(0,a.jsx)("div",{className:(0,i.cn)("scene-shelf-product-card-tags","lg-desktop:left-6 lg-desktop:top-6 flex max-h-[24px] min-h-[24px] flex-wrap gap-1 overflow-visible pr-9",o?.tags),children:w&&e.tags?.map((n,L)=>(0,a.jsx)(s.Badge,{variant:n.variant||"outline",size:"sm",className:"scene-shelf-product-card-badge",children:n.label},L))}),(0,a.jsx)(s.Checkbox,{checked:p,disabled:d,onCheckedChange:z,onClick:n=>n.stopPropagation(),className:(0,i.cn)("scene-shelf-product-card-checkbox","text-brand-0 border-brand-0 lg-desktop:right-6 lg-desktop:top-6 absolute right-4 top-4 size-5 shrink-0",o?.checkbox)}),(0,a.jsx)("div",{className:(0,i.cn)("flex flex-1 grow-0 items-center justify-center",o?.image),children:f?(0,a.jsx)("a",{onClick:()=>f(e),role:"button",children:(0,a.jsx)(s.Picture,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):e?.href?(0,a.jsx)(C.LocalizedLink,{href:e.href,children:(0,a.jsx)(s.Picture,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):(0,a.jsx)(s.Picture,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}),(0,a.jsxs)("div",{className:"flex grow flex-col justify-start gap-4",children:[(0,a.jsx)(s.Heading,{as:"h3",size:2,className:(0,i.cn)("text-info-primary line-clamp-2 h-[2.2em]",o?.title),html:e.custom_name??e.title}),(0,a.jsxs)("div",{className:(0,i.cn)("flex flex-wrap items-center gap-1",o?.priceWrapper),children:[(0,a.jsx)(s.Text,{as:"span",size:2,className:(0,i.cn)("text-info-primary lg-desktop:text-[24px] whitespace-nowrap text-[20px]",o?.currentPrice),children:e.currentPrice.formatted}),y&&e.originalPrice&&e.originalPrice.value>e.currentPrice.value&&(0,a.jsx)(s.Text,{as:"span",size:2,className:(0,i.cn)("text-info-quaternary lg-desktop:text-[24px] whitespace-nowrap text-[20px] line-through",o?.originalPrice),children:e.originalPrice.formatted})]}),e?.priceLabel&&(0,a.jsx)(s.Text,{size:4,className:(0,i.cn)("text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] mt-2 text-[14px]",o?.productPriceLabel),children:e.priceLabel})]})]})});x.displayName="SceneShelf.ProductCard";
1
+ "use strict";"use client";var j=Object.create;var g=Object.defineProperty;var D=Object.getOwnPropertyDescriptor;var O=Object.getOwnPropertyNames;var q=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var H=(t,r)=>{for(var e in r)g(t,e,{get:r[e],enumerable:!0})},b=(t,r,e,m)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of O(r))!A.call(t,l)&&l!==e&&g(t,l,{get:()=>r[l],enumerable:!(m=D(r,l))||m.enumerable});return t};var I=(t,r,e)=>(e=t!=null?j(q(t)):{},b(r||!t||!t.__esModule?g(e,"default",{value:t,enumerable:!0}):e,t)),R=t=>b(g({},"__esModule",{value:!0}),t);var U={};H(U,{SceneProductCard:()=>x});module.exports=R(U);var a=require("react/jsx-runtime"),M=I(require("react")),i=require("../../helpers/index.js"),s=require("../../components/index.js"),k=require("./context.js"),C=require("../../shared/LocalizedLink.js");const x=M.forwardRef(({className:t,classNames:r,product:e,selected:m,onSelectChange:l,showTags:P,showOriginalPrice:u,onProductImageClick:N,...S},v)=>{const c=(0,k.useSceneShelfContext)(),w=P??c?.showTags??!0,y=u??c?.showOriginalPrice??!0,o=r??c?.classNames??{},p=m??(c?c.selectedIds.has(e.id):!1),h=l??c?.onSelectChange,f=N??c?.onProductImageClick,d=e.soldOut??!1,z=n=>{d||typeof n=="boolean"&&h?.(n,e)},T=()=>{d||h?.(!p,e)};return(0,a.jsxs)("div",{ref:v,className:(0,i.cn)("scene-shelf-product-card","lg-desktop:gap-2 lg-desktop:h-[362px] lg-desktop:px-6 lg-desktop:pb-6 lg-desktop:pt-4 rounded-box box-border flex h-[284px] flex-col justify-between gap-2 border-2 border-solid p-4 pb-6 transition-colors",d?"cursor-not-allowed opacity-50":"cursor-pointer",p?(0,i.cn)("border-brand-0 bg-container-secondary-0",o?.cardSelected):(0,i.cn)("border-lines bg-container-primary",!d&&"hover:bg-container-secondary",o?.card),t),onClick:T,"data-headless-type-name":"SceneShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name??e.title}##Select`,"data-headless-sku":e.id,...S,children:[(0,a.jsx)("div",{className:(0,i.cn)("scene-shelf-product-card-tags","lg-desktop:left-6 lg-desktop:top-6 flex max-h-[24px] min-h-[24px] flex-wrap gap-1 overflow-visible pr-9",o?.tags),children:w&&e.tags?.map((n,L)=>(0,a.jsx)(s.Badge,{variant:n.variant||"outline",size:"sm",className:"scene-shelf-product-card-badge",children:n.label},L))}),(0,a.jsx)(s.Checkbox,{checked:p,disabled:d,onCheckedChange:z,onClick:n=>n.stopPropagation(),className:(0,i.cn)("scene-shelf-product-card-checkbox","text-brand-0 border-brand-0 lg-desktop:right-6 lg-desktop:top-6 absolute right-4 top-4 size-5 shrink-0",o?.checkbox)}),(0,a.jsx)("div",{className:(0,i.cn)("flex flex-1 grow-0 items-center justify-center",o?.image),children:f?(0,a.jsx)("a",{onClick:()=>f(e),role:"button",children:(0,a.jsx)(s.Picture,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):e?.href?(0,a.jsx)(C.LocalizedLink,{href:e.href,children:(0,a.jsx)(s.Picture,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):(0,a.jsx)(s.Picture,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}),(0,a.jsxs)("div",{className:"flex grow flex-col justify-start gap-4",children:[(0,a.jsx)(s.Heading,{as:"h3",size:2,className:(0,i.cn)("text-info-primary line-clamp-2",o?.title),html:e.custom_name??e.title}),(0,a.jsxs)("div",{className:(0,i.cn)("flex flex-wrap items-center gap-1",o?.priceWrapper),children:[(0,a.jsx)(s.Text,{as:"span",size:2,className:(0,i.cn)("text-info-primary lg-desktop:text-[24px] whitespace-nowrap text-[20px]",o?.currentPrice),children:e.currentPrice.formatted}),y&&e.originalPrice&&e.originalPrice.value>e.currentPrice.value&&(0,a.jsx)(s.Text,{as:"span",size:2,className:(0,i.cn)("text-info-quaternary lg-desktop:text-[24px] whitespace-nowrap text-[20px] line-through",o?.originalPrice),children:e.originalPrice.formatted})]}),e?.priceLabel&&(0,a.jsx)(s.Text,{size:4,className:(0,i.cn)("text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] mt-2 text-[14px]",o?.productPriceLabel),children:e.priceLabel})]})]})});x.displayName="SceneShelf.ProductCard";
@@ -1 +1 @@
1
- "use strict";"use client";var W=Object.create;var x=Object.defineProperty;var X=Object.getOwnPropertyDescriptor;var Y=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty;var $=(e,r)=>{for(var o in r)x(e,o,{get:r[o],enumerable:!0})},D=(e,r,o,u)=>{if(r&&typeof r=="object"||typeof r=="function")for(let c of Y(r))!_.call(e,c)&&c!==o&&x(e,c,{get:()=>r[c],enumerable:!(u=X(r,c))||u.enumerable});return e};var ee=(e,r,o)=>(o=e!=null?W(Z(e)):{},D(r||!e||!e.__esModule?x(o,"default",{value:e,enumerable:!0}):o,e)),te=e=>D(x({},"__esModule",{value:!0}),e);var ae={};$(ae,{SceneShelfProductsPanel:()=>g});module.exports=te(ae);var t=require("react/jsx-runtime"),f=ee(require("react")),y=require("swiper/react"),P=require("swiper/modules"),n=require("../../helpers/index.js"),i=require("../../components/index.js"),F=require("./context.js"),oe=require("swiper/css");const g=f.forwardRef(({title:e,totalPriceLabel:r,totalCurrentPrice:o,totalOriginalPrice:u,primaryButtonText:c,primaryButtonFun:M,secondaryButtonText:A,secondaryButtonFun:R,bundleDiscountLabel:O,className:z,children:V,...H},j)=>{const a=(0,F.useSceneShelfContext)(),s=a?.classNames,h=r??a?.totalPriceLabel??"Total Price:",p=o??a?.totalCurrentPrice,w=u??a?.totalOriginalPrice,B=c??a?.primaryButtonText??"Shop Now",T=M??a?.primaryButtonFun??"buyNow",N=A??a?.secondaryButtonText??"Add to Cart",S=R??a?.secondaryButtonFun??"addCart",m=O??a?.bundleDiscountLabel,d=a?.selectedProducts??[],E=a?.onLearnMore,q=a?.onShopNow,G=a?.onAddToCart,I=a?.showOriginalPrice??!0,[J,K]=f.useState(!1),[Q,U]=f.useState(!1),L=f.Children.toArray(V),v=async(l,b)=>{if(!l)return;const C=b==="primary"?K:U;C(!0);try{switch(l){case"buyNow":await q?.(d);break;case"addCart":await G?.(d);break;case"learnMore":await E?.(d);break;default:break}}finally{C(!1)}},k=l=>l==="learnMore"?!1:d.length===0;return(0,t.jsxs)("div",{ref:j,className:(0,n.cn)("bg-container-primary laptop:p-6 lg-desktop:p-8 flex min-w-0 flex-1 flex-col justify-between overflow-hidden p-4",z,s?.content),...H,children:[e&&(0,t.jsx)(i.Heading,{as:"h2",size:3,className:(0,n.cn)("text-info-primary flex-0 mb-[16px] line-clamp-1 shrink-0",s?.title),html:e}),(0,t.jsx)("div",{className:(0,n.cn)("lg-desktop:mb-[24px] mb-[16px] flex-1 ",s?.productList),children:(0,t.jsx)(y.Swiper,{modules:[P.FreeMode,P.Mousewheel],freeMode:!0,mousewheel:{forceToAxis:!0},slidesPerView:"auto",spaceBetween:10,breakpoints:{0:{slidesPerView:1.5},768:{spaceBetween:16,slidesPerView:2.8},1024:{slidesPerView:2.3},1440:{spaceBetween:16,slidesPerView:L.length<=3?3:3.2}},children:L.map((l,b)=>(0,t.jsx)(y.SwiperSlide,{className:"h-fit shrink-0",children:l},b))})}),(0,t.jsxs)("div",{className:(0,n.cn)("tablet:items-end tablet:flex-row flex-0 flex flex-col items-start justify-between gap-2",s?.footer),children:[(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsxs)("div",{className:(0,n.cn)("flex flex-wrap items-center gap-1",s?.totalPrice),children:[h&&(0,t.jsx)(i.Text,{as:"span",size:2,className:"text-info-primary lg-desktop:text-[24px] text-[20px]",children:h}),p&&(0,t.jsx)(i.Text,{as:"span",size:2,className:(0,n.cn)("text-info-primary lg-desktop:text-[24px] text-[20px]",s?.currentTotalPrice),children:p.formatted}),I&&w&&p&&w.value>p.value&&(0,t.jsx)(i.Text,{as:"span",size:2,className:(0,n.cn)("text-info-quaternary lg-desktop:text-[24px] text-[20px] line-through",s?.originalTotalPrice),children:w.formatted})]}),m&&(0,t.jsx)(i.Text,{as:"span",size:2,className:(0,n.cn)("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 text-[14px]",s?.bundleDiscountLabel),children:typeof m=="function"?m(d):m})]}),(0,t.jsxs)("div",{className:(0,n.cn)("flex items-stretch gap-3",s?.buttonGroup),children:[N&&(0,t.jsx)(i.Button,{variant:"secondary",className:"min-w-0 whitespace-normal text-center",onClick:()=>v(S,"secondary"),disabled:k(S),loading:Q,children:N}),B&&(0,t.jsx)(i.Button,{variant:"primary",className:"min-w-0 whitespace-normal text-center",onClick:()=>v(T,"primary"),disabled:k(T),loading:J,children:B})]})]})]})});g.displayName="SceneShelf.ProductsPanel";
1
+ "use strict";"use client";var Y=Object.create;var f=Object.defineProperty;var ee=Object.getOwnPropertyDescriptor;var te=Object.getOwnPropertyNames;var ae=Object.getPrototypeOf,re=Object.prototype.hasOwnProperty;var ne=(t,r)=>{for(var n in r)f(t,n,{get:r[n],enumerable:!0})},R=(t,r,n,p)=>{if(r&&typeof r=="object"||typeof r=="function")for(let l of te(r))!re.call(t,l)&&l!==n&&f(t,l,{get:()=>r[l],enumerable:!(p=ee(r,l))||p.enumerable});return t};var oe=(t,r,n)=>(n=t!=null?Y(ae(t)):{},R(r||!t||!t.__esModule?f(n,"default",{value:t,enumerable:!0}):n,t)),se=t=>R(f({},"__esModule",{value:!0}),t);var ie={};ne(ie,{SceneShelfProductsPanel:()=>S});module.exports=se(ie);var e=require("react/jsx-runtime"),c=oe(require("react")),y=require("swiper/react"),P=require("swiper/modules"),o=require("../../helpers/index.js"),s=require("../../components/index.js"),z=require("../SwiperBox/buildSsrSlideCss.js"),H=require("./context.js"),ce=require("swiper/css");const S=c.forwardRef(({title:t,totalPriceLabel:r,totalCurrentPrice:n,totalOriginalPrice:p,primaryButtonText:l,primaryButtonFun:O,secondaryButtonText:V,secondaryButtonFun:_,bundleDiscountLabel:j,className:E,children:I,...$},q)=>{const a=(0,H.useSceneShelfContext)(),i=a?.classNames,T=r??a?.totalPriceLabel??"Total Price:",m=n??a?.totalCurrentPrice,w=p??a?.totalOriginalPrice,N=l??a?.primaryButtonText??"Shop Now",L=O??a?.primaryButtonFun??"buyNow",C=V??a?.secondaryButtonText??"Add to Cart",k=_??a?.secondaryButtonFun??"addCart",x=j??a?.bundleDiscountLabel,u=a?.selectedProducts??[],G=a?.onLearnMore,W=a?.onShopNow,Z=a?.onAddToCart,J=a?.showOriginalPrice??!0,[K,Q]=c.useState(!1),[U,X]=c.useState(!1),v=c.Children.toArray(I),D=v.length,g=c.useMemo(()=>({0:{slidesPerView:1.5,spaceBetween:10},768:{slidesPerView:2.8,spaceBetween:16},1024:{slidesPerView:2.3,spaceBetween:10},1440:{slidesPerView:D<=3?3:3.2,spaceBetween:16}}),[D]),b=`swiper-ssr-${c.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,h=c.useMemo(()=>(0,z.buildSsrSlideCss)(`.${b}`,g),[b,g]),F=async(d,B)=>{if(!d)return;const A=B==="primary"?Q:X;A(!0);try{switch(d){case"buyNow":await W?.(u);break;case"addCart":await Z?.(u);break;case"learnMore":await G?.(u);break;default:break}}finally{A(!1)}},M=d=>d==="learnMore"?!1:u.length===0;return(0,e.jsxs)("div",{ref:q,className:(0,o.cn)("bg-container-primary laptop:p-6 lg-desktop:p-8 flex min-w-0 flex-1 flex-col justify-between overflow-hidden p-4",E,i?.content),...$,children:[t&&(0,e.jsx)(s.Heading,{as:"h2",size:3,className:(0,o.cn)("text-info-primary flex-0 mb-[16px] line-clamp-1 shrink-0",i?.title),html:t}),(0,e.jsxs)("div",{className:(0,o.cn)("lg-desktop:mb-[24px] mb-[16px] flex-1 ",i?.productList),children:[h&&(0,e.jsx)("style",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:h}}),(0,e.jsx)(y.Swiper,{modules:[P.FreeMode,P.Mousewheel],freeMode:!0,mousewheel:{forceToAxis:!0},className:h?b:void 0,breakpoints:g,children:v.map((d,B)=>(0,e.jsx)(y.SwiperSlide,{className:"h-fit shrink-0",children:d},B))})]}),(0,e.jsxs)("div",{className:(0,o.cn)("tablet:items-end tablet:flex-row flex-0 flex flex-col items-start justify-between gap-2",i?.footer),children:[(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsxs)("div",{className:(0,o.cn)("flex flex-wrap items-center gap-1",i?.totalPrice),children:[T&&(0,e.jsx)(s.Text,{as:"span",size:2,className:"text-info-primary lg-desktop:text-[24px] text-[20px]",children:T}),m&&(0,e.jsx)(s.Text,{as:"span",size:2,className:(0,o.cn)("text-info-primary lg-desktop:text-[24px] text-[20px]",i?.currentTotalPrice),children:m.formatted}),J&&w&&m&&w.value>m.value&&(0,e.jsx)(s.Text,{as:"span",size:2,className:(0,o.cn)("text-info-quaternary lg-desktop:text-[24px] text-[20px] line-through",i?.originalTotalPrice),children:w.formatted})]}),x&&(0,e.jsx)(s.Text,{as:"span",size:2,className:(0,o.cn)("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 text-[14px]",i?.bundleDiscountLabel),children:typeof x=="function"?x(u):x})]}),(0,e.jsxs)("div",{className:(0,o.cn)("flex items-stretch gap-3",i?.buttonGroup),children:[C&&(0,e.jsx)(s.Button,{variant:"secondary",className:"min-w-0 whitespace-normal text-center",onClick:()=>F(k,"secondary"),disabled:M(k),loading:U,children:C}),N&&(0,e.jsx)(s.Button,{variant:"primary",className:"min-w-0 whitespace-normal text-center",onClick:()=>F(L,"primary"),disabled:M(L),loading:K,children:N})]})]})]})});S.displayName="SceneShelf.ProductsPanel";
@@ -1 +1 @@
1
- "use strict";"use client";var pt=Object.create;var w=Object.defineProperty;var ft=Object.getOwnPropertyDescriptor;var ht=Object.getOwnPropertyNames;var gt=Object.getPrototypeOf,xt=Object.prototype.hasOwnProperty;var wt=(t,n)=>{for(var e in n)w(t,e,{get:n[e],enumerable:!0})},S=(t,n,e,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of ht(n))!xt.call(t,r)&&r!==e&&w(t,r,{get:()=>n[r],enumerable:!(o=ft(n,r))||o.enumerable});return t};var bt=(t,n,e)=>(e=t!=null?pt(gt(t)):{},S(n||!t||!t.__esModule?w(e,"default",{value:t,enumerable:!0}):e,t)),yt=t=>S(w({},"__esModule",{value:!0}),t);var Ft={};wt(Ft,{default:()=>Lt});module.exports=yt(Ft);var i=require("react/jsx-runtime"),a=bt(require("react")),b=require("gsap"),F=require("gsap/dist/SplitText"),H=require("gsap/dist/ScrollTrigger"),l=require("../../helpers/utils.js"),C=require("class-variance-authority"),d=require("../../components/index.js"),O=require("../../shared/Styles.js"),U=require("../AiuiProvider/index.js"),W=require("@payloadcms/richtext-lexical/plaintext"),Z=require("../../shared/trackUrlRef.js"),q=require("react-intersection-observer");const $="link",_="title";function vt(t){if(!t)return!1;if(typeof t=="string")return t.trim().length>0;const n=t?.root?.children;return!Array.isArray(n)||n.length===0?!1:n.some(e=>{const o=e?.children;return!Array.isArray(o)||o.length===0?!1:o.some(r=>typeof r?.text=="string"&&r.text.length>0)})}function B(t){if(!t)return"";if(typeof t=="string")return t;try{return(0,W.convertLexicalToPlaintext)({data:t})||""}catch{return""}}const kt=(0,C.cva)("",{variants:{theme:{light:"text-[#080A0F]",dark:"text-[#F5F6F7]"}},defaultVariants:{theme:"light"}}),Tt=(0,C.cva)("desktop:text-base desktop:mt-2 lg-desktop:text-[18px] mt-1 text-[14px] font-bold leading-[1.4] tracking-[-0.36px]",{variants:{theme:{light:"text-[#080A0F]",dark:"text-[#F5F6F7]"}},defaultVariants:{theme:"light"}}),I=({data:t,onClick:n,className:e})=>{const{theme:o="light",extensions:r,title:h,caption:y,align:g}=t,{locale:v="us"}=(0,U.useAiuiContext)();if(!r?.textLink)return null;const u=r?.link?(0,Z.trackUrlRef)((0,l.getLocalizedPath)(r.link,v),`${$}_${_}`):void 0;return(0,i.jsxs)("a",{className:(0,l.cn)({"aiui-dark":o==="dark"},"hover:text-brand-0 [&_svg_path]:hover:fill-brand-0 lg-desktop:text-base flex cursor-pointer items-center overflow-hidden text-sm font-[700] leading-[1.4] transition-all duration-[0.4s]",{"text-[#080A0F]":o==="light"},{"text-[#F5F6F7]":o==="dark"},{"justify-center mt-4":g==="center"},{"mt-1 laptop:mt-0":g==="left"},e),...u?{href:u}:{},"data-headless-type-name":`${$}#${_}`,"data-headless-title-desc-button":`${B(h)}#${B(y)}`,...n?{onClick:n}:{},children:[(0,i.jsx)("div",{className:"truncate whitespace-nowrap",children:r?.textLink}),(0,i.jsx)("div",{className:"lg-desktop:size-5 size-4",children:(0,i.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",children:(0,i.jsx)("path",{d:"M5.52827 3.52864C5.78862 3.26829 6.21063 3.26829 6.47098 3.52864L10.471 7.52864C10.7313 7.78899 10.7313 8.21099 10.471 8.47134L6.47098 12.4713C6.21063 12.7317 5.78862 12.7317 5.52827 12.4713C5.26792 12.211 5.26792 11.789 5.52827 11.5286L9.05692 7.99999L5.52827 4.47134C5.26792 4.21099 5.26792 3.78899 5.52827 3.52864Z",fill:o==="dark"?"#F5F6F7":"#080A0F",className:"transition-all duration-[0.4s]"})})})]})},j=a.default.forwardRef(({data:t,className:n,classNames:e,as:o="h2",weight:r="bold",onButtonClick:h,id:y,...g},v)=>{const{title:u,titleSize:G=4,caption:D,subtitle:M,content:z,countdown:s,showCountdown:J=!1,theme:x="light",extensions:E,align:m="left"}=t,P=(0,a.useRef)(null),p=(0,a.useRef)(null),c=(0,a.useRef)(null),f=(0,a.useRef)(null),[K,Q]=(0,a.useState)(!0),{ref:X,inView:R}=(0,q.useInView)();(0,a.useImperativeHandle)(v,()=>P.current);const Y=()=>{Q(!1)},tt=s?.targetDateTime||s?.targetDate||"",et=s?.targetDateTime_tz,nt=s?.labels?{day:s.labels.days||"Day",hour:s.labels.hours||"Hours",minute:s.labels.minutes||"Mins",second:s.labels.seconds||"Secs"}:void 0;return(0,a.useEffect)(()=>{b.gsap.registerPlugin(F.SplitText,H.ScrollTrigger);function rt(){if(!p.current)return;const it=p.current?.clientHeight||80;c.current&&c.current.revert(),f.current&&f.current.kill(),c.current=new F.SplitText(p.current,{type:"words",wordsClass:"word"});const k=c.current.words;b.gsap.set(k,{opacity:0}),f.current=H.ScrollTrigger.create({trigger:p.current,start:"bottom bottom-=4%",end:`bottom+=${it*1.5+60}px bottom-=4%`,scrub:!0,invalidateOnRefresh:!0,onUpdate:ot=>{const st=ot.progress,A=k.length||1,at=.5,T=1/A,V=T*(1-at),N=(A-1)*V+T,lt=Math.min(1,N>0?st/N:0);k.forEach((dt,ct)=>{const ut=ct*V,mt=T;let L=(lt-ut)/mt;L=Math.max(0,Math.min(1,L)),b.gsap.set(dt,{opacity:L})})}})}return R&&rt(),()=>{c.current&&c.current.revert(),f.current&&f.current.kill()}},[R]),(0,i.jsxs)("div",{id:E?.id?E?.id:y,className:(0,l.cn)("titleBottom title-box flex items-end justify-between gap-2 pb-6",n,e?.wrapper),...g,ref:P,children:[(0,i.jsxs)("div",{ref:X,className:(0,l.cn)("flex-1",e?.container,{"aiui-dark":x==="dark","text-center":m==="center","text-left":m==="left"}),children:[(D||u)&&(0,i.jsx)(d.Heading,{ref:p,as:o,size:G,html:D||u,weight:r,className:(0,l.cn)(kt({theme:x}),e?.title)}),M&&(0,i.jsx)(d.Text,{html:M,as:"div",className:(0,l.cn)(Tt({theme:x}),e?.subtitle)}),vt(z)&&(0,i.jsx)(d.Text,{html:z,as:"div",size:4,className:(0,l.cn)("title-content text-info-primary desktop:text-base desktop:mt-4 lg-desktop:text-[18px] mt-2 text-[14px] leading-[1.6]",e?.content)}),(0,i.jsx)(I,{data:t,className:(0,l.cn)({"laptop:hidden":m==="left"},e?.button),onClick:h}),J&&s&&K&&(0,i.jsx)(d.Countdown,{endDate:tt,endDate_tz:et,timeLabels:nt,showDays:s?.showDays,showHours:s?.showHours,showMinutes:s?.showMinutes,showSeconds:s?.showSeconds,theme:x,onExpire:Y,hideWhenExpired:!0,align:m==="center"?"center":"left",className:(0,l.cn)("mt-4",e?.countdown)})]}),(0,i.jsx)(I,{data:t,className:(0,l.cn)("hidden",{"laptop:flex":m==="left"},e?.button),onClick:h})]})});j.displayName="Title";var Lt=(0,O.withLayout)(j);
1
+ "use strict";"use client";var pt=Object.create;var x=Object.defineProperty;var mt=Object.getOwnPropertyDescriptor;var ft=Object.getOwnPropertyNames;var ht=Object.getPrototypeOf,gt=Object.prototype.hasOwnProperty;var xt=(t,n)=>{for(var e in n)x(t,e,{get:n[e],enumerable:!0})},A=(t,n,e,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let l of ft(n))!gt.call(t,l)&&l!==e&&x(t,l,{get:()=>n[l],enumerable:!(o=mt(n,l))||o.enumerable});return t};var wt=(t,n,e)=>(e=t!=null?pt(ht(t)):{},A(n||!t||!t.__esModule?x(e,"default",{value:t,enumerable:!0}):e,t)),yt=t=>A(x({},"__esModule",{value:!0}),t);var kt={};xt(kt,{default:()=>vt});module.exports=yt(kt);var r=require("react/jsx-runtime"),s=wt(require("react")),w=require("gsap"),k=require("gsap/dist/SplitText"),C=require("gsap/dist/ScrollTrigger"),a=require("../../helpers/utils.js"),c=require("../../components/index.js"),O=require("../../shared/Styles.js"),U=require("../AiuiProvider/index.js"),W=require("@payloadcms/richtext-lexical/plaintext"),Z=require("../../shared/trackUrlRef.js"),q=require("react-intersection-observer");const V="link",B="title";function bt(t){if(!t)return!1;if(typeof t=="string")return t.trim().length>0;const n=t?.root?.children;return!Array.isArray(n)||n.length===0?!1:n.some(e=>{const o=e?.children;return!Array.isArray(o)||o.length===0?!1:o.some(l=>typeof l?.text=="string"&&l.text.length>0)})}function I(t){if(!t)return"";if(typeof t=="string")return t;try{return(0,W.convertLexicalToPlaintext)({data:t})||""}catch{return""}}const Tt="text-info-primary desktop:text-base desktop:mt-2 lg-desktop:text-[18px] mt-1 text-[14px] font-bold leading-[1.4] tracking-[-0.36px]",_=({data:t,onClick:n,className:e})=>{const{extensions:o,title:l,caption:f,align:h}=t,{locale:y="us"}=(0,U.useAiuiContext)();if(!o?.textLink)return null;const g=o?.link?(0,Z.trackUrlRef)((0,a.getLocalizedPath)(o.link,y),`${V}_${B}`):void 0;return(0,r.jsxs)("a",{className:(0,a.cn)("text-info-primary hover:text-brand-0 lg-desktop:text-base flex cursor-pointer items-center overflow-hidden text-sm font-[700] leading-[1.4] transition-all duration-[0.4s]",{"justify-center mt-4":h==="center"},{"mt-1 laptop:mt-0":h==="left"},e),...g?{href:g}:{},"data-headless-type-name":`${V}#${B}`,"data-headless-title-desc-button":`${I(l)}#${I(f)}`,...n?{onClick:n}:{},children:[(0,r.jsx)("div",{className:"truncate whitespace-nowrap",children:o?.textLink}),(0,r.jsx)("div",{className:"lg-desktop:size-5 size-4",children:(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",children:(0,r.jsx)("path",{d:"M5.52827 3.52864C5.78862 3.26829 6.21063 3.26829 6.47098 3.52864L10.471 7.52864C10.7313 7.78899 10.7313 8.21099 10.471 8.47134L6.47098 12.4713C6.21063 12.7317 5.78862 12.7317 5.52827 12.4713C5.26792 12.211 5.26792 11.789 5.52827 11.5286L9.05692 7.99999L5.52827 4.47134C5.26792 4.21099 5.26792 3.78899 5.52827 3.52864Z",fill:"currentColor",className:"transition-all duration-[0.4s]"})})})]})},j=s.default.forwardRef(({data:t,className:n,classNames:e,as:o="h2",weight:l="bold",onButtonClick:f,id:h,...y},g)=>{const{title:L,titleSize:F=4,caption:H,subtitle:D,content:M,countdown:i,showCountdown:G=!1,theme:z="light",extensions:E,align:u="left"}=t,P=(0,s.useRef)(null),p=(0,s.useRef)(null),d=(0,s.useRef)(null),m=(0,s.useRef)(null),[J,K]=(0,s.useState)(!0),{ref:Q,inView:R}=(0,q.useInView)();(0,s.useImperativeHandle)(g,()=>P.current);const X=()=>{K(!1)},Y=i?.targetDateTime||i?.targetDate||"",tt=i?.targetDateTime_tz,et=i?.labels?{day:i.labels.days||"Day",hour:i.labels.hours||"Hours",minute:i.labels.minutes||"Mins",second:i.labels.seconds||"Secs"}:void 0;return(0,s.useEffect)(()=>{w.gsap.registerPlugin(k.SplitText,C.ScrollTrigger);function nt(){if(!p.current)return;const rt=p.current?.clientHeight||80;d.current&&d.current.revert(),m.current&&m.current.kill(),d.current=new k.SplitText(p.current,{type:"words",wordsClass:"word"});const b=d.current.words;w.gsap.set(b,{opacity:0}),m.current=C.ScrollTrigger.create({trigger:p.current,start:"bottom bottom-=4%",end:`bottom+=${rt*1.5+60}px bottom-=4%`,scrub:!0,invalidateOnRefresh:!0,onUpdate:ot=>{const it=ot.progress,N=b.length||1,st=.5,T=1/N,S=T*(1-st),$=(N-1)*S+T,lt=Math.min(1,$>0?it/$:0);b.forEach((at,ct)=>{const dt=ct*S,ut=T;let v=(lt-dt)/ut;v=Math.max(0,Math.min(1,v)),w.gsap.set(at,{opacity:v})})}})}return R&&nt(),()=>{d.current&&d.current.revert(),m.current&&m.current.kill()}},[R]),(0,r.jsxs)("div",{id:E?.id?E?.id:h,className:(0,a.cn)("titleBottom title-box flex items-end justify-between gap-2 pb-6",{"aiui-dark":z==="dark"},n,e?.wrapper),...y,ref:P,children:[(0,r.jsxs)("div",{ref:Q,className:(0,a.cn)("flex-1",e?.container,{"text-center":u==="center","text-left":u==="left"}),children:[(H||L)&&(0,r.jsx)(c.Heading,{ref:p,as:o,size:F,html:H||L,weight:l,className:(0,a.cn)("text-info-primary",e?.title)}),D&&(0,r.jsx)(c.Text,{html:D,as:"div",className:(0,a.cn)(Tt,e?.subtitle)}),bt(M)&&(0,r.jsx)(c.Text,{html:M,as:"div",size:4,className:(0,a.cn)("title-content text-info-primary desktop:text-base desktop:mt-4 lg-desktop:text-[18px] mt-2 text-[14px] leading-[1.6]",e?.content)}),(0,r.jsx)(_,{data:t,className:(0,a.cn)({"laptop:hidden":u==="left"},e?.button),onClick:f}),G&&i&&J&&(0,r.jsx)(c.Countdown,{endDate:Y,endDate_tz:tt,timeLabels:et,showDays:i?.showDays,showHours:i?.showHours,showMinutes:i?.showMinutes,showSeconds:i?.showSeconds,theme:z,onExpire:X,hideWhenExpired:!0,align:u==="center"?"center":"left",className:(0,a.cn)("mt-4",e?.countdown)})]}),(0,r.jsx)(_,{data:t,className:(0,a.cn)("hidden",{"laptop:flex":u==="left"},e?.button),onClick:f})]})});j.displayName="Title";var vt=(0,O.withLayout)(j);
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as i}from"react/jsx-runtime";import*as m from"react";import{cn as r}from"../../helpers/index.js";import"../../components/badge.js";import h from"../../components/picture.js";import{Text as s}from"../../components/text.js";const f=({checked:e,theme:l})=>{const o=l==="dark";return e?i("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",fill:o?"#F5F6F7":"#080A0F"}),t("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",stroke:o?"#F5F6F7":"#080A0F",strokeWidth:"1.6"}),t("path",{d:"M8 11.5833L10.9474 14.5L16 9.5",stroke:o?"#1E2024":"white",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]}):t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",stroke:o?"#B5B7BB":"#2A2C32",strokeWidth:"1.6"})})},p=m.forwardRef(({gift:e,onClick:l,className:o,giftType:a,theme:c,tagBgColor:d,tagTextColor:n},x)=>t("div",{ref:x,className:r("bg-container-primary laptop:rounded-[8px] border-lines relative flex w-full flex-col overflow-hidden rounded-[6px] border-2 transition-all",a===2?"border-brand-0 bg-container-secondary-0 cursor-default":`cursor-pointer hover:shadow-sm ${e.selected?"border-brand-0 bg-container-secondary-0":"border-lines bg-secondary-0 hover:bg-container-secondary"}`,o),onClick:()=>{a===1&&l?.(e)},children:i("div",{className:"flex size-full flex-col",children:[t("div",{className:"tablet:h-[24px] lg-desktop:h-[28px] flex h-[18px] justify-end",children:e.tag&&t("div",{className:"bg-brand-0 lg-desktop:text-[16px] laptop:rounded-bl-[8px] text-badge-foreground absolute rounded-bl-[6px] px-[6px] pb-[4px] pt-[3px] text-[14px] font-bold leading-[1.2]",style:{...d?{backgroundColor:d}:{},...n?{color:n}:{}},children:e.tag})}),i("div",{className:r("laptop:pb-4 laptop:px-4 flex size-full items-center gap-4 px-2 pb-2"),children:[t("div",{className:"flex size-5 shrink-0 items-center justify-center",children:t(f,{checked:!!e.selected,theme:c})}),t("div",{className:r("size-14 shrink-0","tablet:size-12"),children:t(h,{source:e.image,alt:e.name,className:"size-full rounded object-cover"})}),i("div",{className:"flex h-full min-w-0 flex-1 flex-col justify-center gap-1 py-1",children:[t(s,{size:2,html:e.name,className:r("text-info-primary desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1")}),i("div",{className:"mt-auto flex items-center justify-between gap-2",children:[i("div",{className:"flex items-center gap-2",children:[t(s,{size:2,className:r("text-info-primary desktop:text-[16px] lg-desktop:text-[18px]"),children:e.currentPrice}),e.originalPrice&&e.originalPrice!==e.currentPrice&&t(s,{size:2,className:r("text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] pr-6 line-through"),children:e.originalPrice})]}),e.quantity>=1&&i(s,{size:4,className:r("text-info-primary laptop:text-[16px] lg-desktop:text-[18px] self-end text-[14px]"),children:["x",e.quantity]})]})]})]})]})}));p.displayName="FreeGiftItem";var y=p;export{y as default};
1
+ "use client";import{jsx as t,jsxs as i}from"react/jsx-runtime";import*as f from"react";import{cn as r}from"../../helpers/index.js";import"../../components/badge.js";import h from"../../components/picture.js";import{Text as s}from"../../components/text.js";const u=({checked:e,theme:l})=>{const o=l==="dark";return e?i("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",fill:o?"#F5F6F7":"#080A0F"}),t("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",stroke:o?"#F5F6F7":"#080A0F",strokeWidth:"1.6"}),t("path",{d:"M8 11.5833L10.9474 14.5L16 9.5",stroke:o?"#1E2024":"white",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})]}):t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("rect",{x:"2.8",y:"2.8",width:"18.4",height:"18.4",rx:"9.2",stroke:o?"#B5B7BB":"#2A2C32",strokeWidth:"1.6"})})},c=f.forwardRef(({gift:e,onClick:l,className:o,giftType:a,theme:p,tagBgColor:n,tagTextColor:d},x)=>{const m=a===2||!!e.selected;return t("div",{ref:x,className:r("bg-container-primary laptop:rounded-[8px] border-lines relative flex w-full flex-col overflow-hidden rounded-[6px] border-2 transition-all","buy-one-get-one-shelf-free-gift-item",m?"buy-one-get-one-shelf-free-gift-item-selected":"buy-one-get-one-shelf-free-gift-item-unselected",a===2?"border-brand-0 bg-container-secondary-0 cursor-default":`cursor-pointer hover:shadow-sm ${e.selected?"border-brand-0 bg-container-secondary-0":"border-lines bg-secondary-0 hover:bg-container-secondary"}`,o),onClick:()=>{a===1&&l?.(e)},children:i("div",{className:"flex size-full flex-col",children:[t("div",{className:"tablet:h-[24px] lg-desktop:h-[28px] flex h-[18px] justify-end",children:e.tag&&t("div",{className:"bg-brand-0 lg-desktop:text-[16px] laptop:rounded-bl-[8px] text-badge-foreground absolute rounded-bl-[6px] px-[6px] pb-[4px] pt-[3px] text-[14px] font-bold leading-[1.2]",style:{...n?{backgroundColor:n}:{},...d?{color:d}:{}},children:e.tag})}),i("div",{className:r("laptop:pb-4 laptop:px-4 flex size-full items-center gap-4 px-2 pb-2"),children:[t("div",{className:"flex size-5 shrink-0 items-center justify-center",children:t(u,{checked:!!e.selected,theme:p})}),t("div",{className:r("size-14 shrink-0","tablet:size-12"),children:t(h,{source:e.image,alt:e.name,className:"size-full rounded object-cover"})}),i("div",{className:"flex h-full min-w-0 flex-1 flex-col justify-center gap-1 py-1",children:[t(s,{size:2,html:e.name,className:r("text-info-primary desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1")}),i("div",{className:"mt-auto flex items-center justify-between gap-2",children:[i("div",{className:"flex items-center gap-2",children:[t(s,{size:2,className:r("text-info-primary desktop:text-[16px] lg-desktop:text-[18px]"),children:e.currentPrice}),e.originalPrice&&e.originalPrice!==e.currentPrice&&t(s,{size:2,className:r("text-info-tertiary desktop:text-[16px] lg-desktop:text-[18px] pr-6 line-through"),children:e.originalPrice})]}),e.quantity>=1&&i(s,{size:4,className:r("text-info-primary laptop:text-[16px] lg-desktop:text-[18px] self-end text-[14px]"),children:["x",e.quantity]})]})]})]})]})})});c.displayName="FreeGiftItem";var w=c;export{w as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as o}from"react/jsx-runtime";import{Fragment as D,useEffect as w,useMemo as S,useState as y}from"react";import{Text as d,Container as z,Link as m}from"../../components/index.js";import A from"../Subscribe/index.js";import{FooterNavigationBlockType as v}from"./types.js";import{AddIcon as B,SubtractIcon as C,ArrowRightIcon as E,CountryIcon as T}from"./icons/index.js";import{useMediaQuery as M}from"react-responsive";import{cn as x,getLocalizedPath as u}from"../../helpers/utils.js";import{useAiuiContext as k}from"../AiuiProvider/index.js";import{withLayout as P}from"../../shared/Styles.js";const $=({data:{footer:a}={},currentCountry:p,event:n,subscribeLoading:f,classNames:i,className:s,moduleIds:l,...g})=>{const[c,r]=y(!1),b=M({query:"(max-width: 1439px)"});w(()=>{r(b)},[b]);const h=S(()=>a?.blocks?.find(t=>t?.blockType===v.Brand)?.country||{},[a]);return e("footer",{...g,className:x(i?.root,s),children:o(z,{className:x(i?.child),childClassName:x("laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8"),children:[e(d,{html:a?.story,className:"desktop:text-sm text-xs font-bold text-[#6D6D6F]"}),a?.blocks?.map(t=>{if(t?.blockType===v.Signup)return e(O,{subscribeLoading:f,data:t,onSubmit:n?.signup,id:l?.marketingConversion},t.id);if(t?.blockType===v.Brand)return e(Q,{data:t,isMobile:c,event:n,currentCountry:p,id:l?.footerBrand},t?.id);if(t?.blockType===v.Main)return e(j,{data:{...t,country:h},event:n,isMobile:c,currentCountry:p,id:l?.mainServices},t.id)})]})})},O=({data:a,onSubmit:p,subscribeLoading:n,id:f="footer-marketing-conversion"})=>{const{locale:i="us"}=k();return o("div",{id:f,className:"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8",children:[e(A,{subscribeMetadata:a?.signup,className:"desktop:flex-[744]",onSubmit:p,loading:n}),e("div",{className:"desktop:hidden h-px w-full bg-[#3D3E3F]"}),o("div",{className:"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4",children:[o("div",{className:"flex-1",children:[e(d,{html:a?.enjoy?.title,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex flex-col gap-2",children:a?.enjoy?.enjoys?.map(s=>o("div",{className:"flex-start flex gap-2",children:[e("img",{src:s?.icon?.url,loading:"lazy",alt:s?.icon?.alt||"",className:"size-5 shrink-0"}),e(d,{html:s?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})]},s?.id))})]}),e("div",{className:"desktop:block hidden w-px bg-[#3D3E3F]"}),o("div",{className:"flex-1",children:[e(d,{html:a?.benefit?.title,className:"text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex flex-col gap-2",children:a?.benefit?.benefits?.map(s=>e(m,{href:u(s?.link,i,"ref=footer"),asChild:!s?.link,className:"no-underline",children:e(d,{html:s?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},s?.id))})]})]})]})},j=({data:a,event:p,isMobile:n,currentCountry:f,id:i="footer-main-services"})=>{const{locale:s="us"}=k(),[l,g]=y(!1),{services:c,mainNav:r,country:b}=a,h="contact-section";return o("nav",{id:i,className:"flex flex-col gap-8","aria-label":"Main navigation",children:[o("div",{className:x({"desktop:gap-16 flex":c?.download?.title}),children:[o("div",{className:x("w-full",{"desktop:flex-[1260]":c?.download?.title}),children:[e(d,{html:c?.storeBenefits?.title,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:x("laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2",{"desktop:max-w-[648px]":c?.download?.title}),children:c?.storeBenefits?.reasons?.map(t=>o("div",{className:"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2",children:[e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt||"",className:"size-5 shrink-0"}),e(m,{href:u(t?.link,s,"ref=footer"),asChild:!t?.link,className:"no-underline",children:e(d,{html:t?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})})]},t?.id))})]}),e(F,{className:x({"desktop:flex-[404] hidden desktop:block":c?.download?.title}),title:c?.download?.title,apps:c?.download?.apps})]}),e("div",{className:"desktop:block hidden h-px bg-[#3D3E3F]","aria-hidden":"true"}),o("div",{className:"desktop:grid grid-cols-4 gap-4",children:[e(N,{title:r?.products?.title,lists:r?.products?.products}),e(N,{title:r?.explore?.title,lists:r?.explore?.explores}),e(N,{title:r?.support?.title,lists:r?.support?.supports}),o("div",{className:"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4",children:[o("div",{className:"desktop:pb-0 flex items-center justify-between pb-4",children:[e(d,{as:"p",html:r?.contact?.title,className:"text-xl font-bold leading-[1.2] text-white",id:h}),n&&e("button",{onClick:()=>g(!l),"aria-expanded":l,"aria-controls":h,"aria-label":l?"Collapse contact section":"Expand contact section",children:l?e(C,{width:20,height:20}):e(B,{width:20,height:20})})]}),(l&&n||!n)&&e("div",{className:"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2",role:"region","aria-labelledby":h,children:r?.contact?.contacts?.map(t=>o(m,{href:t?.link,className:"group flex items-start gap-2 no-underline",children:[e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt,className:"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),e(d,{html:t?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white"})]},t?.id))}),e(L,{country:f||b,className:"desktop:hidden border-b border-[#3D3E3F]",isMobile:n,onChangeCountry:p?.country}),e("div",{className:"desktop:hidden mt-8",children:e(F,{title:c?.download?.title,apps:c?.download?.apps})}),!!r?.socials?.length&&e("div",{className:"mt-8 flex items-center gap-2",role:"list","aria-label":"Social media links",children:r?.socials?.map(t=>e(m,{href:u(t?.link,s,"ref=footer"),className:"group",role:"listitem","aria-label":t?.icon?.alt||"Social media",children:e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt,className:"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"})},t?.id))}),e("div",{className:"mt-4 flex flex-wrap gap-2",role:"list","aria-label":"Payment methods",children:r?.payment?.map(t=>e(m,{href:u(t?.link,s,"ref=footer"),asChild:!t?.link,role:"listitem","aria-label":t?.icon?.alt||"Payment method",children:e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt||"",className:"h-[28px] w-[44px] shrink-0"})},t?.id))})]})]})]})},Q=({data:a,isMobile:p,event:n,currentCountry:f,id:i="footer-brand"})=>{const{locale:s="us"}=k();return o("div",{id:i,className:"flex flex-col gap-4",children:[o("div",{className:"desktop:items-center desktop:flex desktop:gap-4",children:[e("div",{className:"laptop:flex-row aiui-dark laptop:items-center desktop:flex-[980] flex flex-col items-start gap-3",children:o("div",{className:"flex flex-wrap items-center gap-3",children:[e(m,{variant:"secondary",href:u(a?.brand?.link,s,"ref=footer"),asChild:!a?.brand?.link,children:e(d,{html:a?.brand?.currentBrand,"aria-hidden":"true"})}),!!a?.brand?.brands?.length&&a?.brand?.brands?.map((l,g)=>o(D,{children:[g<=0&&e("span",{className:"bg-lines h-3 w-px","aria-hidden":"true"}),e(m,{variant:"secondary",href:u(l?.link,s,"ref=footer"),className:"text-base leading-normal no-underline",children:e(d,{html:l?.icon,"aria-hidden":"true"})},l?.id)]},g))]})}),e(L,{country:f||a?.country,className:"desktop:flex-[316] desktop:block hidden",isMobile:p,onChangeCountry:n?.country})]}),e("div",{className:"h-px bg-[#3D3E3F]"}),o("div",{className:"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1",children:[e(d,{html:a?.copyright?.label,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]"}),o("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[a?.policy?.policies?.map(l=>e(m,{href:u(l?.link,s,"ref=footer"),className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white",children:l?.label},l?.id)),a?.policy?.cookies&&e("button",{"data-cc":"show-preferencesModal",onClick:n?.cookiesSet,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Cookie preferences: ${a?.policy?.cookies}`,children:a?.policy?.cookies})]})]})]})},N=({title:a,lists:p,className:n})=>{const{locale:f="us"}=k(),[i,s]=y(!1),[l,g]=y(!1),c=M({query:"(max-width: 1439px)"});w(()=>{g(c)},[c]);const r=`nav-section-${a?.replace(/\s+/g,"-").toLowerCase()}`;return o("div",{className:x("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",n),children:[o("div",{className:"flex items-center justify-between",children:[e(d,{as:"p",html:a,className:"text-xl font-bold leading-[1.2] text-white",id:r}),l&&e("button",{onClick:()=>s(!i),"aria-expanded":i,"aria-controls":r,"aria-label":i?`Collapse ${a}`:`Expand ${a}`,className:"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black",children:i?e(C,{width:20,height:20}):e(B,{width:20,height:20})})]}),(i&&l||!l)&&e("nav",{className:"mt-4 flex flex-col gap-2",role:"region","aria-labelledby":r,children:p?.map(b=>e(m,{href:u(b?.link,f,"ref=footer"),className:"no-underline",children:e(d,{html:b?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},b?.id))})]})},F=({title:a,apps:p,className:n})=>{const{locale:f="us"}=k();return p?.length?o("div",{className:n,children:[e(d,{html:a,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex items-center gap-4",role:"list","aria-label":"Download apps",children:p?.map(i=>o(m,{href:u(i?.link,f,"ref=footer"),className:"group flex flex-col items-center gap-[6px]",role:"listitem","aria-label":i?.icon?.alt||i?.label||"Download app",children:[e("img",{src:i?.icon?.url,loading:"lazy",alt:i?.icon?.alt,className:"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),i?.label&&e(d,{html:i?.label,className:"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white"})]},i?.id))})]}):null},L=({country:a,isMobile:p,className:n,onChangeCountry:f})=>e("div",{className:x("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",n),children:o("button",{onClick:()=>f?.(),className:"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Change country/region, current: ${a?.countryName||a?.country}`,children:[o("div",{className:"group flex items-center gap-2",children:[e(T,{width:20,height:20,className:"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100","aria-hidden":"true"}),e(d,{as:"span",html:a?.countryName||a?.country,className:"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200"})]}),p&&e(E,{width:20,height:20,"aria-hidden":"true"})]})});var W=P($);export{W as default};
1
+ import{Fragment as H,jsx as e,jsxs as a}from"react/jsx-runtime";import{Fragment as A,useEffect as C,useMemo as T,useState as N}from"react";import{Text as d,Container as P,Link as u}from"../../components/index.js";import $ from"../Subscribe/index.js";import{FooterNavigationBlockType as w}from"./types.js";import{AddIcon as M,SubtractIcon as F,ArrowRightIcon as O,CountryIcon as j}from"./icons/index.js";import{useMediaQuery as D}from"react-responsive";import{cn as g,getLocalizedPath as h}from"../../helpers/utils.js";import{useAiuiContext as v}from"../AiuiProvider/index.js";import{withLayout as Q}from"../../shared/Styles.js";const L=t=>!!(t?.countryName||t?.country),q=({data:{footer:t}={},currentCountry:p,event:n,subscribeLoading:f,classNames:i,className:s,moduleIds:l,...b})=>{const[c,r]=N(!1),x=D({query:"(max-width: 1439px)"});C(()=>{r(x)},[x]);const y=T(()=>t?.blocks?.find(m=>m?.blockType===w.Brand)?.country,[t]);return e("footer",{...b,className:g(i?.root,s),children:a(P,{className:g(i?.child),childClassName:g("laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8"),children:[e(d,{html:t?.story,className:"desktop:text-sm text-xs font-bold text-[#6D6D6F]"}),t?.blocks?.map(m=>{if(m?.blockType===w.Signup)return e(R,{subscribeLoading:f,data:m,onSubmit:n?.signup,id:l?.marketingConversion},m.id);if(m?.blockType===w.Brand)return e(G,{data:m,isMobile:c,event:n,currentCountry:p,id:l?.footerBrand},m?.id);if(m?.blockType===w.Main)return e(_,{data:{...m,country:y},event:n,isMobile:c,currentCountry:p,id:l?.mainServices},m.id)})]})})},R=({data:t,onSubmit:p,subscribeLoading:n,id:f="footer-marketing-conversion"})=>{const{locale:i="us"}=v();return a("div",{id:f,className:"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8",children:[e($,{subscribeMetadata:t?.signup,className:"desktop:flex-[744]",onSubmit:p,loading:n}),e("div",{className:"desktop:hidden h-px w-full bg-[#3D3E3F]"}),a("div",{className:"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4",children:[a("div",{className:"flex-1",children:[e(d,{html:t?.enjoy?.title,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex flex-col gap-2",children:t?.enjoy?.enjoys?.map(s=>a("div",{className:"flex-start flex gap-2",children:[e("img",{src:s?.icon?.url,loading:"lazy",alt:s?.icon?.alt||"",className:"size-5 shrink-0"}),e(d,{html:s?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})]},s?.id))})]}),e("div",{className:"desktop:block hidden w-px bg-[#3D3E3F]"}),a("div",{className:"flex-1",children:[e(d,{html:t?.benefit?.title,className:"text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex flex-col gap-2",children:t?.benefit?.benefits?.map(s=>e(u,{href:h(s?.link,i,"ref=footer"),asChild:!s?.link,className:"no-underline",children:e(d,{html:s?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},s?.id))})]})]})]})},_=({data:t,event:p,isMobile:n,currentCountry:f,id:i="footer-main-services"})=>{const{locale:s="us"}=v(),[l,b]=N(!1),{services:c,mainNav:r,country:x}=t,y="contact-section",m=!!c?.storeBenefits?.title&&!!c?.storeBenefits?.reasons?.length,k=!!c?.download?.title&&!!c?.download?.apps?.length,z=L(f||x);return a("nav",{id:i,className:"flex flex-col gap-8","aria-label":"Main navigation",children:[(m||k)&&a(H,{children:[a("div",{className:g({"desktop:gap-16 flex":k}),children:[m&&a("div",{className:g("w-full",{"desktop:flex-[1260]":k}),children:[e(d,{html:c?.storeBenefits?.title,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:g("laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2",{"desktop:max-w-[648px]":k}),children:c?.storeBenefits?.reasons?.map(o=>a("div",{className:"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2",children:[e("img",{src:o?.icon?.url,loading:"lazy",alt:o?.icon?.alt||"",className:"size-5 shrink-0"}),e(u,{href:h(o?.link,s,"ref=footer"),asChild:!o?.link,className:"no-underline",children:e(d,{html:o?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})})]},o?.id))})]}),e(S,{className:g({"desktop:flex-[404] hidden desktop:block":k}),title:c?.download?.title,apps:c?.download?.apps})]}),e("div",{className:"desktop:block hidden h-px bg-[#3D3E3F]","aria-hidden":"true"})]}),a("div",{className:"desktop:grid grid-cols-4 gap-4",children:[e(B,{title:r?.products?.title,lists:r?.products?.products}),e(B,{title:r?.explore?.title,lists:r?.explore?.explores}),e(B,{title:r?.support?.title,lists:r?.support?.supports}),a("div",{className:"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4",children:[a("div",{className:"desktop:pb-0 flex items-center justify-between pb-4",children:[e(d,{as:"p",html:r?.contact?.title,className:"text-xl font-bold leading-[1.2] text-white",id:y}),n&&e("button",{onClick:()=>b(!l),"aria-expanded":l,"aria-controls":y,"aria-label":l?"Collapse contact section":"Expand contact section",children:l?e(F,{width:20,height:20}):e(M,{width:20,height:20})})]}),(l&&n||!n)&&e("div",{className:"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2",role:"region","aria-labelledby":y,children:r?.contact?.contacts?.map(o=>a(u,{href:o?.link,className:"group flex items-start gap-2 no-underline",children:[e("img",{src:o?.icon?.url,loading:"lazy",alt:o?.icon?.alt,className:"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),e(d,{html:o?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white"})]},o?.id))}),z?e(E,{country:f||x,className:"desktop:hidden border-b border-[#3D3E3F]",isMobile:n,onChangeCountry:p?.country}):e("div",{className:"desktop:hidden border-b border-[#3D3E3F]","aria-hidden":"true"}),k&&e("div",{className:"desktop:hidden mt-8",children:e(S,{title:c?.download?.title,apps:c?.download?.apps})}),!!r?.socials?.length&&e("div",{className:"mt-8 flex items-center gap-2",role:"list","aria-label":"Social media links",children:r?.socials?.map(o=>e(u,{href:h(o?.link,s,"ref=footer"),className:"group",role:"listitem","aria-label":o?.icon?.alt||"Social media",children:e("img",{src:o?.icon?.url,loading:"lazy",alt:o?.icon?.alt,className:"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"})},o?.id))}),!!r?.payment?.length&&e("div",{className:"mt-4 flex flex-wrap gap-2",role:"list","aria-label":"Payment methods",children:r?.payment?.map(o=>e(u,{href:h(o?.link,s,"ref=footer"),asChild:!o?.link,role:"listitem","aria-label":o?.icon?.alt||"Payment method",children:e("img",{src:o?.icon?.url,loading:"lazy",alt:o?.icon?.alt||"",className:"h-[28px] w-[44px] shrink-0"})},o?.id))})]})]})]})},G=({data:t,isMobile:p,event:n,currentCountry:f,id:i="footer-brand"})=>{const{locale:s="us"}=v();return a("div",{id:i,className:"flex flex-col gap-4",children:[a("div",{className:"desktop:items-center desktop:flex desktop:gap-4",children:[e("div",{className:"laptop:flex-row aiui-dark laptop:items-center desktop:flex-[980] flex flex-col items-start gap-3",children:a("div",{className:"flex flex-wrap items-center gap-3",children:[e(u,{variant:"secondary",href:h(t?.brand?.link,s,"ref=footer"),asChild:!t?.brand?.link,children:e(d,{html:t?.brand?.currentBrand,"aria-hidden":"true"})}),!!t?.brand?.brands?.length&&t?.brand?.brands?.map((l,b)=>a(A,{children:[b<=0&&e("span",{className:"bg-lines h-3 w-px","aria-hidden":"true"}),e(u,{variant:"secondary",href:h(l?.link,s,"ref=footer"),className:"text-base leading-normal no-underline",children:e(d,{html:l?.icon,"aria-hidden":"true"})},l?.id)]},b))]})}),e(E,{country:f||t?.country,className:"desktop:flex-[316] desktop:block hidden",isMobile:p,onChangeCountry:n?.country})]}),e("div",{className:"h-px bg-[#3D3E3F]"}),a("div",{className:"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1",children:[e(d,{html:t?.copyright?.label,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]"}),a("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[t?.policy?.policies?.map(l=>e(u,{href:h(l?.link,s,"ref=footer"),className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white",children:l?.label},l?.id)),t?.policy?.cookies&&e("button",{"data-cc":"show-preferencesModal",onClick:n?.cookiesSet,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Cookie preferences: ${t?.policy?.cookies}`,children:t?.policy?.cookies})]})]})]})},B=({title:t,lists:p,className:n})=>{const{locale:f="us"}=v(),[i,s]=N(!1),[l,b]=N(!1),c=D({query:"(max-width: 1439px)"});if(C(()=>{b(c)},[c]),!t)return null;const r=`nav-section-${t.replace(/\s+/g,"-").toLowerCase()}`;return a("div",{className:g("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",n),children:[a("div",{className:"flex items-center justify-between",children:[e(d,{as:"p",html:t,className:"text-xl font-bold leading-[1.2] text-white",id:r}),l&&e("button",{onClick:()=>s(!i),"aria-expanded":i,"aria-controls":r,"aria-label":i?`Collapse ${t}`:`Expand ${t}`,className:"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black",children:i?e(F,{width:20,height:20}):e(M,{width:20,height:20})})]}),(i&&l||!l)&&e("nav",{className:"mt-4 flex flex-col gap-2",role:"region","aria-labelledby":r,children:p?.map(x=>e(u,{href:h(x?.link,f,"ref=footer"),className:"no-underline",children:e(d,{html:x?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},x?.id))})]})},S=({title:t,apps:p,className:n})=>{const{locale:f="us"}=v();return!t||!p?.length?null:a("div",{className:n,children:[e(d,{html:t,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex items-center gap-4",role:"list","aria-label":"Download apps",children:p?.map(i=>a(u,{href:h(i?.link,f,"ref=footer"),className:"group flex flex-col items-center gap-[6px]",role:"listitem","aria-label":i?.icon?.alt||i?.label||"Download app",children:[e("img",{src:i?.icon?.url,loading:"lazy",alt:i?.icon?.alt,className:"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),i?.label&&e(d,{html:i?.label,className:"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white"})]},i?.id))})]})},E=({country:t,isMobile:p,className:n,onChangeCountry:f})=>L(t)?e("div",{className:g("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",n),children:a("button",{onClick:()=>f?.(),className:"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Change country/region, current: ${t?.countryName||t?.country}`,children:[a("div",{className:"group flex items-center gap-2",children:[e(j,{width:20,height:20,className:"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100","aria-hidden":"true"}),e(d,{as:"span",html:t?.countryName||t?.country,className:"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200"})]}),p&&e(O,{width:20,height:20,"aria-hidden":"true"})]})}):null;var ee=Q(q);export{ee as default};
@@ -1 +1 @@
1
- "use client";import{Fragment as ne,jsx as t,jsxs as r}from"react/jsx-runtime";import{useMediaQuery as q}from"react-responsive";import Q,{useImperativeHandle as X,useRef as $,useState as p}from"react";import{createPortal as Z}from"react-dom";import{cn as m,getLocalizedPath as k}from"../../helpers/utils.js";import{withLayout as F}from"../../shared/Styles.js";import J from"../SwiperBox/index.js";import{Button as K,Heading as O,Picture as T,Text as S,Tabs as W,TabsList as ee,TabsTrigger as te,TabsContent as oe}from"../../components/index.js";import V from"../Title/index.js";import{VideoModal as se}from"../VideoModal/index.js";import{TextModal as le}from"../TextModal/index.js";import{useExposure as G}from"../../hooks/useExposure.js";import{trackUrlRef as y}from"../../shared/trackUrlRef.js";import{useAiuiContext as ie}from"../AiuiProvider/index.js";import"swiper/css";const u="image",h="graphic",P=e=>{let o="";const s=d=>(d?.url&&(o=d.url),o),n=s(e.lgDesktop),a=s(e.desktop),i=s(e.laptop),g=s(e.tablet),b=e.default?.url;return[`${n} 9999`,`${a} 1919`,`${i} 1439`,`${g} 1024`,`${b} 768`].join(", ")},B="descTitle lg-desktop:text-[32px] desktop:mt-2 desktop:text-[24px] text-lines-2 mt-1 line-clamp-3 flex-1 text-[24px] font-bold leading-[1.2]",re=({data:e,configuration:o})=>{const s=$(null),[n,a]=p({visible:!1,x:0,y:0,text:""}),i=o?.descriptionTag||"h3",g=()=>{switch(o.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]"}},b=l=>{e?.description&&a({visible:!0,x:l.clientX,y:l.clientY,text:e.description})},d=()=>{a(l=>({...l,visible:!1}))};G(s,{componentType:u,componentName:h,componentTitle:e?.title,componentDescription:e?.description,position:o?.index+1});const x=e?.href?"a":"div",w=e?.href?{href:y(k(e.href,o?.locale||"us"),`${u}_${h}`)}:{};return t("div",{ref:s,className:m(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:t("div",{className:m("rounded-box absolute inset-0 overflow-hidden"),children:r("div",{className:`graphic-children relative block size-full overflow-hidden ${e?.href?"cursor-pointer":""}`,children:[e?.href?r("a",{"aria-label":e?.title||e?.description,href:y(k(e?.href||"",o?.locale||"us"),`${u}_${h}`),className:"rounded-card block size-full overflow-hidden","data-headless-nav-postion":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:[t(T,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?P(e.backgroundImage):e?.imgUrl?.url,alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""}),t("span",{className:"sr-only",children:e?.title||e?.description})]}):t("div",{className:"rounded-card block size-full overflow-hidden",children:t(T,{className:"h-full",imgClassName:"h-full object-cover tablet:hover:scale-110 transition-all duration-300",source:e?.backgroundImage?.default?P(e.backgroundImage):e?.imgUrl?.url||"",alt:e?.backgroundImage?.lgDesktop?.alt||e?.backgroundImage?.default?.alt||e?.imgUrl?.alt||""})}),r(x,{...w,className:m("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:[r("div",{className:m("flex items-end gap-1 overflow-hidden","graphic-bottom"),children:[r("div",{className:"flex-1 overflow-hidden",children:[t(S,{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&&r("div",{onMouseMove:b,onMouseLeave:d,children:[e?.title?t(O,{html:e?.description,style:{color:e?.textColor},as:i,className:`${B} graphic-description`}):t(i,{style:{color:e?.textColor},dangerouslySetInnerHTML:{__html:e?.description||""},className:`${B} graphic-description-item`}),typeof window<"u"&&n.visible&&Z(t(S,{as:"div",html:n.text,className:"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200",style:{left:`${n.x+16}px`,top:`${n.y+16}px`}}),document.body)]})]}),!e?.isShowIcon&&(e?.video?.url||e?.youtubeId)&&t("button",{"aria-label":"Play Video",onClick:l=>{l.preventDefault(),l.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:t("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})}),e?.isShowIcon&&e?.icon?.url&&t("button",{onClick:l=>{l.preventDefault(),l.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:t(T,{className:"h-full",imgClassName:"h-full object-cover",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),e.buttonText&&t(K,{as:"a","aria-label":e?.title||e?.description,variant:"secondary",className:"bgButton mt-[8px] self-start",href:y(k(e?.href||"",o?.locale||"us"),`${u}_${h}`),"data-headless-nav-position":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}#${e?.buttonText}`,children:e.buttonText})]})]})})})},L=({items:e=[],sharedConfig:o})=>{const s=n=>{const a=e.length>3,i=e.length>2;switch(n){case 1440:return a?4:e.length;case 1024:return a?3:e.length;case 768:return e.length===1?1:a||i?2.3:2;default:return e.length===1?1:1.2}};return t(J,{id:"Graphic",className:m("!overflow-visible"),data:{list:e,configuration:{...o,num:e.length}},Slide:re,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:s()},768:{spaceBetween:16,freeMode:!1,slidesPerView:s(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:s(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:s(1440)}}})},D=Q.forwardRef(({data:e,className:o,...s},n)=>{const a=q({query:"(max-width: 768px)"}),i=$(null),[g,b]=p(!1),[d,x]=p(""),[w,l]=p(""),[A,U]=p(""),[z,I]=p(null),[H,C]=p(!1),{locale:R="us"}=ie(),E=e?.isShowTab??!1,f=e?.tabs,j=e?.tabAlign??"left",[_,Y]=p(f?.[0]?.id??"");X(n,()=>i.current),G(i,{componentType:u,componentName:h,componentTitle:e?.title});const M={itemShape:e?.itemShape,descriptionTag:e?.descriptionTag,locale:R,onVideoPlayBtnClick:(c,v)=>{b(!0),v?.isYouTube?l?.(v?.youtubeId||""):(x?.(v?.video?.url||""),U?.(v?.mobileVideo?.url||""))},onIconClick:c=>{C(!0),I(c)}},N=()=>r(ne,{children:[t(se,{visible:g,youTubeId:w,onCloseModal:()=>b(!1),videoUrl:a&&A||d}),t(le,{textVisible:H,extension:z?.extension,onCloseModal:()=>{C(!1),I(null)}})]});return!E||!f||f.length===0?r("div",{...s,ref:i,className:m("graphicBlock",o),children:[r("div",{className:"graphic-box",children:[e?.title&&t(V,{data:{title:e.title,align:e?.titleAlign??"left"}}),t(L,{items:e?.items,sharedConfig:M})]}),N()]}):r("div",{...s,ref:i,className:m("graphicBlock",o),children:[e?.title&&t(V,{data:{title:e.title,align:e?.titleAlign??"left"}}),r(W,{value:_,onValueChange:Y,align:j,children:[t("div",{className:"mb-[24px]",children:t(ee,{children:f.map(c=>t(te,{value:c.id,children:c.label},c.id))})}),f.map(c=>t(oe,{value:c.id,children:t(L,{items:c.items,sharedConfig:M})},c.id))]}),N()]})});D.displayName="Graphic";var Te=F(D);export{Te as default};
1
+ "use client";import{Fragment as ne,jsx as t,jsxs as r}from"react/jsx-runtime";import{useMediaQuery as q}from"react-responsive";import Q,{useImperativeHandle as X,useRef as S,useState as p}from"react";import{createPortal as Z}from"react-dom";import{cn as m,getLocalizedPath as k}from"../../helpers/utils.js";import{withLayout as F}from"../../shared/Styles.js";import J from"../SwiperBox/index.js";import{Button as K,Heading as O,Picture as T,Text as V,Tabs as W,TabsList as ee,TabsTrigger as te,TabsContent as oe}from"../../components/index.js";import G from"../Title/index.js";import{VideoModal as se}from"../VideoModal/index.js";import{TextModal as le}from"../TextModal/index.js";import{useExposure as P}from"../../hooks/useExposure.js";import{trackUrlRef as y}from"../../shared/trackUrlRef.js";import{useAiuiContext as ie}from"../AiuiProvider/index.js";import"swiper/css";const u="image",h="graphic",B=e=>{let o="";const s=d=>(d?.url&&(o=d.url),o),n=s(e.lgDesktop),a=s(e.desktop),i=s(e.laptop),g=s(e.tablet),b=e.default?.url;return[`${n} 9999`,`${a} 1919`,`${i} 1439`,`${g} 1024`,`${b} 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]",re=({data:e,configuration:o})=>{const s=S(null),[n,a]=p({visible:!1,x:0,y:0,text:""}),i=o?.descriptionTag||"h3",g=()=>{switch(o.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[360] laptop:aspect-w-[440] laptop:aspect-h-[360] desktop:aspect-w-[648] desktop:aspect-h-[384] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[427] desktop:aspect-h-[384] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[480]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[360] laptop:aspect-w-[288] laptop:aspect-h-[360] desktop:aspect-w-[316] desktop:aspect-h-[384] lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480]"}},b=l=>{e?.description&&a({visible:!0,x:l.clientX,y:l.clientY,text:e.description})},d=()=>{a(l=>({...l,visible:!1}))};P(s,{componentType:u,componentName:h,componentTitle:e?.title,componentDescription:e?.description,position:o?.index+1});const v=e?.href?"a":"div",x=e?.href?{href:y(k(e.href,o?.locale||"us"),`${u}_${h}`)}:{};return t("div",{ref:s,className:m(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:t("div",{className:m("rounded-box absolute inset-0 overflow-hidden"),children:r("div",{className:`graphic-children relative block size-full overflow-hidden ${e?.href?"cursor-pointer":""}`,children:[e?.href?r("a",{"aria-label":e?.title||e?.description,href:y(k(e?.href||"",o?.locale||"us"),`${u}_${h}`),className:"rounded-card block size-full overflow-hidden","data-headless-nav-postion":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}`,children:[t(T,{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||""}),t("span",{className:"sr-only",children:e?.title||e?.description})]}):t("div",{className:"rounded-card block size-full overflow-hidden",children:t(T,{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||""})}),r(v,{...x,className:m("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:[r("div",{className:m("flex items-end gap-1 overflow-hidden","graphic-bottom"),children:[r("div",{className:"flex-1 overflow-hidden",children:[t(V,{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&&r("div",{onMouseMove:b,onMouseLeave:d,children:[e?.title?t(O,{html:e?.description,style:{color:e?.textColor},as:i,className:`${L} graphic-description`}):t(i,{style:{color:e?.textColor},dangerouslySetInnerHTML:{__html:e?.description||""},className:`${L} graphic-description-item`}),typeof window<"u"&&n.visible&&Z(t(V,{as:"div",html:n.text,className:"pointer-events-none fixed z-[9999] max-w-xs rounded-lg bg-black/60 px-3 py-2 text-sm text-white shadow-lg backdrop-blur-sm transition-opacity duration-200",style:{left:`${n.x+16}px`,top:`${n.y+16}px`}}),document.body)]})]}),!e?.isShowIcon&&(e?.video?.url||e?.youtubeId)&&t("button",{"aria-label":"Play Video",onClick:l=>{l.preventDefault(),l.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:t("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})}),e?.isShowIcon&&e?.icon?.url&&t("button",{onClick:l=>{l.preventDefault(),l.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:t(T,{className:"h-full",imgClassName:"h-full object-cover",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),e.buttonText&&t(K,{as:"a","aria-label":e?.title||e?.description,variant:"secondary",className:"bgButton mt-[8px] self-start",href:y(k(e?.href||"",o?.locale||"us"),`${u}_${h}`),"data-headless-nav-position":`''#${o?.index+1}`,"data-headless-type-name":`${u}#${h}`,"data-headless-title-desc-button":`${e?.title}#${e?.description}#${e?.buttonText}`,children:e.buttonText})]})]})})})},D=({items:e=[],sharedConfig:o})=>{const s=n=>{const a=e.length>3,i=e.length>2;switch(n){case 1440:return a?4:e.length;case 1024:return a?3:e.length;case 768:return e.length===1?1:a||i?2.3:2;default:return e.length===1?1:1.2}};return t(J,{id:"Graphic",className:m("!overflow-visible"),data:{list:e,configuration:{...o,num:e.length}},Slide:re,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=Q.forwardRef(({data:e,className:o,...s},n)=>{const a=q({query:"(max-width: 768px)"}),i=S(null),[g,b]=p(!1),[d,v]=p(""),[x,l]=p(""),[U,I]=p(""),[z,C]=p(null),[H,M]=p(!1),{locale:R="us"}=ie(),E=e?.isShowTab??!1,f=e?.tabs,j=e?.tabAlign??"left",[_,Y]=p(f?.[0]?.id??"");X(n,()=>i.current),P(i,{componentType:u,componentName:h,componentTitle:e?.title});const N={itemShape:e?.itemShape,descriptionTag:e?.descriptionTag,locale:R,onVideoPlayBtnClick:(c,w)=>{b(!0),w?.isYouTube?(l(w?.youtubeId||""),v(""),I("")):(l(""),v(w?.video?.url||""),I(w?.mobileVideo?.url||""))},onIconClick:c=>{M(!0),C(c)}},$=()=>r(ne,{children:[t(se,{visible:g,youTubeId:x,onCloseModal:()=>b(!1),videoUrl:x?"":a&&U||d}),t(le,{textVisible:H,extension:z?.extension,onCloseModal:()=>{M(!1),C(null)}})]});return!E||!f||f.length===0?r("div",{...s,ref:i,className:m("graphicBlock",o),children:[r("div",{className:"graphic-box",children:[e?.title&&t(G,{data:{title:e.title,align:e?.titleAlign??"left"}}),t(D,{items:e?.items,sharedConfig:N})]}),$()]}):r("div",{...s,ref:i,className:m("graphicBlock",o),children:[e?.title&&t(G,{data:{title:e.title,align:e?.titleAlign??"left"}}),r(W,{value:_,onValueChange:Y,align:j,children:[t("div",{className:"mb-[24px]",children:t(ee,{children:f.map(c=>t(te,{value:c.id,children:c.label},c.id))})}),f.map(c=>t(oe,{value:c.id,children:t(D,{items:c.items,sharedConfig:N})},c.id))]}),$()]})});A.displayName="Graphic";var Te=F(A);export{Te as default};
@@ -1 +1 @@
1
- import{jsx as t,jsxs as a}from"react/jsx-runtime";import{Grid as c,GridItem as p}from"../../../../components/index.js";const e=({BoxLeftGallery:o,BoxRightDetail:d,BoxBottomSummary:l})=>a("div",{id:"ipc-product-card",className:"laptop-md:pt-6 laptop-md:px-16 lg-desktop:px-[calc(50%-832px)]",children:[a(c,{className:"ipc-box-grid laptop-md:gap-x-4 lg-desktop:gap-6 gap-8 laptop:gap-y-8 laptop-md:gap-y-8",children:[t(p,{className:"ipc-box-left-grid-item laptop:px-0 laptop-md:col-start-1 laptop-md:col-span-8 laptop-md:sticky laptop-md:top-[124px] col-span-12 h-fit",children:o}),t(p,{className:"ipc-box-right-grid-item laptop-md:col-start-9 laptop-md:col-span-4 col-span-12",children:d})]}),l]});var m=e;export{m as default};
1
+ "use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import{useRef as o}from"react";import{Grid as m,GridItem as a}from"../../../../components/index.js";import{useStickyFlip as r}from"../../hooks/useStickyFlip.js";const s=({BoxLeftGallery:d,BoxRightDetail:i,BoxBottomSummary:c})=>{const t=o(null),p=o(null);return r(t,p),l("div",{id:"ipc-product-card",className:"laptop-md:pt-6 laptop-md:px-16 lg-desktop:px-[calc(50%-832px)]",children:[l(m,{className:"ipc-box-grid laptop-md:gap-x-4 lg-desktop:gap-6 gap-8 laptop:gap-y-8 laptop-md:gap-y-8",children:[e(a,{ref:t,className:"ipc-box-left-grid-item laptop:px-0 laptop-md:col-start-1 laptop-md:col-span-8 laptop-md:sticky laptop-md:top-[124px] col-span-12 h-fit",children:d}),e(a,{ref:p,className:"ipc-box-right-grid-item laptop-md:col-start-9 laptop-md:col-span-4 col-span-12",children:i})]}),c]})};var n=s;export{n as default};
@@ -1 +1 @@
1
- import{jsx as o,jsxs as u}from"react/jsx-runtime";import{Text as n,Container as L}from"../../../../../components/index.js";import{useAiuiContext as E}from"../../../../AiuiProvider/index.js";import{useBizProductContext as O}from"../../../BizProductProvider.js";import{useMemo as v}from"react";import{formatPrice as d}from"../../../utils/index.js";import{replaceTemplate as N}from"../../../utils/textFormat.js";import{useBenefits as _}from"../../../hooks/useBenefits.js";import j from"../../CartActionButtons/index.js";const q=({totalSavingsSlot:h,renderComparePrice:p}={})=>{const{copyWriting:e,locale:a="us",trackingData:w,currencyCode:r}=E(),{variant:t,finalPrice:S,totalSavings:l,isLogin:m,comparePrice:x,onAddToCart:P,onBuyNow:T,savingDetail:s,addToCartLoading:k,buyNowLoading:A,notifyMeMode:M,onNotifyMeClick:D,discount:z,memberFunctionResult:b}=O(),B=_({variant:t}),{commonCoupon:i,memberDiscount:c}=B,F=w?.showComparePrice??!0,R=v(()=>N(e?.totalSavings||"",{amount:d({amount:l,currencyCode:t.price.currencyCode,locale:r==="CAD"?"us":a||"us"})}),[e?.totalSavings,l,t.price.currencyCode,a]),f=v(()=>{if(!e?.unlockedSaving)return;const g=i?.enable?Number(i?.config?.fixed_value||0):0,C=c?.enable?c.config?.amount??0:0,y=Math.round((b?.withoutCouponMaxMemberTotalSave?Math.max(C,g):C+g)*100)/100;if(!(y<=0))return N(e.unlockedSaving,{amount:d({amount:y,currencyCode:t.price.currencyCode,locale:r==="CAD"?"us":a||"us"})})},[e?.unlockedSaving,i?.enable,i?.config?.fixed_value,c?.enable,c?.config?.amount,b,t.price.currencyCode,a]);return u(L,{childClassName:"tablet:flex tablet:justify-end tablet:gap-8 laptop-md:px-0 desktop:px-0 tablet:items-center tablet:gap-4",className:"laptop-md:border-none laptop-md:py-0 border-t border-[#E4E5E6] bg-white py-3",children:[t.availableForSale?u("div",{className:"laptop-md:items-end flex flex-col justify-between",children:[u("div",{className:"flex items-center gap-1",children:[o(n,{className:"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2]",html:d({amount:parseFloat(S.toFixed(2)),currencyCode:t.price.currencyCode,locale:r==="CAD"?"us":a||"us"})}),p?p({comparePrice:x}):F&&(l>0||s?.member>0&&m)&&o(n,{className:"tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2] text-[#4A4C56] line-through",html:d({amount:x,currencyCode:t.price.currencyCode,locale:r==="CAD"?"us":a||"us"})}),s?.member>0&&m&&o(n,{className:"bg-brand-0 rounded px-1 py-[2px] text-sm font-bold text-white",html:e?.memberPrice||"Member Price"})]}),h||(l>0||s?.member>0&&m?o(n,{className:"text-brand-0 tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:`${R}`}):f?o(n,{className:"text-info-quaternary tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:f}):null)]}):o(n,{className:"text-[20px] font-bold text-[#999999]",html:e?.soldOut??"Sold Out"}),o("div",{className:"tablet:mt-0 mt-2 flex items-center gap-2",children:o(j,{mode:M,availableForSale:t.availableForSale,addToCartText:e?.addToCart??"Add to Cart",buyNowText:e?.buyNow??"Buy Now",addToCartLoading:k,buyNowLoading:A,onAddToCart:P,onBuyNow:T,onNotifyMeClick:D,notifyMeText:e?.notifyMe,notifyMeClassName:"w-full"})})]})};var Q=q;export{Q as default};
1
+ import{jsx as o,jsxs as m}from"react/jsx-runtime";import{Text as r,Container as L}from"../../../../../components/index.js";import{useAiuiContext as E}from"../../../../AiuiProvider/index.js";import{useBizProductContext as O}from"../../../BizProductProvider.js";import{useMemo as v}from"react";import{formatPrice as d}from"../../../utils/index.js";import{replaceTemplate as h}from"../../../utils/textFormat.js";import{useBenefits as _}from"../../../hooks/useBenefits.js";import j from"../../CartActionButtons/index.js";const q=({totalSavingsSlot:N,renderComparePrice:u}={})=>{const{copyWriting:e,locale:a="us",trackingData:w,currencyCode:n}=E(),{variant:t,finalPrice:S,totalSavings:l,isLogin:s,comparePrice:x,onAddToCart:P,onBuyNow:k,savingDetail:p,addToCartLoading:T,buyNowLoading:A,notifyMeMode:M,onNotifyMeClick:D,discount:z,memberFunctionResult:b}=O(),B=_({variant:t}),{commonCoupon:c,memberDiscount:i}=B,F=w?.showComparePrice??!0,R=v(()=>h(e?.totalSavings||"",{amount:d({amount:l,currencyCode:t.price.currencyCode,locale:n==="CAD"?"us":a||"us"})}),[e?.totalSavings,l,t.price.currencyCode,a]),f=v(()=>{if(!e?.unlockedSaving)return;const g=c?.enable?Number(c?.config?.fixed_value||0):0,C=i?.enable?i.config?.amount??0:0,y=Math.round((b?.withoutCouponMaxMemberTotalSave?Math.max(C,g):C+g)*100)/100;if(!(y<=0))return h(e.unlockedSaving,{amount:d({amount:y,currencyCode:t.price.currencyCode,locale:n==="CAD"?"us":a||"us"})})},[e?.unlockedSaving,c?.enable,c?.config?.fixed_value,i?.enable,i?.config?.amount,b,t.price.currencyCode,a]);return m(L,{childClassName:"tablet:flex tablet:justify-end tablet:gap-8 laptop-md:px-0 desktop:px-0 tablet:items-center tablet:gap-4",className:"laptop-md:border-none laptop-md:py-0 border-t border-[#E4E5E6] bg-white py-3",children:[t.availableForSale?m("div",{className:"ipc-purchase-bar-price laptop-md:items-end flex flex-col justify-between",children:[m("div",{className:"ipc-purchase-bar-price-row flex items-center gap-1",children:[o(r,{className:"ipc-purchase-bar-final-price tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2]",html:d({amount:parseFloat(S.toFixed(2)),currencyCode:t.price.currencyCode,locale:n==="CAD"?"us":a||"us"})}),u?u({comparePrice:x}):F&&(l>0||p?.member>0&&s)&&o(r,{className:"ipc-purchase-bar-compare-price tablet:text-2xl laptop-md:text-xl lg-desktop:text-2xl text-xl font-bold !leading-[1.2] text-[#4A4C56] line-through",html:d({amount:x,currencyCode:t.price.currencyCode,locale:n==="CAD"?"us":a||"us"})}),p?.member>0&&s&&o(r,{className:"ipc-purchase-bar-member-badge bg-brand-0 rounded px-1 py-[2px] text-sm font-bold text-white",html:e?.memberPrice||"Member Price"})]}),N||(l>0||p?.member>0&&s?o(r,{className:"ipc-purchase-bar-total-savings text-brand-0 tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:`${R}`}):f?o(r,{className:"ipc-purchase-bar-unlocked-saving text-info-quaternary tablet:text-end laptop-md:text-xl lg-desktop:text-2xl whitespace-nowrap text-[18px] font-bold !leading-[1.2]",html:f}):null)]}):o(r,{className:"text-[20px] font-bold text-[#999999]",html:e?.soldOut??"Sold Out"}),o("div",{className:"tablet:mt-0 mt-2 flex items-center gap-2",children:o(j,{mode:M,availableForSale:t.availableForSale,addToCartText:e?.addToCart??"Add to Cart",buyNowText:e?.buyNow??"Buy Now",addToCartLoading:T,buyNowLoading:A,onAddToCart:P,onBuyNow:k,onNotifyMeClick:D,notifyMeText:e?.notifyMe,notifyMeClassName:"w-full"})})]})};var Q=q;export{Q as default};
@@ -0,0 +1,20 @@
1
+ import { type RefObject } from 'react';
2
+ export declare const FLIP_DURATION = 250;
3
+ export declare const FLIP_EASING = "cubic-bezier(0.2, 0, 0, 1)";
4
+ export declare const FLIP_DESKTOP_QUERY = "(min-width: 1280px)";
5
+ export declare function parseTranslateY(transform: string | null | undefined): number;
6
+ /** 旧视觉位置与新布局位置的差值,小于 MIN_DELTA 视为没有位移 */
7
+ export declare function computeFlipDelta(prevVisualTop: number, nextLayoutTop: number): number;
8
+ /**
9
+ * sticky 元素被容器底部顶住时,观察元素高度变化会让它瞬间跳位。
10
+ * 这里在布局变化后、绘制前,用 FLIP 把这次跳动变成平滑过渡,不改变滚动位置。
11
+ *
12
+ * - 仅在 `query` 命中且未开启 prefers-reduced-motion 时生效
13
+ * - resize 期间不播放动画,避免拖动窗口时拖尾
14
+ * - 动画中再次触发会从当前视觉位置重新起动画
15
+ */
16
+ export declare function useStickyFlip(targetRef: RefObject<HTMLElement | null>, observedRef: RefObject<HTMLElement | null>, options?: {
17
+ query?: string;
18
+ duration?: number;
19
+ easing?: string;
20
+ }): void;
@@ -0,0 +1 @@
1
+ import{useEffect as z}from"react";const _=250,I="cubic-bezier(0.2, 0, 0, 1)",S="(min-width: 1280px)",F="(prefers-reduced-motion: reduce)",D=.5,A=150;function C(e){if(!e||e==="none")return 0;const t=e.match(/^matrix3d\((.+)\)$/);if(t)return parseFloat(t[1].split(",")[13])||0;const n=e.match(/^matrix\((.+)\)$/);return n&&parseFloat(n[1].split(",")[5])||0}function Y(e,t){const n=e-t;return Math.abs(n)<D?0:n}function N(e,t,n={}){const{query:m=S,duration:p=_,easing:f=I}=n;z(()=>{const r=e.current,T=t.current;if(!r||!T||typeof ResizeObserver>"u")return;const L=window.matchMedia(m),h=window.matchMedia(F),M=()=>L.matches&&!h.matches&&typeof r.animate=="function";let o=null,a=!1,l,E=!1;const b=()=>o?C(getComputedStyle(r).transform):0;let u=r.getBoundingClientRect().top;const i=()=>{u=r.getBoundingClientRect().top-b()},s=()=>{const d=o;o=null,d?.cancel()},O=()=>{if(!E){E=!0,i();return}if(a||!M()){s(),i();return}const d=u+b();s();const R=r.getBoundingClientRect().top;u=R;const v=Y(d,R);if(!v)return;const c=r.animate([{transform:`translateY(${v}px)`},{transform:"translateY(0)"}],{duration:p,easing:f}),y=()=>{o===c&&(o=null)};c.onfinish=y,c.oncancel=y,o=c},w=()=>i(),g=()=>{a=!0,s(),i(),clearTimeout(l),l=setTimeout(()=>{a=!1,i()},A)},x=new ResizeObserver(O);return x.observe(T),window.addEventListener("scroll",w,{passive:!0}),window.addEventListener("resize",g),()=>{x.disconnect(),window.removeEventListener("scroll",w),window.removeEventListener("resize",g),clearTimeout(l),s()}},[e,t,m,p,f])}export{S as FLIP_DESKTOP_QUERY,_ as FLIP_DURATION,I as FLIP_EASING,Y as computeFlipDelta,C as parseTranslateY,N as useStickyFlip};
@@ -1 +1 @@
1
- "use client";import{jsx as a,jsxs as d}from"react/jsx-runtime";import*as T from"react";import{cn as t}from"../../helpers/index.js";import{Checkbox as L,Badge as j,Heading as D,Text as c,Picture as n}from"../../components/index.js";import{useSceneShelfContext as O}from"./context.js";import{LocalizedLink as q}from"../../shared/LocalizedLink.js";const p=T.forwardRef(({className:x,classNames:h,product:e,selected:f,onSelectChange:b,showTags:k,showOriginalPrice:C,onProductImageClick:P,...u},N)=>{const r=O(),S=k??r?.showTags??!0,v=C??r?.showOriginalPrice??!0,s=h??r?.classNames??{},l=f??(r?r.selectedIds.has(e.id):!1),m=b??r?.onSelectChange,g=P??r?.onProductImageClick,o=e.soldOut??!1,w=i=>{o||typeof i=="boolean"&&m?.(i,e)},y=()=>{o||m?.(!l,e)};return d("div",{ref:N,className:t("scene-shelf-product-card","lg-desktop:gap-2 lg-desktop:h-[362px] lg-desktop:px-6 lg-desktop:pb-6 lg-desktop:pt-4 rounded-box box-border flex h-[284px] flex-col justify-between gap-2 border-2 border-solid p-4 pb-6 transition-colors",o?"cursor-not-allowed opacity-50":"cursor-pointer",l?t("border-brand-0 bg-container-secondary-0",s?.cardSelected):t("border-lines bg-container-primary",!o&&"hover:bg-container-secondary",s?.card),x),onClick:y,"data-headless-type-name":"SceneShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name??e.title}##Select`,"data-headless-sku":e.id,...u,children:[a("div",{className:t("scene-shelf-product-card-tags","lg-desktop:left-6 lg-desktop:top-6 flex max-h-[24px] min-h-[24px] flex-wrap gap-1 overflow-visible pr-9",s?.tags),children:S&&e.tags?.map((i,z)=>a(j,{variant:i.variant||"outline",size:"sm",className:"scene-shelf-product-card-badge",children:i.label},z))}),a(L,{checked:l,disabled:o,onCheckedChange:w,onClick:i=>i.stopPropagation(),className:t("scene-shelf-product-card-checkbox","text-brand-0 border-brand-0 lg-desktop:right-6 lg-desktop:top-6 absolute right-4 top-4 size-5 shrink-0",s?.checkbox)}),a("div",{className:t("flex flex-1 grow-0 items-center justify-center",s?.image),children:g?a("a",{onClick:()=>g(e),role:"button",children:a(n,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):e?.href?a(q,{href:e.href,children:a(n,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):a(n,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}),d("div",{className:"flex grow flex-col justify-start gap-4",children:[a(D,{as:"h3",size:2,className:t("text-info-primary line-clamp-2 h-[2.2em]",s?.title),html:e.custom_name??e.title}),d("div",{className:t("flex flex-wrap items-center gap-1",s?.priceWrapper),children:[a(c,{as:"span",size:2,className:t("text-info-primary lg-desktop:text-[24px] whitespace-nowrap text-[20px]",s?.currentPrice),children:e.currentPrice.formatted}),v&&e.originalPrice&&e.originalPrice.value>e.currentPrice.value&&a(c,{as:"span",size:2,className:t("text-info-quaternary lg-desktop:text-[24px] whitespace-nowrap text-[20px] line-through",s?.originalPrice),children:e.originalPrice.formatted})]}),e?.priceLabel&&a(c,{size:4,className:t("text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] mt-2 text-[14px]",s?.productPriceLabel),children:e.priceLabel})]})]})});p.displayName="SceneShelf.ProductCard";export{p as SceneProductCard};
1
+ "use client";import{jsx as a,jsxs as d}from"react/jsx-runtime";import*as T from"react";import{cn as t}from"../../helpers/index.js";import{Checkbox as L,Badge as j,Heading as D,Text as c,Picture as n}from"../../components/index.js";import{useSceneShelfContext as O}from"./context.js";import{LocalizedLink as q}from"../../shared/LocalizedLink.js";const p=T.forwardRef(({className:x,classNames:h,product:e,selected:f,onSelectChange:b,showTags:k,showOriginalPrice:C,onProductImageClick:P,...u},N)=>{const r=O(),S=k??r?.showTags??!0,v=C??r?.showOriginalPrice??!0,s=h??r?.classNames??{},l=f??(r?r.selectedIds.has(e.id):!1),m=b??r?.onSelectChange,g=P??r?.onProductImageClick,o=e.soldOut??!1,w=i=>{o||typeof i=="boolean"&&m?.(i,e)},y=()=>{o||m?.(!l,e)};return d("div",{ref:N,className:t("scene-shelf-product-card","lg-desktop:gap-2 lg-desktop:h-[362px] lg-desktop:px-6 lg-desktop:pb-6 lg-desktop:pt-4 rounded-box box-border flex h-[284px] flex-col justify-between gap-2 border-2 border-solid p-4 pb-6 transition-colors",o?"cursor-not-allowed opacity-50":"cursor-pointer",l?t("border-brand-0 bg-container-secondary-0",s?.cardSelected):t("border-lines bg-container-primary",!o&&"hover:bg-container-secondary",s?.card),x),onClick:y,"data-headless-type-name":"SceneShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name??e.title}##Select`,"data-headless-sku":e.id,...u,children:[a("div",{className:t("scene-shelf-product-card-tags","lg-desktop:left-6 lg-desktop:top-6 flex max-h-[24px] min-h-[24px] flex-wrap gap-1 overflow-visible pr-9",s?.tags),children:S&&e.tags?.map((i,z)=>a(j,{variant:i.variant||"outline",size:"sm",className:"scene-shelf-product-card-badge",children:i.label},z))}),a(L,{checked:l,disabled:o,onCheckedChange:w,onClick:i=>i.stopPropagation(),className:t("scene-shelf-product-card-checkbox","text-brand-0 border-brand-0 lg-desktop:right-6 lg-desktop:top-6 absolute right-4 top-4 size-5 shrink-0",s?.checkbox)}),a("div",{className:t("flex flex-1 grow-0 items-center justify-center",s?.image),children:g?a("a",{onClick:()=>g(e),role:"button",children:a(n,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):e?.href?a(q,{href:e.href,children:a(n,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}):a(n,{source:e.imageUrl,alt:e.imageAlt||e.title,className:"lg-desktop:size-[175px] aspect-square size-[124px] ",imgClassName:"object-contain"})}),d("div",{className:"flex grow flex-col justify-start gap-4",children:[a(D,{as:"h3",size:2,className:t("text-info-primary line-clamp-2",s?.title),html:e.custom_name??e.title}),d("div",{className:t("flex flex-wrap items-center gap-1",s?.priceWrapper),children:[a(c,{as:"span",size:2,className:t("text-info-primary lg-desktop:text-[24px] whitespace-nowrap text-[20px]",s?.currentPrice),children:e.currentPrice.formatted}),v&&e.originalPrice&&e.originalPrice.value>e.currentPrice.value&&a(c,{as:"span",size:2,className:t("text-info-quaternary lg-desktop:text-[24px] whitespace-nowrap text-[20px] line-through",s?.originalPrice),children:e.originalPrice.formatted})]}),e?.priceLabel&&a(c,{size:4,className:t("text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] mt-2 text-[14px]",s?.productPriceLabel),children:e.priceLabel})]})]})});p.displayName="SceneShelf.ProductCard";export{p as SceneProductCard};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as i}from"react/jsx-runtime";import*as l from"react";import{Swiper as K,SwiperSlide as Q}from"swiper/react";import{FreeMode as U,Mousewheel as W}from"swiper/modules";import{cn as r}from"../../helpers/index.js";import{Heading as X,Button as T,Text as d}from"../../components/index.js";import{useSceneShelfContext as Y}from"./context.js";import"swiper/css";const N=l.forwardRef(({title:m,totalPriceLabel:S,totalCurrentPrice:L,totalOriginalPrice:v,primaryButtonText:k,primaryButtonFun:C,secondaryButtonText:D,secondaryButtonFun:F,bundleDiscountLabel:M,className:A,children:R,...O},z)=>{const e=Y(),a=e?.classNames,x=S??e?.totalPriceLabel??"Total Price:",s=L??e?.totalCurrentPrice,u=v??e?.totalOriginalPrice,f=k??e?.primaryButtonText??"Shop Now",y=C??e?.primaryButtonFun??"buyNow",P=D??e?.secondaryButtonText??"Add to Cart",w=F??e?.secondaryButtonFun??"addCart",c=M??e?.bundleDiscountLabel,n=e?.selectedProducts??[],V=e?.onLearnMore,H=e?.onShopNow,j=e?.onAddToCart,E=e?.showOriginalPrice??!0,[q,G]=l.useState(!1),[I,J]=l.useState(!1),b=l.Children.toArray(R),g=async(o,p)=>{if(!o)return;const B=p==="primary"?G:J;B(!0);try{switch(o){case"buyNow":await H?.(n);break;case"addCart":await j?.(n);break;case"learnMore":await V?.(n);break;default:break}}finally{B(!1)}},h=o=>o==="learnMore"?!1:n.length===0;return i("div",{ref:z,className:r("bg-container-primary laptop:p-6 lg-desktop:p-8 flex min-w-0 flex-1 flex-col justify-between overflow-hidden p-4",A,a?.content),...O,children:[m&&t(X,{as:"h2",size:3,className:r("text-info-primary flex-0 mb-[16px] line-clamp-1 shrink-0",a?.title),html:m}),t("div",{className:r("lg-desktop:mb-[24px] mb-[16px] flex-1 ",a?.productList),children:t(K,{modules:[U,W],freeMode:!0,mousewheel:{forceToAxis:!0},slidesPerView:"auto",spaceBetween:10,breakpoints:{0:{slidesPerView:1.5},768:{spaceBetween:16,slidesPerView:2.8},1024:{slidesPerView:2.3},1440:{spaceBetween:16,slidesPerView:b.length<=3?3:3.2}},children:b.map((o,p)=>t(Q,{className:"h-fit shrink-0",children:o},p))})}),i("div",{className:r("tablet:items-end tablet:flex-row flex-0 flex flex-col items-start justify-between gap-2",a?.footer),children:[i("div",{className:"flex flex-col",children:[i("div",{className:r("flex flex-wrap items-center gap-1",a?.totalPrice),children:[x&&t(d,{as:"span",size:2,className:"text-info-primary lg-desktop:text-[24px] text-[20px]",children:x}),s&&t(d,{as:"span",size:2,className:r("text-info-primary lg-desktop:text-[24px] text-[20px]",a?.currentTotalPrice),children:s.formatted}),E&&u&&s&&u.value>s.value&&t(d,{as:"span",size:2,className:r("text-info-quaternary lg-desktop:text-[24px] text-[20px] line-through",a?.originalTotalPrice),children:u.formatted})]}),c&&t(d,{as:"span",size:2,className:r("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 text-[14px]",a?.bundleDiscountLabel),children:typeof c=="function"?c(n):c})]}),i("div",{className:r("flex items-stretch gap-3",a?.buttonGroup),children:[P&&t(T,{variant:"secondary",className:"min-w-0 whitespace-normal text-center",onClick:()=>g(w,"secondary"),disabled:h(w),loading:I,children:P}),f&&t(T,{variant:"primary",className:"min-w-0 whitespace-normal text-center",onClick:()=>g(y,"primary"),disabled:h(y),loading:q,children:f})]})]})]})});N.displayName="SceneShelf.ProductsPanel";export{N as SceneShelfProductsPanel};
1
+ "use client";import{jsx as t,jsxs as s}from"react/jsx-runtime";import*as n from"react";import{Swiper as K,SwiperSlide as Q}from"swiper/react";import{FreeMode as U,Mousewheel as X}from"swiper/modules";import{cn as r}from"../../helpers/index.js";import{Heading as Y,Button as C,Text as d}from"../../components/index.js";import{buildSsrSlideCss as ee}from"../SwiperBox/buildSsrSlideCss.js";import{useSceneShelfContext as te}from"./context.js";import"swiper/css";const k=n.forwardRef(({title:y,totalPriceLabel:v,totalCurrentPrice:D,totalOriginalPrice:F,primaryButtonText:M,primaryButtonFun:A,secondaryButtonText:R,secondaryButtonFun:z,bundleDiscountLabel:H,className:O,children:V,..._},j)=>{const e=te(),a=e?.classNames,P=v??e?.totalPriceLabel??"Total Price:",l=D??e?.totalCurrentPrice,u=F??e?.totalOriginalPrice,w=M??e?.primaryButtonText??"Shop Now",g=A??e?.primaryButtonFun??"buyNow",b=R??e?.secondaryButtonText??"Add to Cart",h=z??e?.secondaryButtonFun??"addCart",c=H??e?.bundleDiscountLabel,i=e?.selectedProducts??[],E=e?.onLearnMore,I=e?.onShopNow,$=e?.onAddToCart,q=e?.showOriginalPrice??!0,[G,W]=n.useState(!1),[Z,J]=n.useState(!1),B=n.Children.toArray(V),S=B.length,p=n.useMemo(()=>({0:{slidesPerView:1.5,spaceBetween:10},768:{slidesPerView:2.8,spaceBetween:16},1024:{slidesPerView:2.3,spaceBetween:10},1440:{slidesPerView:S<=3?3:3.2,spaceBetween:16}}),[S]),m=`swiper-ssr-${n.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,x=n.useMemo(()=>ee(`.${m}`,p),[m,p]),T=async(o,f)=>{if(!o)return;const L=f==="primary"?W:J;L(!0);try{switch(o){case"buyNow":await I?.(i);break;case"addCart":await $?.(i);break;case"learnMore":await E?.(i);break;default:break}}finally{L(!1)}},N=o=>o==="learnMore"?!1:i.length===0;return s("div",{ref:j,className:r("bg-container-primary laptop:p-6 lg-desktop:p-8 flex min-w-0 flex-1 flex-col justify-between overflow-hidden p-4",O,a?.content),..._,children:[y&&t(Y,{as:"h2",size:3,className:r("text-info-primary flex-0 mb-[16px] line-clamp-1 shrink-0",a?.title),html:y}),s("div",{className:r("lg-desktop:mb-[24px] mb-[16px] flex-1 ",a?.productList),children:[x&&t("style",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:x}}),t(K,{modules:[U,X],freeMode:!0,mousewheel:{forceToAxis:!0},className:x?m:void 0,breakpoints:p,children:B.map((o,f)=>t(Q,{className:"h-fit shrink-0",children:o},f))})]}),s("div",{className:r("tablet:items-end tablet:flex-row flex-0 flex flex-col items-start justify-between gap-2",a?.footer),children:[s("div",{className:"flex flex-col",children:[s("div",{className:r("flex flex-wrap items-center gap-1",a?.totalPrice),children:[P&&t(d,{as:"span",size:2,className:"text-info-primary lg-desktop:text-[24px] text-[20px]",children:P}),l&&t(d,{as:"span",size:2,className:r("text-info-primary lg-desktop:text-[24px] text-[20px]",a?.currentTotalPrice),children:l.formatted}),q&&u&&l&&u.value>l.value&&t(d,{as:"span",size:2,className:r("text-info-quaternary lg-desktop:text-[24px] text-[20px] line-through",a?.originalTotalPrice),children:u.formatted})]}),c&&t(d,{as:"span",size:2,className:r("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-1 text-[14px]",a?.bundleDiscountLabel),children:typeof c=="function"?c(i):c})]}),s("div",{className:r("flex items-stretch gap-3",a?.buttonGroup),children:[b&&t(C,{variant:"secondary",className:"min-w-0 whitespace-normal text-center",onClick:()=>T(h,"secondary"),disabled:N(h),loading:Z,children:b}),w&&t(C,{variant:"primary",className:"min-w-0 whitespace-normal text-center",onClick:()=>T(g,"primary"),disabled:N(g),loading:G,children:w})]})]})]})});k.displayName="SceneShelf.ProductsPanel";export{k as SceneShelfProductsPanel};
@@ -1 +1 @@
1
- "use client";import{jsx as i,jsxs as T}from"react/jsx-runtime";import at,{useEffect as lt,useRef as g,useImperativeHandle as dt,useState as ct}from"react";import{gsap as k}from"gsap";import{SplitText as R}from"gsap/dist/SplitText";import{ScrollTrigger as A}from"gsap/dist/ScrollTrigger";import{cn as s,getLocalizedPath as ut}from"../../helpers/utils.js";import{cva as V}from"class-variance-authority";import{Heading as mt,Text as N,Countdown as pt}from"../../components/index.js";import{withLayout as ft}from"../../shared/Styles.js";import{useAiuiContext as ht}from"../AiuiProvider/index.js";import{convertLexicalToPlaintext as gt}from"@payloadcms/richtext-lexical/plaintext";import{trackUrlRef as xt}from"../../shared/trackUrlRef.js";import{useInView as wt}from"react-intersection-observer";const S="link",$="title";function bt(t){if(!t)return!1;if(typeof t=="string")return t.trim().length>0;const a=t?.root?.children;return!Array.isArray(a)||a.length===0?!1:a.some(n=>{const r=n?.children;return!Array.isArray(r)||r.length===0?!1:r.some(o=>typeof o?.text=="string"&&o.text.length>0)})}function _(t){if(!t)return"";if(typeof t=="string")return t;try{return gt({data:t})||""}catch{return""}}const yt=V("",{variants:{theme:{light:"text-[#080A0F]",dark:"text-[#F5F6F7]"}},defaultVariants:{theme:"light"}}),vt=V("desktop:text-base desktop:mt-2 lg-desktop:text-[18px] mt-1 text-[14px] font-bold leading-[1.4] tracking-[-0.36px]",{variants:{theme:{light:"text-[#080A0F]",dark:"text-[#F5F6F7]"}},defaultVariants:{theme:"light"}}),B=({data:t,onClick:a,className:n})=>{const{theme:r="light",extensions:o,title:p,caption:x,align:f}=t,{locale:w="us"}=ht();if(!o?.textLink)return null;const d=o?.link?xt(ut(o.link,w),`${S}_${$}`):void 0;return T("a",{className:s({"aiui-dark":r==="dark"},"hover:text-brand-0 [&_svg_path]:hover:fill-brand-0 lg-desktop:text-base flex cursor-pointer items-center overflow-hidden text-sm font-[700] leading-[1.4] transition-all duration-[0.4s]",{"text-[#080A0F]":r==="light"},{"text-[#F5F6F7]":r==="dark"},{"justify-center mt-4":f==="center"},{"mt-1 laptop:mt-0":f==="left"},n),...d?{href:d}:{},"data-headless-type-name":`${S}#${$}`,"data-headless-title-desc-button":`${_(p)}#${_(x)}`,...a?{onClick:a}:{},children:[i("div",{className:"truncate whitespace-nowrap",children:o?.textLink}),i("div",{className:"lg-desktop:size-5 size-4",children:i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",children:i("path",{d:"M5.52827 3.52864C5.78862 3.26829 6.21063 3.26829 6.47098 3.52864L10.471 7.52864C10.7313 7.78899 10.7313 8.21099 10.471 8.47134L6.47098 12.4713C6.21063 12.7317 5.78862 12.7317 5.52827 12.4713C5.26792 12.211 5.26792 11.789 5.52827 11.5286L9.05692 7.99999L5.52827 4.47134C5.26792 4.21099 5.26792 3.78899 5.52827 3.52864Z",fill:r==="dark"?"#F5F6F7":"#080A0F",className:"transition-all duration-[0.4s]"})})})]})},I=at.forwardRef(({data:t,className:a,classNames:n,as:r="h2",weight:o="bold",onButtonClick:p,id:x,...f},w)=>{const{title:d,titleSize:j=4,caption:L,subtitle:F,content:H,countdown:e,showCountdown:O=!1,theme:h="light",extensions:C,align:c="left"}=t,D=g(null),u=g(null),l=g(null),m=g(null),[U,W]=ct(!0),{ref:Z,inView:M}=wt();dt(w,()=>D.current);const q=()=>{W(!1)},G=e?.targetDateTime||e?.targetDate||"",J=e?.targetDateTime_tz,K=e?.labels?{day:e.labels.days||"Day",hour:e.labels.hours||"Hours",minute:e.labels.minutes||"Mins",second:e.labels.seconds||"Secs"}:void 0;return lt(()=>{k.registerPlugin(R,A);function Q(){if(!u.current)return;const X=u.current?.clientHeight||80;l.current&&l.current.revert(),m.current&&m.current.kill(),l.current=new R(u.current,{type:"words",wordsClass:"word"});const b=l.current.words;k.set(b,{opacity:0}),m.current=A.create({trigger:u.current,start:"bottom bottom-=4%",end:`bottom+=${X*1.5+60}px bottom-=4%`,scrub:!0,invalidateOnRefresh:!0,onUpdate:Y=>{const tt=Y.progress,z=b.length||1,et=.5,y=1/z,E=y*(1-et),P=(z-1)*E+y,nt=Math.min(1,P>0?tt/P:0);b.forEach((rt,it)=>{const ot=it*E,st=y;let v=(nt-ot)/st;v=Math.max(0,Math.min(1,v)),k.set(rt,{opacity:v})})}})}return M&&Q(),()=>{l.current&&l.current.revert(),m.current&&m.current.kill()}},[M]),T("div",{id:C?.id?C?.id:x,className:s("titleBottom title-box flex items-end justify-between gap-2 pb-6",a,n?.wrapper),...f,ref:D,children:[T("div",{ref:Z,className:s("flex-1",n?.container,{"aiui-dark":h==="dark","text-center":c==="center","text-left":c==="left"}),children:[(L||d)&&i(mt,{ref:u,as:r,size:j,html:L||d,weight:o,className:s(yt({theme:h}),n?.title)}),F&&i(N,{html:F,as:"div",className:s(vt({theme:h}),n?.subtitle)}),bt(H)&&i(N,{html:H,as:"div",size:4,className:s("title-content text-info-primary desktop:text-base desktop:mt-4 lg-desktop:text-[18px] mt-2 text-[14px] leading-[1.6]",n?.content)}),i(B,{data:t,className:s({"laptop:hidden":c==="left"},n?.button),onClick:p}),O&&e&&U&&i(pt,{endDate:G,endDate_tz:J,timeLabels:K,showDays:e?.showDays,showHours:e?.showHours,showMinutes:e?.showMinutes,showSeconds:e?.showSeconds,theme:h,onExpire:q,hideWhenExpired:!0,align:c==="center"?"center":"left",className:s("mt-4",n?.countdown)})]}),i(B,{data:t,className:s("hidden",{"laptop:flex":c==="left"},n?.button),onClick:p})]})});I.displayName="Title";var At=ft(I);export{At as default};
1
+ "use client";import{jsx as o,jsxs as T}from"react/jsx-runtime";import st,{useEffect as lt,useRef as h,useImperativeHandle as at,useState as ct}from"react";import{gsap as b}from"gsap";import{SplitText as N}from"gsap/dist/SplitText";import{ScrollTrigger as S}from"gsap/dist/ScrollTrigger";import{cn as i,getLocalizedPath as dt}from"../../helpers/utils.js";import{Heading as ut,Text as $,Countdown as pt}from"../../components/index.js";import{withLayout as mt}from"../../shared/Styles.js";import{useAiuiContext as ft}from"../AiuiProvider/index.js";import{convertLexicalToPlaintext as ht}from"@payloadcms/richtext-lexical/plaintext";import{trackUrlRef as gt}from"../../shared/trackUrlRef.js";import{useInView as xt}from"react-intersection-observer";const A="link",V="title";function wt(t){if(!t)return!1;if(typeof t=="string")return t.trim().length>0;const s=t?.root?.children;return!Array.isArray(s)||s.length===0?!1:s.some(n=>{const r=n?.children;return!Array.isArray(r)||r.length===0?!1:r.some(l=>typeof l?.text=="string"&&l.text.length>0)})}function B(t){if(!t)return"";if(typeof t=="string")return t;try{return ht({data:t})||""}catch{return""}}const yt="text-info-primary desktop:text-base desktop:mt-2 lg-desktop:text-[18px] mt-1 text-[14px] font-bold leading-[1.4] tracking-[-0.36px]",I=({data:t,onClick:s,className:n})=>{const{extensions:r,title:l,caption:p,align:m}=t,{locale:g="us"}=ft();if(!r?.textLink)return null;const f=r?.link?gt(dt(r.link,g),`${A}_${V}`):void 0;return T("a",{className:i("text-info-primary hover:text-brand-0 lg-desktop:text-base flex cursor-pointer items-center overflow-hidden text-sm font-[700] leading-[1.4] transition-all duration-[0.4s]",{"justify-center mt-4":m==="center"},{"mt-1 laptop:mt-0":m==="left"},n),...f?{href:f}:{},"data-headless-type-name":`${A}#${V}`,"data-headless-title-desc-button":`${B(l)}#${B(p)}`,...s?{onClick:s}:{},children:[o("div",{className:"truncate whitespace-nowrap",children:r?.textLink}),o("div",{className:"lg-desktop:size-5 size-4",children:o("svg",{xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",children:o("path",{d:"M5.52827 3.52864C5.78862 3.26829 6.21063 3.26829 6.47098 3.52864L10.471 7.52864C10.7313 7.78899 10.7313 8.21099 10.471 8.47134L6.47098 12.4713C6.21063 12.7317 5.78862 12.7317 5.52827 12.4713C5.26792 12.211 5.26792 11.789 5.52827 11.5286L9.05692 7.99999L5.52827 4.47134C5.26792 4.21099 5.26792 3.78899 5.52827 3.52864Z",fill:"currentColor",className:"transition-all duration-[0.4s]"})})})]})},_=st.forwardRef(({data:t,className:s,classNames:n,as:r="h2",weight:l="bold",onButtonClick:p,id:m,...g},f)=>{const{title:v,titleSize:j=4,caption:k,subtitle:C,content:L,countdown:e,showCountdown:O=!1,theme:H="light",extensions:D,align:c="left"}=t,M=h(null),d=h(null),a=h(null),u=h(null),[U,W]=ct(!0),{ref:Z,inView:z}=xt();at(f,()=>M.current);const q=()=>{W(!1)},F=e?.targetDateTime||e?.targetDate||"",G=e?.targetDateTime_tz,J=e?.labels?{day:e.labels.days||"Day",hour:e.labels.hours||"Hours",minute:e.labels.minutes||"Mins",second:e.labels.seconds||"Secs"}:void 0;return lt(()=>{b.registerPlugin(N,S);function K(){if(!d.current)return;const Q=d.current?.clientHeight||80;a.current&&a.current.revert(),u.current&&u.current.kill(),a.current=new N(d.current,{type:"words",wordsClass:"word"});const x=a.current.words;b.set(x,{opacity:0}),u.current=S.create({trigger:d.current,start:"bottom bottom-=4%",end:`bottom+=${Q*1.5+60}px bottom-=4%`,scrub:!0,invalidateOnRefresh:!0,onUpdate:X=>{const Y=X.progress,E=x.length||1,tt=.5,w=1/E,P=w*(1-tt),R=(E-1)*P+w,et=Math.min(1,R>0?Y/R:0);x.forEach((nt,rt)=>{const ot=rt*P,it=w;let y=(et-ot)/it;y=Math.max(0,Math.min(1,y)),b.set(nt,{opacity:y})})}})}return z&&K(),()=>{a.current&&a.current.revert(),u.current&&u.current.kill()}},[z]),T("div",{id:D?.id?D?.id:m,className:i("titleBottom title-box flex items-end justify-between gap-2 pb-6",{"aiui-dark":H==="dark"},s,n?.wrapper),...g,ref:M,children:[T("div",{ref:Z,className:i("flex-1",n?.container,{"text-center":c==="center","text-left":c==="left"}),children:[(k||v)&&o(ut,{ref:d,as:r,size:j,html:k||v,weight:l,className:i("text-info-primary",n?.title)}),C&&o($,{html:C,as:"div",className:i(yt,n?.subtitle)}),wt(L)&&o($,{html:L,as:"div",size:4,className:i("title-content text-info-primary desktop:text-base desktop:mt-4 lg-desktop:text-[18px] mt-2 text-[14px] leading-[1.6]",n?.content)}),o(I,{data:t,className:i({"laptop:hidden":c==="left"},n?.button),onClick:p}),O&&e&&U&&o(pt,{endDate:F,endDate_tz:G,timeLabels:J,showDays:e?.showDays,showHours:e?.showHours,showMinutes:e?.showMinutes,showSeconds:e?.showSeconds,theme:H,onExpire:q,hideWhenExpired:!0,align:c==="center"?"center":"left",className:i("mt-4",n?.countdown)})]}),o(I,{data:t,className:i("hidden",{"laptop:flex":c==="left"},n?.button),onClick:p})]})});_.displayName="Title";var Pt=mt(_);export{Pt as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anker-in/headless-ui",
3
- "version": "1.3.82",
3
+ "version": "1.3.83",
4
4
  "type": "commonjs",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "types": "./dist/cjs/index.d.ts",
package/style.css CHANGED
@@ -1554,9 +1554,6 @@ video {
1554
1554
  .h-\[1px\] {
1555
1555
  height: 1px;
1556
1556
  }
1557
- .h-\[2\.2em\] {
1558
- height: 2.2em;
1559
- }
1560
1557
  .h-\[200px\] {
1561
1558
  height: 200px;
1562
1559
  }
@@ -2226,6 +2223,9 @@ video {
2226
2223
  --tw-scale-y: 70%;
2227
2224
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
2228
2225
  }
2226
+ .\!transform {
2227
+ transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) !important;
2228
+ }
2229
2229
  .transform {
2230
2230
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
2231
2231
  }
@@ -9170,9 +9170,6 @@ video {
9170
9170
  .\[\&_svg\]\:shrink-0 svg {
9171
9171
  flex-shrink: 0;
9172
9172
  }
9173
- .\[\&_svg_path\]\:hover\:fill-brand-0:hover svg path {
9174
- fill: var(--brand-color-0);
9175
- }
9176
9173
  .swiper-slide-active.\[\.swiper-slide-active\&\]\:opacity-100 {
9177
9174
  opacity: 1;
9178
9175
  }