yt-uikit 0.8.29-shadow-dom.3 → 0.8.29-shadow-dom.4

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/index.js CHANGED
@@ -2593,7 +2593,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
2593
2593
  &:hover {
2594
2594
  transform: rotate(360deg);
2595
2595
  }
2596
- `,yu=({isOpen:e,setIsOpen:n,backgroundColor:r="white",backgroundSubdued:a="#3947821F",tertiaryColor:i="#067D431A",tertiaryTextColor:d="#000000",exploreCTAColor:s,checkoutFontSize:p,cartTitle:u="My Cart",emptyCartTitle:m,emptyCartDescription:f,emptyCartButtons:g,removeCartItem:x,handleIncrement:h,handleDecrement:y,addCartItem:b,isUserSignedIn:v,showBundle:w,bundleProducts:C,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:S,rewardMultiplier:T,redemptionMultiplier:$,discountApplied:B,removeDiscount:z,applyDiscount:I,checkoutFunction:D,joinNowFunction:N,guestLoyaltyPercentage:_,isDev:P,recProductsList:O,showMultiStepProgressBar:F,cartCheckpoints:A,redemptionRate:M,pointsRewardRate:R,showCartLevelAltPay:L,exploreCtaRedirectLink:j,discountAmountApplied:V,minimumCartValue:W,discountInCheckoutButton:H,isStickyCheckout:q,handleCheckpointCrossed:U,customCartProgressBarCriteria:Q,checkoutButtonColor:Y="#252E69",ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,productRecsCtaButtonText:J,productRecsTitleText:ee,emptyProductRecsTitleText:te,showProductRecsOnDesktop:ne,showProductRecsOnMobile:re,themeColor:oe,themeTextColor:ae,companyName:ie,gstNumber:le,showGSTOption:ce,applyGSTToCart:de,showMOVForProgressTiers:se,freeProduct:pe,showLoyaltyCta:ue=!1,freeProductAdjustedCartTotal:me,minimumOrderValueToAvailDiscount:fe,signinCTAButtonVisible:ge,cartSigninCTAMainText:xe,applyNoteToCart:he,note:ye,showNoteOption:be,inlineCartOfferInfoText:ve,inlineCartOfferInfoRedirectLink:we,cartOfferTermsAndConditionsText:Ce,showEditOptionOnProducts:Ee,onSetLoading:ke,showVariantSelectionDropdownInProductRecs:Se,originalCartSubtotal:Te,freebieProductsInCart:$e,showFreebieClaim:Be,addFreebieToCart:ze,freebiesInCart:Ie,effectiveQuantityForProgressBar:De,productPercentageOffMapping:Ne,removeFreebieFromCart:_e,postalCodeList:Pe,enableGeoLocationDeliveryRestriction:Oe=!1,getProductDetailsByVariantId:Fe,applyPostalCodeAndDeliverySlotToCart:Ae,showDeleteOnFreebies:Me,freebieCouponTemplates:Re,freebieFlowCheckpoints:Le,freebieClaimData:je,postalCodeBasedItemTrackingParameter:Ve,enableSlotPicker:We,deliveryHeaderTitle:He,deliveryAvailableText:qe,deliveryNotAvailableText:Ue,giftWrapSetupData:Qe,giftWrapProductDetail:Ye,progressBarFreeProductIconType:Ge,enableCustomCartOnCartPage:Ze,isCartPage:Xe,showCartTimer:Ke,showFreebieMilestone:Je,freebieMilestoneData:et,cartTimerInMinutes:tt,cartTimerCustomText:nt,productRecsCardLayout:rt,productRecsCardListVariant:ot,imageAspectSelector:at,cartComponentsCornerType:it,cartComponentsCornerRadius:lt,cartOffersCarousalData:ct,gstSectionCustomizationData:dt,noteSectionTitle:ut,checkoutSectionMessage:mt,checkoutSectionMessageDisplay:ft,showVariantSelectionDropdownInProductClaim:gt,loyaltyDiscount:xt,brandTokenName:yt,showDiscountOnMRP:vt,switchWidthVariant:wt,prefixMessageText:Ct,suffixMessageText:Et,successMessageText:kt,toggleDecimal:St,cartOffersCarouselHeight:Tt,disableCheckoutButton:$t,showEmptyCartRecommendations:Bt=!1,checkoutButtonBottomSpacing:zt,showPoweredByBadge:It,applyCouponCode:Dt,showApplyCoupon:Nt,enableConfetti:_t,checkoutSectionMessageRedirectLink:Pt,showCheckoutButtonPaymentIcons:Ot})=>{const Ft=pn(fn),At=pn(En),[Mt,Rt]=c(!1),[Lt,jt]=c(!1),[Vt,Wt]=c(!0),{setLoading:Ht}=kn();t.useEffect(()=>{ke&&ke(Ht)},[ke]);const qt=o(!1),Ut=o(null),Qt=o(null);l(()=>{const t=()=>{n(!1)};return e?(qt.current||(Ut.current=window.history.state,Qt.current=window.location.href,window.history.pushState({ytCustomCartDrawer:"open"},"")),window.addEventListener("popstate",t),qt.current=!0):(qt.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.replaceState(Ut.current,"",Qt.current??window.location.href),qt.current=!1),()=>{window.removeEventListener("popstate",t)}},[e,n]);const[Yt,Gt]=c(!1);l(()=>{const t=document.querySelector("body");t&&(Ze&&Xe?t.classList.remove("drawer-open"):!Yt&&e?t.classList.add("drawer-open"):t.classList.remove("drawer-open"))},[e,Ze,Xe,Yt]),l(()=>{function e(){const e=window.innerWidth;Gt(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const Zt=Ft?.items?.reduce((e,t)=>e+t?.quantity,0);l(()=>{const e=()=>{Rt(!0),window.setTimeout(()=>Rt(!1),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)},[]);const[Xt,Kt]=c("normal"),[Jt,en]=c("normal"),[tn,nn]=c("auto");l(()=>{CSS.supports("font-weight","500")?Kt("500"):CSS.supports("font-weight","400")?Kt("400"):CSS.supports("font-weight","600")&&Kt("600"),CSS.supports("font-weight","400")?en("400"):CSS.supports("font-weight","300")?en("300"):CSS.supports("font-weight","200")&&en("200"),CSS.supports("width","-webkit-fill-available")?nn("-webkit-fill-available"):CSS.supports("width","-moz-available")&&nn("-moz-available")},[]);const[rn]=mn(bn),[on]=mn(Cn),[an]=mn(wn);l(()=>{Wt(!("all-products"!==Ve&&("specific-tags"!==Ve||rn.isPostalCodeValid||We)&&("specific-tags"!==Ve||rn.isPostalCodeValid||on||!We)&&("specific-tags"===Ve&&"standard"===an||Lt&&(We?rn.isPostalCodeValid&&on:rn.isPostalCodeValid))))},[rn.isPostalCodeValid,on,Lt,Ve,We]),mn(Sn);const[ln,cn]=c(!0);l(()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&cn(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&cn(!1)},[]);const dn=new Date("2024-11-01");return In(Ft?.items_subtotal_price,Ft?.currency),t.createElement(fu,{className:"yt-cart-drawer",$isDev:P,$isOpen:e,$backgroundColor:r,$enableCustomCartOnCartPage:Ze,$isCartPage:Xe,$isLargeScreen:Yt,$switchWidthVariant:wt,style:{"--yt-cart-font-weight":Xt,"--yt-cart-product-rec-price-font-weight":Jt,"--yt-cart-custom-fill-width":tn}},At.cartLoading?t.createElement("div",{style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},At.showLoader&&!At.showSkeletonLoader&&t.createElement("div",{className:"loader"},"‎")):t.createElement(t.Fragment,null),t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-cart-drawer-content",style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},t.createElement("div",null,t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",margin:"1rem 1rem 0px"}},t.createElement(xu,{className:"yt-cart-title-container",style:{fontWeight:"var(--yt-cart-font-weight, bold)",color:X,fontSize:"16px"}},t.createElement("span",{style:{whiteSpace:"nowrap",flexShrink:0}},u),Ft?.item_count>0&&L&&!(ue&&L)&&R>0&&t.createElement(pu,{pointsRewardRate:R,loyaltyIcon:k,brandTokenName:yt,themeColor:oe,themeTextColor:ae,rewardMultiplier:T}),Zt>0&&t.createElement(gu,{$backgroundSubdued:a},Zt)),t.createElement("div",{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(Ze&&Xe)&&t.createElement(hu,{className:"yt-cart-close-button",$backgroundColor:a||"#cacaca30",onClick:()=>n(!e)},t.createElement(bt,{style:{height:"auto",width:"auto",color:X},fontSize:24,cursor:"pointer",onClick:()=>{n(!e)}})))),At&&t.createElement(lu,{$themeColor:oe,show:At.showLoader}),ct?.enableCartOffersCarousel&&t.createElement(ru,{themeColor:oe,cartOffersCarousalData:ct,cartOffersCarouselHeight:Tt,cartData:Ft}),Ke&&ln&&Ft?.item_count?t.createElement(Fp,{minutes:tt,customText:nt,onTimerComplete:()=>{cn(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,Mt&&_t&&t.createElement(ao,{particleCount:50,spread:90,origin:{y:.3}}),ve?t.createElement(Ql,{inlineCartOfferInfoText:ve,inlineCartOfferInfoRedirectLink:we,themeColor:oe,tooltipText:Ce,themeTextColor:ae}):null),F&&Ft?.items_subtotal_price>0&&Ft?.currency&&!!A&&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?.[Kr(r)]&&("minimum_order_value"!==r||1!==e?.[Kr(r)])).some((e,i)=>Jr(e,i,a,o,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:r,checkpoints:a}).progressPercentage>0)}(A,In(void 0!==Te?Te:Ft?.items_subtotal_price,Ft.currency),void 0===De?Ft?.item_count:De,Q??"minimum_order_value",Ft?.item_count)&&t.createElement(t.Fragment,null,t.createElement(Fo,{customCartProgressBarCriteria:Q??"minimum_order_value",handleCheckpointCrossed:U,checkpoints:A,effectiveQuantityForProgressBar:void 0===De?Ft?.item_count:De,currentCartAmount:In(void 0!==Te?Te:Ft?.items_subtotal_price,Ft.currency),themeColor:oe,themeTextColor:ae,primaryTextColor:X,secondaryTextColor:K,showMOVForProgressTiers:se,progressBarFreeProductIconType:Ge,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,prefixMessageText:Ct,suffixMessageText:Et,successMessageText:kt,enableConfetti:_t})),Ft?.item_count>0&&t.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),0===Ft?.items?.length&&0===Ft?.item_count&&!1===At?.showSkeletonLoader?t.createElement(Vo,{showLoyaltyCta:ue,joinNowFunction:N,emptyCartTitle:m,emptyCartDescription:f,exploreCTAColor:s,isUserSignedIn:v,exploreCtaRedirectLink:j,themeColor:oe,emptyCartButtons:g,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,themeTextColor:ae,recProductsList:O,addCartItem:b,productRecsCtaButtonText:J,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,showVariantSelectionDropdownInProductRecs:Se,emptyProductRecsTitleText:te,backgroundSubdued:a,showEmptyCartRecommendations:Bt,tertiaryColor:i,tertiaryTextColor:d}):t.createElement("div",{style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},t.createElement(wi,{isDev:P,themeColor:oe,handleDecrement:y,handleIncrement:h,removeCartItem:x,addCartItem:b,primaryTextColor:X,secondaryTextColor:K,freeProduct:pe,themeTextColor:ae,showEditOptionOnProducts:Ee,productPercentageOffMapping:Ne,removeFreebieFromCart:_e,showDeleteOnFreebies:Me,freebieCouponTemplates:Re??[],freebieFlowCheckpoints:Le??[],cartCheckpoints:A,freeProductAdjustedCartTotal:me,imageAspectSelector:at,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,giftWrapVariantId:Ye?.variants?.nodes[0]?.id,giftWrapProductId:Qe?.giftProductId,showGiftWrapAsLineItem:Qe?.showGiftWrapAsLineItem,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:d,backgroundColor:r,showDiscountOnMRP:vt,checkoutSectionMessage:mt,checkoutSectionMessageRedirectLink:Pt,showFreebieMilestone:Je,freebieMilestoneData:et}),Yt&&ne&&!!O&&O?.length>0&&Ft?.item_count>0&&b&&t.createElement(Nr,{addCartItem:b,products:O,productRecsCtaButtonText:J,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,productRecsTitleText:ee,themeColor:oe,primaryTextColor:X,secondaryTextColor:K,showVariantSelectionDropdownInProductRecs:Se,cardLayout:rt,variant:ot,cartComponentsCornerType:it,cartComponentsCornerRadius:lt,backgroundSubdued:a,backgroundColor:r,tertiaryColor:i,tertiaryTextColor:d}),!Yt&&re&&!!O&&O?.length>0&&Ft?.item_count>0&&b&&t.createElement(Nr,{addCartItem:b,products:O,productRecsCtaButtonText:J,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,productRecsTitleText:ee,themeColor:oe,primaryTextColor:X,secondaryTextColor:K,showVariantSelectionDropdownInProductRecs:Se,cardLayout:rt,variant:ot,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:d}),"devlhok.myshopify.com"===window.ytapp?.storeDomain&&t.createElement(mu,{showDiscountOnMRP:vt,cartCheckpoints:A,toggleDecimal:St,primaryTextColor:X,discountApplied:B,showPoweredByBadge:It})),t.createElement(ia,null,Ft?.item_count>0&&w&&C&&t.createElement(Ei,{bundleProducts:C}),ce&&!!de&&Ft?.item_count>0&&t.createElement(Fi,{companyName:ie,gstNumber:le,themeColor:oe,iconColor:dt?.iconColor,showIcon:dt?.showIcon,backgroundColor:dt?.backgroundColor,textColor:dt?.textColor,title:dt?.title}),!!Ft&&Ft?.item_count>0&&!!ze&&!!$e&&!!Ie&&$e.length>0&&t.createElement(Ul,{freebieProductsInCart:$e,themeColor:oe,themeTextColor:ae,primaryTextColor:X,addFreebieToCart:ze,freebiesInCart:Ie,imageAspectSelector:at,freebieCouponTemplates:Re,freebieClaimData:je,cartCheckpoints:A,isCartDrawerOpen:e}),Oe&&(Pe?.length??0)>0&&!!Ae&&Ft?.item_count>0&&t.createElement(Ai,null,t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>Wt(!Vt)},t.createElement("span",{style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",t.createElement(ht,null)),t.createElement(Mi,null,Vt?t.createElement(st,null):t.createElement(pt,null))),"all-products"===Ve&&Vt?t.createElement(Ep,{postalCodeList:Pe,themeColor:oe,themeTextColor:ae,enableSlotPicker:We,deliveryHeaderTitle:He,deliveryAvailableText:qe,deliveryNotAvailableText:Ue,disabledDates:dn}):Vt&&(Lt?t.createElement(Ep,{postalCodeList:Pe,themeColor:oe,themeTextColor:ae,enableSlotPicker:We,deliveryHeaderTitle:He,deliveryAvailableText:qe,deliveryNotAvailableText:Ue,disabledDates:dn}):t.createElement(kp,{postalCodeList:Pe,themeColor:oe,themeTextColor:ae,enableSlotPicker:We,disabledDates:dn}))),be&&!!he&&Ft?.item_count>0&&t.createElement(Li,{note:ye,noteSectionTitle:ut}),Qe?.showGiftWrapOption&&Ft?.item_count>0&&t.createElement(_p,{themeColor:oe,id:Qe?.giftProductId,detail:Ye,showPrice:Qe?.showPrice,errorText:Qe?.errorText,customText:Qe?.customText,showGiftIcon:Qe?.showGiftIcon,showProductImage:Qe?.showProductImage,addCartItem:b,removeCartItem:x}),Ft?.item_count>0&&Nt&&!ue&&Dt&&t.createElement(uu,{backgroundSubdued:a,themeColor:oe,themeTextColor:ae,primaryTextColor:X,cartComponentsCornerRadius:lt,applyCouponCode:Dt,removeDiscount:z,enableConfetti:_t}),Ft?.item_count>0&&t.createElement(t.Fragment,null,v||!ue||xt?!xt&&void 0!==E&&void 0!==S&&!!k&&ue&&!!I&&t.createElement($a,{themeColor:oe,applyDiscount:I,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:S,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,minimumOrderValueToAvailDiscount:fe,brandTokenName:yt,showCartLevelAltPay:L,redemptionMultiplier:$}):!!_&&!!N&&t.createElement(oa,{cartSigninCTAMainText:xe,signinCTAButtonVisible:ge,themeColor:oe,joinNowFunction:N,guestLoyaltyPercentage:_,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,showCartLevelAltPay:L})),Ft?.item_count>0&&!!xt&&!!z&&ue&&xt&&void 0!==S&&t.createElement(Ea,{themeColor:oe,removeDiscount:z,loyaltyDiscount:xt,isDev:P,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,pointsToBeUsed:S,brandTokenName:yt,showCartLevelAltPay:L}),ue&&L&&M&&k&&Ft?.item_count>0&&t.createElement(du,{loyaltyIcon:k,backgroundSubdued:a,primaryTextColor:X,pointsRewardRate:R,rewardMultiplier:T}),ue&&Ft&&Ft.item_count>0&&!!fe&&fe>1&&t.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:oe??"#50D1AA",fontWeight:600,display:"flex",justifyContent:ge?"space-between":"center"}},"Minimum order value to use ",yt,":"," ",fe),Ft&&D&&Ft?.item_count>0&&t.createElement("div",null,t.createElement(Jo,{disableCheckoutButton:!!$t||At.cartLoading,discountApplied:B,checkoutFunction:D,checkoutButtonColor:Y,checkoutFontSize:p,discountInCheckoutButton:H,isStickyCheckout:q,discountAmountApplied:V,minimumCartValue:W,themeTextColor:ae,applyGSTToCart:de,showGSTOption:ce,applyNoteToCart:he,showNoteOption:be,enableGeoLocationDeliveryRestriction:Oe,applyPostalCodeAndDeliverySlotToCart:Ae,enableSlotPicker:We,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,checkoutSectionMessage:mt,checkoutSectionMessageDisplay:ft,checkoutSectionMessageRedirectLink:Pt,showDiscountOnMRP:vt,tertiaryColor:i,tertiaryTextColor:d,cartCheckpoints:A,toggleDecimal:St,checkoutButtonBottomSpacing:zt,showPoweredByBadge:It,showCheckoutButtonPaymentIcons:Ot,primaryTextColor:X,hideSubtotalAndBadge:"devlhok.myshopify.com"===window.ytapp?.storeDomain}))))))},bu=h.div`
2596
+ `,yu=({isOpen:e,setIsOpen:n,backgroundColor:r="white",backgroundSubdued:a="#3947821F",tertiaryColor:i="#067D431A",tertiaryTextColor:d="#000000",exploreCTAColor:s,checkoutFontSize:p,cartTitle:u="My Cart",emptyCartTitle:m,emptyCartDescription:f,emptyCartButtons:g,removeCartItem:x,handleIncrement:h,handleDecrement:y,addCartItem:b,isUserSignedIn:v,showBundle:w,bundleProducts:C,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:S,rewardMultiplier:T,redemptionMultiplier:$,discountApplied:B,removeDiscount:z,applyDiscount:I,checkoutFunction:D,joinNowFunction:N,guestLoyaltyPercentage:_,isDev:P,recProductsList:O,showMultiStepProgressBar:F,cartCheckpoints:A,redemptionRate:M,pointsRewardRate:R,showCartLevelAltPay:L,exploreCtaRedirectLink:j,discountAmountApplied:V,minimumCartValue:W,discountInCheckoutButton:H,isStickyCheckout:q,handleCheckpointCrossed:U,customCartProgressBarCriteria:Q,checkoutButtonColor:Y="#252E69",ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,productRecsCtaButtonText:J,productRecsTitleText:ee,emptyProductRecsTitleText:te,showProductRecsOnDesktop:ne,showProductRecsOnMobile:re,themeColor:oe,themeTextColor:ae,companyName:ie,gstNumber:le,showGSTOption:ce,applyGSTToCart:de,showMOVForProgressTiers:se,freeProduct:pe,showLoyaltyCta:ue=!1,freeProductAdjustedCartTotal:me,minimumOrderValueToAvailDiscount:fe,signinCTAButtonVisible:ge,cartSigninCTAMainText:xe,applyNoteToCart:he,note:ye,showNoteOption:be,inlineCartOfferInfoText:ve,inlineCartOfferInfoRedirectLink:we,cartOfferTermsAndConditionsText:Ce,showEditOptionOnProducts:Ee,onSetLoading:ke,showVariantSelectionDropdownInProductRecs:Se,originalCartSubtotal:Te,freebieProductsInCart:$e,showFreebieClaim:Be,addFreebieToCart:ze,freebiesInCart:Ie,effectiveQuantityForProgressBar:De,productPercentageOffMapping:Ne,removeFreebieFromCart:_e,postalCodeList:Pe,enableGeoLocationDeliveryRestriction:Oe=!1,getProductDetailsByVariantId:Fe,applyPostalCodeAndDeliverySlotToCart:Ae,showDeleteOnFreebies:Me,freebieCouponTemplates:Re,freebieFlowCheckpoints:Le,freebieClaimData:je,postalCodeBasedItemTrackingParameter:Ve,enableSlotPicker:We,deliveryHeaderTitle:He,deliveryAvailableText:qe,deliveryNotAvailableText:Ue,giftWrapSetupData:Qe,giftWrapProductDetail:Ye,progressBarFreeProductIconType:Ge,enableCustomCartOnCartPage:Ze,isCartPage:Xe,showCartTimer:Ke,showFreebieMilestone:Je,freebieMilestoneData:et,cartTimerInMinutes:tt,cartTimerCustomText:nt,productRecsCardLayout:rt,productRecsCardListVariant:ot,imageAspectSelector:at,cartComponentsCornerType:it,cartComponentsCornerRadius:lt,cartOffersCarousalData:ct,gstSectionCustomizationData:dt,noteSectionTitle:ut,checkoutSectionMessage:mt,checkoutSectionMessageDisplay:ft,showVariantSelectionDropdownInProductClaim:gt,loyaltyDiscount:xt,brandTokenName:yt,showDiscountOnMRP:vt,switchWidthVariant:wt,prefixMessageText:Ct,suffixMessageText:Et,successMessageText:kt,toggleDecimal:St,cartOffersCarouselHeight:Tt,disableCheckoutButton:$t,showEmptyCartRecommendations:Bt=!1,checkoutButtonBottomSpacing:zt,showPoweredByBadge:It,applyCouponCode:Dt,showApplyCoupon:Nt,enableConfetti:_t,checkoutSectionMessageRedirectLink:Pt,showCheckoutButtonPaymentIcons:Ot})=>{const Ft=pn(fn),At=pn(En);t.useEffect(()=>{setTimeout(()=>{const t=document.querySelector(".yt-cart-drawer"),n=document.querySelector("#yt001-widget-reward")?.shadowRoot?.querySelector(".yt-cart-drawer"),r=n||t,o=r?window.getComputedStyle(r):null;fetch("http://127.0.0.1:7244/ingest/dac024e4-e731-4c60-a4a1-db68e2d3da59",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({location:"CartDrawer.tsx:useEffect:isOpen",message:"CartDrawer isOpen and DOM state",data:{isOpen:e,drawerFound:!!r,transform:o?.transform,display:o?.display,visibility:o?.visibility,position:o?.position,zIndex:o?.zIndex,right:o?.right},timestamp:Date.now(),sessionId:"debug-session",hypothesisId:"D"})}).catch(()=>{})},100)},[e]);const[Mt,Rt]=c(!1),[Lt,jt]=c(!1),[Vt,Wt]=c(!0),{setLoading:Ht}=kn();t.useEffect(()=>{ke&&ke(Ht)},[ke]);const qt=o(!1),Ut=o(null),Qt=o(null);l(()=>{const t=()=>{n(!1)};return e?(qt.current||(Ut.current=window.history.state,Qt.current=window.location.href,window.history.pushState({ytCustomCartDrawer:"open"},"")),window.addEventListener("popstate",t),qt.current=!0):(qt.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.replaceState(Ut.current,"",Qt.current??window.location.href),qt.current=!1),()=>{window.removeEventListener("popstate",t)}},[e,n]);const[Yt,Gt]=c(!1);l(()=>{const t=document.querySelector("body");t&&(Ze&&Xe?t.classList.remove("drawer-open"):!Yt&&e?t.classList.add("drawer-open"):t.classList.remove("drawer-open"))},[e,Ze,Xe,Yt]),l(()=>{function e(){const e=window.innerWidth;Gt(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const Zt=Ft?.items?.reduce((e,t)=>e+t?.quantity,0);l(()=>{const e=()=>{Rt(!0),window.setTimeout(()=>Rt(!1),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)},[]);const[Xt,Kt]=c("normal"),[Jt,en]=c("normal"),[tn,nn]=c("auto");l(()=>{CSS.supports("font-weight","500")?Kt("500"):CSS.supports("font-weight","400")?Kt("400"):CSS.supports("font-weight","600")&&Kt("600"),CSS.supports("font-weight","400")?en("400"):CSS.supports("font-weight","300")?en("300"):CSS.supports("font-weight","200")&&en("200"),CSS.supports("width","-webkit-fill-available")?nn("-webkit-fill-available"):CSS.supports("width","-moz-available")&&nn("-moz-available")},[]);const[rn]=mn(bn),[on]=mn(Cn),[an]=mn(wn);l(()=>{Wt(!("all-products"!==Ve&&("specific-tags"!==Ve||rn.isPostalCodeValid||We)&&("specific-tags"!==Ve||rn.isPostalCodeValid||on||!We)&&("specific-tags"===Ve&&"standard"===an||Lt&&(We?rn.isPostalCodeValid&&on:rn.isPostalCodeValid))))},[rn.isPostalCodeValid,on,Lt,Ve,We]),mn(Sn);const[ln,cn]=c(!0);l(()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&cn(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&cn(!1)},[]);const dn=new Date("2024-11-01");return In(Ft?.items_subtotal_price,Ft?.currency),t.createElement(fu,{className:"yt-cart-drawer",$isDev:P,$isOpen:e,$backgroundColor:r,$enableCustomCartOnCartPage:Ze,$isCartPage:Xe,$isLargeScreen:Yt,$switchWidthVariant:wt,style:{"--yt-cart-font-weight":Xt,"--yt-cart-product-rec-price-font-weight":Jt,"--yt-cart-custom-fill-width":tn}},At.cartLoading?t.createElement("div",{style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},At.showLoader&&!At.showSkeletonLoader&&t.createElement("div",{className:"loader"},"‎")):t.createElement(t.Fragment,null),t.createElement(t.Fragment,null,t.createElement("div",{className:"yt-cart-drawer-content",style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},t.createElement("div",null,t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",margin:"1rem 1rem 0px"}},t.createElement(xu,{className:"yt-cart-title-container",style:{fontWeight:"var(--yt-cart-font-weight, bold)",color:X,fontSize:"16px"}},t.createElement("span",{style:{whiteSpace:"nowrap",flexShrink:0}},u),Ft?.item_count>0&&L&&!(ue&&L)&&R>0&&t.createElement(pu,{pointsRewardRate:R,loyaltyIcon:k,brandTokenName:yt,themeColor:oe,themeTextColor:ae,rewardMultiplier:T}),Zt>0&&t.createElement(gu,{$backgroundSubdued:a},Zt)),t.createElement("div",{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(Ze&&Xe)&&t.createElement(hu,{className:"yt-cart-close-button",$backgroundColor:a||"#cacaca30",onClick:()=>n(!e)},t.createElement(bt,{style:{height:"auto",width:"auto",color:X},fontSize:24,cursor:"pointer",onClick:()=>{n(!e)}})))),At&&t.createElement(lu,{$themeColor:oe,show:At.showLoader}),ct?.enableCartOffersCarousel&&t.createElement(ru,{themeColor:oe,cartOffersCarousalData:ct,cartOffersCarouselHeight:Tt,cartData:Ft}),Ke&&ln&&Ft?.item_count?t.createElement(Fp,{minutes:tt,customText:nt,onTimerComplete:()=>{cn(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")}}):null,Mt&&_t&&t.createElement(ao,{particleCount:50,spread:90,origin:{y:.3}}),ve?t.createElement(Ql,{inlineCartOfferInfoText:ve,inlineCartOfferInfoRedirectLink:we,themeColor:oe,tooltipText:Ce,themeTextColor:ae}):null),F&&Ft?.items_subtotal_price>0&&Ft?.currency&&!!A&&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?.[Kr(r)]&&("minimum_order_value"!==r||1!==e?.[Kr(r)])).some((e,i)=>Jr(e,i,a,o,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:r,checkpoints:a}).progressPercentage>0)}(A,In(void 0!==Te?Te:Ft?.items_subtotal_price,Ft.currency),void 0===De?Ft?.item_count:De,Q??"minimum_order_value",Ft?.item_count)&&t.createElement(t.Fragment,null,t.createElement(Fo,{customCartProgressBarCriteria:Q??"minimum_order_value",handleCheckpointCrossed:U,checkpoints:A,effectiveQuantityForProgressBar:void 0===De?Ft?.item_count:De,currentCartAmount:In(void 0!==Te?Te:Ft?.items_subtotal_price,Ft.currency),themeColor:oe,themeTextColor:ae,primaryTextColor:X,secondaryTextColor:K,showMOVForProgressTiers:se,progressBarFreeProductIconType:Ge,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,prefixMessageText:Ct,suffixMessageText:Et,successMessageText:kt,enableConfetti:_t})),Ft?.item_count>0&&t.createElement("div",{style:{display:"flex",height:"12px",background:"#87878717"}}),0===Ft?.items?.length&&0===Ft?.item_count&&!1===At?.showSkeletonLoader?t.createElement(Vo,{showLoyaltyCta:ue,joinNowFunction:N,emptyCartTitle:m,emptyCartDescription:f,exploreCTAColor:s,isUserSignedIn:v,exploreCtaRedirectLink:j,themeColor:oe,emptyCartButtons:g,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,themeTextColor:ae,recProductsList:O,addCartItem:b,productRecsCtaButtonText:J,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,showVariantSelectionDropdownInProductRecs:Se,emptyProductRecsTitleText:te,backgroundSubdued:a,showEmptyCartRecommendations:Bt,tertiaryColor:i,tertiaryTextColor:d}):t.createElement("div",{style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},t.createElement(wi,{isDev:P,themeColor:oe,handleDecrement:y,handleIncrement:h,removeCartItem:x,addCartItem:b,primaryTextColor:X,secondaryTextColor:K,freeProduct:pe,themeTextColor:ae,showEditOptionOnProducts:Ee,productPercentageOffMapping:Ne,removeFreebieFromCart:_e,showDeleteOnFreebies:Me,freebieCouponTemplates:Re??[],freebieFlowCheckpoints:Le??[],cartCheckpoints:A,freeProductAdjustedCartTotal:me,imageAspectSelector:at,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,giftWrapVariantId:Ye?.variants?.nodes[0]?.id,giftWrapProductId:Qe?.giftProductId,showGiftWrapAsLineItem:Qe?.showGiftWrapAsLineItem,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:d,backgroundColor:r,showDiscountOnMRP:vt,checkoutSectionMessage:mt,checkoutSectionMessageRedirectLink:Pt,showFreebieMilestone:Je,freebieMilestoneData:et}),Yt&&ne&&!!O&&O?.length>0&&Ft?.item_count>0&&b&&t.createElement(Nr,{addCartItem:b,products:O,productRecsCtaButtonText:J,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,productRecsTitleText:ee,themeColor:oe,primaryTextColor:X,secondaryTextColor:K,showVariantSelectionDropdownInProductRecs:Se,cardLayout:rt,variant:ot,cartComponentsCornerType:it,cartComponentsCornerRadius:lt,backgroundSubdued:a,backgroundColor:r,tertiaryColor:i,tertiaryTextColor:d}),!Yt&&re&&!!O&&O?.length>0&&Ft?.item_count>0&&b&&t.createElement(Nr,{addCartItem:b,products:O,productRecsCtaButtonText:J,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,productRecsTitleText:ee,themeColor:oe,primaryTextColor:X,secondaryTextColor:K,showVariantSelectionDropdownInProductRecs:Se,cardLayout:rt,variant:ot,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,backgroundSubdued:a,tertiaryColor:i,tertiaryTextColor:d}),"devlhok.myshopify.com"===window.ytapp?.storeDomain&&t.createElement(mu,{showDiscountOnMRP:vt,cartCheckpoints:A,toggleDecimal:St,primaryTextColor:X,discountApplied:B,showPoweredByBadge:It})),t.createElement(ia,null,Ft?.item_count>0&&w&&C&&t.createElement(Ei,{bundleProducts:C}),ce&&!!de&&Ft?.item_count>0&&t.createElement(Fi,{companyName:ie,gstNumber:le,themeColor:oe,iconColor:dt?.iconColor,showIcon:dt?.showIcon,backgroundColor:dt?.backgroundColor,textColor:dt?.textColor,title:dt?.title}),!!Ft&&Ft?.item_count>0&&!!ze&&!!$e&&!!Ie&&$e.length>0&&t.createElement(Ul,{freebieProductsInCart:$e,themeColor:oe,themeTextColor:ae,primaryTextColor:X,addFreebieToCart:ze,freebiesInCart:Ie,imageAspectSelector:at,freebieCouponTemplates:Re,freebieClaimData:je,cartCheckpoints:A,isCartDrawerOpen:e}),Oe&&(Pe?.length??0)>0&&!!Ae&&Ft?.item_count>0&&t.createElement(Ai,null,t.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>Wt(!Vt)},t.createElement("span",{style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",t.createElement(ht,null)),t.createElement(Mi,null,Vt?t.createElement(st,null):t.createElement(pt,null))),"all-products"===Ve&&Vt?t.createElement(Ep,{postalCodeList:Pe,themeColor:oe,themeTextColor:ae,enableSlotPicker:We,deliveryHeaderTitle:He,deliveryAvailableText:qe,deliveryNotAvailableText:Ue,disabledDates:dn}):Vt&&(Lt?t.createElement(Ep,{postalCodeList:Pe,themeColor:oe,themeTextColor:ae,enableSlotPicker:We,deliveryHeaderTitle:He,deliveryAvailableText:qe,deliveryNotAvailableText:Ue,disabledDates:dn}):t.createElement(kp,{postalCodeList:Pe,themeColor:oe,themeTextColor:ae,enableSlotPicker:We,disabledDates:dn}))),be&&!!he&&Ft?.item_count>0&&t.createElement(Li,{note:ye,noteSectionTitle:ut}),Qe?.showGiftWrapOption&&Ft?.item_count>0&&t.createElement(_p,{themeColor:oe,id:Qe?.giftProductId,detail:Ye,showPrice:Qe?.showPrice,errorText:Qe?.errorText,customText:Qe?.customText,showGiftIcon:Qe?.showGiftIcon,showProductImage:Qe?.showProductImage,addCartItem:b,removeCartItem:x}),Ft?.item_count>0&&Nt&&!ue&&Dt&&t.createElement(uu,{backgroundSubdued:a,themeColor:oe,themeTextColor:ae,primaryTextColor:X,cartComponentsCornerRadius:lt,applyCouponCode:Dt,removeDiscount:z,enableConfetti:_t}),Ft?.item_count>0&&t.createElement(t.Fragment,null,v||!ue||xt?!xt&&void 0!==E&&void 0!==S&&!!k&&ue&&!!I&&t.createElement($a,{themeColor:oe,applyDiscount:I,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:S,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,minimumOrderValueToAvailDiscount:fe,brandTokenName:yt,showCartLevelAltPay:L,redemptionMultiplier:$}):!!_&&!!N&&t.createElement(oa,{cartSigninCTAMainText:xe,signinCTAButtonVisible:ge,themeColor:oe,joinNowFunction:N,guestLoyaltyPercentage:_,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,showCartLevelAltPay:L})),Ft?.item_count>0&&!!xt&&!!z&&ue&&xt&&void 0!==S&&t.createElement(Ea,{themeColor:oe,removeDiscount:z,loyaltyDiscount:xt,isDev:P,ctaButtonBackgroundColor:G,ctaButtonTextColor:Z,primaryTextColor:X,secondaryTextColor:K,pointsToBeUsed:S,brandTokenName:yt,showCartLevelAltPay:L}),ue&&L&&M&&k&&Ft?.item_count>0&&t.createElement(du,{loyaltyIcon:k,backgroundSubdued:a,primaryTextColor:X,pointsRewardRate:R,rewardMultiplier:T}),ue&&Ft&&Ft.item_count>0&&!!fe&&fe>1&&t.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:oe??"#50D1AA",fontWeight:600,display:"flex",justifyContent:ge?"space-between":"center"}},"Minimum order value to use ",yt,":"," ",fe),Ft&&D&&Ft?.item_count>0&&t.createElement("div",null,t.createElement(Jo,{disableCheckoutButton:!!$t||At.cartLoading,discountApplied:B,checkoutFunction:D,checkoutButtonColor:Y,checkoutFontSize:p,discountInCheckoutButton:H,isStickyCheckout:q,discountAmountApplied:V,minimumCartValue:W,themeTextColor:ae,applyGSTToCart:de,showGSTOption:ce,applyNoteToCart:he,showNoteOption:be,enableGeoLocationDeliveryRestriction:Oe,applyPostalCodeAndDeliverySlotToCart:Ae,enableSlotPicker:We,cartComponentsCornerRadius:lt,cartComponentsCornerType:it,checkoutSectionMessage:mt,checkoutSectionMessageDisplay:ft,checkoutSectionMessageRedirectLink:Pt,showDiscountOnMRP:vt,tertiaryColor:i,tertiaryTextColor:d,cartCheckpoints:A,toggleDecimal:St,checkoutButtonBottomSpacing:zt,showPoweredByBadge:It,showCheckoutButtonPaymentIcons:Ot,primaryTextColor:X,hideSubtotalAndBadge:"devlhok.myshopify.com"===window.ytapp?.storeDomain}))))))},bu=h.div`
2597
2597
  position: relative;
2598
2598
  `,vu=h.button`
2599
2599
  border: 1px solid #ccc;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yt-uikit",
3
- "version": "0.8.29-shadow-dom.3",
3
+ "version": "0.8.29-shadow-dom.4",
4
4
  "description": "YourToken UI Kit",
5
5
  "scripts": {
6
6
  "rollup": "tsc && rollup -c",