yt-uikit 0.10.145-order-note.0 → 0.10.145-progress-bar.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/index.js +2 -2
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -1075,7 +1075,7 @@ function dn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;
|
|
|
1075
1075
|
flex-wrap: wrap;
|
|
1076
1076
|
text-align: center;
|
|
1077
1077
|
}
|
|
1078
|
-
`,il=({prefixMessageText:t="You are",suffixMessageText:r="away from",successMessageText:n="Best reward unlocked",...o})=>{const a=(n,o)=>e.createElement(al,{className:"yt-cart-progress-bar-reward-message"},t&&e.createElement("span",{className:"yt-cart-progress-bar-prefix-span"},t," "),e.createElement("span",{className:"yt-cart-progress-bar-amount-span",style:{fontWeight:"bold"}},n)," ",r&&e.createElement("span",{className:"yt-cart-progress-bar-suffix-span"},r," "),e.createElement("span",{className:"yt-cart-progress-bar-checkpoint-span",style:{fontWeight:"bold"}},o));let i=-1;const l=void 0!==o.currentCartAmount?o.currentCartAmount:o.cartData?.items_subtotal_price,s=void 0!==o.effectiveQuantityForProgressBar?o.effectiveQuantityForProgressBar:o.cartData?.item_count,c=cn(o.cartData,o.cartData?.currency)??"Rs .",d=[...o.checkpoints??[]].sort((e,t)=>"minimum_order_value"===o.customCartProgressBarCriteria?e.minimumOrderValue-t.minimumOrderValue:e.quantityThreshold-t.quantityThreshold);if("minimum_order_value"===o.customCartProgressBarCriteria){if(0===l&&o.cartData?.items_subtotal_price>0)return null;for(let e=0;e<d.length;e++)if(l<d[e].minimumOrderValue){i=e;break}if(-1===i)return e.createElement("span",{className:"yt-cart-progress-bar-success-span"},n);const t=d[i];return a(`${c}${oa((t?.minimumOrderValue-l).toFixed(0))}`,t?.name)}if(0===s&&o.cartData?.item_count>0)return null;for(let e=0;e<d.length;e++)if(s<d[e].quantityThreshold){i=e;break}if(-1===i)return e.createElement("span",{className:"yt-cart-progress-bar-success-span"},n);const p=d[i];return a(`${p?.quantityThreshold-s}`,p?.name)},ll=t=>e.createElement(Ki,{className:"yt-cart-single-tier-reward-message",$ctaButtonTextColor:t.ctaButtonTextColor,$ctaButtonBackgroundColor:t.ctaButtonBackgroundColor},e.createElement(il,{...t})),sl=({particleCount:t,spread:n,origin:o,checkpointPosition:i=.5})=>{const l=a(null),s=a(!1);return r(()=>{const e=window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches;if(!e&&l.current&&!s.current){const e=Date.now();if(e-(window.__ytLastCartConfettiAt??0)<1500)return void(s.current=!0);window.__ytLastCartConfettiAt=e;He.create(l.current,{resize:!0})({particleCount:Math.min(t,80),spread:n,origin:{x:1,y:.8}}),s.current=!0}},[t,n,o,i]),e.createElement("canvas",{className:"yt-cart-progress-bar-confetti",ref:l,id:"my-canvas",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:-1,display:"inline"}})},cl=({prefixMessageText:n,suffixMessageText:i,successMessageText:l,enableConfetti:s,...c})=>{const{currentCartAmount:d,checkpoints:p,themeColor:m,customCartProgressBarCriteria:u,primaryTextColor:g,effectiveQuantityForProgressBar:f,ctaButtonBackgroundColor:y,ctaButtonTextColor:x}=c,h=Ne(Zr),[b,w]=t(!1),[v,C]=t(-1),E=a({}),k=o(()=>[...p??[]].sort((e,t)=>"minimum_order_value"===u?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold).filter(e=>0!==e?.[nl(u)]&&("minimum_order_value"!==u||1!==e?.[nl(u)])).map((...e)=>ol(...e,h?.item_count,c)),[p,h?.item_count,d,u,f]);return r(()=>{k.forEach((e,t)=>{const r=String(e.couponTemplateId);(E.current[r]||0)<100&&e.progressPercentage>=100&&(C(t),w(!0),setTimeout(()=>w(!1),5e3)),E.current[r]=e.progressPercentage})},[k]),e.createElement(e.Fragment,null,e.createElement(ll,{currentCartAmount:d,checkpoints:p,cartData:h,customCartProgressBarCriteria:u,effectiveQuantityForProgressBar:f,themeColor:m,primaryTextColor:g,showMOVForProgressTiers:!1,prefixMessageText:n,suffixMessageText:i,successMessageText:l,ctaButtonBackgroundColor:y,ctaButtonTextColor:x}),e.createElement(Ji,{className:"yt-cart-progress-bar-wrapper"},b&&s&&e.createElement(sl,{particleCount:50,spread:90,origin:{y:.3},checkpointPosition:(v+1)/(p?.length??1)}),e.createElement(el,{className:"yt-cart-progress-bar-content-wrapper"},e.createElement(Xi,{className:"yt-cart-progress-bar-container"},k.map((t,r)=>e.createElement(tl,{className:"yt-cart-progress-bar-checkpoint-wrapper",key:t?.couponTemplateId,$numberOfCheckpoints:p?.length??1},e.createElement(rl,{className:"yt-cart-progress-bar-checkpoint-inner-wrapper"},r<p?.length&&e.createElement(Zi,{className:"yt-cart-single-progress-bar",$isCompleted:t?.progressPercentage>=100,$percent:t?.progressPercentage,style:{display:"flex"},$numberOfCheckpoints:p?.length??1,$isFirstCheckpoint:0===r,$ctaButtonBackgroundColor:y}))))))))},dl=t=>e.createElement(qi,{className:"yt-cart-multi-tier-reward-message",$ctaButtonTextColor:t.ctaButtonTextColor,$ctaButtonBackgroundColor:t.ctaButtonBackgroundColor},e.createElement(il,{...t})),pl={tshirt:Je,box:et,cup:ut,gift:Xe,emptyCircle:kt},ml={percentage_discount_coupon:Oe,amount_discount_coupon:Oe,free_delivery:j,free_gift:Xe,dummy_coupon:kt},ul=({checkpointWithProgress:t,themeColor:r,checkpointsLength:n,progressBarFreeProductIconType:o,ctaButtonTextColor:a})=>t?.progressPercentage>=100?e.createElement(je,{className:"yt-cart-progress-bar-checkpoint-icon",style:{padding:"4px",border:"2px solid black",backgroundColor:r,color:a,borderColor:r,borderRadius:"9999px",fontSize:`${Li(n)}px`,width:"24px",height:"24px",marginLeft:"-2px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"}}):((t,r,n,o)=>{let a;return a="free_product"===t?pl?.[o]:ml?.[t],a?e.createElement(a,{className:"yt-cart-progress-bar-checkpoint-icon",style:{padding:"4px",border:"2px solid black",backgroundColor:"white",borderColor:r,color:r,borderRadius:"9999px",width:"24px",height:"24px",fontSize:`${Li(n??3)}px`,marginLeft:"-2px"}}):e.createElement(je,{className:"yt-cart-progress-bar-checkpoint-icon",style:{padding:"4px",border:"2px solid black",backgroundColor:"grey",color:"white",borderRadius:"9999px",fontSize:`${Li(n)}px`,width:"24px",height:"24px",marginLeft:"-2px"}})})(t?.couponType,"#707070",n,o??"tshirt"),gl=({showMOVForProgressTiers:t,minimumOrderValue:r,customCartProgressBarCriteria:n,cartData:o,quantityThreshold:a,ctaButtonBackgroundColor:i,ctaButtonTextColor:l})=>t?e.createElement(ji,{className:"yt-cart-progress-bar-checkpoint-tooltip",$visible:r>1||a>0,$ctaButtonTextColor:l,$ctaButtonBackgroundColor:i},"minimum_order_value"===n?`${cn(o,o?.currency)} ${oa(r)}`:`${a} item${a>1?"s":""}`):null,fl="undefined"!=typeof window?l:r,yl=({prefixMessageText:n,suffixMessageText:l,successMessageText:s,enableConfetti:c,maxTiersVisible:d=5,...p})=>{const{currentCartAmount:m,themeColor:u,primaryTextColor:g,progressBarFreeProductIconType:f,ctaButtonBackgroundColor:y,ctaButtonTextColor:x}=p,h=Ne(Zr),[b,w]=t(!1),[v,C]=t(-1),E=a({}),[k,S]=t(0),[T,N]=t(0),z=a(null),I=a(null),F=a([]);F.current.length=0;const B=i(()=>{if("undefined"==typeof window)return;const e=F.current.filter(e=>Boolean(e&&null!==e.offsetParent));if(!e.length)return S(e=>0!==e?0:e),void N(e=>0!==e?0:e);let t=0;e.forEach(e=>{const r=window.getComputedStyle(e),n=parseFloat(r.lineHeight||""),o=parseFloat(r.fontSize||""),a=Number.isNaN(n)?Number.isNaN(o)?0:1.2*o:n,i=e.getBoundingClientRect(),l=a>0?Math.max(0,i.height-a):Math.max(0,e.scrollHeight-e.clientHeight);t=Math.max(t,l)});const r=t>1?Math.min(32,Math.round(t+6)):0;S(e=>e!==r?r:e);const n=z.current,o=I.current,a=e[e.length-1];if(!n||!o||!a)return void N(e=>0!==e?0:e);const i=a.closest(".yt-cart-progress-bar-checkpoint-wrapper"),l=i?a.getBoundingClientRect().right-i.getBoundingClientRect().right:0,s=n.getBoundingClientRect(),c=o.getBoundingClientRect(),d=Math.ceil(c.right+l-s.right),p=d>0?d:0;N(e=>e!==p?p:e)},[]);r(()=>{if("undefined"==typeof window)return;const e=()=>{B()};window.addEventListener("resize",e);const t=z.current,r="undefined"!=typeof ResizeObserver&&t?new ResizeObserver(()=>B()):null;return r&&t&&r.observe(t),()=>{window.removeEventListener("resize",e),r?.disconnect()}},[B]);const $=o(()=>(p.checkpoints??[]).slice().sort((e,t)=>"minimum_order_value"===p.customCartProgressBarCriteria?e.minimumOrderValue-t.minimumOrderValue:e.quantityThreshold-t.quantityThreshold),[p.checkpoints,p.customCartProgressBarCriteria]),A=o(()=>{const e=$.filter(e=>0!==e?.[nl(p.customCartProgressBarCriteria)]);return e.map((t,r)=>ol(t,r,e,h?.item_count,p))},[$,p.customCartProgressBarCriteria,p.currentCartAmount,p.effectiveQuantityForProgressBar,h]),P=o(()=>{let e=-1;return A.forEach((t,r)=>{t?.progressPercentage>=100&&(e=r)}),e},[A]),D=d>0?d:5,_=Math.min(Math.max(P,0),Math.max(0,A.length-D)),R=o(()=>A.slice(_,_+D),[A,_,D]),L=_>0?A[_-1]:null;return fl(()=>{B()},[B,R]),r(()=>{A.forEach((e,t)=>{const r=String(e?.couponTemplateId);(E.current[r]||0)<100&&e?.progressPercentage>=100&&(C(t),w(!0),setTimeout(()=>w(!1),5e3)),E.current[r]=e?.progressPercentage})},[A]),e.createElement(e.Fragment,null,e.createElement(dl,{currentCartAmount:m,checkpoints:$,cartData:h,customCartProgressBarCriteria:p.customCartProgressBarCriteria,effectiveQuantityForProgressBar:p.effectiveQuantityForProgressBar,themeColor:u,primaryTextColor:g,showMOVForProgressTiers:p.showMOVForProgressTiers??!1,ctaButtonBackgroundColor:y,prefixMessageText:n,suffixMessageText:l,successMessageText:s,ctaButtonTextColor:x}),e.createElement(Ui,{className:"yt-cart-progress-bar-wrapper",$showMOVForProgressTiers:p.showMOVForProgressTiers??!1,$rightMarginOffsetPx:T,ref:z},b&&c&&e.createElement(sl,{particleCount:50,spread:90,origin:{y:.3},checkpointPosition:(v-_+1)/(R.length||1)}),e.createElement(Yi,{className:"yt-cart-progress-bar-content-wrapper",$tagWrapOffsetPx:k},e.createElement(Mi,{className:"yt-cart-progress-bar-container",ref:I},L&&e.createElement(Qi,{className:"yt-cart-progress-bar-anchor-checkpoint",$numberOfCheckpoints:R.length||1,style:{flexGrow:0,flexShrink:0,width:"auto"}},e.createElement(Gi,null,e.createElement(Vi,{className:"yt-cart-multi-progress-bar",$isCompleted:!0,$percent:100,style:{display:"flex",flexGrow:0,width:"12px"},$numberOfCheckpoints:R.length||1,$isFirstCheckpoint:!0,$ctaButtonBackgroundColor:y}),e.createElement(Wi,{className:"yt-cart-progress-bar-checkpoint-container"},e.createElement(ul,{checkpointWithProgress:L,themeColor:y,checkpointsLength:R.length||1,progressBarFreeProductIconType:f,ctaButtonTextColor:x})))),R.map((t,r)=>{const n=R.length||1;return e.createElement(Qi,{className:"yt-cart-progress-bar-checkpoint-wrapper",key:`${_}-${t?.couponTemplateId}`,$numberOfCheckpoints:n,$animationDelayMs:90*r},e.createElement(Gi,{className:"yt-cart-progress-bar-checkpoint-inner-wrapper"},r<n&&e.createElement(Vi,{className:"yt-cart-multi-progress-bar",$isCompleted:t?.progressPercentage>=100,$percent:t?.progressPercentage,style:{display:"flex"},$numberOfCheckpoints:n,$isFirstCheckpoint:0===r,$ctaButtonBackgroundColor:y,$hasHiddenCompletedCheckpoint:Boolean(L)}),("minimum_order_value"!==p.customCartProgressBarCriteria||t?.minimumOrderValue>1)&&e.createElement(Wi,{className:"yt-cart-progress-bar-checkpoint-container",$isDummy:t?.isDummyCouponTemplate},e.createElement(Hi,{className:"yt-cart-progress-bar-tier-name-tag",ref:e=>{F.current[r]=e},$isCompleted:t?.progressPercentage>=100,$ctaButtonTextColor:x,$ctaButtonBackgroundColor:y,$primaryTextColor:g,style:{display:n>1?"block":"none"}},t?.name),n>1&&e.createElement(ul,{checkpointWithProgress:t,themeColor:y,checkpointsLength:n,progressBarFreeProductIconType:f,ctaButtonTextColor:x}),e.createElement(gl,{showMOVForProgressTiers:p.showMOVForProgressTiers,minimumOrderValue:t?.minimumOrderValue,customCartProgressBarCriteria:p.customCartProgressBarCriteria,cartData:h,quantityThreshold:t?.quantityThreshold,ctaButtonBackgroundColor:y,ctaButtonTextColor:x}))))})))))},xl=t=>t?.checkpoints&&t.checkpoints.length>0?1===t.checkpoints.length?e.createElement(cl,{...t}):e.createElement(yl,{...t}):null,hl=d(d.span`
|
|
1078
|
+
`,il=({prefixMessageText:t="You are",suffixMessageText:r="away from",successMessageText:n="Best reward unlocked",...o})=>{const a=(n,o)=>e.createElement(al,{className:"yt-cart-progress-bar-reward-message"},t&&e.createElement("span",{className:"yt-cart-progress-bar-prefix-span"},t," "),e.createElement("span",{className:"yt-cart-progress-bar-amount-span",style:{fontWeight:"bold"}},n)," ",r&&e.createElement("span",{className:"yt-cart-progress-bar-suffix-span"},r," "),e.createElement("span",{className:"yt-cart-progress-bar-checkpoint-span",style:{fontWeight:"bold"}},o));let i=-1;const l=void 0!==o.currentCartAmount?o.currentCartAmount:o.cartData?.items_subtotal_price,s=void 0!==o.effectiveQuantityForProgressBar?o.effectiveQuantityForProgressBar:o.cartData?.item_count,c=cn(o.cartData,o.cartData?.currency)??"Rs .",d=[...o.checkpoints??[]].sort((e,t)=>"minimum_order_value"===o.customCartProgressBarCriteria?e.minimumOrderValue-t.minimumOrderValue:e.quantityThreshold-t.quantityThreshold);if("minimum_order_value"===o.customCartProgressBarCriteria){if(0===l&&o.cartData?.items_subtotal_price>0)return null;for(let e=0;e<d.length;e++)if(l<d[e].minimumOrderValue){i=e;break}if(-1===i)return e.createElement("span",{className:"yt-cart-progress-bar-success-span"},n);const t=d[i];return a(`${c}${oa((t?.minimumOrderValue-l).toFixed(0))}`,t?.name)}if(0===s&&o.cartData?.item_count>0)return null;for(let e=0;e<d.length;e++)if(s<d[e].quantityThreshold){i=e;break}if(-1===i)return e.createElement("span",{className:"yt-cart-progress-bar-success-span"},n);const p=d[i];return a(`${p?.quantityThreshold-s}`,p?.name)},ll=t=>e.createElement(Ki,{className:"yt-cart-single-tier-reward-message",$ctaButtonTextColor:t.ctaButtonTextColor,$ctaButtonBackgroundColor:t.ctaButtonBackgroundColor},e.createElement(il,{...t})),sl=({particleCount:t,spread:n,origin:o,checkpointPosition:i=.5})=>{const l=a(null),s=a(!1);return r(()=>{const e=window.matchMedia?.("(prefers-reduced-motion: reduce)")?.matches;if(!e&&l.current&&!s.current){const e=Date.now();if(e-(window.__ytLastCartConfettiAt??0)<1500)return void(s.current=!0);window.__ytLastCartConfettiAt=e;He.create(l.current,{resize:!0})({particleCount:Math.min(t,80),spread:n,origin:{x:1,y:.8}}),s.current=!0}},[t,n,o,i]),e.createElement("canvas",{className:"yt-cart-progress-bar-confetti",ref:l,id:"my-canvas",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:-1,display:"inline"}})},cl=({prefixMessageText:n,suffixMessageText:i,successMessageText:l,enableConfetti:s,...c})=>{const{currentCartAmount:d,checkpoints:p,themeColor:m,customCartProgressBarCriteria:u,primaryTextColor:g,effectiveQuantityForProgressBar:f,ctaButtonBackgroundColor:y,ctaButtonTextColor:x}=c,h=Ne(Zr),[b,w]=t(!1),[v,C]=t(-1),E=a({}),k=o(()=>[...p??[]].sort((e,t)=>"minimum_order_value"===u?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold).filter(e=>0!==e?.[nl(u)]&&("minimum_order_value"!==u||1!==e?.[nl(u)])).map((...e)=>ol(...e,h?.item_count,c)),[p,h?.item_count,d,u,f]);return r(()=>{k.forEach((e,t)=>{const r=String(e.couponTemplateId);(E.current[r]||0)<100&&e.progressPercentage>=100&&(C(t),w(!0),setTimeout(()=>w(!1),5e3)),E.current[r]=e.progressPercentage})},[k]),e.createElement(e.Fragment,null,e.createElement(ll,{currentCartAmount:d,checkpoints:p,cartData:h,customCartProgressBarCriteria:u,effectiveQuantityForProgressBar:f,themeColor:m,primaryTextColor:g,showMOVForProgressTiers:!1,prefixMessageText:n,suffixMessageText:i,successMessageText:l,ctaButtonBackgroundColor:y,ctaButtonTextColor:x}),e.createElement(Ji,{className:"yt-cart-progress-bar-wrapper"},b&&s&&e.createElement(sl,{particleCount:50,spread:90,origin:{y:.3},checkpointPosition:(v+1)/(p?.length??1)}),e.createElement(el,{className:"yt-cart-progress-bar-content-wrapper"},e.createElement(Xi,{className:"yt-cart-progress-bar-container"},k.map((t,r)=>e.createElement(tl,{className:"yt-cart-progress-bar-checkpoint-wrapper",key:t?.couponTemplateId,$numberOfCheckpoints:p?.length??1},e.createElement(rl,{className:"yt-cart-progress-bar-checkpoint-inner-wrapper"},r<p?.length&&e.createElement(Zi,{className:"yt-cart-single-progress-bar",$isCompleted:t?.progressPercentage>=100,$percent:t?.progressPercentage,style:{display:"flex"},$numberOfCheckpoints:p?.length??1,$isFirstCheckpoint:0===r,$ctaButtonBackgroundColor:y}))))))))},dl=t=>e.createElement(qi,{className:"yt-cart-multi-tier-reward-message",$ctaButtonTextColor:t.ctaButtonTextColor,$ctaButtonBackgroundColor:t.ctaButtonBackgroundColor},e.createElement(il,{...t})),pl={tshirt:Je,box:et,cup:ut,gift:Xe,emptyCircle:kt},ml={percentage_discount_coupon:Oe,amount_discount_coupon:Oe,free_delivery:j,free_gift:Xe,dummy_coupon:kt},ul=({checkpointWithProgress:t,themeColor:r,checkpointsLength:n,progressBarFreeProductIconType:o,ctaButtonTextColor:a})=>t?.progressPercentage>=100?e.createElement(je,{className:"yt-cart-progress-bar-checkpoint-icon",style:{padding:"4px",border:"2px solid black",backgroundColor:r,color:a,borderColor:r,borderRadius:"9999px",fontSize:`${Li(n)}px`,width:"24px",height:"24px",marginLeft:"-2px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.3)"}}):((t,r,n,o)=>{let a;return a="free_product"===t?pl?.[o]:ml?.[t],a?e.createElement(a,{className:"yt-cart-progress-bar-checkpoint-icon",style:{padding:"4px",border:"2px solid black",backgroundColor:"white",borderColor:r,color:r,borderRadius:"9999px",width:"24px",height:"24px",fontSize:`${Li(n??3)}px`,marginLeft:"-2px"}}):e.createElement(je,{className:"yt-cart-progress-bar-checkpoint-icon",style:{padding:"4px",border:"2px solid black",backgroundColor:"grey",color:"white",borderRadius:"9999px",fontSize:`${Li(n)}px`,width:"24px",height:"24px",marginLeft:"-2px"}})})(t?.couponType,"#707070",n,o??"tshirt"),gl=({showMOVForProgressTiers:t,minimumOrderValue:r,customCartProgressBarCriteria:n,cartData:o,quantityThreshold:a,ctaButtonBackgroundColor:i,ctaButtonTextColor:l})=>t?e.createElement(ji,{className:"yt-cart-progress-bar-checkpoint-tooltip",$visible:r>1||a>0,$ctaButtonTextColor:l,$ctaButtonBackgroundColor:i},"minimum_order_value"===n?`${cn(o,o?.currency)} ${oa(r)}`:`${a} item${a>1?"s":""}`):null,fl="undefined"!=typeof window?l:r,yl=({prefixMessageText:n,suffixMessageText:l,successMessageText:s,enableConfetti:c,maxTiersVisible:d=5,...p})=>{const{currentCartAmount:m,themeColor:u,primaryTextColor:g,progressBarFreeProductIconType:f,ctaButtonBackgroundColor:y,ctaButtonTextColor:x}=p,h=Ne(Zr),[b,w]=t(!1),[v,C]=t(-1),E=a({}),[k,S]=t(0),[T,N]=t(0),z=a(null),I=a(null),F=a([]);F.current.length=0;const B=i(()=>{if("undefined"==typeof window)return;const e=F.current.filter(e=>Boolean(e&&null!==e.offsetParent));if(!e.length)return S(e=>0!==e?0:e),void N(e=>0!==e?0:e);let t=0;e.forEach(e=>{const r=window.getComputedStyle(e),n=parseFloat(r.lineHeight||""),o=parseFloat(r.fontSize||""),a=Number.isNaN(n)?Number.isNaN(o)?0:1.2*o:n,i=e.getBoundingClientRect(),l=a>0?Math.max(0,i.height-a):Math.max(0,e.scrollHeight-e.clientHeight);t=Math.max(t,l)});const r=t>1?Math.min(32,Math.round(t+6)):0;S(e=>e!==r?r:e);const n=z.current,o=I.current,a=e[e.length-1];if(!n||!o||!a)return void N(e=>0!==e?0:e);const i=a.closest(".yt-cart-progress-bar-checkpoint-wrapper"),l=i?a.getBoundingClientRect().right-i.getBoundingClientRect().right:0,s=n.getBoundingClientRect(),c=o.getBoundingClientRect(),d=Math.ceil(c.right+l-s.right),p=d>0?d:0;N(e=>e!==p?p:e)},[]);r(()=>{if("undefined"==typeof window)return;const e=()=>{B()};window.addEventListener("resize",e);const t=z.current,r="undefined"!=typeof ResizeObserver&&t?new ResizeObserver(()=>B()):null;return r&&t&&r.observe(t),()=>{window.removeEventListener("resize",e),r?.disconnect()}},[B]);const $=o(()=>(p.checkpoints??[]).slice().sort((e,t)=>"minimum_order_value"===p.customCartProgressBarCriteria?e.minimumOrderValue-t.minimumOrderValue:e.quantityThreshold-t.quantityThreshold),[p.checkpoints,p.customCartProgressBarCriteria]),A=o(()=>{const e=$.filter(e=>0!==e?.[nl(p.customCartProgressBarCriteria)]);return e.map((t,r)=>ol(t,r,e,h?.item_count,p))},[$,p.customCartProgressBarCriteria,p.currentCartAmount,p.effectiveQuantityForProgressBar,h]),P=o(()=>{let e=-1;return A.forEach((t,r)=>{t?.progressPercentage>=100&&(e=r)}),e},[A]),D=d>0?d:5,_=Math.min(Math.max(D>1?P:P+1,0),Math.max(0,A.length-D)),R=o(()=>A.slice(_,_+D),[A,_,D]),L=_>0?A[_-1]:null;return fl(()=>{B()},[B,R]),r(()=>{A.forEach((e,t)=>{const r=String(e?.couponTemplateId);(E.current[r]||0)<100&&e?.progressPercentage>=100&&(C(t),w(!0),setTimeout(()=>w(!1),5e3)),E.current[r]=e?.progressPercentage})},[A]),e.createElement(e.Fragment,null,e.createElement(dl,{currentCartAmount:m,checkpoints:$,cartData:h,customCartProgressBarCriteria:p.customCartProgressBarCriteria,effectiveQuantityForProgressBar:p.effectiveQuantityForProgressBar,themeColor:u,primaryTextColor:g,showMOVForProgressTiers:p.showMOVForProgressTiers??!1,ctaButtonBackgroundColor:y,prefixMessageText:n,suffixMessageText:l,successMessageText:s,ctaButtonTextColor:x}),e.createElement(Ui,{className:"yt-cart-progress-bar-wrapper",$showMOVForProgressTiers:p.showMOVForProgressTiers??!1,$rightMarginOffsetPx:T,ref:z},b&&c&&e.createElement(sl,{particleCount:50,spread:90,origin:{y:.3},checkpointPosition:(v-_+1)/(R.length||1)}),e.createElement(Yi,{className:"yt-cart-progress-bar-content-wrapper",$tagWrapOffsetPx:k},e.createElement(Mi,{className:"yt-cart-progress-bar-container",ref:I},L&&e.createElement(Qi,{className:"yt-cart-progress-bar-anchor-checkpoint",$numberOfCheckpoints:R.length||1,style:{flexGrow:0,flexShrink:0,width:"auto"}},e.createElement(Gi,null,e.createElement(Vi,{className:"yt-cart-multi-progress-bar",$isCompleted:!0,$percent:100,style:{display:"flex",flexGrow:0,width:"12px"},$numberOfCheckpoints:R.length||1,$isFirstCheckpoint:!0,$ctaButtonBackgroundColor:y}),e.createElement(Wi,{className:"yt-cart-progress-bar-checkpoint-container"},e.createElement(ul,{checkpointWithProgress:L,themeColor:y,checkpointsLength:R.length||1,progressBarFreeProductIconType:f,ctaButtonTextColor:x})))),R.map((t,r)=>{const n=R.length||1;return e.createElement(Qi,{className:"yt-cart-progress-bar-checkpoint-wrapper",key:`${_}-${t?.couponTemplateId}`,$numberOfCheckpoints:n,$animationDelayMs:90*r},e.createElement(Gi,{className:"yt-cart-progress-bar-checkpoint-inner-wrapper"},r<n&&e.createElement(Vi,{className:"yt-cart-multi-progress-bar",$isCompleted:t?.progressPercentage>=100,$percent:t?.progressPercentage,style:{display:"flex"},$numberOfCheckpoints:n,$isFirstCheckpoint:0===r,$ctaButtonBackgroundColor:y,$hasHiddenCompletedCheckpoint:Boolean(L)}),("minimum_order_value"!==p.customCartProgressBarCriteria||t?.minimumOrderValue>1)&&e.createElement(Wi,{className:"yt-cart-progress-bar-checkpoint-container",$isDummy:t?.isDummyCouponTemplate},e.createElement(Hi,{className:"yt-cart-progress-bar-tier-name-tag",ref:e=>{F.current[r]=e},$isCompleted:t?.progressPercentage>=100,$ctaButtonTextColor:x,$ctaButtonBackgroundColor:y,$primaryTextColor:g,style:{display:n>1?"block":"none"}},t?.name),n>1&&e.createElement(ul,{checkpointWithProgress:t,themeColor:y,checkpointsLength:n,progressBarFreeProductIconType:f,ctaButtonTextColor:x}),e.createElement(gl,{showMOVForProgressTiers:p.showMOVForProgressTiers,minimumOrderValue:t?.minimumOrderValue,customCartProgressBarCriteria:p.customCartProgressBarCriteria,cartData:h,quantityThreshold:t?.quantityThreshold,ctaButtonBackgroundColor:y,ctaButtonTextColor:x}))))})))))},xl=t=>t?.checkpoints&&t.checkpoints.length>0?1===t.checkpoints.length?e.createElement(cl,{...t}):e.createElement(yl,{...t}):null,hl=d(d.span`
|
|
1079
1079
|
display: flex !important;
|
|
1080
1080
|
gap: 4px;
|
|
1081
1081
|
`)`
|
|
@@ -1086,7 +1086,7 @@ function dn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;
|
|
|
1086
1086
|
width: 100%;
|
|
1087
1087
|
gap: 10px;
|
|
1088
1088
|
margin-top: 16px;
|
|
1089
|
-
`;function wl({showLoyaltyCta:r,exploreCTAColor:n="#73DABB",emptyCartTitle:o="Your Cart is Empty",emptyCartDescription:a,isUserSignedIn:i=!1,joinNowFunction:l,exploreCtaRedirectLink:s,themeColor:c,emptyCartButtons:d=[],cartComponentsCornerRadius:p=0,cartComponentsCornerType:m="sharp",themeTextColor:u="white",isRecProductsListValid:g,recProductsList:f,addCartItem:y,productRecsCtaButtonText:x,ctaButtonBackgroundColor:h,ctaButtonTextColor:b,primaryTextColor:w,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:C,variantPickerUiVariant:E,emptyProductRecsTitleText:k="Empty cart Recommendations",backgroundSubdued:S,showEmptyCartRecommendations:T=!1,tertiaryColor:N,tertiaryTextColor:z}){const[I,F]=t(!1),[B,$]=t(null);return e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-empty-container",style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",height:"100%",overflowY:"auto",marginTop:"5px"}},e.createElement("div",{className:"yt-cart-empty-content",style:{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"12px"}},e.createElement("svg",{className:"yt-empty-cart-svg",xmlns:"http://www.w3.org/2000/svg",width:"90",height:"80",viewBox:"0 0 79 67",fill:"none"},e.createElement("path",{d:"M78.3148 24.8681V27.0245C78.3148 28.8109 76.8667 30.259 75.0803 30.259H74.0021L70.4827 54.894C70.0275 58.081 67.298 60.4483 64.0787 60.4483H14.9214C11.7021 60.4483 8.97266 58.081 8.51726 54.894L4.99805 30.259H3.91987C2.13344 30.259 0.685303 28.8109 0.685303 27.0245V24.8681C0.685303 23.0817 2.13344 21.6335 3.91987 21.6335H12.9956L27.3868 1.84596C28.7877 -0.0802239 31.4848 -0.506243 33.4113 0.894727C35.3376 2.2957 35.7635 4.99292 34.3625 6.91924L23.6611 21.6335H55.339L44.6376 6.9191C43.2367 4.99292 43.6627 2.29556 45.589 0.894592C47.515 -0.506378 50.2125 -0.0804935 51.6135 1.84582L66.0045 21.6335H75.0803C76.8667 21.6335 78.3148 23.0817 78.3148 24.8681ZM42.7346 48.5882V33.4936C42.7346 31.7072 41.2865 30.259 39.5001 30.259C37.7136 30.259 36.2655 31.7072 36.2655 33.4936V48.5882C36.2655 50.3747 37.7136 51.8228 39.5001 51.8228C41.2865 51.8228 42.7346 50.3747 42.7346 48.5882ZM57.8293 48.5882V33.4936C57.8293 31.7072 56.3811 30.259 54.5947 30.259C52.8083 30.259 51.3601 31.7072 51.3601 33.4936V48.5882C51.3601 50.3747 52.8083 51.8228 54.5947 51.8228C56.3811 51.8228 57.8293 50.3747 57.8293 48.5882ZM27.64 48.5882V33.4936C27.64 31.7072 26.1919 30.259 24.4054 30.259C22.619 30.259 21.1709 31.7072 21.1709 33.4936V48.5882C21.1709 50.3747 22.619 51.8228 24.4054 51.8228C26.1919 51.8228 27.64 50.3747 27.64 48.5882Z",fill:v??"#4D4D4D"}),e.createElement("path",{d:"M78.0001 57C78.0001 62.5228 73.5229 67 68.0001 67C62.4772 67 58.0001 62.5228 58.0001 57C58.0001 51.4772 62.4772 47 68.0001 47C73.5229 47 78.0001 51.4772 78.0001 57Z",fill:N??"#D9D9D9"}),e.createElement("path",{d:"M64.7572 56.512C64.7572 55.128 65.0052 54.044 65.5012 53.26C66.0052 52.476 66.8372 52.084 67.9972 52.084C69.1572 52.084 69.9852 52.476 70.4812 53.26C70.9852 54.044 71.2372 55.128 71.2372 56.512C71.2372 57.904 70.9852 58.996 70.4812 59.788C69.9852 60.58 69.1572 60.976 67.9972 60.976C66.8372 60.976 66.0052 60.58 65.5012 59.788C65.0052 58.996 64.7572 57.904 64.7572 56.512ZM69.5812 56.512C69.5812 55.92 69.5412 55.424 69.4612 55.024C69.3892 54.616 69.2372 54.284 69.0052 54.028C68.7812 53.772 68.4452 53.644 67.9972 53.644C67.5492 53.644 67.2092 53.772 66.9772 54.028C66.7532 54.284 66.6012 54.616 66.5212 55.024C66.4492 55.424 66.4132 55.92 66.4132 56.512C66.4132 57.12 66.4492 57.632 66.5212 58.048C66.5932 58.456 66.7452 58.788 66.9772 59.044C67.2092 59.292 67.5492 59.416 67.9972 59.416C68.4452 59.416 68.7852 59.292 69.0172 59.044C69.2492 58.788 69.4012 58.456 69.4732 58.048C69.5452 57.632 69.5812 57.12 69.5812 56.512Z",fill:z??"black"})),e.createElement("span",{className:"yt-cart-empty-title",style:{color:w,fontWeight:"semibold"}},o),a&&e.createElement("span",{className:"yt-cart-empty-description",style:{color:"#929292",fontSize:"14px"}},a),!i&&r&&e.createElement("div",{className:"yt-cart-empty-signin-cta",style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px"}},e.createElement(Nt,{color:n,fontSize:"14px",strokeWidth:2}),e.createElement(hl,null,e.createElement("span",{className:"yt-cart-empty-signin-link",onClick:l,style:{color:n,textDecorationLine:"underline",cursor:"pointer"}},"Sign-in")," ",e.createElement("span",{className:"yt-cart-empty-signin-suffix",style:{color:"black"}},"to avail offers"))),d&&d.length>0&&e.createElement(bl,{className:"yt-cart-empty-button-container"},d.map((t,r)=>e.createElement("button",{key:`empty-cart-button-${r}`,onMouseEnter:()=>$(r),onMouseLeave:()=>$(null),onClick:()=>ba(t.link),className:"yt-cart-empty-button",style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:B===r?c||"#73DABB":"#CACACA30",color:B===r?u:"#333333",padding:"12px 24px",cursor:"pointer",border:"1px solid #D1D1D1",borderRadius:"rounded"===m?`${p}px`:"0px",transition:"all 0.2s ease",width:"100%",fontSize:"14px",fontWeight:500,textTransform:"capitalize"}},t.title)))),T&&f&&g&&y&&e.createElement("div",{className:"yt-cart-empty-recommendations",style:{width:"100%",marginTop:"20px",marginBottom:"20px"}},e.createElement(_i,{products:f,addCartItem:y,productRecsTitleText:k,productRecsCtaButtonText:x,ctaButtonBackgroundColor:h,ctaButtonTextColor:b,primaryTextColor:w,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:C,variantPickerUiVariant:E,variant:"scroll",cardLayout:"vertical",cartComponentsCornerRadius:p,cartComponentsCornerType:m,backgroundSubdued:S,tertiaryColor:N,tertiaryTextColor:z}))),e.createElement("button",{className:"yt-cart-empty-continue-shopping",onMouseEnter:()=>F(!0),onMouseLeave:()=>F(!1),onClick:()=>ba(s??"/",!0),style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px",backgroundColor:I?"#CACACA50":"#CACACA30",padding:"16px 40px",cursor:"pointer",border:"none",transition:"all 0.2s ease",width:"100%",justifyContent:"center",borderRadius:0,backgroundImage:"none",marginTop:"auto"}},e.createElement(St,{color:w}),e.createElement("span",{className:"yt-cart-empty-continue-text",style:{textTransform:"uppercase",fontSize:"12px",fontWeight:600,color:w,cursor:"pointer"}},"Continue Shopping")))}const vl=ze("gstNumber",""),Cl=ze("gstCompanyName",""),El=ke("");xr("/* Body when cart drawer is open */\nbody.drawer-open {\n overflow: hidden;\n}\n\n/* Quantity Selector */\n.qty-selector-decrement-button {\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n flex-wrap: nowrap !important;\n margin: 0 !important;\n cursor: pointer;\n width: 25px !important;\n height: 22px !important;\n min-height: 22px !important;\n padding: 10px !important;\n border: 0 !important;\n outline: none;\n /* focus:outline-none */\n background-color: #ffffff;\n color: black !important;\n border-radius: 0px !important;\n font-size: 16px !important;\n font-weight: 200 !important;\n min-width: fit-content;\n box-shadow: none;\n}\n\n.qty-selector-decrement-button:hover {\n background-color: #e5e7eb;\n /* hover:bg-gray-200 */\n}\n\n.qty-selector-input {\n background-color: white !important;\n /* bg-white */\n text-align: center;\n /* text-center */\n color: #111827;\n /* text-gray-900 */\n font-size: 1.1rem;\n /* text-sm */\n display: block;\n /* block */\n width: 3.4rem;\n /* w-12 */\n height: 28px;\n border: 0;\n margin: 0;\n}\n\nform .qty-selector-input {\n min-height: 22px !important;\n height: auto !important;\n text-align: center !important;\n line-height: 22px !important;\n box-shadow: none;\n}\n\n@media screen and (max-width: 450px) {\n .qty-selector-decrement-button {\n width: 30px;\n height: 28px;\n padding: 10px;\n }\n .qty-selector-input {\n height: 28px;\n width: 2rem;\n }\n}\n.yt-cart-close-button {\n transition: transform 0.5s ease-in-out !important;\n}\n\n.yt-cart-close-button:hover {\n transform: rotate(360deg);\n}\n\n.qty-selector-decrement-button,\n.yt-checkout-button,\n.yt-sticky-buy-now-button {\n background-image: none !important;\n}\n\nbutton.yt-checkout-button,\nbutton.yt-sticky-buy-now-button,\nbutton.add-to-cart-button {\n min-height: auto !important;\n line-height: normal !important;\n}\n\n.yt-cart-title-container {\n display: -webkit-flex !important;\n display: -moz-flex !important;\n display: -ms-flexbox !important;\n display: flex !important;\n align-items: center !important;\n gap: 8px !important;\n flex-direction: row !important;\n flex-wrap: nowrap !important;\n}\n\n.yt-cart-details-button {\n margin-left: 5px;\n background: none;\n border: none;\n color: #d3122a;\n cursor: pointer;\n font-size: 12px;\n font-weight: 600;\n text-decoration: underline;\n padding: 0 !important;\n min-height: 10px !important;\n}\n\n.delete-icon,\n.edit-icon {\n height: 24px !important;\n width: 24px !important;\n}\n\n:root {\n --yt-base-color: #ddd;\n --yt-shine-color: #e8e8e8;\n --yt-animation-duration: 1.6s;\n --yt-cart-skeleton-loader-media-offset: 68px;\n /* 52px + 16px */\n}\n\n.yt-cart-skeleton-loader-container {\n display: flex;\n flex-direction: column;\n margin-top: 15px;\n}\n\n.yt-cart-skeleton-loader-item {\n width: 250px;\n height: 80px;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-media {\n float: left;\n width: 52px;\n height: 52px;\n background-color: #ccc;\n border-radius: 25%;\n margin: 8px;\n background-image: linear-gradient(90deg, var(--yt-base-color) 0px, var(--yt-shine-color) 40px, var(--yt-base-color) 80px);\n background-size: 600px;\n animation: shine-yt-cart-skeleton-loader-media var(--yt-animation-duration) infinite linear;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-line {\n float: left;\n width: 180px;\n height: 16px;\n margin-top: 12px;\n border-radius: 7px;\n background-image: linear-gradient(90deg, var(--yt-base-color) 0px, var(--yt-shine-color) 40px, var(--yt-base-color) 80px);\n background-size: 600px;\n animation: shine-lines var(--yt-animation-duration) infinite linear;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-media + .yt-cart-skeleton-loader-line {\n margin-top: 11px;\n width: 140px;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-line ~ .yt-cart-skeleton-loader-line {\n background-color: var(--yt-base-color);\n}\n\n@keyframes shine-lines {\n 0% {\n background-position: -100px;\n }\n 40%, 100% {\n background-position: 140px;\n }\n}\n@keyframes shine-yt-cart-skeleton-loader-media {\n 0% {\n background-position: calc(-100px + var(--yt-cart-skeleton-loader-media-offset));\n }\n 40%, 100% {\n background-position: calc(140px + var(--yt-cart-skeleton-loader-media-offset));\n }\n}\n.yt-loyalty-cta-container {\n box-shadow: 0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549);\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 10px;\n border-radius: 10px;\n}\n\n.yt-loyalty-apply-cta-loading-container {\n box-shadow: 0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549);\n border: 1px solid #e5e7e8;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 10px;\n border-radius: 10px;\n position: relative;\n overflow: hidden;\n margin: 0 1rem;\n min-height: 54.5px;\n background: #fafafa;\n z-index: 100;\n}\n\n.yt-loyalty-cta-progress-bar-container {\n width: 100%;\n height: 2px;\n background-color: #f0f0f0;\n position: absolute;\n bottom: 0;\n left: 0;\n z-index: 100;\n}\n\n.yt-loyalty-cta-progress-bar {\n height: 100%;\n background-color: red;\n transition: width 2.25s ease-in-out;\n z-index: 100;\n}");const kl=ze("postalCode",void 0);function Sl({isCartPageEnabled:n,checkoutButtonColor:i,checkoutFontSize:l,cartConfigData:s,checkoutFunction:c,discountApplied:d,discountInCheckoutButton:p,discountAmountApplied:m,minimumCartValue:u,themeTextColor:g,applyGSTToCart:f,showGSTOption:y,applyNoteToCart:x,showNoteOption:h,enableGeoLocationDeliveryRestriction:b,applyPostalCodeAndDeliverySlotToCart:w,enableSlotPicker:v,isStickyCheckout:C,cartComponentsCornerType:E,cartComponentsCornerRadius:k,checkoutSectionMessage:S,checkoutSectionMessageDisplay:T,checkoutSectionMessageRedirectLink:N,showDiscountOnMRP:z,tertiaryColor:I,tertiaryTextColor:F,cartCheckpoints:B,toggleDecimal:$,disableCheckoutButton:A,checkoutButtonBottomSpacing:P=8,showCheckoutButtonPaymentIcons:D,primaryTextColor:_,hideSubtotalAndBadge:R=!1,showTrustedBadge:L,trustedBadgeData:O,isLargeScreen:M,uploadImageStatus:W="not-required",uploadImageRequired:V=!1,onUploadImageRequired:H}){const j=Ne(Zr),q=Ne(vl),U=Ne(Cl),Y=Ne(El),Q=Ne(Kr),G=Ne(Xr),Z=Ne(kl),X=Ne(en),K=Ne(Jr),{cartLoading:J}=Ne(tn),ee=a(!1);""!==Y&&(ee.current=!0);const te=!!h&&!!x&&(""!==Y||ee.current),re=a(null);r(()=>{if(!te)return;re.current=Y;const e=setTimeout(()=>{re.current=null,x(Y).catch(()=>{})},200);return()=>clearTimeout(e)},[Y]),r(()=>()=>{null!==re.current&&x?.(re.current).catch(()=>{})},[]);const[ne,oe]=t(!1),[ae,ie]=t(""),le=cn(j,j?.currency),[se,ce]=t("closed"),de=a(null),pe=o(()=>((e,t=.2)=>{if(!e)return"#000000";try{const r=e.trim();if(r.startsWith("#")&&(7===r.length||9===r.length)){const e=parseInt(r.slice(1,3),16),n=parseInt(r.slice(3,5),16),o=parseInt(r.slice(5,7),16),a=9===r.length?parseInt(r.slice(7,9),16):void 0,i=Math.max(0,Math.min(255,Math.floor(e*(1-t)))),l=Math.max(0,Math.min(255,Math.floor(n*(1-t)))),s=Math.max(0,Math.min(255,Math.floor(o*(1-t)))),c=`#${i.toString(16).padStart(2,"0")}${l.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`;return void 0!==a?`${c}${a.toString(16).padStart(2,"0")}`:c}return e}catch{return e}})(I,.22),[I]),me=o(()=>an(u??0,j?.currency??"INR"),[u,j?.currency]),ue=o(()=>oa($?me.toFixed(2):me.toFixed(0)),[me,$]),ge=a(null),fe=a(null),ye=a(null),xe=()=>{ce("closing"),setTimeout(()=>{ce("closed")},300)},he=an(j?.original_total_price,j?.currency),be=o(()=>B?.find(e=>"free_delivery"===e.couponType&&void 0!==e.discountValue),[B]),we=o(()=>!(!be||!be.minimumOrderValue)&&he>=be.minimumOrderValue,[be,he]),ve=we&&be&&be.discountValue||0,Ce=m?an(m,j?.currency??"INR"):0,Ee=Number((he-Ce).toFixed(2)),ke=o(()=>{if(!j?.items?.length)return 0;const e=j.items.reduce((e,t)=>e+(z?Math.max(la(t,j?.currency),t.original_price):t.original_price)*t.quantity,0);return an(e,j?.currency)},[j?.items,z]),Se=o(()=>we?ke+ve:ke,[we,ke,ve]),Te=o(()=>me>0&&he<=me?`Add products worth more than ${le}${ue}`:"",[me,he,le,ue]),ze=o(()=>j?.items?.length?j.items.reduce((e,t)=>e+Math.max(la(t,j?.currency)-t.original_price,0)*t.quantity,0):0,[j?.items]),Ie=an(ze,j?.currency??"INR");r(()=>{ge.current&&na(ge.current),fe.current&&na(fe.current),ye.current&&na(ye.current)},[i,Ce,z,Ie,se,ve]);const Fe=o(()=>{const e={};return j?.items?.length?(j.items.forEach(t=>{t.discounts&&Array.isArray(t.discounts)&&t.discounts.forEach(t=>{e[t.title]=(e[t.title]||0)+t.amount})}),e):e},[j?.items]),Be=o(()=>{const e=[];for(const t in Fe)if(Object.prototype.hasOwnProperty.call(Fe,t)){const r=Fe[t],n=an(r,j?.currency??"INR"),o=sa(t);e.push({title:o,amount:n})}return e},[Fe,j?.currency]),$e=o(()=>{let e=0;return e+=z?Ce+Ie:Ce,we&&(e+=ve),e},[Ce,Ie,z,we,ve]),Ae=async e=>{if(V)return e?.preventDefault?.(),void H?.();if(ie(""),"checking"===W||"error"===W){e?.preventDefault?.();const t=window.ytUploadImageCheck;if(!t)return void ie("Couldn't check image upload requirements. Click Checkout to retry.");oe(!0);try{if("required"===await t())return oe(!1),void H?.()}catch{return oe(!1),void ie("Couldn't check image upload requirements. Click Checkout to retry.")}}if(oe(!0),Ee<=0)oe(!1);else{if(b){if("standard"!==K&&(v?!Q:!G.isPostalCodeValid))return void oe(!1);if(w)try{"standard"===K?await w(K):await w(K,String(Z)||"",X&&v?new Date(X).toDateString():"")}catch(e){console.error("Error applying postal code and delivery slot"),alert("There was an error processing your delivery options. Please try again.")}}y&&f&&""!==U&&""!==q&&await f(q,U),te&&await x(Y),await c(e),oe(!1)}},Pe=Ee<=0||!V&&(!(!A&&!J)||!!b&&("standard"!==K&&(v?!Q:!G.isPostalCodeValid))),[De,_e]=t(!!n),Re=a(null),[Le,Oe]=t("0px");r(()=>{n&&_e(!0)},[n]),r(()=>{Re.current&&Oe(De?`${Re.current.scrollHeight}px`:"0px")},[De,Be,we]);const Me=()=>{_e(!De)};r(()=>{function e(e){de.current&&!de.current.contains(e.target)&&xe()}return"open"!==se&&"opening"!==se||document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[se]);const We=O?.badgeImage?.path||"",Ve=s?.checkoutTextName||"Checkout",He=(t,r=Ve)=>t?e.createElement("span",{className:"yt-cart-checkout-loading-text",style:{fontSize:"13px",width:"100%",textAlign:"center"}},"Redirecting to Checkout..."):D?e.createElement("div",{className:"yt-cart-checkout-button-content",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},e.createElement("span",{className:"yt-cart-summary-checkout-span",style:{fontSize:"16px"}},r),e.createElement("div",{className:"yt-cart-checkout-payment-methods",style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},e.createElement("img",{className:"yt-cart-checkout-payment-icons",src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),e.createElement(zt,{className:"yt-cart-summary-checkout-next-icon",fontSize:"24px"}))):e.createElement("div",{className:"yt-cart-checkout-button-content",style:{alignItems:"center",display:"flex",columnGap:"5px",pointerEvents:"none"}},"Proceed to Checkout"!==r&&e.createElement(qe,{fontSize:"20px"}),e.createElement("span",{className:"yt-cart-checkout-button-text",style:{fontSize:"16px",pointerEvents:"none"}},r));return e.createElement("div",{className:"yt-cart-checkout-section",style:{position:"relative"}},ae&&e.createElement("div",{className:"yt-cart-upload-image-check-error",role:"alert",style:{color:"#b91c1c",fontSize:"12px",padding:"6px 12px",textAlign:"center"}},ae),!!S&&S.length>0&&!aa()&&(()=>{const t=T||"ribbon";if("ribbon"===t)return e.createElement("div",{className:"yt-cart-bottom-bar",style:{fontSize:"10px",textAlign:"center",backgroundColor:I,padding:"3px",boxShadow:"1px 2px 4px 0px #00000061",color:F,marginBottom:R?"0px":"4px",borderTopLeftRadius:"14px",borderTopRightRadius:"14px",cursor:N?"pointer":"default"},onClick:()=>{N&&ba(N)}},S);const r=({children:r})=>e.createElement("div",{className:"yt-cart-checkout-ribbon-container",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",padding:M?"0 55px":"0 13px",marginBottom:"4px",position:"bookmark"===t?"absolute":"static",top:"bookmark"===t?"-11px":void 0,cursor:N?"pointer":"default"},onClick:()=>{N&&ba(N)}},r);return"tag"===t?e.createElement(r,null,e.createElement("div",{className:"yt-cart-checkout-ribbon-tag-container",style:{display:"flex",alignItems:"center",width:"100%"}},e.createElement("svg",{className:"yt-cart-checkout-ribbon-tag-left",width:"20",height:"26",viewBox:"0 0 20 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flex:"0 0 auto"}},e.createElement("path",{d:"M0 0H20V20H0L7.41935 10.7639L0 0Z",fill:pe}),e.createElement("path",{d:"M12.2581 5.80645L20 0V5.80645H12.2581Z",fill:"black",fillOpacity:"0.36"}),e.createElement("path",{d:"M12 5.80646L20 5.80645V25.8065H12V5.80646Z",fill:I})),e.createElement("div",{className:"yt-cart-checkout-ribbon-tag-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:I,color:F,padding:"8px 16px",fontSize:"10px",marginTop:"5px",lineHeight:"5px"}},S),e.createElement("svg",{className:"yt-cart-checkout-ribbon-tag-right",width:"20",height:"26",viewBox:"0 0 20 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flex:"0 0 auto"}},e.createElement("path",{d:"M20 0H0V20H20L12.5806 10.7639L20 0Z",fill:pe}),e.createElement("path",{d:"M7.74194 5.80645L0 0V5.80645H7.74194Z",fill:"black",fillOpacity:"0.36"}),e.createElement("path",{d:"M8 5.80646L0 5.80645V25.8065H8V5.80646Z",fill:I})))):e.createElement(r,null,e.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-container",style:{display:"flex",alignItems:"center",width:"100%"}},e.createElement("svg",{className:"yt-cart-checkout-ribbon-bookmark-left",width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M8.34334 4.75V9.5H0V4.75C0 2.12665 1.86772 0 4.17167 0C6.47562 0 8.34334 2.12665 8.34334 4.75Z",fill:pe}),e.createElement("path",{d:"M12.1545 19H13.9056V0H4.17167C6.27666 0 7.98284 1.943 7.98284 4.33981V14.25C7.98284 16.8734 9.85056 19 12.1545 19Z",fill:I})),e.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:I,color:F,padding:"8px 16px",fontSize:"10px",lineHeight:"3px",marginRight:"-1px",marginLeft:"-1px"}},S),e.createElement("svg",{className:"yt-cart-checkout-ribbon-bookmark-right",width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M5.65666 4.75V9.5H14V4.75C14 2.12665 12.1323 0 9.82833 0C7.52438 0 5.65666 2.12665 5.65666 4.75Z",fill:pe}),e.createElement("path",{d:"M1.84549 19H0.0944166V0H9.82833C7.72334 0 6.01716 1.943 6.01716 4.33981V14.25C6.01716 16.8734 4.14944 19 1.84549 19Z",fill:I}))))})(),(!0===p||"true"===p)&&!n&&"closed"!==se&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-checkout-popout-overlay",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",opacity:"open"===se?1:0,transition:"opacity 0.3s ease-in-out",display:"block",zIndex:2147483643},onClick:xe}),e.createElement("div",{className:"yt-cart-checkout-popout",ref:de,style:{position:"fixed",bottom:0,left:0,right:0,zIndex:2147483644,transform:"open"===se?"translateY(0)":"translateY(100%)",transition:"transform 0.3s cubic-bezier(0.22, 1, 0.36, 1)"}},e.createElement("div",{className:"yt-cart-checkout-popout-header",style:{backgroundColor:"#F1F1F1",padding:"1rem",display:"flex",justifyContent:"space-between",alignItems:"center",color:"#000000",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",fontWeight:"bold",fontSize:"16px"}},e.createElement("span",{className:"yt-cart-checkout-popout-title"},"Price Summary"),e.createElement("button",{className:"yt-cart-checkout-popout-close",onClick:xe,style:{background:"none",border:"none",color:"#000000",fontSize:"16px",fontWeight:"bold",cursor:"pointer",padding:0,marginLeft:"auto",transition:"transform 0.3s ease"}},"✕")),e.createElement("div",{className:"yt-cart-checkout-popout-content",style:{backgroundColor:"white",padding:"10px 1rem 0"}},e.createElement(e.Fragment,null,(z&&Ie>0||d&&Be.length>0||we&&ve>0)&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-subtotal-row",style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{className:"yt-cart-subtotal-label",style:{fontSize:"14px",color:"#212529"}},"Subtotal"),e.createElement("span",{className:"yt-cart-subtotal-value",style:{fontSize:"14px",color:"#212529"}},le,oa(we?$?Se.toFixed(2):Se.toFixed(0):$?ke.toFixed(2):ke.toFixed(0)))),(Ce>0||z&&Ie>0||we&&ve>0)&&e.createElement("div",{className:"yt-cart-checkout-popout-discounts",style:{display:"flex",flexDirection:"column",paddingBottom:"5px",marginTop:"5px",fontWeight:"600"}},z&&Ie>0&&e.createElement("div",{className:"yt-cart-discount-row",style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},e.createElement("span",{className:"yt-cart-discount-label"},"Discount on MRP"),e.createElement("span",{className:"yt-cart-discount-value",style:{color:"#D3122A"}},"-",le,oa($?Ie.toFixed(2):Ie.toFixed(0)))),we&&ve>0&&e.createElement("div",{className:"yt-cart-discount-row",style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},e.createElement("span",{className:"yt-cart-discount-label"},"Free Shipping"),e.createElement("span",{className:"yt-cart-discount-value",style:{color:"#D3122A"}},"-",le,oa($?ve.toFixed(2):ve.toFixed(0)))),Be.map(t=>e.createElement("div",{className:"yt-cart-discount-row",key:t.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#1E1E1E"}},e.createElement("span",{className:"yt-cart-discount-label"},t.title),e.createElement("span",{className:"yt-cart-discount-value",style:{color:"#D3122A"}},"-",le,oa($?t.amount.toFixed(2):t.amount.toFixed(0))))),$e>0&&e.createElement("div",{className:"yt-cart-total-savings-row",style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529",marginTop:"5px",paddingTop:"5px",borderTop:"1px solid #E5E7EB"}},e.createElement("span",{className:"yt-cart-total-savings-label"},"Total Savings"),e.createElement("span",{className:"yt-cart-total-savings-value",style:{color:"#D3122A",fontWeight:"bold"}},"-",le,oa($?$e.toFixed(2):$e.toFixed(0))))),(Ce>0||z&&Ie>0||we&&ve>0)&&e.createElement("div",{className:"yt-cart-checkout-popout-divider",style:{height:"12px",display:"flex",background:"#F5F5F5",width:"calc(100% + 2rem)",margin:"10px -1rem 0 -1rem",position:"relative",borderTop:"0.8px solid #C5C5C5",borderBottom:"0.8px solid #C5C5C5"}}))),e.createElement("div",{className:"yt-cart-grand-total-row",style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:Ce>0||z&&Ie>0||we&&ve>0?"10px":"0"}},e.createElement("div",{className:"yt-cart-grand-total-label-group",style:{display:"flex",flexDirection:"column"}},e.createElement("span",{className:"yt-cart-grand-total-label",style:{fontSize:"14px",fontWeight:"600",color:"#212529"}},"Grand Total"),e.createElement("span",{className:"yt-cart-tax-note",style:{fontSize:"9px",color:"#4A5157"}},"Inclusive of all taxes")),e.createElement("span",{className:"yt-cart-grand-total-value",style:{fontSize:"16px",color:"black",fontWeight:"var(--yt-cart-font-weight)"}},le,oa($?Ee.toFixed(2):Ee.toFixed(0)))),e.createElement("div",{className:"yt-cart-savings-banner",style:{display:"flex",background:I,color:F,width:"calc(100% + 2rem)",margin:"10px -1rem 0 -1rem",position:"relative",fontSize:"12px",fontWeight:"600",justifyContent:"center",alignItems:"center",gap:"5px",padding:"4px 0"}},e.createElement("img",{className:"yt-cart-savings-icon",src:"https://r2.yourtoken.io/image%2016.png",alt:"confetti-image",style:{width:"30px",height:"30px"}}),"You saved"," ",e.createElement("span",{className:"yt-cart-savings-value"},le,oa($?$e.toFixed(2):$e.toFixed(0)))," ","on your order")),e.createElement("button",{type:"button",ref:fe,id:"yt-checkout-button-popout",className:"yt-checkout-button",onClick:Ae,disabled:Pe,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:0,height:"45px",padding:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:i,border:0,textTransform:"uppercase",fontSize:l,letterSpacing:"1px",opacity:Pe?.9:1,cursor:Pe?"not-allowed":"pointer",borderRadius:"0px",boxShadow:"none",width:"100%"}},He(ne)))),(!0===p||"true"===p)&&A&&Pe&&Te&&e.createElement("div",{className:"yt-cart-checkout-disabled-message",style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},Te),!0!==p&&"true"!==p||n?e.createElement(e.Fragment,null,A&&Pe&&Te&&e.createElement("div",{className:"yt-cart-checkout-disabled-message",style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},Te),e.createElement("div",{className:"yt-cart-checkout-summary",style:{display:"flex",flexDirection:"column",rowGap:"5px",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:R?"0px":"10px"}},e.createElement("div",{className:"yt-cart-checkout-breakdown",style:{display:R?"none":"flex",flexDirection:"column",rowGap:"2px",margin:"0 1rem",color:_}},(Ie>0||d&&Be.length>0||we&&ve>0)&&$e>0&&e.createElement(e.Fragment,null,n&&e.createElement("div",{className:"yt-cart-price-summary-text",style:{backgroundColor:"#575757",fontSize:"16px",margin:"-0.5rem -1rem",padding:"10px",fontFamily:"Poppins",fontWeight:"500"}},e.createElement("span",{className:"yt-cart-price-summary-title",style:{color:"white"}},"Price Summary")),e.createElement("div",{className:"yt-cart-subtotal-row",style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:n?"20px":"0"}},e.createElement("span",{className:"yt-cart-subtotal-label",style:{fontSize:"12px"}},"Subtotal"),e.createElement("span",{className:"yt-cart-subtotal-value",style:{fontSize:"14px"}},le,oa(we?$?Se.toFixed(2):Se.toFixed(0):$?ke.toFixed(2):ke.toFixed(0)))),(Ce>0||Ie>0||we&&ve>0)&&e.createElement("div",{className:"yt-cart-discounts-section",style:{display:"flex",flexDirection:"column",paddingBottom:"5px"}},e.createElement("div",{className:"yt-cart-discounts-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{className:"yt-cart-discounts-label",style:{fontSize:"12px",fontWeight:"600",display:"flex",alignItems:"center"}},"Discounts Applied",!n&&e.createElement("button",{onClick:Me,className:"yt-cart-details-button",style:{marginBottom:"0",marginLeft:"5px",background:"none",border:"none",color:"#7E7E7E",cursor:"pointer",fontSize:"12px",fontWeight:"600",textDecoration:"underline",padding:"0 !important",minHeight:"10px !important",boxShadow:"none",minWidth:"fit-content",height:"auto",lineHeight:"normal",marginTop:"0"}},De?"Hide details":"See details")),e.createElement("span",{className:"yt-cart-discounts-total",style:{fontSize:"14px",color:"#D3122A",fontWeight:"600"}},"-",le,oa($?$e.toFixed(2):$e.toFixed(0)))),e.createElement("div",{className:"yt-cart-discounts-details",ref:Re,style:{height:Le,overflow:"hidden",transition:"height 0.3s ease, opacity 0.3s ease",opacity:De?1:0,marginTop:De?"5px":"0",borderTop:De?"1px solid #E5E7EB":"none",paddingTop:De?"5px":"0",fontWeight:"600"}},z&&Ie>0&&e.createElement("div",{className:"yt-cart-discount-row",style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",{className:"yt-cart-discount-label"},"Discount on MRP"),e.createElement("span",{className:"yt-cart-discount-value",style:{color:"#D3122A"}},"-",le,oa($?Ie.toFixed(2):Ie.toFixed(0)))),we&&ve>0&&e.createElement("div",{className:"yt-cart-discount-row",style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",{className:"yt-cart-discount-label"},"Free Shipping"),e.createElement("span",{className:"yt-cart-discount-value",style:{color:"#D3122A"}},"-",le,oa($?ve.toFixed(2):ve.toFixed(0)))),Be.map(t=>e.createElement("div",{className:"yt-cart-discount-row",key:t.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",{className:"yt-cart-discount-label"},t.title),e.createElement("span",{className:"yt-cart-discount-value",style:{color:"#D3122A"}},"-",le,oa($?t.amount.toFixed(2):t.amount.toFixed(0))))))),e.createElement("hr",{className:"yt-cart-checkout-divider",style:{height:"1px",margin:"2px 0",backgroundColor:"#E5E7EB",border:"none",maxWidth:"unset"}})),e.createElement("div",{className:"yt-cart-total-row",style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{className:"yt-cart-total-label",style:{fontSize:"14px",fontWeight:"600"}},"Total"),e.createElement("span",{className:"yt-cart-total-value",style:{fontSize:"16px",fontWeight:"var(--yt-cart-font-weight)"}},le,oa($?Ee.toFixed(2):Ee.toFixed(0))))),e.createElement("button",{type:"button",ref:ge,id:"yt-checkout-button",className:"yt-checkout-button",onClick:Ae,disabled:Pe,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"closed"!==se||C?"0":`4px 1rem ${P}px 1rem`,height:"45px",paddingTop:"10px",paddingBottom:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:i,border:0,color:g??"white",textTransform:"uppercase",fontSize:l,letterSpacing:"1px",opacity:Pe?.9:1,cursor:Pe?"not-allowed":"pointer",borderRadius:"closed"!==se?"0px":"rounded"===E?`${k}px`:"0px",boxShadow:"none"}},He(ne,Ve)),L&&We&&!R&&e.createElement("div",{className:"yt-cart-powered-by-badge",style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0px 6px"}},e.createElement("img",{className:"yt-cart-trusted-badge-image",src:We,alt:"Trusted Badge",style:{height:"auto",width:"340px",maxHeight:"50px"}})))):e.createElement("div",{className:"yt-cart-checkout-section-concise-container",style:{display:"flex",flexDirection:"column",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:"10px"}},e.createElement("div",{className:"yt-cart-checkout-concise-row",style:{display:"flex",flexDirection:"row",alignItems:"stretch",justifyContent:"space-between",width:"auto",padding:C?"7px 0 8px 8px":`7px 8px ${P}px 8px`}},e.createElement("div",{className:"yt-cart-checkout-concise-summary",style:{display:"flex",flexDirection:"column",textAlign:"center",justifyContent:"center",alignItems:"flex-start",paddingRight:"2rem",overflowWrap:"normal"}},(Ce>0||z&&Ie>0||we&&ve>0)&&e.createElement("div",{className:"yt-cart-checkout-save-badge",ref:ye,style:{fontSize:"9px",backgroundColor:i,width:"max-content",padding:"2px 8px"}},"Saving ",le,oa($?$e.toFixed(2):$e.toFixed(0))),ne?e.createElement("div",{className:"yt-cart-checkout-concise-loading",style:{fontSize:"12px",color:"#4a4a4a"}},"Redirecting to Checkout..."):d||we&&be?e.createElement("div",{className:"yt-cart-checkout-concise-price-wrapper"},e.createElement("div",{className:"yt-cart-checkout-concise-price-row",style:{display:"flex",alignItems:"baseline",justifyContent:"center"}},e.createElement("span",{className:"yt-cart-checkout-concise-total",style:{fontSize:"15px",color:"#1E1E1E",fontWeight:"600"}},le,oa($?Ee.toFixed(2):Ee.toFixed(0))),(Ce>0||Ie>0||we&&ve>0)&&e.createElement("span",{className:"yt-cart-checkout-concise-compare-total",style:{fontSize:"14px",color:"#8C8C8C",textDecoration:"line-through",marginLeft:"4px",fontWeight:"normal"}},le,oa(we?Se.toFixed(0):ke.toFixed(0))))):e.createElement("div",{className:"yt-cart-checkout-concise-total",style:{fontSize:"18px",color:"#1E1E1E",fontWeight:"600"}},le,oa($?Ee.toFixed(2):Ee.toFixed(0))),(z&&Ie>0||d&&Ce>0||we&&ve>0)&&!n?e.createElement("div",{className:"yt-cart-checkout-concise-details-link",style:{fontSize:"11px",color:"#4A5157",width:"max-content",cursor:"pointer",textDecoration:"underline"},onClick:e=>{e.stopPropagation(),ce("opening"),requestAnimationFrame(()=>{ce("open")})}},"See Details"):e.createElement("div",{className:"yt-cart-checkout-concise-tax-note",style:{fontSize:"9px",color:"#4A5157",width:"max-content"}},"Inclusive of all taxes")),e.createElement("div",{className:"yt-cart-checkout-concise-button-wrapper",style:{display:"flex",justifyContent:"center",width:"100%"}},e.createElement("button",{type:"button",ref:ge,id:"yt-checkout-button",className:"yt-checkout-button",onClick:Ae,disabled:Pe,style:{backgroundColor:i,border:0,textTransform:"uppercase",letterSpacing:"1px",fontSize:"12px",padding:"10px 15px",opacity:Pe?.9:1,cursor:Pe?"not-allowed":"pointer",borderRadius:"rounded"===E?`${k}px`:"0px",width:"100%",margin:"0 auto",boxShadow:"none"}},D?e.createElement("div",{className:"yt-cart-checkout-concise-button-content",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},e.createElement("span",{className:"yt-cart-checkout-button-text",style:{fontSize:"12px"}},Ve),e.createElement("div",{className:"yt-cart-checkout-payment-methods",style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},e.createElement("img",{className:"yt-cart-checkout-payment-icons",src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),e.createElement(zt,{fontSize:"24px"}))):Ve))),L&&!R&&We&&e.createElement("div",{className:"yt-cart-powered-by-badge",style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0 6px"}},e.createElement("img",{className:"yt-cart-trusted-badge-image",src:We,alt:"Trusted Badge",style:{height:"auto",width:"340px",maxHeight:"50px"}}))))}const Tl=d.button`
|
|
1089
|
+
`;function wl({showLoyaltyCta:r,exploreCTAColor:n="#73DABB",emptyCartTitle:o="Your Cart is Empty",emptyCartDescription:a,isUserSignedIn:i=!1,joinNowFunction:l,exploreCtaRedirectLink:s,themeColor:c,emptyCartButtons:d=[],cartComponentsCornerRadius:p=0,cartComponentsCornerType:m="sharp",themeTextColor:u="white",isRecProductsListValid:g,recProductsList:f,addCartItem:y,productRecsCtaButtonText:x,ctaButtonBackgroundColor:h,ctaButtonTextColor:b,primaryTextColor:w,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:C,variantPickerUiVariant:E,emptyProductRecsTitleText:k="Empty cart Recommendations",backgroundSubdued:S,showEmptyCartRecommendations:T=!1,tertiaryColor:N,tertiaryTextColor:z}){const[I,F]=t(!1),[B,$]=t(null);return e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-empty-container",style:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",textAlign:"center",height:"100%",overflowY:"auto",marginTop:"5px"}},e.createElement("div",{className:"yt-cart-empty-content",style:{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"12px"}},e.createElement("svg",{className:"yt-empty-cart-svg",xmlns:"http://www.w3.org/2000/svg",width:"90",height:"80",viewBox:"0 0 79 67",fill:"none"},e.createElement("path",{d:"M78.3148 24.8681V27.0245C78.3148 28.8109 76.8667 30.259 75.0803 30.259H74.0021L70.4827 54.894C70.0275 58.081 67.298 60.4483 64.0787 60.4483H14.9214C11.7021 60.4483 8.97266 58.081 8.51726 54.894L4.99805 30.259H3.91987C2.13344 30.259 0.685303 28.8109 0.685303 27.0245V24.8681C0.685303 23.0817 2.13344 21.6335 3.91987 21.6335H12.9956L27.3868 1.84596C28.7877 -0.0802239 31.4848 -0.506243 33.4113 0.894727C35.3376 2.2957 35.7635 4.99292 34.3625 6.91924L23.6611 21.6335H55.339L44.6376 6.9191C43.2367 4.99292 43.6627 2.29556 45.589 0.894592C47.515 -0.506378 50.2125 -0.0804935 51.6135 1.84582L66.0045 21.6335H75.0803C76.8667 21.6335 78.3148 23.0817 78.3148 24.8681ZM42.7346 48.5882V33.4936C42.7346 31.7072 41.2865 30.259 39.5001 30.259C37.7136 30.259 36.2655 31.7072 36.2655 33.4936V48.5882C36.2655 50.3747 37.7136 51.8228 39.5001 51.8228C41.2865 51.8228 42.7346 50.3747 42.7346 48.5882ZM57.8293 48.5882V33.4936C57.8293 31.7072 56.3811 30.259 54.5947 30.259C52.8083 30.259 51.3601 31.7072 51.3601 33.4936V48.5882C51.3601 50.3747 52.8083 51.8228 54.5947 51.8228C56.3811 51.8228 57.8293 50.3747 57.8293 48.5882ZM27.64 48.5882V33.4936C27.64 31.7072 26.1919 30.259 24.4054 30.259C22.619 30.259 21.1709 31.7072 21.1709 33.4936V48.5882C21.1709 50.3747 22.619 51.8228 24.4054 51.8228C26.1919 51.8228 27.64 50.3747 27.64 48.5882Z",fill:v??"#4D4D4D"}),e.createElement("path",{d:"M78.0001 57C78.0001 62.5228 73.5229 67 68.0001 67C62.4772 67 58.0001 62.5228 58.0001 57C58.0001 51.4772 62.4772 47 68.0001 47C73.5229 47 78.0001 51.4772 78.0001 57Z",fill:N??"#D9D9D9"}),e.createElement("path",{d:"M64.7572 56.512C64.7572 55.128 65.0052 54.044 65.5012 53.26C66.0052 52.476 66.8372 52.084 67.9972 52.084C69.1572 52.084 69.9852 52.476 70.4812 53.26C70.9852 54.044 71.2372 55.128 71.2372 56.512C71.2372 57.904 70.9852 58.996 70.4812 59.788C69.9852 60.58 69.1572 60.976 67.9972 60.976C66.8372 60.976 66.0052 60.58 65.5012 59.788C65.0052 58.996 64.7572 57.904 64.7572 56.512ZM69.5812 56.512C69.5812 55.92 69.5412 55.424 69.4612 55.024C69.3892 54.616 69.2372 54.284 69.0052 54.028C68.7812 53.772 68.4452 53.644 67.9972 53.644C67.5492 53.644 67.2092 53.772 66.9772 54.028C66.7532 54.284 66.6012 54.616 66.5212 55.024C66.4492 55.424 66.4132 55.92 66.4132 56.512C66.4132 57.12 66.4492 57.632 66.5212 58.048C66.5932 58.456 66.7452 58.788 66.9772 59.044C67.2092 59.292 67.5492 59.416 67.9972 59.416C68.4452 59.416 68.7852 59.292 69.0172 59.044C69.2492 58.788 69.4012 58.456 69.4732 58.048C69.5452 57.632 69.5812 57.12 69.5812 56.512Z",fill:z??"black"})),e.createElement("span",{className:"yt-cart-empty-title",style:{color:w,fontWeight:"semibold"}},o),a&&e.createElement("span",{className:"yt-cart-empty-description",style:{color:"#929292",fontSize:"14px"}},a),!i&&r&&e.createElement("div",{className:"yt-cart-empty-signin-cta",style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px"}},e.createElement(Nt,{color:n,fontSize:"14px",strokeWidth:2}),e.createElement(hl,null,e.createElement("span",{className:"yt-cart-empty-signin-link",onClick:l,style:{color:n,textDecorationLine:"underline",cursor:"pointer"}},"Sign-in")," ",e.createElement("span",{className:"yt-cart-empty-signin-suffix",style:{color:"black"}},"to avail offers"))),d&&d.length>0&&e.createElement(bl,{className:"yt-cart-empty-button-container"},d.map((t,r)=>e.createElement("button",{key:`empty-cart-button-${r}`,onMouseEnter:()=>$(r),onMouseLeave:()=>$(null),onClick:()=>ba(t.link),className:"yt-cart-empty-button",style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:B===r?c||"#73DABB":"#CACACA30",color:B===r?u:"#333333",padding:"12px 24px",cursor:"pointer",border:"1px solid #D1D1D1",borderRadius:"rounded"===m?`${p}px`:"0px",transition:"all 0.2s ease",width:"100%",fontSize:"14px",fontWeight:500,textTransform:"capitalize"}},t.title)))),T&&f&&g&&y&&e.createElement("div",{className:"yt-cart-empty-recommendations",style:{width:"100%",marginTop:"20px",marginBottom:"20px"}},e.createElement(_i,{products:f,addCartItem:y,productRecsTitleText:k,productRecsCtaButtonText:x,ctaButtonBackgroundColor:h,ctaButtonTextColor:b,primaryTextColor:w,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:C,variantPickerUiVariant:E,variant:"scroll",cardLayout:"vertical",cartComponentsCornerRadius:p,cartComponentsCornerType:m,backgroundSubdued:S,tertiaryColor:N,tertiaryTextColor:z}))),e.createElement("button",{className:"yt-cart-empty-continue-shopping",onMouseEnter:()=>F(!0),onMouseLeave:()=>F(!1),onClick:()=>ba(s??"/",!0),style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px",backgroundColor:I?"#CACACA50":"#CACACA30",padding:"16px 40px",cursor:"pointer",border:"none",transition:"all 0.2s ease",width:"100%",justifyContent:"center",borderRadius:0,backgroundImage:"none",marginTop:"auto"}},e.createElement(St,{color:w}),e.createElement("span",{className:"yt-cart-empty-continue-text",style:{textTransform:"uppercase",fontSize:"12px",fontWeight:600,color:w,cursor:"pointer"}},"Continue Shopping")))}const vl=ze("gstNumber",""),Cl=ze("gstCompanyName",""),El=ke("");xr("/* Body when cart drawer is open */\nbody.drawer-open {\n overflow: hidden;\n}\n\n/* Quantity Selector */\n.qty-selector-decrement-button {\n display: flex !important;\n justify-content: center !important;\n align-items: center !important;\n flex-wrap: nowrap !important;\n margin: 0 !important;\n cursor: pointer;\n width: 25px !important;\n height: 22px !important;\n min-height: 22px !important;\n padding: 10px !important;\n border: 0 !important;\n outline: none;\n /* focus:outline-none */\n background-color: #ffffff;\n color: black !important;\n border-radius: 0px !important;\n font-size: 16px !important;\n font-weight: 200 !important;\n min-width: fit-content;\n box-shadow: none;\n}\n\n.qty-selector-decrement-button:hover {\n background-color: #e5e7eb;\n /* hover:bg-gray-200 */\n}\n\n.qty-selector-input {\n background-color: white !important;\n /* bg-white */\n text-align: center;\n /* text-center */\n color: #111827;\n /* text-gray-900 */\n font-size: 1.1rem;\n /* text-sm */\n display: block;\n /* block */\n width: 3.4rem;\n /* w-12 */\n height: 28px;\n border: 0;\n margin: 0;\n}\n\nform .qty-selector-input {\n min-height: 22px !important;\n height: auto !important;\n text-align: center !important;\n line-height: 22px !important;\n box-shadow: none;\n}\n\n@media screen and (max-width: 450px) {\n .qty-selector-decrement-button {\n width: 30px;\n height: 28px;\n padding: 10px;\n }\n .qty-selector-input {\n height: 28px;\n width: 2rem;\n }\n}\n.yt-cart-close-button {\n transition: transform 0.5s ease-in-out !important;\n}\n\n.yt-cart-close-button:hover {\n transform: rotate(360deg);\n}\n\n.qty-selector-decrement-button,\n.yt-checkout-button,\n.yt-sticky-buy-now-button {\n background-image: none !important;\n}\n\nbutton.yt-checkout-button,\nbutton.yt-sticky-buy-now-button,\nbutton.add-to-cart-button {\n min-height: auto !important;\n line-height: normal !important;\n}\n\n.yt-cart-title-container {\n display: -webkit-flex !important;\n display: -moz-flex !important;\n display: -ms-flexbox !important;\n display: flex !important;\n align-items: center !important;\n gap: 8px !important;\n flex-direction: row !important;\n flex-wrap: nowrap !important;\n}\n\n.yt-cart-details-button {\n margin-left: 5px;\n background: none;\n border: none;\n color: #d3122a;\n cursor: pointer;\n font-size: 12px;\n font-weight: 600;\n text-decoration: underline;\n padding: 0 !important;\n min-height: 10px !important;\n}\n\n.delete-icon,\n.edit-icon {\n height: 24px !important;\n width: 24px !important;\n}\n\n:root {\n --yt-base-color: #ddd;\n --yt-shine-color: #e8e8e8;\n --yt-animation-duration: 1.6s;\n --yt-cart-skeleton-loader-media-offset: 68px;\n /* 52px + 16px */\n}\n\n.yt-cart-skeleton-loader-container {\n display: flex;\n flex-direction: column;\n margin-top: 15px;\n}\n\n.yt-cart-skeleton-loader-item {\n width: 250px;\n height: 80px;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-media {\n float: left;\n width: 52px;\n height: 52px;\n background-color: #ccc;\n border-radius: 25%;\n margin: 8px;\n background-image: linear-gradient(90deg, var(--yt-base-color) 0px, var(--yt-shine-color) 40px, var(--yt-base-color) 80px);\n background-size: 600px;\n animation: shine-yt-cart-skeleton-loader-media var(--yt-animation-duration) infinite linear;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-line {\n float: left;\n width: 180px;\n height: 16px;\n margin-top: 12px;\n border-radius: 7px;\n background-image: linear-gradient(90deg, var(--yt-base-color) 0px, var(--yt-shine-color) 40px, var(--yt-base-color) 80px);\n background-size: 600px;\n animation: shine-lines var(--yt-animation-duration) infinite linear;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-media + .yt-cart-skeleton-loader-line {\n margin-top: 11px;\n width: 140px;\n}\n\n.yt-cart-skeleton-loader-item .yt-cart-skeleton-loader-line ~ .yt-cart-skeleton-loader-line {\n background-color: var(--yt-base-color);\n}\n\n@keyframes shine-lines {\n 0% {\n background-position: -100px;\n }\n 40%, 100% {\n background-position: 140px;\n }\n}\n@keyframes shine-yt-cart-skeleton-loader-media {\n 0% {\n background-position: calc(-100px + var(--yt-cart-skeleton-loader-media-offset));\n }\n 40%, 100% {\n background-position: calc(140px + var(--yt-cart-skeleton-loader-media-offset));\n }\n}\n.yt-loyalty-cta-container {\n box-shadow: 0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549);\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 10px;\n border-radius: 10px;\n}\n\n.yt-loyalty-apply-cta-loading-container {\n box-shadow: 0px 3px 3.8px 0px rgba(1, 1, 1, 0.231372549);\n border: 1px solid #e5e7e8;\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n padding: 10px;\n border-radius: 10px;\n position: relative;\n overflow: hidden;\n margin: 0 1rem;\n min-height: 54.5px;\n background: #fafafa;\n z-index: 100;\n}\n\n.yt-loyalty-cta-progress-bar-container {\n width: 100%;\n height: 2px;\n background-color: #f0f0f0;\n position: absolute;\n bottom: 0;\n left: 0;\n z-index: 100;\n}\n\n.yt-loyalty-cta-progress-bar {\n height: 100%;\n background-color: red;\n transition: width 2.25s ease-in-out;\n z-index: 100;\n}");const kl=ze("postalCode",void 0);function Sl({isCartPageEnabled:n,checkoutButtonColor:i,checkoutFontSize:l,cartConfigData:s,checkoutFunction:c,discountApplied:d,discountInCheckoutButton:p,discountAmountApplied:m,minimumCartValue:u,themeTextColor:g,applyGSTToCart:f,showGSTOption:y,applyNoteToCart:x,showNoteOption:h,enableGeoLocationDeliveryRestriction:b,applyPostalCodeAndDeliverySlotToCart:w,enableSlotPicker:v,isStickyCheckout:C,cartComponentsCornerType:E,cartComponentsCornerRadius:k,checkoutSectionMessage:S,checkoutSectionMessageDisplay:T,checkoutSectionMessageRedirectLink:N,showDiscountOnMRP:z,tertiaryColor:I,tertiaryTextColor:F,cartCheckpoints:B,toggleDecimal:$,disableCheckoutButton:A,checkoutButtonBottomSpacing:P=8,showCheckoutButtonPaymentIcons:D,primaryTextColor:_,hideSubtotalAndBadge:R=!1,showTrustedBadge:L,trustedBadgeData:O,isLargeScreen:M,uploadImageStatus:W="not-required",uploadImageRequired:V=!1,onUploadImageRequired:H}){const j=Ne(Zr),q=Ne(vl),U=Ne(Cl),Y=Ne(El),Q=Ne(Kr),G=Ne(Xr),Z=Ne(kl),X=Ne(en),K=Ne(Jr),{cartLoading:J}=Ne(tn),[ee,te]=t(!1),[re,ne]=t(""),oe=cn(j,j?.currency),[ae,ie]=t("closed"),le=a(null),se=o(()=>((e,t=.2)=>{if(!e)return"#000000";try{const r=e.trim();if(r.startsWith("#")&&(7===r.length||9===r.length)){const e=parseInt(r.slice(1,3),16),n=parseInt(r.slice(3,5),16),o=parseInt(r.slice(5,7),16),a=9===r.length?parseInt(r.slice(7,9),16):void 0,i=Math.max(0,Math.min(255,Math.floor(e*(1-t)))),l=Math.max(0,Math.min(255,Math.floor(n*(1-t)))),s=Math.max(0,Math.min(255,Math.floor(o*(1-t)))),c=`#${i.toString(16).padStart(2,"0")}${l.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`;return void 0!==a?`${c}${a.toString(16).padStart(2,"0")}`:c}return e}catch{return e}})(I,.22),[I]),ce=o(()=>an(u??0,j?.currency??"INR"),[u,j?.currency]),de=o(()=>oa($?ce.toFixed(2):ce.toFixed(0)),[ce,$]),pe=a(null),me=a(null),ue=a(null),ge=()=>{ie("closing"),setTimeout(()=>{ie("closed")},300)},fe=an(j?.original_total_price,j?.currency),ye=o(()=>B?.find(e=>"free_delivery"===e.couponType&&void 0!==e.discountValue),[B]),xe=o(()=>!(!ye||!ye.minimumOrderValue)&&fe>=ye.minimumOrderValue,[ye,fe]),he=xe&&ye&&ye.discountValue||0,be=m?an(m,j?.currency??"INR"):0,we=Number((fe-be).toFixed(2)),ve=o(()=>{if(!j?.items?.length)return 0;const e=j.items.reduce((e,t)=>e+(z?Math.max(la(t,j?.currency),t.original_price):t.original_price)*t.quantity,0);return an(e,j?.currency)},[j?.items,z]),Ce=o(()=>xe?ve+he:ve,[xe,ve,he]),Ee=o(()=>ce>0&&fe<=ce?`Add products worth more than ${oe}${de}`:"",[ce,fe,oe,de]),ke=o(()=>j?.items?.length?j.items.reduce((e,t)=>e+Math.max(la(t,j?.currency)-t.original_price,0)*t.quantity,0):0,[j?.items]),Se=an(ke,j?.currency??"INR");r(()=>{pe.current&&na(pe.current),me.current&&na(me.current),ue.current&&na(ue.current)},[i,be,z,Se,ae,he]);const Te=o(()=>{const e={};return j?.items?.length?(j.items.forEach(t=>{t.discounts&&Array.isArray(t.discounts)&&t.discounts.forEach(t=>{e[t.title]=(e[t.title]||0)+t.amount})}),e):e},[j?.items]),ze=o(()=>{const e=[];for(const t in Te)if(Object.prototype.hasOwnProperty.call(Te,t)){const r=Te[t],n=an(r,j?.currency??"INR"),o=sa(t);e.push({title:o,amount:n})}return e},[Te,j?.currency]),Ie=o(()=>{let e=0;return e+=z?be+Se:be,xe&&(e+=he),e},[be,Se,z,xe,he]),Fe=async e=>{if(V)return e?.preventDefault?.(),void H?.();if(ne(""),"checking"===W||"error"===W){e?.preventDefault?.();const t=window.ytUploadImageCheck;if(!t)return void ne("Couldn't check image upload requirements. Click Checkout to retry.");te(!0);try{if("required"===await t())return te(!1),void H?.()}catch{return te(!1),void ne("Couldn't check image upload requirements. Click Checkout to retry.")}}if(te(!0),we<=0)te(!1);else{if(b){if("standard"!==K&&(v?!Q:!G.isPostalCodeValid))return void te(!1);if(w)try{"standard"===K?await w(K):await w(K,String(Z)||"",X&&v?new Date(X).toDateString():"")}catch(e){console.error("Error applying postal code and delivery slot"),alert("There was an error processing your delivery options. Please try again.")}}y&&f&&""!==U&&""!==q&&await f(q,U),h&&x&&""!==Y&&await x(Y),await c(e),te(!1)}},Be=we<=0||!V&&(!(!A&&!J)||!!b&&("standard"!==K&&(v?!Q:!G.isPostalCodeValid))),[$e,Ae]=t(!!n),Pe=a(null),[De,_e]=t("0px");r(()=>{n&&Ae(!0)},[n]),r(()=>{Pe.current&&_e($e?`${Pe.current.scrollHeight}px`:"0px")},[$e,ze,xe]);const Re=()=>{Ae(!$e)};r(()=>{function e(e){le.current&&!le.current.contains(e.target)&&ge()}return"open"!==ae&&"opening"!==ae||document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[ae]);const Le=O?.badgeImage?.path||"",Oe=s?.checkoutTextName||"Checkout",Me=(t,r=Oe)=>t?e.createElement("span",{className:"yt-cart-checkout-loading-text",style:{fontSize:"13px",width:"100%",textAlign:"center"}},"Redirecting to Checkout..."):D?e.createElement("div",{className:"yt-cart-checkout-button-content",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},e.createElement("span",{className:"yt-cart-summary-checkout-span",style:{fontSize:"16px"}},r),e.createElement("div",{className:"yt-cart-checkout-payment-methods",style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},e.createElement("img",{className:"yt-cart-checkout-payment-icons",src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),e.createElement(zt,{className:"yt-cart-summary-checkout-next-icon",fontSize:"24px"}))):e.createElement("div",{className:"yt-cart-checkout-button-content",style:{alignItems:"center",display:"flex",columnGap:"5px",pointerEvents:"none"}},"Proceed to Checkout"!==r&&e.createElement(qe,{fontSize:"20px"}),e.createElement("span",{className:"yt-cart-checkout-button-text",style:{fontSize:"16px",pointerEvents:"none"}},r));return e.createElement("div",{className:"yt-cart-checkout-section",style:{position:"relative"}},re&&e.createElement("div",{className:"yt-cart-upload-image-check-error",role:"alert",style:{color:"#b91c1c",fontSize:"12px",padding:"6px 12px",textAlign:"center"}},re),!!S&&S.length>0&&!aa()&&(()=>{const t=T||"ribbon";if("ribbon"===t)return e.createElement("div",{className:"yt-cart-bottom-bar",style:{fontSize:"10px",textAlign:"center",backgroundColor:I,padding:"3px",boxShadow:"1px 2px 4px 0px #00000061",color:F,marginBottom:R?"0px":"4px",borderTopLeftRadius:"14px",borderTopRightRadius:"14px",cursor:N?"pointer":"default"},onClick:()=>{N&&ba(N)}},S);const r=({children:r})=>e.createElement("div",{className:"yt-cart-checkout-ribbon-container",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",padding:M?"0 55px":"0 13px",marginBottom:"4px",position:"bookmark"===t?"absolute":"static",top:"bookmark"===t?"-11px":void 0,cursor:N?"pointer":"default"},onClick:()=>{N&&ba(N)}},r);return"tag"===t?e.createElement(r,null,e.createElement("div",{className:"yt-cart-checkout-ribbon-tag-container",style:{display:"flex",alignItems:"center",width:"100%"}},e.createElement("svg",{className:"yt-cart-checkout-ribbon-tag-left",width:"20",height:"26",viewBox:"0 0 20 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flex:"0 0 auto"}},e.createElement("path",{d:"M0 0H20V20H0L7.41935 10.7639L0 0Z",fill:se}),e.createElement("path",{d:"M12.2581 5.80645L20 0V5.80645H12.2581Z",fill:"black",fillOpacity:"0.36"}),e.createElement("path",{d:"M12 5.80646L20 5.80645V25.8065H12V5.80646Z",fill:I})),e.createElement("div",{className:"yt-cart-checkout-ribbon-tag-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:I,color:F,padding:"8px 16px",fontSize:"10px",marginTop:"5px",lineHeight:"5px"}},S),e.createElement("svg",{className:"yt-cart-checkout-ribbon-tag-right",width:"20",height:"26",viewBox:"0 0 20 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flex:"0 0 auto"}},e.createElement("path",{d:"M20 0H0V20H20L12.5806 10.7639L20 0Z",fill:se}),e.createElement("path",{d:"M7.74194 5.80645L0 0V5.80645H7.74194Z",fill:"black",fillOpacity:"0.36"}),e.createElement("path",{d:"M8 5.80646L0 5.80645V25.8065H8V5.80646Z",fill:I})))):e.createElement(r,null,e.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-container",style:{display:"flex",alignItems:"center",width:"100%"}},e.createElement("svg",{className:"yt-cart-checkout-ribbon-bookmark-left",width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M8.34334 4.75V9.5H0V4.75C0 2.12665 1.86772 0 4.17167 0C6.47562 0 8.34334 2.12665 8.34334 4.75Z",fill:se}),e.createElement("path",{d:"M12.1545 19H13.9056V0H4.17167C6.27666 0 7.98284 1.943 7.98284 4.33981V14.25C7.98284 16.8734 9.85056 19 12.1545 19Z",fill:I})),e.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:I,color:F,padding:"8px 16px",fontSize:"10px",lineHeight:"3px",marginRight:"-1px",marginLeft:"-1px"}},S),e.createElement("svg",{className:"yt-cart-checkout-ribbon-bookmark-right",width:"14",height:"19",viewBox:"0 0 14 19",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M5.65666 4.75V9.5H14V4.75C14 2.12665 12.1323 0 9.82833 0C7.52438 0 5.65666 2.12665 5.65666 4.75Z",fill:se}),e.createElement("path",{d:"M1.84549 19H0.0944166V0H9.82833C7.72334 0 6.01716 1.943 6.01716 4.33981V14.25C6.01716 16.8734 4.14944 19 1.84549 19Z",fill:I}))))})(),(!0===p||"true"===p)&&!n&&"closed"!==ae&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-checkout-popout-overlay",style:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",opacity:"open"===ae?1:0,transition:"opacity 0.3s ease-in-out",display:"block",zIndex:2147483643},onClick:ge}),e.createElement("div",{className:"yt-cart-checkout-popout",ref:le,style:{position:"fixed",bottom:0,left:0,right:0,zIndex:2147483644,transform:"open"===ae?"translateY(0)":"translateY(100%)",transition:"transform 0.3s cubic-bezier(0.22, 1, 0.36, 1)"}},e.createElement("div",{className:"yt-cart-checkout-popout-header",style:{backgroundColor:"#F1F1F1",padding:"1rem",display:"flex",justifyContent:"space-between",alignItems:"center",color:"#000000",borderTopLeftRadius:"8px",borderTopRightRadius:"8px",fontWeight:"bold",fontSize:"16px"}},e.createElement("span",{className:"yt-cart-checkout-popout-title"},"Price Summary"),e.createElement("button",{className:"yt-cart-checkout-popout-close",onClick:ge,style:{background:"none",border:"none",color:"#000000",fontSize:"16px",fontWeight:"bold",cursor:"pointer",padding:0,marginLeft:"auto",transition:"transform 0.3s ease"}},"✕")),e.createElement("div",{className:"yt-cart-checkout-popout-content",style:{backgroundColor:"white",padding:"10px 1rem 0"}},e.createElement(e.Fragment,null,(z&&Se>0||d&&ze.length>0||xe&&he>0)&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-subtotal-row",style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{className:"yt-cart-subtotal-label",style:{fontSize:"14px",color:"#212529"}},"Subtotal"),e.createElement("span",{className:"yt-cart-subtotal-value",style:{fontSize:"14px",color:"#212529"}},oe,oa(xe?$?Ce.toFixed(2):Ce.toFixed(0):$?ve.toFixed(2):ve.toFixed(0)))),(be>0||z&&Se>0||xe&&he>0)&&e.createElement("div",{className:"yt-cart-checkout-popout-discounts",style:{display:"flex",flexDirection:"column",paddingBottom:"5px",marginTop:"5px",fontWeight:"600"}},z&&Se>0&&e.createElement("div",{className:"yt-cart-discount-row",style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},e.createElement("span",{className:"yt-cart-discount-label"},"Discount on MRP"),e.createElement("span",{className:"yt-cart-discount-value",style:{color:"#D3122A"}},"-",oe,oa($?Se.toFixed(2):Se.toFixed(0)))),xe&&he>0&&e.createElement("div",{className:"yt-cart-discount-row",style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},e.createElement("span",{className:"yt-cart-discount-label"},"Free Shipping"),e.createElement("span",{className:"yt-cart-discount-value",style:{color:"#D3122A"}},"-",oe,oa($?he.toFixed(2):he.toFixed(0)))),ze.map(t=>e.createElement("div",{className:"yt-cart-discount-row",key:t.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#1E1E1E"}},e.createElement("span",{className:"yt-cart-discount-label"},t.title),e.createElement("span",{className:"yt-cart-discount-value",style:{color:"#D3122A"}},"-",oe,oa($?t.amount.toFixed(2):t.amount.toFixed(0))))),Ie>0&&e.createElement("div",{className:"yt-cart-total-savings-row",style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529",marginTop:"5px",paddingTop:"5px",borderTop:"1px solid #E5E7EB"}},e.createElement("span",{className:"yt-cart-total-savings-label"},"Total Savings"),e.createElement("span",{className:"yt-cart-total-savings-value",style:{color:"#D3122A",fontWeight:"bold"}},"-",oe,oa($?Ie.toFixed(2):Ie.toFixed(0))))),(be>0||z&&Se>0||xe&&he>0)&&e.createElement("div",{className:"yt-cart-checkout-popout-divider",style:{height:"12px",display:"flex",background:"#F5F5F5",width:"calc(100% + 2rem)",margin:"10px -1rem 0 -1rem",position:"relative",borderTop:"0.8px solid #C5C5C5",borderBottom:"0.8px solid #C5C5C5"}}))),e.createElement("div",{className:"yt-cart-grand-total-row",style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:be>0||z&&Se>0||xe&&he>0?"10px":"0"}},e.createElement("div",{className:"yt-cart-grand-total-label-group",style:{display:"flex",flexDirection:"column"}},e.createElement("span",{className:"yt-cart-grand-total-label",style:{fontSize:"14px",fontWeight:"600",color:"#212529"}},"Grand Total"),e.createElement("span",{className:"yt-cart-tax-note",style:{fontSize:"9px",color:"#4A5157"}},"Inclusive of all taxes")),e.createElement("span",{className:"yt-cart-grand-total-value",style:{fontSize:"16px",color:"black",fontWeight:"var(--yt-cart-font-weight)"}},oe,oa($?we.toFixed(2):we.toFixed(0)))),e.createElement("div",{className:"yt-cart-savings-banner",style:{display:"flex",background:I,color:F,width:"calc(100% + 2rem)",margin:"10px -1rem 0 -1rem",position:"relative",fontSize:"12px",fontWeight:"600",justifyContent:"center",alignItems:"center",gap:"5px",padding:"4px 0"}},e.createElement("img",{className:"yt-cart-savings-icon",src:"https://r2.yourtoken.io/image%2016.png",alt:"confetti-image",style:{width:"30px",height:"30px"}}),"You saved"," ",e.createElement("span",{className:"yt-cart-savings-value"},oe,oa($?Ie.toFixed(2):Ie.toFixed(0)))," ","on your order")),e.createElement("button",{type:"button",ref:me,id:"yt-checkout-button-popout",className:"yt-checkout-button",onClick:Fe,disabled:Be,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:0,height:"45px",padding:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:i,border:0,textTransform:"uppercase",fontSize:l,letterSpacing:"1px",opacity:Be?.9:1,cursor:Be?"not-allowed":"pointer",borderRadius:"0px",boxShadow:"none",width:"100%"}},Me(ee)))),(!0===p||"true"===p)&&A&&Be&&Ee&&e.createElement("div",{className:"yt-cart-checkout-disabled-message",style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},Ee),!0!==p&&"true"!==p||n?e.createElement(e.Fragment,null,A&&Be&&Ee&&e.createElement("div",{className:"yt-cart-checkout-disabled-message",style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},Ee),e.createElement("div",{className:"yt-cart-checkout-summary",style:{display:"flex",flexDirection:"column",rowGap:"5px",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:R?"0px":"10px"}},e.createElement("div",{className:"yt-cart-checkout-breakdown",style:{display:R?"none":"flex",flexDirection:"column",rowGap:"2px",margin:"0 1rem",color:_}},(Se>0||d&&ze.length>0||xe&&he>0)&&Ie>0&&e.createElement(e.Fragment,null,n&&e.createElement("div",{className:"yt-cart-price-summary-text",style:{backgroundColor:"#575757",fontSize:"16px",margin:"-0.5rem -1rem",padding:"10px",fontFamily:"Poppins",fontWeight:"500"}},e.createElement("span",{className:"yt-cart-price-summary-title",style:{color:"white"}},"Price Summary")),e.createElement("div",{className:"yt-cart-subtotal-row",style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:n?"20px":"0"}},e.createElement("span",{className:"yt-cart-subtotal-label",style:{fontSize:"12px"}},"Subtotal"),e.createElement("span",{className:"yt-cart-subtotal-value",style:{fontSize:"14px"}},oe,oa(xe?$?Ce.toFixed(2):Ce.toFixed(0):$?ve.toFixed(2):ve.toFixed(0)))),(be>0||Se>0||xe&&he>0)&&e.createElement("div",{className:"yt-cart-discounts-section",style:{display:"flex",flexDirection:"column",paddingBottom:"5px"}},e.createElement("div",{className:"yt-cart-discounts-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{className:"yt-cart-discounts-label",style:{fontSize:"12px",fontWeight:"600",display:"flex",alignItems:"center"}},"Discounts Applied",!n&&e.createElement("button",{onClick:Re,className:"yt-cart-details-button",style:{marginBottom:"0",marginLeft:"5px",background:"none",border:"none",color:"#7E7E7E",cursor:"pointer",fontSize:"12px",fontWeight:"600",textDecoration:"underline",padding:"0 !important",minHeight:"10px !important",boxShadow:"none",minWidth:"fit-content",height:"auto",lineHeight:"normal",marginTop:"0"}},$e?"Hide details":"See details")),e.createElement("span",{className:"yt-cart-discounts-total",style:{fontSize:"14px",color:"#D3122A",fontWeight:"600"}},"-",oe,oa($?Ie.toFixed(2):Ie.toFixed(0)))),e.createElement("div",{className:"yt-cart-discounts-details",ref:Pe,style:{height:De,overflow:"hidden",transition:"height 0.3s ease, opacity 0.3s ease",opacity:$e?1:0,marginTop:$e?"5px":"0",borderTop:$e?"1px solid #E5E7EB":"none",paddingTop:$e?"5px":"0",fontWeight:"600"}},z&&Se>0&&e.createElement("div",{className:"yt-cart-discount-row",style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",{className:"yt-cart-discount-label"},"Discount on MRP"),e.createElement("span",{className:"yt-cart-discount-value",style:{color:"#D3122A"}},"-",oe,oa($?Se.toFixed(2):Se.toFixed(0)))),xe&&he>0&&e.createElement("div",{className:"yt-cart-discount-row",style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",{className:"yt-cart-discount-label"},"Free Shipping"),e.createElement("span",{className:"yt-cart-discount-value",style:{color:"#D3122A"}},"-",oe,oa($?he.toFixed(2):he.toFixed(0)))),ze.map(t=>e.createElement("div",{className:"yt-cart-discount-row",key:t.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",{className:"yt-cart-discount-label"},t.title),e.createElement("span",{className:"yt-cart-discount-value",style:{color:"#D3122A"}},"-",oe,oa($?t.amount.toFixed(2):t.amount.toFixed(0))))))),e.createElement("hr",{className:"yt-cart-checkout-divider",style:{height:"1px",margin:"2px 0",backgroundColor:"#E5E7EB",border:"none",maxWidth:"unset"}})),e.createElement("div",{className:"yt-cart-total-row",style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{className:"yt-cart-total-label",style:{fontSize:"14px",fontWeight:"600"}},"Total"),e.createElement("span",{className:"yt-cart-total-value",style:{fontSize:"16px",fontWeight:"var(--yt-cart-font-weight)"}},oe,oa($?we.toFixed(2):we.toFixed(0))))),e.createElement("button",{type:"button",ref:pe,id:"yt-checkout-button",className:"yt-checkout-button",onClick:Fe,disabled:Be,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"closed"!==ae||C?"0":`4px 1rem ${P}px 1rem`,height:"45px",paddingTop:"10px",paddingBottom:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:i,border:0,color:g??"white",textTransform:"uppercase",fontSize:l,letterSpacing:"1px",opacity:Be?.9:1,cursor:Be?"not-allowed":"pointer",borderRadius:"closed"!==ae?"0px":"rounded"===E?`${k}px`:"0px",boxShadow:"none"}},Me(ee,Oe)),L&&Le&&!R&&e.createElement("div",{className:"yt-cart-powered-by-badge",style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0px 6px"}},e.createElement("img",{className:"yt-cart-trusted-badge-image",src:Le,alt:"Trusted Badge",style:{height:"auto",width:"340px",maxHeight:"50px"}})))):e.createElement("div",{className:"yt-cart-checkout-section-concise-container",style:{display:"flex",flexDirection:"column",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:"10px"}},e.createElement("div",{className:"yt-cart-checkout-concise-row",style:{display:"flex",flexDirection:"row",alignItems:"stretch",justifyContent:"space-between",width:"auto",padding:C?"7px 0 8px 8px":`7px 8px ${P}px 8px`}},e.createElement("div",{className:"yt-cart-checkout-concise-summary",style:{display:"flex",flexDirection:"column",textAlign:"center",justifyContent:"center",alignItems:"flex-start",paddingRight:"2rem",overflowWrap:"normal"}},(be>0||z&&Se>0||xe&&he>0)&&e.createElement("div",{className:"yt-cart-checkout-save-badge",ref:ue,style:{fontSize:"9px",backgroundColor:i,width:"max-content",padding:"2px 8px"}},"Saving ",oe,oa($?Ie.toFixed(2):Ie.toFixed(0))),ee?e.createElement("div",{className:"yt-cart-checkout-concise-loading",style:{fontSize:"12px",color:"#4a4a4a"}},"Redirecting to Checkout..."):d||xe&&ye?e.createElement("div",{className:"yt-cart-checkout-concise-price-wrapper"},e.createElement("div",{className:"yt-cart-checkout-concise-price-row",style:{display:"flex",alignItems:"baseline",justifyContent:"center"}},e.createElement("span",{className:"yt-cart-checkout-concise-total",style:{fontSize:"15px",color:"#1E1E1E",fontWeight:"600"}},oe,oa($?we.toFixed(2):we.toFixed(0))),(be>0||Se>0||xe&&he>0)&&e.createElement("span",{className:"yt-cart-checkout-concise-compare-total",style:{fontSize:"14px",color:"#8C8C8C",textDecoration:"line-through",marginLeft:"4px",fontWeight:"normal"}},oe,oa(xe?Ce.toFixed(0):ve.toFixed(0))))):e.createElement("div",{className:"yt-cart-checkout-concise-total",style:{fontSize:"18px",color:"#1E1E1E",fontWeight:"600"}},oe,oa($?we.toFixed(2):we.toFixed(0))),(z&&Se>0||d&&be>0||xe&&he>0)&&!n?e.createElement("div",{className:"yt-cart-checkout-concise-details-link",style:{fontSize:"11px",color:"#4A5157",width:"max-content",cursor:"pointer",textDecoration:"underline"},onClick:e=>{e.stopPropagation(),ie("opening"),requestAnimationFrame(()=>{ie("open")})}},"See Details"):e.createElement("div",{className:"yt-cart-checkout-concise-tax-note",style:{fontSize:"9px",color:"#4A5157",width:"max-content"}},"Inclusive of all taxes")),e.createElement("div",{className:"yt-cart-checkout-concise-button-wrapper",style:{display:"flex",justifyContent:"center",width:"100%"}},e.createElement("button",{type:"button",ref:pe,id:"yt-checkout-button",className:"yt-checkout-button",onClick:Fe,disabled:Be,style:{backgroundColor:i,border:0,textTransform:"uppercase",letterSpacing:"1px",fontSize:"12px",padding:"10px 15px",opacity:Be?.9:1,cursor:Be?"not-allowed":"pointer",borderRadius:"rounded"===E?`${k}px`:"0px",width:"100%",margin:"0 auto",boxShadow:"none"}},D?e.createElement("div",{className:"yt-cart-checkout-concise-button-content",style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},e.createElement("span",{className:"yt-cart-checkout-button-text",style:{fontSize:"12px"}},Oe),e.createElement("div",{className:"yt-cart-checkout-payment-methods",style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},e.createElement("img",{className:"yt-cart-checkout-payment-icons",src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),e.createElement(zt,{fontSize:"24px"}))):Oe))),L&&!R&&Le&&e.createElement("div",{className:"yt-cart-powered-by-badge",style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0 6px"}},e.createElement("img",{className:"yt-cart-trusted-badge-image",src:Le,alt:"Trusted Badge",style:{height:"auto",width:"340px",maxHeight:"50px"}}))))}const Tl=d.button`
|
|
1090
1090
|
background-color: ${e=>wa(e.$ctaButtonBackgroundColor,"#BEB8EC")};
|
|
1091
1091
|
color: ${e=>wa(e.$ctaButtonTextColor,"black")};
|
|
1092
1092
|
font-size: 11px;
|