@anker-in/headless-ui 1.3.85 → 1.3.87

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +6 -0
  2. package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
  3. package/dist/cjs/biz-components/HeroBanner/HeroBannerCarousel.js +1 -1
  4. package/dist/cjs/biz-components/Listing/BizProductProvider.d.ts +8 -2
  5. package/dist/cjs/biz-components/Listing/BizProductProvider.js +1 -1
  6. package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.js +1 -1
  7. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
  8. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js +1 -1
  9. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js +1 -1
  10. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
  11. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +1 -1
  12. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  13. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js +1 -1
  14. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  15. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  16. package/dist/cjs/biz-components/Listing/hooks/useBenefits.js +1 -1
  17. package/dist/cjs/biz-components/Listing/types/product.d.ts +9 -0
  18. package/dist/cjs/biz-components/Listing/types/product.js +1 -1
  19. package/dist/cjs/biz-components/Listing/types.d.ts +19 -0
  20. package/dist/cjs/biz-components/Listing/types.js +1 -1
  21. package/dist/cjs/biz-components/Listing/utils/priceCalc.d.ts +28 -0
  22. package/dist/cjs/biz-components/Listing/utils/priceCalc.js +1 -0
  23. package/dist/cjs/biz-components/ProductNav/ProductNav.js +1 -1
  24. package/dist/cjs/biz-components/SearchPage/index.js +1 -1
  25. package/dist/cjs/biz-components/SecondaryBanner/index.js +1 -1
  26. package/dist/cjs/biz-components/index.d.ts +2 -0
  27. package/dist/cjs/biz-components/index.js +1 -1
  28. package/dist/cjs/components/container.js +1 -1
  29. package/dist/cjs/helpers/utils.js +1 -1
  30. package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
  31. package/dist/esm/biz-components/HeroBanner/HeroBannerCarousel.js +1 -1
  32. package/dist/esm/biz-components/Listing/BizProductProvider.d.ts +8 -2
  33. package/dist/esm/biz-components/Listing/BizProductProvider.js +1 -1
  34. package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.js +1 -1
  35. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
  36. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js +1 -1
  37. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js +1 -1
  38. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
  39. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +1 -1
  40. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  41. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js +1 -1
  42. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  43. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  44. package/dist/esm/biz-components/Listing/hooks/useBenefits.js +1 -1
  45. package/dist/esm/biz-components/Listing/types/product.d.ts +9 -0
  46. package/dist/esm/biz-components/Listing/types.d.ts +19 -0
  47. package/dist/esm/biz-components/Listing/utils/priceCalc.d.ts +28 -0
  48. package/dist/esm/biz-components/Listing/utils/priceCalc.js +1 -0
  49. package/dist/esm/biz-components/ProductNav/ProductNav.js +1 -1
  50. package/dist/esm/biz-components/SearchPage/index.js +1 -1
  51. package/dist/esm/biz-components/SecondaryBanner/index.js +1 -1
  52. package/dist/esm/biz-components/index.d.ts +2 -0
  53. package/dist/esm/biz-components/index.js +1 -1
  54. package/dist/esm/components/container.js +1 -1
  55. package/dist/esm/helpers/utils.js +1 -1
  56. package/dist/tokens/base.css +48 -0
  57. package/package.json +1 -1
  58. package/style.css +9 -12
  59. package/tailwind.config.js +3 -0
@@ -1 +1 @@
1
- import{jsx as t,jsxs as x}from"react/jsx-runtime";import{useAiuiContext as Z}from"../../../../AiuiProvider/index.js";import{Text as J,Picture as W,Badge as oe}from"../../../../../components/index.js";import{useCallback as N,useMemo as Y,useState as E,forwardRef as Q,useRef as V,useEffect as R,useImperativeHandle as re}from"react";import{Swiper as $,SwiperSlide as B}from"swiper/react";import{Navigation as K,Mousewheel as X,Thumbs as O,Pagination as ee,Autoplay as ne}from"swiper/modules";import{cn as L}from"../../../../../helpers/index.js";import{GalleryTabType as _}from"./types.js";import{Content as se,List as ce,Root as de,Trigger as ue}from"@radix-ui/react-tabs";import{useBizProductContext as q}from"../../../BizProductProvider.js";import{useVariantMedia as pe}from"../../../hooks/use-variant-media.js";import{SpecsModal as me}from"./components/SpecsModal.js";import be from"./components/CompareModal.js";import{formatPrice as ge}from"../../../utils/index.js";import{withLayout as fe}from"../../../../../shared/Styles.js";import{gaTrack as ve}from"../../../../../shared/track.js";import{ExposureDetector as ye}from"../../../../../components/index.js";import{debounce as te}from"es-toolkit";const ae=e=>x("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[t("rect",{x:"48",y:"48",width:"48",height:"48",rx:"24",transform:"rotate(-180 48 48)",fill:"white"}),t("path",{d:"M25.1035 16.8545C25.5372 16.3818 26.246 16.3818 26.6797 16.8545C27.1067 17.3201 27.1067 18.0706 26.6797 18.5361L21.668 24L26.6797 29.4639C27.1067 29.9294 27.1067 30.6799 26.6797 31.1455C26.246 31.6182 25.5372 31.6182 25.1035 31.1455L19.3203 24.8408C18.8933 24.3752 18.8933 23.6248 19.3203 23.1592L25.1035 16.8545Z",fill:"currentColor"})]}),le=e=>x("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[t("rect",{width:"48",height:"48",rx:"24",transform:"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)",fill:"white"}),t("path",{d:"M22.8965 16.8545C22.4628 16.3818 21.754 16.3818 21.3203 16.8545C20.8933 17.3201 20.8933 18.0706 21.3203 18.5361L26.332 24L21.3203 29.4639C20.8933 29.9294 20.8933 30.6799 21.3203 31.1455C21.754 31.6182 22.4628 31.6182 22.8965 31.1455L28.6797 24.8408C29.1067 24.3752 29.1067 23.6248 28.6797 23.1592L22.8965 16.8545Z",fill:"currentColor"})]}),he=()=>{const{copyWriting:e}=Z(),{product:r,variant:c,selectedOptions:P}=q(),m=pe({product:r,variant:c}),[f,S]=E(null),A=V(null),T=c?.metafields?.component?.custom_media_list;let o,v,y,h;T&&T?.available?(o=T?.product||[],v=T?.scenarios||[],y=T?.keyFeatures||[],h=T?.video||[]):(o=m?.productList,v=m?.sceneList,y=m?.keyFeaturesList,h=m?.videoList);const k=Y(()=>[...o,...v,...h],[o,v,h]),I={productList:o,sceneList:v,keyFeaturesList:y,videoList:h},d=Y(()=>{const i=r?.payload?.components?.find(g=>g.componentKey==="ProductGallery")?.data||[],s=c?.payload?.components?.find(g=>g.componentKey==="ProductGallery")?.data||[];return i?.map(g=>{const G=Array.isArray(s)?s?.find(F=>g?.galleries===F?.galleries):{};let D=I[g?.galleries]||[];if(G?.images&&Array.isArray(G.images)&&G.images.length>0){const F=G.images.map(u=>{const C=[];if(u.image_1920&&u.image_1920.trim()&&C.push(`${u.image_1920}`),u.image_1440&&u.image_1440.trim()&&C.push(`${u.image_1440} 1919`),u.image_1024&&u.image_1024.trim()&&C.push(`${u.image_1024} 1439`),u.image_768&&u.image_768.trim()&&C.push(`${u.image_768} 1023`),u.image_390&&u.image_390.trim()&&C.push(`${u.image_390} 767`),C.length>0){const U=C.join(", ");return{image:{url:U,altText:g.comment?.content||""},_fromImages:!0,_responsiveSource:U}}return null}).filter(u=>u!==null);F.length>0&&(D=F)}return{...g,galleries:D}}).filter(g=>g.galleries.length>0)},[c?.payload,I,r?.payload]),[n,a]=E(d?.[0]),[l,p]=E(0),[b,w]=E(null),M=N(()=>{const i=(l+1)%d.length;p(i),a(d[i]),w(0)},[l,d]),z=N(()=>{const i=l===0?d.length-1:l-1;p(i),a(d[i]);const s=d[i]?.galleries||[];w(s.length-1)},[l,d]);R(()=>{l!=null&&requestAnimationFrame(()=>{A.current?.scrollToTab(l)})},[l]),R(()=>{a(d[0]),p(0)},[c?.id]);const H=(i,s)=>{switch(i?.galleryTabType){case _.GALLERY_IMAGE_MAIN:return t(j,{...i,index:s,onNextTab:M,onPrevTab:z,targetSlideIndex:b,onSlideChange:()=>w(null)});case _.GALLERY_IMAGE_FEATURES:return t(j,{...i,index:s,onNextTab:M,onPrevTab:z,targetSlideIndex:b,onSlideChange:()=>w(null)});case _.GALLERY_IMAGE_SCENE:return t(j,{...i,index:s,onNextTab:M,onPrevTab:z,targetSlideIndex:b,onSlideChange:()=>w(null)});case _.GALLERY_VIDEO:return t(Te,{...i,onNextTab:M,onPrevTab:z,targetSlideIndex:b,onSlideChange:()=>w(null)});default:return null}};return t("div",{id:"ipc-product-gallery",children:x(de,{className:"relative",value:n?.tabValue,defaultValue:d?.[0]?.tabValue,children:[t("div",{className:"tablet:h-[620px] laptop-md:rounded-2xl laptop-md:h-[560px] lg-desktop:h-[700px] laptop-md:relative h-[420px] overflow-hidden bg-[#EAEAEC] ",children:d.map((i,s)=>t(se,{className:"h-full",value:i.tabValue,children:H(i,s)},i.tabValue))}),t(ie,{ref:A,galleryTabs:d,activeGalleryTab:n,setActiveGalleryTab:a,setActiveTabIndex:p,setTargetSlideIndex:w})]})})},ie=Q((e,r)=>{const{galleryTabs:c,activeGalleryTab:P,setActiveGalleryTab:m,setActiveTabIndex:f,setTargetSlideIndex:S}=e,{product:A,compareData:T}=q(),o=V(null),v=V(new Map),y=!!A.metafields?.global?.specifications?.length,h=!!T?.specificationKeys?.length,k=N(n=>{if(o.current){const a=o.current,l=n.currentTarget,p=l.offsetLeft-a.offsetWidth/2+l.offsetWidth/2;a.scrollTo({left:p,behavior:"smooth"})}},[]),I=N((n,a,l)=>{m(a),f(l),S(0),k(n)},[m,f,S,k]),d=N(n=>{if(o.current&&c[n]){const a=o.current,l=c[n],p=v.current.get(l.tabValue);if(p){const b=p.offsetLeft-a.offsetWidth/2+p.offsetWidth/2;a.scrollTo({left:b,behavior:"smooth"})}}},[c]);return re(r,()=>({scrollToTab:d})),x("div",{className:"laptop:inset-x-16 tablet:mt-3 laptop-md:static absolute inset-x-4 bottom-4 z-[2] flex items-center justify-between",children:[t(ce,{ref:o,className:"laptop:p-0 laptop-md:p-1 overflow-x-auto rounded-full bg-[#EAEAEC] p-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t("div",{className:"whitespace-nowrap",children:c?.map((n,a)=>t(ue,{ref:l=>{l?v.current.set(n.tabValue,l):v.current.delete(n.tabValue)},className:L("lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px] rounded-full px-5 pb-[10px] pt-[11px] text-[14px] font-bold leading-tight",n.tabValue===P?.tabValue&&"bg-white"),onClick:l=>I(l,n,a),value:n.tabValue,children:n.tabLabel},n.tabValue+a))})}),(y||h)&&x("div",{className:"desktop:gap-2 desktop:flex hidden",children:[y&&t(me,{}),y&&h&&t("span",{children:"|"}),h&&t(be,{})]})]})});ie.displayName="ProductGalleryTab";const j=Q((e,r)=>{const{locale:c="us",copyWriting:P}=Z(),{variant:m,totalSavings:f}=q(),S=V(null),[A,T]=E(null),[o,v]=E(null),[y,h]=E([]),k=V(null),I=Y(()=>{if(e?.galleryTabType===_.GALLERY_IMAGE_MAIN)return"size-[240px] mx-auto mt-[42px] tablet:mt-16 tablet:size-[420px] lg-desktop:size-[560px]";e?.galleryTabType===_.GALLERY_IMAGE_FEATURES||(e?.galleryTabType,_.GALLERY_IMAGE_SCENE)},[e?.galleryTabType]),d=N(()=>{o?.isBeginning?e.onPrevTab?.():o?.slidePrev()},[o,e]),n=N(()=>{o?.isEnd?e.onNextTab?.():o?.slideNext()},[o,e]);return R(()=>{o&&e.targetSlideIndex&&(o.slideTo(e.targetSlideIndex,0),e.onSlideChange?.())},[o,e.targetSlideIndex,e]),R(()=>{const a=()=>{if(!e?.comment?.content||!k.current)return;const b=k.current;b.textContent="Test";const M=b.offsetHeight*2+2,H=e.comment.content.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim().split(" "),i=[];let s="";for(let g=0;g<H.length;g++){const G=H[g],D=s?`${s} ${G}`:G;b.textContent=D,b.offsetHeight>M?s?(i.push(s),s=G):(i.push(G),s=""):s=D}s&&i.push(s),b.textContent="",h(i)},l=requestAnimationFrame(()=>{requestAnimationFrame(()=>{a()})}),p=()=>{a()};return window.addEventListener("resize",te(p,500)),()=>{cancelAnimationFrame(l),window.removeEventListener("resize",te(p,500))}},[e?.comment?.content]),x("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[t($,{ref:r,className:"h-full",onSwiper:v,onTouchEnd:(a,l)=>{a.isBeginning&&a.swipeDirection==="prev"?d():a.isEnd&&a.swipeDirection==="next"&&n()},pagination:{clickable:!0,el:S.current},thumbs:{swiper:A},modules:[X,O,K,ee],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:e?.galleries?.map((a,l)=>{const p=`${e.tabValue}-${l}`,b=()=>{ve({event:"ga4Event",event_name:"component_impression",event_parameters:{page_group:`Product Detail Page${m.sku}`,component_type:"image",component_name:e?.tabLabel||"",position:l+1,creative_id:"",component_title:"",component_description:"",navigation:""}})},w=a?._responsiveSource||a?.image?.url||"";return t(B,{className:"h-full",children:t(ye,{onExposure:b,exposureKey:p,threshold:.5,duration:2e3,className:"h-full",children:t(W,{source:w,alt:a?.image?.altText,className:L("h-full",I),imgClassName:"object-cover h-full"})})},e?.id+"SwiperSlideItem"+l)})}),m.availableForSale&&!!f&&!e.index&&t(oe,{size:"lg",className:"bg-brand-0 laptop:left-16 laptop:top-5 laptop-md:left-6 laptop-md:top-6 absolute left-4 top-3 z-[2] text-white",children:`${ge({amount:f,currencyCode:m?.price?.currencyCode,locale:c})} ${P?.off}`}),t("div",{className:L("tablet:opacity-0 tablet:block tablet:absolute tablet:top-1/2 laptop:left-16 tablet:left-6 laptop-md:left-6 z-10 hidden -translate-y-1/2 cursor-pointer","swiper-button"),onClick:d,children:t(ae,{className:L("tablet:size-10 lg-desktop:size-12")})}),t("div",{className:L("tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 laptop:right-16 tablet:right-6 laptop-md:right-6 z-10 hidden -translate-y-1/2 cursor-pointer","swiper-button"),onClick:n,children:t(le,{className:L("tablet:size-10 lg-desktop:size-12")})}),x("div",{className:"tablet:bottom-[70px] tablet:flex laptop:inset-x-16 laptop-md:bottom-[20px] laptop-md:inset-x-6 absolute inset-x-4 bottom-[94px] z-10 items-center justify-between",children:[t("div",{className:"tablet:block hidden",children:t($,{className:"flex items-center justify-between",onSwiper:T,spaceBetween:12,slidesPerView:6,freeMode:!0,watchSlidesProgress:!0,modules:[K,O],children:e?.galleries?.map((a,l)=>t(B,{className:"[&.swiper-slide-thumb-active]:border-brand !w-auto cursor-pointer border border-transparent [&.swiper-slide-thumb-active]:rounded",children:t(W,{source:a.image?.url,alt:a.image?.altText,className:"lg-desktop:size-12 size-10 overflow-hidden rounded bg-white",imgClassName:"object-cover h-full"})},e?.id+"SwiperSlideThumbItem"+l))})}),!e?.index&&x("div",{className:"flex items-center gap-2",children:[t(W,{source:e?.comment?.avatar?.url,className:"laptop:size-10 size-8 shrink-0 rounded-full",imgClassName:"object-cover "}),x("div",{className:"relative max-w-[528px]",children:[t("div",{ref:k,className:"lg-desktop:text-base pointer-events-none text-sm font-bold text-[#1D1D1F] opacity-0",style:{visibility:"hidden"}}),t($,{modules:[ne],loop:y.length>1,className:"h-[44px]",direction:"vertical",autoplay:{delay:5e3,disableOnInteraction:!1},children:y.length>0?y.map((a,l)=>t(B,{children:t(J,{html:a,as:"div",className:"lg-desktop:text-base overflow-hidden text-sm font-bold text-[#1D1D1F]"})},l+"text-group")):t(B,{children:t(J,{as:"div",html:e?.comment?.content,className:"lg-desktop:text-base text-sm font-bold text-[#1D1D1F]"})})})]})]})]}),t("div",{ref:S,className:"tablet:hidden absolute inset-x-4 !bottom-[70px] z-10 text-center [&_.swiper-pagination-bullet-active]:!bg-[#080A0F] [&_.swiper-pagination-bullet]:bg-white [&_.swiper-pagination-bullet]:opacity-100"})]})});j.displayName="ProductGalleryTabImage";const xe=({src:e})=>{const r=V(null);return R(()=>{const c=r.current;c&&(c.muted=!0,c.play().catch(()=>{}))},[]),x("video",{ref:r,playsInline:!0,autoPlay:!0,loop:!0,muted:!0,controls:!0,className:"w-full mt-20 laptop:size-full laptop:mt-0 aspect-video laptop:aspect-auto object-cover",children:[t("track",{kind:"captions"}),t("source",{src:e,type:"video/mp4"}),t("source",{src:e,type:"video/webm"}),t("source",{src:e,type:"video/ogg"})]})},Te=e=>{const[r,c]=E(null),P=N(()=>{r?.isBeginning?e.onPrevTab?.():r?.slidePrev()},[r,e]),m=N(()=>{r?.isEnd?e.onNextTab?.():r?.slideNext()},[r,e]);return R(()=>{r&&e.targetSlideIndex!==null&&e.targetSlideIndex!==void 0&&(r.slideTo(e.targetSlideIndex,0),e.onSlideChange?.())},[r,e.targetSlideIndex,e]),x("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[t($,{className:"h-full",onSwiper:c,onTouchEnd:(f,S)=>{f.isBeginning&&f.swipeDirection==="prev"?P():f.isEnd&&f.swipeDirection==="next"&&m()},modules:[X,O,K,ee],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:e?.galleries?.map((f,S)=>t(B,{className:"h-full bg-info-primary",children:t(xe,{src:f?.sources?.[0]?.url})},e?.id+"SwiperSlideItem"+S))}),t("div",{className:L("swiper-button tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:left-6 z-10 hidden -translate-y-1/2 cursor-pointer"),onClick:P,children:t(ae,{className:"tablet:size-10 lg-desktop:size-12"})}),t("div",{className:L("tablet:block swiper-button tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:right-6 z-10 hidden -translate-y-1/2 cursor-pointer"),onClick:m,children:t(le,{className:"tablet:size-10 lg-desktop:size-12"})})]})},Fe=e=>t("div",{children:"3D View"});var Be=fe(he);export{Be as default};
1
+ import{jsx as t,jsxs as x}from"react/jsx-runtime";import{useAiuiContext as Z}from"../../../../AiuiProvider/index.js";import{Text as J,Picture as j,Badge as oe}from"../../../../../components/index.js";import{useCallback as S,useMemo as W,useState as E,forwardRef as Q,useRef as z,useEffect as D,useImperativeHandle as re}from"react";import{Swiper as H,SwiperSlide as B}from"swiper/react";import{Navigation as Y,Mousewheel as X,Thumbs as K,Pagination as ee,Autoplay as ne}from"swiper/modules";import{cn as L}from"../../../../../helpers/index.js";import{GalleryTabType as V}from"./types.js";import{Content as se,List as ce,Root as de,Trigger as ue}from"@radix-ui/react-tabs";import{useBizProductContext as O}from"../../../BizProductProvider.js";import{useVariantMedia as pe}from"../../../hooks/use-variant-media.js";import{SpecsModal as me}from"./components/SpecsModal.js";import be from"./components/CompareModal.js";import{formatPrice as ge}from"../../../utils/index.js";import{withLayout as fe}from"../../../../../shared/Styles.js";import{gaTrack as ve}from"../../../../../shared/track.js";import{ExposureDetector as ye}from"../../../../../components/index.js";import{debounce as te}from"es-toolkit";const ae=e=>x("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[t("rect",{x:"48",y:"48",width:"48",height:"48",rx:"24",transform:"rotate(-180 48 48)",fill:"white"}),t("path",{d:"M25.1035 16.8545C25.5372 16.3818 26.246 16.3818 26.6797 16.8545C27.1067 17.3201 27.1067 18.0706 26.6797 18.5361L21.668 24L26.6797 29.4639C27.1067 29.9294 27.1067 30.6799 26.6797 31.1455C26.246 31.6182 25.5372 31.6182 25.1035 31.1455L19.3203 24.8408C18.8933 24.3752 18.8933 23.6248 19.3203 23.1592L25.1035 16.8545Z",fill:"currentColor"})]}),le=e=>x("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[t("rect",{width:"48",height:"48",rx:"24",transform:"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)",fill:"white"}),t("path",{d:"M22.8965 16.8545C22.4628 16.3818 21.754 16.3818 21.3203 16.8545C20.8933 17.3201 20.8933 18.0706 21.3203 18.5361L26.332 24L21.3203 29.4639C20.8933 29.9294 20.8933 30.6799 21.3203 31.1455C21.754 31.6182 22.4628 31.6182 22.8965 31.1455L28.6797 24.8408C29.1067 24.3752 29.1067 23.6248 28.6797 23.1592L22.8965 16.8545Z",fill:"currentColor"})]}),he=()=>{const{copyWriting:e}=Z(),{product:o,variant:c,selectedOptions:k}=O(),g=pe({product:o,variant:c}),[f,G]=E(null),C=z(null),T=c?.metafields?.component?.custom_media_list;let v,s,w,y;T&&T?.available?(v=T?.product||[],s=T?.scenarios||[],w=T?.keyFeatures||[],y=T?.video||[]):(v=g?.productList,s=g?.sceneList,w=g?.keyFeaturesList,y=g?.videoList);const F=W(()=>[...v,...s,...y],[v,s,y]),N={productList:v,sceneList:s,keyFeaturesList:w,videoList:y},p=W(()=>{const i=o?.payload?.components?.find(n=>n.componentKey==="ProductGallery")?.data||[],b=c?.payload?.components?.find(n=>n.componentKey==="ProductGallery")?.data||[];return i?.map(n=>{const P=Array.isArray(b)?b?.find(I=>n?.galleries===I?.galleries):{};let A=N[n?.galleries]||[];if(P?.images&&Array.isArray(P.images)&&P.images.length>0){const I=P.images.map(u=>{const M=[];if(u.image_1920&&u.image_1920.trim()&&M.push(`${u.image_1920}`),u.image_1440&&u.image_1440.trim()&&M.push(`${u.image_1440} 1919`),u.image_1024&&u.image_1024.trim()&&M.push(`${u.image_1024} 1439`),u.image_768&&u.image_768.trim()&&M.push(`${u.image_768} 1023`),u.image_390&&u.image_390.trim()&&M.push(`${u.image_390} 767`),M.length>0){const U=M.join(", ");return{image:{url:U,altText:n.comment?.content||""},_fromImages:!0,_responsiveSource:U}}return null}).filter(u=>u!==null);I.length>0&&(A=I)}return{...n,galleries:A}}).filter(n=>n.galleries.length>0)},[c?.payload,N,o?.payload]),[r,d]=E(p?.[0]),[a,l]=E(0),[h,m]=E(null),_=S(()=>{const i=(a+1)%p.length;l(i),d(p[i]),m(0)},[a,p]),R=S(()=>{const i=a===0?p.length-1:a-1;l(i),d(p[i]);const b=p[i]?.galleries||[];m(b.length-1)},[a,p]);D(()=>{a!=null&&requestAnimationFrame(()=>{C.current?.scrollToTab(a)})},[a]),D(()=>{d(p[0]),l(0)},[c?.id]);const q=(i,b)=>{switch(i?.galleryTabType){case V.GALLERY_IMAGE_MAIN:return t($,{...i,index:b,onNextTab:_,onPrevTab:R,targetSlideIndex:h,onSlideChange:()=>m(null)});case V.GALLERY_IMAGE_FEATURES:return t($,{...i,index:b,onNextTab:_,onPrevTab:R,targetSlideIndex:h,onSlideChange:()=>m(null)});case V.GALLERY_IMAGE_SCENE:return t($,{...i,index:b,onNextTab:_,onPrevTab:R,targetSlideIndex:h,onSlideChange:()=>m(null)});case V.GALLERY_VIDEO:return t(Te,{...i,onNextTab:_,onPrevTab:R,targetSlideIndex:h,onSlideChange:()=>m(null)});default:return null}};return t("div",{id:"ipc-product-gallery",children:x(de,{className:"relative",value:r?.tabValue,defaultValue:p?.[0]?.tabValue,children:[t("div",{className:"tablet:h-[620px] laptop-md:rounded-2xl laptop-md:h-[560px] lg-desktop:h-[700px] laptop-md:relative h-[420px] overflow-hidden bg-[#EAEAEC] ",children:p.map((i,b)=>t(se,{className:"h-full",value:i.tabValue,children:q(i,b)},i.tabValue))}),t(ie,{ref:C,galleryTabs:p,activeGalleryTab:r,setActiveGalleryTab:d,setActiveTabIndex:l,setTargetSlideIndex:m})]})})},ie=Q((e,o)=>{const{galleryTabs:c,activeGalleryTab:k,setActiveGalleryTab:g,setActiveTabIndex:f,setTargetSlideIndex:G}=e,{product:C,compareData:T}=O(),v=z(null),s=z(new Map),w=!!C.metafields?.global?.specifications?.length,y=!!T?.specificationKeys?.length,F=S(r=>{if(v.current){const d=v.current,a=r.currentTarget,l=a.offsetLeft-d.offsetWidth/2+a.offsetWidth/2;d.scrollTo({left:l,behavior:"smooth"})}},[]),N=S((r,d,a)=>{g(d),f(a),G(0),F(r)},[g,f,G,F]),p=S(r=>{if(v.current&&c[r]){const d=v.current,a=c[r],l=s.current.get(a.tabValue);if(l){const h=l.offsetLeft-d.offsetWidth/2+l.offsetWidth/2;d.scrollTo({left:h,behavior:"smooth"})}}},[c]);return re(o,()=>({scrollToTab:p})),x("div",{className:"laptop:inset-x-16 tablet:mt-3 laptop-md:static absolute inset-x-4 bottom-4 z-[2] flex items-center justify-between",children:[t(ce,{ref:v,className:"laptop:p-0 laptop-md:p-1 overflow-x-auto rounded-full bg-[#EAEAEC] p-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t("div",{className:"whitespace-nowrap",children:c?.map((r,d)=>t(ue,{ref:a=>{a?s.current.set(r.tabValue,a):s.current.delete(r.tabValue)},className:L("lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px] rounded-full px-5 pb-[10px] pt-[11px] text-[14px] font-bold leading-tight",r.tabValue===k?.tabValue&&"bg-white"),onClick:a=>N(a,r,d),value:r.tabValue,children:r.tabLabel},r.tabValue+d))})}),(w||y)&&x("div",{className:"desktop:gap-2 desktop:flex hidden",children:[w&&t(me,{}),w&&y&&t("span",{children:"|"}),y&&t(be,{})]})]})});ie.displayName="ProductGalleryTab";const $=Q((e,o)=>{const{locale:c="us",copyWriting:k}=Z(),{variant:g,totalSavings:f,formattedPrices:G}=O(),C=z(null),[T,v]=E(null),[s,w]=E(null),[y,F]=E([]),N=z(null),p=W(()=>{if(e?.galleryTabType===V.GALLERY_IMAGE_MAIN)return"size-[240px] mx-auto mt-[42px] tablet:mt-16 tablet:size-[420px] lg-desktop:size-[560px]";e?.galleryTabType===V.GALLERY_IMAGE_FEATURES||(e?.galleryTabType,V.GALLERY_IMAGE_SCENE)},[e?.galleryTabType]),r=S(()=>{s?.isBeginning?e.onPrevTab?.():s?.slidePrev()},[s,e]),d=S(()=>{s?.isEnd?e.onNextTab?.():s?.slideNext()},[s,e]);return D(()=>{s&&e.targetSlideIndex&&(s.slideTo(e.targetSlideIndex,0),e.onSlideChange?.())},[s,e.targetSlideIndex,e]),D(()=>{const a=()=>{if(!e?.comment?.content||!N.current)return;const m=N.current;m.textContent="Test";const R=m.offsetHeight*2+2,i=e.comment.content.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim().split(" "),b=[];let n="";for(let P=0;P<i.length;P++){const A=i[P],I=n?`${n} ${A}`:A;m.textContent=I,m.offsetHeight>R?n?(b.push(n),n=A):(b.push(A),n=""):n=I}n&&b.push(n),m.textContent="",F(b)},l=requestAnimationFrame(()=>{requestAnimationFrame(()=>{a()})}),h=()=>{a()};return window.addEventListener("resize",te(h,500)),()=>{cancelAnimationFrame(l),window.removeEventListener("resize",te(h,500))}},[e?.comment?.content]),x("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[t(H,{ref:o,className:"h-full",onSwiper:w,onTouchEnd:(a,l)=>{a.isBeginning&&a.swipeDirection==="prev"?r():a.isEnd&&a.swipeDirection==="next"&&d()},pagination:{clickable:!0,el:C.current},thumbs:{swiper:T},modules:[X,K,Y,ee],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:e?.galleries?.map((a,l)=>{const h=`${e.tabValue}-${l}`,m=()=>{ve({event:"ga4Event",event_name:"component_impression",event_parameters:{page_group:`Product Detail Page${g.sku}`,component_type:"image",component_name:e?.tabLabel||"",position:l+1,creative_id:"",component_title:"",component_description:"",navigation:""}})},_=a?._responsiveSource||a?.image?.url||"";return t(B,{className:"h-full",children:t(ye,{onExposure:m,exposureKey:h,threshold:.5,duration:2e3,className:"h-full",children:t(j,{source:_,alt:a?.image?.altText,className:L("h-full",p),imgClassName:"object-cover h-full"})})},e?.id+"SwiperSlideItem"+l)})}),g.availableForSale&&!!f&&!e.index&&t(oe,{size:"lg",className:"bg-brand-0 laptop:left-16 laptop:top-5 laptop-md:left-6 laptop-md:top-6 absolute left-4 top-3 z-[2] text-white",children:`${G?.totalSavings??ge({amount:f,currencyCode:g?.price?.currencyCode,locale:c})} ${k?.off}`}),t("div",{className:L("tablet:opacity-0 tablet:block tablet:absolute tablet:top-1/2 laptop:left-16 tablet:left-6 laptop-md:left-6 z-10 hidden -translate-y-1/2 cursor-pointer","swiper-button"),onClick:r,children:t(ae,{className:L("tablet:size-10 lg-desktop:size-12")})}),t("div",{className:L("tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 laptop:right-16 tablet:right-6 laptop-md:right-6 z-10 hidden -translate-y-1/2 cursor-pointer","swiper-button"),onClick:d,children:t(le,{className:L("tablet:size-10 lg-desktop:size-12")})}),x("div",{className:"tablet:bottom-[70px] tablet:flex laptop:inset-x-16 laptop-md:bottom-[20px] laptop-md:inset-x-6 absolute inset-x-4 bottom-[94px] z-10 items-center justify-between",children:[t("div",{className:"tablet:block hidden",children:t(H,{className:"flex items-center justify-between",onSwiper:v,spaceBetween:12,slidesPerView:6,freeMode:!0,watchSlidesProgress:!0,modules:[Y,K],children:e?.galleries?.map((a,l)=>t(B,{className:"[&.swiper-slide-thumb-active]:border-brand !w-auto cursor-pointer border border-transparent [&.swiper-slide-thumb-active]:rounded",children:t(j,{source:a.image?.url,alt:a.image?.altText,className:"lg-desktop:size-12 size-10 overflow-hidden rounded bg-white",imgClassName:"object-cover h-full"})},e?.id+"SwiperSlideThumbItem"+l))})}),!e?.index&&x("div",{className:"flex items-center gap-2",children:[t(j,{source:e?.comment?.avatar?.url,className:"laptop:size-10 size-8 shrink-0 rounded-full",imgClassName:"object-cover "}),x("div",{className:"relative max-w-[528px]",children:[t("div",{ref:N,className:"lg-desktop:text-base pointer-events-none text-sm font-bold text-[#1D1D1F] opacity-0",style:{visibility:"hidden"}}),t(H,{modules:[ne],loop:y.length>1,className:"h-[44px]",direction:"vertical",autoplay:{delay:5e3,disableOnInteraction:!1},children:y.length>0?y.map((a,l)=>t(B,{children:t(J,{html:a,as:"div",className:"lg-desktop:text-base overflow-hidden text-sm font-bold text-[#1D1D1F]"})},l+"text-group")):t(B,{children:t(J,{as:"div",html:e?.comment?.content,className:"lg-desktop:text-base text-sm font-bold text-[#1D1D1F]"})})})]})]})]}),t("div",{ref:C,className:"tablet:hidden absolute inset-x-4 !bottom-[70px] z-10 text-center [&_.swiper-pagination-bullet-active]:!bg-[#080A0F] [&_.swiper-pagination-bullet]:bg-white [&_.swiper-pagination-bullet]:opacity-100"})]})});$.displayName="ProductGalleryTabImage";const xe=({src:e})=>{const o=z(null);return D(()=>{const c=o.current;c&&(c.muted=!0,c.play().catch(()=>{}))},[]),x("video",{ref:o,playsInline:!0,autoPlay:!0,loop:!0,muted:!0,controls:!0,className:"w-full mt-20 laptop:size-full laptop:mt-0 aspect-video laptop:aspect-auto object-cover",children:[t("track",{kind:"captions"}),t("source",{src:e,type:"video/mp4"}),t("source",{src:e,type:"video/webm"}),t("source",{src:e,type:"video/ogg"})]})},Te=e=>{const[o,c]=E(null),k=S(()=>{o?.isBeginning?e.onPrevTab?.():o?.slidePrev()},[o,e]),g=S(()=>{o?.isEnd?e.onNextTab?.():o?.slideNext()},[o,e]);return D(()=>{o&&e.targetSlideIndex!==null&&e.targetSlideIndex!==void 0&&(o.slideTo(e.targetSlideIndex,0),e.onSlideChange?.())},[o,e.targetSlideIndex,e]),x("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[t(H,{className:"h-full",onSwiper:c,onTouchEnd:(f,G)=>{f.isBeginning&&f.swipeDirection==="prev"?k():f.isEnd&&f.swipeDirection==="next"&&g()},modules:[X,K,Y,ee],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:e?.galleries?.map((f,G)=>t(B,{className:"h-full bg-info-primary",children:t(xe,{src:f?.sources?.[0]?.url})},e?.id+"SwiperSlideItem"+G))}),t("div",{className:L("swiper-button tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:left-6 z-10 hidden -translate-y-1/2 cursor-pointer"),onClick:k,children:t(ae,{className:"tablet:size-10 lg-desktop:size-12"})}),t("div",{className:L("tablet:block swiper-button tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:right-6 z-10 hidden -translate-y-1/2 cursor-pointer"),onClick:g,children:t(le,{className:"tablet:size-10 lg-desktop:size-12"})})]})},Fe=e=>t("div",{children:"3D View"});var Be=fe(he);export{Be as default};
@@ -1 +1 @@
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
+ "use client";import{jsx as e,jsxs as l}from"react/jsx-runtime";import{useRef as o}from"react";import{Grid as c,GridItem as a}from"../../../../components/index.js";import{useStickyFlip as r}from"../../hooks/useStickyFlip.js";const s=({BoxLeftGallery:i,BoxRightDetail:d,BoxBottomSummary:m})=>{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-grid",children:[l(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:[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:i}),e(a,{ref:p,className:"ipc-box-right-grid-item laptop-md:col-start-9 laptop-md:col-span-4 col-span-12",children:d})]}),m]})};var x=s;export{x as default};
@@ -1 +1 @@
1
- import{jsx as t,jsxs as l}from"react/jsx-runtime";import{Text as s,Button as K,Grid as U,GridItem as M,Picture as T,Heading as X}from"../../../../../components/index.js";import{useBizProductContext as B}from"../../../BizProductProvider.js";import{useComponentData as Y}from"../../../hooks/useComponentData.js";import{useEffect as Z,useMemo as N,useState as tt}from"react";import{formatPrice as h}from"../../../utils/index.js";import{useAiuiContext as V}from"../../../../AiuiProvider/index.js";import et from"decimal.js";import{replaceTemplate as at}from"../../../utils/textFormat.js";import{withLayout as ot}from"../../../../../shared/Styles.js";import{ExposureDetector as lt}from"../../../../../components/index.js";import{gaTrack as it}from"../../../../../shared/track.js";import rt from"../../CartActionButtons/index.js";const nt=()=>{const{locale:p="us",copyWriting:r,trackingData:f}=V(),{product:m,variant:e,finalPrice:d,comparePrice:x,coupon:C,selectedOptions:n,selectedVariants:g,totalSavings:k,onAddToCart:P,onBuyNow:w,savingDetail:c,checkedBundle:v,joinedRecommendBuyProducts:a,setJoinedRecommendBuyProducts:$,setSavingDetail:ct,addToCartLoading:I,buyNowLoading:R,notifyMeMode:q,onNotifyMeClick:W,profile:A,addOrder:D,setAddOrder:S}=B(),_=f?.showComparePrice??!0,b=Y("ProductSummary")??{},[G]=g,j=N(()=>{let o=new et(G?.price?.amount||0);A?.email&&(o=o.minus(c?.member||0));const i=o.minus(c?.coupon).toNumber();return parseFloat(i.toFixed(2))},[G,v,A,c?.member,c?.coupon]),{giftVariant:z}=st()||{},[u,O]=tt();Z(()=>{O({gift:a.gift?.value?void 0:z})},[z,a]);const J=N(()=>{const o=[];return D&&D.forEach((i,y)=>{a[i]?.value&&o.push({type:i,key:`${i}-${y}`})}),o},[D,a]),Q=N(()=>{const o=n?.quantity||"",i=n?.color||n?.colour||n?.couleur||"";return`${o&&i?`${o} | ${i}`:o||i}`},[n?.quantity,n?.color,n?.colour,n?.couleur]),H=N(()=>{const{image_1920:o,image_1440:i,image_1024:y,image_768:E,image_390:F}=b?.thumbnail||{};return(b?.thumbnail?`${o} 1920, ${i} 1440, ${y} 1024, ${E} 768, ${F} 390`:e.image?.url)||e.image?.url},[b?.thumbnail,e.image?.url]);return e.availableForSale?t("div",{className:"ipc-product-summary laptop:px-16 laptop-md:px-0 laptop-md:mt-[96px] lg-desktop:mt-[128px] mt-16",children:t("div",{className:"laptop:rounded-2xl bg-[#F5F5F7]",children:l(U,{className:"tablet:p-8 tablet:!pb-0 px-4 pt-6",children:[l(M,{className:"laptop:col-start-1 laptop:col-span-5 col-span-12 flex flex-col justify-between gap-4",children:[t(X,{className:"lg-desktop:text-[48px] laptop:text-[32px] laptop-md:text-[40px] mb-4 text-[24px] font-bold leading-none [&>span]:text-[#D1D1D1]",html:b?.readyWant?.replace?.("{title}",m?.title)}),t("div",{className:"",children:t(T,{source:H,className:"lg-desktop:aspect-[644/320] laptop-md:aspect-[503/270] laptop:aspect-[332/190] tablet:aspect-[704/380] aspect-[358/190]",imgClassName:"object-cover h-full"})})]}),l(M,{className:"tablet:pb-8 laptop:col-start-7 laptop:mt-0 laptop:col-span-6 col-span-12 mt-8 flex flex-col justify-between gap-6 pb-6",children:[l("div",{children:[l("div",{className:"flex flex-col gap-4",children:[t(lt,{exposureKey:"listing_selector",onExposure:()=>{it({event:"ga4Event",event_name:"component_impression",event_parameters:{page_group:`Product Detail Page${e.sku}`,component_type:"image",component_name:"listing_selector",position:1}})},children:l("div",{className:"flex items-center justify-between gap-6",children:[l("div",{className:"flex items-center gap-4",children:[t(T,{source:e.image?.url||m?.images?.[0]?.url,className:"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2"}),l("div",{className:"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]",children:[t(s,{className:"laptop-md:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold",html:m.title}),t(s,{className:"laptop:text-[14px] laptop-md:text-[18px] text-[12px] font-bold text-[#6D6D6F]",html:Q})]})]}),l("div",{className:"flex items-center gap-1",children:[t(s,{className:"laptop-md:text-2xl text-base font-bold",html:h({amount:j,currencyCode:e.price.currencyCode,locale:p})}),_&&j<e?.price?.amount&&t(s,{className:"laptop-md:text-2xl laptop:text-xl text-base font-bold text-[#6D6D6F] line-through",html:h({amount:e?.price?.amount,currencyCode:e.price.currencyCode,locale:p})})]})]})}),J.map(({type:o,key:i})=>o==="gift"&&a?.gift?.value?t(L,{giftOperation:y=>{$?.({...a,gift:{value:void 0,canOperate:!0}}),O?.({...u,gift:y}),S?.(E=>E.filter(F=>F!=="gift"))},status:!!a?.gift,gift:a?.gift?.value,canOperate:a?.gift?.canOperate},i):null)]}),u?.gift&&l("div",{className:"laptop-md:mt-8 mt-6",children:[t(s,{className:"laptop-md:text-[18px] text-sm font-bold",html:b?.recommendBuy}),t("div",{className:"laptop-md:gap-4 mt-4 flex flex-col gap-6",children:u?.gift&&t(L,{giftOperation:o=>{$?.({...a,gift:{value:o,canOperate:!0}}),O?.({...u,gift:void 0}),S?.(i=>[...i,"gift"])},canOperate:a?.gift?.canOperate,status:!u?.gift,gift:u?.gift})})]})]}),l("div",{className:"text-right",children:[t(s,{className:"laptop:text-xl laptop-md:text-2xl text-right font-bold",html:`${at(r?.totalPrice||"",{amount:h({amount:parseFloat(d.toFixed(2)),currencyCode:e.price.currencyCode,locale:p})})}`}),_&&k>0&&t(s,{className:"laptop:text-xl laptop-md:text-2xl ml-1 text-base font-bold text-[#6D6D6F] line-through",html:h({amount:x,currencyCode:e.price.currencyCode,locale:p})}),t("div",{className:"mt-4 flex justify-end gap-3",children:t(rt,{mode:q,availableForSale:e.availableForSale,addToCartText:r?.addToCart,buyNowText:r?.shopNow,addToCartLoading:I,buyNowLoading:R,addToCartClassName:"tablet:w-auto laptop:w-1/2 laptop-md:w-auto w-1/2",buyNowClassName:"tablet:w-auto laptop:w-1/2 laptop-md:w-auto w-1/2",onAddToCart:P,onBuyNow:w,onNotifyMeClick:W,notifyMeText:r?.notifyMe,notifyMeClassName:"tablet:w-auto laptop:w-1/2 laptop-md:w-auto w-1/2"})})]})]})]})})}):null},st=()=>{const{bundle:p,variant:r,checkedBundle:f,freeGift:m,checkedGift:e}=B();let d;const{giftList:x=[]}=m||{},[C]=x?.filter(n=>n.availableForSale)??[];return d=e||C,{giftVariant:d}},L=({giftOperation:p,gift:r,status:f,canOperate:m})=>{const{locale:e="us",copyWriting:d}=V(),{freeGift:x,setCheckedGift:C}=B(),{freeLabel:n}=x||{},{options:g}=r||{},k=N(()=>{const P=g?.find(a=>a.name==="color"||a.name==="colour"||a.name==="couleur")||{},w=g?.find(a=>a.name==="quantity")||{},c=P?P.values?.[0]?.label:"",v=w?w.values?.[0]?.label:"";return`${c&&v?v+" | "+c:v||c} | ${n}`},[n,g]);return l("div",{className:"flex items-center justify-between gap-6",children:[l("div",{className:"flex items-center gap-4",children:[t(T,{source:r?.image?.url,className:"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2"}),l("div",{className:"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]",children:[t(s,{className:"laptop-md:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold",html:r?.product?.title}),t(s,{className:"laptop:text-[14px] laptop-md:text-[18px] text-[12px] font-bold text-[#6D6D6F]",html:k})]})]}),l("div",{className:"flex flex-col items-end justify-center gap-2",children:[!!r&&l("div",{className:"flex items-center gap-1",children:[t(s,{className:"laptop-md:text-2xl text-base font-bold",html:n}),t(s,{className:"laptop-md:text-2xl text-base font-bold text-[#6D6D6F] line-through",html:h({amount:r.price.amount,locale:e,currencyCode:r.price.currencyCode})})]}),m&&t(K,{size:"icon",variant:"link",onClick:()=>{C?.(f?void 0:r),p(r)},className:"size-auto shrink-0 underline",children:f?d?.remove:d?.add})]})]})};var wt=ot(nt);export{wt as default};
1
+ import{jsx as t,jsxs as a}from"react/jsx-runtime";import{Text as s,Button as X,Grid as Y,GridItem as M,Picture as S,Heading as Z}from"../../../../../components/index.js";import{useBizProductContext as A}from"../../../BizProductProvider.js";import{useComponentData as tt}from"../../../hooks/useComponentData.js";import{useEffect as et,useMemo as y,useState as at}from"react";import{formatPrice as V}from"../../../utils/index.js";import{useAiuiContext as I}from"../../../../AiuiProvider/index.js";import{replaceTemplate as ot}from"../../../utils/textFormat.js";import{calcSummaryFinalPrice as lt}from"../../../utils/priceCalc.js";import{withLayout as it}from"../../../../../shared/Styles.js";import{ExposureDetector as rt}from"../../../../../components/index.js";import{gaTrack as nt}from"../../../../../shared/track.js";import st from"../../CartActionButtons/index.js";const ct=()=>{const{locale:N="us",copyWriting:o,trackingData:u}=I(),{product:p,variant:l,finalPrice:m,comparePrice:f,coupon:h,selectedOptions:i,selectedVariants:x,totalSavings:k,onAddToCart:P,onBuyNow:w,savingDetail:c,checkedBundle:g,joinedRecommendBuyProducts:e,setJoinedRecommendBuyProducts:B,setSavingDetail:mt,addToCartLoading:q,buyNowLoading:W,notifyMeMode:J,onNotifyMeClick:Q,profile:$,addOrder:O,setAddOrder:_,formattedPrices:D}=A(),C=r=>V({amount:r,currencyCode:l.price.currencyCode,locale:N}),G=u?.showComparePrice??!0,v=tt("ProductSummary")??{},[j]=x,z=y(()=>lt({price:j?.price?.amount||0,memberSaving:c?.member,couponSaving:c?.coupon,isLogin:!!$?.email}),[j,g,$,c?.member,c?.coupon]),{giftVariant:L}=pt()||{},[d,E]=at();et(()=>{E({gift:e.gift?.value?void 0:L})},[L,e]);const H=y(()=>{const r=[];return O&&O.forEach((n,b)=>{e[n]?.value&&r.push({type:n,key:`${n}-${b}`})}),r},[O,e]),K=y(()=>{const r=i?.quantity||"",n=i?.color||i?.colour||i?.couleur||"";return`${r&&n?`${r} | ${n}`:r||n}`},[i?.quantity,i?.color,i?.colour,i?.couleur]),U=y(()=>{const{image_1920:r,image_1440:n,image_1024:b,image_768:F,image_390:T}=v?.thumbnail||{};return(v?.thumbnail?`${r} 1920, ${n} 1440, ${b} 1024, ${F} 768, ${T} 390`:l.image?.url)||l.image?.url},[v?.thumbnail,l.image?.url]);return l.availableForSale?t("div",{className:"ipc-product-summary laptop:px-16 laptop-md:px-0 laptop-md:mt-[96px] lg-desktop:mt-[128px] mt-16",children:t("div",{className:"laptop:rounded-2xl bg-[#F5F5F7]",children:a(Y,{className:"tablet:p-8 tablet:!pb-0 px-4 pt-6",children:[a(M,{className:"laptop:col-start-1 laptop:col-span-5 col-span-12 flex flex-col justify-between gap-4",children:[t(Z,{className:"lg-desktop:text-[48px] laptop:text-[32px] laptop-md:text-[40px] mb-4 text-[24px] font-bold leading-none [&>span]:text-[#D1D1D1]",html:v?.readyWant?.replace?.("{title}",p?.title)}),t("div",{className:"",children:t(S,{source:U,className:"lg-desktop:aspect-[644/320] laptop-md:aspect-[503/270] laptop:aspect-[332/190] tablet:aspect-[704/380] aspect-[358/190]",imgClassName:"object-cover h-full"})})]}),a(M,{className:"tablet:pb-8 laptop:col-start-7 laptop:mt-0 laptop:col-span-6 col-span-12 mt-8 flex flex-col justify-between gap-6 pb-6",children:[a("div",{children:[a("div",{className:"flex flex-col gap-4",children:[t(rt,{exposureKey:"listing_selector",onExposure:()=>{nt({event:"ga4Event",event_name:"component_impression",event_parameters:{page_group:`Product Detail Page${l.sku}`,component_type:"image",component_name:"listing_selector",position:1}})},children:a("div",{className:"flex items-center justify-between gap-6",children:[a("div",{className:"flex items-center gap-4",children:[t(S,{source:l.image?.url||p?.images?.[0]?.url,className:"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2"}),a("div",{className:"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]",children:[t(s,{className:"laptop-md:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold",html:p.title}),t(s,{className:"laptop:text-[14px] laptop-md:text-[18px] text-[12px] font-bold text-[#6D6D6F]",html:K})]})]}),a("div",{className:"flex items-center gap-1",children:[t(s,{className:"laptop-md:text-2xl text-base font-bold",html:D?.summaryFinalPrice??C(z)}),G&&z<l?.price?.amount&&t(s,{className:"laptop-md:text-2xl laptop:text-xl text-base font-bold text-[#6D6D6F] line-through",html:l?.price?.formattedAmount??C(l?.price?.amount)})]})]})}),H.map(({type:r,key:n})=>r==="gift"&&e?.gift?.value?t(R,{giftOperation:b=>{B?.({...e,gift:{value:void 0,canOperate:!0}}),E?.({...d,gift:b}),_?.(F=>F.filter(T=>T!=="gift"))},status:!!e?.gift,gift:e?.gift?.value,canOperate:e?.gift?.canOperate},n):null)]}),d?.gift&&a("div",{className:"laptop-md:mt-8 mt-6",children:[t(s,{className:"laptop-md:text-[18px] text-sm font-bold",html:v?.recommendBuy}),t("div",{className:"laptop-md:gap-4 mt-4 flex flex-col gap-6",children:d?.gift&&t(R,{giftOperation:r=>{B?.({...e,gift:{value:r,canOperate:!0}}),E?.({...d,gift:void 0}),_?.(n=>[...n,"gift"])},canOperate:e?.gift?.canOperate,status:!d?.gift,gift:d?.gift})})]})]}),a("div",{className:"text-right",children:[t(s,{className:"laptop:text-xl laptop-md:text-2xl text-right font-bold",html:`${ot(o?.totalPrice||"",{amount:D?.finalPrice??C(parseFloat(m.toFixed(2)))})}`}),G&&k>0&&t(s,{className:"laptop:text-xl laptop-md:text-2xl ml-1 text-base font-bold text-[#6D6D6F] line-through",html:D?.comparePrice??C(f)}),t("div",{className:"mt-4 flex justify-end gap-3",children:t(st,{mode:J,availableForSale:l.availableForSale,addToCartText:o?.addToCart,buyNowText:o?.shopNow,addToCartLoading:q,buyNowLoading:W,addToCartClassName:"tablet:w-auto laptop:w-1/2 laptop-md:w-auto w-1/2",buyNowClassName:"tablet:w-auto laptop:w-1/2 laptop-md:w-auto w-1/2",onAddToCart:P,onBuyNow:w,onNotifyMeClick:Q,notifyMeText:o?.notifyMe,notifyMeClassName:"tablet:w-auto laptop:w-1/2 laptop-md:w-auto w-1/2"})})]})]})]})})}):null},pt=()=>{const{bundle:N,variant:o,checkedBundle:u,freeGift:p,checkedGift:l}=A();let m;const{giftList:f=[]}=p||{},[h]=f?.filter(i=>i.availableForSale)??[];return m=l||h,{giftVariant:m}},R=({giftOperation:N,gift:o,status:u,canOperate:p})=>{const{locale:l="us",copyWriting:m}=I(),{freeGift:f,setCheckedGift:h}=A(),{freeLabel:i}=f||{},{options:x}=o||{},k=y(()=>{const P=x?.find(e=>e.name==="color"||e.name==="colour"||e.name==="couleur")||{},w=x?.find(e=>e.name==="quantity")||{},c=P?P.values?.[0]?.label:"",g=w?w.values?.[0]?.label:"";return`${c&&g?g+" | "+c:g||c} | ${i}`},[i,x]);return a("div",{className:"flex items-center justify-between gap-6",children:[a("div",{className:"flex items-center gap-4",children:[t(S,{source:o?.image?.url,className:"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2"}),a("div",{className:"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]",children:[t(s,{className:"laptop-md:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold",html:o?.product?.title}),t(s,{className:"laptop:text-[14px] laptop-md:text-[18px] text-[12px] font-bold text-[#6D6D6F]",html:k})]})]}),a("div",{className:"flex flex-col items-end justify-center gap-2",children:[!!o&&a("div",{className:"flex items-center gap-1",children:[t(s,{className:"laptop-md:text-2xl text-base font-bold",html:i}),t(s,{className:"laptop-md:text-2xl text-base font-bold text-[#6D6D6F] line-through",html:o.price.formattedAmount??V({amount:o.price.amount,locale:l,currencyCode:o.price.currencyCode})})]}),p&&t(X,{size:"icon",variant:"link",onClick:()=>{h?.(u?void 0:o),N(o)},className:"size-auto shrink-0 underline",children:u?m?.remove:m?.add})]})]})};var Ot=it(ct);export{Ot as default};
@@ -1 +1 @@
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};
1
+ import{jsx as t,jsxs as u}from"react/jsx-runtime";import{Text as r,Container as E}from"../../../../../components/index.js";import{useAiuiContext as O}from"../../../../AiuiProvider/index.js";import{useBizProductContext as U}from"../../../BizProductProvider.js";import{useMemo as C}from"react";import{formatPrice as _}from"../../../utils/index.js";import{replaceTemplate as y}from"../../../utils/textFormat.js";import{calcUnlockedSaving as j}from"../../../utils/priceCalc.js";import{useBenefits as q}from"../../../hooks/useBenefits.js";import z from"../../CartActionButtons/index.js";const W=({totalSavingsSlot:N,renderComparePrice:x}={})=>{const{copyWriting:e,locale:d="us",trackingData:h,currencyCode:S}=O(),{variant:o,finalPrice:w,totalSavings:n,isLogin:s,comparePrice:b,onAddToCart:P,onBuyNow:k,savingDetail:p,addToCartLoading:T,buyNowLoading:M,notifyMeMode:A,onNotifyMeClick:B,discount:$,memberFunctionResult:f,formattedPrices:a}=U(),F=q({variant:o}),{commonCoupon:i,memberDiscount:l}=F,D=h?.showComparePrice??!0,c=m=>_({amount:m,currencyCode:o.price.currencyCode,locale:S==="CAD"?"us":d||"us"}),R=C(()=>y(e?.totalSavings||"",{amount:a?.totalSavings??c(n)}),[e?.totalSavings,n,o.price.currencyCode,d,a?.totalSavings]),g=C(()=>{if(!e?.unlockedSaving)return;const m=i?.enable?Number(i?.config?.fixed_value||0):0,L=l?.enable?l.config?.amount??0:0,v=j({memberSaving:L,couponSaving:m,exclusive:!!f?.withoutCouponMaxMemberTotalSave});if(!(v<=0))return y(e.unlockedSaving,{amount:a?.unlockedSaving??c(v)})},[e?.unlockedSaving,i?.enable,i?.config?.fixed_value,l?.enable,l?.config?.amount,f,o.price.currencyCode,d,a?.unlockedSaving]);return u(E,{childClassName:"tablet:flex tablet:justify-end tablet:gap-8 laptop-md:px-0 desktop:px-0 lg-desktop:px-grid tablet:items-center tablet:gap-4",className:"laptop-md:border-none laptop-md:py-0 border-t border-[#E4E5E6] bg-white py-3",children:[o.availableForSale?u("div",{className:"ipc-purchase-bar-price laptop-md:items-end flex flex-col justify-between",children:[u("div",{className:"ipc-purchase-bar-price-row flex items-center gap-1",children:[t(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:a?.finalPrice??c(parseFloat(w.toFixed(2)))}),x?x({comparePrice:b}):D&&(n>0||p?.member>0&&s)&&t(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:a?.comparePrice??c(b)}),p?.member>0&&s&&t(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||(n>0||p?.member>0&&s?t(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}`}):g?t(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:g}):null)]}):t(r,{className:"text-[20px] font-bold text-[#999999]",html:e?.soldOut??"Sold Out"}),t("div",{className:"tablet:mt-0 mt-2 flex items-center gap-2",children:t(z,{mode:A,availableForSale:o.availableForSale,addToCartText:e?.addToCart??"Add to Cart",buyNowText:e?.buyNow??"Buy Now",addToCartLoading:T,buyNowLoading:M,onAddToCart:P,onBuyNow:k,onNotifyMeClick:B,notifyMeText:e?.notifyMe,notifyMeClassName:"w-full"})})]})};var Z=W;export{Z as default};
@@ -1 +1 @@
1
- import{useBizProductContext as P}from"../BizProductProvider.js";import{checkItemAvailableForProduct as C}from"../utils/helper.js";import{useDiscountEnable as h}from"./useDiscountEnable.js";import{useAiuiContext as G}from"../../AiuiProvider/index.js";const R=({variant:e})=>{const{coupon:i,product:a,bundle:c,freeGift:r,functionFreeGift:f,memberFunctionResult:t,creditsRedemption:m,profile:p}=P(),{amount:l}=m??{},{trackingData:o}=G(),d=Math.max(t?.withCouponMemberTotalSave??0,t?.withoutCouponMaxMemberTotalSave??0),u=h({profile:p,variant:e,memberFunctionResult:t,coupon:i}),g=!!(o?.paidShipping&&e.requiresShipping&&!e?.metafields?.global?.presell&&!e?.metafields?.global?.HideShipping),s=o?.freeGift,b=s?.excludeProducts?.map(n=>typeof n=="object"&&"sku"in n?n.sku:n)??[],B=o?.levelDiscount&&C({product:a,variant:e,item:o?.levelDiscount});return{commonCoupon:{enable:u.showCommonCoupon&&!!i,config:i??{}},freeGift:{enable:!!r&&!!r?.giftList?.length,config:r},functionFreeGift:{enable:!!f&&!!f?.giftItems?.length,config:f},bundle:{enable:!!c&&!!c?.bundleOptions?.length,config:c},memberDiscount:{enable:u.showMemberDiscount,config:{amount:d,description:t?.labels?.[0]}},creditsRedemption:{enable:!!l&&l>0,config:{amount:l,label:o?.creditsRedemptionLabel}},paidShipping:{enable:g,config:{}},fullGift:{enable:!!(s&&!b.includes(e.sku)),config:s??{}},levelDiscount:{enable:!!B,config:o?.levelDiscount??{}}}};export{R as useBenefits};
1
+ import{useBizProductContext as C}from"../BizProductProvider.js";import{checkItemAvailableForProduct as h}from"../utils/helper.js";import{useDiscountEnable as G}from"./useDiscountEnable.js";import{useAiuiContext as D}from"../../AiuiProvider/index.js";const x=({variant:e})=>{const{coupon:i,product:a,bundle:r,freeGift:c,functionFreeGift:f,memberFunctionResult:o,creditsRedemption:s,profile:d,formattedPrices:p}=C(),{amount:u}=s??{},{trackingData:t}=D(),g=Math.max(o?.withCouponMemberTotalSave??0,o?.withoutCouponMaxMemberTotalSave??0),m=G({profile:d,variant:e,memberFunctionResult:o,coupon:i}),b=!!(t?.paidShipping&&e.requiresShipping&&!e?.metafields?.global?.presell&&!e?.metafields?.global?.HideShipping),l=t?.freeGift,B=l?.excludeProducts?.map(n=>typeof n=="object"&&"sku"in n?n.sku:n)??[],P=t?.levelDiscount&&h({product:a,variant:e,item:t?.levelDiscount});return{commonCoupon:{enable:m.showCommonCoupon&&!!i,config:i??{}},freeGift:{enable:!!c&&!!c?.giftList?.length,config:c},functionFreeGift:{enable:!!f&&!!f?.giftItems?.length,config:f},bundle:{enable:!!r&&!!r?.bundleOptions?.length,config:r},memberDiscount:{enable:m.showMemberDiscount,config:{amount:g,formattedAmount:p?.memberDiscount,description:o?.labels?.[0]}},creditsRedemption:{enable:!!u&&u>0,config:{amount:u,formattedAmount:s?.formattedAmount,label:t?.creditsRedemptionLabel}},paidShipping:{enable:b,config:{}},fullGift:{enable:!!(l&&!B.includes(e.sku)),config:l??{}},levelDiscount:{enable:!!P,config:t?.levelDiscount??{}}}};export{x as useBenefits};
@@ -3,6 +3,11 @@ import { DiscountType } from '../const.js';
3
3
  export type ProductPrice = {
4
4
  amount: number;
5
5
  currencyCode: CurrencyCode;
6
+ /**
7
+ * 宿主已格式化好的金额(含货币符号)。传入后组件直接展示;
8
+ * 未传入时回退到组件库内置的 formatPrice(旧逻辑)。
9
+ */
10
+ formattedAmount?: string;
6
11
  };
7
12
  export type ProductOption = {
8
13
  __typename?: 'MultipleChoiceOption';
@@ -98,6 +103,10 @@ export type VariantCoupon = {
98
103
  fixed_value: string;
99
104
  value_style: string;
100
105
  variant_price4wscode: number;
106
+ /** 宿主已格式化的固定减免金额(取绝对值,含货币符号)。未传入时回退到内置 formatPrice */
107
+ formattedFixedValue?: string;
108
+ /** 宿主已格式化的 variant_price4wscode(含货币符号)。未传入时回退到内置 formatPrice */
109
+ formattedVariantPrice4wscode?: string;
101
110
  discount_type: string;
102
111
  amazon_deal: boolean;
103
112
  cdi_id: number;
@@ -19,6 +19,25 @@ export type CompareData = {
19
19
  };
20
20
  show: boolean;
21
21
  };
22
+ /**
23
+ * 宿主已格式化好的价格字符串(含货币符号)。
24
+ * 每个字段都是可选的:传入则组件直接展示;未传入则该处回退到组件库内置的 formatPrice(旧逻辑)。
25
+ * 字段对应的数字请通过 `utils/priceCalc` 或 context 中的同名数字字段获取。
26
+ */
27
+ export type ListingFormattedPrices = {
28
+ /** 对应 context.finalPrice(取 2 位小数) */
29
+ finalPrice?: string;
30
+ /** 对应 context.comparePrice */
31
+ comparePrice?: string;
32
+ /** 对应 context.totalSavings */
33
+ totalSavings?: string;
34
+ /** 对应 calcSummaryFinalPrice() 的结果(ProductSummary 当前商品最终价) */
35
+ summaryFinalPrice?: string;
36
+ /** 对应 calcUnlockedSaving() 的结果(ProductActions 已解锁节省),结果 <= 0 时不会展示 */
37
+ unlockedSaving?: string;
38
+ /** 对应会员折扣金额 max(withCouponMemberTotalSave, withoutCouponMaxMemberTotalSave) */
39
+ memberDiscount?: string;
40
+ };
22
41
  export type DiscountData = {
23
42
  memberFunctionSaving: number;
24
43
  codeSavings: number;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * 价格相关的纯数字计算。只返回 number,不做任何格式化。
3
+ * 宿主可调用这些函数拿到与组件内部一致的金额,再自行格式化后通过 `formattedPrices` 传入。
4
+ */
5
+ /**
6
+ * ProductSummary 中「当前商品最终价」。
7
+ * = 商品价 - (已登录 ? 会员节省 : 0) - 优惠券节省,保留 2 位小数。
8
+ */
9
+ export declare function calcSummaryFinalPrice({ price, memberSaving, couponSaving, isLogin, }: {
10
+ /** 当前商品原价,即 selectedVariants[0].price.amount */
11
+ price: number;
12
+ /** savingDetail.member */
13
+ memberSaving?: number;
14
+ /** savingDetail.coupon */
15
+ couponSaving?: number;
16
+ /** 是否已登录,对应组件内 `Boolean(profile?.email)` */
17
+ isLogin: boolean;
18
+ }): number;
19
+ /**
20
+ * ProductActions 中「已解锁的节省金额」。
21
+ * 不可叠加时取会员与 code 折扣的较大值,可叠加时取二者之和,保留 2 位小数。
22
+ */
23
+ export declare function calcUnlockedSaving({ memberSaving, couponSaving, exclusive, }: {
24
+ memberSaving: number;
25
+ couponSaving: number;
26
+ /** 对应 `Boolean(memberFunctionResult?.withoutCouponMaxMemberTotalSave)` */
27
+ exclusive: boolean;
28
+ }): number;
@@ -0,0 +1 @@
1
+ import i from"decimal.js";function a({price:e,memberSaving:n=0,couponSaving:r=0,isLogin:o}){let u=new i(e||0);o&&(u=u.minus(n||0));const m=u.minus(r).toNumber();return parseFloat(m.toFixed(2))}function c({memberSaving:e,couponSaving:n,exclusive:r}){return Math.round((r?Math.max(e,n):e+n)*100)/100}export{a as calcSummaryFinalPrice,c as calcUnlockedSaving};
@@ -1 +1 @@
1
- "use client";import{jsx as o,jsxs as c}from"react/jsx-runtime";import{useState as _,useEffect as y,useCallback as q,forwardRef as U,useImperativeHandle as W,useRef as h}from"react";import{cn as $}from"../../helpers/utils.js";import{withLayout as J}from"../../shared/Styles.js";import{Button as I,Link as K,Text as A}from"../../components/index.js";import{useExposure as Q}from"../../hooks/useExposure.js";import{useTracking as X}from"../../hooks/useTracking.js";import{trackUrlRef as Z}from"../../shared/trackUrlRef.js";import{toPlainTrackingText as T}from"../../shared/track.js";import*as C from"@radix-ui/react-popover";const N="navigation",E="product_nav",P=d=>d.anchorId??d.id??"",ee=d=>o("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...d,children:o("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),L=U(({className:d="",data:B,id:z,onAnchorClick:D,scrollOffsetExtra:R=0},j)=>{const{tabLinks:p=[],anchorList:s=[],textLink:i,buyBtn:a,theme:Y="light"}=B||{},{buildRef:F}=X(),u=(e,t,n=1)=>({href:Z(e,F(N,E)),"data-headless-type-name":`${N}#${E}`,"data-headless-title-desc-button":`##${T(t)}`,"data-headless-nav-position":`${T(t)}#${n}`}),[G,g]=_(""),f=h(null),w=h(!1),v=h(""),x=h(null),S=h(new Map);W(j,()=>f.current),Q(f,{componentType:N,componentName:E,componentTitle:[...p.map(e=>e.label),...s.map(e=>e.label)].join(" | "),componentDescription:a?.text??i?.text??""});const k=q(()=>{if(s.length===0)return;const e=window.scrollY;window.scrollTo({top:0,behavior:"instant"}),requestAnimationFrame(()=>{const t=new Map;s.forEach(n=>{const r=P(n),l=document.getElementById(r);if(l){const b=l.getBoundingClientRect();t.set(r,b.top+window.scrollY)}}),S.current=t,window.scrollTo({top:e,behavior:"instant"})})},[s]);y(()=>{if(s.length===0)return;const e=setTimeout(k,100);return()=>clearTimeout(e)},[s,k]),y(()=>{if(s.length===0)return;let e=null;const t=new ResizeObserver(()=>{e&&clearTimeout(e),e=setTimeout(k,150)});return t.observe(document.body),()=>{t.disconnect(),e&&clearTimeout(e)}},[s,k]),y(()=>{if(s.length===0)return;const e=()=>{if(w.current){x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{w.current=!1,v.current&&(g(v.current),v.current="")},100);return}const n=f.current?.offsetHeight||0,r=window.scrollY+n+R+10;let l="";const b=S.current;for(let m=s.length-1;m>=0;m--){const V=s[m],M=P(V),H=b.get(M);if(H!==void 0&&r>=H){l=M;break}}if(!l&&s.length>0){const m=b.get(P(s[0]));m!==void 0&&r<m&&(l="")}g(l)},t=setTimeout(()=>{e()},200);return window.addEventListener("scroll",e,{passive:!0}),()=>{clearTimeout(t),window.removeEventListener("scroll",e),x.current&&clearTimeout(x.current)}},[s,R]),y(()=>{const e=document.querySelectorAll(".header"),t=[];return e.forEach(n=>{const r=n;t.push({element:r,originalPosition:r.style.position||getComputedStyle(r).position}),r.style.position="relative"}),()=>{t.forEach(({element:n,originalPosition:r})=>{n.style.position=r==="static"?"":r})}},[]);const O=(e,t)=>{e.preventDefault();const n=S.current.get(t);if(n===void 0){console.warn(`Cached position for "${t}" not found`);return}g(t),v.current=t,w.current=!0;const r=f.current?.offsetHeight||0,l=n-r-R;window.scrollTo({top:l,behavior:"smooth"}),window.history.pushState(null,"",`#${t}`)};return c("div",{id:z,ref:f,className:$("product-nav text-info-primary bg-container-primary tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden px-4 py-0",{"aiui-dark":Y==="dark"},d),children:[c("div",{className:"product-nav-main desktop:flex-row desktop:gap-[48px] flex w-full flex-col justify-start",children:[c("div",{className:"product-nav-header laptop:w-full desktop:w-fit desktop:gap-[24px] desktop:py-0 flex w-full flex-row items-center justify-between gap-[16px] pt-[14px]",children:[c("div",{className:"product-nav-tabs flex flex-row items-center gap-[8px]",children:[p.map((e,t)=>c("div",{className:"product-nav-tab-item flex items-center gap-[8px]",children:[o("a",{...u(e.link,e.label,p.indexOf(e)+1),className:$("product-nav-tab-link hover:text-brand-color text-nowrap text-[14px] font-bold tracking-[-0.04em]",{"text-[#6D6D6F]":t!==0,"hidden desktop:block":t===1}),children:o("span",{children:e.label})}),t!==p.length-1&&o("div",{className:"product-nav-tab-divider desktop:inline-block hidden h-[14px] w-px bg-[#E4E5E6]"})]},e.link||t)),p.length>1&&c(C.Root,{children:[o(C.Trigger,{asChild:!0,children:o("button",{className:"product-nav-dropdown-trigger desktop:hidden -ml-1 inline-block","aria-label":"More products",children:o(ee,{className:"text-[#1D1D1F]"})})}),o(C.Content,{className:"product-nav-dropdown-content rounded-[6px] border border-[#E4E5E6] bg-white p-[6px] px-[8px] py-[4px]",style:{boxShadow:"0px 4px 8px 0px rgba(0,0,0,0.12)"},side:"bottom",align:"end",alignOffset:10,sideOffset:10,children:p.slice(1).map(e=>o("a",{...u(e.link,e.label,p.indexOf(e)+1),className:"product-nav-dropdown-link hover:text-brand-color text-nowrap",children:o("span",{children:e.label})},e.link))})]})]}),c("div",{className:"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]",children:[i?.link&&o("a",{...u(i.link,i.text),target:i.target||"_self",className:"product-nav-text-link hover:text-brand-color cursor-pointer",children:o(A,{size:2,className:"text-nowrap",children:i.text})}),a?.link&&o(I,{as:"a",...u(a.link,a.text),size:"sm",className:"product-nav-buy-button text-nowrap",children:a.text})]})]}),o("div",{className:"product-nav-anchors laptop:w-fit desktop:gap-[24px] desktop:py-[8px] flex w-full items-center gap-[16px] overflow-x-scroll py-[12px] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:s.map((e,t)=>{const n=P(e);return c("a",{href:`#${n}`,className:"product-nav-anchor-link","data-headless-type-name":`${N}#${E}`,"data-headless-title-desc-button":`##${T(e.label)}`,"data-headless-nav-position":`${T(e.label)}#${t+1}`,onClick:r=>{D?(r.preventDefault(),g(n),v.current=n,w.current=!0,D(e,t)):O(r,n)},children:[o(A,{size:2,className:"product-nav-anchor-text text-nowrap",children:e.label}),o("div",{className:$("product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent",{"!bg-brand-0":G===n})})]},n)})})]}),c("div",{className:"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]",children:[i?.link&&o(K,{...u(i.link,i.text),target:i.target||"_self",className:"product-nav-text-link no-underline",children:o(A,{size:2,className:"text-nowrap",children:i.text})}),a?.link&&o(I,{as:"a",...u(a.link,a.text),size:"sm",className:"product-nav-buy-button text-nowrap",children:a.text})]})]})});L.displayName="ProductNav";var ce=J(L);export{ce as default};
1
+ "use client";import{jsx as o,jsxs as c}from"react/jsx-runtime";import{useState as _,useEffect as y,useCallback as q,forwardRef as U,useImperativeHandle as W,useRef as h}from"react";import{cn as $}from"../../helpers/utils.js";import{withLayout as J}from"../../shared/Styles.js";import{Button as I,Link as K,Text as A}from"../../components/index.js";import{useExposure as Q}from"../../hooks/useExposure.js";import{useTracking as X}from"../../hooks/useTracking.js";import{trackUrlRef as Z}from"../../shared/trackUrlRef.js";import{toPlainTrackingText as T}from"../../shared/track.js";import*as C from"@radix-ui/react-popover";const N="navigation",E="product_nav",P=d=>d.anchorId??d.id??"",ee=d=>o("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",...d,children:o("path",{d:"M5 7.5L10 12.5L15 7.5",stroke:"currentColor",strokeWidth:"1.66667",strokeLinecap:"round",strokeLinejoin:"round"})}),L=U(({className:d="",data:B,id:z,onAnchorClick:D,scrollOffsetExtra:R=0},j)=>{const{tabLinks:p=[],anchorList:s=[],textLink:i,buyBtn:a,theme:Y="light"}=B||{},{buildRef:F}=X(),u=(e,t,n=1)=>({href:Z(e,F(N,E)),"data-headless-type-name":`${N}#${E}`,"data-headless-title-desc-button":`##${T(t)}`,"data-headless-nav-position":`${T(t)}#${n}`}),[G,g]=_(""),f=h(null),w=h(!1),v=h(""),x=h(null),S=h(new Map);W(j,()=>f.current),Q(f,{componentType:N,componentName:E,componentTitle:[...p.map(e=>e.label),...s.map(e=>e.label)].join(" | "),componentDescription:a?.text??i?.text??""});const b=q(()=>{if(s.length===0)return;const e=window.scrollY;window.scrollTo({top:0,behavior:"instant"}),requestAnimationFrame(()=>{const t=new Map;s.forEach(n=>{const r=P(n),l=document.getElementById(r);if(l){const k=l.getBoundingClientRect();t.set(r,k.top+window.scrollY)}}),S.current=t,window.scrollTo({top:e,behavior:"instant"})})},[s]);y(()=>{if(s.length===0)return;const e=setTimeout(b,100);return()=>clearTimeout(e)},[s,b]),y(()=>{if(s.length===0)return;let e=null;const t=new ResizeObserver(()=>{e&&clearTimeout(e),e=setTimeout(b,150)});return t.observe(document.body),()=>{t.disconnect(),e&&clearTimeout(e)}},[s,b]),y(()=>{if(s.length===0)return;const e=()=>{if(w.current){x.current&&clearTimeout(x.current),x.current=setTimeout(()=>{w.current=!1,v.current&&(g(v.current),v.current="")},100);return}const n=f.current?.offsetHeight||0,r=window.scrollY+n+R+10;let l="";const k=S.current;for(let m=s.length-1;m>=0;m--){const V=s[m],M=P(V),H=k.get(M);if(H!==void 0&&r>=H){l=M;break}}if(!l&&s.length>0){const m=k.get(P(s[0]));m!==void 0&&r<m&&(l="")}g(l)},t=setTimeout(()=>{e()},200);return window.addEventListener("scroll",e,{passive:!0}),()=>{clearTimeout(t),window.removeEventListener("scroll",e),x.current&&clearTimeout(x.current)}},[s,R]),y(()=>{const e=document.querySelectorAll(".header"),t=[];return e.forEach(n=>{const r=n;t.push({element:r,originalPosition:r.style.position||getComputedStyle(r).position}),r.style.position="relative"}),()=>{t.forEach(({element:n,originalPosition:r})=>{n.style.position=r==="static"?"":r})}},[]);const O=(e,t)=>{e.preventDefault();const n=S.current.get(t);if(n===void 0){console.warn(`Cached position for "${t}" not found`);return}g(t),v.current=t,w.current=!0;const r=f.current?.offsetHeight||0,l=n-r-R;window.scrollTo({top:l,behavior:"smooth"}),window.history.pushState(null,"",`#${t}`)};return c("div",{id:z,ref:f,className:$("product-nav text-info-primary bg-container-primary px-grid !sticky top-0 !z-[51] flex w-full justify-between overflow-hidden py-0",{"aiui-dark":Y==="dark"},d),children:[c("div",{className:"product-nav-main desktop:flex-row desktop:gap-[48px] flex w-full flex-col justify-start",children:[c("div",{className:"product-nav-header laptop:w-full desktop:w-fit desktop:gap-[24px] desktop:py-0 flex w-full flex-row items-center justify-between gap-[16px] pt-[14px]",children:[c("div",{className:"product-nav-tabs flex flex-row items-center gap-[8px]",children:[p.map((e,t)=>c("div",{className:"product-nav-tab-item flex items-center gap-[8px]",children:[o("a",{...u(e.link,e.label,p.indexOf(e)+1),className:$("product-nav-tab-link hover:text-brand-color text-nowrap text-[14px] font-bold tracking-[-0.04em]",{"text-[#6D6D6F]":t!==0,"hidden desktop:block":t===1}),children:o("span",{children:e.label})}),t!==p.length-1&&o("div",{className:"product-nav-tab-divider desktop:inline-block hidden h-[14px] w-px bg-[#E4E5E6]"})]},e.link||t)),p.length>1&&c(C.Root,{children:[o(C.Trigger,{asChild:!0,children:o("button",{className:"product-nav-dropdown-trigger desktop:hidden -ml-1 inline-block","aria-label":"More products",children:o(ee,{className:"text-[#1D1D1F]"})})}),o(C.Content,{className:"product-nav-dropdown-content rounded-[6px] border border-[#E4E5E6] bg-white p-[6px] px-[8px] py-[4px]",style:{boxShadow:"0px 4px 8px 0px rgba(0,0,0,0.12)"},side:"bottom",align:"end",alignOffset:10,sideOffset:10,children:p.slice(1).map(e=>o("a",{...u(e.link,e.label,p.indexOf(e)+1),className:"product-nav-dropdown-link hover:text-brand-color text-nowrap",children:o("span",{children:e.label})},e.link))})]})]}),c("div",{className:"product-nav-mobile-actions desktop:hidden desktop:gap-[24px] flex items-center gap-[16px]",children:[i?.link&&o("a",{...u(i.link,i.text),target:i.target||"_self",className:"product-nav-text-link hover:text-brand-color cursor-pointer",children:o(A,{size:2,className:"text-nowrap",children:i.text})}),a?.link&&o(I,{as:"a",...u(a.link,a.text),size:"sm",className:"product-nav-buy-button text-nowrap",children:a.text})]})]}),o("div",{className:"product-nav-anchors laptop:w-fit desktop:gap-[24px] desktop:py-[8px] flex w-full items-center gap-[16px] overflow-x-scroll py-[12px] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:s.map((e,t)=>{const n=P(e);return c("a",{href:`#${n}`,className:"product-nav-anchor-link","data-headless-type-name":`${N}#${E}`,"data-headless-title-desc-button":`##${T(e.label)}`,"data-headless-nav-position":`${T(e.label)}#${t+1}`,onClick:r=>{D?(r.preventDefault(),g(n),v.current=n,w.current=!0,D(e,t)):O(r,n)},children:[o(A,{size:2,className:"product-nav-anchor-text text-nowrap",children:e.label}),o("div",{className:$("product-nav-anchor-indicator laptop:top-[12px] desktop:top-[10px] relative top-[12px] h-[4px] w-full bg-transparent",{"!bg-brand-0":G===n})})]},n)})})]}),c("div",{className:"product-nav-desktop-actions desktop:flex desktop:gap-[24px] desktop:py-[8px] hidden items-center gap-[16px]",children:[i?.link&&o(K,{...u(i.link,i.text),target:i.target||"_self",className:"product-nav-text-link no-underline",children:o(A,{size:2,className:"text-nowrap",children:i.text})}),a?.link&&o(I,{as:"a",...u(a.link,a.text),size:"sm",className:"product-nav-buy-button text-nowrap",children:a.text})]})]})});L.displayName="ProductNav";var ce=J(L);export{ce as default};
@@ -1 +1 @@
1
- import{Fragment as I,jsx as e,jsxs as i}from"react/jsx-runtime";import{Heading as S,Tabs as q,TabsList as J,TabsTrigger as Q,TabsContent as A,Text as N,Picture as C,Link as X,Button as L,DropdownMenu as Y,DropdownMenuTrigger as Z,DropdownMenuContent as ee,DropdownMenuItem as te,LoadingDots as M,Badge as ae}from"../../components/index.js";import{DownArrow as se}from"../HeaderNavigation/icons/index.js";import{useMemo as u,useState as O}from"react";import{cn as _,atobID as ie,highlightSearchWord as T,replaceTemplate as le}from"../../helpers/utils.js";import{useAiuiContext as j}from"../AiuiProvider/index.js";import{formatVariantPrice as oe}from"../ShelfDisplay/shelfDisplay.js";import{SearchPageTabType as v}from"./types.js";import{getLocalizedPath as B}from"../../helpers/utils.js";const F=({product:t,onSecondaryButton:o,onPrimaryButton:s,searchValue:n,variantData:m,shopNowLoadingProductId:y,badgeVariant:b})=>{const l=u(()=>m||t?.variants?.[0],[t,m]),{locale:g="us",copyWriting:c,currencyCode:x}=j(),f=y===t?.id,D=u(()=>B(`/products/${t?.handle}`,g,`variant=${ie(l?.id)}&ref=search_result_${n?.toLowerCase()}`),[t?.handle,l?.id,n,g]),P=l?.coupons?.[0],{price:k,basePrice:r}=oe({locale:x==="CAD"?"us":g||"us",amount:P?P.variant_price4wscode:l?.price?.amount??l?.price,baseAmount:P?l?.price?.amount??l?.price:0,currencyCode:t?.price?.currencyCode||"USD"}),z=u(()=>t?.tags?.filter?.(d=>d?.startsWith?.("CLtag"))?.map?.(d=>d?.replace?.("CLtag:",""))?.slice?.(0,2),[t?.tags]);return e("div",{className:"rounded-image-text ipc_search_product_item lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] relative h-auto overflow-hidden",children:t?.type==="advertising"&&t?.advertisingLink?i(X,{href:B(t?.advertisingLink,g),className:"h-full",children:[e(C,{source:`${t?.advertisingBgImg}`,className:"size-full",imgClassName:"size-full object-cover"}),i("div",{className:"desktop:p-6 absolute inset-0 z-[2] p-4 [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[e(N,{html:t?.advertisingTitle,className:_("desktop:text-base text-sm font-bold leading-[1.2]",{"text-white":t?.advertisingTheme==="light","text-info-primary":t?.advertisingTheme==="dark"})}),t?.advertisingSubtitle&&e(S,{size:3,html:t?.advertisingSubtitle,className:_("laptop:line-clamp-3 mt-2 line-clamp-4 font-bold",{"text-white":t?.advertisingTheme==="light","text-info-primary":t?.advertisingTheme==="dark"})})]})]}):i("a",{href:D,className:"tablet:hover:bg-info-white desktop:p-6 desktop:pt-4 tablet:p-4 flex h-full flex-col bg-[#EAEAEC] px-2 py-4 no-underline duration-300",children:[e("div",{className:"ipc_search_product_item_image",children:e(C,{className:"lg-desktop:size-[196px] mx-auto size-[138px]",source:l?.image?.url||t?.images?.[0]?.url,alt:t?.title,imgClassName:"object-cover size-full"})}),i("div",{className:"ipc_search_product_item_content desktop:mt-2 lg-desktop:mt-3 desktop:gap-6 mt-1 flex flex-1 flex-col justify-between gap-4",children:[i("div",{className:"flex-1",children:[e("div",{className:"lg-desktop:h-[28px] mb-2 flex h-[24px] gap-2",children:z?.map((d,E)=>e(ae,{size:"lg",variant:b,children:d},E))}),e(N,{className:"lg-desktop:text-2xl tablet:line-clamp-2 line-clamp-3 text-xl font-bold !leading-[1.2]",weight:"bold",html:T(t?.title||"",n||"")}),e(N,{as:"p",className:"lg-desktop:text-[18px] tablet:line-clamp-1 mt-1 line-clamp-2 text-sm font-bold",html:T(t?.description,n||"")})]}),i("div",{children:[e("div",{className:"mb-2 flex items-center",children:l?.availableForSale?i(I,{children:[e("div",{className:"final-price text-info-primary tablet:text-xl lg-desktop:text-2xl text-[18px] font-bold",children:l?.availableForSale&&k||""}),e("div",{className:"origin-price tablet:text-xl lg-desktop:text-2xl text-info-secondary ml-1 text-[18px] font-bold line-through",children:l?.availableForSale&&r||""})]}):e("div",{className:"text-info-primary tablet:text-xl lg-desktop:text-2xl text-[18px] font-bold",children:c?.soldOutText||"Sold Out"})}),i("div",{className:_("ipc_search_product_item_button_group","lg-desktop:gap-3 laptop:flex-row flex flex-col items-center gap-2"),children:[c?.learnMoreText&&e(L,{variant:"secondary",className:"laptop:w-auto w-full",size:"lg",onClick:d=>{d.preventDefault(),d.stopPropagation(),o?.()},children:c?.learnMoreText}),c?.shopNowText&&e(L,{variant:"primary",className:"laptop:w-auto w-full",size:"lg",disabled:!l?.availableForSale,loading:f,onClick:d=>{d.preventDefault(),d.stopPropagation(),s?.()},children:c?.shopNowText})]})]})]})]})})},re=({blog:t,searchValue:o})=>{const{copyWriting:s,locale:n="us"}=j(),m=u(()=>B(`/blogs/${t?.blog?.handle}/${t?.handle.replace("storefront-","")}`,n),[t,n]);return e("div",{className:"ipc_search_blog_item border-b border-[#E4E5E6] py-6",children:i("div",{className:"ipc_search_blog_item_content laptop:flex-row-reverse laptop:gap-8 desktop:gap-16 flex flex-col gap-4",children:[e("div",{className:"rounded-image-text laptop:flex-[440] desktop:flex-[540] desktop:h-[280px] h-[240px] overflow-hidden",children:e(C,{source:t?.image?.url,className:"size-full",imgClassName:"size-full object-cover",alt:t?.title})}),i("div",{className:"laptop:flex-[424] desktop:flex-[704] lg-desktop:flex-[1056] flex flex-col justify-center",children:[e(S,{size:3,html:T(t?.title,o)}),e(N,{html:T(t?.content,o),className:"lg-desktop:text-[18px] desktop:text-[16px] mt-1 line-clamp-2 text-sm font-bold leading-[1.4]"}),e("div",{className:"desktop:mt-6 mt-4",children:e(L,{as:"a",href:m,variant:"secondary",size:"lg",children:s?.learnMoreText||"Learn More"})})]})]})})},ne=({searchValue:t,page:o})=>{const{copyWriting:s,locale:n="us"}=j(),m=u(()=>B(`/${o?.handle}`,n),[o,n]);return i("div",{className:"ipc_search_page_items border-b border-[#E4E5E6] py-6",children:[e(S,{size:3,html:T(o?.name,t)}),e(N,{as:"p",html:T(o?.bodySummary||"",t),className:"lg-desktop:text-[18px] desktop:text-[16px] mt-1 text-sm font-bold leading-[1.4]"}),e(L,{as:"a",href:m,variant:"secondary",size:"lg",className:"desktop:mt-6 mt-4",children:s?.learnMoreText||"Learn More"})]})},R=({url:t,label:o})=>i("div",{className:"flex flex-col items-center justify-center gap-4",children:[e(C,{source:t,className:"h-[180px] w-[240px]",imgClassName:"object-cover"}),e(N,{html:o,className:"desktop:text-[18px] text-sm font-bold leading-[1.4]"})]}),$=({products:t,title:o,buildProps:s,onSecondaryButton:n,onPrimaryButton:m,badgeVariant:y})=>{const{products:b}=s||{};return console.log(b,"buildProducts"),i("div",{className:"ipc_search_recommend_product tablet:pt-[80px] laptop:pt-[96px] desktop:pt-[112px] lg-desktop:pt-[128px] pt-[64px]",children:[e(S,{size:4,weight:"bold",html:o}),e("div",{className:" tablet:grid-cols-3 desktop:grid-cols-4 desktop:gap-4 mt-6 grid grid-cols-2 gap-x-3 gap-y-4",children:t?.map((l,g)=>{const c=b?.find(f=>f.handle===l.handle);if(!c)return null;const x=c?.variants?.find(f=>f.sku===l.sku);return e(F,{product:c,variantData:x,badgeVariant:y,onSecondaryButton:()=>n?.(),onPrimaryButton:()=>m?.()},l.sku+g)})})]})},de=({searchResult:t,searchValue:o,data:s,onSecondaryButton:n,onPrimaryButton:m,onChangeSort:y,loading:b,shopNowLoadingProductId:l,searchResultCount:g,onChangeTab:c,buildProps:x,componentOverrides:f,className:D,...P})=>{const k=f?.badge?.variant,[r,z]=O(s?.tabs?.[0]),[d,E]=O(!1),[V,G]=O({[v.PRODUCTS]:s?.tabs?.find(a=>a.tabType===v.PRODUCTS)?.sortKeys?.[0],[v.BLOGS]:s?.tabs?.find(a=>a.tabType===v.BLOGS)?.sortKeys?.[0],[v.PAGES]:s?.tabs?.find(a=>a.tabType===v.PAGES)?.sortKeys?.[0]}),w=u(()=>t?.products||[],[t]),K=u(()=>t?.blogs||[],[t]),W=u(()=>t?.pages||[],[t]),U=u(()=>Object.values(g||{}).reduce((a,p)=>a+p,0),[g]),H=u(()=>{const a={advertisingBgImg:`${r?.advertisingBgImg?.url}, ${r?.advertisingMobBgImg?.url} 768`,advertisingTitle:r?.advertisingTitle,advertisingSubtitle:r?.advertisingSubtitle,advertisingLink:r?.advertisingLink,advertisingTheme:r?.advertisingTheme,type:"advertising"};if(!!r?.advertisingBgImg?.url||!!r?.advertisingTitle||!!r?.advertisingLink){const h=[...w||[]];return h.length>=8?h.splice(7,0,a):h.length>0&&h.push(a),h}else return w},[r,w]);return i("div",{...P,className:_("ipc_search_page desktop:py-[128px] tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] px-4 py-16",D),children:[e(S,{size:4,weight:"bold",html:le(s?.title,{totalCount:U?.toString(),inputValue:`"${o}"`})}),e("div",{className:"mt-6",children:i(q,{className:"ipc_search_page_tabs",defaultValue:"products",children:[i("div",{className:" desktop:flex desktop:items-center desktop:flex-row desktop:gap-6 desktop:justify-between",children:[e(J,{children:s?.tabs?.map(a=>i(Q,{onClick:()=>{z(a);const p=a?.sortKeys?.[0];p&&(G(h=>({...h,[a?.tabType]:p})),y?.(a?.tabType,p)),c?.(a?.tabType)},defaultValue:"products",value:a.tabType,children:[a.label," (",g?.[a.tabType],")"]},a.id))}),i(Y,{onOpenChange:E,children:[e(Z,{asChild:!0,children:i("button",{className:"desktop:mt-0 mt-6 flex items-center text-base font-bold leading-[1.2] focus-visible:!outline-none",children:[r?.sortLabel," ",V?.[r?.tabType]?.label," ",e(se,{className:_("inline-block size-4",{"rotate-180":d})})]})}),e(ee,{align:"start",sideOffset:8,className:"rounded-sidebar-shelf bg-white !px-0 py-2 focus-visible:!outline-none",children:r?.sortKeys?.map(a=>e(te,{className:_("laptop:px-4 laptop:text-base px-3 py-4 text-sm font-bold hover:bg-[#EAEAEC] hover:text-current hover:!outline-none",{"bg-[#EAEAEC]":V?.[r?.tabType]?.value===a.value}),onClick:()=>{y?.(r?.tabType,a),G(p=>({...p,[r?.tabType]:a}))},children:a.label},a.id))})]})]}),i(A,{value:v.PRODUCTS,className:"ipc_search_page_tabs_products_content mt-6",children:[e("div",{className:" tablet:grid-cols-3 desktop:grid-cols-4 desktop:gap-4 grid grid-cols-2 gap-x-3 gap-y-4",children:H?.map((a,p)=>e(F,{searchValue:o,product:a,shopNowLoadingProductId:l,badgeVariant:k,onSecondaryButton:()=>n?.(a),onPrimaryButton:()=>m?.(a)},(a.id||"")+p))}),b?e("div",{className:"mt-6 flex w-full justify-center",children:e(M,{})}):!w?.length&&i(I,{children:[e(R,{url:s?.noResultImage?.url,label:s?.noResultLabel}),e($,{products:s?.recommendProducts||[],buildProps:x,title:s?.recommendProductsTitle,shopNowLoadingProductId:l,badgeVariant:k})]})]}),e(A,{value:v.BLOGS,className:"ipc_search_page_tabs_blogs_content",children:i("div",{children:[K?.map(a=>e(re,{blog:a,searchValue:o},a.id)),b?e("div",{className:"mt-6 flex justify-center",children:e(M,{})}):!K?.length&&i(I,{children:[e(R,{url:s?.noResultImage?.url,label:s?.noResultLabel}),e($,{products:s?.recommendProducts||[],buildProps:x,title:s?.recommendProductsTitle,badgeVariant:k})]})]})}),i(A,{value:v.PAGES,className:"ipc_search_page_tabs_pages_content",children:[e("div",{children:W?.map((a,p)=>e(ne,{page:a,searchValue:o},(a.global_id||a.id)+p))}),b?e("div",{className:"mt-6 flex justify-center",children:e(M,{})}):!W?.length&&i(I,{children:[e(R,{url:s?.noResultImage?.url,label:s?.noResultLabel}),e($,{products:s?.recommendProducts||[],buildProps:x,title:s?.recommendProductsTitle,shopNowLoadingProductId:l,badgeVariant:k})]})]})]})})]})};var fe=de;export{fe as default};
1
+ import{Fragment as I,jsx as e,jsxs as i}from"react/jsx-runtime";import{Heading as S,Tabs as q,TabsList as J,TabsTrigger as Q,TabsContent as A,Text as N,Picture as C,Link as X,Button as L,DropdownMenu as Y,DropdownMenuTrigger as Z,DropdownMenuContent as ee,DropdownMenuItem as te,LoadingDots as M,Badge as ae}from"../../components/index.js";import{DownArrow as se}from"../HeaderNavigation/icons/index.js";import{useMemo as u,useState as O}from"react";import{cn as _,atobID as ie,highlightSearchWord as T,replaceTemplate as le}from"../../helpers/utils.js";import{useAiuiContext as j}from"../AiuiProvider/index.js";import{formatVariantPrice as oe}from"../ShelfDisplay/shelfDisplay.js";import{SearchPageTabType as v}from"./types.js";import{getLocalizedPath as B}from"../../helpers/utils.js";const F=({product:t,onSecondaryButton:o,onPrimaryButton:s,searchValue:n,variantData:m,shopNowLoadingProductId:y,badgeVariant:b})=>{const l=u(()=>m||t?.variants?.[0],[t,m]),{locale:g="us",copyWriting:p,currencyCode:x}=j(),f=y===t?.id,D=u(()=>B(`/products/${t?.handle}`,g,`variant=${ie(l?.id)}&ref=search_result_${n?.toLowerCase()}`),[t?.handle,l?.id,n,g]),P=l?.coupons?.[0],{price:k,basePrice:r}=oe({locale:x==="CAD"?"us":g||"us",amount:P?P.variant_price4wscode:l?.price?.amount??l?.price,baseAmount:P?l?.price?.amount??l?.price:0,currencyCode:t?.price?.currencyCode||"USD"}),z=u(()=>t?.tags?.filter?.(d=>d?.startsWith?.("CLtag"))?.map?.(d=>d?.replace?.("CLtag:",""))?.slice?.(0,2),[t?.tags]);return e("div",{className:"rounded-image-text ipc_search_product_item lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] relative h-auto overflow-hidden",children:t?.type==="advertising"&&t?.advertisingLink?i(X,{href:B(t?.advertisingLink,g),className:"h-full",children:[e(C,{source:`${t?.advertisingBgImg}`,className:"size-full",imgClassName:"size-full object-cover"}),i("div",{className:"desktop:p-6 absolute inset-0 z-[2] p-4 [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[e(N,{html:t?.advertisingTitle,className:_("desktop:text-base text-sm font-bold leading-[1.2]",{"text-white":t?.advertisingTheme==="light","text-info-primary":t?.advertisingTheme==="dark"})}),t?.advertisingSubtitle&&e(S,{size:3,html:t?.advertisingSubtitle,className:_("laptop:line-clamp-3 mt-2 line-clamp-4 font-bold",{"text-white":t?.advertisingTheme==="light","text-info-primary":t?.advertisingTheme==="dark"})})]})]}):i("a",{href:D,className:"tablet:hover:bg-info-white desktop:p-6 desktop:pt-4 tablet:p-4 flex h-full flex-col bg-[#EAEAEC] px-2 py-4 no-underline duration-300",children:[e("div",{className:"ipc_search_product_item_image",children:e(C,{className:"lg-desktop:size-[196px] mx-auto size-[138px]",source:l?.image?.url||t?.images?.[0]?.url,alt:t?.title,imgClassName:"object-cover size-full"})}),i("div",{className:"ipc_search_product_item_content desktop:mt-2 lg-desktop:mt-3 desktop:gap-6 mt-1 flex flex-1 flex-col justify-between gap-4",children:[i("div",{className:"flex-1",children:[e("div",{className:"lg-desktop:h-[28px] mb-2 flex h-[24px] gap-2",children:z?.map((d,E)=>e(ae,{size:"lg",variant:b,children:d},E))}),e(N,{className:"lg-desktop:text-2xl tablet:line-clamp-2 line-clamp-3 text-xl font-bold !leading-[1.2]",weight:"bold",html:T(t?.title||"",n||"")}),e(N,{as:"p",className:"lg-desktop:text-[18px] tablet:line-clamp-1 mt-1 line-clamp-2 text-sm font-bold",html:T(t?.description,n||"")})]}),i("div",{children:[e("div",{className:"mb-2 flex items-center",children:l?.availableForSale?i(I,{children:[e("div",{className:"final-price text-info-primary tablet:text-xl lg-desktop:text-2xl text-[18px] font-bold",children:l?.availableForSale&&k||""}),e("div",{className:"origin-price tablet:text-xl lg-desktop:text-2xl text-info-secondary ml-1 text-[18px] font-bold line-through",children:l?.availableForSale&&r||""})]}):e("div",{className:"text-info-primary tablet:text-xl lg-desktop:text-2xl text-[18px] font-bold",children:p?.soldOutText||"Sold Out"})}),i("div",{className:_("ipc_search_product_item_button_group","lg-desktop:gap-3 laptop:flex-row flex flex-col items-center gap-2"),children:[p?.learnMoreText&&e(L,{variant:"secondary",className:"laptop:w-auto w-full",size:"lg",onClick:d=>{d.preventDefault(),d.stopPropagation(),o?.()},children:p?.learnMoreText}),p?.shopNowText&&e(L,{variant:"primary",className:"laptop:w-auto w-full",size:"lg",disabled:!l?.availableForSale,loading:f,onClick:d=>{d.preventDefault(),d.stopPropagation(),s?.()},children:p?.shopNowText})]})]})]})]})})},re=({blog:t,searchValue:o})=>{const{copyWriting:s,locale:n="us"}=j(),m=u(()=>B(`/blogs/${t?.blog?.handle}/${t?.handle.replace("storefront-","")}`,n),[t,n]);return e("div",{className:"ipc_search_blog_item border-b border-[#E4E5E6] py-6",children:i("div",{className:"ipc_search_blog_item_content laptop:flex-row-reverse laptop:gap-8 desktop:gap-16 flex flex-col gap-4",children:[e("div",{className:"rounded-image-text laptop:flex-[440] desktop:flex-[540] desktop:h-[280px] h-[240px] overflow-hidden",children:e(C,{source:t?.image?.url,className:"size-full",imgClassName:"size-full object-cover",alt:t?.title})}),i("div",{className:"laptop:flex-[424] desktop:flex-[704] lg-desktop:flex-[1056] flex flex-col justify-center",children:[e(S,{size:3,html:T(t?.title,o)}),e(N,{html:T(t?.content,o),className:"lg-desktop:text-[18px] desktop:text-[16px] mt-1 line-clamp-2 text-sm font-bold leading-[1.4]"}),e("div",{className:"desktop:mt-6 mt-4",children:e(L,{as:"a",href:m,variant:"secondary",size:"lg",children:s?.learnMoreText||"Learn More"})})]})]})})},ne=({searchValue:t,page:o})=>{const{copyWriting:s,locale:n="us"}=j(),m=u(()=>B(`/${o?.handle}`,n),[o,n]);return i("div",{className:"ipc_search_page_items border-b border-[#E4E5E6] py-6",children:[e(S,{size:3,html:T(o?.name,t)}),e(N,{as:"p",html:T(o?.bodySummary||"",t),className:"lg-desktop:text-[18px] desktop:text-[16px] mt-1 text-sm font-bold leading-[1.4]"}),e(L,{as:"a",href:m,variant:"secondary",size:"lg",className:"desktop:mt-6 mt-4",children:s?.learnMoreText||"Learn More"})]})},R=({url:t,label:o})=>i("div",{className:"flex flex-col items-center justify-center gap-4",children:[e(C,{source:t,className:"h-[180px] w-[240px]",imgClassName:"object-cover"}),e(N,{html:o,className:"desktop:text-[18px] text-sm font-bold leading-[1.4]"})]}),$=({products:t,title:o,buildProps:s,onSecondaryButton:n,onPrimaryButton:m,badgeVariant:y})=>{const{products:b}=s||{};return console.log(b,"buildProducts"),i("div",{className:"ipc_search_recommend_product tablet:pt-[80px] laptop:pt-[96px] desktop:pt-[112px] lg-desktop:pt-[128px] pt-[64px]",children:[e(S,{size:4,weight:"bold",html:o}),e("div",{className:" tablet:grid-cols-3 desktop:grid-cols-4 desktop:gap-4 mt-6 grid grid-cols-2 gap-x-3 gap-y-4",children:t?.map((l,g)=>{const p=b?.find(f=>f.handle===l.handle);if(!p)return null;const x=p?.variants?.find(f=>f.sku===l.sku);return e(F,{product:p,variantData:x,badgeVariant:y,onSecondaryButton:()=>n?.(),onPrimaryButton:()=>m?.()},l.sku+g)})})]})},de=({searchResult:t,searchValue:o,data:s,onSecondaryButton:n,onPrimaryButton:m,onChangeSort:y,loading:b,shopNowLoadingProductId:l,searchResultCount:g,onChangeTab:p,buildProps:x,componentOverrides:f,className:D,...P})=>{const k=f?.badge?.variant,[r,z]=O(s?.tabs?.[0]),[d,E]=O(!1),[V,G]=O({[v.PRODUCTS]:s?.tabs?.find(a=>a.tabType===v.PRODUCTS)?.sortKeys?.[0],[v.BLOGS]:s?.tabs?.find(a=>a.tabType===v.BLOGS)?.sortKeys?.[0],[v.PAGES]:s?.tabs?.find(a=>a.tabType===v.PAGES)?.sortKeys?.[0]}),w=u(()=>t?.products||[],[t]),K=u(()=>t?.blogs||[],[t]),W=u(()=>t?.pages||[],[t]),U=u(()=>Object.values(g||{}).reduce((a,c)=>a+c,0),[g]),H=u(()=>{const a={advertisingBgImg:`${r?.advertisingBgImg?.url}, ${r?.advertisingMobBgImg?.url} 768`,advertisingTitle:r?.advertisingTitle,advertisingSubtitle:r?.advertisingSubtitle,advertisingLink:r?.advertisingLink,advertisingTheme:r?.advertisingTheme,type:"advertising"};if(!!r?.advertisingBgImg?.url||!!r?.advertisingTitle||!!r?.advertisingLink){const h=[...w||[]];return h.length>=8?h.splice(7,0,a):h.length>0&&h.push(a),h}else return w},[r,w]);return i("div",{...P,className:_("ipc_search_page desktop:py-[128px] px-grid py-16",D),children:[e(S,{size:4,weight:"bold",html:le(s?.title,{totalCount:U?.toString(),inputValue:`"${o}"`})}),e("div",{className:"mt-6",children:i(q,{className:"ipc_search_page_tabs",defaultValue:"products",children:[i("div",{className:" desktop:flex desktop:items-center desktop:flex-row desktop:gap-6 desktop:justify-between",children:[e(J,{children:s?.tabs?.map(a=>i(Q,{onClick:()=>{z(a);const c=a?.sortKeys?.[0];c&&(G(h=>({...h,[a?.tabType]:c})),y?.(a?.tabType,c)),p?.(a?.tabType)},defaultValue:"products",value:a.tabType,children:[a.label," (",g?.[a.tabType],")"]},a.id))}),i(Y,{onOpenChange:E,children:[e(Z,{asChild:!0,children:i("button",{className:"desktop:mt-0 mt-6 flex items-center text-base font-bold leading-[1.2] focus-visible:!outline-none",children:[r?.sortLabel," ",V?.[r?.tabType]?.label," ",e(se,{className:_("inline-block size-4",{"rotate-180":d})})]})}),e(ee,{align:"start",sideOffset:8,className:"rounded-sidebar-shelf bg-white !px-0 py-2 focus-visible:!outline-none",children:r?.sortKeys?.map(a=>e(te,{className:_("laptop:px-4 laptop:text-base px-3 py-4 text-sm font-bold hover:bg-[#EAEAEC] hover:text-current hover:!outline-none",{"bg-[#EAEAEC]":V?.[r?.tabType]?.value===a.value}),onClick:()=>{y?.(r?.tabType,a),G(c=>({...c,[r?.tabType]:a}))},children:a.label},a.id))})]})]}),i(A,{value:v.PRODUCTS,className:"ipc_search_page_tabs_products_content mt-6",children:[e("div",{className:" tablet:grid-cols-3 desktop:grid-cols-4 desktop:gap-4 grid grid-cols-2 gap-x-3 gap-y-4",children:H?.map((a,c)=>e(F,{searchValue:o,product:a,shopNowLoadingProductId:l,badgeVariant:k,onSecondaryButton:()=>n?.(a),onPrimaryButton:()=>m?.(a)},(a.id||"")+c))}),b?e("div",{className:"mt-6 flex w-full justify-center",children:e(M,{})}):!w?.length&&i(I,{children:[e(R,{url:s?.noResultImage?.url,label:s?.noResultLabel}),e($,{products:s?.recommendProducts||[],buildProps:x,title:s?.recommendProductsTitle,shopNowLoadingProductId:l,badgeVariant:k})]})]}),e(A,{value:v.BLOGS,className:"ipc_search_page_tabs_blogs_content",children:i("div",{children:[K?.map(a=>e(re,{blog:a,searchValue:o},a.id)),b?e("div",{className:"mt-6 flex justify-center",children:e(M,{})}):!K?.length&&i(I,{children:[e(R,{url:s?.noResultImage?.url,label:s?.noResultLabel}),e($,{products:s?.recommendProducts||[],buildProps:x,title:s?.recommendProductsTitle,badgeVariant:k})]})]})}),i(A,{value:v.PAGES,className:"ipc_search_page_tabs_pages_content",children:[e("div",{children:W?.map((a,c)=>e(ne,{page:a,searchValue:o},(a.global_id||a.id)+c))}),b?e("div",{className:"mt-6 flex justify-center",children:e(M,{})}):!W?.length&&i(I,{children:[e(R,{url:s?.noResultImage?.url,label:s?.noResultLabel}),e($,{products:s?.recommendProducts||[],buildProps:x,title:s?.recommendProductsTitle,shopNowLoadingProductId:l,badgeVariant:k})]})]})]})})]})};var fe=de;export{fe as default};
@@ -1 +1 @@
1
- "use client";import{jsx as t,jsxs as g}from"react/jsx-runtime";import*as p from"react";import{cva as ue}from"class-variance-authority";import{useMediaQuery as H}from"react-responsive";import E from"jump.js";import{cn as s,getLocalizedPath as w}from"../../helpers/index.js";import{Text as O,Button as P,Heading as ge,Picture as be,Countdown as ye}from"../../components/index.js";import{withLayout as fe}from"../../shared/Styles.js";import xe from"../Media/index.js";import{useAiuiContext as ke}from"../AiuiProvider/index.js";import{useExposure as he}from"../../hooks/useExposure.js";import{buildTrackingRef as Te,trackUrlRef as V}from"../../shared/trackUrlRef.js";import{buildClickTrackingProps as _,resolveComponentMediaType as ve}from"../../shared/track.js";import Be from"./SecondaryBannerCarousel.js";const u="secondary_banner",Ie=ue("text-info-primary relative w-full",{variants:{size:{sm:"tablet:aspect-[768/480] laptop:aspect-[1024/480] desktop:aspect-[1440/480] lg-desktop:aspect-[1920/480] aspect-[390/480]",base:"tablet:aspect-[768/660] laptop:aspect-[1024/432] desktop:aspect-[1440/576] lg-desktop:aspect-[1920/720] aspect-[390/660]",lg:"tablet:aspect-[768/660] laptop:aspect-[1024/520] desktop:aspect-[1440/700] lg-desktop:aspect-[1920/930] aspect-[390/660]",xlg:"tablet:aspect-[768/1320] laptop:aspect-[1024/864] desktop:aspect-[1440/1152] lg-desktop:aspect-[1920/1440] aspect-[390/1440] overflow-visible"}},defaultVariants:{size:"base"}}),j=p.forwardRef(({className:h,classNames:a={},data:e,jumpOptions:T={},isActive:$,a11yLabels:J,trackExposure:q=!0,frameIndex:b,...v},l)=>{const{pcImage:F,padImage:W,mobileImage:G,isVideoLoop:Q,endDate:B,endDate_tz:U,dateFormat:K,size:X,iconArray:y,theme:Y,primaryButton:n,secondaryButton:i,title:c,titleTag:Z}=e,ee=Q??!0,f=X??"base",te=Y??"light",ne=Z??"h2",{locale:I="us",pageHandle:ie}=ke(),oe=H({query:"(max-width: 767px)"}),ae=H({query:"(min-width: 768px) and (max-width: 1024px)"}),M=oe?e.mobileImage:ae?e.padImage??e.pcImage:e.pcImage,m=ve(M?.mimeType==="video/mp4"),S=b??1,C=`${Te(ie??"",m,u)}${b===void 0?"":`_${b}`}`,x=M?.id||e.pcImage?.id||"",L=p.useRef(null),se=p.useCallback(o=>{L.current=o,typeof l=="function"?l(o):l&&(l.current=o)},[l]),re=p.useRef(null);he(q?L:re,{componentType:m,componentName:u,componentTitle:c?.trim()||"",componentDescription:e.subtitle?.trim()||"",position:1,creativeId:x});const le=!!(i?.link||typeof i?.onClick=="function"),pe=!!(n?.link||typeof n?.onClick=="function"),z=i?.link&&!i.link.startsWith("#")?V(w(i.link,I),C):void 0,N=n?.link&&!n.link.startsWith("#")?V(w(n.link,I),C):void 0,ce=_({interactive:le,componentType:m,componentName:u,title:c,description:e.subtitle,buttonName:i?.text,position:S,creativeId:x}),me=_({interactive:pe,componentType:m,componentName:u,title:c,description:e.subtitle,buttonName:n?.text,position:S,creativeId:x}),R={...{duration:500,offset:0},...T},k=p.useId(),d=c?`${k}-title`:void 0,D=e.subtitle?`${k}-subtitle`:void 0,A=e.superTitle?`${k}-super-title`:void 0,de=[A,D].filter(Boolean).join(" ")||void 0;return e.items&&e.items.length>0?t(Be,{data:e,className:h,classNames:a,jumpOptions:T,a11yLabels:J,ref:l,...v}):g("section",{ref:se,role:"banner","aria-labelledby":d,"aria-describedby":de,className:s({"aiui-dark":te==="dark"},Ie({size:f}),h,a?.root),...v,children:[t("div",{className:s("absolute inset-0",{"h-fit":f==="xlg"}),children:t(xe,{pcImage:F,padImage:W,mobileImage:G,className:"size-full",imgClassName:"object-cover",videoClassName:"object-cover",muted:!0,loop:ee,playsInline:!0,autoPlay:$??!0})}),g("div",{className:s("banner-content laptop:top-[min(50%,50vh)] laptop:-translate-y-1/2 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] absolute top-12 z-10 flex flex-col items-start justify-center px-[16px] text-left",a?.content),children:[g("div",{className:"banner-inner-title desktop:gap-2 flex flex-col items-start gap-1",children:[e.superTitle&&t(O,{as:"p",size:2,id:A,className:s("banner-super-title desktop:text-[16px] lg-desktop:text-[18px]",a?.superTitle),html:e.superTitle}),e.title&&t(ge,{as:ne,size:["xlg","lg"].includes(f)?5:4,id:d,className:s("banner-title ",a?.title),html:e.title}),e.subtitle&&t(O,{as:"p",size:3,id:D,className:s("banner-subtitle desktop:text-[16px] lg-desktop:text-[18px]",a?.subtitle),html:e.subtitle})]}),B&&t("div",{className:"banner-countdown",children:t(ye,{endDate:B,endDate_tz:U,dateFormat:K,variant:"spacious",className:"lg-desktop:mt-8 mt-6"})}),g("div",{className:s("banner-cta-group lg-desktop:mt-[32px] lg-desktop:gap-3 mt-6 flex gap-2",a?.buttonGroup),children:[i?.text&&t(P,{variant:"secondary",onClick:o=>{if(i.link?.startsWith("#")){o.preventDefault();const r=document.querySelector(i.link);r&&E(r,R)}i.onClick?.()},className:s("",a?.secondaryButton),"aria-describedby":d,...z?{as:"a",href:z}:{},...ce,children:i.text}),n?.text&&t(P,{onClick:o=>{if(n.link?.startsWith("#")){o.preventDefault();const r=document.querySelector(n.link);r&&E(r,R)}n.onClick?.()},className:s("",a?.primaryButton),"aria-describedby":d,...N?{as:"a",href:N}:{},...me,children:n.text})]}),Array.isArray(y)&&y.length>0&&t("div",{className:"banner-icons desktop:mt-3 lg-desktop:mt-4 mt-2 flex items-center gap-2",role:"group","aria-label":"brand icons",children:y.map((o,r)=>o.pcImage?t(be,{source:o.pcImage.url,alt:o.pcImage.alt||`icon ${r+1}`,role:"img",className:"laptop:h-auto h-[48px] max-w-none",imgClassName:"h-full"},r):null)})]})]})});j.displayName="SecondaryBanner";var Pe=fe(j);export{Pe as default,Ie as secondaryBannerVariants};
1
+ "use client";import{jsx as t,jsxs as g}from"react/jsx-runtime";import*as p from"react";import{cva as ue}from"class-variance-authority";import{useMediaQuery as H}from"react-responsive";import E from"jump.js";import{cn as s,getLocalizedPath as w}from"../../helpers/index.js";import{Text as O,Button as P,Heading as ge,Picture as be,Countdown as ye}from"../../components/index.js";import{withLayout as fe}from"../../shared/Styles.js";import ke from"../Media/index.js";import{useAiuiContext as xe}from"../AiuiProvider/index.js";import{useExposure as he}from"../../hooks/useExposure.js";import{buildTrackingRef as Te,trackUrlRef as V}from"../../shared/trackUrlRef.js";import{buildClickTrackingProps as _,resolveComponentMediaType as ve}from"../../shared/track.js";import Be from"./SecondaryBannerCarousel.js";const u="secondary_banner",Ie=ue("text-info-primary relative w-full",{variants:{size:{sm:"tablet:aspect-[768/480] laptop:aspect-[1024/480] desktop:aspect-[1440/480] lg-desktop:aspect-[1920/480] aspect-[390/480]",base:"tablet:aspect-[768/660] laptop:aspect-[1024/432] desktop:aspect-[1440/576] lg-desktop:aspect-[1920/720] aspect-[390/660]",lg:"tablet:aspect-[768/660] laptop:aspect-[1024/520] desktop:aspect-[1440/700] lg-desktop:aspect-[1920/930] aspect-[390/660]",xlg:"tablet:aspect-[768/1320] laptop:aspect-[1024/864] desktop:aspect-[1440/1152] lg-desktop:aspect-[1920/1440] aspect-[390/1440] overflow-visible"}},defaultVariants:{size:"base"}}),j=p.forwardRef(({className:h,classNames:a={},data:e,jumpOptions:T={},isActive:$,a11yLabels:J,trackExposure:q=!0,frameIndex:b,...v},l)=>{const{pcImage:F,padImage:W,mobileImage:G,isVideoLoop:Q,endDate:B,endDate_tz:U,dateFormat:K,size:X,iconArray:y,theme:Y,primaryButton:n,secondaryButton:i,title:c,titleTag:Z}=e,ee=Q??!0,f=X??"base",te=Y??"light",ne=Z??"h2",{locale:I="us",pageHandle:ie}=xe(),oe=H({query:"(max-width: 767px)"}),ae=H({query:"(min-width: 768px) and (max-width: 1024px)"}),M=oe?e.mobileImage:ae?e.padImage??e.pcImage:e.pcImage,m=ve(M?.mimeType==="video/mp4"),S=b??1,C=`${Te(ie??"",m,u)}${b===void 0?"":`_${b}`}`,k=M?.id||e.pcImage?.id||"",L=p.useRef(null),se=p.useCallback(o=>{L.current=o,typeof l=="function"?l(o):l&&(l.current=o)},[l]),re=p.useRef(null);he(q?L:re,{componentType:m,componentName:u,componentTitle:c?.trim()||"",componentDescription:e.subtitle?.trim()||"",position:1,creativeId:k});const le=!!(i?.link||typeof i?.onClick=="function"),pe=!!(n?.link||typeof n?.onClick=="function"),z=i?.link&&!i.link.startsWith("#")?V(w(i.link,I),C):void 0,N=n?.link&&!n.link.startsWith("#")?V(w(n.link,I),C):void 0,ce=_({interactive:le,componentType:m,componentName:u,title:c,description:e.subtitle,buttonName:i?.text,position:S,creativeId:k}),me=_({interactive:pe,componentType:m,componentName:u,title:c,description:e.subtitle,buttonName:n?.text,position:S,creativeId:k}),R={...{duration:500,offset:0},...T},x=p.useId(),d=c?`${x}-title`:void 0,D=e.subtitle?`${x}-subtitle`:void 0,A=e.superTitle?`${x}-super-title`:void 0,de=[A,D].filter(Boolean).join(" ")||void 0;return e.items&&e.items.length>0?t(Be,{data:e,className:h,classNames:a,jumpOptions:T,a11yLabels:J,ref:l,...v}):g("section",{ref:se,role:"banner","aria-labelledby":d,"aria-describedby":de,className:s({"aiui-dark":te==="dark"},Ie({size:f}),h,a?.root),...v,children:[t("div",{className:s("absolute inset-0",{"h-fit":f==="xlg"}),children:t(ke,{pcImage:F,padImage:W,mobileImage:G,className:"size-full",imgClassName:"object-cover",videoClassName:"object-cover",muted:!0,loop:ee,playsInline:!0,autoPlay:$??!0})}),g("div",{className:s("banner-content laptop:top-[min(50%,50vh)] laptop:-translate-y-1/2 px-grid absolute top-12 z-10 flex flex-col items-start justify-center text-left",a?.content),children:[g("div",{className:"banner-inner-title desktop:gap-2 flex flex-col items-start gap-1",children:[e.superTitle&&t(O,{as:"p",size:2,id:A,className:s("banner-super-title desktop:text-[16px] lg-desktop:text-[18px]",a?.superTitle),html:e.superTitle}),e.title&&t(ge,{as:ne,size:["xlg","lg"].includes(f)?5:4,id:d,className:s("banner-title ",a?.title),html:e.title}),e.subtitle&&t(O,{as:"p",size:3,id:D,className:s("banner-subtitle desktop:text-[16px] lg-desktop:text-[18px]",a?.subtitle),html:e.subtitle})]}),B&&t("div",{className:"banner-countdown",children:t(ye,{endDate:B,endDate_tz:U,dateFormat:K,variant:"spacious",className:"lg-desktop:mt-8 mt-6"})}),g("div",{className:s("banner-cta-group lg-desktop:mt-[32px] lg-desktop:gap-3 mt-6 flex gap-2",a?.buttonGroup),children:[i?.text&&t(P,{variant:"secondary",onClick:o=>{if(i.link?.startsWith("#")){o.preventDefault();const r=document.querySelector(i.link);r&&E(r,R)}i.onClick?.()},className:s("",a?.secondaryButton),"aria-describedby":d,...z?{as:"a",href:z}:{},...ce,children:i.text}),n?.text&&t(P,{onClick:o=>{if(n.link?.startsWith("#")){o.preventDefault();const r=document.querySelector(n.link);r&&E(r,R)}n.onClick?.()},className:s("",a?.primaryButton),"aria-describedby":d,...N?{as:"a",href:N}:{},...me,children:n.text})]}),Array.isArray(y)&&y.length>0&&t("div",{className:"banner-icons desktop:mt-3 lg-desktop:mt-4 mt-2 flex items-center gap-2",role:"group","aria-label":"brand icons",children:y.map((o,r)=>o.pcImage?t(be,{source:o.pcImage.url,alt:o.pcImage.alt||`icon ${r+1}`,role:"img",className:"laptop:h-auto h-[48px] max-w-none",imgClassName:"h-full"},r):null)})]})]})});j.displayName="SecondaryBanner";var Pe=fe(j);export{Pe as default,Ie as secondaryBannerVariants};
@@ -50,6 +50,8 @@ export { default as GraphicOverlay } from './GraphicOverlay/index.js';
50
50
  export { default as Specs } from './Specs/index.js';
51
51
  export { default as TabGroup } from './TabsGroup/index.js';
52
52
  export { default as BizProductProvider, useBizProductContext } from './Listing/BizProductProvider.js';
53
+ export type { ListingFormattedPrices } from './Listing/types.js';
54
+ export { calcSummaryFinalPrice, calcUnlockedSaving } from './Listing/utils/priceCalc.js';
53
55
  export { default as PurchaseBar } from './Listing/components/PurchaseBar/index.js';
54
56
  export { default as ProductActions } from './Listing/components/PurchaseBar/ProductActions/index.js';
55
57
  export type { ProductActionsProps } from './Listing/components/PurchaseBar/ProductActions/index.js';
@@ -1 +1 @@
1
- import{AccessoriesProductGrid as o,SectionHeader as a,PromoBanner as i,MainProductArea as s,AddToCartSuccessPopover as p}from"./AccessoriesShelf/index.js";import{default as f}from"./ActivitySchedule/index.js";import{default as n}from"./GiftShelf/index.js";import{default as u}from"./GiftTierShelf/index.js";import{default as x}from"./ActivityMechanism/index.js";import{default as S}from"./BrandEquity/index.js";import{default as P}from"./MemberEquity/index.js";import{default as g}from"./Slogan/index.js";import{default as B}from"./Title/index.js";import{default as v}from"./Spacer/index.js";import{default as b}from"./ShelfDisplay/index.js";import{default as D}from"./ShelfDisplayHorizontal/index.js";import{default as j}from"./Evaluate/index.js";import{default as L}from"./Category/index.js";import{default as V}from"./HeroBanner/index.js";import{default as k}from"./AccordionCards/index.js";import{default as W}from"./Graphic/index.js";import{default as H}from"./MediaPlayerBase/index.js";import{default as q}from"./MediaPlayerSticky/index.js";import{default as K}from"./MediaPlayerMulti/index.js";import{default as _}from"./Marquee/index.js";import{default as J}from"./MarqueeReview/index.js";import{default as X}from"./WhyChoose/index.js";import{default as $}from"./Faq/index.js";import{MarqueeItem as re,MarqueeImageContent as te,MarqueeTextContent as oe}from"./Marquee/index.js";import{default as ie}from"./MultiLayoutGraphicBlock/index.js";import{default as pe}from"./GraphicAttractionBlock/index.js";import{default as fe}from"./HeaderNavigation/index.js";import{default as ne}from"./FooterNavigation/index.js";import{default as ue}from"./SearchPage/index.js";import{IPC_SEARCH_PAGE as xe,SearchPageTabType as ye}from"./SearchPage/types.js";import{withLayout as he}from"../shared/Styles.js";import{default as Ce}from"./AiuiProvider/index.js";import{default as Me}from"./Tabs/index.js";import{default as Te}from"./SwiperBox/index.js";import{VideoModal as Ie}from"./VideoModal/index.js";import{default as Ae}from"./CreativeModule/index.js";import{default as Fe}from"./GraphicOverlay/index.js";import{default as Ge}from"./Specs/index.js";import{default as Oe}from"./TabsGroup/index.js";import{default as we,useBizProductContext as ke}from"./Listing/BizProductProvider.js";import{default as We}from"./Listing/components/PurchaseBar/index.js";import{default as He}from"./Listing/components/PurchaseBar/ProductActions/index.js";import{default as qe}from"./Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js";import{default as Ke}from"./Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js";import{default as _e}from"./Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js";import{default as Je}from"./Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js";import{default as Xe}from"./Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/index.js";import{default as $e}from"./Listing/components/ProductCard/ProductDetail/ProductOptions/index.js";import{default as rr}from"./Listing/components/ProductCard/ProductDetail/ProductBundle/index.js";import{default as or}from"./Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js";import{default as ir}from"./Listing/components/ProductCard/ProductDetail/ProductBanner/index.js";import{default as pr}from"./Listing/components/ProductCard/ProductGridBox.js";import{default as fr}from"./Listing/components/ProductCard/ProductGallery/index.js";import{default as nr}from"./Listing/components/ProductCard/ProductSummary/index.js";import{default as ur}from"./Listing/components/ProductCard/ProductDetail/BenefitsTab.js";import{default as xr}from"./Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/index.js";import{default as Sr}from"./Listing/components/PaidShipping/index.js";import{default as Pr}from"./Listing/components/CartActionButtons/index.js";import{NotifyMeDialog as gr}from"./NotifyMeDialog/index.js";import{default as Br}from"./Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js";import{default as vr}from"./Listing/components/ProductCard/ProductPaidShipping/index.js";import{default as br}from"./GraphicMore/index.js";import{default as Dr}from"./Features/index.js";import{default as jr}from"./AplusDesc/index.js";import{default as Lr}from"./GiftBox/index.js";import{default as Vr}from"./SelectStore/index.js";import{default as kr}from"./DownLoad/index.js";import{default as Wr}from"./FootCharger/index.js";import{default as Hr}from"./BrandCardLink/index.js";import*as Rr from"./IPRedirect/index.js";import{default as zr}from"./WheelLottery/index.js";import{default as Ur}from"./ProductLottery/index.js";import{default as Yr}from"./ProductCompare/index.js";import{default as Qr}from"./Ksp/index.js";import{default as Zr}from"./ImageTextFeature/index.js";import{default as et}from"./FeatureCards/index.js";import{default as tt}from"./FeaturedBlogPosts/index.js";import{default as at}from"./ImageWithText/index.js";import{default as st}from"./VideoFeature/index.js";import{default as dt}from"./TabsWithMedia/index.js";import{default as ct}from"./TabWithImage/index.js";import{default as lt}from"./FeatureShowcase/index.js";import{default as mt}from"./ProductHero/index.js";import{default as yt}from"./SpecsComparison/index.js";import{default as ht}from"./MediaSceneSwitcher/index.js";import{default as Ct}from"./MediaSceneSwitcherV2/index.js";import{default as Mt}from"./ThreeDCarousel/index.js";import{default as Tt}from"./ProductNav/index.js";import{default as It}from"./AnchorNavigation/index.js";import{default as At}from"./PromotionalBar/index.js";import{default as Ft}from"./EventSchedule/index.js";import{default as Gt}from"./SecondaryBanner/index.js";import{default as Ot}from"./BuyOneGetOneShelf/index.js";import{default as wt}from"./ActiveShelf/index.js";import{default as Nt}from"./MediaShelf/index.js";import{default as Et,CreditsProductCard as Ht}from"./CreditsShelf/index.js";import{default as qt,SceneProductCard as zt}from"./SceneShelf/index.js";import{default as Ut,SceneShelfV2ProductCard as _t}from"./SceneShelfV2/index.js";import{default as Jt}from"./SceneShelfV3/index.js";import{default as Xt}from"./MediaEndorsement/index.js";import{default as $t}from"./MediaTextOverlay/index.js";import{default as ro}from"./ImageOverlayShelf/index.js";import{default as oo,AccessoryProductCard as ao}from"./AccessoriesShelf/components/AccessoryShelf/index.js";import{default as so}from"./ImageTextOverlay/index.js";import{default as fo}from"./MiniCart/index.js";import{default as no}from"./MiniCart/CircleProgress.js";import{default as uo,MiniCartDialog as mo}from"./MiniCart/MiniCartDialog.js";import{default as yo}from"./WebPushPopup/index.js";import{useEmarsysWebPush as ho}from"../hooks/useEmarsysWebPush.js";const e={ActivityMechanism:"ActivityMechanism",ActivitySchedule:"ActivitySchedule",AnchorNavigation:"AnchorNavigation",EventSchedule:"EventSchedule",FeatureCards:"FeatureCards",GiftShelf:"GiftShelf",GiftTierShelf:"GiftTierShelf",ImageTextFeature:"ImageTextFeature",ImageTextOverlay:"ImageTextOverlay",ImageWithText:"ImageWithText",MarqueeReview:"MarqueeReview",MediaSceneSwitcher:"MediaSceneSwitcher",ProductCompare:"ProductCompare",ProductHero:"ProductHero",ProductNav:"ProductNav",PromotionalBar:"PromotionalBar",TabsWithMedia:"TabsWithMedia",ThreeDCarousel:"ThreeDCarousel",VideoFeature:"VideoFeature","ipc-accordioncards":"AccordionCards","ipc-active-shelf":"ActiveShelf","ipc-add-to-cart-success-popover":"AddToCartSuccessPopover","ipc-aplusdesc":"AplusDesc","ipc-banner":"HeroBanner","ipc-bogo-shelf":"BuyOneGetOneShelf","ipc-brand-card-link":"BrandCardLink","ipc-brand-equity":"BrandEquity","ipc-category":"Category","ipc-creativemodule":"CreativeModule","ipc-credits-shelf":"CreditsShelf","ipc-download":"DownLoad","ipc-evaluate":"Evaluate","ipc-faq":"Faq","ipc-features":"Features","ipc-featured-blog-posts":"FeaturedBlogPosts","ipc-footcharger":"FootCharger","ipc-ga-block":"GraphicAttractionBlock","ipc-giftbox":"GiftBox","ipc-graphic":"Graphic","ipc-graphicmore":"GraphicMore","ipc-graphicoverlay":"GraphicOverlay","ipc-image-overlay-shelf":"ImageOverlayShelf","ipc-marquee":"Marquee","ipc-media-endorsement":"MediaEndorsement","ipc-media-shelf":"MediaShelf","ipc-media-scene-switcher-v2":"MediaSceneSwitcherV2","ipc-media-text-overlay":"MediaTextOverlay","ipc-mediaplayerbase":"MediaPlayerBase","ipc-mediaplayermulti":"MediaPlayerMulti","ipc-mediaplayersticky":"MediaPlayerSticky","ipc-member-equity":"MemberEquity","ipc-mini-cart":"MiniCart","ipc-mlg-block":"MultiLayoutGraphicBlock","ipc-notify-me-dialog":"NotifyMeDialog","ipc-product-lottery":"ProductLottery","ipc-scene-shelf":"SceneShelf","ipc-scene-shelf-v2":"SceneShelfV2","ipc-scene-shelf-v3":"SceneShelfV3","ipc-search-page":"SearchPage","ipc-search-page-tabs":"SearchPage","ipc-secondary-banner":"SecondaryBanner","ipc-selectstore":"SelectStore","ipc-shelfdisplay":"ShelfDisplay","ipc-shelfdisplay-horizontal":"ShelfDisplayHorizontal","ipc-slogan":"Slogan","ipc-spacer":"Spacer","ipc-specs":"Specs","ipc-tabs":"Tabs","ipc-title":"Title","ipc-wheel-lottery":"WheelLottery","ipc-whychoose":"WhyChoose",ksp:"Ksp",modalCoupon:"ModalCoupon",modalRegisterSubscribe:"ModalRegisterSubscribe",modalSmsSubscribe:"ModalSmsSubscribe",modalSubscribeConfirm:"ModalSubscribeConfirm",modalVerify:"ModalVerify"};import{CartSummaryHeader as Co,CartItemRow as go,CartGiftSection as Mo,CartPerksSection as Bo,CartThirdPartyBanner as To,CartPriceSummary as vo}from"./CartDetail/index.js";import{useAiuiContext as bo}from"./AiuiProvider/index.js";import{default as Do}from"./ModalRegisterSubscribe/index.js";import{default as jo}from"./ModalSubscribeConfirm/index.js";import{default as Lo}from"./ModalCoupon/index.js";import{default as Vo}from"./ModalSmsSubscribe/index.js";import{default as ko}from"./ModalVerify/index.js";export{o as AccessoriesProductGrid,ao as AccessoryProductCard,oo as AccessoryShelf,k as AccordionCards,wt as ActiveShelf,x as ActivityMechanism,f as ActivitySchedule,p as AddToCartSuccessPopover,Ce as AiuiProvider,It as AnchorNavigation,jr as AplusDesc,ur as BenefitsTab,we as BizProductProvider,Hr as BrandCardLink,S as BrandEquity,Ot as BuyOneGetOneShelf,Pr as CartActionButtons,Mo as CartGiftSection,go as CartItemRow,Bo as CartPerksSection,vo as CartPriceSummary,Co as CartSummaryHeader,To as CartThirdPartyBanner,L as Category,Ae as CreativeModule,xr as CreditCouponRedeem,Ht as CreditsProductCard,Et as CreditsShelf,kr as DownLoad,j as Evaluate,Ft as EventSchedule,$ as Faq,et as FeatureCards,lt as FeatureShowcase,tt as FeaturedBlogPosts,Dr as Features,Wr as FootCharger,ne as FooterNavigation,Lr as GiftBox,n as GiftShelf,u as GiftTierShelf,W as Graphic,pe as GraphicAttractionBlock,br as GraphicMore,Fe as GraphicOverlay,fe as HeaderNavigation,V as HeroBanner,xe as IPC_SEARCH_PAGE,Rr as IPRedirect,ro as ImageOverlayShelf,Zr as ImageTextFeature,so as ImageTextOverlay,at as ImageWithText,Qr as Ksp,s as MainProductArea,_ as Marquee,te as MarqueeImageContent,re as MarqueeItem,J as MarqueeReview,oe as MarqueeTextContent,Xt as MediaEndorsement,H as MediaPlayerBase,K as MediaPlayerMulti,q as MediaPlayerSticky,ht as MediaSceneSwitcher,Ct as MediaSceneSwitcherV2,Nt as MediaShelf,$t as MediaTextOverlay,P as MemberEquity,fo as MiniCart,no as MiniCartCircleProgress,uo as MiniCartDialog,mo as MiniCartDialogComponent,Lo as ModalCoupon,Do as ModalRegisterSubscribe,Vo as ModalSmsSubscribe,jo as ModalSubscribeConfirm,ko as ModalVerify,ie as MultiLayoutGraphicBlock,gr as NotifyMeDialog,e as PAYLOAD_COMPONENT_MAP,Sr as PaidShipping,He as ProductActions,ir as ProductBanner,Ke as ProductBenefits,qe as ProductBenefitsTabs,rr as ProductBundle,Yr as ProductCompare,or as ProductCoupon,Je as ProductFreeGift,Xe as ProductFunctionFreeGift,fr as ProductGallery,pr as ProductGridBox,mt as ProductHero,_e as ProductHighlight,Ur as ProductLottery,Tt as ProductNav,$e as ProductOptions,vr as ProductPaidShipping,Br as ProductServiceBenefits,nr as ProductSummary,i as PromoBanner,At as PromotionalBar,We as PurchaseBar,zt as SceneProductCard,qt as SceneShelf,Ut as SceneShelfV2,_t as SceneShelfV2ProductCard,Jt as SceneShelfV3,ue as SearchPage,ye as SearchPageTabType,Gt as SecondaryBanner,a as SectionHeader,Vr as SelectStore,b as ShelfDisplay,D as ShelfDisplayHorizontal,g as Slogan,v as Spacer,Ge as Specs,yt as SpecsComparison,Te as SwiperBox,Oe as TabGroup,ct as TabWithImage,Me as Tabs,dt as TabsWithMedia,Mt as ThreeDCarousel,B as Title,st as VideoFeature,Ie as VideoModal,yo as WebPushPopup,zr as WheelLottery,X as WhyChoose,bo as useAiuiContext,ke as useBizProductContext,ho as useEmarsysWebPush,he as withLayout};
1
+ import{AccessoriesProductGrid as o,SectionHeader as a,PromoBanner as i,MainProductArea as s,AddToCartSuccessPopover as p}from"./AccessoriesShelf/index.js";import{default as f}from"./ActivitySchedule/index.js";import{default as n}from"./GiftShelf/index.js";import{default as u}from"./GiftTierShelf/index.js";import{default as x}from"./ActivityMechanism/index.js";import{default as S}from"./BrandEquity/index.js";import{default as P}from"./MemberEquity/index.js";import{default as g}from"./Slogan/index.js";import{default as B}from"./Title/index.js";import{default as T}from"./Spacer/index.js";import{default as b}from"./ShelfDisplay/index.js";import{default as D}from"./ShelfDisplayHorizontal/index.js";import{default as j}from"./Evaluate/index.js";import{default as L}from"./Category/index.js";import{default as V}from"./HeroBanner/index.js";import{default as k}from"./AccordionCards/index.js";import{default as W}from"./Graphic/index.js";import{default as H}from"./MediaPlayerBase/index.js";import{default as q}from"./MediaPlayerSticky/index.js";import{default as K}from"./MediaPlayerMulti/index.js";import{default as _}from"./Marquee/index.js";import{default as J}from"./MarqueeReview/index.js";import{default as X}from"./WhyChoose/index.js";import{default as $}from"./Faq/index.js";import{MarqueeItem as re,MarqueeImageContent as te,MarqueeTextContent as oe}from"./Marquee/index.js";import{default as ie}from"./MultiLayoutGraphicBlock/index.js";import{default as pe}from"./GraphicAttractionBlock/index.js";import{default as fe}from"./HeaderNavigation/index.js";import{default as ne}from"./FooterNavigation/index.js";import{default as ue}from"./SearchPage/index.js";import{IPC_SEARCH_PAGE as xe,SearchPageTabType as ye}from"./SearchPage/types.js";import{withLayout as he}from"../shared/Styles.js";import{default as Ce}from"./AiuiProvider/index.js";import{default as Me}from"./Tabs/index.js";import{default as ve}from"./SwiperBox/index.js";import{VideoModal as Ie}from"./VideoModal/index.js";import{default as Ae}from"./CreativeModule/index.js";import{default as Fe}from"./GraphicOverlay/index.js";import{default as Ge}from"./Specs/index.js";import{default as Oe}from"./TabsGroup/index.js";import{default as we,useBizProductContext as ke}from"./Listing/BizProductProvider.js";import{calcSummaryFinalPrice as We,calcUnlockedSaving as Ee}from"./Listing/utils/priceCalc.js";import{default as Re}from"./Listing/components/PurchaseBar/index.js";import{default as ze}from"./Listing/components/PurchaseBar/ProductActions/index.js";import{default as Ue}from"./Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js";import{default as Ye}from"./Listing/components/ProductCard/ProductDetail/ProductBenefits/index.js";import{default as Qe}from"./Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js";import{default as Ze}from"./Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js";import{default as er}from"./Listing/components/ProductCard/ProductDetail/ProductFunctionFreeGift/index.js";import{default as tr}from"./Listing/components/ProductCard/ProductDetail/ProductOptions/index.js";import{default as ar}from"./Listing/components/ProductCard/ProductDetail/ProductBundle/index.js";import{default as sr}from"./Listing/components/ProductCard/ProductDetail/ProductCoupon/index.js";import{default as dr}from"./Listing/components/ProductCard/ProductDetail/ProductBanner/index.js";import{default as cr}from"./Listing/components/ProductCard/ProductGridBox.js";import{default as lr}from"./Listing/components/ProductCard/ProductGallery/index.js";import{default as mr}from"./Listing/components/ProductCard/ProductSummary/index.js";import{default as yr}from"./Listing/components/ProductCard/ProductDetail/BenefitsTab.js";import{default as hr}from"./Listing/components/ProductCard/ProductDetail/CreditCouponRedeem/index.js";import{default as Cr}from"./Listing/components/PaidShipping/index.js";import{default as Mr}from"./Listing/components/CartActionButtons/index.js";import{NotifyMeDialog as vr}from"./NotifyMeDialog/index.js";import{default as Ir}from"./Listing/components/ProductCard/ProductDetail/ProductServiceBenefits/index.js";import{default as Ar}from"./Listing/components/ProductCard/ProductPaidShipping/index.js";import{default as Fr}from"./GraphicMore/index.js";import{default as Gr}from"./Features/index.js";import{default as Or}from"./AplusDesc/index.js";import{default as wr}from"./GiftBox/index.js";import{default as Nr}from"./SelectStore/index.js";import{default as Er}from"./DownLoad/index.js";import{default as Rr}from"./FootCharger/index.js";import{default as zr}from"./BrandCardLink/index.js";import*as Kr from"./IPRedirect/index.js";import{default as _r}from"./WheelLottery/index.js";import{default as Jr}from"./ProductLottery/index.js";import{default as Xr}from"./ProductCompare/index.js";import{default as $r}from"./Ksp/index.js";import{default as rt}from"./ImageTextFeature/index.js";import{default as ot}from"./FeatureCards/index.js";import{default as it}from"./FeaturedBlogPosts/index.js";import{default as pt}from"./ImageWithText/index.js";import{default as ft}from"./VideoFeature/index.js";import{default as nt}from"./TabsWithMedia/index.js";import{default as ut}from"./TabWithImage/index.js";import{default as xt}from"./FeatureShowcase/index.js";import{default as St}from"./ProductHero/index.js";import{default as Pt}from"./SpecsComparison/index.js";import{default as gt}from"./MediaSceneSwitcher/index.js";import{default as Bt}from"./MediaSceneSwitcherV2/index.js";import{default as Tt}from"./ThreeDCarousel/index.js";import{default as bt}from"./ProductNav/index.js";import{default as Dt}from"./AnchorNavigation/index.js";import{default as jt}from"./PromotionalBar/index.js";import{default as Lt}from"./EventSchedule/index.js";import{default as Vt}from"./SecondaryBanner/index.js";import{default as kt}from"./BuyOneGetOneShelf/index.js";import{default as Wt}from"./ActiveShelf/index.js";import{default as Ht}from"./MediaShelf/index.js";import{default as qt,CreditsProductCard as zt}from"./CreditsShelf/index.js";import{default as Ut,SceneProductCard as _t}from"./SceneShelf/index.js";import{default as Jt,SceneShelfV2ProductCard as Qt}from"./SceneShelfV2/index.js";import{default as Zt}from"./SceneShelfV3/index.js";import{default as eo}from"./MediaEndorsement/index.js";import{default as to}from"./MediaTextOverlay/index.js";import{default as ao}from"./ImageOverlayShelf/index.js";import{default as so,AccessoryProductCard as po}from"./AccessoriesShelf/components/AccessoryShelf/index.js";import{default as co}from"./ImageTextOverlay/index.js";import{default as lo}from"./MiniCart/index.js";import{default as mo}from"./MiniCart/CircleProgress.js";import{default as yo,MiniCartDialog as So}from"./MiniCart/MiniCartDialog.js";import{default as Po}from"./WebPushPopup/index.js";import{useEmarsysWebPush as go}from"../hooks/useEmarsysWebPush.js";const e={ActivityMechanism:"ActivityMechanism",ActivitySchedule:"ActivitySchedule",AnchorNavigation:"AnchorNavigation",EventSchedule:"EventSchedule",FeatureCards:"FeatureCards",GiftShelf:"GiftShelf",GiftTierShelf:"GiftTierShelf",ImageTextFeature:"ImageTextFeature",ImageTextOverlay:"ImageTextOverlay",ImageWithText:"ImageWithText",MarqueeReview:"MarqueeReview",MediaSceneSwitcher:"MediaSceneSwitcher",ProductCompare:"ProductCompare",ProductHero:"ProductHero",ProductNav:"ProductNav",PromotionalBar:"PromotionalBar",TabsWithMedia:"TabsWithMedia",ThreeDCarousel:"ThreeDCarousel",VideoFeature:"VideoFeature","ipc-accordioncards":"AccordionCards","ipc-active-shelf":"ActiveShelf","ipc-add-to-cart-success-popover":"AddToCartSuccessPopover","ipc-aplusdesc":"AplusDesc","ipc-banner":"HeroBanner","ipc-bogo-shelf":"BuyOneGetOneShelf","ipc-brand-card-link":"BrandCardLink","ipc-brand-equity":"BrandEquity","ipc-category":"Category","ipc-creativemodule":"CreativeModule","ipc-credits-shelf":"CreditsShelf","ipc-download":"DownLoad","ipc-evaluate":"Evaluate","ipc-faq":"Faq","ipc-features":"Features","ipc-featured-blog-posts":"FeaturedBlogPosts","ipc-footcharger":"FootCharger","ipc-ga-block":"GraphicAttractionBlock","ipc-giftbox":"GiftBox","ipc-graphic":"Graphic","ipc-graphicmore":"GraphicMore","ipc-graphicoverlay":"GraphicOverlay","ipc-image-overlay-shelf":"ImageOverlayShelf","ipc-marquee":"Marquee","ipc-media-endorsement":"MediaEndorsement","ipc-media-shelf":"MediaShelf","ipc-media-scene-switcher-v2":"MediaSceneSwitcherV2","ipc-media-text-overlay":"MediaTextOverlay","ipc-mediaplayerbase":"MediaPlayerBase","ipc-mediaplayermulti":"MediaPlayerMulti","ipc-mediaplayersticky":"MediaPlayerSticky","ipc-member-equity":"MemberEquity","ipc-mini-cart":"MiniCart","ipc-mlg-block":"MultiLayoutGraphicBlock","ipc-notify-me-dialog":"NotifyMeDialog","ipc-product-lottery":"ProductLottery","ipc-scene-shelf":"SceneShelf","ipc-scene-shelf-v2":"SceneShelfV2","ipc-scene-shelf-v3":"SceneShelfV3","ipc-search-page":"SearchPage","ipc-search-page-tabs":"SearchPage","ipc-secondary-banner":"SecondaryBanner","ipc-selectstore":"SelectStore","ipc-shelfdisplay":"ShelfDisplay","ipc-shelfdisplay-horizontal":"ShelfDisplayHorizontal","ipc-slogan":"Slogan","ipc-spacer":"Spacer","ipc-specs":"Specs","ipc-tabs":"Tabs","ipc-title":"Title","ipc-wheel-lottery":"WheelLottery","ipc-whychoose":"WhyChoose",ksp:"Ksp",modalCoupon:"ModalCoupon",modalRegisterSubscribe:"ModalRegisterSubscribe",modalSmsSubscribe:"ModalSmsSubscribe",modalSubscribeConfirm:"ModalSubscribeConfirm",modalVerify:"ModalVerify"};import{CartSummaryHeader as Bo,CartItemRow as vo,CartGiftSection as To,CartPerksSection as Io,CartThirdPartyBanner as bo,CartPriceSummary as Ao}from"./CartDetail/index.js";import{useAiuiContext as Fo}from"./AiuiProvider/index.js";import{default as Go}from"./ModalRegisterSubscribe/index.js";import{default as Oo}from"./ModalSubscribeConfirm/index.js";import{default as wo}from"./ModalCoupon/index.js";import{default as No}from"./ModalSmsSubscribe/index.js";import{default as Eo}from"./ModalVerify/index.js";export{o as AccessoriesProductGrid,po as AccessoryProductCard,so as AccessoryShelf,k as AccordionCards,Wt as ActiveShelf,x as ActivityMechanism,f as ActivitySchedule,p as AddToCartSuccessPopover,Ce as AiuiProvider,Dt as AnchorNavigation,Or as AplusDesc,yr as BenefitsTab,we as BizProductProvider,zr as BrandCardLink,S as BrandEquity,kt as BuyOneGetOneShelf,Mr as CartActionButtons,To as CartGiftSection,vo as CartItemRow,Io as CartPerksSection,Ao as CartPriceSummary,Bo as CartSummaryHeader,bo as CartThirdPartyBanner,L as Category,Ae as CreativeModule,hr as CreditCouponRedeem,zt as CreditsProductCard,qt as CreditsShelf,Er as DownLoad,j as Evaluate,Lt as EventSchedule,$ as Faq,ot as FeatureCards,xt as FeatureShowcase,it as FeaturedBlogPosts,Gr as Features,Rr as FootCharger,ne as FooterNavigation,wr as GiftBox,n as GiftShelf,u as GiftTierShelf,W as Graphic,pe as GraphicAttractionBlock,Fr as GraphicMore,Fe as GraphicOverlay,fe as HeaderNavigation,V as HeroBanner,xe as IPC_SEARCH_PAGE,Kr as IPRedirect,ao as ImageOverlayShelf,rt as ImageTextFeature,co as ImageTextOverlay,pt as ImageWithText,$r as Ksp,s as MainProductArea,_ as Marquee,te as MarqueeImageContent,re as MarqueeItem,J as MarqueeReview,oe as MarqueeTextContent,eo as MediaEndorsement,H as MediaPlayerBase,K as MediaPlayerMulti,q as MediaPlayerSticky,gt as MediaSceneSwitcher,Bt as MediaSceneSwitcherV2,Ht as MediaShelf,to as MediaTextOverlay,P as MemberEquity,lo as MiniCart,mo as MiniCartCircleProgress,yo as MiniCartDialog,So as MiniCartDialogComponent,wo as ModalCoupon,Go as ModalRegisterSubscribe,No as ModalSmsSubscribe,Oo as ModalSubscribeConfirm,Eo as ModalVerify,ie as MultiLayoutGraphicBlock,vr as NotifyMeDialog,e as PAYLOAD_COMPONENT_MAP,Cr as PaidShipping,ze as ProductActions,dr as ProductBanner,Ye as ProductBenefits,Ue as ProductBenefitsTabs,ar as ProductBundle,Xr as ProductCompare,sr as ProductCoupon,Ze as ProductFreeGift,er as ProductFunctionFreeGift,lr as ProductGallery,cr as ProductGridBox,St as ProductHero,Qe as ProductHighlight,Jr as ProductLottery,bt as ProductNav,tr as ProductOptions,Ar as ProductPaidShipping,Ir as ProductServiceBenefits,mr as ProductSummary,i as PromoBanner,jt as PromotionalBar,Re as PurchaseBar,_t as SceneProductCard,Ut as SceneShelf,Jt as SceneShelfV2,Qt as SceneShelfV2ProductCard,Zt as SceneShelfV3,ue as SearchPage,ye as SearchPageTabType,Vt as SecondaryBanner,a as SectionHeader,Nr as SelectStore,b as ShelfDisplay,D as ShelfDisplayHorizontal,g as Slogan,T as Spacer,Ge as Specs,Pt as SpecsComparison,ve as SwiperBox,Oe as TabGroup,ut as TabWithImage,Me as Tabs,nt as TabsWithMedia,Tt as ThreeDCarousel,B as Title,ft as VideoFeature,Ie as VideoModal,Po as WebPushPopup,_r as WheelLottery,X as WhyChoose,We as calcSummaryFinalPrice,Ee as calcUnlockedSaving,Fo as useAiuiContext,ke as useBizProductContext,go as useEmarsysWebPush,he as withLayout};
@@ -1 +1 @@
1
- import{Fragment as N,jsx as t}from"react/jsx-runtime";import m from"react";import{cn as i}from"../helpers/utils.js";import{Slot as g}from"@radix-ui/react-slot";const u=({children:e})=>t(N,{children:e}),d=m.forwardRef(({...e},o)=>{const{asChild:p,children:n,className:s,childClassName:a,spaceY:c="none",spaceTop:r="none",spaceBottom:l="none",...f}=e,C=p?g:"div",y={default:"tablet:my-[80px] laptop:my-[96px] desktop:my-[112px] lg-desktop:my-[128px] my-[64px]",none:""},R={default:"tablet:pt-[80px] laptop:pt-[96px] desktop:pt-[112px] lg-desktop:pt-[128px] pt-[64px]",none:""},b={default:"tablet:pb-[80px] laptop:pb-[96px] desktop:pb-[112px] lg-desktop:pb-[128px] pb-[64px]",none:""};return t(C,{...f,ref:o,className:i(s,"ipc_container","relative z-10 w-full"),children:t("div",{className:i("lg-desktop:max-w-full mx-auto size-full","tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] px-4",a,y?.[c]||c,R?.[r]||r,b?.[l]||l),children:n})})});d.displayName="Section";const x=m.forwardRef(({...e},o)=>{const{children:p,mode:n="section"}=e,a={section:d,fragment:u}[n];return t(a,{...e,ref:o,children:p})});x.displayName="Container";export{x as Container};
1
+ import{Fragment as b,jsx as o}from"react/jsx-runtime";import i from"react";import{cn as l}from"../helpers/utils.js";import{Slot as u}from"@radix-ui/react-slot";const N=({children:e})=>o(b,{children:e}),d=i.forwardRef(({...e},t)=>{const{asChild:p,children:n,className:s,childClassName:a,spaceY:c="none",spaceTop:r="none",spaceBottom:m="none",...x}=e,C=p?u:"div",y={default:"tablet:my-[80px] laptop:my-[96px] desktop:my-[112px] lg-desktop:my-[128px] my-[64px]",none:""},R={default:"tablet:pt-[80px] laptop:pt-[96px] desktop:pt-[112px] lg-desktop:pt-[128px] pt-[64px]",none:""},g={default:"tablet:pb-[80px] laptop:pb-[96px] desktop:pb-[112px] lg-desktop:pb-[128px] pb-[64px]",none:""};return o(C,{...x,ref:t,className:l(s,"ipc_container","relative z-10 w-full"),children:o("div",{className:l("lg-desktop:max-w-full px-grid mx-auto size-full",a,y?.[c]||c,R?.[r]||r,g?.[m]||m),children:n})})});d.displayName="Section";const f=i.forwardRef(({...e},t)=>{const{children:p,mode:n="section"}=e,a={section:d,fragment:N}[n];return o(a,{...e,ref:t,children:p})});f.displayName="Container";export{f as Container};
@@ -1 +1 @@
1
- import{clsx as u}from"clsx";import{extendTailwindMerge as l}from"tailwind-merge";const f=l({extend:{theme:{borderRadius:["btn","box","box-small","card","tabs","sidebar-shelf","image-text"]},classGroups:{"font-size":["text-heading-1","text-heading-2","text-heading-3","text-heading-4","text-heading-5","text-text-3","text-text-2","text-text-1"],"text-color":["text-info-primary","text-info-secondary","text-info-tertiary","text-info-quaternary","text-info-white"],leading:["leading-tight","leading-normal","leading-loose"]}}});function d(...t){return f(u(t))}function a(){}function b(t){return t&&typeof t=="string"&&t.includes("/")?t.split("/").pop()?.split("?")?.shift():t}const y=t=>t?.replace(/\s+/g,"-"),g=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),p=(t,r,e="{",n="}")=>{if(!t||!r||Object.keys(r).length===0)return t;const s=g(e),o=g(n),i=new RegExp(`${s}([a-zA-Z0-9_-]+)${o}`,"g");return t.replace(i,(x,c)=>r[c]!==void 0?r[c]:x)},w=(t,r)=>{try{if(!t||!r)return t;const e=g(r),n=new RegExp(e,"gi");return t.replace(n,s=>`<span class='text-brand-0 font-bold'>${s}</span>`)}catch(e){return console.error("highlightSearchWord error:",e),t}},R=(t,r,e)=>{if(!t)return t;if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("#"))return e?t.includes("?")?`${t}&${e}`:`${t}?${e}`:t;const n=t.split("/").filter(Boolean);if(n.length===0){const i=r==="us"?"/":`/${r}`;return e?`${i}?${e}`:i}if(n[0]===r){const i=`/${n.join("/")}`;return e?`${i}?${e}`:i}const o=`${r==="us"?"":`/${r}`}/${n.join("/")}`;return e?`${o}?${e}`:o};export{b as atobID,d as cn,R as getLocalizedPath,w as highlightSearchWord,a as noop,p as replaceTemplate,y as spaceToHyphen};
1
+ import{clsx as u}from"clsx";import{extendTailwindMerge as l}from"tailwind-merge";const f=l({extend:{theme:{spacing:["grid"],borderRadius:["btn","box","box-small","card","tabs","sidebar-shelf","image-text"]},classGroups:{"font-size":["text-heading-1","text-heading-2","text-heading-3","text-heading-4","text-heading-5","text-text-3","text-text-2","text-text-1"],"text-color":["text-info-primary","text-info-secondary","text-info-tertiary","text-info-quaternary","text-info-white"],leading:["leading-tight","leading-normal","leading-loose"]}}});function $(...t){return f(u(t))}function a(){}function b(t){return t&&typeof t=="string"&&t.includes("/")?t.split("/").pop()?.split("?")?.shift():t}const p=t=>t?.replace(/\s+/g,"-"),g=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),y=(t,r,e="{",n="}")=>{if(!t||!r||Object.keys(r).length===0)return t;const s=g(e),o=g(n),i=new RegExp(`${s}([a-zA-Z0-9_-]+)${o}`,"g");return t.replace(i,(x,c)=>r[c]!==void 0?r[c]:x)},w=(t,r)=>{try{if(!t||!r)return t;const e=g(r),n=new RegExp(e,"gi");return t.replace(n,s=>`<span class='text-brand-0 font-bold'>${s}</span>`)}catch(e){return console.error("highlightSearchWord error:",e),t}},R=(t,r,e)=>{if(!t)return t;if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("#"))return e?t.includes("?")?`${t}&${e}`:`${t}?${e}`:t;const n=t.split("/").filter(Boolean);if(n.length===0){const i=r==="us"?"/":`/${r}`;return e?`${i}?${e}`:i}if(n[0]===r){const i=`/${n.join("/")}`;return e?`${i}?${e}`:i}const o=`${r==="us"?"":`/${r}`}/${n.join("/")}`;return e?`${o}?${e}`:o};export{b as atobID,$ as cn,R as getLocalizedPath,w as highlightSearchWord,a as noop,y as replaceTemplate,p as spaceToHyphen};
@@ -117,6 +117,54 @@
117
117
  }
118
118
 
119
119
 
120
+ :root {
121
+ --grid-margin: 16px;
122
+ }
123
+
124
+ @media (min-width: 768px) {
125
+ :root {
126
+ --grid-margin: 32px;
127
+ }
128
+ }
129
+
130
+ @media (min-width: 1025px) {
131
+ :root {
132
+ --grid-margin: 64px;
133
+ }
134
+ }
135
+
136
+ @media (min-width: 1920px) {
137
+ :root {
138
+ --grid-margin: calc(50% - 832px);
139
+ }
140
+ }
141
+
142
+ /* 默认是阶梯式:16 / 32 / 64px,1440 至 1919px 固定 64px,1920px 起居中 1664px。
143
+ 流式需要主动开启:在祖先元素或 <html> 上声明 data-grid="fluid"(或 .grid-fluid),
144
+ 其内的 px-grid 在 1440 至 1920px 之间从 64px 线性过渡到 128px。
145
+ data-grid="legacy"(或 .grid-legacy)用于在流式范围内的局部区域切回阶梯式。
146
+ 选择器优先级相同,靠书写顺序生效,顺序不可调换。 */
147
+ @media (min-width: 1440px) {
148
+ [data-grid='fluid'],
149
+ .grid-fluid {
150
+ --grid-margin: clamp(64px, calc(64px + (100% - 1440px) * 64 / 480), 128px);
151
+ }
152
+
153
+ [data-grid='legacy'],
154
+ .grid-legacy {
155
+ --grid-margin: 64px;
156
+ }
157
+ }
158
+
159
+ @media (min-width: 1920px) {
160
+ [data-grid='fluid'],
161
+ .grid-fluid,
162
+ [data-grid='legacy'],
163
+ .grid-legacy {
164
+ --grid-margin: calc(50% - 832px);
165
+ }
166
+ }
167
+
120
168
  @media (min-width: 1024px) {
121
169
  :root {
122
170
  --card-radius: 16px;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anker-in/headless-ui",
3
- "version": "1.3.85",
3
+ "version": "1.3.87",
4
4
  "type": "commonjs",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "types": "./dist/cjs/index.d.ts",