yt-uikit 0.8.14 → 0.8.15-fix-cart-state.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/components/BundleBlock/BundleBuilder/bundleBuilder.style.d.ts +1 -3
- package/dist/esm/components/BundleBlock/BundleBuilderTracker/bundleBuilderTracker.style.d.ts +1 -3
- package/dist/esm/components/BundleBlock/FixedBundle/fixedBundle.style.d.ts +3 -9
- package/dist/esm/components/BundleBlock/VolumeBundle/volumeBundle.style.d.ts +1 -3
- package/dist/esm/components/Cart/FreebieClaimErrorBoundary.d.ts +28 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/types/components/BundleBlock/BundleBuilder/bundleBuilder.style.d.ts +1 -3
- package/dist/esm/types/components/BundleBlock/BundleBuilderTracker/bundleBuilderTracker.style.d.ts +1 -3
- package/dist/esm/types/components/BundleBlock/FixedBundle/fixedBundle.style.d.ts +3 -9
- package/dist/esm/types/components/BundleBlock/VolumeBundle/volumeBundle.style.d.ts +1 -3
- package/dist/esm/types/components/Cart/FreebieClaimErrorBoundary.d.ts +28 -0
- package/dist/esm/types/utils/freebieErrorLogger.d.ts +68 -0
- package/dist/esm/types/utils/freebieValidation.d.ts +45 -0
- package/dist/esm/utils/freebieErrorLogger.d.ts +68 -0
- package/dist/esm/utils/freebieValidation.d.ts +45 -0
- package/package.json +2 -2
|
@@ -28,9 +28,7 @@ export declare const PriceContainer: import("styled-components/dist/types").ISty
|
|
|
28
28
|
export declare const AddToBundleWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
29
29
|
borderRadius: string;
|
|
30
30
|
}>> & string;
|
|
31
|
-
export declare const AddedButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<
|
|
32
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
33
|
-
}, {
|
|
31
|
+
export declare const AddedButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>, {
|
|
34
32
|
borderRadius: string;
|
|
35
33
|
}>> & string;
|
|
36
34
|
export declare const AddedButtonText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
package/dist/esm/components/BundleBlock/BundleBuilderTracker/bundleBuilderTracker.style.d.ts
CHANGED
|
@@ -30,9 +30,7 @@ export declare const ItemImageBox: import("styled-components/dist/types").IStyle
|
|
|
30
30
|
export declare const QuantityBadge: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
31
31
|
borderRadius: string;
|
|
32
32
|
}>> & string;
|
|
33
|
-
export declare const RemoveButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
|
34
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
35
|
-
}>, never>, never>> & string;
|
|
33
|
+
export declare const RemoveButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
|
|
36
34
|
export declare const DetailedItemContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
37
35
|
borderRadius: string;
|
|
38
36
|
}>> & string;
|
|
@@ -48,9 +48,7 @@ export declare const PriceLine: import("styled-components/dist/types").IStyledCo
|
|
|
48
48
|
export declare const SummaryBlock: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
49
49
|
export declare const AddBundleButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
50
50
|
export declare const PlusWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
51
|
-
export declare const PlusWrapperWithHiding: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<
|
|
52
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
53
|
-
}, never>> & string;
|
|
51
|
+
export declare const PlusWrapperWithHiding: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, never>> & string;
|
|
54
52
|
export declare const PlusSeparator: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
55
53
|
export declare const DropdownContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
56
54
|
export declare const DropdownHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -74,17 +72,13 @@ export declare const OptionRow: import("styled-components/dist/types").IStyledCo
|
|
|
74
72
|
export declare const OptionLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>> & string;
|
|
75
73
|
export declare const CheckboxContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
76
74
|
export declare const HiddenCheckbox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, never>> & string;
|
|
77
|
-
export declare const StyledCheckboxLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>,
|
|
78
|
-
ref?: ((instance: HTMLLabelElement | null) => void) | import("react").RefObject<HTMLLabelElement> | null | undefined;
|
|
79
|
-
}>, never>, {
|
|
75
|
+
export declare const StyledCheckboxLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>>, never>, {
|
|
80
76
|
isChecked: boolean;
|
|
81
77
|
borderColor?: string | undefined;
|
|
82
78
|
borderRadius?: string | undefined;
|
|
83
79
|
backgroundColor?: string | undefined;
|
|
84
80
|
}>> & string;
|
|
85
81
|
export declare const HorizontalCheckboxWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
86
|
-
export declare const VerticalCheckboxWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<
|
|
87
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
88
|
-
}, {
|
|
82
|
+
export declare const VerticalCheckboxWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, {
|
|
89
83
|
isImage?: boolean | undefined;
|
|
90
84
|
}>> & string;
|
|
@@ -61,9 +61,7 @@ export declare const RadioWrapper: import("styled-components/dist/types").IStyle
|
|
|
61
61
|
isActive?: boolean | undefined;
|
|
62
62
|
accentColor?: string | undefined;
|
|
63
63
|
}>> & string;
|
|
64
|
-
export declare const HiddenRadio: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>,
|
|
65
|
-
ref?: ((instance: HTMLInputElement | null) => void) | import("react").RefObject<HTMLInputElement> | null | undefined;
|
|
66
|
-
}>, never>, never>> & string;
|
|
64
|
+
export declare const HiddenRadio: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>>, never>, never>> & string;
|
|
67
65
|
export declare const CustomRadio: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
68
66
|
accentColor?: string | undefined;
|
|
69
67
|
}>> & string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React, { Component, ReactNode } from 'react';
|
|
2
|
+
interface FreebieClaimErrorBoundaryProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
fallback?: ReactNode;
|
|
5
|
+
showErrorUI?: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface FreebieClaimErrorBoundaryState {
|
|
8
|
+
hasError: boolean;
|
|
9
|
+
error: Error | null;
|
|
10
|
+
errorInfo: React.ErrorInfo | null;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Error Boundary for Freebie Claim components
|
|
14
|
+
* Catches React rendering errors and logs them with detailed context
|
|
15
|
+
* Prevents entire cart from crashing when freebie component has errors
|
|
16
|
+
*/
|
|
17
|
+
declare class FreebieClaimErrorBoundary extends Component<FreebieClaimErrorBoundaryProps, FreebieClaimErrorBoundaryState> {
|
|
18
|
+
constructor(props: FreebieClaimErrorBoundaryProps);
|
|
19
|
+
static getDerivedStateFromError(error: Error): Partial<FreebieClaimErrorBoundaryState>;
|
|
20
|
+
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
21
|
+
render(): ReactNode;
|
|
22
|
+
}
|
|
23
|
+
export default FreebieClaimErrorBoundary;
|
|
24
|
+
/**
|
|
25
|
+
* HOC to wrap a component with FreebieClaimErrorBoundary
|
|
26
|
+
* Usage: const SafeComponent = withFreebieErrorBoundary(MyComponent);
|
|
27
|
+
*/
|
|
28
|
+
export declare function withFreebieErrorBoundary<P extends object>(Component: React.ComponentType<P>, showErrorUI?: boolean): React.FC<P>;
|
package/dist/esm/index.js
CHANGED
|
@@ -2236,7 +2236,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
2236
2236
|
font-weight: 400;
|
|
2237
2237
|
min-width: 14px;
|
|
2238
2238
|
line-height: 14px;
|
|
2239
|
-
`,Wp=({isOpen:e,setIsOpen:n,backgroundColor:r="white",backgroundSubdued:a="#3947821F",tertiaryColor:i="#067D431A",tertiaryTextColor:s="#000000",exploreCTAColor:d,checkoutFontSize:p,cartTitle:u="My Cart",emptyCartTitle:m,emptyCartDescription:f,emptyCartButtons:g,removeCartItem:h,handleIncrement:x,handleDecrement:y,addCartItem:b,isUserSignedIn:v,showBundle:w,showCouponOptions:C,bundleProducts:k,discountAmountOff:E,loyaltyIcon:T,pointsToBeUsed:S,rewardMultiplier:$,redemptionMultiplier:B,discountApplied:z,removeDiscount:I,applyDiscount:N,rewardCoupons:D,userTotalPoints:_,checkoutFunction:P,joinNowFunction:A,guestLoyaltyPercentage:O,isDev:F,recProductsList:M,showMultiStepProgressBar:R,cartCheckpoints:L,redemptionRate:j,pointsRewardRate:V,showCartLevelAltPay:W,guestRewardCoupon:H,showGuestDiscountCoupon:q,applyTemplateDiscount:U,exploreCtaRedirectLink:G,discountAmountApplied:Q,minimumCartValue:Y,discountInCheckoutButton:Z,isStickyCheckout:X,showDiscountsListToGuestUsers:K,showApplyCouponsButtonToGuestUsers:J,handleCheckpointCrossed:ee,customCartProgressBarCriteria:te,checkoutButtonColor:ne="#252E69",ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,productRecsCtaButtonText:le,productRecsTitleText:ce,emptyProductRecsTitleText:se,showProductRecsOnDesktop:de,showProductRecsOnMobile:pe,themeColor:ue,themeTextColor:me,companyName:fe,gstNumber:ge,showGSTOption:he,applyGSTToCart:xe,showMOVForProgressTiers:ye,freeProduct:be,showLoyaltyCta:ve=!1,freeProductAdjustedCartTotal:we,minimumOrderValueToAvailDiscount:Ce,signinCTAButtonVisible:ke,cartSigninCTAMainText:Ee,applyNoteToCart:Te,note:Se,showNoteOption:$e,inlineCartOfferInfoText:Be,inlineCartOfferInfoRedirectLink:ze,cartOfferTermsAndConditionsText:Ie,showEditOptionOnProducts:Ne,onSetLoading:De,showVariantSelectionDropdownInProductRecs:_e,originalCartSubtotal:Pe,freebieProductsInCart:Ae,showFreebieClaim:Oe,addFreebieToCart:Fe,freebiesInCart:Me,effectiveQuantityForProgressBar:Re,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,postalCodeList:We,enableGeoLocationDeliveryRestriction:He=!1,getProductDetailsByVariantId:qe,applyPostalCodeAndDeliverySlotToCart:Ue,showDeleteOnFreebies:Ge,freebieCouponTemplates:Qe,freebieFlowCheckpoints:Ye,freebieClaimData:Ze,postalCodeBasedItemTrackingParameter:Xe,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:rt,progressBarFreeProductIconType:ot,enableCustomCartOnCartPage:at,isCartPage:it,showCartTimer:lt,showFreebieMilestone:ct,freebieMilestoneData:pt,cartTimerInMinutes:ut,cartTimerCustomText:mt,productRecsCardLayout:ft,productRecsCardListVariant:gt,imageAspectSelector:xt,cartComponentsCornerType:bt,cartComponentsCornerRadius:vt,cartOffersCarousalData:wt,gstSectionCustomizationData:Ct,noteSectionTitle:kt,checkoutSectionMessage:Et,checkoutSectionMessageDisplay:Tt,showVariantSelectionDropdownInProductClaim:St,loyaltyDiscount:$t,brandTokenName:Bt,showDiscountOnMRP:zt,switchWidthVariant:It,prefixMessageText:Nt,suffixMessageText:Dt,successMessageText:_t,toggleDecimal:Pt,cartOffersCarouselHeight:At,disableCheckoutButton:Ot,showEmptyCartRecommendations:Ft=!1,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:Rt,applyCouponCode:Lt,showApplyCoupon:jt,enableConfetti:Vt,checkoutSectionMessageRedirectLink:Wt,showCheckoutButtonPaymentIcons:Ht})=>{const qt=dn(mn),Ut=dn(Cn),[Gt,Qt]=c(!1),[Yt,Zt]=un(Tn),[Xt,Kt]=c(!1),[Jt,en]=c(!0),{setLoading:tn}=kn();t.useEffect(()=>{De&&De(tn)},[De]);const nn=o(!1);l(()=>{const t=()=>{n(!1)};return e?(nn.current||window.history.pushState({ytCustomCartDrawer:"open"},""),window.addEventListener("popstate",t),nn.current=!0):(nn.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.back(),nn.current=!1),()=>{window.removeEventListener("popstate",t)}},[e,n]);const[rn,on]=c(!1);l(()=>{const t=document.querySelector("body");if(t)return at&&it?(t.classList.remove("drawer-open"),void t.classList.remove("drawer-closed")):void(rn?(t.classList.remove("drawer-open"),t.classList.remove("drawer-closed")):e?(t.classList.add("drawer-open"),t.classList.remove("drawer-closed")):(t.classList.remove("drawer-open"),t.classList.add("drawer-closed")))},[e,at,it,rn]),l(()=>{function e(){const e=window.innerWidth;on(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const an=qt?.items?.reduce((e,t)=>e+t?.quantity,0),ln=o(null);l(()=>{function e(e){ln.current&&!ln.current.contains(e.target)&&Zt(!1)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),l(()=>{const e=()=>{Qt(!0),window.setTimeout(()=>Qt(!1),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)},[]);const[cn,sn]=c("normal"),[pn,fn]=c("normal"),[gn,hn]=c("auto");l(()=>{CSS.supports("font-weight","500")?sn("500"):CSS.supports("font-weight","400")?sn("400"):CSS.supports("font-weight","600")&&sn("600"),CSS.supports("font-weight","400")?fn("400"):CSS.supports("font-weight","300")?fn("300"):CSS.supports("font-weight","200")&&fn("200"),CSS.supports("width","-webkit-fill-available")?hn("-webkit-fill-available"):CSS.supports("width","-moz-available")&&hn("-moz-available")},[]),l(()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",cn),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",pn),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",gn)},[cn,pn]);const[xn]=un(yn);dn(bn);const[Sn]=un(wn),[$n]=un(vn);l(()=>{const e=qt?.items.some(e=>(je?.get(String(e.product_id))||[]).includes("Delhi-NCR"));Kt(e)},[qt?.items,je]);l(()=>{en(!("all-products"!==Xe&&("specific-tags"!==Xe||xn.isPostalCodeValid||Ke)&&("specific-tags"!==Xe||xn.isPostalCodeValid||Sn||!Ke)&&("specific-tags"===Xe&&"standard"===$n||Xt&&(Ke?xn.isPostalCodeValid&&Sn:xn.isPostalCodeValid))))},[xn.isPostalCodeValid,Sn,Xt,Xe,Ke]),un(En);const[Bn,zn]=c(!0);l(()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&zn(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&zn(!1)},[]);const Nn=new Date("2024-11-01");return In(qt?.items_subtotal_price,qt?.currency),t.createElement(jp,{className:"yt-cart-drawer",$isDev:F,$isOpen:e,$backgroundColor:r,$enableCustomCartOnCartPage:at,$isCartPage:it,$isLargeScreen:rn,$switchWidthVariant:It},Ut.cartLoading?t.createElement("div",{style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},Ut.showLoader&&!Ut.showSkeletonLoader&&t.createElement("div",{className:"loader"},"")):t.createElement(t.Fragment,null),t.createElement(t.Fragment,null,Yt&&t.createElement("div",{style:{position:"fixed",inset:0,zIndex:40,backgroundColor:"rgba(128,128,128,0.7)"}},""),t.createElement("div",{className:"yt-cart-drawer-content",style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},t.createElement("div",{style:{}},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",margin:"1rem 1rem 0px"}},t.createElement("span",{className:"yt-cart-title-container",style:{fontWeight:"var(--yt-cart-font-weight, bold)",color:ae,fontSize:"16px"}},t.createElement("span",{style:{whiteSpace:"nowrap",flexShrink:0}},u),qt?.item_count>0&&W&&!(ve&&W)&&V>0&&t.createElement(Rp,{pointsRewardRate:V,loyaltyIcon:T,brandTokenName:Bt,themeColor:ue,themeTextColor:me,rewardMultiplier:$}),an>0&&t.createElement(Vp,{$backgroundSubdued:a},an)),t.createElement("div",{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(at&&it)&&t.createElement("div",{className:"close-button",style:{backgroundColor:a||"#cacaca30"}},t.createElement(yt,{style:{height:"auto",width:"auto",color:ae},fontSize:24,cursor:"pointer",onClick:()=>n(!e)})))),Ut&&t.createElement(Ap,{$themeColor:ue,show:Ut.showLoader}),wt?.enableCartOffersCarousel&&t.createElement(Np,{themeColor:ue,cartOffersCarousalData:wt,cartOffersCarouselHeight:At,cartData:qt}),lt&&Bn&&qt?.item_count?t.createElement(dp,{minutes:ut,customText:mt,onTimerComplete:()=>{zn(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,Gt&&Vt&&t.createElement(io,{particleCount:50,spread:90,origin:{y:.3}}),Be?t.createElement(Ml,{inlineCartOfferInfoText:Be,inlineCartOfferInfoRedirectLink:ze,themeColor:ue,tooltipText:Ie,themeTextColor:me}):null),R&&qt?.items_subtotal_price>0&&qt?.currency&&!!L&&function(e,t,n,r,o){if(!e||0===e.length)return!1;const a=[...e].sort((e,t)=>"minimum_order_value"===r?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold);return a.filter(e=>0!==e?.[Jr(r)]&&("minimum_order_value"!==r||1!==e?.[Jr(r)])).some((e,i)=>eo(e,i,a,o,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:r,checkpoints:a}).progressPercentage>0)}(L,In(void 0!==Pe?Pe:qt?.items_subtotal_price,qt.currency),void 0===Re?qt?.item_count:Re,te??"minimum_order_value",qt?.item_count)&&t.createElement(t.Fragment,null,t.createElement(Lo,{customCartProgressBarCriteria:te??"minimum_order_value",handleCheckpointCrossed:ee,checkpoints:L,effectiveQuantityForProgressBar:void 0===Re?qt?.item_count:Re,currentCartAmount:In(void 0!==Pe?Pe:qt?.items_subtotal_price,qt.currency),themeColor:ue,themeTextColor:me,primaryTextColor:ae,secondaryTextColor:ie,showMOVForProgressTiers:ye,progressBarFreeProductIconType:ot,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,prefixMessageText:Nt,suffixMessageText:Dt,successMessageText:_t,enableConfetti:Vt})),qt?.item_count>0&&t.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),0===qt?.items?.length&&0===qt?.item_count&&!1===Ut?.showSkeletonLoader?t.createElement(Uo,{showLoyaltyCta:ve,joinNowFunction:A,emptyCartTitle:m,emptyCartDescription:f,exploreCTAColor:d,isUserSignedIn:v,exploreCtaRedirectLink:G,themeColor:ue,emptyCartButtons:g,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,themeTextColor:me,recProductsList:M,addCartItem:b,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:_e,emptyProductRecsTitleText:se,backgroundSubdued:a,showEmptyCartRecommendations:Ft,tertiaryColor:i,tertiaryTextColor:s}):t.createElement("div",{style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},t.createElement(gi,{isDev:F,themeColor:ue,handleDecrement:y,handleIncrement:x,removeCartItem:h,addCartItem:b,primaryTextColor:ae,secondaryTextColor:ie,freeProduct:be,themeTextColor:me,showEditOptionOnProducts:Ne,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,showDeleteOnFreebies:Ge,freebieCouponTemplates:Qe??[],freebieFlowCheckpoints:Ye??[],cartCheckpoints:L,freeProductAdjustedCartTotal:we,imageAspectSelector:xt,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,giftWrapVariantId:rt?.variants?.nodes[0]?.id,giftWrapProductId:nt?.giftProductId,showGiftWrapAsLineItem:nt?.showGiftWrapAsLineItem,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:s,backgroundColor:r,showDiscountOnMRP:zt,checkoutSectionMessage:Et,checkoutSectionMessageRedirectLink:Wt,showFreebieMilestone:ct,freebieMilestoneData:pt}),rn&&de&&!!M&&M?.length>0&&qt?.item_count>0&&b&&t.createElement(_r,{addCartItem:b,products:M,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,productRecsTitleText:ce,themeColor:ue,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:_e,cardLayout:ft,variant:gt,cartComponentsCornerType:bt,cartComponentsCornerRadius:vt,backgroundSubdued:a,backgroundColor:r,tertiaryColor:i,tertiaryTextColor:s}),!rn&&pe&&!!M&&M?.length>0&&qt?.item_count>0&&b&&t.createElement(_r,{addCartItem:b,products:M,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,productRecsTitleText:ce,themeColor:ue,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:_e,cardLayout:ft,variant:gt,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:s})),t.createElement(la,null,qt?.item_count>0&&w&&k&&t.createElement(xi,{bundleProducts:k}),he&&!!xe&&qt?.item_count>0&&t.createElement(Ii,{companyName:fe,gstNumber:ge,themeColor:ue,iconColor:Ct?.iconColor,showIcon:Ct?.showIcon,backgroundColor:Ct?.backgroundColor,textColor:Ct?.textColor,title:Ct?.title}),!!qt&&qt?.item_count>0&&!!Fe&&!!Ae&&!!Me&&Ae.length>0&&t.createElement(Fl,{freebieProductsInCart:Ae,themeColor:ue,themeTextColor:me,primaryTextColor:ae,addFreebieToCart:Fe,freebiesInCart:Me,imageAspectSelector:xt,freebieCouponTemplates:Qe,freebieClaimData:Ze,cartCheckpoints:L,isCartDrawerOpen:e}),He&&(We?.length??0)>0&&!!Ue&&qt?.item_count>0&&t.createElement("div",{className:"form-group"},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>en(!Jt)},t.createElement("span",{style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",t.createElement(ht,null)),t.createElement("div",{className:"icon-transition"},Jt?t.createElement(st,null):t.createElement(dt,null))),"all-products"===Xe&&Jt?t.createElement(Kd,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:Nn}):Jt&&(Xt?t.createElement(Kd,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:Nn}):t.createElement(Jd,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,disabledDates:Nn}))),$e&&!!Te&&qt?.item_count>0&&t.createElement(Ni,{note:Se,noteSectionTitle:kt}),nt?.showGiftWrapOption&&qt?.item_count>0&&t.createElement(lp,{themeColor:ue,id:nt?.giftProductId,detail:rt,showPrice:nt?.showPrice,errorText:nt?.errorText,customText:nt?.customText,showGiftIcon:nt?.showGiftIcon,addCartItem:b,removeCartItem:h}),qt?.item_count>0&&jt&&!ve&&Lt&&t.createElement(Lp,{backgroundSubdued:a,themeColor:ue,themeTextColor:me,primaryTextColor:ae,cartComponentsCornerRadius:vt,applyCouponCode:Lt,removeDiscount:I,enableConfetti:Vt}),qt?.item_count>0&&C&&N&&!$t&&U&&D&&D?.length>0?t.createElement(t.Fragment,null,v||v&&J?t.createElement(Ia,{themeColor:ue,showGuestDiscountCoupon:q,guestRewardCoupon:H,ref:ln,discountAmountOff:E,userTotalPoints:_??0,applyDiscount:N,applyTemplateDiscount:U,rewardCoupons:D,isCouponSelectionOpen:Yt,setIsCouponSelectionOpen:Zt,pointsToBeUsed:S,joinNowFunction:A,guestLoyaltyPercentage:O,isUserSignedIn:v,showDiscountsListToGuestUsers:K}):!!O&&ve&&!!A&&t.createElement(aa,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:ke,guestLoyaltyPercentage:O,joinNowFunction:A,themeColor:ue,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:W})):qt?.item_count>0&&t.createElement(t.Fragment,null,v||!ve||$t?!$t&&qt?.item_count>0&&void 0!==E&&void 0!==S&&!!T&&ve&&!!N&&t.createElement(Ea,{themeColor:ue,applyDiscount:N,discountAmountOff:E,loyaltyIcon:T,pointsToBeUsed:S,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,minimumOrderValueToAvailDiscount:Ce,brandTokenName:Bt,showCartLevelAltPay:W,redemptionMultiplier:B}):qt?.item_count>0&&!!O&&!!A&&t.createElement(aa,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:ke,themeColor:ue,joinNowFunction:A,guestLoyaltyPercentage:O,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:W})),qt?.item_count>0&&!!$t&&!!I&&ve&&$t&&void 0!==S&&t.createElement(va,{themeColor:ue,removeDiscount:I,loyaltyDiscount:$t,isDev:F,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,pointsToBeUsed:S,brandTokenName:Bt,showCartLevelAltPay:W}),ve&&W&&j&&T&&qt?.item_count>0&&t.createElement(Fp,{loyaltyIcon:T,backgroundSubdued:a,primaryTextColor:ae,pointsRewardRate:V,rewardMultiplier:$}),ve&&qt&&qt.item_count>0&&!!Ce&&Ce>1&&t.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:ue??"#50D1AA",fontWeight:600,display:"flex",justifyContent:ke?"space-between":"center"}},"Minimum order value to use ",Bt,":"," ",Ce),qt&&P&&qt?.item_count>0&&t.createElement("div",null,t.createElement(ea,{disableCheckoutButton:!!Ot||Ut.cartLoading,discountApplied:z,checkoutFunction:P,checkoutButtonColor:ne,checkoutFontSize:p,discountInCheckoutButton:Z,isStickyCheckout:X,discountAmountApplied:Q,minimumCartValue:Y,themeTextColor:me,applyGSTToCart:xe,showGSTOption:he,applyNoteToCart:Te,showNoteOption:$e,enableGeoLocationDeliveryRestriction:He,applyPostalCodeAndDeliverySlotToCart:Ue,enableSlotPicker:Ke,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,checkoutSectionMessage:Et,checkoutSectionMessageDisplay:Tt,checkoutSectionMessageRedirectLink:Wt,showDiscountOnMRP:zt,tertiaryColor:i,tertiaryTextColor:s,cartCheckpoints:L,toggleDecimal:Pt,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:Rt,showCheckoutButtonPaymentIcons:Ht,primaryTextColor:ae}))))))},Hp=x.div`
|
|
2239
|
+
`,Wp=({isOpen:e,setIsOpen:n,backgroundColor:r="white",backgroundSubdued:a="#3947821F",tertiaryColor:i="#067D431A",tertiaryTextColor:s="#000000",exploreCTAColor:d,checkoutFontSize:p,cartTitle:u="My Cart",emptyCartTitle:m,emptyCartDescription:f,emptyCartButtons:g,removeCartItem:h,handleIncrement:x,handleDecrement:y,addCartItem:b,isUserSignedIn:v,showBundle:w,showCouponOptions:C,bundleProducts:k,discountAmountOff:E,loyaltyIcon:T,pointsToBeUsed:S,rewardMultiplier:$,redemptionMultiplier:B,discountApplied:z,removeDiscount:I,applyDiscount:N,rewardCoupons:D,userTotalPoints:_,checkoutFunction:P,joinNowFunction:A,guestLoyaltyPercentage:O,isDev:F,recProductsList:M,showMultiStepProgressBar:R,cartCheckpoints:L,redemptionRate:j,pointsRewardRate:V,showCartLevelAltPay:W,guestRewardCoupon:H,showGuestDiscountCoupon:q,applyTemplateDiscount:U,exploreCtaRedirectLink:G,discountAmountApplied:Q,minimumCartValue:Y,discountInCheckoutButton:Z,isStickyCheckout:X,showDiscountsListToGuestUsers:K,showApplyCouponsButtonToGuestUsers:J,handleCheckpointCrossed:ee,customCartProgressBarCriteria:te,checkoutButtonColor:ne="#252E69",ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,productRecsCtaButtonText:le,productRecsTitleText:ce,emptyProductRecsTitleText:se,showProductRecsOnDesktop:de,showProductRecsOnMobile:pe,themeColor:ue,themeTextColor:me,companyName:fe,gstNumber:ge,showGSTOption:he,applyGSTToCart:xe,showMOVForProgressTiers:ye,freeProduct:be,showLoyaltyCta:ve=!1,freeProductAdjustedCartTotal:we,minimumOrderValueToAvailDiscount:Ce,signinCTAButtonVisible:ke,cartSigninCTAMainText:Ee,applyNoteToCart:Te,note:Se,showNoteOption:$e,inlineCartOfferInfoText:Be,inlineCartOfferInfoRedirectLink:ze,cartOfferTermsAndConditionsText:Ie,showEditOptionOnProducts:Ne,onSetLoading:De,showVariantSelectionDropdownInProductRecs:_e,originalCartSubtotal:Pe,freebieProductsInCart:Ae,showFreebieClaim:Oe,addFreebieToCart:Fe,freebiesInCart:Me,effectiveQuantityForProgressBar:Re,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,postalCodeList:We,enableGeoLocationDeliveryRestriction:He=!1,getProductDetailsByVariantId:qe,applyPostalCodeAndDeliverySlotToCart:Ue,showDeleteOnFreebies:Ge,freebieCouponTemplates:Qe,freebieFlowCheckpoints:Ye,freebieClaimData:Ze,postalCodeBasedItemTrackingParameter:Xe,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,giftWrapSetupData:nt,giftWrapProductDetail:rt,progressBarFreeProductIconType:ot,enableCustomCartOnCartPage:at,isCartPage:it,showCartTimer:lt,showFreebieMilestone:ct,freebieMilestoneData:pt,cartTimerInMinutes:ut,cartTimerCustomText:mt,productRecsCardLayout:ft,productRecsCardListVariant:gt,imageAspectSelector:xt,cartComponentsCornerType:bt,cartComponentsCornerRadius:vt,cartOffersCarousalData:wt,gstSectionCustomizationData:Ct,noteSectionTitle:kt,checkoutSectionMessage:Et,checkoutSectionMessageDisplay:Tt,showVariantSelectionDropdownInProductClaim:St,loyaltyDiscount:$t,brandTokenName:Bt,showDiscountOnMRP:zt,switchWidthVariant:It,prefixMessageText:Nt,suffixMessageText:Dt,successMessageText:_t,toggleDecimal:Pt,cartOffersCarouselHeight:At,disableCheckoutButton:Ot,showEmptyCartRecommendations:Ft=!1,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:Rt,applyCouponCode:Lt,showApplyCoupon:jt,enableConfetti:Vt,checkoutSectionMessageRedirectLink:Wt,showCheckoutButtonPaymentIcons:Ht})=>{const qt=dn(mn),Ut=dn(Cn),[Gt,Qt]=c(!1),[Yt,Zt]=un(Tn),[Xt,Kt]=c(!1),[Jt,en]=c(!0),{setLoading:tn}=kn();t.useEffect(()=>{De&&De(tn)},[De]);const nn=o(!1),rn=o(null),on=o(null);l(()=>{const t=()=>{n(!1)};return e?(nn.current||(rn.current=window.history.state,on.current=window.location.href,window.history.pushState({ytCustomCartDrawer:"open"},"")),window.addEventListener("popstate",t),nn.current=!0):(nn.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.replaceState(rn.current,"",on.current??window.location.href),nn.current=!1),()=>{window.removeEventListener("popstate",t)}},[e,n]);const[an,ln]=c(!1);l(()=>{const t=document.querySelector("body");if(t)return at&&it?(t.classList.remove("drawer-open"),void t.classList.remove("drawer-closed")):void(an?(t.classList.remove("drawer-open"),t.classList.remove("drawer-closed")):e?(t.classList.add("drawer-open"),t.classList.remove("drawer-closed")):(t.classList.remove("drawer-open"),t.classList.add("drawer-closed")))},[e,at,it,an]),l(()=>{function e(){const e=window.innerWidth;ln(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const cn=qt?.items?.reduce((e,t)=>e+t?.quantity,0),sn=o(null);l(()=>{function e(e){sn.current&&!sn.current.contains(e.target)&&Zt(!1)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),l(()=>{const e=()=>{Qt(!0),window.setTimeout(()=>Qt(!1),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)},[]);const[pn,fn]=c("normal"),[gn,hn]=c("normal"),[xn,Sn]=c("auto");l(()=>{CSS.supports("font-weight","500")?fn("500"):CSS.supports("font-weight","400")?fn("400"):CSS.supports("font-weight","600")&&fn("600"),CSS.supports("font-weight","400")?hn("400"):CSS.supports("font-weight","300")?hn("300"):CSS.supports("font-weight","200")&&hn("200"),CSS.supports("width","-webkit-fill-available")?Sn("-webkit-fill-available"):CSS.supports("width","-moz-available")&&Sn("-moz-available")},[]),l(()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",pn),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",gn),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",xn)},[pn,gn]);const[$n]=un(yn);dn(bn);const[Bn]=un(wn),[zn]=un(vn);l(()=>{const e=qt?.items.some(e=>(je?.get(String(e.product_id))||[]).includes("Delhi-NCR"));Kt(e)},[qt?.items,je]);l(()=>{en(!("all-products"!==Xe&&("specific-tags"!==Xe||$n.isPostalCodeValid||Ke)&&("specific-tags"!==Xe||$n.isPostalCodeValid||Bn||!Ke)&&("specific-tags"===Xe&&"standard"===zn||Xt&&(Ke?$n.isPostalCodeValid&&Bn:$n.isPostalCodeValid))))},[$n.isPostalCodeValid,Bn,Xt,Xe,Ke]),un(En);const[Nn,Dn]=c(!0);l(()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&Dn(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&Dn(!1)},[]);const _n=new Date("2024-11-01");return In(qt?.items_subtotal_price,qt?.currency),t.createElement(jp,{className:"yt-cart-drawer",$isDev:F,$isOpen:e,$backgroundColor:r,$enableCustomCartOnCartPage:at,$isCartPage:it,$isLargeScreen:an,$switchWidthVariant:It},Ut.cartLoading?t.createElement("div",{style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},Ut.showLoader&&!Ut.showSkeletonLoader&&t.createElement("div",{className:"loader"},"")):t.createElement(t.Fragment,null),t.createElement(t.Fragment,null,Yt&&t.createElement("div",{style:{position:"fixed",inset:0,zIndex:40,backgroundColor:"rgba(128,128,128,0.7)"}},""),t.createElement("div",{className:"yt-cart-drawer-content",style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},t.createElement("div",{style:{}},t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",margin:"1rem 1rem 0px"}},t.createElement("span",{className:"yt-cart-title-container",style:{fontWeight:"var(--yt-cart-font-weight, bold)",color:ae,fontSize:"16px"}},t.createElement("span",{style:{whiteSpace:"nowrap",flexShrink:0}},u),qt?.item_count>0&&W&&!(ve&&W)&&V>0&&t.createElement(Rp,{pointsRewardRate:V,loyaltyIcon:T,brandTokenName:Bt,themeColor:ue,themeTextColor:me,rewardMultiplier:$}),cn>0&&t.createElement(Vp,{$backgroundSubdued:a},cn)),t.createElement("div",{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(at&&it)&&t.createElement("div",{className:"close-button",style:{backgroundColor:a||"#cacaca30"}},t.createElement(yt,{style:{height:"auto",width:"auto",color:ae},fontSize:24,cursor:"pointer",onClick:()=>{n(!e)}})))),Ut&&t.createElement(Ap,{$themeColor:ue,show:Ut.showLoader}),wt?.enableCartOffersCarousel&&t.createElement(Np,{themeColor:ue,cartOffersCarousalData:wt,cartOffersCarouselHeight:At,cartData:qt}),lt&&Nn&&qt?.item_count?t.createElement(dp,{minutes:ut,customText:mt,onTimerComplete:()=>{Dn(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,Gt&&Vt&&t.createElement(io,{particleCount:50,spread:90,origin:{y:.3}}),Be?t.createElement(Ml,{inlineCartOfferInfoText:Be,inlineCartOfferInfoRedirectLink:ze,themeColor:ue,tooltipText:Ie,themeTextColor:me}):null),R&&qt?.items_subtotal_price>0&&qt?.currency&&!!L&&function(e,t,n,r,o){if(!e||0===e.length)return!1;const a=[...e].sort((e,t)=>"minimum_order_value"===r?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold);return a.filter(e=>0!==e?.[Jr(r)]&&("minimum_order_value"!==r||1!==e?.[Jr(r)])).some((e,i)=>eo(e,i,a,o,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:r,checkpoints:a}).progressPercentage>0)}(L,In(void 0!==Pe?Pe:qt?.items_subtotal_price,qt.currency),void 0===Re?qt?.item_count:Re,te??"minimum_order_value",qt?.item_count)&&t.createElement(t.Fragment,null,t.createElement(Lo,{customCartProgressBarCriteria:te??"minimum_order_value",handleCheckpointCrossed:ee,checkpoints:L,effectiveQuantityForProgressBar:void 0===Re?qt?.item_count:Re,currentCartAmount:In(void 0!==Pe?Pe:qt?.items_subtotal_price,qt.currency),themeColor:ue,themeTextColor:me,primaryTextColor:ae,secondaryTextColor:ie,showMOVForProgressTiers:ye,progressBarFreeProductIconType:ot,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,prefixMessageText:Nt,suffixMessageText:Dt,successMessageText:_t,enableConfetti:Vt})),qt?.item_count>0&&t.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),0===qt?.items?.length&&0===qt?.item_count&&!1===Ut?.showSkeletonLoader?t.createElement(Uo,{showLoyaltyCta:ve,joinNowFunction:A,emptyCartTitle:m,emptyCartDescription:f,exploreCTAColor:d,isUserSignedIn:v,exploreCtaRedirectLink:G,themeColor:ue,emptyCartButtons:g,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,themeTextColor:me,recProductsList:M,addCartItem:b,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:_e,emptyProductRecsTitleText:se,backgroundSubdued:a,showEmptyCartRecommendations:Ft,tertiaryColor:i,tertiaryTextColor:s}):t.createElement("div",{style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},t.createElement(gi,{isDev:F,themeColor:ue,handleDecrement:y,handleIncrement:x,removeCartItem:h,addCartItem:b,primaryTextColor:ae,secondaryTextColor:ie,freeProduct:be,themeTextColor:me,showEditOptionOnProducts:Ne,productPercentageOffMapping:Le,productTagsMapping:je,removeFreebieFromCart:Ve,showDeleteOnFreebies:Ge,freebieCouponTemplates:Qe??[],freebieFlowCheckpoints:Ye??[],cartCheckpoints:L,freeProductAdjustedCartTotal:we,imageAspectSelector:xt,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,giftWrapVariantId:rt?.variants?.nodes[0]?.id,giftWrapProductId:nt?.giftProductId,showGiftWrapAsLineItem:nt?.showGiftWrapAsLineItem,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:s,backgroundColor:r,showDiscountOnMRP:zt,checkoutSectionMessage:Et,checkoutSectionMessageRedirectLink:Wt,showFreebieMilestone:ct,freebieMilestoneData:pt}),an&&de&&!!M&&M?.length>0&&qt?.item_count>0&&b&&t.createElement(_r,{addCartItem:b,products:M,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,productRecsTitleText:ce,themeColor:ue,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:_e,cardLayout:ft,variant:gt,cartComponentsCornerType:bt,cartComponentsCornerRadius:vt,backgroundSubdued:a,backgroundColor:r,tertiaryColor:i,tertiaryTextColor:s}),!an&&pe&&!!M&&M?.length>0&&qt?.item_count>0&&b&&t.createElement(_r,{addCartItem:b,products:M,productRecsCtaButtonText:le,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,productRecsTitleText:ce,themeColor:ue,primaryTextColor:ae,secondaryTextColor:ie,showVariantSelectionDropdownInProductRecs:_e,cardLayout:ft,variant:gt,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:s})),t.createElement(la,null,qt?.item_count>0&&w&&k&&t.createElement(xi,{bundleProducts:k}),he&&!!xe&&qt?.item_count>0&&t.createElement(Ii,{companyName:fe,gstNumber:ge,themeColor:ue,iconColor:Ct?.iconColor,showIcon:Ct?.showIcon,backgroundColor:Ct?.backgroundColor,textColor:Ct?.textColor,title:Ct?.title}),!!qt&&qt?.item_count>0&&!!Fe&&!!Ae&&!!Me&&Ae.length>0&&t.createElement(Fl,{freebieProductsInCart:Ae,themeColor:ue,themeTextColor:me,primaryTextColor:ae,addFreebieToCart:Fe,freebiesInCart:Me,imageAspectSelector:xt,freebieCouponTemplates:Qe,freebieClaimData:Ze,cartCheckpoints:L,isCartDrawerOpen:e}),He&&(We?.length??0)>0&&!!Ue&&qt?.item_count>0&&t.createElement("div",{className:"form-group"},t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>en(!Jt)},t.createElement("span",{style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",t.createElement(ht,null)),t.createElement("div",{className:"icon-transition"},Jt?t.createElement(st,null):t.createElement(dt,null))),"all-products"===Xe&&Jt?t.createElement(Kd,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:_n}):Jt&&(Xt?t.createElement(Kd,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,deliveryHeaderTitle:Je,deliveryAvailableText:et,deliveryNotAvailableText:tt,disabledDates:_n}):t.createElement(Jd,{postalCodeList:We,themeColor:ue,themeTextColor:me,enableSlotPicker:Ke,disabledDates:_n}))),$e&&!!Te&&qt?.item_count>0&&t.createElement(Ni,{note:Se,noteSectionTitle:kt}),nt?.showGiftWrapOption&&qt?.item_count>0&&t.createElement(lp,{themeColor:ue,id:nt?.giftProductId,detail:rt,showPrice:nt?.showPrice,errorText:nt?.errorText,customText:nt?.customText,showGiftIcon:nt?.showGiftIcon,addCartItem:b,removeCartItem:h}),qt?.item_count>0&&jt&&!ve&&Lt&&t.createElement(Lp,{backgroundSubdued:a,themeColor:ue,themeTextColor:me,primaryTextColor:ae,cartComponentsCornerRadius:vt,applyCouponCode:Lt,removeDiscount:I,enableConfetti:Vt}),qt?.item_count>0&&C&&N&&!$t&&U&&D&&D?.length>0?t.createElement(t.Fragment,null,v||v&&J?t.createElement(Ia,{themeColor:ue,showGuestDiscountCoupon:q,guestRewardCoupon:H,ref:sn,discountAmountOff:E,userTotalPoints:_??0,applyDiscount:N,applyTemplateDiscount:U,rewardCoupons:D,isCouponSelectionOpen:Yt,setIsCouponSelectionOpen:Zt,pointsToBeUsed:S,joinNowFunction:A,guestLoyaltyPercentage:O,isUserSignedIn:v,showDiscountsListToGuestUsers:K}):!!O&&ve&&!!A&&t.createElement(aa,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:ke,guestLoyaltyPercentage:O,joinNowFunction:A,themeColor:ue,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:W})):qt?.item_count>0&&t.createElement(t.Fragment,null,v||!ve||$t?!$t&&qt?.item_count>0&&void 0!==E&&void 0!==S&&!!T&&ve&&!!N&&t.createElement(Ea,{themeColor:ue,applyDiscount:N,discountAmountOff:E,loyaltyIcon:T,pointsToBeUsed:S,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,minimumOrderValueToAvailDiscount:Ce,brandTokenName:Bt,showCartLevelAltPay:W,redemptionMultiplier:B}):qt?.item_count>0&&!!O&&!!A&&t.createElement(aa,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:ke,themeColor:ue,joinNowFunction:A,guestLoyaltyPercentage:O,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,showCartLevelAltPay:W})),qt?.item_count>0&&!!$t&&!!I&&ve&&$t&&void 0!==S&&t.createElement(va,{themeColor:ue,removeDiscount:I,loyaltyDiscount:$t,isDev:F,ctaButtonBackgroundColor:re,ctaButtonTextColor:oe,primaryTextColor:ae,secondaryTextColor:ie,pointsToBeUsed:S,brandTokenName:Bt,showCartLevelAltPay:W}),ve&&W&&j&&T&&qt?.item_count>0&&t.createElement(Fp,{loyaltyIcon:T,backgroundSubdued:a,primaryTextColor:ae,pointsRewardRate:V,rewardMultiplier:$}),ve&&qt&&qt.item_count>0&&!!Ce&&Ce>1&&t.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:ue??"#50D1AA",fontWeight:600,display:"flex",justifyContent:ke?"space-between":"center"}},"Minimum order value to use ",Bt,":"," ",Ce),qt&&P&&qt?.item_count>0&&t.createElement("div",null,t.createElement(ea,{disableCheckoutButton:!!Ot||Ut.cartLoading,discountApplied:z,checkoutFunction:P,checkoutButtonColor:ne,checkoutFontSize:p,discountInCheckoutButton:Z,isStickyCheckout:X,discountAmountApplied:Q,minimumCartValue:Y,themeTextColor:me,applyGSTToCart:xe,showGSTOption:he,applyNoteToCart:Te,showNoteOption:$e,enableGeoLocationDeliveryRestriction:He,applyPostalCodeAndDeliverySlotToCart:Ue,enableSlotPicker:Ke,cartComponentsCornerRadius:vt,cartComponentsCornerType:bt,checkoutSectionMessage:Et,checkoutSectionMessageDisplay:Tt,checkoutSectionMessageRedirectLink:Wt,showDiscountOnMRP:zt,tertiaryColor:i,tertiaryTextColor:s,cartCheckpoints:L,toggleDecimal:Pt,checkoutButtonBottomSpacing:Mt,showPoweredByBadge:Rt,showCheckoutButtonPaymentIcons:Ht,primaryTextColor:ae}))))))},Hp=x.div`
|
|
2240
2240
|
position: relative;
|
|
2241
2241
|
`,qp=x.button`
|
|
2242
2242
|
border: 1px solid #ccc;
|
|
@@ -2869,7 +2869,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
2869
2869
|
&:hover {
|
|
2870
2870
|
border-color: ${({$themeColor:e})=>e||"#000"};
|
|
2871
2871
|
}
|
|
2872
|
-
`,Nu=n(({removeCartItem:e,addCartItem:n,getProductDetailsByVariantId:r,themeColor:a,cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,productClaimCtaButtonText:f,backgroundSubdued:g,primaryTextColor:h},x)=>{const[y,b]=un(En),v=dn(mn),w=o(null),[C,k]=c(null),[E,T]=c(!1),[S,$]=c({}),[B,z]=c(y?.variantId),[I,N]=c(y?.quantity||1),[D,_]=c(!1),P=Ma();l(()=>{y?.open?setTimeout(()=>{_(!0)},10):_(!1)},[y?.open]);l(()=>{(async()=>{if(!C&&r&&y?.variantId&&y?.handle){const e=await r(y.handle,y.variantId);if(e&&e.variants&&e.options){let t;const n=y.allowedVariantIds,r=Array.isArray(n)&&n.length>0;if(t=r?e.variants.find(e=>e.available&&n.includes(String(e.id))&&String(e.id)===String(y.variantId))||e.variants.find(e=>e.available&&n.includes(String(e.id))):e.variants.find(e=>e.available&&String(e.id)===String(y.variantId)),t){z(String(t.id));const n={};e.options.forEach((e,r)=>{n[e.name]=t[`option${r+1}`]}),$(n)}else z(void 0),$({})}k(e)}})()},[C,r,y]);const A=(e,t)=>{const n={...S,[e]:t};$(n);const r=C?.variants?.find(e=>C.options.every((t,r)=>e[`option${r+1}`]===n[t.name]));if(r){const e=y?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(r.id)))return;r.available&&z(String(r.id))}},O=C?.variants?.find(e=>String(e.id)===String(B)),F=Dn(v,v?.currency),M=i(()=>{const e={};if(!C)return e;const t=Array.isArray(y?.allowedVariantIds)&&y.allowedVariantIds.length>0;return C.options.forEach(n=>{e[n.name]=n.values.filter(e=>C.variants.filter(r=>{const o=C.options.indexOf(n);if(r[`option${o+1}`]!==e)return!1;return!!C.options.every((e,t)=>{if(e.name===n.name)return!0;const o=S[e.name];return!o||r[`option${t+1}`]===o})&&(!!(!t||Array.isArray(y.allowedVariantIds)&&y.allowedVariantIds.includes(String(r.id)))&&!!r.available)}).some(e=>!!(!t||Array.isArray(y.allowedVariantIds)&&y.allowedVariantIds.includes(String(e.id)))&&e.available))}),e},[C,S,y]);return C?t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:y?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:D?1:0,transition:"opacity 0.3s ease"},onClick:()=>{_(!1),setTimeout(()=>{b({open:!1,variantId:void 0,handle:void 0,quantity:void 0})},300)}}),t.createElement(su,{ref:x,className:"yt-variant-selection-popup"},t.createElement(pu,{ref:w,style:{backgroundColor:p||"white",opacity:D?1:0,transform:D?"translateY(0)":"translateY(20px)"},$themeColor:a,onClick:e=>e.stopPropagation()},y?.freebieSelection&&t.createElement(du,null,"Unlocked Freebie"),t.createElement(mu,null,t.createElement(fu,null,t.createElement(gu,null,t.createElement(hu,{src:O?.featured_image?.src??C?.featured_image,alt:O?.featured_image?.alt??C?.title})),t.createElement(xu,null,t.createElement(yu,{$themeColor:a,$primaryTextColor:h,href:`${C?.url}?variant=${O?.id}`},C?.title),t.createElement(Bu,null,t.createElement(bu,null,t.createElement(vu,{$primaryTextColor:h},F,In(O?.price,v?.currency??"INR")),null!=O?.compare_at_price&&null!=O?.price&&O.compare_at_price>O.price&&t.createElement(wu,null,F,In(O?.compare_at_price,v?.currency??"INR"))),!y?.freebieSelection&&t.createElement(Na,{value:I,handleItemQuantityIncrement:async()=>{N(e=>e+1)},handleItemQuantityDecrement:async()=>{I>1&&N(e=>e-1)},cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundSubdued:g})))),C?.options?.map(e=>{const n=P?.options?.find(t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase());return t.createElement(ku,{key:e.name},t.createElement(Tu,null,t.createElement("span",null,"Select ",e.name),S[e.name]&&t.createElement(Su,null,S[e.name])),t.createElement($u,null,M[e.name]?.map(r=>{const o=S[e.name]===r,i=Fa(n,r);return"color"===n?.type&&i?.value?t.createElement(zu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>A(e.name,r),$colorValue:i.value}):"image"===n?.type&&i?.value?t.createElement(Iu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>A(e.name,r),$imageUrl:i.value}):t.createElement(Eu,{$themeColor:a,key:r,$isSelected:o,backgroundColor:o?a:void 0,onClick:()=>A(e.name,r)},r)})))})),t.createElement(Cu,{className:"yt-cart-variant-popup-ATC-button",$themeColor:a??"#C33",onClick:y?.productRec?async()=>{if(B&&n){T(!0);try{await n(B,I,"product-recommendation-variant-selector",!1,y.handle),b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}T(!1)}}:async()=>{if(!B)return;const t=!!y?.lineItemKey,r=String(B)!==String(y?.variantId);if(!t||r){T(!0);try{const t=y?.freebieSelection;t&&u&&y?.lineItemKey?await u(y.lineItemKey):await e(y?.lineItemKey||y?.variantId,"variant-selector",!0),t&&m?await m(B,y.allowedVariantIds):n&&B&&await n(B,I,"variant-selector",!1,y.handle),b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}T(!1)}else b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!B||E},E?t.createElement(fa,{color:"white",size:13}):y?.productRec?"ADD TO BAG":y?.freebieSelection?f||"CLAIM FREEBIE":"GET IN BAG")))):t.createElement(su,{ref:x},t.createElement(pu,{style:{backgroundColor:p||"white"}},t.createElement(uu,null,t.createElement(ya,{color:a||"#868E96"}))))});Nu.displayName="DesktopVariantPopup";const Du=n(({removeCartItem:e,addCartItem:n,getProductDetailsByVariantId:r,themeColor:a,cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,productClaimCtaButtonText:f,backgroundSubdued:g,primaryTextColor:h},x)=>{const[y,b]=un(En),v=dn(mn),[w,C]=c(null),[k,E]=c(!1),[T,S]=c({}),[$,B]=c(y?.variantId),[z,I]=c(y?.quantity||1),N=o(null),D=Ma(),[_,P]=c(!1);l(()=>{y?.open?setTimeout(()=>{P(!0)},10):P(!1)},[y?.open]);l(()=>{(async()=>{if(!w&&r&&y?.variantId&&y?.handle)try{const e=await r(y.handle,y.variantId);if(!e)return;if(!e.variants||!Array.isArray(e.variants))return;if(e&&e.variants&&e.options){let t;const n=y.allowedVariantIds,r=Array.isArray(n)&&n.length>0;if(t=r?e.variants.find(e=>e.available&&n.includes(String(e.id))&&String(e.id)===String(y.variantId))||e.variants.find(e=>e.available&&n.includes(String(e.id))):e.variants.find(e=>e.available&&String(e.id)===String(y.variantId)),t){B(String(t.id));const n={};e.options.forEach((e,r)=>{n[e.name]=t[`option${r+1}`]}),S(n)}else B(void 0),S({})}C(e)}catch(e){}})()},[w,r,y]),l(()=>{},[p,e,n,r]);const A=(e,t)=>{const n={...T,[e]:t};S(n);const r=w?.variants?.find(e=>w.options.every((t,r)=>e[`option${r+1}`]===n[t.name]));if(r){const e=y?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(r.id)))return;r.available&&B(String(r.id))}},O=w?.variants?.find(e=>String(e.id)===String($)),F=Dn(v,v?.currency),M=i(()=>{const e={};if(!w)return e;const t=Array.isArray(y?.allowedVariantIds)&&y.allowedVariantIds.length>0;return w.options.forEach(n=>{e[n.name]=n.values.filter(e=>w.variants.filter(r=>{const o=w.options.indexOf(n);if(r[`option${o+1}`]!==e)return!1;return!!w.options.every((e,t)=>{if(e.name===n.name)return!0;const o=T[e.name];return!o||r[`option${t+1}`]===o})&&(!!(!t||Array.isArray(y.allowedVariantIds)&&y.allowedVariantIds.includes(String(r.id)))&&!!r.available)}).some(e=>!!(!t||Array.isArray(y.allowedVariantIds)&&y.allowedVariantIds.includes(String(e.id)))&&e.available))}),e},[w,T,y]);return w?t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:y?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:_?1:0,transition:"opacity 0.3s ease"},onClick:()=>{P(!1),setTimeout(()=>{b({open:!1,variantId:void 0,handle:void 0,quantity:void 0})},300)}}),t.createElement(su,{ref:x,className:"yt-variant-selection-popup"},t.createElement(pu,{ref:N,style:{backgroundColor:p||"white",opacity:_?1:0,transform:_?"translateY(0)":"translateY(20px)"},$themeColor:a,onClick:e=>e.stopPropagation()},y?.freebieSelection&&t.createElement(du,null,"Unlocked Freebie"),t.createElement(mu,null,t.createElement(fu,null,t.createElement(gu,null,t.createElement(hu,{src:O?.featured_image?.src??w?.featured_image,alt:O?.featured_image?.alt??w?.title})),t.createElement(xu,null,t.createElement(yu,{$themeColor:a,$primaryTextColor:h,href:`${w?.url}?variant=${O?.id}`},w?.title),t.createElement(Bu,null,t.createElement(bu,null,t.createElement(vu,{$primaryTextColor:h},F,In(O?.price,v?.currency??"INR")),null!=O?.compare_at_price&&null!=O?.price&&O.compare_at_price>O.price&&t.createElement(wu,null,F,In(O?.compare_at_price,v?.currency??"INR"))),!y?.freebieSelection&&t.createElement(Na,{value:z,handleItemQuantityIncrement:async()=>{I(e=>e+1)},handleItemQuantityDecrement:async()=>{z>1&&I(e=>e-1)},cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundSubdued:g})))),w?.options?.map(e=>{const n=D?.options?.find(t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase());return t.createElement(ku,{key:e.name},t.createElement(Tu,null,t.createElement("span",null,"Select ",e.name,":"),T[e.name]&&t.createElement(Su,null,T[e.name])),t.createElement($u,null,M[e.name]?.map(r=>{const o=T[e.name]===r,i=Fa(n,r);return"color"===n?.type&&i?.value?t.createElement(zu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>A(e.name,r),$colorValue:i.value}):"image"===n?.type&&i?.value?t.createElement(Iu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>A(e.name,r),$imageUrl:i.value}):t.createElement(Eu,{$themeColor:a,key:r,$isSelected:o,backgroundColor:o?a:void 0,onClick:()=>A(e.name,r)},r)})))})),t.createElement(Cu,{className:"yt-cart-variant-popup-ATC-button",$themeColor:a??"#C33",onClick:y?.productRec?async()=>{if($&&n){E(!0);try{await n($,z,"product-recommendation-variant-selector",!1,y.handle),b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}E(!1)}}:async()=>{if(!$)return;const t=!!y?.lineItemKey,r=String($)!==String(y?.variantId);if(!t||r){E(!0);try{const t=y?.freebieSelection;t&&u&&y?.lineItemKey?await u(y.lineItemKey):await e(y?.lineItemKey||y?.variantId,"variant-selector",!0),t&&m?await m($,y.allowedVariantIds):n&&$&&await n($,z,"variant-selector",!1,y.handle),b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}E(!1)}else b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!$||k},k?t.createElement(fa,{color:"white",size:13}):y?.productRec?"ADD TO BAG":y?.freebieSelection?f||"CLAIM FREEBIE":"GET IN BAG")))):t.createElement(su,{ref:x},t.createElement(pu,{style:{backgroundColor:p||"white"}},t.createElement(uu,null,t.createElement(ya,{color:a||"#868E96"}))))});const _u=({setIsCartOpen:e,isCartOpen:n,cartCheckpoints:r,customCartProgressBarCriteria:o,floatingCartData:a,effectiveQuantityForProgressBar:i,cartComponentsCornerType:l,cartComponentsCornerRadius:c})=>{const s=dn(mn),d=a?.bannerFooterText,p="string"==typeof d&&d.trim().length>0,u=!n&&(e=>{try{if("undefined"==typeof window)return!1;const t=window.location.pathname||"/";if("/"===t||""===t)return!0;const n=e?.showOnPages;if(!Array.isArray(n)||0===n.length)return!1;const r=t.toLowerCase(),o=r.endsWith("/")?r:`${r}/`;return n.some(e=>{if(!e||"string"!=typeof e)return!1;const t=e.trim().toLowerCase().replace(/^\/|\/$/g,"");if(!t)return!1;const n=`/${t}/`;return o.includes(n)})}catch{return!1}})(a),m=s?.item_count??0,f=In(s?.items_subtotal_price??0,s?.currency??"INR"),g=Dn(s),h=function(e,t,n,r,o){if(!e||0===e.length)return{deltaValue:0,show:!1};const a=(t??"minimum_order_value").toLowerCase(),i="quantity_threshold"===a?"number"==typeof o?o:r:n,l=[...e].sort((e,t)=>("quantity_threshold"===a?e.quantityThreshold:e.minimumOrderValue)-("quantity_threshold"===a?t.quantityThreshold:t.minimumOrderValue)).find(e=>("quantity_threshold"===a?e.quantityThreshold:e.minimumOrderValue)>i);if(!l)return{deltaValue:0,show:!1};const c="quantity_threshold"===a?l.quantityThreshold:l.minimumOrderValue,s=Math.max(0,c-i);return{deltaValue:s,show:s>0,isQuantity:"quantity_threshold"===a}}(r,o,f,m,i),x="sharp"===l?0:c??12,y=a?.textColor??"#111",b=a?.backgroundColor??"#FF7E6E",v=a?.bannerBackgroundColor??"#FFE0DC",w=a?.buttonColor??"#E8513F",C=t.useRef(null);t.useEffect(()=>{jn(C.current)},[w]);const k={position:"fixed",width:"100%",bottom:0,zIndex:2147483642,paddingBottom:"env(safe-area-inset-bottom)"},E={background:"#FFFFFF",color:y,padding:"5px",fontSize:12,fontFamily:"Poppins",fontWeight:600,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",gap:8},T={background:"#fff",color:y,borderRadius:x,boxShadow:"0 10px 24px rgba(0,0,0,0.15)",overflow:"hidden",fontFamily:"Poppins"},S={position:"absolute",top:0,left:"50%",transform:"translate(-50%, -70%)",backgroundColor:v,color:y,padding:8,fontSize:12,lineHeight:"normal",borderTopLeftRadius:13,borderTopRightRadius:13,width:"97%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,zIndex:-1},$={display:"flex",alignItems:"center",gap:12,padding:"10px 12px",backgroundColor:b},B={display:"flex",alignItems:"center",gap:8,fontWeight:700,fontSize:16,color:y},z={fontSize:12,color:y,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},I={padding:"5px 10px",background:w,color:"#fff",borderRadius:8,fontSize:15,fontWeight:700,border:"none",outline:"none",flexShrink:0};if(!u)return null;if(0===m){if(!h.show)return null;const e=h.isQuantity?`${h.deltaValue} more items to get freebie`:`Add items worth ${g}${Vn(h.deltaValue.toFixed(0))} to get freebie`;return t.createElement("div",{style:k},t.createElement("div",{style:E},t.createElement(W,{"aria-hidden":!0}),t.createElement("span",null,e)))}const N=1===m?"1 item":`${m} items`,D=h.show?h.isQuantity?`${h.deltaValue} more items to get freebie`:`Add items worth ${g}${Vn(h.deltaValue.toFixed(0))} more to get freebie`:"";return t.createElement("div",{style:{position:"fixed",left:12,right:12,bottom:12,zIndex:2147483642,paddingBottom:"env(safe-area-inset-bottom)"}},t.createElement("div",{style:{position:"relative"}},h.show&&t.createElement("div",{style:S},t.createElement(W,{"aria-hidden":!0,style:{marginBottom:7}}),t.createElement("span",{style:{display:"inline-block",marginBottom:7}},D)),t.createElement("div",{style:T},t.createElement("div",{style:$},t.createElement(mt,{width:24,height:24,color:y}),t.createElement("div",{style:{display:"flex",flexDirection:"column",minWidth:0,flex:1,lineHeight:"normal"}},t.createElement("div",{style:B},t.createElement("span",null,g,Vn(f.toFixed(0))),t.createElement("span",{style:{fontSize:9,fontWeight:600,color:"#fff",backgroundColor:"#828282",marginBottom:5,paddingInline:5}},N)),p?t.createElement("span",{style:z,title:d},d):null),t.createElement("button",{ref:C,style:I,onClick:()=>e(!0),"aria-label":"View Cart"},"View Cart")))))},Pu=({exploreCTAColor:e,checkoutFontSize:n,handleDecrement:r,handleIncrement:a,removeCartItem:i,addCartItem:s,cartTitle:d,emptyCartTitle:p,emptyCartDescription:u,emptyCartButtons:f,backgroundColor:g,backgroundSubdued:h,tertiaryColor:x,tertiaryTextColor:y,backdrop:b=!0,cartData:v,isUserSignedIn:w,showBundle:C,showCouponOptions:k,bundleProducts:E,discountAmountOff:T,loyaltyIcon:S,pointsToBeUsed:$,rewardMultiplier:B,redemptionMultiplier:z,removeDiscount:I,applyDiscount:N,discountApplied:D,rewardCoupons:_,userTotalPoints:P,checkoutFunction:A,joinNowFunction:O,guestLoyaltyPercentage:F,showToggleButton:M,isOpen:R,setIsOpen:L,isDev:j,switchWidthVariant:V,recProductsList:W,showMultiStepProgressBar:H,cartCheckpoints:q,redemptionRate:U,pointsRewardRate:G,showCartLevelAltPay:Q,guestRewardCoupon:Y,showGuestDiscountCoupon:Z,applyTemplateDiscount:X,exploreCtaRedirectLink:K,discountAmountApplied:J,minimumCartValue:ee,discountInCheckoutButton:te,isStickyCheckout:ne,showDiscountsListToGuestUsers:re,showApplyCouponsButtonToGuestUsers:oe,handleCheckpointCrossed:ae,customCartProgressBarCriteria:ie,checkoutButtonColor:le,ctaButtonBackgroundColor:ce,ctaButtonTextColor:se,primaryTextColor:de,productRecsCtaButtonText:pe,productRecsTitleText:ue,secondaryTextColor:me,showProductRecsOnDesktop:fe,showProductRecsOnMobile:ge,themeColor:he,themeTextColor:xe,companyName:ye,gstNumber:be,showGSTOption:ve,applyGSTToCart:we,showMOVForProgressTiers:Ce,freeProduct:ke,showLoyaltyCta:Ee,freeProductAdjustedCartTotal:Te,minimumOrderValueToAvailDiscount:Se,signinCTAButtonVisible:$e,cartSigninCTAMainText:Be,showNoteOption:ze,applyNoteToCart:Ie,note:Ne,inlineCartOfferInfoText:De,inlineCartOfferInfoRedirectLink:_e,cartOfferTermsAndConditionsText:Pe,showEditOptionOnProducts:Ae,getProductDetailsByVariantId:Oe,onSetLoading:Fe,showVariantSelectionDropdownInProductRecs:Me,originalCartSubtotal:Re,currentTier:Le,freebieProductsInCart:je,showFreebieClaim:Ve,addFreebieToCart:We,freebiesInCart:He,effectiveQuantityForProgressBar:qe,productPercentageOffMapping:Ue,productTagsMapping:Ge,removeFreebieFromCart:Qe,postalCodeList:Ye,enableGeoLocationDeliveryRestriction:Ze,applyPostalCodeAndDeliverySlotToCart:Xe,showDeleteOnFreebies:Ke,freebieCouponTemplates:Je,freebieFlowCheckpoints:et,freebieClaimData:tt,showStickyAddToCart:nt,stickyCartLineItem:rt,postalCodeBasedItemTrackingParameter:ot,enableSlotPicker:at,deliveryHeaderTitle:it,deliveryAvailableText:lt,deliveryNotAvailableText:ct,giftWrapSetupData:st,giftWrapProductDetail:dt,enableCustomCartOnCartPage:pt,isCartPage:ut,progressBarFreeProductIconType:mt,addToStickyCart:ft,productRecsCardLayout:gt,productRecsCardListVariant:ht,showCartTimer:xt,showFreebieMilestone:yt,showFloatingCart:bt,floatingCartData:vt,freebieMilestoneData:wt,cartTimerInMinutes:Ct,cartTimerCustomText:kt,imageAspectSelector:Et,cartComponentsCornerType:Tt,cartComponentsCornerRadius:St,stickyCartCustomizationData:$t,cartOffersCarousalData:Bt,stickyBarBuyNowFunction:zt,gstSectionCustomizationData:It,noteSectionTitle:Nt,checkoutSectionMessage:Dt,checkoutSectionMessageRedirectLink:_t,checkoutSectionMessageDisplay:Pt,showVariantSelectionDropdownInProductClaim:At,loyaltyDiscount:Ot,brandTokenName:Ft,showDiscountOnMRP:Mt,prefixMessageText:Rt,suffixMessageText:Lt,successMessageText:jt,toggleDecimal:Vt,cartOffersCarouselHeight:Wt,disableCheckoutButton:Ht,showEmptyCartRecommendations:qt,emptyProductRecsTitleText:Ut,checkoutButtonBottomSpacing:Gt,showPoweredByBadge:Qt=!0,applyCouponCode:Yt,showApplyCoupon:Zt,enableConfetti:Xt,showCheckoutButtonPaymentIcons:Kt=!0,comboBundleData:Jt,comboBundleAddToCartFunction:en})=>{const tn=pn(mn),[nn,rn]=un(En),[on,an]=un(Cl),ln=()=>L(!R),[cn,sn]=c(()=>{const e=window.ytComboBundle;return{comboBundleData:e?.bundle??null,comboBundleAddToCartFunction:e?.addToCart??null}});l(()=>{const e=e=>{const t=e.detail;sn({comboBundleData:t?.bundle??null,comboBundleAddToCartFunction:t?.addToCart??null})};return window.addEventListener("yt-combo-bundle-updated",e),()=>window.removeEventListener("yt-combo-bundle-updated",e)},[]);const dn=cn.comboBundleData??Jt,fn=cn.comboBundleAddToCartFunction??en;m(()=>{v&&tn(v)},[v]);const gn=o(null);l(()=>{function e(e){gn.current&&!gn.current.contains(e.target)&&(rn({open:!1,variantId:void 0,quantity:void 0,handle:void 0}),an({isOpen:!1}))}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const[hn,xn]=c(!1);return l(()=>{const e=()=>{xn(window.innerWidth>=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),t.createElement(t.Fragment,null,t.createElement("div",{style:{position:pt&&ut?"relative":"absolute",width:"100%",display:pt&&ut?"flex":"block",alignItems:"center",justifyContent:"center"}},M&&!(pt&&ut)&&t.createElement("button",{style:{margin:"16px"},onClick:ln},R?"Close Drawer":"Open Drawer"),R&&b&&!(pt&&ut)&&t.createElement("div",{onClick:ln,id:"custom-cart-yt-overlay",style:{position:"fixed",top:0,right:0,zIndex:1e4,transform:"translateX(0)",backgroundColor:"rgba(0,0,0,0.5)",inset:0,height:"100%",width:"100%"}},""),t.createElement(Wp,{isCartPage:ut,enableCustomCartOnCartPage:pt,isOpen:R,setIsOpen:L,backgroundColor:g,backgroundSubdued:h??"#F5F5F5",tertiaryColor:x,tertiaryTextColor:y,exploreCTAColor:e,checkoutFontSize:n,cartTitle:d,handleDecrement:r,handleIncrement:a,removeCartItem:i,addCartItem:s,emptyCartTitle:p,emptyCartButtons:f,emptyCartDescription:u,showCouponOptions:k,showBundle:C,isUserSignedIn:w,bundleProducts:E,discountAmountOff:T,loyaltyIcon:S,pointsToBeUsed:$,rewardMultiplier:B,redemptionMultiplier:z,removeDiscount:I,applyDiscount:N,discountApplied:D,rewardCoupons:_,userTotalPoints:P,checkoutFunction:A,joinNowFunction:O,guestLoyaltyPercentage:F,isDev:j,switchWidthVariant:V,recProductsList:W,showMultiStepProgressBar:H,cartCheckpoints:q,redemptionRate:U,pointsRewardRate:G,showCartLevelAltPay:Q,guestRewardCoupon:Y,showGuestDiscountCoupon:Z,applyTemplateDiscount:X,exploreCtaRedirectLink:K,discountAmountApplied:J,minimumCartValue:ee,discountInCheckoutButton:te,isStickyCheckout:ne,showDiscountsListToGuestUsers:re,showApplyCouponsButtonToGuestUsers:oe,handleCheckpointCrossed:ae,customCartProgressBarCriteria:ie??"minimum_order_value",checkoutButtonColor:le,ctaButtonBackgroundColor:ce,ctaButtonTextColor:se,primaryTextColor:de,productRecsCtaButtonText:pe,productRecsTitleText:ue,secondaryTextColor:me,showProductRecsOnDesktop:fe,showProductRecsOnMobile:ge,themeColor:he,themeTextColor:xe,companyName:ye,gstNumber:be,showGSTOption:ve,applyGSTToCart:we,showMOVForProgressTiers:Ce,freeProduct:ke,showLoyaltyCta:Ee,freeProductAdjustedCartTotal:Te,minimumOrderValueToAvailDiscount:Se,signinCTAButtonVisible:$e,cartSigninCTAMainText:Be,applyNoteToCart:Ie,note:Ne,showNoteOption:ze,inlineCartOfferInfoText:De,inlineCartOfferInfoRedirectLink:_e,cartOfferTermsAndConditionsText:Pe,showEditOptionOnProducts:Ae,onSetLoading:Fe,showVariantSelectionDropdownInProductRecs:Me,originalCartSubtotal:Re,currentTier:Le,freebieProductsInCart:je,cartOffersCarousalData:Bt,showFreebieClaim:Ve,addFreebieToCart:We,freebiesInCart:He,effectiveQuantityForProgressBar:qe,productPercentageOffMapping:Ue,productTagsMapping:Ge,removeFreebieFromCart:Qe,postalCodeList:Ye,enableGeoLocationDeliveryRestriction:Ze,applyPostalCodeAndDeliverySlotToCart:Xe,showDeleteOnFreebies:Ke,freebieCouponTemplates:Je,freebieFlowCheckpoints:et,freebieClaimData:tt,postalCodeBasedItemTrackingParameter:ot,enableSlotPicker:at,deliveryHeaderTitle:it,deliveryAvailableText:lt,deliveryNotAvailableText:ct,giftWrapSetupData:st,giftWrapProductDetail:dt,progressBarFreeProductIconType:mt,productRecsCardLayout:gt,productRecsCardListVariant:ht,showCartTimer:xt,showFreebieMilestone:yt,freebieMilestoneData:wt,cartTimerCustomText:kt,cartTimerInMinutes:Ct,imageAspectSelector:Et,cartComponentsCornerType:Tt,cartComponentsCornerRadius:St,gstSectionCustomizationData:It,noteSectionTitle:Nt,checkoutSectionMessage:Dt,checkoutSectionMessageRedirectLink:_t,checkoutSectionMessageDisplay:Pt,showVariantSelectionDropdownInProductClaim:At,loyaltyDiscount:Ot,getProductDetailsByVariantId:Oe,brandTokenName:Ft,showDiscountOnMRP:Mt??!0,prefixMessageText:Rt,suffixMessageText:Lt,successMessageText:jt,toggleDecimal:Vt,cartOffersCarouselHeight:Wt,disableCheckoutButton:Ht,showEmptyCartRecommendations:qt,emptyProductRecsTitleText:Ut,checkoutButtonBottomSpacing:Gt,showPoweredByBadge:Qt,applyCouponCode:Yt,showApplyCoupon:Zt,enableConfetti:Xt,showCheckoutButtonPaymentIcons:Kt}),nt&&rt&&s&&t.createElement(cu,{showStickyCart:nt,stickyCartCustomizationData:$t,product:rt,addCartItem:s,onSetLoading:Fe,themeColor:he,themeTextColor:xe,cartData:v,isCartOpen:R,setIsCartOpen:L,ctaButtonBackgroundColor:ce,ctaButtonTextColor:se,addToStickyCart:ft,cartComponentsCornerRadius:St,cartComponentsCornerType:Tt,checkoutFunction:zt,backgroundColor:g,primaryTextColor:de,comboBundleData:dn,comboBundleAddToCartFunction:fn}),hn&&nn.open&&t.createElement(Nu,{backgroundColor:g,ref:gn,isDev:j,removeCartItem:i,addCartItem:s,getProductDetailsByVariantId:Oe,themeColor:he,cartComponentsCornerRadius:St,cartComponentsCornerType:Tt,removeFreebieFromCart:Qe,freebieClaimAddToCart:We,productClaimCtaButtonText:tt?.productClaimCtaButtonText,backgroundSubdued:h??"#F5F5F5",primaryTextColor:de}),!hn&&nn.open&&t.createElement(Du,{ref:gn,isDev:j,removeCartItem:i,addCartItem:s,getProductDetailsByVariantId:Oe,themeColor:he,cartComponentsCornerRadius:St,cartComponentsCornerType:Tt,backgroundColor:g,removeFreebieFromCart:Qe,freebieClaimAddToCart:We,productClaimCtaButtonText:tt?.productClaimCtaButtonText,backgroundSubdued:h??"#F5F5F5",primaryTextColor:de})),!hn&&bt&&t.createElement(_u,{isCartOpen:R,setIsCartOpen:L,cartCheckpoints:q,customCartProgressBarCriteria:ie,floatingCartData:vt,effectiveQuantityForProgressBar:qe,cartComponentsCornerRadius:St,cartComponentsCornerType:Tt}))};q('@media (max-width: 108px) {\n .yt-fixed-bundle-price-section {\n width: 100% !important;\n }\n .yt-fixed-bundle-product-list {\n max-width: 100% !important;\n width: 100% !important;\n justify-content: center !important;\n }\n .price-text {\n text-align: center !important;\n }\n .bundle-builder-add-to-bundle-button {\n font-size: 12px !important;\n padding: 0px 8px !important;\n }\n .quantity .input-text.qty {\n width: 12px !important;\n height: 18px !important;\n }\n .quantity.buttons_added .minus,\n .quantity.buttons_added .plus {\n padding: 6px !important;\n height: 20px !important;\n }\n .bundle-builder-tracker-container {\n justify-content: center !important;\n }\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n .bundle-builder-title {\n font-size: 2rem !important;\n }\n .bundle-builder-tracker-item {\n width: 64px !important;\n height: 64px !important;\n }\n .bundle-builder-product-title {\n font-size: 14px !important;\n }\n}\n.hide-tracker-scrollbar {\n overflow-x: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n -webkit-overflow-scrolling: touch;\n}\n\n.hide-tracker-scrollbar::-webkit-scrollbar {\n display: none;\n}\n\n.yt-fixed-bundle-border {\n border: 1px solid #c7c7c7;\n}\n\n.yt-fixed-bundle-border-minor-curved {\n border-radius: 8px;\n}\n\n.yt-fixed-bundle-border-minor-curved-image {\n border-radius: 6px;\n}\n\n.yt-fixed-bundle-border-major-curved {\n border-radius: 20px;\n}\n\n.yt-fixed-bundle-border-major-curved-image {\n border-radius: 18px;\n}\n\n@media (min-width: 1200px) {\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-builder-tracker-container {\n gap: 5px !important;\n margin-block: 0 !important;\n }\n .bundle-summary {\n display: flex;\n flex-direction: column !important;\n align-items: flex-start;\n gap: 2px !important;\n }\n .bundle-summary button {\n padding-top: 2px !important;\n padding-inline: 13px !important;\n font-size: 14px !important;\n padding-inline: 10px !important;\n padding: 0px;\n width: -webkit-fill-available;\n }\n .bundle-builder-tracker-progress {\n display: block !important;\n }\n .summary-info {\n width: 100% !important;\n min-width: 200px !important;\n display: flex;\n justify-content: space-between !important;\n flex-direction: row !important;\n flex-grow: 1 !important;\n font-size: 14px !important;\n }\n}\n@media (max-width: 540px) {\n .products-display {\n justify-content: space-between !important;\n column-gap: 5px !important;\n }\n .bundle-builder-product-container {\n width: 49% !important;\n }\n .bundle-builder-title {\n font-size: 1.5rem !important;\n margin-bottom: 8px !important;\n }\n .bundle-builder-subtitle {\n padding-top: 4px;\n font-size: 1rem !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-summary.bundle-filled {\n display: flex !important;\n }\n}\n.yt-bundle-builder-product-price {\n font-weight: 600;\n color: black;\n margin-bottom: 2px;\n}\n\n/* Fixed bundle block */\n.yt-fixed-bundle-fixed-bundle {\n box-sizing: unset;\n max-width: 1000px;\n margin: 0 auto;\n container-type: inline-size;\n text-align: left;\n}\n\n.yt-fixed-bundle-bundle-header {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 10px 0px;\n gap: 8px;\n line-height: normal;\n}\n\n.yt-fixed-bundle-bundle-title {\n font-size: 24px;\n font-weight: 600;\n text-align: center;\n width: 100%;\n}\n\n.yt-fixed-bundle-bundle-subtitle {\n font-size: 16px;\n font-weight: 300;\n text-align: center;\n}\n\n.yt-fixed-bundle-bundle-content {\n display: flex;\n flex-direction: column;\n padding: 10px 0px;\n}\n\n.yt-fixed-bundle-product-list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.yt-product-main {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-card {\n display: flex;\n width: 90%;\n align-items: flex-start;\n padding: 0px;\n box-shadow: 2px 2px 11.8px 0px rgba(0, 0, 0, 0.1411764706);\n transition: transform 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n position: unset;\n}\n\n.yt-fixed-bundle-product-image {\n max-width: none;\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n}\n\n.yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n}\n\n.yt-fixed-bundle-product-title {\n font-size: 16px;\n font-weight: 700;\n display: block;\n line-height: 1.4;\n}\n\n.yt-fixed-bundle-product-price {\n font-size: 16px;\n display: block;\n margin-bottom: 6px;\n}\n\n.yt-fixed-bundle-original-price {\n text-decoration: line-through !important;\n color: #6b7280;\n margin-left: 4px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-checkbox {\n display: none !important;\n}\n\n.yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n}\n\n.yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n}\n\n.yt-fixed-bundle-variant-select {\n appearance: none;\n -webkit-appearance: none;\n width: 100%;\n padding: 4px 20px;\n background-color: #ffffff;\n font-size: 15px;\n background-image: none;\n color: #2d2d2d;\n cursor: pointer;\n transition: border-color 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-variant-select:focus {\n border-color: #cac6c6;\n box-shadow: 0 0 8px 0 rgba(56, 55, 57, 0.3);\n outline: none;\n}\n\n.yt-fixed-bundle-select-dot {\n position: absolute;\n top: 50%;\n left: 10px;\n transform: translateY(-50%);\n font-weight: 700;\n color: #4d4d4d;\n width: 8px; /* Adjust size */\n font-size: 8px;\n border-radius: 50%;\n pointer-events: none;\n}\n\n.yt-fixed-bundle-select-dot::after {\n content: "";\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background-color: #1b1b1b;\n}\n\n.yt-fixed-bundle-select-icon {\n position: absolute;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n pointer-events: none;\n color: #6b7280;\n background-color: rgba(30, 57, 103, 0.1);\n font-size: 20px;\n height: 100%;\n padding: 0px 5px;\n}\n\n.yt-fixed-bundle-plus-sign {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-plus-sign span {\n display: flex;\n justify-content: center;\n width: 24px;\n height: 22px;\n align-items: center;\n padding-bottom: 2px;\n background-color: #f2f2f2;\n color: black;\n border-radius: 2px;\n font-size: 20px;\n font-weight: bold;\n}\n\n.yt-fixed-bundle-price-section {\n display: flex;\n flex-direction: column;\n margin-top: 20px;\n width: 1000px;\n}\n\n.yt-fixed-bundle-subtotal {\n font-size: 13px;\n font-weight: 400 !important;\n}\n\n.yt-fixed-bundle-subtotal-amount {\n font-weight: 600;\n font-size: 13px;\n}\n\n.yt-fixed-bundle-deal-price-container {\n display: flex;\n justify-content: center;\n align-items: center;\n margin-bottom: 12px;\n gap: 8px;\n margin-top: 3px;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-deal-price {\n font-size: 16px;\n font-weight: 600;\n}\n\n.yt-fixed-bundle-extra-savings {\n font-size: 12px;\n color: #f6f8f7;\n padding: 4px 8px;\n background-color: #d3122a;\n border-radius: 2px;\n font-weight: 700 !important;\n}\n\n.yt-fixed-bundle-add-to-cart-button {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background-color: #8b5cf6;\n border: none;\n padding: 8px 0px;\n font-size: 16px;\n font-weight: 500 !important;\n cursor: pointer;\n width: 100%;\n}\n\n.yt-fixed-bundle-add-to-cart-button:disabled,\n.yt-fixed-bundle-add-to-cart-button[disabled] {\n color: #7d7d7d;\n cursor: default;\n}\n\n.yt-fixed-bundle-product-card.horizontal {\n max-width: 100%;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-product-card.horizontal:hover {\n transform: none;\n}\n\n.yt-fixed-bundle-product-list.horizontal {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n}\n\n.yt-product-main.horizontal {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-image-container.horizontal {\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n width: 30%;\n}\n\n.yt-fixed-bundle-product-image.horizontal {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n user-select: none;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop.horizontal {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile.horizontal {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop.horizontal {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-product-details.horizontal {\n padding-left: 0px;\n}\n\n.yt-fixed-bundle-product-price.horizontal {\n margin-bottom: 0px;\n}\n\n@media (min-width: 100px) {\n @container (width > 100px) {\n .yt-fixed-bundle-fixed-bundle {\n padding: 40px;\n }\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: flex;\n width: 100%;\n bottom: 6px;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n display: none;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n }\n .yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n }\n .yt-fixed-bundle-variant-select {\n margin: 0px 4px;\n }\n .yt-fixed-bundle-select-icon {\n right: 4px;\n }\n .yt-fixed-bundle-bundle-title {\n font-size: 32px;\n }\n .yt-fixed-bundle-bundle-subtitle {\n font-size: 20px;\n }\n .yt-fixed-bundle-bundle-content {\n flex-direction: column;\n justify-content: space-between;\n align-items: flex-start;\n }\n .yt-fixed-bundle-product-list {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n }\n .yt-fixed-bundle-product-card {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n text-align: center;\n }\n .yt-fixed-bundle-product-image-container {\n width: 100%;\n height: 100%;\n margin-right: 0;\n margin-bottom: 12px;\n justify-content: center;\n position: relative;\n }\n .yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n }\n .yt-fixed-bundle-product-image {\n height: 230px;\n width: 100%;\n aspect-ratio: 1;\n align-self: center;\n }\n .yt-fixed-bundle-plus-sign {\n align-self: center;\n margin-left: 0;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n margin-top: 32px;\n align-items: center;\n justify-content: center;\n text-align: center;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 10px;\n }\n .yt-fixed-bundle-subtotal {\n font-size: 15px;\n }\n .yt-fixed-bundle-subtotal-amount {\n font-size: 15px;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n top: 8px;\n left: 10px;\n height: auto;\n display: flex;\n align-items: center;\n }\n .yt-fixed-bundle-deal-price {\n font-size: 24px;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 13px;\n padding: 4px 8px;\n }\n .yt-fixed-bundle-add-to-cart-button {\n font-size: 20px;\n padding: 10px 0px;\n width: 100%;\n }\n .yt-product-main {\n width: 29%;\n }\n .yt-fixed-bundle-product-card:hover {\n transform: translateY(-5px);\n box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.1411764706);\n }\n }\n}\n.yt-product-main {\n display: flex;\n position: relative;\n}\n\n/* Container query */\n@container (max-width: 100px) {\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n }\n .yt-product-main {\n width: 100%;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n bottom: 6px;\n }\n .yt-fixed-bundle-product-image {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n .yt-fixed-bundle-variant-select-wrapper {\n position: relative;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n }\n .yt-fixed-bundle-product-card {\n max-width: 100%;\n flex-direction: row;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n }\n}\n.yt-product-card-transition {\n opacity: 0;\n transform: translateY(20px);\n transition: transform 0.6s ease, box-shadow 0.6s ease;\n}\n\n.yt-product-card-transition-up {\n opacity: 0;\n transform: translateY(-20px);\n transition: opacity 0.6s ease, transform 0.6s ease;\n}\n\n.yt-product-card-transition-active {\n opacity: 1;\n transform: translateY(0);\n}\n\n.yt-description-content img,\n.yt-collection-bundle-modal-description img,\n.yt-collection-bundle-modal-description iframe {\n max-width: 100%;\n height: auto;\n display: block;\n margin: 0 auto 15px;\n border-radius: 7px;\n}\n\n.yt-description-content,\n.yt-collection-bundle-modal-description {\n text-align: left;\n overflow-wrap: break-word;\n}');const Au=x.div`
|
|
2872
|
+
`,Nu=n(({removeCartItem:e,addCartItem:n,getProductDetailsByVariantId:r,themeColor:a,cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,productClaimCtaButtonText:f,backgroundSubdued:g,primaryTextColor:h},x)=>{const[y,b]=un(En),v=dn(mn),w=o(null),[C,k]=c(null),[E,T]=c(!1),[S,$]=c({}),[B,z]=c(y?.variantId),[I,N]=c(y?.quantity||1),[D,_]=c(!1),P=Ma();l(()=>{y?.open?setTimeout(()=>{_(!0)},10):_(!1)},[y?.open]);l(()=>{(async()=>{if(!C&&r&&y?.variantId&&y?.handle){const e=await r(y.handle,y.variantId);if(e&&e.variants&&e.options){let t;const n=y.allowedVariantIds,r=Array.isArray(n)&&n.length>0;if(t=r?e.variants.find(e=>e.available&&n.includes(String(e.id))&&String(e.id)===String(y.variantId))||e.variants.find(e=>e.available&&n.includes(String(e.id))):e.variants.find(e=>e.available&&String(e.id)===String(y.variantId)),t){z(String(t.id));const n={};e.options.forEach((e,r)=>{n[e.name]=t[`option${r+1}`]}),$(n)}else z(void 0),$({})}k(e)}})()},[C,r,y]);const A=(e,t)=>{const n={...S,[e]:t};$(n);const r=C?.variants?.find(e=>C.options.every((t,r)=>e[`option${r+1}`]===n[t.name]));if(r){const e=y?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(r.id)))return;r.available&&z(String(r.id))}},O=C?.variants?.find(e=>String(e.id)===String(B)),F=Dn(v,v?.currency),M=i(()=>{const e={};if(!C)return e;const t=Array.isArray(y?.allowedVariantIds)&&y.allowedVariantIds.length>0;return C.options.forEach(n=>{e[n.name]=n.values.filter(e=>C.variants.filter(r=>{const o=C.options.indexOf(n);if(r[`option${o+1}`]!==e)return!1;return!!C.options.every((e,t)=>{if(e.name===n.name)return!0;const o=S[e.name];return!o||r[`option${t+1}`]===o})&&(!!(!t||Array.isArray(y.allowedVariantIds)&&y.allowedVariantIds.includes(String(r.id)))&&!!r.available)}).some(e=>!!(!t||Array.isArray(y.allowedVariantIds)&&y.allowedVariantIds.includes(String(e.id)))&&e.available))}),e},[C,S,y]);return C?t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:y?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:D?1:0,transition:"opacity 0.3s ease"},onClick:()=>{_(!1),setTimeout(()=>{b({open:!1,variantId:void 0,handle:void 0,quantity:void 0})},300)}}),t.createElement(su,{ref:x,className:"yt-variant-selection-popup"},t.createElement(pu,{ref:w,style:{backgroundColor:p||"white",opacity:D?1:0,transform:D?"translateY(0)":"translateY(20px)"},$themeColor:a,onClick:e=>e.stopPropagation()},y?.freebieSelection&&t.createElement(du,null,"Unlocked Freebie"),t.createElement(mu,null,t.createElement(fu,null,t.createElement(gu,null,t.createElement(hu,{src:O?.featured_image?.src??C?.featured_image,alt:O?.featured_image?.alt??C?.title})),t.createElement(xu,null,t.createElement(yu,{$themeColor:a,$primaryTextColor:h,href:`${C?.url}?variant=${O?.id}`},C?.title),t.createElement(Bu,null,t.createElement(bu,null,t.createElement(vu,{$primaryTextColor:h},F,In(O?.price,v?.currency??"INR")),null!=O?.compare_at_price&&null!=O?.price&&O.compare_at_price>O.price&&t.createElement(wu,null,F,In(O?.compare_at_price,v?.currency??"INR"))),!y?.freebieSelection&&t.createElement(Na,{value:I,handleItemQuantityIncrement:async()=>{N(e=>e+1)},handleItemQuantityDecrement:async()=>{I>1&&N(e=>e-1)},cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundSubdued:g})))),C?.options?.map(e=>{const n=P?.options?.find(t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase());return t.createElement(ku,{key:e.name},t.createElement(Tu,null,t.createElement("span",null,"Select ",e.name),S[e.name]&&t.createElement(Su,null,S[e.name])),t.createElement($u,null,M[e.name]?.map(r=>{const o=S[e.name]===r,i=Fa(n,r);return"color"===n?.type&&i?.value?t.createElement(zu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>A(e.name,r),$colorValue:i.value}):"image"===n?.type&&i?.value?t.createElement(Iu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>A(e.name,r),$imageUrl:i.value}):t.createElement(Eu,{$themeColor:a,key:r,$isSelected:o,backgroundColor:o?a:void 0,onClick:()=>A(e.name,r)},r)})))})),t.createElement(Cu,{className:"yt-cart-variant-popup-ATC-button",$themeColor:a??"#C33",onClick:y?.productRec?async()=>{if(B&&n){T(!0);try{await n(B,I,"product-recommendation-variant-selector",!1,y.handle),b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}T(!1)}}:async()=>{if(!B)return;const t=!!y?.lineItemKey,r=String(B)!==String(y?.variantId);if(!t||r){T(!0);try{const t=y?.freebieSelection;t&&u&&y?.lineItemKey?await u(y.lineItemKey):await e(y?.lineItemKey||y?.variantId,"variant-selector",!0),t&&m?await m(B,y.allowedVariantIds):n&&B&&await n(B,I,"variant-selector",!1,y.handle),b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}T(!1)}else b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!B||E},E?t.createElement(fa,{color:"white",size:13}):y?.productRec?"ADD TO BAG":y?.freebieSelection?f||"CLAIM FREEBIE":"GET IN BAG")))):t.createElement(su,{ref:x},t.createElement(pu,{style:{backgroundColor:p||"white"}},t.createElement(uu,null,t.createElement(ya,{color:a||"#868E96"}))))});Nu.displayName="DesktopVariantPopup";const Du=n(({removeCartItem:e,addCartItem:n,getProductDetailsByVariantId:r,themeColor:a,cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundColor:p,removeFreebieFromCart:u,freebieClaimAddToCart:m,productClaimCtaButtonText:f,backgroundSubdued:g,primaryTextColor:h},x)=>{const[y,b]=un(En),v=dn(mn),[w,C]=c(null),[k,E]=c(!1),[T,S]=c({}),[$,B]=c(y?.variantId),[z,I]=c(y?.quantity||1),N=o(null),D=Ma(),[_,P]=c(!1);l(()=>{y?.open?setTimeout(()=>{P(!0)},10):P(!1)},[y?.open]);l(()=>{(async()=>{if(!w&&r&&y?.variantId&&y?.handle)try{const e=await r(y.handle,y.variantId);if(!e)return;if(!e.variants||!Array.isArray(e.variants))return;if(e&&e.variants&&e.options){let t;const n=y.allowedVariantIds,r=Array.isArray(n)&&n.length>0;if(t=r?e.variants.find(e=>e.available&&n.includes(String(e.id))&&String(e.id)===String(y.variantId))||e.variants.find(e=>e.available&&n.includes(String(e.id))):e.variants.find(e=>e.available&&String(e.id)===String(y.variantId)),t){B(String(t.id));const n={};e.options.forEach((e,r)=>{n[e.name]=t[`option${r+1}`]}),S(n)}else B(void 0),S({})}C(e)}catch(e){}})()},[w,r,y]),l(()=>{},[p,e,n,r]);const A=(e,t)=>{const n={...T,[e]:t};S(n);const r=w?.variants?.find(e=>w.options.every((t,r)=>e[`option${r+1}`]===n[t.name]));if(r){const e=y?.allowedVariantIds;if(Array.isArray(e)&&e.length>0&&!e.includes(String(r.id)))return;r.available&&B(String(r.id))}},O=w?.variants?.find(e=>String(e.id)===String($)),F=Dn(v,v?.currency),M=i(()=>{const e={};if(!w)return e;const t=Array.isArray(y?.allowedVariantIds)&&y.allowedVariantIds.length>0;return w.options.forEach(n=>{e[n.name]=n.values.filter(e=>w.variants.filter(r=>{const o=w.options.indexOf(n);if(r[`option${o+1}`]!==e)return!1;return!!w.options.every((e,t)=>{if(e.name===n.name)return!0;const o=T[e.name];return!o||r[`option${t+1}`]===o})&&(!!(!t||Array.isArray(y.allowedVariantIds)&&y.allowedVariantIds.includes(String(r.id)))&&!!r.available)}).some(e=>!!(!t||Array.isArray(y.allowedVariantIds)&&y.allowedVariantIds.includes(String(e.id)))&&e.available))}),e},[w,T,y]);return w?t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:2147483643,display:y?.open?"flex":"none",justifyContent:"center",alignItems:"center",opacity:_?1:0,transition:"opacity 0.3s ease"},onClick:()=>{P(!1),setTimeout(()=>{b({open:!1,variantId:void 0,handle:void 0,quantity:void 0})},300)}}),t.createElement(su,{ref:x,className:"yt-variant-selection-popup"},t.createElement(pu,{ref:N,style:{backgroundColor:p||"white",opacity:_?1:0,transform:_?"translateY(0)":"translateY(20px)"},$themeColor:a,onClick:e=>e.stopPropagation()},y?.freebieSelection&&t.createElement(du,null,"Unlocked Freebie"),t.createElement(mu,null,t.createElement(fu,null,t.createElement(gu,null,t.createElement(hu,{src:O?.featured_image?.src??w?.featured_image,alt:O?.featured_image?.alt??w?.title})),t.createElement(xu,null,t.createElement(yu,{$themeColor:a,$primaryTextColor:h,href:`${w?.url}?variant=${O?.id}`},w?.title),t.createElement(Bu,null,t.createElement(bu,null,t.createElement(vu,{$primaryTextColor:h},F,In(O?.price,v?.currency??"INR")),null!=O?.compare_at_price&&null!=O?.price&&O.compare_at_price>O.price&&t.createElement(wu,null,F,In(O?.compare_at_price,v?.currency??"INR"))),!y?.freebieSelection&&t.createElement(Na,{value:z,handleItemQuantityIncrement:async()=>{I(e=>e+1)},handleItemQuantityDecrement:async()=>{z>1&&I(e=>e-1)},cartComponentsCornerRadius:s,cartComponentsCornerType:d,backgroundSubdued:g})))),w?.options?.map(e=>{const n=D?.options?.find(t=>t.name.trim().toLowerCase()===e.name.trim().toLowerCase());return t.createElement(ku,{key:e.name},t.createElement(Tu,null,t.createElement("span",null,"Select ",e.name,":"),T[e.name]&&t.createElement(Su,null,T[e.name])),t.createElement($u,null,M[e.name]?.map(r=>{const o=T[e.name]===r,i=Fa(n,r);return"color"===n?.type&&i?.value?t.createElement(zu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>A(e.name,r),$colorValue:i.value}):"image"===n?.type&&i?.value?t.createElement(Iu,{key:r,$isSelected:o,$themeColor:a,onClick:()=>A(e.name,r),$imageUrl:i.value}):t.createElement(Eu,{$themeColor:a,key:r,$isSelected:o,backgroundColor:o?a:void 0,onClick:()=>A(e.name,r)},r)})))})),t.createElement(Cu,{className:"yt-cart-variant-popup-ATC-button",$themeColor:a??"#C33",onClick:y?.productRec?async()=>{if($&&n){E(!0);try{await n($,z,"product-recommendation-variant-selector",!1,y.handle),b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,productRec:!1})}catch(e){console.error("Error adding item from product recommendation:",e)}E(!1)}}:async()=>{if(!$)return;const t=!!y?.lineItemKey,r=String($)!==String(y?.variantId);if(!t||r){E(!0);try{const t=y?.freebieSelection;t&&u&&y?.lineItemKey?await u(y.lineItemKey):await e(y?.lineItemKey||y?.variantId,"variant-selector",!0),t&&m?await m($,y.allowedVariantIds):n&&$&&await n($,z,"variant-selector",!1,y.handle),b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})}catch(e){}E(!1)}else b({open:!1,variantId:void 0,quantity:void 0,handle:void 0,lineItemKey:void 0})},disabled:!$||k},k?t.createElement(fa,{color:"white",size:13}):y?.productRec?"ADD TO BAG":y?.freebieSelection?f||"CLAIM FREEBIE":"GET IN BAG")))):t.createElement(su,{ref:x},t.createElement(pu,{style:{backgroundColor:p||"white"}},t.createElement(uu,null,t.createElement(ya,{color:a||"#868E96"}))))});const _u=({setIsCartOpen:e,isCartOpen:n,cartCheckpoints:r,customCartProgressBarCriteria:o,floatingCartData:a,effectiveQuantityForProgressBar:i,cartComponentsCornerType:l,cartComponentsCornerRadius:c})=>{const s=dn(mn),d=a?.bannerFooterText,p="string"==typeof d&&d.trim().length>0,u=!n&&(e=>{try{if("undefined"==typeof window)return!1;const t=window.location.pathname||"/";if("/"===t||""===t)return!0;const n=e?.showOnPages;if(!Array.isArray(n)||0===n.length)return!1;const r=t.toLowerCase(),o=r.endsWith("/")?r:`${r}/`;return n.some(e=>{if(!e||"string"!=typeof e)return!1;const t=e.trim().toLowerCase().replace(/^\/|\/$/g,"");if(!t)return!1;const n=`/${t}/`;return o.includes(n)})}catch{return!1}})(a),m=s?.item_count??0,f=In(s?.items_subtotal_price??0,s?.currency??"INR"),g=Dn(s),h=function(e,t,n,r,o){if(!e||0===e.length)return{deltaValue:0,show:!1};const a=(t??"minimum_order_value").toLowerCase(),i="quantity_threshold"===a?"number"==typeof o?o:r:n,l=[...e].sort((e,t)=>("quantity_threshold"===a?e.quantityThreshold:e.minimumOrderValue)-("quantity_threshold"===a?t.quantityThreshold:t.minimumOrderValue)).find(e=>("quantity_threshold"===a?e.quantityThreshold:e.minimumOrderValue)>i);if(!l)return{deltaValue:0,show:!1};const c="quantity_threshold"===a?l.quantityThreshold:l.minimumOrderValue,s=Math.max(0,c-i);return{deltaValue:s,show:s>0,isQuantity:"quantity_threshold"===a}}(r,o,f,m,i),x="sharp"===l?0:c??12,y=a?.textColor??"#111",b=a?.backgroundColor??"#FF7E6E",v=a?.bannerBackgroundColor??"#FFE0DC",w=a?.buttonColor??"#E8513F",C=t.useRef(null);t.useEffect(()=>{jn(C.current)},[w]);const k={position:"fixed",width:"100%",bottom:0,zIndex:2147483642,paddingBottom:"env(safe-area-inset-bottom)"},E={background:"#FFFFFF",color:y,padding:"5px",fontSize:12,fontFamily:"Poppins",fontWeight:600,textAlign:"center",display:"flex",alignItems:"center",justifyContent:"center",gap:8},T={background:"#fff",color:y,borderRadius:x,boxShadow:"0 10px 24px rgba(0,0,0,0.15)",overflow:"hidden",fontFamily:"Poppins"},S={position:"absolute",top:0,left:"50%",transform:"translate(-50%, -70%)",backgroundColor:v,color:y,padding:8,fontSize:12,lineHeight:"normal",borderTopLeftRadius:13,borderTopRightRadius:13,width:"97%",display:"flex",alignItems:"center",justifyContent:"center",gap:6,zIndex:-1},$={display:"flex",alignItems:"center",gap:12,padding:"10px 12px",backgroundColor:b},B={display:"flex",alignItems:"center",gap:8,fontWeight:700,fontSize:16,color:y},z={fontSize:12,color:y,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},I={padding:"5px 10px",background:w,color:"#fff",borderRadius:8,fontSize:15,fontWeight:700,border:"none",outline:"none",flexShrink:0};if(!u)return null;if(0===m){if(!h.show)return null;const e=h.isQuantity?`${h.deltaValue} more items to get freebie`:`Add items worth ${g}${Vn(h.deltaValue.toFixed(0))} to get freebie`;return t.createElement("div",{style:k},t.createElement("div",{style:E},t.createElement(W,{"aria-hidden":!0}),t.createElement("span",null,e)))}const N=1===m?"1 item":`${m} items`,D=h.show?h.isQuantity?`${h.deltaValue} more items to get freebie`:`Add items worth ${g}${Vn(h.deltaValue.toFixed(0))} more to get freebie`:"";return t.createElement("div",{style:{position:"fixed",left:12,right:12,bottom:12,zIndex:2147483642,paddingBottom:"env(safe-area-inset-bottom)"}},t.createElement("div",{style:{position:"relative"}},h.show&&t.createElement("div",{style:S},t.createElement(W,{"aria-hidden":!0,style:{marginBottom:7}}),t.createElement("span",{style:{display:"inline-block",marginBottom:7}},D)),t.createElement("div",{style:T},t.createElement("div",{style:$},t.createElement(mt,{width:24,height:24,color:y}),t.createElement("div",{style:{display:"flex",flexDirection:"column",minWidth:0,flex:1,lineHeight:"normal"}},t.createElement("div",{style:B},t.createElement("span",null,g,Vn(f.toFixed(0))),t.createElement("span",{style:{fontSize:9,fontWeight:600,color:"#fff",backgroundColor:"#828282",marginBottom:5,paddingInline:5}},N)),p?t.createElement("span",{style:z,title:d},d):null),t.createElement("button",{ref:C,style:I,onClick:()=>e(!0),"aria-label":"View Cart"},"View Cart")))))},Pu=({exploreCTAColor:e,checkoutFontSize:n,handleDecrement:r,handleIncrement:a,removeCartItem:i,addCartItem:s,cartTitle:d,emptyCartTitle:p,emptyCartDescription:u,emptyCartButtons:f,backgroundColor:g,backgroundSubdued:h,tertiaryColor:x,tertiaryTextColor:y,backdrop:b=!0,cartData:v,isUserSignedIn:w,showBundle:C,showCouponOptions:k,bundleProducts:E,discountAmountOff:T,loyaltyIcon:S,pointsToBeUsed:$,rewardMultiplier:B,redemptionMultiplier:z,removeDiscount:I,applyDiscount:N,discountApplied:D,rewardCoupons:_,userTotalPoints:P,checkoutFunction:A,joinNowFunction:O,guestLoyaltyPercentage:F,showToggleButton:M,isOpen:R,setIsOpen:L,isDev:j,switchWidthVariant:V,recProductsList:W,showMultiStepProgressBar:H,cartCheckpoints:q,redemptionRate:U,pointsRewardRate:G,showCartLevelAltPay:Q,guestRewardCoupon:Y,showGuestDiscountCoupon:Z,applyTemplateDiscount:X,exploreCtaRedirectLink:K,discountAmountApplied:J,minimumCartValue:ee,discountInCheckoutButton:te,isStickyCheckout:ne,showDiscountsListToGuestUsers:re,showApplyCouponsButtonToGuestUsers:oe,handleCheckpointCrossed:ae,customCartProgressBarCriteria:ie,checkoutButtonColor:le,ctaButtonBackgroundColor:ce,ctaButtonTextColor:se,primaryTextColor:de,productRecsCtaButtonText:pe,productRecsTitleText:ue,secondaryTextColor:me,showProductRecsOnDesktop:fe,showProductRecsOnMobile:ge,themeColor:he,themeTextColor:xe,companyName:ye,gstNumber:be,showGSTOption:ve,applyGSTToCart:we,showMOVForProgressTiers:Ce,freeProduct:ke,showLoyaltyCta:Ee,freeProductAdjustedCartTotal:Te,minimumOrderValueToAvailDiscount:Se,signinCTAButtonVisible:$e,cartSigninCTAMainText:Be,showNoteOption:ze,applyNoteToCart:Ie,note:Ne,inlineCartOfferInfoText:De,inlineCartOfferInfoRedirectLink:_e,cartOfferTermsAndConditionsText:Pe,showEditOptionOnProducts:Ae,getProductDetailsByVariantId:Oe,onSetLoading:Fe,showVariantSelectionDropdownInProductRecs:Me,originalCartSubtotal:Re,currentTier:Le,freebieProductsInCart:je,showFreebieClaim:Ve,addFreebieToCart:We,freebiesInCart:He,effectiveQuantityForProgressBar:qe,productPercentageOffMapping:Ue,productTagsMapping:Ge,removeFreebieFromCart:Qe,postalCodeList:Ye,enableGeoLocationDeliveryRestriction:Ze,applyPostalCodeAndDeliverySlotToCart:Xe,showDeleteOnFreebies:Ke,freebieCouponTemplates:Je,freebieFlowCheckpoints:et,freebieClaimData:tt,showStickyAddToCart:nt,stickyCartLineItem:rt,postalCodeBasedItemTrackingParameter:ot,enableSlotPicker:at,deliveryHeaderTitle:it,deliveryAvailableText:lt,deliveryNotAvailableText:ct,giftWrapSetupData:st,giftWrapProductDetail:dt,enableCustomCartOnCartPage:pt,isCartPage:ut,progressBarFreeProductIconType:mt,addToStickyCart:ft,productRecsCardLayout:gt,productRecsCardListVariant:ht,showCartTimer:xt,showFreebieMilestone:yt,showFloatingCart:bt,floatingCartData:vt,freebieMilestoneData:wt,cartTimerInMinutes:Ct,cartTimerCustomText:kt,imageAspectSelector:Et,cartComponentsCornerType:Tt,cartComponentsCornerRadius:St,stickyCartCustomizationData:$t,cartOffersCarousalData:Bt,stickyBarBuyNowFunction:zt,gstSectionCustomizationData:It,noteSectionTitle:Nt,checkoutSectionMessage:Dt,checkoutSectionMessageRedirectLink:_t,checkoutSectionMessageDisplay:Pt,showVariantSelectionDropdownInProductClaim:At,loyaltyDiscount:Ot,brandTokenName:Ft,showDiscountOnMRP:Mt,prefixMessageText:Rt,suffixMessageText:Lt,successMessageText:jt,toggleDecimal:Vt,cartOffersCarouselHeight:Wt,disableCheckoutButton:Ht,showEmptyCartRecommendations:qt,emptyProductRecsTitleText:Ut,checkoutButtonBottomSpacing:Gt,showPoweredByBadge:Qt=!0,applyCouponCode:Yt,showApplyCoupon:Zt,enableConfetti:Xt,showCheckoutButtonPaymentIcons:Kt=!0,comboBundleData:Jt,comboBundleAddToCartFunction:en})=>{const tn=pn(mn),[nn,rn]=un(En),[on,an]=un(Cl),ln=()=>L(!R),[cn,sn]=c(()=>{const e=window.ytComboBundle;return{comboBundleData:e?.bundle??null,comboBundleAddToCartFunction:e?.addToCart??null}});l(()=>{const e=e=>{const t=e.detail;sn({comboBundleData:t?.bundle??null,comboBundleAddToCartFunction:t?.addToCart??null})};return window.addEventListener("yt-combo-bundle-updated",e),()=>window.removeEventListener("yt-combo-bundle-updated",e)},[]);const dn=cn.comboBundleData??Jt,fn=cn.comboBundleAddToCartFunction??en,gn=o(null),hn=o(0);m(()=>{if(v){const e=v?.token??null,t="number"==typeof v?.cartUpdatedAtMs?v.cartUpdatedAtMs:void 0;e!==gn.current&&(gn.current=e,hn.current=t??0);const n=hn.current;if(!(void 0===t||t>=n))return;void 0!==t&&(hn.current=t),tn(v)}},[v]);const xn=o(null);l(()=>{function e(e){xn.current&&!xn.current.contains(e.target)&&(rn({open:!1,variantId:void 0,quantity:void 0,handle:void 0}),an({isOpen:!1}))}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const[yn,bn]=c(!1);return l(()=>{const e=()=>{bn(window.innerWidth>=768)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),t.createElement(t.Fragment,null,t.createElement("div",{style:{position:pt&&ut?"relative":"absolute",width:"100%",display:pt&&ut?"flex":"block",alignItems:"center",justifyContent:"center"}},M&&!(pt&&ut)&&t.createElement("button",{style:{margin:"16px"},onClick:ln},R?"Close Drawer":"Open Drawer"),R&&b&&!(pt&&ut)&&t.createElement("div",{onClick:ln,id:"custom-cart-yt-overlay",style:{position:"fixed",top:0,right:0,zIndex:1e4,transform:"translateX(0)",backgroundColor:"rgba(0,0,0,0.5)",inset:0,height:"100%",width:"100%"}},""),t.createElement(Wp,{isCartPage:ut,enableCustomCartOnCartPage:pt,isOpen:R,setIsOpen:L,backgroundColor:g,backgroundSubdued:h??"#F5F5F5",tertiaryColor:x,tertiaryTextColor:y,exploreCTAColor:e,checkoutFontSize:n,cartTitle:d,handleDecrement:r,handleIncrement:a,removeCartItem:i,addCartItem:s,emptyCartTitle:p,emptyCartButtons:f,emptyCartDescription:u,showCouponOptions:k,showBundle:C,isUserSignedIn:w,bundleProducts:E,discountAmountOff:T,loyaltyIcon:S,pointsToBeUsed:$,rewardMultiplier:B,redemptionMultiplier:z,removeDiscount:I,applyDiscount:N,discountApplied:D,rewardCoupons:_,userTotalPoints:P,checkoutFunction:A,joinNowFunction:O,guestLoyaltyPercentage:F,isDev:j,switchWidthVariant:V,recProductsList:W,showMultiStepProgressBar:H,cartCheckpoints:q,redemptionRate:U,pointsRewardRate:G,showCartLevelAltPay:Q,guestRewardCoupon:Y,showGuestDiscountCoupon:Z,applyTemplateDiscount:X,exploreCtaRedirectLink:K,discountAmountApplied:J,minimumCartValue:ee,discountInCheckoutButton:te,isStickyCheckout:ne,showDiscountsListToGuestUsers:re,showApplyCouponsButtonToGuestUsers:oe,handleCheckpointCrossed:ae,customCartProgressBarCriteria:ie??"minimum_order_value",checkoutButtonColor:le,ctaButtonBackgroundColor:ce,ctaButtonTextColor:se,primaryTextColor:de,productRecsCtaButtonText:pe,productRecsTitleText:ue,secondaryTextColor:me,showProductRecsOnDesktop:fe,showProductRecsOnMobile:ge,themeColor:he,themeTextColor:xe,companyName:ye,gstNumber:be,showGSTOption:ve,applyGSTToCart:we,showMOVForProgressTiers:Ce,freeProduct:ke,showLoyaltyCta:Ee,freeProductAdjustedCartTotal:Te,minimumOrderValueToAvailDiscount:Se,signinCTAButtonVisible:$e,cartSigninCTAMainText:Be,applyNoteToCart:Ie,note:Ne,showNoteOption:ze,inlineCartOfferInfoText:De,inlineCartOfferInfoRedirectLink:_e,cartOfferTermsAndConditionsText:Pe,showEditOptionOnProducts:Ae,onSetLoading:Fe,showVariantSelectionDropdownInProductRecs:Me,originalCartSubtotal:Re,currentTier:Le,freebieProductsInCart:je,cartOffersCarousalData:Bt,showFreebieClaim:Ve,addFreebieToCart:We,freebiesInCart:He,effectiveQuantityForProgressBar:qe,productPercentageOffMapping:Ue,productTagsMapping:Ge,removeFreebieFromCart:Qe,postalCodeList:Ye,enableGeoLocationDeliveryRestriction:Ze,applyPostalCodeAndDeliverySlotToCart:Xe,showDeleteOnFreebies:Ke,freebieCouponTemplates:Je,freebieFlowCheckpoints:et,freebieClaimData:tt,postalCodeBasedItemTrackingParameter:ot,enableSlotPicker:at,deliveryHeaderTitle:it,deliveryAvailableText:lt,deliveryNotAvailableText:ct,giftWrapSetupData:st,giftWrapProductDetail:dt,progressBarFreeProductIconType:mt,productRecsCardLayout:gt,productRecsCardListVariant:ht,showCartTimer:xt,showFreebieMilestone:yt,freebieMilestoneData:wt,cartTimerCustomText:kt,cartTimerInMinutes:Ct,imageAspectSelector:Et,cartComponentsCornerType:Tt,cartComponentsCornerRadius:St,gstSectionCustomizationData:It,noteSectionTitle:Nt,checkoutSectionMessage:Dt,checkoutSectionMessageRedirectLink:_t,checkoutSectionMessageDisplay:Pt,showVariantSelectionDropdownInProductClaim:At,loyaltyDiscount:Ot,getProductDetailsByVariantId:Oe,brandTokenName:Ft,showDiscountOnMRP:Mt??!0,prefixMessageText:Rt,suffixMessageText:Lt,successMessageText:jt,toggleDecimal:Vt,cartOffersCarouselHeight:Wt,disableCheckoutButton:Ht,showEmptyCartRecommendations:qt,emptyProductRecsTitleText:Ut,checkoutButtonBottomSpacing:Gt,showPoweredByBadge:Qt,applyCouponCode:Yt,showApplyCoupon:Zt,enableConfetti:Xt,showCheckoutButtonPaymentIcons:Kt}),nt&&rt&&s&&t.createElement(cu,{showStickyCart:nt,stickyCartCustomizationData:$t,product:rt,addCartItem:s,onSetLoading:Fe,themeColor:he,themeTextColor:xe,cartData:v,isCartOpen:R,setIsCartOpen:L,ctaButtonBackgroundColor:ce,ctaButtonTextColor:se,addToStickyCart:ft,cartComponentsCornerRadius:St,cartComponentsCornerType:Tt,checkoutFunction:zt,backgroundColor:g,primaryTextColor:de,comboBundleData:dn,comboBundleAddToCartFunction:fn}),yn&&nn.open&&t.createElement(Nu,{backgroundColor:g,ref:xn,isDev:j,removeCartItem:i,addCartItem:s,getProductDetailsByVariantId:Oe,themeColor:he,cartComponentsCornerRadius:St,cartComponentsCornerType:Tt,removeFreebieFromCart:Qe,freebieClaimAddToCart:We,productClaimCtaButtonText:tt?.productClaimCtaButtonText,backgroundSubdued:h??"#F5F5F5",primaryTextColor:de}),!yn&&nn.open&&t.createElement(Du,{ref:xn,isDev:j,removeCartItem:i,addCartItem:s,getProductDetailsByVariantId:Oe,themeColor:he,cartComponentsCornerRadius:St,cartComponentsCornerType:Tt,backgroundColor:g,removeFreebieFromCart:Qe,freebieClaimAddToCart:We,productClaimCtaButtonText:tt?.productClaimCtaButtonText,backgroundSubdued:h??"#F5F5F5",primaryTextColor:de})),!yn&&bt&&t.createElement(_u,{isCartOpen:R,setIsCartOpen:L,cartCheckpoints:q,customCartProgressBarCriteria:ie,floatingCartData:vt,effectiveQuantityForProgressBar:qe,cartComponentsCornerRadius:St,cartComponentsCornerType:Tt}))};q('@media (max-width: 108px) {\n .yt-fixed-bundle-price-section {\n width: 100% !important;\n }\n .yt-fixed-bundle-product-list {\n max-width: 100% !important;\n width: 100% !important;\n justify-content: center !important;\n }\n .price-text {\n text-align: center !important;\n }\n .bundle-builder-add-to-bundle-button {\n font-size: 12px !important;\n padding: 0px 8px !important;\n }\n .quantity .input-text.qty {\n width: 12px !important;\n height: 18px !important;\n }\n .quantity.buttons_added .minus,\n .quantity.buttons_added .plus {\n padding: 6px !important;\n height: 20px !important;\n }\n .bundle-builder-tracker-container {\n justify-content: center !important;\n }\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n .bundle-builder-title {\n font-size: 2rem !important;\n }\n .bundle-builder-tracker-item {\n width: 64px !important;\n height: 64px !important;\n }\n .bundle-builder-product-title {\n font-size: 14px !important;\n }\n}\n.hide-tracker-scrollbar {\n overflow-x: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n -webkit-overflow-scrolling: touch;\n}\n\n.hide-tracker-scrollbar::-webkit-scrollbar {\n display: none;\n}\n\n.yt-fixed-bundle-border {\n border: 1px solid #c7c7c7;\n}\n\n.yt-fixed-bundle-border-minor-curved {\n border-radius: 8px;\n}\n\n.yt-fixed-bundle-border-minor-curved-image {\n border-radius: 6px;\n}\n\n.yt-fixed-bundle-border-major-curved {\n border-radius: 20px;\n}\n\n.yt-fixed-bundle-border-major-curved-image {\n border-radius: 18px;\n}\n\n@media (min-width: 1200px) {\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-builder-tracker-container {\n gap: 5px !important;\n margin-block: 0 !important;\n }\n .bundle-summary {\n display: flex;\n flex-direction: column !important;\n align-items: flex-start;\n gap: 2px !important;\n }\n .bundle-summary button {\n padding-top: 2px !important;\n padding-inline: 13px !important;\n font-size: 14px !important;\n padding-inline: 10px !important;\n padding: 0px;\n width: -webkit-fill-available;\n }\n .bundle-builder-tracker-progress {\n display: block !important;\n }\n .summary-info {\n width: 100% !important;\n min-width: 200px !important;\n display: flex;\n justify-content: space-between !important;\n flex-direction: row !important;\n flex-grow: 1 !important;\n font-size: 14px !important;\n }\n}\n@media (max-width: 540px) {\n .products-display {\n justify-content: space-between !important;\n column-gap: 5px !important;\n }\n .bundle-builder-product-container {\n width: 49% !important;\n }\n .bundle-builder-title {\n font-size: 1.5rem !important;\n margin-bottom: 8px !important;\n }\n .bundle-builder-subtitle {\n padding-top: 4px;\n font-size: 1rem !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-summary.bundle-filled {\n display: flex !important;\n }\n}\n.yt-bundle-builder-product-price {\n font-weight: 600;\n color: black;\n margin-bottom: 2px;\n}\n\n/* Fixed bundle block */\n.yt-fixed-bundle-fixed-bundle {\n box-sizing: unset;\n max-width: 1000px;\n margin: 0 auto;\n container-type: inline-size;\n text-align: left;\n}\n\n.yt-fixed-bundle-bundle-header {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 10px 0px;\n gap: 8px;\n line-height: normal;\n}\n\n.yt-fixed-bundle-bundle-title {\n font-size: 24px;\n font-weight: 600;\n text-align: center;\n width: 100%;\n}\n\n.yt-fixed-bundle-bundle-subtitle {\n font-size: 16px;\n font-weight: 300;\n text-align: center;\n}\n\n.yt-fixed-bundle-bundle-content {\n display: flex;\n flex-direction: column;\n padding: 10px 0px;\n}\n\n.yt-fixed-bundle-product-list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.yt-product-main {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-card {\n display: flex;\n width: 90%;\n align-items: flex-start;\n padding: 0px;\n box-shadow: 2px 2px 11.8px 0px rgba(0, 0, 0, 0.1411764706);\n transition: transform 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n position: unset;\n}\n\n.yt-fixed-bundle-product-image {\n max-width: none;\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n}\n\n.yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n}\n\n.yt-fixed-bundle-product-title {\n font-size: 16px;\n font-weight: 700;\n display: block;\n line-height: 1.4;\n}\n\n.yt-fixed-bundle-product-price {\n font-size: 16px;\n display: block;\n margin-bottom: 6px;\n}\n\n.yt-fixed-bundle-original-price {\n text-decoration: line-through !important;\n color: #6b7280;\n margin-left: 4px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-checkbox {\n display: none !important;\n}\n\n.yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n}\n\n.yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n}\n\n.yt-fixed-bundle-variant-select {\n appearance: none;\n -webkit-appearance: none;\n width: 100%;\n padding: 4px 20px;\n background-color: #ffffff;\n font-size: 15px;\n background-image: none;\n color: #2d2d2d;\n cursor: pointer;\n transition: border-color 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-variant-select:focus {\n border-color: #cac6c6;\n box-shadow: 0 0 8px 0 rgba(56, 55, 57, 0.3);\n outline: none;\n}\n\n.yt-fixed-bundle-select-dot {\n position: absolute;\n top: 50%;\n left: 10px;\n transform: translateY(-50%);\n font-weight: 700;\n color: #4d4d4d;\n width: 8px; /* Adjust size */\n font-size: 8px;\n border-radius: 50%;\n pointer-events: none;\n}\n\n.yt-fixed-bundle-select-dot::after {\n content: "";\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background-color: #1b1b1b;\n}\n\n.yt-fixed-bundle-select-icon {\n position: absolute;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n pointer-events: none;\n color: #6b7280;\n background-color: rgba(30, 57, 103, 0.1);\n font-size: 20px;\n height: 100%;\n padding: 0px 5px;\n}\n\n.yt-fixed-bundle-plus-sign {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-plus-sign span {\n display: flex;\n justify-content: center;\n width: 24px;\n height: 22px;\n align-items: center;\n padding-bottom: 2px;\n background-color: #f2f2f2;\n color: black;\n border-radius: 2px;\n font-size: 20px;\n font-weight: bold;\n}\n\n.yt-fixed-bundle-price-section {\n display: flex;\n flex-direction: column;\n margin-top: 20px;\n width: 1000px;\n}\n\n.yt-fixed-bundle-subtotal {\n font-size: 13px;\n font-weight: 400 !important;\n}\n\n.yt-fixed-bundle-subtotal-amount {\n font-weight: 600;\n font-size: 13px;\n}\n\n.yt-fixed-bundle-deal-price-container {\n display: flex;\n justify-content: center;\n align-items: center;\n margin-bottom: 12px;\n gap: 8px;\n margin-top: 3px;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-deal-price {\n font-size: 16px;\n font-weight: 600;\n}\n\n.yt-fixed-bundle-extra-savings {\n font-size: 12px;\n color: #f6f8f7;\n padding: 4px 8px;\n background-color: #d3122a;\n border-radius: 2px;\n font-weight: 700 !important;\n}\n\n.yt-fixed-bundle-add-to-cart-button {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background-color: #8b5cf6;\n border: none;\n padding: 8px 0px;\n font-size: 16px;\n font-weight: 500 !important;\n cursor: pointer;\n width: 100%;\n}\n\n.yt-fixed-bundle-add-to-cart-button:disabled,\n.yt-fixed-bundle-add-to-cart-button[disabled] {\n color: #7d7d7d;\n cursor: default;\n}\n\n.yt-fixed-bundle-product-card.horizontal {\n max-width: 100%;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-product-card.horizontal:hover {\n transform: none;\n}\n\n.yt-fixed-bundle-product-list.horizontal {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n}\n\n.yt-product-main.horizontal {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-image-container.horizontal {\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n width: 30%;\n}\n\n.yt-fixed-bundle-product-image.horizontal {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n user-select: none;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop.horizontal {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile.horizontal {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop.horizontal {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-product-details.horizontal {\n padding-left: 0px;\n}\n\n.yt-fixed-bundle-product-price.horizontal {\n margin-bottom: 0px;\n}\n\n@media (min-width: 100px) {\n @container (width > 100px) {\n .yt-fixed-bundle-fixed-bundle {\n padding: 40px;\n }\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: flex;\n width: 100%;\n bottom: 6px;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n display: none;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n }\n .yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n }\n .yt-fixed-bundle-variant-select {\n margin: 0px 4px;\n }\n .yt-fixed-bundle-select-icon {\n right: 4px;\n }\n .yt-fixed-bundle-bundle-title {\n font-size: 32px;\n }\n .yt-fixed-bundle-bundle-subtitle {\n font-size: 20px;\n }\n .yt-fixed-bundle-bundle-content {\n flex-direction: column;\n justify-content: space-between;\n align-items: flex-start;\n }\n .yt-fixed-bundle-product-list {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n }\n .yt-fixed-bundle-product-card {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n text-align: center;\n }\n .yt-fixed-bundle-product-image-container {\n width: 100%;\n height: 100%;\n margin-right: 0;\n margin-bottom: 12px;\n justify-content: center;\n position: relative;\n }\n .yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n }\n .yt-fixed-bundle-product-image {\n height: 230px;\n width: 100%;\n aspect-ratio: 1;\n align-self: center;\n }\n .yt-fixed-bundle-plus-sign {\n align-self: center;\n margin-left: 0;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n margin-top: 32px;\n align-items: center;\n justify-content: center;\n text-align: center;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 10px;\n }\n .yt-fixed-bundle-subtotal {\n font-size: 15px;\n }\n .yt-fixed-bundle-subtotal-amount {\n font-size: 15px;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n top: 8px;\n left: 10px;\n height: auto;\n display: flex;\n align-items: center;\n }\n .yt-fixed-bundle-deal-price {\n font-size: 24px;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 13px;\n padding: 4px 8px;\n }\n .yt-fixed-bundle-add-to-cart-button {\n font-size: 20px;\n padding: 10px 0px;\n width: 100%;\n }\n .yt-product-main {\n width: 29%;\n }\n .yt-fixed-bundle-product-card:hover {\n transform: translateY(-5px);\n box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.1411764706);\n }\n }\n}\n.yt-product-main {\n display: flex;\n position: relative;\n}\n\n/* Container query */\n@container (max-width: 100px) {\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n }\n .yt-product-main {\n width: 100%;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n bottom: 6px;\n }\n .yt-fixed-bundle-product-image {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n .yt-fixed-bundle-variant-select-wrapper {\n position: relative;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n }\n .yt-fixed-bundle-product-card {\n max-width: 100%;\n flex-direction: row;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n }\n}\n.yt-product-card-transition {\n opacity: 0;\n transform: translateY(20px);\n transition: transform 0.6s ease, box-shadow 0.6s ease;\n}\n\n.yt-product-card-transition-up {\n opacity: 0;\n transform: translateY(-20px);\n transition: opacity 0.6s ease, transform 0.6s ease;\n}\n\n.yt-product-card-transition-active {\n opacity: 1;\n transform: translateY(0);\n}\n\n.yt-description-content img,\n.yt-collection-bundle-modal-description img,\n.yt-collection-bundle-modal-description iframe {\n max-width: 100%;\n height: auto;\n display: block;\n margin: 0 auto 15px;\n border-radius: 7px;\n}\n\n.yt-description-content,\n.yt-collection-bundle-modal-description {\n text-align: left;\n overflow-wrap: break-word;\n}');const Au=x.div`
|
|
2873
2873
|
display: flex;
|
|
2874
2874
|
flex-direction: row;
|
|
2875
2875
|
height: 100%;
|
|
@@ -28,9 +28,7 @@ export declare const PriceContainer: import("styled-components/dist/types").ISty
|
|
|
28
28
|
export declare const AddToBundleWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
29
29
|
borderRadius: string;
|
|
30
30
|
}>> & string;
|
|
31
|
-
export declare const AddedButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<
|
|
32
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
33
|
-
}, {
|
|
31
|
+
export declare const AddedButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>, {
|
|
34
32
|
borderRadius: string;
|
|
35
33
|
}>> & string;
|
|
36
34
|
export declare const AddedButtonText: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
package/dist/esm/types/components/BundleBlock/BundleBuilderTracker/bundleBuilderTracker.style.d.ts
CHANGED
|
@@ -30,9 +30,7 @@ export declare const ItemImageBox: import("styled-components/dist/types").IStyle
|
|
|
30
30
|
export declare const QuantityBadge: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
31
31
|
borderRadius: string;
|
|
32
32
|
}>> & string;
|
|
33
|
-
export declare const RemoveButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
|
34
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
35
|
-
}>, never>, never>> & string;
|
|
33
|
+
export declare const RemoveButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>>, never>, never>> & string;
|
|
36
34
|
export declare const DetailedItemContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
37
35
|
borderRadius: string;
|
|
38
36
|
}>> & string;
|
|
@@ -48,9 +48,7 @@ export declare const PriceLine: import("styled-components/dist/types").IStyledCo
|
|
|
48
48
|
export declare const SummaryBlock: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
49
49
|
export declare const AddBundleButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, never>> & string;
|
|
50
50
|
export declare const PlusWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
51
|
-
export declare const PlusWrapperWithHiding: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<
|
|
52
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
53
|
-
}, never>> & string;
|
|
51
|
+
export declare const PlusWrapperWithHiding: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, never>> & string;
|
|
54
52
|
export declare const PlusSeparator: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
55
53
|
export declare const DropdownContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
56
54
|
export declare const DropdownHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
@@ -74,17 +72,13 @@ export declare const OptionRow: import("styled-components/dist/types").IStyledCo
|
|
|
74
72
|
export declare const OptionLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, never>> & string;
|
|
75
73
|
export declare const CheckboxContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
76
74
|
export declare const HiddenCheckbox: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, never>> & string;
|
|
77
|
-
export declare const StyledCheckboxLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>,
|
|
78
|
-
ref?: ((instance: HTMLLabelElement | null) => void) | import("react").RefObject<HTMLLabelElement> | null | undefined;
|
|
79
|
-
}>, never>, {
|
|
75
|
+
export declare const StyledCheckboxLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, import("react").DetailedHTMLProps<import("react").LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>>, never>, {
|
|
80
76
|
isChecked: boolean;
|
|
81
77
|
borderColor?: string | undefined;
|
|
82
78
|
borderRadius?: string | undefined;
|
|
83
79
|
backgroundColor?: string | undefined;
|
|
84
80
|
}>> & string;
|
|
85
81
|
export declare const HorizontalCheckboxWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
86
|
-
export declare const VerticalCheckboxWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<
|
|
87
|
-
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
88
|
-
}, {
|
|
82
|
+
export declare const VerticalCheckboxWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>, {
|
|
89
83
|
isImage?: boolean | undefined;
|
|
90
84
|
}>> & string;
|
|
@@ -61,9 +61,7 @@ export declare const RadioWrapper: import("styled-components/dist/types").IStyle
|
|
|
61
61
|
isActive?: boolean | undefined;
|
|
62
62
|
accentColor?: string | undefined;
|
|
63
63
|
}>> & string;
|
|
64
|
-
export declare const HiddenRadio: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>,
|
|
65
|
-
ref?: ((instance: HTMLInputElement | null) => void) | import("react").RefObject<HTMLInputElement> | null | undefined;
|
|
66
|
-
}>, never>, never>> & string;
|
|
64
|
+
export declare const HiddenRadio: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("styled-components").FastOmit<import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>>, never>, never>> & string;
|
|
67
65
|
export declare const CustomRadio: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
68
66
|
accentColor?: string | undefined;
|
|
69
67
|
}>> & string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React, { Component, ReactNode } from 'react';
|
|
2
|
+
interface FreebieClaimErrorBoundaryProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
fallback?: ReactNode;
|
|
5
|
+
showErrorUI?: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface FreebieClaimErrorBoundaryState {
|
|
8
|
+
hasError: boolean;
|
|
9
|
+
error: Error | null;
|
|
10
|
+
errorInfo: React.ErrorInfo | null;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Error Boundary for Freebie Claim components
|
|
14
|
+
* Catches React rendering errors and logs them with detailed context
|
|
15
|
+
* Prevents entire cart from crashing when freebie component has errors
|
|
16
|
+
*/
|
|
17
|
+
declare class FreebieClaimErrorBoundary extends Component<FreebieClaimErrorBoundaryProps, FreebieClaimErrorBoundaryState> {
|
|
18
|
+
constructor(props: FreebieClaimErrorBoundaryProps);
|
|
19
|
+
static getDerivedStateFromError(error: Error): Partial<FreebieClaimErrorBoundaryState>;
|
|
20
|
+
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
|
21
|
+
render(): ReactNode;
|
|
22
|
+
}
|
|
23
|
+
export default FreebieClaimErrorBoundary;
|
|
24
|
+
/**
|
|
25
|
+
* HOC to wrap a component with FreebieClaimErrorBoundary
|
|
26
|
+
* Usage: const SafeComponent = withFreebieErrorBoundary(MyComponent);
|
|
27
|
+
*/
|
|
28
|
+
export declare function withFreebieErrorBoundary<P extends object>(Component: React.ComponentType<P>, showErrorUI?: boolean): React.FC<P>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized error logging utility for Freebie Claim components
|
|
3
|
+
* Provides detailed error logging with context to help debug issues across stores
|
|
4
|
+
*/
|
|
5
|
+
export declare enum FreebieErrorSeverity {
|
|
6
|
+
WARNING = "WARNING",
|
|
7
|
+
ERROR = "ERROR",
|
|
8
|
+
CRITICAL = "CRITICAL"
|
|
9
|
+
}
|
|
10
|
+
export interface FreebieErrorContext {
|
|
11
|
+
component?: string;
|
|
12
|
+
productId?: string;
|
|
13
|
+
productTitle?: string;
|
|
14
|
+
variantId?: string;
|
|
15
|
+
checkpointId?: number;
|
|
16
|
+
storeData?: any;
|
|
17
|
+
additionalData?: any;
|
|
18
|
+
}
|
|
19
|
+
export interface FreebieError {
|
|
20
|
+
severity: FreebieErrorSeverity;
|
|
21
|
+
message: string;
|
|
22
|
+
context: FreebieErrorContext;
|
|
23
|
+
timestamp: string;
|
|
24
|
+
}
|
|
25
|
+
declare class FreebieErrorLogger {
|
|
26
|
+
private errors;
|
|
27
|
+
private maxErrors;
|
|
28
|
+
/**
|
|
29
|
+
* Log an error with context
|
|
30
|
+
*/
|
|
31
|
+
log(severity: FreebieErrorSeverity, message: string, context?: FreebieErrorContext): void;
|
|
32
|
+
/**
|
|
33
|
+
* Log a warning
|
|
34
|
+
*/
|
|
35
|
+
warn(message: string, context?: FreebieErrorContext): void;
|
|
36
|
+
/**
|
|
37
|
+
* Log an error
|
|
38
|
+
*/
|
|
39
|
+
error(message: string, context?: FreebieErrorContext): void;
|
|
40
|
+
/**
|
|
41
|
+
* Log a critical error
|
|
42
|
+
*/
|
|
43
|
+
critical(message: string, context?: FreebieErrorContext): void;
|
|
44
|
+
/**
|
|
45
|
+
* Get all logged errors
|
|
46
|
+
*/
|
|
47
|
+
getErrors(): FreebieError[];
|
|
48
|
+
/**
|
|
49
|
+
* Get errors by severity
|
|
50
|
+
*/
|
|
51
|
+
getErrorsBySeverity(severity: FreebieErrorSeverity): FreebieError[];
|
|
52
|
+
/**
|
|
53
|
+
* Clear all errors
|
|
54
|
+
*/
|
|
55
|
+
clearErrors(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Export errors as JSON for debugging
|
|
58
|
+
*/
|
|
59
|
+
exportErrors(): string;
|
|
60
|
+
}
|
|
61
|
+
export declare const freebieErrorLogger: FreebieErrorLogger;
|
|
62
|
+
export declare const logMissingProp: (component: string, propName: string, additionalContext?: any) => void;
|
|
63
|
+
export declare const logInvalidData: (component: string, dataType: string, issue: string, data?: any) => void;
|
|
64
|
+
export declare const logProductError: (component: string, message: string, productId?: string, productTitle?: string, additionalData?: any) => void;
|
|
65
|
+
export declare const logVariantError: (component: string, message: string, productId?: string, variantId?: string, additionalData?: any) => void;
|
|
66
|
+
export declare const logCheckpointError: (component: string, message: string, checkpointId?: number, additionalData?: any) => void;
|
|
67
|
+
export declare const logWarning: (component: string, message: string, context?: FreebieErrorContext) => void;
|
|
68
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation utilities for Freebie Claim components
|
|
3
|
+
* Validates product data, configuration, and required props
|
|
4
|
+
*/
|
|
5
|
+
export interface ValidationResult {
|
|
6
|
+
isValid: boolean;
|
|
7
|
+
errors: string[];
|
|
8
|
+
warnings: string[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Validate that required props are present
|
|
12
|
+
*/
|
|
13
|
+
export declare const validateRequiredProps: (component: string, props: {
|
|
14
|
+
freebieProductsInCart?: any[];
|
|
15
|
+
addFreebieToCart?: Function;
|
|
16
|
+
freebiesInCart?: string[];
|
|
17
|
+
}) => ValidationResult;
|
|
18
|
+
/**
|
|
19
|
+
* Validate product data structure
|
|
20
|
+
*/
|
|
21
|
+
export declare const validateProductData: (component: string, product: any, index?: number) => ValidationResult;
|
|
22
|
+
/**
|
|
23
|
+
* Validate all products in cart
|
|
24
|
+
*/
|
|
25
|
+
export declare const validateAllProducts: (component: string, products: any[]) => ValidationResult;
|
|
26
|
+
/**
|
|
27
|
+
* Validate variant data
|
|
28
|
+
*/
|
|
29
|
+
export declare const validateVariantData: (component: string, variant: any, productId?: string) => ValidationResult;
|
|
30
|
+
/**
|
|
31
|
+
* Validate checkpoint data
|
|
32
|
+
*/
|
|
33
|
+
export declare const validateCheckpoint: (component: string, checkpoint: any) => ValidationResult;
|
|
34
|
+
/**
|
|
35
|
+
* Validate freebie claim configuration
|
|
36
|
+
*/
|
|
37
|
+
export declare const validateFreebieClaimData: (component: string, freebieClaimData: any) => ValidationResult;
|
|
38
|
+
/**
|
|
39
|
+
* Validate that products match inventory requirements
|
|
40
|
+
*/
|
|
41
|
+
export declare const validateInventoryQuantity: (component: string, product: any, shouldCheckInventoryQuantity: boolean) => ValidationResult;
|
|
42
|
+
/**
|
|
43
|
+
* Log validation summary
|
|
44
|
+
*/
|
|
45
|
+
export declare const logValidationSummary: (component: string, validationResults: ValidationResult[]) => void;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized error logging utility for Freebie Claim components
|
|
3
|
+
* Provides detailed error logging with context to help debug issues across stores
|
|
4
|
+
*/
|
|
5
|
+
export declare enum FreebieErrorSeverity {
|
|
6
|
+
WARNING = "WARNING",
|
|
7
|
+
ERROR = "ERROR",
|
|
8
|
+
CRITICAL = "CRITICAL"
|
|
9
|
+
}
|
|
10
|
+
export interface FreebieErrorContext {
|
|
11
|
+
component?: string;
|
|
12
|
+
productId?: string;
|
|
13
|
+
productTitle?: string;
|
|
14
|
+
variantId?: string;
|
|
15
|
+
checkpointId?: number;
|
|
16
|
+
storeData?: any;
|
|
17
|
+
additionalData?: any;
|
|
18
|
+
}
|
|
19
|
+
export interface FreebieError {
|
|
20
|
+
severity: FreebieErrorSeverity;
|
|
21
|
+
message: string;
|
|
22
|
+
context: FreebieErrorContext;
|
|
23
|
+
timestamp: string;
|
|
24
|
+
}
|
|
25
|
+
declare class FreebieErrorLogger {
|
|
26
|
+
private errors;
|
|
27
|
+
private maxErrors;
|
|
28
|
+
/**
|
|
29
|
+
* Log an error with context
|
|
30
|
+
*/
|
|
31
|
+
log(severity: FreebieErrorSeverity, message: string, context?: FreebieErrorContext): void;
|
|
32
|
+
/**
|
|
33
|
+
* Log a warning
|
|
34
|
+
*/
|
|
35
|
+
warn(message: string, context?: FreebieErrorContext): void;
|
|
36
|
+
/**
|
|
37
|
+
* Log an error
|
|
38
|
+
*/
|
|
39
|
+
error(message: string, context?: FreebieErrorContext): void;
|
|
40
|
+
/**
|
|
41
|
+
* Log a critical error
|
|
42
|
+
*/
|
|
43
|
+
critical(message: string, context?: FreebieErrorContext): void;
|
|
44
|
+
/**
|
|
45
|
+
* Get all logged errors
|
|
46
|
+
*/
|
|
47
|
+
getErrors(): FreebieError[];
|
|
48
|
+
/**
|
|
49
|
+
* Get errors by severity
|
|
50
|
+
*/
|
|
51
|
+
getErrorsBySeverity(severity: FreebieErrorSeverity): FreebieError[];
|
|
52
|
+
/**
|
|
53
|
+
* Clear all errors
|
|
54
|
+
*/
|
|
55
|
+
clearErrors(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Export errors as JSON for debugging
|
|
58
|
+
*/
|
|
59
|
+
exportErrors(): string;
|
|
60
|
+
}
|
|
61
|
+
export declare const freebieErrorLogger: FreebieErrorLogger;
|
|
62
|
+
export declare const logMissingProp: (component: string, propName: string, additionalContext?: any) => void;
|
|
63
|
+
export declare const logInvalidData: (component: string, dataType: string, issue: string, data?: any) => void;
|
|
64
|
+
export declare const logProductError: (component: string, message: string, productId?: string, productTitle?: string, additionalData?: any) => void;
|
|
65
|
+
export declare const logVariantError: (component: string, message: string, productId?: string, variantId?: string, additionalData?: any) => void;
|
|
66
|
+
export declare const logCheckpointError: (component: string, message: string, checkpointId?: number, additionalData?: any) => void;
|
|
67
|
+
export declare const logWarning: (component: string, message: string, context?: FreebieErrorContext) => void;
|
|
68
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation utilities for Freebie Claim components
|
|
3
|
+
* Validates product data, configuration, and required props
|
|
4
|
+
*/
|
|
5
|
+
export interface ValidationResult {
|
|
6
|
+
isValid: boolean;
|
|
7
|
+
errors: string[];
|
|
8
|
+
warnings: string[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Validate that required props are present
|
|
12
|
+
*/
|
|
13
|
+
export declare const validateRequiredProps: (component: string, props: {
|
|
14
|
+
freebieProductsInCart?: any[];
|
|
15
|
+
addFreebieToCart?: Function;
|
|
16
|
+
freebiesInCart?: string[];
|
|
17
|
+
}) => ValidationResult;
|
|
18
|
+
/**
|
|
19
|
+
* Validate product data structure
|
|
20
|
+
*/
|
|
21
|
+
export declare const validateProductData: (component: string, product: any, index?: number) => ValidationResult;
|
|
22
|
+
/**
|
|
23
|
+
* Validate all products in cart
|
|
24
|
+
*/
|
|
25
|
+
export declare const validateAllProducts: (component: string, products: any[]) => ValidationResult;
|
|
26
|
+
/**
|
|
27
|
+
* Validate variant data
|
|
28
|
+
*/
|
|
29
|
+
export declare const validateVariantData: (component: string, variant: any, productId?: string) => ValidationResult;
|
|
30
|
+
/**
|
|
31
|
+
* Validate checkpoint data
|
|
32
|
+
*/
|
|
33
|
+
export declare const validateCheckpoint: (component: string, checkpoint: any) => ValidationResult;
|
|
34
|
+
/**
|
|
35
|
+
* Validate freebie claim configuration
|
|
36
|
+
*/
|
|
37
|
+
export declare const validateFreebieClaimData: (component: string, freebieClaimData: any) => ValidationResult;
|
|
38
|
+
/**
|
|
39
|
+
* Validate that products match inventory requirements
|
|
40
|
+
*/
|
|
41
|
+
export declare const validateInventoryQuantity: (component: string, product: any, shouldCheckInventoryQuantity: boolean) => ValidationResult;
|
|
42
|
+
/**
|
|
43
|
+
* Log validation summary
|
|
44
|
+
*/
|
|
45
|
+
export declare const logValidationSummary: (component: string, validationResults: ValidationResult[]) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yt-uikit",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.15-fix-cart-state.0",
|
|
4
4
|
"description": "YourToken UI Kit",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"rollup": "tsc && rollup -c",
|
|
@@ -92,4 +92,4 @@
|
|
|
92
92
|
"rollup-plugin-terser": "^7.0.2",
|
|
93
93
|
"web-vitals": "^3.5.1"
|
|
94
94
|
}
|
|
95
|
-
}
|
|
95
|
+
}
|