@anker-in/headless-ui 1.3.70-alpha.1789705399245 → 1.3.71

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 (79) hide show
  1. package/dist/cjs/biz-components/ActiveShelf/ProductCard.d.ts +2 -50
  2. package/dist/cjs/biz-components/ActiveShelf/ProductCard.js +1 -1
  3. package/dist/cjs/biz-components/ActiveShelf/index.d.ts +5 -49
  4. package/dist/cjs/biz-components/ActiveShelf/index.js +1 -1
  5. package/dist/cjs/biz-components/ActiveShelf/types.d.ts +0 -53
  6. package/dist/cjs/biz-components/ActiveShelf/types.js +1 -1
  7. package/dist/cjs/biz-components/ActivitySchedule/index.js +1 -1
  8. package/dist/cjs/biz-components/BrandEquity/BrandEquity.js +1 -1
  9. package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  10. package/dist/cjs/biz-components/HeaderNavigation/MobileMenuComponents.d.ts +1 -2
  11. package/dist/cjs/biz-components/HeaderNavigation/MobileMenuComponents.js +1 -1
  12. package/dist/cjs/biz-components/HeaderNavigation/SidebarDropdown.js +1 -1
  13. package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
  14. package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
  15. package/dist/cjs/biz-components/ImageWithText/types.d.ts +2 -2
  16. package/dist/cjs/biz-components/Ksp/index.d.ts +0 -2
  17. package/dist/cjs/biz-components/Ksp/index.js +1 -1
  18. package/dist/cjs/biz-components/ProductNav/ProductNav.js +1 -1
  19. package/dist/cjs/biz-components/SecondaryBanner/index.d.ts +0 -10
  20. package/dist/cjs/biz-components/SecondaryBanner/index.js +1 -1
  21. package/dist/cjs/biz-components/Specs/dropdown.d.ts +1 -2
  22. package/dist/cjs/biz-components/Specs/dropdown.js +2 -2
  23. package/dist/cjs/biz-components/Specs/index.js +1 -1
  24. package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
  25. package/dist/cjs/components/badge.d.ts +1 -1
  26. package/dist/cjs/components/badge.js +1 -1
  27. package/dist/cjs/components/link.js +1 -1
  28. package/dist/cjs/helpers/utils.js +1 -1
  29. package/dist/cjs/hooks/useDraggableScroll.js +1 -1
  30. package/dist/cjs/hooks/useExposure.d.ts +1 -1
  31. package/dist/cjs/hooks/useExposure.js +1 -1
  32. package/dist/cjs/hooks/useViewItemList.d.ts +1 -1
  33. package/dist/esm/biz-components/ActiveShelf/ProductCard.d.ts +2 -50
  34. package/dist/esm/biz-components/ActiveShelf/ProductCard.js +1 -1
  35. package/dist/esm/biz-components/ActiveShelf/index.d.ts +5 -49
  36. package/dist/esm/biz-components/ActiveShelf/index.js +1 -1
  37. package/dist/esm/biz-components/ActiveShelf/types.d.ts +0 -53
  38. package/dist/esm/biz-components/ActivitySchedule/index.js +1 -1
  39. package/dist/esm/biz-components/BrandEquity/BrandEquity.js +1 -1
  40. package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
  41. package/dist/esm/biz-components/HeaderNavigation/MobileMenuComponents.d.ts +1 -2
  42. package/dist/esm/biz-components/HeaderNavigation/MobileMenuComponents.js +1 -1
  43. package/dist/esm/biz-components/HeaderNavigation/SidebarDropdown.js +1 -1
  44. package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
  45. package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
  46. package/dist/esm/biz-components/ImageWithText/types.d.ts +2 -2
  47. package/dist/esm/biz-components/Ksp/index.d.ts +0 -2
  48. package/dist/esm/biz-components/Ksp/index.js +1 -1
  49. package/dist/esm/biz-components/ProductNav/ProductNav.js +1 -1
  50. package/dist/esm/biz-components/SecondaryBanner/index.d.ts +0 -10
  51. package/dist/esm/biz-components/SecondaryBanner/index.js +1 -1
  52. package/dist/esm/biz-components/Specs/dropdown.d.ts +1 -2
  53. package/dist/esm/biz-components/Specs/dropdown.js +2 -2
  54. package/dist/esm/biz-components/Specs/index.js +1 -1
  55. package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
  56. package/dist/esm/components/badge.d.ts +1 -1
  57. package/dist/esm/components/badge.js +1 -1
  58. package/dist/esm/components/link.js +1 -1
  59. package/dist/esm/helpers/utils.js +1 -1
  60. package/dist/esm/hooks/useDraggableScroll.js +1 -1
  61. package/dist/esm/hooks/useExposure.d.ts +1 -1
  62. package/dist/esm/hooks/useExposure.js +1 -1
  63. package/dist/esm/hooks/useViewItemList.d.ts +1 -1
  64. package/dist/tokens/oneAnker.css +0 -12
  65. package/package.json +1 -1
  66. package/style.css +9 -156
  67. package/tailwind.config.js +0 -5
  68. package/dist/cjs/biz-components/ActiveShelf/MemberLabel.d.ts +0 -42
  69. package/dist/cjs/biz-components/ActiveShelf/MemberLabel.js +0 -1
  70. package/dist/cjs/biz-components/ActiveShelf/styles.d.ts +0 -55
  71. package/dist/cjs/biz-components/ActiveShelf/styles.js +0 -1
  72. package/dist/cjs/biz-components/HeaderNavigation/useNavCollapse.d.ts +0 -30
  73. package/dist/cjs/biz-components/HeaderNavigation/useNavCollapse.js +0 -1
  74. package/dist/esm/biz-components/ActiveShelf/MemberLabel.d.ts +0 -42
  75. package/dist/esm/biz-components/ActiveShelf/MemberLabel.js +0 -1
  76. package/dist/esm/biz-components/ActiveShelf/styles.d.ts +0 -55
  77. package/dist/esm/biz-components/ActiveShelf/styles.js +0 -1
  78. package/dist/esm/biz-components/HeaderNavigation/useNavCollapse.d.ts +0 -30
  79. package/dist/esm/biz-components/HeaderNavigation/useNavCollapse.js +0 -1
@@ -1,21 +1,14 @@
1
1
  import * as React from 'react';
2
- import type { ButtonFunctionType, CopyConfig, UserType, ActivityLabel, DiscountTagStyle, ActiveShelfLayoutMode } from './types.js';
2
+ import type { ButtonFunctionType, CopyConfig } from './types.js';
3
3
  import type { BadgeProps } from '../../components/badge.js';
4
- import type { Img } from '../../types/props.js';
5
4
  /**
6
5
  * 语义化类名
7
6
  */
8
- export type ActiveShelfSemanticName = 'root' | 'title' | 'description' | 'tabsList' | 'promotionalBar' | 'productCard' | 'discountBadge' | 'discountBadgeText' | 'productTitle' | 'productDescription' | 'productPriceLabel' | 'productPrice' | 'originalPrice' | 'buttonGroup' | 'secondaryButton' | 'primaryButton' | 'stockTrack' | 'stockBar';
7
+ export type ActiveShelfSemanticName = 'root' | 'title' | 'description' | 'productCard' | 'productTitle' | 'productDescription' | 'productPriceLabel' | 'productPrice' | 'originalPrice' | 'buttonGroup' | 'secondaryButton' | 'primaryButton' | 'stockTrack' | 'stockBar';
9
8
  /**
10
9
  * 库存展示模式
11
10
  */
12
11
  export type StockDisplayMode = 'always' | 'never' | 'below-quantity' | 'below-percentage';
13
- interface SocialEndorsementItem {
14
- /** 图标:图片 URL 字符串,或 SVG React 节点 */
15
- icon: string | React.ReactNode;
16
- /** 无障碍标签 */
17
- label?: string;
18
- }
19
12
  /**
20
13
  * 基础产品数据接口(来自外部数据源)
21
14
  */
@@ -28,10 +21,6 @@ export interface BaseProductData {
28
21
  shopify_id: string;
29
22
  custom_name?: string;
30
23
  custom_description?: string;
31
- /** 自定义产品卡片背景图 URL */
32
- custom_bg_image?: string | null;
33
- /** 自定义产品卡片场景图 URL(鼠标 hover 时覆盖背景图) */
34
- custom_scene_image?: string | null;
35
24
  }
36
25
  /**
37
26
  * Shopify 变体数据接口
@@ -85,16 +74,6 @@ export interface VariantData {
85
74
  * 通用折扣数据,包括折扣title, 类型和值
86
75
  */
87
76
  coupon: any;
88
- /** 社媒背书图标(socialEndorsements: SocialEndorsementItem[] */
89
- socialEndorsements?: SocialEndorsementItem[];
90
- /** 普通会员折扣金额(格式化后的字符串,如 '$20') */
91
- memberDiscountAmount?: string;
92
- /** 付费会员折扣金额(格式化后的字符串,如 '$30') */
93
- plusMemberDiscountAmount?: string;
94
- /** 折扣金额(string 类型,用于左上角折扣标签展示) */
95
- discountAmount?: string;
96
- /** SKU 会员活动配置(对象数组,每项含 type 与 label) */
97
- activityLabels?: ActivityLabel[];
98
77
  }
99
78
  /**
100
79
  * 完整的产品卡片数据接口
@@ -111,12 +90,6 @@ export interface ProductCardProps {
111
90
  className?: string;
112
91
  /** 是否展示标签系统 */
113
92
  showTags?: boolean;
114
- /** 是否展示价格标签 */
115
- isShowPricesTag?: boolean;
116
- /** 是否展示会员价格与价格标签(价格下方的会员标签,如 Member Price) */
117
- showMemberPrice?: boolean;
118
- /** 布局模式:网格布局(flex)或横向轮播(horizontal),用于切换 CardContent/MemberLabel 间距 */
119
- layoutMode?: ActiveShelfLayoutMode;
120
93
  /** 库存展示模式 */
121
94
  stockDisplayMode?: StockDisplayMode;
122
95
  /** 库存阈值(当模式为 below-quantity 或 below-percentage 时使用) */
@@ -151,27 +124,6 @@ export interface ProductCardProps {
151
124
  /** 文案配置 */
152
125
  copy?: CopyConfig;
153
126
  onProductImageClick?: (product: ProductCardData) => void;
154
- /** active-shelf-items-tag(自定义标签)文案颜色。设置后会隐藏默认品牌色描边 */
155
- itemsTagTextColor?: string;
156
- /** active-shelf-items-tag 背景颜色,设置后会覆盖默认的品牌渐变背景并隐藏默认品牌色描边 */
157
- itemsTagBgColor?: string;
158
- /** 用户身份(会员标签模块) */
159
- userType?: UserType;
160
- /** 会员标签模块三种状态的装饰图 */
161
- memberImages?: Partial<Record<UserType, Img>>;
162
- /** 左上角自定义标签图标 */
163
- customTagsIcon?: Img;
164
- /** 自定义折扣标签图标样式(style1/style2/style3 为内置预设,custom 为自定义上传) */
165
- customTagStyle?: DiscountTagStyle;
166
- /** 点击会员标签模块游客副标题(注册/登录)回调 */
167
- onMemberSignUp?: () => void;
168
- /** 点击会员标签模块付费会员折扣文案(加购付费会员sku)回调 */
169
- onPlusMemberAddCart?: () => void;
170
- /** 自定义折扣标签渲染(仅 customTagStyle=custom 时生效) */
171
- renderDiscountBadge?: (ctx: {
172
- text?: string;
173
- layoutMode: ActiveShelfLayoutMode;
174
- }) => React.ReactNode;
175
127
  }
176
128
  /**
177
129
  * 产品卡片组件
@@ -1 +1 @@
1
- "use strict";"use client";var le=Object.create;var P=Object.defineProperty;var ce=Object.getOwnPropertyDescriptor;var de=Object.getOwnPropertyNames;var ue=Object.getPrototypeOf,me=Object.prototype.hasOwnProperty;var ge=(e,a)=>{for(var s in a)P(e,s,{get:a[s],enumerable:!0})},E=(e,a,s,d)=>{if(a&&typeof a=="object"||typeof a=="function")for(let c of de(a))!me.call(e,c)&&c!==s&&P(e,c,{get:()=>a[c],enumerable:!(d=ce(a,c))||d.enumerable});return e};var be=(e,a,s)=>(s=e!=null?le(ue(e)):{},E(a||!e||!e.__esModule?P(s,"default",{value:e,enumerable:!0}):s,e)),ye=e=>E(P({},"__esModule",{value:!0}),e);var he={};ge(he,{ProductCard:()=>A,default:()=>xe});module.exports=ye(he);var t=require("react/jsx-runtime"),N=be(require("react")),n=require("../../helpers/index.js"),i=require("../../components/index.js"),j=require("./MemberLabel.js"),L=require("./styles.js");const fe=5;function pe(e,a,s,d){if(e===void 0)return!0;switch(e){case"always":return!0;case"never":return!1;case"below-quantity":return a===void 0?!0:s<=a;case"below-percentage":return a===void 0?!0:s/d*100<=a;default:return!0}}const ve=({items:e})=>e?.length?(0,t.jsx)("div",{className:"active-shelf-display-social-endorsements desktop:gap-2 laptop:flex absolute right-0 top-0 z-10 hidden flex-col items-center gap-1",children:e.slice(0,3).map((a,s)=>typeof a.icon=="string"?(0,t.jsx)("img",{src:a.icon,alt:a.label||"",loading:"lazy",className:"desktop:size-10 lg-desktop:size-12 size-8 object-contain"},s):(0,t.jsx)(i.Text,{"aria-label":a.label,className:"desktop:size-10 lg-desktop:size-12 size-8 [&_img]:size-full [&_svg]:size-full",children:a.icon},s))}):null,F={style1:{bg:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/2_7746fc9c-d4e4-4a59-a972-fa4cb0f3f8bd.png?v=1789381635",textClass:"aiui-dark text-info-primary"},style2:{bg:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_e0438358-493b-40cb-9a58-89d6ee2d3751.png?v=1789381628",textClass:"aiui-dark text-info-primary"},style3:{bg:"https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_19208ba4-71ea-4580-892d-72167f1cf606.png?v=1789381639",textClass:"aiui-dark text-info-primary"}},Se=({text:e,style:a="style1",icon:s,className:d,textClassName:c,layoutMode:S="flex",renderBadge:y})=>{if(!e)return null;const m=a==="custom",o=m&&!!y,f=m&&!y&&!!s?.url,p=m?void 0:F[a],g=F.style1,u=L.layoutModeStyles[S],x={style1:u.discountBadgeText,style2:u.discountBadgeTextStyle2,style3:u.discountBadgeTextStyle3},h=m?u.discountBadgeTextCenter:x[a];return(0,t.jsxs)("div",{className:(0,n.cn)("active-shelf-discount-badge","absolute left-0 top-0 z-10",u.discountBadgeSize,d),children:[o?y({text:e,layoutMode:S}):f?(0,t.jsx)(i.Picture,{source:s.url,alt:s.alt||e,className:"block size-full",imgClassName:"block size-full object-contain"}):(0,t.jsx)("img",{src:(p??g).bg,alt:e,loading:"lazy",className:"block size-full object-contain"}),!o&&(0,t.jsx)("span",{className:(0,n.cn)("active-shelf-discount-badge-text text-center","absolute inset-0 font-bold !leading-[1.2]",h,(p??g).textClass,c),children:e})]})},A=N.forwardRef(({product:e,className:a,showTags:s=!0,stockDisplayMode:d,stockThresholdValue:c,onLearnMore:S,onShopNow:y,onAddToCart:m,classNames:o,secondaryButtonText:f,secondaryButtonFun:p,primaryButtonText:g,primaryButtonFun:u,showOriginalPrice:x,renderOriginalPrice:h,copy:b,onProductImageClick:B,itemsTagTextColor:k,itemsTagBgColor:v,userType:C,memberImages:q,customTagsIcon:O,customTagStyle:$,onMemberSignUp:U,onPlusMemberAddCart:G,showMemberPrice:z,layoutMode:T,renderDiscountBadge:H},K)=>{const[V,J]=N.useState(!1),[Q,W]=N.useState(!1),X=e?.memberDiscountAmount,Y=e?.plusMemberDiscountAmount,Z=e?.activityLabels??[],ee=C==="guest"?"guest":"member",_=Z.find(l=>l.type===ee)?.label,te=C==="guest"?b?.memberActivityLabelUnLogin:b?.memberActivityLabel,ae=!!_||!!te,ie=e?.discountAmount,r=L.layoutModeStyles[T??"flex"],ne=N.useMemo(()=>e?.availableForSale&&e?.quantityAvailable<=0?fe:e?.availableForSale?(e?.quantityAvailable??0)/(e?.totalInventory??1)*100:0,[e?.availableForSale,e?.quantityAvailable,e?.totalInventory]),M=async(l,D)=>{if(!l)return;const I=D==="primary"?J:W;I(!0);try{switch(l){case"buyNow":await y?.(e);break;case"addCart":await m?.(e);break;case"learnMore":await S?.(e);break;default:break}}finally{I(!1)}},se=e.availableForSale&&e.quantityAvailable<=0,oe={...k?{color:k}:{},...v?{backgroundColor:v,backgroundImage:"none"}:{},...k||v?{outlineColor:k}:{}},w=!!e.custom_bg_image,re=!!e.custom_scene_image,R=l=>l?{backgroundImage:`url(${l})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}:void 0;return(0,t.jsxs)(i.Card,{ref:K,className:(0,n.cn)("hover:bg-container-secondary-0 bg-container-primary relative flex h-full flex-col overflow-hidden border-none",r.cardRadius,a,o?.productCard),children:[(0,t.jsx)(Se,{text:ie,style:$,icon:O,layoutMode:T,renderBadge:H,className:o?.discountBadge,textClassName:o?.discountBadgeText}),(0,t.jsxs)(i.CardContent,{className:(0,n.cn)(r.cardContent,"relative flex flex-1 flex-col justify-between"),children:[(0,t.jsxs)("div",{className:"product-image-wrapper group/product-image relative mb-4",children:[w&&(0,t.jsx)("div",{"aria-hidden":!0,className:(0,n.cn)("absolute inset-0 z-20",r.imageOffset),style:R(e.custom_bg_image)}),re&&(0,t.jsx)("div",{"aria-hidden":!0,className:(0,n.cn)("absolute inset-0 z-20 opacity-0 transition-opacity duration-300 group-hover/product-image:opacity-100",r.imageOffset),style:R(e.custom_scene_image)}),(0,t.jsx)("div",{className:(0,n.cn)("product-image mx-auto cursor-pointer overflow-hidden",r.image),children:(0,t.jsx)("a",{onClick:()=>B?.(e),...!B&&{href:e?.listingLink},rel:"noreferrer",className:(0,n.cn)("block size-full",w&&"opacity-0"),children:(0,t.jsx)(i.Picture,{source:e.image,alt:e.name,className:"aspect-square size-full object-contain",imgClassName:"size-full object-contain"})})}),(0,t.jsx)(ve,{items:e?.socialEndorsements})]}),s&&(0,t.jsx)("div",{className:"desktop:mb-2 mb-1 flex h-[24px] gap-1",children:e.tags?.map((l,D)=>l.label&&(0,t.jsx)(i.Badge,{size:"sm",variant:l.variant||"outline",className:"active-shelf-items-tag py-0",style:oe,children:l.label},D))}),(0,t.jsxs)("div",{className:"flex h-full flex-1 grow flex-col justify-between gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(i.Heading,{as:"h3",size:"none",className:(0,n.cn)("text-info-primary",r.title,o?.productTitle),html:e.custom_name||e.name}),e?.description&&(0,t.jsx)(i.Text,{size:"none",className:(0,n.cn)("active-shelf-product-description text-info-primary",r.description,o?.productDescription),html:e.custom_description||e.description})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:(0,n.cn)(o?.productPrice),children:(0,t.jsx)("div",{className:(0,n.cn)("flex items-baseline",r.priceGap),children:e.availableForSale?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.Heading,{size:"none",className:(0,n.cn)("text-info-primary",r.price),as:"h6",children:e.price}),h?h(e,{showOriginalPrice:x}):x&&e.originalPrice&&(0,t.jsx)(i.Heading,{size:"none",className:(0,n.cn)("text-info-tertiary line-through",r.price,o?.originalPrice),as:"h6",children:e.originalPrice})]}):(0,t.jsx)(i.Heading,{size:"none",className:(0,n.cn)("text-info-tertiary",r.price),children:b?.outOfStockLabel??"Sold Out"})})}),z&&e?.priceLabel&&e?.availableForSale&&(0,t.jsx)("div",{className:(0,n.cn)("min-h-[1lh]",r.priceLabel),children:(0,t.jsx)(i.Text,{size:"none",className:(0,n.cn)("text-brand-0",o?.productPriceLabel),style:{...v?{color:v}:{}},children:e.priceLabel})}),(0,t.jsxs)("div",{className:(0,n.cn)("mt-2 flex",r.buttonContainer,o?.buttonGroup),children:[f&&(0,t.jsx)(i.Button,{variant:"secondary",size:"lg",className:(0,n.cn)(r.buttonItem,o?.secondaryButton),onClick:()=>M(p,"secondary"),disabled:!e.availableForSale&&p!=="learnMore",loading:Q,"data-headless-type-name":"ActiveShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${f}`,"data-headless-sku":e.sku,children:f}),g&&(0,t.jsx)(i.Button,{variant:"primary",size:"lg",className:(0,n.cn)(r.buttonItem,o?.primaryButton),onClick:()=>M(u,"primary"),disabled:!e.availableForSale&&u!=="learnMore",loading:V,"data-headless-type-name":"ActiveShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${g}`,"data-headless-sku":e.sku,children:g})]}),pe(d,c,e?.quantityAvailable??0,e?.totalInventory??0)&&(0,t.jsxs)("div",{className:"mt-4 flex flex-col gap-1",children:[(0,t.jsx)(i.Progress,{value:ne,max:100,min:0,size:"base",variant:"default","aria-label":"stock progress",classNames:{root:(0,n.cn)("bg-[var(--progress-track-bg,rgba(0,0,0,0.2))]",o?.stockTrack),progressBar:(0,n.cn)("bg-brand-0 transition-all duration-300 ease-in-out",o?.stockBar)}}),(0,t.jsx)(i.Text,{size:3,className:"text-info-tertiary text-[14px]",children:se?b?.limitedStock:b?.stockDisplayText?.replace("{count}",`${e.availableForSale?e.quantityAvailable:0}`)})]})]})]})]}),z&&C&&(0,t.jsx)(j.MemberLabel,{userType:C,copy:b,images:q,onSignUp:U,onPlusMemberAddCart:G,hasActivity:ae,activityLabel:_,memberDiscountAmount:X,plusMemberDiscountAmount:Y,layoutMode:T})]})});A.displayName="ActiveShelf.ProductCard";var xe=A;
1
+ "use strict";"use client";var q=Object.create;var p=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var $=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var I=(e,i)=>{for(var r in i)p(e,r,{get:i[r],enumerable:!0})},C=(e,i,r,c)=>{if(i&&typeof i=="object"||typeof i=="function")for(let s of _(i))!E.call(e,s)&&s!==r&&p(e,s,{get:()=>i[s],enumerable:!(c=M(i,s))||c.enumerable});return e};var j=(e,i,r)=>(r=e!=null?q($(e)):{},C(i||!e||!e.__esModule?p(r,"default",{value:e,enumerable:!0}):r,e)),H=e=>C(p({},"__esModule",{value:!0}),e);var V={};I(V,{ProductCard:()=>u,default:()=>K});module.exports=H(V);var a=require("react/jsx-runtime"),d=j(require("react")),n=require("../../helpers/index.js"),t=require("../../components/index.js");const O=5;function G(e,i,r,c){if(e===void 0)return!0;switch(e){case"always":return!0;case"never":return!1;case"below-quantity":return i===void 0?!0:r<=i;case"below-percentage":return i===void 0?!0:r/c*100<=i;default:return!0}}const u=d.forwardRef(({product:e,className:i,showTags:r=!0,stockDisplayMode:c,stockThresholdValue:s,onLearnMore:S,onShopNow:N,onAddToCart:B,classNames:o,secondaryButtonText:b,secondaryButtonFun:y,primaryButtonText:f,primaryButtonFun:v,showOriginalPrice:x,renderOriginalPrice:k,copy:g,onProductImageClick:h},D)=>{const[L,T]=d.useState(!1),[F,z]=d.useState(!1),A=d.useMemo(()=>e?.availableForSale&&e?.quantityAvailable<=0?O:e?.availableForSale?(e?.quantityAvailable??0)/(e?.totalInventory??1)*100:0,[e?.availableForSale,e?.quantityAvailable,e?.totalInventory]),w=async(l,m)=>{if(!l)return;const P=m==="primary"?T:z;P(!0);try{switch(l){case"buyNow":await N?.(e);break;case"addCart":await B?.(e);break;case"learnMore":await S?.(e);break;default:break}}finally{P(!1)}},R=e.availableForSale&&e.quantityAvailable<=0;return(0,a.jsx)(t.Card,{ref:D,className:(0,n.cn)("bg-container-primary hover:bg-container-secondary-0 flex h-full flex-col overflow-hidden border-none",i,o?.productCard),children:(0,a.jsxs)(t.CardContent,{className:"desktop:p-6 relative flex flex-1 flex-col justify-between p-4",children:[(0,a.jsx)("div",{className:"lg-desktop:h-[28px] flex h-[24px] gap-1",children:r&&e.tags?.map((l,m)=>l.label?(0,a.jsx)(t.Badge,{size:"sm",variant:l.variant||"outline",className:(0,n.cn)(l.variant==="promotional"?"ml-2":""),promotionalType:l.promotionalType,children:l.label},m):(0,a.jsx)(d.Fragment,{children:l},m))}),(0,a.jsx)("div",{className:"product-image-wrapper lg-desktop:size-[196px] mx-auto size-[138px] cursor-pointer overflow-hidden",children:(0,a.jsx)("a",{onClick:()=>h?.(e),...!h&&{href:e?.listingLink},rel:"noreferrer",children:(0,a.jsx)(t.Picture,{source:e.image,alt:e.name,className:"aspect-square size-full object-contain",imgClassName:"w-full h-full object-contain"})})}),(0,a.jsxs)("div",{className:"flex h-full flex-1 grow flex-col justify-between",children:[(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsx)(t.Heading,{as:"h3",size:2,className:(0,n.cn)("text-info-primary mb-2 line-clamp-2 min-h-[2.4em]",o?.productTitle),html:e.custom_name||e.name}),e?.description&&(0,a.jsx)(t.Text,{size:2,className:(0,n.cn)("text-info-secondary desktop:line-clamp-2 desktop:min-h-[2.4em] desktop:text-[16px] lg-desktop:text-[18px] line-clamp-2 min-h-[2.4em] text-[14px]",o?.productDescription),html:e.custom_description||e.description})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:(0,n.cn)("mb-2",o?.productPrice),children:(0,a.jsx)("div",{className:"flex items-baseline gap-2",children:e.availableForSale?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(t.Heading,{size:2,className:"text-info-primary",as:"h6",children:e.price}),k?k(e,{showOriginalPrice:x}):x&&e.originalPrice&&(0,a.jsx)(t.Heading,{size:2,className:(0,n.cn)("text-info-tertiary line-through",o?.originalPrice),as:"h6",children:e.originalPrice})]}):(0,a.jsx)(t.Heading,{size:2,className:"text-info-tertiary",children:g?.outOfStockLabel??"Sold Out"})})}),e?.priceLabel&&e?.availableForSale&&(0,a.jsx)(t.Text,{size:4,className:(0,n.cn)("text-marketing-1 desktop:text-[16px] lg-desktop:text-[18px] mt-2 text-[14px]",o?.productPriceLabel),children:e.priceLabel}),(0,a.jsxs)("div",{className:(0,n.cn)("lg-desktop:gap-3 tablet:flex-nowrap flex flex-wrap gap-2",o?.buttonGroup),children:[b&&(0,a.jsx)(t.Button,{variant:"secondary",size:"base",className:(0,n.cn)("tablet:w-fit tablet:min-w-0 tablet:whitespace-normal tablet:text-center w-full whitespace-nowrap",o?.secondaryButton),onClick:()=>w(y,"secondary"),disabled:!e.availableForSale&&y!=="learnMore",loading:F,"data-headless-type-name":"ActiveShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${b}`,"data-headless-sku":e.sku,children:b}),f&&(0,a.jsx)(t.Button,{variant:"primary",size:"base",className:(0,n.cn)("tablet:w-fit tablet:min-w-0 tablet:whitespace-normal tablet:text-center w-full whitespace-nowrap",o?.primaryButton),onClick:()=>w(v,"primary"),disabled:!e.availableForSale&&v!=="learnMore",loading:L,"data-headless-type-name":"ActiveShelf#ProductCard","data-headless-title-desc-button":`${e.custom_name||e.name}#${e.description||""}#${f}`,"data-headless-sku":e.sku,children:f})]}),G(c,s,e?.quantityAvailable??0,e?.totalInventory??0)&&(0,a.jsxs)("div",{className:"mt-4 space-y-2",children:[(0,a.jsx)(t.Progress,{value:A,max:100,min:0,size:"base",variant:"default","aria-label":"stock progress",classNames:{root:(0,n.cn)("bg-[var(--progress-track-bg,rgba(0,0,0,0.2))]",o?.stockTrack),progressBar:(0,n.cn)("bg-brand-0 transition-all duration-300 ease-in-out",o?.stockBar)}}),(0,a.jsx)(t.Text,{size:3,className:"text-info-tertiary text-[14px]",children:R?g?.limitedStock:g?.stockDisplayText?.replace("{count}",`${e.availableForSale?e.quantityAvailable:0}`)})]})]})]})]})})});u.displayName="ActiveShelf.ProductCard";var K=u;
@@ -1,15 +1,12 @@
1
1
  import * as React from 'react';
2
- import { type PromotionalBarProps } from '../PromotionalBar/index.js';
3
2
  import 'swiper/css';
4
3
  import 'swiper/css/navigation';
5
- import type { ButtonFunctionType, CopyConfig, UserType, DiscountTagStyle, ActiveShelfLayoutMode } from './types.js';
4
+ import type { ButtonFunctionType, CopyConfig } from './types.js';
6
5
  import { ProductCard, type ProductCardData, type ActiveShelfSemanticName, type StockDisplayMode } from './ProductCard.js';
7
- import type { Img } from '../../types/props.js';
8
6
  /**
9
- * 平铺布局桌面端(≥1440px)每行列数
10
- * '4' 为默认(现状),'3' 表示桌面端降为 3 列
7
+ * 组件布局模式
11
8
  */
12
- export type TileDesktopColumns = '3' | '4';
9
+ export type ActiveShelfLayoutMode = 'flex' | 'horizontal';
13
10
  /**
14
11
  * Code Channel 配置 - 折扣前缀
15
12
  */
@@ -24,11 +21,6 @@ export interface ProductTab {
24
21
  tab: string;
25
22
  /** 该分组下的产品数据 */
26
23
  data: ProductCardData[];
27
- /** 资源块(如 PromotionalBar) */
28
- resourceBlocks?: Array<PromotionalBarProps['data'] & {
29
- blockType: string;
30
- display: 'visible' | 'hidden';
31
- }>;
32
24
  }
33
25
  /**
34
26
  * ActiveShelf 业务组件数据接口
@@ -53,7 +45,7 @@ export interface ActiveShelfData {
53
45
  layoutMode?: ActiveShelfLayoutMode;
54
46
  /** Code Channel 配置 - 折扣前缀 */
55
47
  codeChannel?: CodeChannelConfig;
56
- /** 是否展示会员价格与价格标签(价格下方的会员标签,如 Member Price) */
48
+ /** 是否展示会员价格 */
57
49
  showMemberPrice?: boolean;
58
50
  /** 是否展示折扣标签 */
59
51
  showDiscount?: boolean;
@@ -71,37 +63,10 @@ export interface ActiveShelfData {
71
63
  showOriginalPrice?: boolean;
72
64
  /** 文案配置 */
73
65
  copy?: CopyConfig;
74
- /** active-shelf-items-tag(自定义标签)文案颜色。设置后会隐藏默认品牌色描边 */
75
- itemsTagTextColor?: string;
76
- /** active-shelf-items-tag 背景颜色,设置后会覆盖默认的品牌渐变背景并隐藏默认品牌色描边 */
77
- itemsTagBgColor?: string;
78
- /** 用户身份(会员标签模块) */
79
- userType?: UserType;
80
- /** 会员标签模块三种状态的装饰图 */
81
- memberImages?: Partial<Record<UserType, Img>>;
82
- /** 左上角自定义标签图标 */
83
- customTagsIcon?: Img;
84
- /** 自定义折扣标签图标样式(style1/style2/style3 为内置预设,custom 为自定义上传) */
85
- customTagStyle?: DiscountTagStyle;
86
- /** PC 端(≥768px)平铺最多展示行数 */
87
- tileMaxRowsPc?: number;
88
- /** 移动端(<768px)平铺最多展示行数 */
89
- tileMaxRowsMob?: number;
90
- /** 平铺布局桌面端(≥1440px)每行列数,'3' 或 '4',默认 '4' */
91
- tileDesktopColumns?: TileDesktopColumns;
92
- /** 平铺布局折叠时「展开」按钮文案,默认 'Show more' */
93
- tileExpandText?: string;
94
- /** 平铺布局展开后「收起」按钮文案,默认 'Show less' */
95
- tileCollapseText?: string;
96
66
  /**
97
67
  * 产品列表(当不使用 Tab 分组时可直接传入产品列表)
98
68
  */
99
69
  productsCard: ProductCardData[];
100
- /** 资源块(如 PromotionalBar),非 Tab 模式下生效 */
101
- resourceBlocks?: Array<PromotionalBarProps['data'] & {
102
- blockType: string;
103
- display: 'visible' | 'hidden';
104
- }>;
105
70
  }
106
71
  export interface ActiveShelfProps extends React.HTMLAttributes<HTMLDivElement> {
107
72
  /** 业务数据 */
@@ -112,10 +77,6 @@ export interface ActiveShelfProps extends React.HTMLAttributes<HTMLDivElement> {
112
77
  onShopNow?: (product: ProductCardData) => void;
113
78
  /** 点击加入购物车回调 */
114
79
  onAddToCart?: (product: ProductCardData) => void;
115
- /** 点击会员标签模块游客副标题(注册/登录)回调 */
116
- onMemberSignUp?: () => void;
117
- /** 点击会员标签模块付费会员折扣文案(加购付费会员sku)回调 */
118
- onPlusMemberAddCart?: () => void;
119
80
  /** 语义化类名 */
120
81
  classNames?: Partial<Record<ActiveShelfSemanticName, string>>;
121
82
  /**
@@ -127,11 +88,6 @@ export interface ActiveShelfProps extends React.HTMLAttributes<HTMLDivElement> {
127
88
  renderOriginalPrice?: (product: ProductCardData, context: {
128
89
  showOriginalPrice?: boolean;
129
90
  }) => React.ReactNode;
130
- /** 自定义折扣标签渲染(仅 customTagStyle=custom 时生效) */
131
- renderDiscountBadge?: (ctx: {
132
- text?: string;
133
- layoutMode: ActiveShelfLayoutMode;
134
- }) => React.ReactNode;
135
91
  }
136
92
  /**
137
93
  * ActiveShelf 复合组件类型定义
@@ -145,4 +101,4 @@ declare const ActiveShelfWrapped: React.ForwardRefExoticComponent<Omit<ActiveShe
145
101
  ProductCard: typeof ProductCard;
146
102
  };
147
103
  export default ActiveShelfWrapped;
148
- export type { StockDisplayMode, ActiveShelfSemanticName, ProductCardData, ActiveShelfLayoutMode };
104
+ export type { StockDisplayMode, ActiveShelfSemanticName, ProductCardData };
@@ -1 +1 @@
1
- "use strict";"use client";var Ce=Object.create;var X=Object.defineProperty;var Me=Object.getOwnPropertyDescriptor;var Pe=Object.getOwnPropertyNames;var Se=Object.getPrototypeOf,ke=Object.prototype.hasOwnProperty;var Be=(s,o)=>{for(var r in o)X(s,r,{get:o[r],enumerable:!0})},ne=(s,o,r,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let l of Pe(o))!ke.call(s,l)&&l!==r&&X(s,l,{get:()=>o[l],enumerable:!(c=Me(o,l))||c.enumerable});return s};var le=(s,o,r)=>(r=s!=null?Ce(Se(s)):{},ne(o||!s||!s.__esModule?X(r,"default",{value:s,enumerable:!0}):r,s)),Le=s=>ne(X({},"__esModule",{value:!0}),s);var Ie={};Be(Ie,{default:()=>ze});module.exports=Le(Ie);var e=require("react/jsx-runtime"),i=le(require("react")),p=require("../../helpers/index.js"),ge=require("../../shared/Styles.js"),n=require("../../components/index.js"),se=le(require("../PromotionalBar/index.js")),ee=require("swiper/react"),he=require("swiper/modules"),Oe=require("swiper/css"),Ve=require("swiper/css/navigation"),Y=require("./ProductCard.js"),ye=require("../../hooks/useExposure.js");const De="shelf",Ne="active_shelf",Re=()=>(0,e.jsxs)("span",{className:"lg-desktop:size-14 relative flex size-10 items-center justify-center",children:[(0,e.jsx)("span",{className:"prev-mask bg-masks-0 group-hover/prev-mask:bg-masks-1 absolute inset-0 rounded-full transition-colors"}),(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",className:"lg-desktop:size-6 relative size-5",children:(0,e.jsx)("path",{d:"M15 6L9 12L15 18",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]}),Ae=()=>(0,e.jsxs)("span",{className:"lg-desktop:size-14 relative flex size-10 items-center justify-center",children:[(0,e.jsx)("span",{className:"next-mask bg-masks-0 group-hover/next-mask:bg-masks-1 absolute inset-0 rounded-full transition-colors"}),(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",className:"lg-desktop:size-6 relative size-5",children:(0,e.jsx)("path",{d:"M9 6L15 12L9 18",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]});function ce(s){return typeof window>"u"?2:window.matchMedia("(min-width: 1440px)").matches?s==="3"?3:4:window.matchMedia("(min-width: 768px)").matches?3:2}function de(){return typeof window>"u"?!0:!window.matchMedia("(min-width: 768px)").matches}function ue(){return typeof window>"u"?!1:window.matchMedia("(min-width: 1025px)").matches}const oe=i.forwardRef(({products:s,layoutMode:o,className:r,copy:c,showTags:l,stockDisplayMode:T,stockThresholdValue:f,onLearnMore:d,onShopNow:b,onAddToCart:w,classNames:V,secondaryButtonText:U,secondaryButtonFun:h,primaryButtonText:v,primaryButtonFun:x,showOriginalPrice:C,renderOriginalPrice:M,itemsTagBgColor:P,itemsTagTextColor:S,renderDiscountBadge:k,userType:B,memberImages:L,customTagsIcon:D,customTagStyle:$,onMemberSignUp:N,onPlusMemberAddCart:R,tileMaxRowsPc:te,tileMaxRowsMob:j,tileDesktopColumns:u,tileExpandText:W,tileCollapseText:_,showMemberPrice:A},q)=>{const E=i.useId().replace(/:/g,""),z=`swiper-button-next-custom-${E}`,I=`swiper-button-prev-custom-${E}`,[F,m]=i.useState({isBeginning:!0,isEnd:!1}),Z=i.useRef(null),g=i.useCallback(()=>{const t=Z.current;if(!t?.slides||t.slides.length===0)return;t.slides.forEach(O=>{O.style.height="auto"});const H=Array.from(t.slides).map(O=>O.scrollHeight),ae=Math.max(...H);ae>0&&t.slides.forEach(O=>{O.style.height=`${ae}px`})},[]);i.useEffect(()=>{const t=()=>{requestAnimationFrame(g)};return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[g]);const[y,a]=i.useState(!1),[G,J]=i.useState(()=>ce(u)),[Te,fe]=i.useState(()=>de()),[be,we]=i.useState(()=>ue());i.useEffect(()=>{const t=()=>{J(ce(u)),fe(de()),we(ue())};return t(),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[u]);const K=o==="horizontal"&&!be?"flex":o,Q=Te?j:te,ie=K==="flex"&&!!Q&&Q>0,re=Q?Q*G:s.length,ve=ie&&s.length>re,xe=ie&&!y?s.slice(0,re):s;return s?.length===0?null:(0,e.jsx)("div",{ref:q,className:r,children:K==="flex"?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:(0,p.cn)("tablet:grid-cols-3 tablet:gap-4 grid grid-cols-2 justify-start gap-3",u==="3"?"desktop:grid-cols-3 lg-desktop:grid-cols-3":"desktop:grid-cols-4 lg-desktop:grid-cols-4"),children:xe.map((t,H)=>(0,e.jsx)(Y.ProductCard,{product:t,layoutMode:K,className:"shrink-0",showTags:l,stockDisplayMode:T,stockThresholdValue:f,onLearnMore:d,onShopNow:b,onAddToCart:w,classNames:V,secondaryButtonText:U,secondaryButtonFun:h,primaryButtonText:v,primaryButtonFun:x,showOriginalPrice:C,renderOriginalPrice:M,renderDiscountBadge:k,itemsTagBgColor:P,itemsTagTextColor:S,copy:c,userType:B,memberImages:L,customTagsIcon:D,customTagStyle:$,onMemberSignUp:N,onPlusMemberAddCart:R,showMemberPrice:A},t.shopify_id+"-"+t.sku||H))}),ve&&(0,e.jsxs)("div",{className:"laptop:hover:text-brand-0 text-info-primary mt-6 flex items-center justify-center",children:[(0,e.jsx)("button",{className:"laptop:text-base text-sm font-bold",onClick:()=>a(t=>!t),children:y?_??"Show less":W??"Show more"}),(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:(0,p.cn)("laptop:size-5 size-4",y&&"rotate-180"),width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:(0,e.jsx)("path",{d:"M17.2929 8.29302C17.6834 7.90249 18.3164 7.90249 18.707 8.29302C19.0975 8.68354 19.0975 9.31655 18.707 9.70708L12.707 15.7071C12.3164 16.0976 11.6834 16.0976 11.2929 15.7071L5.29289 9.70708C4.90237 9.31655 4.90237 8.68354 5.29289 8.29302C5.68342 7.90249 6.31643 7.90249 6.70696 8.29302L11.9999 13.586L17.2929 8.29302Z",fill:"currentColor"})})]})]}):(0,e.jsxs)("div",{className:"group relative",children:[(0,e.jsx)(ee.Swiper,{modules:[he.Navigation],spaceBetween:16,navigation:{nextEl:`.${z}`,prevEl:`.${I}`},onSwiper:t=>{Z.current=t,m({isBeginning:t.isBeginning,isEnd:t.isEnd}),setTimeout(g,100)},slidesPerView:3,breakpoints:{1025:{freeMode:!1,slidesPerView:3},1440:{freeMode:!1,slidesPerView:u==="3"?3:4}},onReachEnd:()=>{m(t=>({...t,isEnd:!0}))},onReachBeginning:()=>{m(t=>({...t,isBeginning:!0}))},onFromEdge:()=>{m({isBeginning:!1,isEnd:!1})},className:"!overflow-visible [&_.swiper-wrapper]:items-start",children:s.map((t,H)=>(0,e.jsx)(ee.SwiperSlide,{className:"overflow-hidden",children:(0,e.jsx)(Y.ProductCard,{product:t,layoutMode:K,className:"w-full max-w-full",showTags:l,stockDisplayMode:T,stockThresholdValue:f,onLearnMore:d,onShopNow:b,onAddToCart:w,classNames:V,secondaryButtonText:U,secondaryButtonFun:h,primaryButtonText:v,primaryButtonFun:x,showOriginalPrice:C,renderOriginalPrice:M,renderDiscountBadge:k,itemsTagBgColor:P,itemsTagTextColor:S,copy:c,userType:B,memberImages:L,customTagsIcon:D,customTagStyle:$,onMemberSignUp:N,onPlusMemberAddCart:R,showMemberPrice:A})},t.shopify_id+"-"+t.sku||H))}),(0,e.jsx)("button",{className:`${I} tablet:block group/prev-mask absolute left-4 top-1/2 z-10 hidden -translate-y-1/2 ${F.isBeginning?"pointer-events-none opacity-0":"opacity-100"}`,"aria-label":c?.previousSlideLabel,children:(0,e.jsx)(Re,{})}),(0,e.jsx)("button",{className:`${z} tablet:block group/next-mask absolute right-4 top-1/2 z-10 hidden -translate-y-1/2 ${F.isEnd?"pointer-events-none opacity-0":"opacity-100"}`,"aria-label":c?.nextSlideLabel,children:(0,e.jsx)(Ae,{})})]})})});oe.displayName="ProductsList";const pe=i.forwardRef(({className:s,data:o,onLearnMore:r,onShopNow:c,onAddToCart:l,onMemberSignUp:T,onPlusMemberAddCart:f,classNames:d,renderOriginalPrice:b,renderDiscountBadge:w,...V},U)=>{const h=i.useRef(null);(0,ye.useExposure)(h,{componentType:De,componentName:Ne,componentTitle:o.title,componentDescription:o.description}),i.useImperativeHandle(U,()=>h.current);const{theme:v="light",layoutMode:x="flex",showTags:C=!0,stockDisplayMode:M,stockThresholdValue:P,showOriginalPrice:S,secondaryButtonText:k,primaryButtonText:B,secondaryButtonFun:L,primaryButtonFun:D,isShowTab:$=!0,itemsTagBgColor:N,itemsTagTextColor:R,copy:te,userType:j,memberImages:u,customTagsIcon:W,customTagStyle:_,showMemberPrice:A,tileMaxRowsPc:q,tileMaxRowsMob:E,tileDesktopColumns:z,tileExpandText:I,tileCollapseText:F}=o,m=te||{},Z=o.productsTab&&o.productsTab.length>0,g=$&&Z,y=g?void 0:o.resourceBlocks?.find(a=>a.blockType==="PromotionalBar"&&a.display==="visible");return(0,e.jsxs)("div",{ref:h,className:(0,p.cn)("w-full",{"aiui-dark":v==="dark"},s,d?.root),style:{"--progress-track-bg":v==="dark"?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.2)"},...V,children:[o.title&&(0,e.jsx)(n.Heading,{as:"h2",html:o.title,size:4,className:(0,p.cn)("text-info-primary mb-4 leading-tight",d?.title)}),o.description&&(0,e.jsx)(n.Text,{size:3,as:"p",html:o.description,className:(0,p.cn)("text-info-primary mb-6",d?.description)}),(0,e.jsxs)(n.Tabs,{defaultValue:o.productsTab?.[0]?.id,className:"w-full",children:[g&&(0,e.jsx)(n.TabsList,{className:"mb-6",children:o.productsTab?.map(a=>(0,e.jsx)(n.TabsTrigger,{value:a.id,children:a.tab},"tab-"+a.id))}),g?o.productsTab?.map(a=>{const G=a.resourceBlocks?.find(J=>J.blockType==="PromotionalBar"&&J.display==="visible");return(0,e.jsxs)(n.TabsContent,{value:a.id,children:[G&&(0,e.jsx)(se.default,{data:G,className:(0,p.cn)("laptop:mb-4 mb-3",d?.promotionalBar)}),(0,e.jsx)(oe,{products:a.data,layoutMode:x,copy:m,showTags:C,stockDisplayMode:M,stockThresholdValue:P,onLearnMore:r,onShopNow:c,onAddToCart:l,classNames:d,secondaryButtonText:k,secondaryButtonFun:L,primaryButtonText:B,primaryButtonFun:D,showOriginalPrice:S,renderOriginalPrice:b,renderDiscountBadge:w,itemsTagBgColor:N,itemsTagTextColor:R,userType:j,memberImages:u,customTagsIcon:W,customTagStyle:_,onMemberSignUp:T,onPlusMemberAddCart:f,showMemberPrice:A,tileMaxRowsPc:q,tileMaxRowsMob:E,tileDesktopColumns:z,tileExpandText:I,tileCollapseText:F})]},"tab-content-"+a.id)}):(0,e.jsxs)(e.Fragment,{children:[y&&(0,e.jsx)(se.default,{data:y,className:(0,p.cn)("laptop:mb-4 mb-3",d?.promotionalBar)}),(0,e.jsx)(oe,{products:o.productsCard,layoutMode:x,copy:m,showTags:C,stockDisplayMode:M,stockThresholdValue:P,onLearnMore:r,onShopNow:c,onAddToCart:l,classNames:d,secondaryButtonText:k,secondaryButtonFun:L,primaryButtonText:B,primaryButtonFun:D,showOriginalPrice:S,renderOriginalPrice:b,renderDiscountBadge:w,itemsTagBgColor:N,itemsTagTextColor:R,userType:j,memberImages:u,customTagsIcon:W,customTagStyle:_,onMemberSignUp:T,onPlusMemberAddCart:f,showMemberPrice:A,tileMaxRowsPc:q,tileMaxRowsMob:E,tileDesktopColumns:z,tileExpandText:I,tileCollapseText:F})]})]})]})});pe.displayName="ActiveShelf";const me=pe;me.ProductCard=Y.ProductCard;const Ee=(0,ge.withLayout)(me);var ze=Ee;
1
+ "use strict";"use client";var j=Object.create;var N=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty;var J=(i,o)=>{for(var r in o)N(i,r,{get:o[r],enumerable:!0})},O=(i,o,r,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of q(o))!G.call(i,n)&&n!==r&&N(i,n,{get:()=>o[n],enumerable:!(s=_(o,n))||s.enumerable});return i};var K=(i,o,r)=>(r=i!=null?j(Z(i)):{},O(o||!i||!i.__esModule?N(r,"default",{value:i,enumerable:!0}):r,i)),Q=i=>O(N({},"__esModule",{value:!0}),i);var ie={};J(ie,{default:()=>oe});module.exports=Q(ie);var t=require("react/jsx-runtime"),l=K(require("react")),E=require("../../helpers/index.js"),V=require("../../shared/Styles.js"),a=require("../../components/index.js"),R=require("swiper/react"),I=require("swiper/modules"),ae=require("swiper/css"),ne=require("swiper/css/navigation"),A=require("./ProductCard.js"),W=require("../../hooks/useExposure.js");const U="shelf",X="active_shelf",Y=({disabled:i})=>(0,t.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-primary laptop:block lg-desktop:size-[56px] hidden size-[40px]",children:[(0,t.jsx)("path",{d:"M0 28C0 43.464 12.536 56 28 56C43.464 56 56 43.464 56 28C56 12.536 43.464 0 28 0C12.536 0 0 12.536 0 28Z",fill:"currentColor",fillOpacity:i?"0.2":"0.6"}),(0,t.jsx)("path",{d:"M31 22L25 28L31 34",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),ee=({disabled:i})=>(0,t.jsxs)("svg",{width:"56",height:"56",viewBox:"0 0 56 56",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"text-info-primary laptop:block lg-desktop:size-[56px] hidden size-[40px]",children:[(0,t.jsx)("path",{d:"M0 28C0 12.536 12.536 0 28 0C43.464 0 56 12.536 56 28C56 43.464 43.464 56 28 56C12.536 56 0 43.464 0 28Z",fill:"currentColor",fillOpacity:i?"0.2":"0.6"}),(0,t.jsx)("path",{d:"M25 22L31 28L25 34",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),F=l.forwardRef(({products:i,layoutMode:o,className:r,copy:s,showTags:n,stockDisplayMode:c,stockThresholdValue:m,onLearnMore:P,onShopNow:B,onAddToCart:p,classNames:g,secondaryButtonText:y,secondaryButtonFun:f,primaryButtonText:T,primaryButtonFun:b,showOriginalPrice:v,renderOriginalPrice:w},M)=>{const C=l.useId().replace(/:/g,""),x=`swiper-button-next-custom-${C}`,L=`swiper-button-prev-custom-${C}`,[u,d]=l.useState({isBeginning:!0,isEnd:!1}),D=l.useRef(null),h=l.useCallback(()=>{const e=D.current;if(!e?.slides||e.slides.length===0)return;e.slides.forEach(k=>{k.style.height="auto"});const S=Array.from(e.slides).map(k=>k.scrollHeight),H=Math.max(...S);H>0&&e.slides.forEach(k=>{k.style.height=`${H}px`})},[]);return l.useEffect(()=>{const e=()=>{requestAnimationFrame(h)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[h]),i?.length===0?null:(0,t.jsx)("div",{ref:M,className:r,children:o==="flex"?(0,t.jsx)("div",{className:"lg-desktop:gap-4 tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 laptop:gap-4 grid grid-cols-1 justify-start gap-3",children:i.map((e,S)=>(0,t.jsx)(A.ProductCard,{product:e,className:"shrink-0",showTags:n,stockDisplayMode:c,stockThresholdValue:m,onLearnMore:P,onShopNow:B,onAddToCart:p,classNames:g,secondaryButtonText:y,secondaryButtonFun:f,primaryButtonText:T,primaryButtonFun:b,showOriginalPrice:v,renderOriginalPrice:w,copy:s},e.shopify_id+"-"+e.sku||S))}):(0,t.jsxs)("div",{className:"group relative",children:[(0,t.jsx)(R.Swiper,{modules:[I.Navigation],spaceBetween:16,slidesPerView:"auto",navigation:{nextEl:`.${x}`,prevEl:`.${L}`},onSwiper:e=>{D.current=e,d({isBeginning:e.isBeginning,isEnd:e.isEnd}),setTimeout(h,100)},onReachEnd:()=>{d(e=>({...e,isEnd:!0}))},onReachBeginning:()=>{d(e=>({...e,isBeginning:!0}))},onFromEdge:()=>{d({isBeginning:!1,isEnd:!1})},className:"!overflow-visible",children:i.map((e,S)=>(0,t.jsx)(R.SwiperSlide,{className:"tablet:!w-[288px] desktop:!w-[316px] lg-desktop:!w-[404px] !w-[296px] overflow-hidden",children:(0,t.jsx)(A.ProductCard,{product:e,className:"w-full max-w-full",showTags:n,stockDisplayMode:c,stockThresholdValue:m,onLearnMore:P,onShopNow:B,onAddToCart:p,classNames:g,secondaryButtonText:y,secondaryButtonFun:f,primaryButtonText:T,primaryButtonFun:b,showOriginalPrice:v,renderOriginalPrice:w,copy:s})},e.shopify_id+"-"+e.sku||S))}),(0,t.jsx)("button",{className:`${L} tablet:block absolute left-4 top-1/2 z-10 hidden -translate-y-1/2 transition-opacity ${u.isBeginning?"pointer-events-none opacity-0":"opacity-0 group-hover:opacity-100"}`,"aria-label":s?.previousSlideLabel,children:(0,t.jsx)(Y,{disabled:u.isBeginning})}),(0,t.jsx)("button",{className:`${x} tablet:block absolute right-4 top-1/2 z-10 hidden -translate-y-1/2 transition-opacity ${u.isEnd?"pointer-events-none opacity-0":"opacity-0 group-hover:opacity-100"}`,"aria-label":s?.nextSlideLabel,children:(0,t.jsx)(ee,{disabled:u.isEnd})})]})})});F.displayName="ProductsList";const z=l.forwardRef(({className:i,data:o,onLearnMore:r,onShopNow:s,onAddToCart:n,classNames:c,renderOriginalPrice:m,...P},B)=>{const p=l.useRef(null);(0,W.useExposure)(p,{componentType:U,componentName:X,componentTitle:o.title,componentDescription:o.description}),l.useImperativeHandle(B,()=>p.current);const{theme:g="light",layoutMode:y="flex",showTags:f=!0,stockDisplayMode:T,stockThresholdValue:b,showOriginalPrice:v=!0,secondaryButtonText:w,primaryButtonText:M,secondaryButtonFun:C,primaryButtonFun:x,isShowTab:L=!0,copy:u}=o,d=u||{},D=o.productsTab&&o.productsTab.length>0,h=L&&D;return(0,t.jsxs)("div",{ref:p,className:(0,E.cn)("w-full",{"aiui-dark":g==="dark"},i,c?.root),style:{"--progress-track-bg":g==="dark"?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.2)"},...P,children:[o.title&&(0,t.jsx)(a.Heading,{as:"h2",html:o.title,size:4,className:(0,E.cn)("text-info-primary mb-4",c?.title)}),o.description&&(0,t.jsx)(a.Text,{size:3,as:"p",html:o.description,className:(0,E.cn)("text-info-primary mb-6",c?.description)}),(0,t.jsxs)(a.Tabs,{defaultValue:o.productsTab?.[0]?.id,className:"w-full",children:[h&&(0,t.jsx)(a.TabsList,{className:"mb-6",children:o.productsTab?.map(e=>(0,t.jsx)(a.TabsTrigger,{value:e.id,children:e.tab},"tab-"+e.id))}),h?o.productsTab?.map(e=>(0,t.jsx)(a.TabsContent,{value:e.id,children:(0,t.jsx)(F,{products:e.data,layoutMode:y,copy:d,showTags:f,stockDisplayMode:T,stockThresholdValue:b,onLearnMore:r,onShopNow:s,onAddToCart:n,classNames:c,secondaryButtonText:w,secondaryButtonFun:C,primaryButtonText:M,primaryButtonFun:x,showOriginalPrice:v,renderOriginalPrice:m})},"tab-content-"+e.id)):(0,t.jsx)(F,{products:o.productsCard,layoutMode:y,copy:d,showTags:f,stockDisplayMode:T,stockThresholdValue:b,onLearnMore:r,onShopNow:s,onAddToCart:n,classNames:c,secondaryButtonText:w,secondaryButtonFun:C,primaryButtonText:M,primaryButtonFun:x,showOriginalPrice:v,renderOriginalPrice:m})]})]})});z.displayName="ActiveShelf";const $=z;$.ProductCard=A.ProductCard;const te=(0,V.withLayout)($);var oe=te;
@@ -2,35 +2,6 @@
2
2
  * 按钮功能类型
3
3
  */
4
4
  export type ButtonFunctionType = 'buyNow' | 'addCart' | 'learnMore';
5
- /**
6
- * 自定义折扣标签图标样式
7
- * style1/style2/style3 为内置预设样式(写死在组件中),custom 为自定义上传图标
8
- */
9
- export type DiscountTagStyle = 'style1' | 'style2' | 'style3' | 'custom';
10
- /**
11
- * 组件布局模式
12
- * flex=网格布局,horizontal=横向轮播
13
- */
14
- export type ActiveShelfLayoutMode = 'flex' | 'horizontal';
15
- /**
16
- * 用户身份类型
17
- */
18
- export type UserType = 'guest' | 'member' | 'plus-member';
19
- /**
20
- * SKU 会员活动标签类型
21
- * guest=会员模块游客态活动文案,member=会员模块会员态活动文案(普通会员/付费会员共用)
22
- */
23
- export type ActivityLabelType = 'guest' | 'member';
24
- /**
25
- * SKU 会员活动配置项
26
- * 依据飞书规则矩阵:activityLabels 为对象数组,每项含 type 与 label
27
- */
28
- export interface ActivityLabel {
29
- /** 标签类型:guest=游客态活动,member=会员态活动(普通/付费共用) */
30
- type: ActivityLabelType;
31
- /** 标签文案 */
32
- label: string;
33
- }
34
5
  /**
35
6
  * ActiveShelf 文案配置接口
36
7
  * 注意:secondaryButtonText 和 shopNowText 作为高频属性保持在 data 的直接属性中
@@ -50,28 +21,4 @@ export interface CopyConfig {
50
21
  outOfStockLabel?: string;
51
22
  limitedStock?: string;
52
23
  couponTag?: string;
53
- /** 会员模块游客状态标题文案 */
54
- memberTitleLabelUpgrade?: string;
55
- /** 会员模块普通会员状态标题文案 */
56
- memberTitleLabel?: string;
57
- /** 会员模块付费会员状态标题文案 */
58
- plusmemberTitleLabel?: string;
59
- /** 会员模块游客状态副标题文案 */
60
- memberSubtitleLabelUpgrade?: string;
61
- /** 会员模块普通会员状态副标题文案 */
62
- memberSubtitleLabel?: string;
63
- /** 会员模块付费会员状态副标题文案 */
64
- plusmemberSubtitleLabel?: string;
65
- /** 会员模块游客态活动文案 */
66
- memberActivityLabelUnLogin?: string;
67
- /** 会员模块会员态活动文案(普通会员/付费会员) */
68
- memberActivityLabel?: string;
69
- /** 会员模块游客态产品活动文案 */
70
- productActivityLabelUnLogin?: string;
71
- /** 会员模块会员态产品活动文案(普通会员/付费会员) */
72
- productActivityLabel?: string;
73
- /** 会员模块普通会员折扣文案,支持 {amount} 占位符(替换为普通会员折扣金额) */
74
- memberDiscountLabel?: string;
75
- /** 会员模块付费会员折扣文案,支持 {amount} 占位符(替换为付费会员折扣金额) */
76
- plusMemberDiscountLabel?: string;
77
24
  }
@@ -1 +1 @@
1
- "use strict";var l=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var a=Object.prototype.hasOwnProperty;var o=(t,e,b,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of n(e))!a.call(t,i)&&i!==b&&l(t,i,{get:()=>e[i],enumerable:!(r=s(e,i))||r.enumerable});return t};var g=t=>o(l({},"__esModule",{value:!0}),t);var m={};module.exports=g(m);
1
+ "use strict";var n=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var g=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of a(e))!l.call(t,i)&&i!==o&&n(t,i,{get:()=>e[i],enumerable:!(r=s(e,i))||r.enumerable});return t};var b=t=>g(n({},"__esModule",{value:!0}),t);var c={};module.exports=b(c);
@@ -1 +1 @@
1
- "use strict";"use client";var C=Object.create;var p=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var B=(e,t)=>{for(var a in t)p(e,a,{get:t[a],enumerable:!0})},g=(e,t,a,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of V(t))!I.call(e,s)&&s!==a&&p(e,s,{get:()=>t[s],enumerable:!(c=P(t,s))||c.enumerable});return e};var L=(e,t,a)=>(a=e!=null?C(z(e)):{},g(t||!e||!e.__esModule?p(a,"default",{value:e,enumerable:!0}):a,e)),E=e=>g(p({},"__esModule",{value:!0}),e);var R={};B(R,{default:()=>M});module.exports=E(R);var i=require("react/jsx-runtime"),v=L(require("react")),d=require("../../helpers/index.js"),l=require("../../components/index.js"),f=require("class-variance-authority"),h=require("swiper/react"),y=require("../../shared/Styles.js");const j=(0,f.cva)("rounded-card laptop:px-6 laptop:py-4 relative flex min-w-0 flex-col justify-between gap-2 overflow-hidden px-4 py-3",{variants:{state:{"active-light":"bg-gradient-to-r from-[#3555aa] to-[#6988e3]","active-dark":"bg-gradient-to-r from-[#3555aa] to-[#6988e3]","inactive-light":"bg-[#EAEAEC]","inactive-dark":"bg-[#1E2024]"},size:{small:"laptop:h-[160px] h-[120px]",large:"laptop:h-[240px] h-[200px]"}},defaultVariants:{state:"inactive-light",size:"small"}}),m=(0,f.cva)("font-bold leading-[1.2]",{variants:{state:{"active-light":"text-white","active-dark":"text-white","inactive-light":"text-[#080A0F]","inactive-dark":"text-white"}},defaultVariants:{state:"inactive-light"}}),w=v.memo(({item:e,theme:t="light",className:a,size:c})=>{const s=e.isActive||!1,o=`${s?"active":"inactive"}-${t}`;return(0,i.jsx)("div",{className:(0,d.cn)(j({state:o,size:c}),a),"data-ui-component-id":"ActivityScheduleCard",children:(0,i.jsxs)(l.Link,{asChild:!e?.link,href:e?.link,className:"size-full no-underline hover:text-current",children:[(s?e.activeIcon:e.inactiveIcon)&&(0,i.jsx)("div",{className:"laptop:w-[160px] aspect-1 absolute right-0 top-0 z-10 w-[120px]",children:(0,i.jsx)(l.Picture,{source:s?e.activeIcon.url:e.inactiveIcon.url,alt:s?e.activeIcon.alt:e.inactiveIcon.alt,className:"aspect-square"})}),(0,i.jsxs)("div",{className:"relative z-20 flex h-full flex-col justify-between",children:[(0,i.jsx)(l.Heading,{as:"h3",size:3,html:e.title,className:(0,d.cn)(m({state:o}))}),(0,i.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,i.jsx)("div",{className:"flex flex-col justify-end overflow-hidden",children:(0,i.jsx)(l.Heading,{as:"h4",size:2,html:e.subtitle,className:(0,d.cn)(" line-clamp-2",m({state:o}))})}),c==="large"&&e.description&&(0,i.jsx)(l.Text,{html:e.description,className:(0,d.cn)("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-3 text-[14px] leading-[1.4]",m({state:o}))})]})]})]})})});w.displayName="ActivityScheduleCard";const x=v.forwardRef(({classNames:e={},data:t,...a},c)=>{const s=t.theme||"light",o=t.size||"small",r=v.useMemo(()=>t?.scheduleList?.length||2,[t?.scheduleList]),k=v.useMemo(()=>{const n=N=>{switch(N){case"mobile":return{slidesPerView:1.17,spaceBetween:12};case"tablet":return r===2?{slidesPerView:2,spaceBetween:12}:{slidesPerView:2.4,spaceBetween:12};case"laptop":return r===2?{}:r===4?{slidesPerView:3.2,spaceBetween:16}:{slidesPerView:r,spaceBetween:16};case"desktop":return r===2?{slidesPerView:2,spaceBetween:16}:{slidesPerView:r,spaceBetween:16}}},u=n("mobile"),S=n("tablet"),b=n("laptop"),A=n("desktop");return{0:u,768:S,1024:b,1440:A}},[r]);return(0,i.jsx)("div",{ref:c,className:(0,d.cn)(e?.root),"data-ui-component-id":"ActivitySchedule",...a,children:(0,i.jsx)(h.Swiper,{breakpoints:k,className:"w-full !overflow-visible",children:t?.scheduleList?.map((n,u)=>(0,i.jsx)(h.SwiperSlide,{children:(0,i.jsx)(w,{item:n,theme:s,size:o,className:e?.card})},"activityScheduleCardItem"+u))??null})})});x.displayName="ActivitySchedule";var M=(0,y.withLayout)(x);
1
+ "use strict";"use client";var C=Object.create;var p=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty;var B=(e,t)=>{for(var a in t)p(e,a,{get:t[a],enumerable:!0})},g=(e,t,a,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of V(t))!I.call(e,s)&&s!==a&&p(e,s,{get:()=>t[s],enumerable:!(c=P(t,s))||c.enumerable});return e};var L=(e,t,a)=>(a=e!=null?C(z(e)):{},g(t||!e||!e.__esModule?p(a,"default",{value:e,enumerable:!0}):a,e)),E=e=>g(p({},"__esModule",{value:!0}),e);var R={};B(R,{default:()=>M});module.exports=E(R);var i=require("react/jsx-runtime"),v=L(require("react")),d=require("../../helpers/index.js"),l=require("../../components/index.js"),f=require("class-variance-authority"),h=require("swiper/react"),y=require("../../shared/Styles.js");const j=(0,f.cva)("rounded-card laptop:px-6 laptop:py-4 relative flex min-w-0 flex-col justify-between gap-2 overflow-hidden px-4 py-3",{variants:{state:{"active-light":"bg-gradient-to-r from-[#3555aa] to-[#6988e3]","active-dark":"bg-gradient-to-r from-[#3555aa] to-[#6988e3]","inactive-light":"bg-[#EAEAEC]","inactive-dark":"bg-[#1E2024]"},size:{small:"laptop:h-[160px] h-[120px]",large:"laptop:h-[240px] h-[200px]"}},defaultVariants:{state:"inactive-light",size:"small"}}),m=(0,f.cva)("font-bold leading-[1.2]",{variants:{state:{"active-light":"text-white","active-dark":"text-white","inactive-light":"text-[#080A0F]","inactive-dark":"text-white"}},defaultVariants:{state:"inactive-light"}}),w=v.memo(({item:e,theme:t="light",className:a,size:c})=>{const s=e.isActive||!1,o=`${s?"active":"inactive"}-${t}`;return(0,i.jsx)("div",{className:(0,d.cn)(j({state:o,size:c}),a),"data-ui-component-id":"ActivityScheduleCard",children:(0,i.jsxs)(l.Link,{asChild:!e?.link,href:e?.link,className:"size-full no-underline hover:text-current",children:[(s?e.activeIcon:e.inactiveIcon)&&(0,i.jsx)("div",{className:"laptop:w-[160px] aspect-1 absolute right-0 top-0 z-10 w-[120px]",children:(0,i.jsx)(l.Picture,{source:s?e.activeIcon.url:e.inactiveIcon.url,alt:s?e.activeIcon.alt:e.inactiveIcon.alt,className:"aspect-square"})}),(0,i.jsxs)("div",{className:"relative z-20 flex h-full flex-col justify-between",children:[(0,i.jsx)(l.Heading,{as:"h3",size:3,html:e.title,className:(0,d.cn)(m({state:o}))}),(0,i.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,i.jsx)("div",{className:"flex flex-col justify-end overflow-hidden",children:(0,i.jsx)(l.Heading,{as:"h4",size:2,html:e.subtitle,className:(0,d.cn)(" line-clamp-2",m({state:o}))})}),c==="large"&&e.description&&(0,i.jsx)(l.Text,{html:e.description,className:(0,d.cn)("lg-desktop:text-[18px] desktop:text-[16px] line-clamp-3 text-[14px] leading-[1.4]",m({state:o}))})]})]})]})})});w.displayName="ActivityScheduleCard";const x=v.forwardRef(({classNames:e={},data:t,...a},c)=>{const s=t.theme||"light",o=t.size||"large",r=v.useMemo(()=>t?.scheduleList?.length||2,[t?.scheduleList]),k=v.useMemo(()=>{const n=N=>{switch(N){case"mobile":return{slidesPerView:1.17,spaceBetween:12};case"tablet":return r===2?{slidesPerView:2,spaceBetween:12}:{slidesPerView:2.4,spaceBetween:12};case"laptop":return r===2?{}:r===4?{slidesPerView:3.2,spaceBetween:16}:{slidesPerView:r,spaceBetween:16};case"desktop":return r===2?{slidesPerView:2,spaceBetween:16}:{slidesPerView:r,spaceBetween:16}}},u=n("mobile"),S=n("tablet"),b=n("laptop"),A=n("desktop");return{0:u,768:S,1024:b,1440:A}},[r]);return(0,i.jsx)(l.Container,{ref:c,className:(0,d.cn)(e?.root),childClassName:"overflow-hidden","data-ui-component-id":"ActivitySchedule",...a,children:(0,i.jsx)(h.Swiper,{breakpoints:k,className:"w-full !overflow-visible",children:t.scheduleList.map((n,u)=>(0,i.jsx)(h.SwiperSlide,{children:(0,i.jsx)(w,{item:n,theme:s,size:o,className:e?.card})},"activityScheduleCardItem"+u))})})});x.displayName="ActivitySchedule";var M=(0,y.withLayout)(x);
@@ -1 +1 @@
1
- "use strict";"use client";var j=Object.create;var d=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var H=(e,r)=>{for(var a in r)d(e,a,{get:r[a],enumerable:!0})},k=(e,r,a,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of L(r))!A.call(e,o)&&o!==a&&d(e,o,{get:()=>r[o],enumerable:!(i=P(r,o))||i.enumerable});return e};var N=(e,r,a)=>(a=e!=null?j(z(e)):{},k(r||!e||!e.__esModule?d(a,"default",{value:e,enumerable:!0}):a,e)),D=e=>k(d({},"__esModule",{value:!0}),e);var F={};H(F,{default:()=>C});module.exports=D(F);var t=require("react/jsx-runtime"),s=require("react"),l=require("../../helpers/utils.js"),y=N(require("../../components/picture.js")),E=require("../../shared/Styles.js"),S=require("react-responsive"),M=require("../../hooks/useExposure.js"),c=require("swiper/react"),p=require("swiper/modules"),B=N(require("../Title/index.js"));const R="copy",Q="store_benefits",$=(e,r)=>{const a=[];for(let i=0;i<e.length;i+=r)a.push(e.slice(i,i+r));return a},w=(0,s.forwardRef)(({data:{items:e=[],itemShape:r,title:a,theme:i},className:o},u)=>{const[x,T]=(0,s.useState)(!1),v=(0,S.useMediaQuery)({query:"(max-width: 768px)"}),b=(0,s.useRef)(null),f=(0,s.useRef)(null);(0,s.useImperativeHandle)(u,()=>f.current),(0,M.useExposure)(f,{componentType:R,componentName:Q}),(0,s.useEffect)(()=>{T(v)},[v]);const I=x?$(e,3):e;return(0,t.jsxs)("div",{ref:f,className:(0,l.cn)("brand-equity-wrapper w-full",{"aiui-dark":i==="dark"},o),children:[a&&(0,t.jsx)(B.default,{data:{title:a}}),x?(0,t.jsxs)(c.Swiper,{className:(0,l.cn)(o),modules:[p.FreeMode,p.Mousewheel,p.Pagination],freeMode:!0,mousewheel:{forceToAxis:!0},pagination:{clickable:!0,el:b.current},breakpoints:{0:{spaceBetween:12}},children:[I?.map((n,m)=>(0,t.jsx)(c.SwiperSlide,{className:"!flex flex-col gap-3",children:Array.isArray(n)&&n?.map((g,h)=>(0,t.jsx)(q,{data:g,itemShape:r,index:h,theme:g.theme??i},h))},"SwiperSlide"+m)),(0,t.jsx)("div",{ref:b,className:"mt-3 flex justify-center"})]}):(0,t.jsx)("div",{className:(0,l.cn)("grid grid-cols-1 gap-3","tablet:grid-cols-2","laptop:gap-4 laptop:grid-cols-10"),children:e.map((n,m)=>(0,t.jsx)(q,{data:n,itemShape:r,index:m,theme:n.theme??i},m))})]})}),q=({data:e,itemShape:r,index:a,theme:i})=>(0,t.jsxs)("div",{className:(0,l.cn)("brand-equity-item",`brand-equity-item-${a+1}`,e.containerName?`brand-equity-item--${e.containerName}`:void 0,"bg-container-secondary-1 box-border flex w-full flex-col p-4","desktop:p-6 justify-between","laptop:col-span-3 lg-desktop:p-8","laptop:h-[192px] lg-desktop:h-[240px] h-[160px]",{"laptop:col-span-4":[0,5,6,11].includes(a),"bg-container-primary":i==="dark"},"rounded-box",e.className),children:[(0,t.jsxs)("div",{className:"lg-desktop:h-[36px] flex h-[30px] items-center justify-between gap-3",children:[(0,t.jsx)("h3",{className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-[14px] font-bold leading-[1.2] tracking-[-0.02em]",children:e.title}),e.type==="avatar"?(0,t.jsx)("div",{className:"flex shrink-0 -space-x-2",children:e?.avatarList?.map((o,u)=>(0,t.jsx)("div",{className:(0,l.cn)("border-container-primary size-[30px] overflow-hidden rounded-full border-2","relative inline-block shrink-0","lg-desktop:size-[36px]"),children:(0,t.jsx)(y.default,{source:o.avatar?.url,alt:o.avatar?.alt,className:"size-full object-cover"})},u))}):(0,t.jsx)("div",{className:"lg-desktop:size-[36px] size-[30px] shrink-0",children:(0,t.jsx)(y.default,{className:"size-full object-cover",source:e.icon?.url,alt:e.icon?.alt,imgClassName:"w-full h-full object-cover"})})]}),(0,t.jsx)("p",{className:"lg-desktop:text-[24px] text-info-primary line-clamp-3 text-[20px] font-bold leading-[1.2] tracking-[-0.04em]",children:e.description})]});w.displayName="BrandEquity";var C=(0,E.withLayout)(w);
1
+ "use strict";"use client";var j=Object.create;var d=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var L=Object.getOwnPropertyNames;var z=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var H=(e,r)=>{for(var i in r)d(e,i,{get:r[i],enumerable:!0})},h=(e,r,i,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of L(r))!A.call(e,o)&&o!==i&&d(e,o,{get:()=>r[o],enumerable:!(a=P(r,o))||a.enumerable});return e};var k=(e,r,i)=>(i=e!=null?j(z(e)):{},h(r||!e||!e.__esModule?d(i,"default",{value:e,enumerable:!0}):i,e)),D=e=>h(d({},"__esModule",{value:!0}),e);var F={};H(F,{default:()=>C});module.exports=D(F);var t=require("react/jsx-runtime"),s=require("react"),l=require("../../helpers/utils.js"),y=k(require("../../components/picture.js")),q=require("../../shared/Styles.js"),E=require("react-responsive"),S=require("../../hooks/useExposure.js"),c=require("swiper/react"),p=require("swiper/modules"),M=k(require("../Title/index.js"));const R="copy",Q="store_benefits",$=(e,r)=>{const i=[];for(let a=0;a<e.length;a+=r)i.push(e.slice(a,a+r));return i},N=(0,s.forwardRef)(({data:{items:e=[],itemShape:r,title:i,theme:a},className:o},u)=>{const[x,B]=(0,s.useState)(!1),v=(0,E.useMediaQuery)({query:"(max-width: 768px)"}),b=(0,s.useRef)(null),f=(0,s.useRef)(null);(0,s.useImperativeHandle)(u,()=>f.current),(0,S.useExposure)(f,{componentType:R,componentName:Q}),(0,s.useEffect)(()=>{B(v)},[v]);const T=x?$(e,3):e;return(0,t.jsxs)("div",{ref:f,className:(0,l.cn)("brand-equity-wrapper w-full",{"aiui-dark":a==="dark"},o),children:[i&&(0,t.jsx)(M.default,{data:{title:i}}),x?(0,t.jsxs)(c.Swiper,{className:(0,l.cn)(o),modules:[p.FreeMode,p.Mousewheel,p.Pagination],freeMode:!0,mousewheel:{forceToAxis:!0},pagination:{clickable:!0,el:b.current},breakpoints:{0:{spaceBetween:12}},children:[T?.map((n,m)=>(0,t.jsx)(c.SwiperSlide,{className:"!flex flex-col gap-3",children:Array.isArray(n)&&n?.map((I,g)=>(0,t.jsx)(w,{data:I,itemShape:r,index:g,theme:a},g))},"SwiperSlide"+m)),(0,t.jsx)("div",{ref:b,className:"mt-3 flex justify-center"})]}):(0,t.jsx)("div",{className:(0,l.cn)("grid grid-cols-1 gap-3","tablet:grid-cols-2","laptop:gap-4 laptop:grid-cols-10"),children:e.map((n,m)=>(0,t.jsx)(w,{data:n,itemShape:r,index:m,theme:a},m))})]})}),w=({data:e,itemShape:r,index:i,theme:a})=>(0,t.jsxs)("div",{className:(0,l.cn)("brand-equity-item",`brand-equity-item-${i+1}`,e.containerName?`brand-equity-item--${e.containerName}`:void 0,"bg-container-secondary-1 box-border flex w-full flex-col p-4","desktop:p-6 justify-between","laptop:col-span-3 lg-desktop:p-8","laptop:h-[192px] lg-desktop:h-[240px] h-[160px]",{"laptop:col-span-4":[0,5,6,11].includes(i),"bg-container-primary":a==="dark"},"rounded-box",e.className),children:[(0,t.jsxs)("div",{className:"lg-desktop:h-[36px] flex h-[30px] items-center justify-between gap-3",children:[(0,t.jsx)("h3",{className:"lg-desktop:text-[18px] desktop:text-[16px] text-info-primary text-[14px] font-bold leading-[1.2] tracking-[-0.02em]",children:e.title}),e.type==="avatar"?(0,t.jsx)("div",{className:"flex shrink-0 -space-x-2",children:e?.avatarList?.map((o,u)=>(0,t.jsx)("div",{className:(0,l.cn)("border-container-primary size-[30px] overflow-hidden rounded-full border-2","relative inline-block shrink-0","lg-desktop:size-[36px]"),children:(0,t.jsx)(y.default,{source:o.avatar?.url,alt:o.avatar?.alt,className:"size-full object-cover"})},u))}):(0,t.jsx)("div",{className:"lg-desktop:size-[36px] size-[30px] shrink-0",children:(0,t.jsx)(y.default,{className:"size-full object-cover",source:e.icon?.url,alt:e.icon?.alt,imgClassName:"w-full h-full object-cover"})})]}),(0,t.jsx)("p",{className:"lg-desktop:text-[24px] text-info-primary line-clamp-3 text-[20px] font-bold leading-[1.2] tracking-[-0.04em]",children:e.description})]});N.displayName="BrandEquity";var C=(0,q.withLayout)(N);
@@ -1 +1 @@
1
- "use strict";var Q=Object.create;var M=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var J=(a,t)=>{for(var s in t)M(a,s,{get:t[s],enumerable:!0})},G=(a,t,s,h)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Z(t))!F.call(a,i)&&i!==s&&M(a,i,{get:()=>t[i],enumerable:!(h=q(t,i))||h.enumerable});return a};var P=(a,t,s)=>(s=a!=null?Q(j(a)):{},G(t||!a||!a.__esModule?M(s,"default",{value:a,enumerable:!0}):s,a)),K=a=>G(M({},"__esModule",{value:!0}),a);var ee={};J(ee,{default:()=>X});module.exports=K(ee);var e=require("react/jsx-runtime"),r=P(require("react")),R=require("react-responsive"),A=require("../../shared/Styles.js"),C=P(require("../../components/picture.js")),O=P(require("../../components/button.js")),I=require("../../components/heading.js"),b=require("../../components/tabs.js"),E=require("../VideoModal/index.js"),p=require("../../helpers/utils.js"),_=P(require("../SwiperBox/index.js")),L=require("../../shared/mimeType.js"),D=require("../../hooks/useExposure.js"),V=require("../../shared/trackUrlRef.js"),H=require("../AiuiProvider/index.js");const w="image",y="p1_banner",W=({data:a,configuration:t,jIndex:s})=>{const[h,i]=(0,r.useState)(!1),m=(0,R.useMediaQuery)({query:"(max-width: 768px)"}),u=(0,r.useRef)(null),v=()=>{switch(t?.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[400] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[426] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[426] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}};(0,D.useExposure)(u,{componentType:w,componentName:y,position:s,componentTitle:a.title,componentDescription:a.description,navigation:t?.activeTab}),(0,r.useEffect)(()=>{i(m)},[m]);const{theme:n="light",title:c,description:o,imageUrl:d,primaryButton:f,secondaryButton:g,imageMobileUrl:k,blockLink:x,video:$,youtubeId:N,isYouTube:B}=a,T="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return(0,e.jsxs)("div",{className:(0,p.cn)("item-wrapper text-info-primary group relative box-border w-full overflow-hidden",v(),{"rounded-box":!0,"aiui-dark":n==="dark","h-[400px]":h},"text-info-primary"),ref:u,children:[x&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:(0,V.trackUrlRef)((0,p.getLocalizedPath)(x||"",t?.locale||"us"),`${w}_${y}`),"data-headless-type-name":`${w}#${y}`,"data-headless-title-desc-button":`${c}#${o}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,"aria-hidden":"true",tabIndex:-1}),(0,e.jsxs)("div",{className:"absolute inset-0",children:[(0,L.isVideo)(d?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:block hidden h-full overflow-hidden",children:(0,e.jsx)("source",{src:d?.url,type:"video/mp4"})}):(0,e.jsx)(C.default,{source:d?.url,alt:d?.alt||"",className:"tablet:block hidden h-full overflow-hidden",imgClassName:(0,p.cn)("h-full object-cover",x&&"transition-all duration-300 group-hover:scale-105"),style:{aspectRatio:`${d?.width}/${d?.height}`}}),(0,L.isVideo)(k?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:hidden block h-full overflow-hidden",children:(0,e.jsx)("source",{src:k?.url,type:"video/mp4"})}):(0,e.jsx)(C.default,{source:k?.url||d?.url,alt:k?.alt||d?.alt||"",className:"tablet:hidden block h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 object-cover"}),(0,e.jsxs)("div",{className:(0,p.cn)("laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 pointer-events-none absolute inset-x-0 bottom-0 z-20 flex w-fit flex-col gap-6 p-4",{"laptop:top-1/2 laptop:-translate-y-1/2 laptop:bottom-auto":a?.width==="full"}),children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(I.Heading,{size:3,as:"h3",className:"item-title",html:c}),(0,e.jsx)(I.Heading,{as:"h4",className:"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-3 text-[14px]",html:o})]}),(0,e.jsxs)("div",{className:"lg-desktop:gap-3 flex gap-2",children:[g&&g.text&&(0,e.jsxs)(O.default,{"aria-label":c??o,className:(0,p.cn)(T,"link-left pointer-events-auto"),variant:"secondary",as:"a",href:(0,V.trackUrlRef)((0,p.getLocalizedPath)(g.link||"",t?.locale||"us"),`${w}_${y}`),"data-headless-type-name":`${w}#${y}`,"data-headless-title-desc-button":`${c}#${o}#${g?.text}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,children:[g.text,(0,e.jsx)("span",{className:"sr-only",children:c??o})]}),f&&f.text&&(0,e.jsx)(O.default,{"aria-label":c??o,className:(0,p.cn)(T,"link-right pointer-events-auto"),variant:"primary",as:"a",href:(0,V.trackUrlRef)((0,p.getLocalizedPath)(f.link||"",t?.locale||"us"),`${w}_${y}`),"data-headless-type-name":`${w}#${y}`,"data-headless-title-desc-button":`${c}#${o}#${f.text}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,children:f.text})]})]})]}),(0,e.jsx)("div",{children:(0,e.jsx)("div",{className:"laptop:bottom-[32px] laptop:right-[32px] absolute bottom-[16px] right-[16px]",children:($?.url||N)&&(0,e.jsx)("button",{onClick:()=>{t?.onVideoPlayBtnClick?.($?.url||N,B)},className:"laptop:size-12 hover:bg-current/75 bg-info-primary flex size-8 items-center justify-center rounded-full opacity-80",children:(0,e.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:n==="dark"?"black":"white",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z"})})})})})]})},z=({items:a=[],shape:t,locale:s,activeTab:h,onVideoPlayBtnClick:i})=>{const m=u=>{const v=a?.length,n=v>3,c=v>2,o=v>1;switch(!0){case u>=1440:case u>=1024:return n?3:v;case u>=768:return n||c?2.3:o?2:1;default:return o?1.2:1}};return(0,e.jsx)(_.default,{className:"!overflow-visible",id:"GraphicOverlaySwiper",data:{list:a||[],configuration:{shape:t,num:a.length,locale:s,activeTab:h,onVideoPlayBtnClick:i}},Slide:W,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:m(374)},768:{spaceBetween:16,freeMode:!1,slidesPerView:m(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:m(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:m(1440)}}})},U=r.default.forwardRef((a,t)=>{const{data:s,className:h,...i}=a,{shape:m,items:u=[],isShowTab:v=!1,tabs:n,tabAlign:c="left"}=s,[o,d]=(0,r.useState)(!1),[f,g]=(0,r.useState)(""),[k,x]=(0,r.useState)(""),[$,N]=(0,r.useState)(n?.[0]?.id??""),{locale:B="us"}=(0,H.useAiuiContext)(),T=(l,Y)=>{d(!0),Y?x?.(l||""):g?.(l||"")},S=()=>(0,e.jsx)(E.VideoModal,{visible:o,youTubeId:k,videoUrl:f,onCloseModal:()=>d(!1)});return!v||!n||n.length===0?(0,e.jsxs)("section",{"data-ui-component-id":"GraphicOverlay",ref:t,...i,className:(0,p.cn)("graphicOverlayBlock text-info-primary max-w-[100dvw]",h),children:[u&&u.length>0?(0,e.jsx)(z,{items:u,shape:m,locale:B,onVideoPlayBtnClick:T}):null,o&&S()]}):(0,e.jsxs)("section",{"data-ui-component-id":"GraphicOverlay",ref:t,...i,className:(0,p.cn)("graphicOverlayBlock text-info-primary max-w-[100dvw]",h),children:[(0,e.jsxs)(b.Tabs,{value:$,onValueChange:N,align:c,children:[(0,e.jsx)("div",{className:"mb-6",children:(0,e.jsx)(b.TabsList,{children:n.map(l=>(0,e.jsx)(b.TabsTrigger,{value:l.id,children:l.label},l.id))})}),n.map(l=>(0,e.jsx)(b.TabsContent,{value:l.id,children:l.items&&l.items.length>0?(0,e.jsx)(z,{items:l.items,shape:m,locale:B,activeTab:l.id,onVideoPlayBtnClick:T}):null},l.id))]}),o&&S()]})});U.displayName="GraphicOverlayBlock";var X=(0,A.withLayout)(U);
1
+ "use strict";var Q=Object.create;var M=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var j=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var J=(a,t)=>{for(var s in t)M(a,s,{get:t[s],enumerable:!0})},G=(a,t,s,h)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Z(t))!F.call(a,i)&&i!==s&&M(a,i,{get:()=>t[i],enumerable:!(h=q(t,i))||h.enumerable});return a};var P=(a,t,s)=>(s=a!=null?Q(j(a)):{},G(t||!a||!a.__esModule?M(s,"default",{value:a,enumerable:!0}):s,a)),K=a=>G(M({},"__esModule",{value:!0}),a);var ee={};J(ee,{default:()=>X});module.exports=K(ee);var e=require("react/jsx-runtime"),r=P(require("react")),R=require("react-responsive"),A=require("../../shared/Styles.js"),C=P(require("../../components/picture.js")),O=P(require("../../components/button.js")),I=require("../../components/heading.js"),v=require("../../components/tabs.js"),E=require("../VideoModal/index.js"),p=require("../../helpers/utils.js"),_=P(require("../SwiperBox/index.js")),L=require("../../shared/mimeType.js"),D=require("../../hooks/useExposure.js"),V=require("../../shared/trackUrlRef.js"),H=require("../AiuiProvider/index.js");const y="image",w="p1_banner",W=({data:a,configuration:t,jIndex:s})=>{const[h,i]=(0,r.useState)(!1),m=(0,R.useMediaQuery)({query:"(max-width: 768px)"}),u=(0,r.useRef)(null),b=()=>{switch(t?.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[346] tablet:aspect-h-[400] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[426] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[426] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}};(0,D.useExposure)(u,{componentType:y,componentName:w,position:s,componentTitle:a.title,componentDescription:a.description,navigation:t?.activeTab}),(0,r.useEffect)(()=>{i(m)},[m]);const{theme:n="light",title:c,description:o,imageUrl:d,primaryButton:f,secondaryButton:g,imageMobileUrl:k,blockLink:x,video:$,youtubeId:N,isYouTube:B}=a,T="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return(0,e.jsxs)("div",{className:(0,p.cn)("item-wrapper text-info-primary group relative box-border w-full overflow-hidden",b(),{"rounded-box":!0,"aiui-dark":n==="dark","h-[400px]":h},"text-info-primary"),ref:u,children:[x&&(0,e.jsx)("a",{className:"absolute inset-0 z-10",href:(0,V.trackUrlRef)((0,p.getLocalizedPath)(x||"",t?.locale||"us"),`${y}_${w}`),"data-headless-type-name":`${y}#${w}`,"data-headless-title-desc-button":`${c}#${o}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,"aria-hidden":"true",tabIndex:-1}),(0,e.jsxs)("div",{className:"absolute inset-0",children:[(0,L.isVideo)(d?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:block hidden h-full overflow-hidden",children:(0,e.jsx)("source",{src:d?.url,type:"video/mp4"})}):(0,e.jsx)(C.default,{source:d?.url,alt:d?.alt||"",className:"tablet:block hidden h-full overflow-hidden",imgClassName:(0,p.cn)("h-full object-cover",x&&"transition-all duration-300 group-hover:scale-105"),style:{aspectRatio:`${d?.width}/${d?.height}`}}),(0,L.isVideo)(k?.mimeType)?(0,e.jsx)("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:hidden block h-full overflow-hidden",children:(0,e.jsx)("source",{src:k?.url,type:"video/mp4"})}):(0,e.jsx)(C.default,{source:k?.url||d?.url,alt:k?.alt||d?.alt||"",className:"tablet:hidden block h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 object-cover"}),(0,e.jsxs)("div",{className:(0,p.cn)("laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 pointer-events-none absolute inset-x-0 bottom-0 z-20 flex w-fit flex-col gap-6 p-4",{"laptop:top-1/2 laptop:-translate-y-1/2 laptop:bottom-auto":a?.width==="full"}),children:[(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)(I.Heading,{size:3,as:"h3",className:"item-title",html:c}),(0,e.jsx)(I.Heading,{as:"h4",className:"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-3 text-[14px]",html:o})]}),(0,e.jsxs)("div",{className:"lg-desktop:gap-3 flex gap-2",children:[g&&g.text&&(0,e.jsxs)(O.default,{"aria-label":c??o,className:(0,p.cn)(T,"link-left pointer-events-auto"),variant:"secondary",as:"a",href:(0,V.trackUrlRef)((0,p.getLocalizedPath)(g.link||"",t?.locale||"us"),`${y}_${w}`),"data-headless-type-name":`${y}#${w}`,"data-headless-title-desc-button":`${c}#${o}#${g?.text}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,children:[g.text,(0,e.jsx)("span",{className:"sr-only",children:c??o})]}),f&&f.text&&(0,e.jsx)(O.default,{"aria-label":c??o,className:(0,p.cn)(T,"link-right pointer-events-auto"),variant:"primary",as:"a",href:(0,V.trackUrlRef)((0,p.getLocalizedPath)(f.link||"",t?.locale||"us"),`${y}_${w}`),"data-headless-type-name":`${y}#${w}`,"data-headless-title-desc-button":`${c}#${o}#${f.text}`,"data-headless-nav-position":`${t?.activeTab}#${s}`,children:f.text})]})]})]}),(0,e.jsx)("div",{children:(0,e.jsx)("div",{className:"laptop:bottom-[32px] laptop:right-[32px] absolute bottom-[16px] right-[16px]",children:($?.url||N)&&(0,e.jsx)("button",{onClick:()=>{t?.onVideoPlayBtnClick?.($?.url||N,B)},className:"laptop:size-12 hover:bg-current/75 bg-info-primary flex size-8 items-center justify-center rounded-full opacity-80",children:(0,e.jsx)("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:n==="dark"?"black":"white",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M12 7L0 14L0 0L12 7Z"})})})})})]})},z=({items:a=[],shape:t,locale:s,activeTab:h,onVideoPlayBtnClick:i})=>{const m=u=>{const b=a?.length,n=b>3,c=b>2,o=b>1;switch(!0){case u>=1440:case u>=1024:return n?3:b;case u>=768:return n||c?2.3:o?2:1;default:return o?1.2:1}};return(0,e.jsx)(_.default,{className:"!overflow-visible",id:"GraphicOverlaySwiper",data:{list:a||[],configuration:{shape:t,num:a.length,locale:s,activeTab:h,onVideoPlayBtnClick:i}},Slide:W,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:m(374)},768:{spaceBetween:16,freeMode:!1,slidesPerView:m(768)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:m(1024)},1440:{spaceBetween:16,freeMode:!1,slidesPerView:m(1440)}}})},U=r.default.forwardRef((a,t)=>{const{data:s,className:h,...i}=a,{shape:m,items:u=[],isShowTab:b=!1,tabs:n,tabAlign:c="left"}=s,[o,d]=(0,r.useState)(!1),[f,g]=(0,r.useState)(""),[k,x]=(0,r.useState)(""),[$,N]=(0,r.useState)(n?.[0]?.id??""),{locale:B="us"}=(0,H.useAiuiContext)(),T=(l,Y)=>{d(!0),Y?x?.(l||""):g?.(l||"")},S=()=>(0,e.jsx)(E.VideoModal,{visible:o,youTubeId:k,videoUrl:f,onCloseModal:()=>d(!1)});return!b||!n||n.length===0?(0,e.jsxs)("section",{"data-ui-component-id":"GraphicOverlay",ref:t,...i,className:(0,p.cn)("graphicOverlayBlock text-info-primary ",h),children:[u&&u.length>0?(0,e.jsx)(z,{items:u,shape:m,locale:B,onVideoPlayBtnClick:T}):null,o&&S()]}):(0,e.jsxs)("section",{"data-ui-component-id":"GraphicOverlay",ref:t,...i,className:(0,p.cn)("graphicOverlayBlock text-info-primary ",h),children:[(0,e.jsxs)(v.Tabs,{value:$,onValueChange:N,align:c,children:[(0,e.jsx)("div",{className:"mb-6",children:(0,e.jsx)(v.TabsList,{children:n.map(l=>(0,e.jsx)(v.TabsTrigger,{value:l.id,children:l.label},l.id))})}),n.map(l=>(0,e.jsx)(v.TabsContent,{value:l.id,children:l.items&&l.items.length>0?(0,e.jsx)(z,{items:l.items,shape:m,locale:B,activeTab:l.id,onVideoPlayBtnClick:T}):null},l.id))]}),o&&S()]})});U.displayName="GraphicOverlayBlock";var X=(0,A.withLayout)(U);
@@ -1,10 +1,9 @@
1
1
  /**
2
2
  * 移动端菜单项
3
3
  */
4
- export declare const MenuItem: ({ label, href, target, onClick, active, icon, className, }: {
4
+ export declare const MenuItem: ({ label, href, onClick, active, icon, className, }: {
5
5
  label: string;
6
6
  href?: string;
7
- target?: string;
8
7
  onClick?: () => void;
9
8
  active?: boolean;
10
9
  icon?: string;
@@ -1 +1 @@
1
- "use strict";var b=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var x=Object.prototype.hasOwnProperty;var v=(t,n)=>{for(var l in n)b(t,l,{get:n[l],enumerable:!0})},h=(t,n,l,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of g(n))!x.call(t,i)&&i!==l&&b(t,i,{get:()=>n[i],enumerable:!(r=f(n,i))||r.enumerable});return t};var N=t=>h(b({},"__esModule",{value:!0}),t);var C={};v(C,{MenuItem:()=>k,SubSubCategoryContentComp:()=>w,SubSubCategoryItemComp:()=>y});module.exports=N(C);var e=require("react/jsx-runtime"),$=require("react"),o=require("../../components/index.js"),s=require("../../helpers/utils.js"),c=require("./icons/index.js"),d=require("./SidebarDropdown.js"),u=require("../AiuiProvider/index.js");const k=({label:t,href:n,target:l,onClick:r,active:i,icon:a,className:m})=>{const p=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[(0,e.jsx)(o.Text,{html:t,className:(0,s.cn)("text-sm font-bold leading-[1.4]",{underline:a})}),a&&(0,e.jsx)(o.Text,{html:a,"aria-hidden":"true"})]}),(0,e.jsx)("svg",{className:`size-5 ${i?"rotate-90":""}`,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M9 5L16 12L9 19",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]});return n?(0,e.jsx)(o.Link,{href:n,target:l,rel:l==="_blank"?"noopener noreferrer":void 0,className:(0,s.cn)("flex cursor-pointer items-center justify-between py-4 no-underline",m),onClick:r,children:p}):(0,e.jsx)("button",{onClick:r,className:(0,s.cn)("flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",m),"aria-expanded":i,children:p})},y=({matchSeriesMetadata:t,onSubSubCategoryItemClick:n,expanded:l})=>{const r=(0,e.jsxs)(e.Fragment,{children:[t?.label&&(0,e.jsx)(o.Text,{html:t?.label,className:"text-sm font-bold leading-[1.4]"}),n&&(0,e.jsx)(c.DownArrow,{"aria-hidden":"true",className:(0,s.cn)("size-5",{"rotate-180":l})})]});return n?(0,e.jsx)("button",{className:"tablet:pt-0 flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",onClick:n,"aria-expanded":l,children:r}):(0,e.jsx)("div",{className:"tablet:pt-0 flex items-center justify-between py-4",children:r})},w=({matchSeriesMetadata:t})=>{const{locale:n="us"}=(0,u.useAiuiContext)();return(0,e.jsx)("div",{className:"laptop:gap-3 flex flex-col gap-2",children:!!t?.series?.length&&t?.series?.map((l,r)=>(0,e.jsxs)("div",{children:[l.label&&(0,e.jsx)(o.Text,{html:l.label,as:"p",className:"mb-2 text-sm font-bold leading-[1.4] text-[#3D3D3F]"}),(0,e.jsxs)("div",{className:"laptop:grid-cols-3 laptop:gap-4 tablet:grid tablet:grid-cols-2 tablet:gap-3 flex flex-col gap-2",children:[!!t?.banner&&(0,e.jsx)(o.Link,{asChild:!t?.banner?.href,href:(0,s.getLocalizedPath)(t?.banner?.href,n),children:(0,e.jsxs)("div",{className:"relative [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[(0,e.jsx)(o.Picture,{source:t?.banner?.imageUrl,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(o.Heading,{size:2,html:t?.banner?.title||"Buy in Guide",className:(0,s.cn)("font-bold text-white",{"text-black":t?.banner?.theme==="dark"})}),(0,e.jsx)(o.Text,{html:t?.banner?.desc||"20.000mAh",className:(0,s.cn)("text-sm font-bold text-white",{"text-black":t?.banner?.theme==="dark"})})]})]})}),l.products?.map((i,a)=>(0,e.jsx)(d.SeriesProductItem,{position:a,product:i,seriesLabel:t?.label,isCollection:t?.isCollection},`seriesProductItem-${l?.label||""}-${r}-${a}`))]})]},`seriesItem-${l?.label||""}-${r}`))})};
1
+ "use strict";var b=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var x=(t,l)=>{for(var n in l)b(t,n,{get:l[n],enumerable:!0})},v=(t,l,n,r)=>{if(l&&typeof l=="object"||typeof l=="function")for(let i of f(l))!g.call(t,i)&&i!==n&&b(t,i,{get:()=>l[i],enumerable:!(r=u(l,i))||r.enumerable});return t};var h=t=>v(b({},"__esModule",{value:!0}),t);var w={};x(w,{MenuItem:()=>N,SubSubCategoryContentComp:()=>k,SubSubCategoryItemComp:()=>y});module.exports=h(w);var e=require("react/jsx-runtime"),L=require("react"),o=require("../../components/index.js"),s=require("../../helpers/utils.js"),p=require("./icons/index.js"),c=require("./SidebarDropdown.js"),d=require("../AiuiProvider/index.js");const N=({label:t,href:l,onClick:n,active:r,icon:i,className:a})=>{const m=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[(0,e.jsx)(o.Text,{html:t,className:(0,s.cn)("text-sm font-bold leading-[1.4]",{underline:i})}),i&&(0,e.jsx)(o.Text,{html:i,"aria-hidden":"true"})]}),(0,e.jsx)("svg",{className:`size-5 ${r?"rotate-90":""}`,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:(0,e.jsx)("path",{d:"M9 5L16 12L9 19",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]});return l?(0,e.jsx)(o.Link,{href:l,className:(0,s.cn)("flex cursor-pointer items-center justify-between py-4 no-underline",a),onClick:n,children:m}):(0,e.jsx)("button",{onClick:n,className:(0,s.cn)("flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",a),"aria-expanded":r,children:m})},y=({matchSeriesMetadata:t,onSubSubCategoryItemClick:l,expanded:n})=>{const r=(0,e.jsxs)(e.Fragment,{children:[t?.label&&(0,e.jsx)(o.Text,{html:t?.label,className:"text-sm font-bold leading-[1.4]"}),l&&(0,e.jsx)(p.DownArrow,{"aria-hidden":"true",className:(0,s.cn)("size-5",{"rotate-180":n})})]});return l?(0,e.jsx)("button",{className:"tablet:pt-0 flex w-full cursor-pointer items-center justify-between border-0 bg-transparent py-4 text-left",onClick:l,"aria-expanded":n,children:r}):(0,e.jsx)("div",{className:"tablet:pt-0 flex items-center justify-between py-4",children:r})},k=({matchSeriesMetadata:t})=>{const{locale:l="us"}=(0,d.useAiuiContext)();return(0,e.jsx)("div",{className:"laptop:gap-3 flex flex-col gap-2",children:!!t?.series?.length&&t?.series?.map((n,r)=>(0,e.jsxs)("div",{children:[n.label&&(0,e.jsx)(o.Text,{html:n.label,as:"p",className:"mb-2 text-sm font-bold leading-[1.4] text-[#3D3D3F]"}),(0,e.jsxs)("div",{className:"laptop:grid-cols-3 laptop:gap-4 tablet:grid tablet:grid-cols-2 tablet:gap-3 flex flex-col gap-2",children:[!!t?.banner&&(0,e.jsx)(o.Link,{asChild:!t?.banner?.href,href:(0,s.getLocalizedPath)(t?.banner?.href,l),children:(0,e.jsxs)("div",{className:"relative [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[(0,e.jsx)(o.Picture,{source:t?.banner?.imageUrl,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(o.Heading,{size:2,html:t?.banner?.title||"Buy in Guide",className:(0,s.cn)("font-bold text-white",{"text-black":t?.banner?.theme==="dark"})}),(0,e.jsx)(o.Text,{html:t?.banner?.desc||"20.000mAh",className:(0,s.cn)("text-sm font-bold text-white",{"text-black":t?.banner?.theme==="dark"})})]})]})}),n.products?.map((i,a)=>(0,e.jsx)(c.SeriesProductItem,{position:a,product:i,seriesLabel:t?.label,isCollection:t?.isCollection},`seriesProductItem-${n?.label||""}-${r}-${a}`))]})]},`seriesItem-${n?.label||""}-${r}`))})};
@@ -1 +1 @@
1
- "use strict";var A=Object.create;var C=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var R=(t,i)=>{for(var m in i)C(t,m,{get:i[m],enumerable:!0})},L=(t,i,m,y)=>{if(i&&typeof i=="object"||typeof i=="function")for(let p of B(i))!O.call(t,p)&&p!==m&&C(t,p,{get:()=>i[p],enumerable:!(y=j(i,p))||y.enumerable});return t};var V=(t,i,m)=>(m=t!=null?A(E(t)):{},L(i||!t||!t.__esModule?C(m,"default",{value:t,enumerable:!0}):m,t)),W=t=>L(C({},"__esModule",{value:!0}),t);var H={};R(H,{SeriesProductItem:()=>_,SidebarDropdown:()=>P});module.exports=W(H);var e=require("react/jsx-runtime"),c=V(require("react")),n=require("../../components/index.js"),b=require("../../helpers/utils.js"),D=require("./icons/index.js"),$=require("./NavProvider.js"),F=require("../AiuiProvider/index.js");const P=c.default.memo(({sidebarCategoriesMetadata:t,seriesMetadata:i})=>{const{buildProps:m,onSidebarNavClick:y}=(0,$.useNavContext)(),{locale:p="us"}=(0,F.useAiuiContext)(),[v,N]=(0,c.useState)([]),[h,S]=(0,c.useState)(-1),g=(0,c.useRef)(null),x=(0,c.useRef)(null),k=(0,c.useCallback)(()=>{const a=t?.subcategories;if(!a?.length)return;const o=a.findIndex(u=>!!u?.subSubCategories),l=a.findIndex(u=>!u?.subSubCategories),r=a.map((u,d)=>({index:d,open:o===d||l===d}));N(r)},[t]);(0,c.useEffect)(()=>{k()},[k]);const s=(0,c.useMemo)(()=>{const a=t?.subcategories?.[v?.find(l=>l.open)?.index||0],o=i?.find(l=>l?.label?.toLowerCase()===a?.label?.toLowerCase())||{};if(a?.collections){const l=m?.categories?.[a?.collections]||{};return{label:o?.label,isCollection:!0,banner:o?.banner,primary:o?.primary,series:[{products:l?.products}]}}else if(a?.subSubCategories){const l=a?.subSubCategories?.[h],r=i?.find(u=>u?.label?.toLowerCase()===l?.label?.toLowerCase())||{};if(l?.collections){const u=m?.categories?.[l?.collections]||{};return{label:r?.label,isCollection:!0,banner:r?.banner,primary:r?.primary,series:[{products:u?.products}]}}else return r}else return o},[t,v,h,i,m]),f=(0,c.useCallback)((a,o)=>{const l=o?.subSubCategories?.length>0;S(l?0:-1);const r=x.current;N(u=>u.map((d,z)=>z===a?{...d,open:!d.open}:l?{...d,open:!1}:!r&&h===-1?{...d,open:!1}:r&&!r.hasSubSubCategories&&!l&&h===-1?{...d,open:!1}:d)),x.current={index:a,hasSubSubCategories:l}},[h]),w=(a,o)=>{N(l=>l.map(r=>r.index===a?{...r,open:!0}:{...r,open:!1})),S(o)};return(0,e.jsxs)(n.Container,{childClassName:"lg-desktop:gap-12 flex bg-white gap-8",children:[(0,e.jsxs)("div",{className:"lg-desktop:basis-[356px] flex basis-[284px] flex-col gap-4 py-4",style:{userSelect:"none"},ref:g,children:[(0,e.jsx)("div",{className:"desktop:h-[416px] flex flex-col overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t?.subcategories?.map((a,o)=>{const l=Array.isArray(a?.subSubCategories)&&a?.subSubCategories?.length>0,r=v?.find(u=>u.index===o)?.open;return(0,e.jsxs)("div",{children:[(0,e.jsxs)("button",{className:(0,b.cn)("rounded-sidebar-shelf flex w-full cursor-pointer items-center justify-between border-0 bg-transparent text-left",{"bg-[#F5F5F7]":!l&&r}),onClick:()=>{f(o,a),y?.(a,o)},"aria-expanded":l?r:void 0,"aria-haspopup":l?"true":void 0,children:[(0,e.jsx)(n.Text,{html:a.label,className:"p-4 text-sm font-bold leading-[1.4]"}),l&&(0,e.jsx)(D.DownArrow,{"aria-hidden":"true",className:(0,b.cn)("size-4",{"rotate-180":r})})]}),r&&(0,e.jsx)("div",{className:"flex flex-col",role:"menu",children:a.subSubCategories?.map((u,d)=>(0,e.jsx)("button",{onClick:()=>{w(o,d),y?.(u,d)},className:(0,b.cn)("rounded-sidebar-shelf w-full cursor-pointer border-0 bg-transparent px-6 py-4 text-left leading-none hover:bg-[#F5F5F7]",{"bg-[#F5F5F7]":h===d}),role:"menuitem","aria-label":u.label,children:(0,e.jsx)(n.Text,{html:u.label,className:"text-sm font-bold leading-[1.4] text-[#4A4C56]"})},`subSubItem-${o}-${d}`))})]},`${a?.label||""}subcategoryItem-${o}`)})}),t&&(0,e.jsx)("div",{className:"flex",children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[t?.primary&&(0,e.jsx)(n.Button,{as:"a",href:`${(0,b.getLocalizedPath)(t?.primary?.url,p)}?ref=${t?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"lg-desktop:text-base text-sm",children:t?.primary?.label}),t?.secondary&&(0,e.jsx)(n.Button,{as:"a",href:t?.secondary?.url,variant:"link",size:"lg",iconClassName:"size-4",className:"lg-desktop:text-base justify-start !p-0 text-sm",children:t?.secondary?.label})]})})]}),(0,e.jsxs)("div",{className:"flex-1 py-4",children:[Reflect.ownKeys(s).length>0&&(0,e.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(()=>{const a=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(n.Text,{html:s?.label,className:"lg-desktop:text-2xl text-xl font-bold leading-[1.4]"}),s?.primary&&!s?.primary?.hide&&(0,e.jsx)(n.Text,{className:"lg-desktop:text-base text-sm font-bold leading-[1.2]",html:s?.primary?.label})]});return s?.primary?.url?(0,e.jsx)(n.Button,{as:"a",href:`${(0,b.getLocalizedPath)(s?.primary?.url,p)}?ref=${s?.label}_viewmore`,variant:"link",size:"lg",iconClassName:"size-4",className:"flex items-center justify-start gap-2 !p-0 no-underline",children:a}):(0,e.jsx)("div",{className:"flex items-center gap-2",children:a})})(),t?.guide?.label&&(0,e.jsx)(n.Link,{href:(0,b.getLocalizedPath)(t?.guide?.url,p),className:"lg-desktop:text-base text-sm leading-[1.2] text-[#6D6D6F]",children:t?.guide?.label})]}),(0,e.jsx)("div",{className:"flex h-[426px] flex-col gap-4 overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:s?.series?.map((a,o)=>(0,e.jsxs)("div",{children:[a.label&&(0,e.jsx)(n.Text,{html:a.label,as:"p",className:"mb-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[!!s?.banner&&(0,e.jsx)(n.Link,{asChild:!s?.banner?.href,href:(0,b.getLocalizedPath)(s?.banner?.href,p),children:(0,e.jsxs)("div",{className:"relative [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[(0,e.jsx)(n.Picture,{source:s?.banner?.imageUrl,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(n.Heading,{size:2,html:s?.banner?.title||"Buy in Guide",className:(0,b.cn)("font-bold text-white",{"text-black":s?.banner?.theme==="dark"})}),(0,e.jsx)(n.Text,{html:s?.banner?.desc||"20.000mAh",className:(0,b.cn)("text-sm font-bold text-white",{"text-black":s?.banner?.theme==="dark"})})]})]})}),a.products?.map((l,r)=>(0,e.jsx)(_,{seriesLabel:s?.label,product:l,isCollection:s?.isCollection},`seriesProductItem-${a?.label||""}-${o}-${r}`))]})]},`seriesItem-${a?.label||""}-${o}`))})]})]})});P.displayName="SidebarDropdown";const _=({product:t,isCollection:i,position:m,seriesLabel:y})=>{const{locale:p="us"}=(0,F.useAiuiContext)(),{buildProps:v,onSeriesProductClick:N,componentOverrides:h}=(0,$.useNavContext)(),S=h?.badge?.variant;let g=i?t:v?.products?.find(f=>f.handle===t.handle);const x=g?.variants?.find(f=>f.sku===t.sku)||g?.variants?.[0],k=(0,c.useMemo)(()=>`${(0,b.getLocalizedPath)(`/products/${g?.handle}`,p)}?variant=${(0,b.atobID)(x?.id)}`,[g?.handle,x?.id,p]),s=(0,c.useMemo)(()=>g?.tags?.filter?.(f=>f?.startsWith?.("CLtag"))?.map?.(f=>f?.replace?.("CLtag:",""))?.slice?.(0,2),[g?.tags]);return x?.availableForSale?(0,e.jsx)(n.Link,{href:k,onClick:f=>{f.preventDefault(),window.open(k,"_self"),N?.(g,m||0,y)},className:"no-underline hover:text-current",children:(0,e.jsxs)("div",{className:"rounded-sidebar-shelf relative flex shrink-0 items-center gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110 [&_img]:hover:duration-500",children:[(0,e.jsx)("div",{className:"shrink-0",children:(0,e.jsx)("img",{src:`${x?.image?.url||t?.images?.[0]?.url}&width=200`,loading:"lazy",alt:g?.title||t?.name,width:90,height:90,className:"size-[96px] object-contain"})}),Array.isArray(s)&&s?.length>0&&(0,e.jsx)("div",{className:"absolute right-1 top-1 flex gap-1",children:s?.map((f,w)=>(0,e.jsx)(n.Badge,{size:"xs",variant:S,className:"whitespace-nowrap",children:f},w))}),(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col justify-center",children:[(0,e.jsx)(n.Text,{className:"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]",html:t?.custom_name||x?.metafields?.infos?.page_short_title||g?.title}),t?.desc&&(0,e.jsx)(n.Text,{as:"p",html:t?.desc,className:"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]"})]})]})}):null};
1
+ "use strict";var A=Object.create;var C=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,O=Object.prototype.hasOwnProperty;var R=(t,i)=>{for(var m in i)C(t,m,{get:i[m],enumerable:!0})},L=(t,i,m,x)=>{if(i&&typeof i=="object"||typeof i=="function")for(let p of j(i))!O.call(t,p)&&p!==m&&C(t,p,{get:()=>i[p],enumerable:!(x=B(i,p))||x.enumerable});return t};var V=(t,i,m)=>(m=t!=null?A(E(t)):{},L(i||!t||!t.__esModule?C(m,"default",{value:t,enumerable:!0}):m,t)),W=t=>L(C({},"__esModule",{value:!0}),t);var H={};R(H,{SeriesProductItem:()=>_,SidebarDropdown:()=>P});module.exports=W(H);var e=require("react/jsx-runtime"),c=V(require("react")),n=require("../../components/index.js"),b=require("../../helpers/utils.js"),D=require("./icons/index.js"),$=require("./NavProvider.js"),F=require("../AiuiProvider/index.js");const P=c.default.memo(({sidebarCategoriesMetadata:t,seriesMetadata:i})=>{const{buildProps:m,onSidebarNavClick:x}=(0,$.useNavContext)(),{locale:p="us"}=(0,F.useAiuiContext)(),[v,N]=(0,c.useState)([]),[h,S]=(0,c.useState)(-1),g=(0,c.useRef)(null),y=(0,c.useRef)(null),k=(0,c.useCallback)(()=>{const a=t?.subcategories;if(!a?.length)return;const o=a.findIndex(u=>!!u?.subSubCategories),l=a.findIndex(u=>!u?.subSubCategories),r=a.map((u,d)=>({index:d,open:o===d||l===d}));N(r)},[t]);(0,c.useEffect)(()=>{k()},[k]);const s=(0,c.useMemo)(()=>{const a=t?.subcategories?.[v?.find(l=>l.open)?.index||0],o=i?.find(l=>l?.label?.toLowerCase()===a?.label?.toLowerCase())||{};if(a?.collections){const l=m?.categories?.[a?.collections]||{};return{label:o?.label,isCollection:!0,banner:o?.banner,primary:o?.primary,series:[{products:l?.products}]}}else if(a?.subSubCategories){const l=a?.subSubCategories?.[h],r=i?.find(u=>u?.label?.toLowerCase()===l?.label?.toLowerCase())||{};if(l?.collections){const u=m?.categories?.[l?.collections]||{};return{label:r?.label,isCollection:!0,banner:r?.banner,primary:r?.primary,series:[{products:u?.products}]}}else return r}else return o},[t,v,h,i,m]),f=(0,c.useCallback)((a,o)=>{const l=o?.subSubCategories?.length>0;S(l?0:-1);const r=y.current;N(u=>u.map((d,z)=>z===a?{...d,open:!d.open}:l?{...d,open:!1}:!r&&h===-1?{...d,open:!1}:r&&!r.hasSubSubCategories&&!l&&h===-1?{...d,open:!1}:d)),y.current={index:a,hasSubSubCategories:l}},[h]),w=(a,o)=>{N(l=>l.map(r=>r.index===a?{...r,open:!0}:{...r,open:!1})),S(o)};return(0,e.jsxs)(n.Container,{childClassName:"lg-desktop:gap-12 flex bg-white gap-8",children:[(0,e.jsxs)("div",{className:"lg-desktop:basis-[356px] flex basis-[284px] flex-col gap-4 py-4",style:{userSelect:"none"},ref:g,children:[(0,e.jsx)("div",{className:"desktop:h-[416px] flex flex-col overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:t?.subcategories?.map((a,o)=>{const l=Array.isArray(a?.subSubCategories)&&a?.subSubCategories?.length>0,r=v?.find(u=>u.index===o)?.open;return(0,e.jsxs)("div",{children:[(0,e.jsxs)("button",{className:(0,b.cn)("rounded-sidebar-shelf flex w-full cursor-pointer items-center justify-between border-0 bg-transparent text-left",{"bg-[#F5F5F7]":!l&&r}),onClick:()=>{f(o,a),x?.(a,o)},"aria-expanded":l?r:void 0,"aria-haspopup":l?"true":void 0,children:[(0,e.jsx)(n.Text,{html:a.label,className:"p-4 text-sm font-bold leading-[1.4]"}),l&&(0,e.jsx)(D.DownArrow,{"aria-hidden":"true",className:(0,b.cn)("size-4",{"rotate-180":r})})]}),r&&(0,e.jsx)("div",{className:"flex flex-col",role:"menu",children:a.subSubCategories?.map((u,d)=>(0,e.jsx)("button",{onClick:()=>{w(o,d),x?.(u,d)},className:(0,b.cn)("rounded-sidebar-shelf w-full cursor-pointer border-0 bg-transparent px-6 py-4 text-left leading-none hover:bg-[#F5F5F7]",{"bg-[#F5F5F7]":h===d}),role:"menuitem","aria-label":u.label,children:(0,e.jsx)(n.Text,{html:u.label,className:"text-sm font-bold leading-[1.4] text-[#4A4C56]"})},`subSubItem-${o}-${d}`))})]},`${a?.label||""}subcategoryItem-${o}`)})}),t&&(0,e.jsx)("div",{className:"flex",children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[t?.primary&&(0,e.jsx)(n.Button,{as:"a",href:`${(0,b.getLocalizedPath)(t?.primary?.url,p)}?ref=${t?.primary?.label}_shopall`,variant:"primary",size:"lg",className:"lg-desktop:text-base text-sm",children:t?.primary?.label}),t?.secondary&&(0,e.jsx)(n.Button,{as:"a",href:t?.secondary?.url,variant:"link",size:"lg",iconClassName:"size-4",className:"lg-desktop:text-base justify-start !p-0 text-sm",children:t?.secondary?.label})]})})]}),(0,e.jsxs)("div",{className:"flex-1 py-4",children:[Reflect.ownKeys(s).length>0&&(0,e.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(()=>{const a=(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(n.Text,{html:s?.label,className:"lg-desktop:text-2xl text-xl font-bold leading-[1.4]"}),s?.primary&&!s?.primary?.hide&&(0,e.jsx)(n.Text,{className:"lg-desktop:text-base text-sm font-bold leading-[1.2]",html:s?.primary?.label})]});return s?.primary?.url?(0,e.jsx)(n.Button,{as:"a",href:`${(0,b.getLocalizedPath)(s?.primary?.url,p)}?ref=${s?.label}_viewmore`,variant:"link",size:"lg",iconClassName:"size-4",className:"flex items-center justify-start gap-2 !p-0 no-underline",children:a}):(0,e.jsx)("div",{className:"flex items-center gap-2",children:a})})(),t?.guide?.label&&(0,e.jsx)(n.Link,{href:(0,b.getLocalizedPath)(t?.guide?.url,p),className:"lg-desktop:text-base text-sm leading-[1.2] text-[#6D6D6F]",children:t?.guide?.label})]}),(0,e.jsx)("div",{className:"flex h-[426px] flex-col gap-4 overflow-y-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:s?.series?.map((a,o)=>(0,e.jsxs)("div",{children:[a.label&&(0,e.jsx)(n.Text,{html:a.label,as:"p",className:"mb-2 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),(0,e.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[!!s?.banner&&(0,e.jsx)(n.Link,{asChild:!s?.banner?.href,href:(0,b.getLocalizedPath)(s?.banner?.href,p),children:(0,e.jsxs)("div",{className:"relative [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-500",children:[(0,e.jsx)(n.Picture,{source:s?.banner?.imageUrl,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),(0,e.jsxs)("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[(0,e.jsx)(n.Heading,{size:2,html:s?.banner?.title||"Buy in Guide",className:(0,b.cn)("font-bold text-white",{"text-black":s?.banner?.theme==="dark"})}),(0,e.jsx)(n.Text,{html:s?.banner?.desc||"20.000mAh",className:(0,b.cn)("text-sm font-bold text-white",{"text-black":s?.banner?.theme==="dark"})})]})]})}),a.products?.map((l,r)=>(0,e.jsx)(_,{seriesLabel:s?.label,product:l,isCollection:s?.isCollection},`seriesProductItem-${a?.label||""}-${o}-${r}`))]})]},`seriesItem-${a?.label||""}-${o}`))})]})]})});P.displayName="SidebarDropdown";const _=({product:t,isCollection:i,position:m,seriesLabel:x})=>{const{locale:p="us"}=(0,F.useAiuiContext)(),{buildProps:v,onSeriesProductClick:N,componentOverrides:h}=(0,$.useNavContext)(),S=h?.badge?.variant;let g=i?t:v?.products?.find(f=>f.handle===t.handle);const y=g?.variants?.find(f=>f.sku===t.sku)||g?.variants?.[0],k=(0,c.useMemo)(()=>`${(0,b.getLocalizedPath)(`/products/${g?.handle}`,p)}?variant=${(0,b.atobID)(y?.id)}`,[g?.handle,y?.id,p]),s=(0,c.useMemo)(()=>g?.tags?.filter?.(f=>f?.startsWith?.("CLtag"))?.map?.(f=>f?.replace?.("CLtag:",""))?.slice?.(0,2),[g?.tags]);return y?.availableForSale?(0,e.jsx)(n.Link,{href:k,onClick:f=>{f.preventDefault(),window.open(k,"_self"),N?.(g,m||0,x)},className:"no-underline hover:text-current",children:(0,e.jsxs)("div",{className:"rounded-sidebar-shelf flex shrink-0 items-center gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110 [&_img]:hover:duration-500",children:[(0,e.jsx)("div",{className:"shrink-0",children:(0,e.jsx)("img",{src:`${y?.image?.url||t?.images?.[0]?.url}&width=200`,loading:"lazy",alt:g?.title||t?.name,width:90,height:90,className:"size-[96px] object-contain"})}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)("div",{className:"flex gap-1",children:Array.isArray(s)&&s?.map((f,w)=>(0,e.jsx)(n.Badge,{size:"sm",variant:S,className:"mb-1 whitespace-nowrap",children:f},w))}),(0,e.jsx)(n.Text,{className:"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]",html:t?.custom_name||y?.metafields?.infos?.page_short_title||g?.title}),t?.desc&&(0,e.jsx)(n.Text,{as:"p",html:t?.desc,className:"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]"})]})]})}):null};