yt-uikit 0.9.37 → 0.9.38

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.
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { CartProps } from "./Cart";
3
- export default function EmptyCart({ showLoyaltyCta, exploreCTAColor, emptyCartTitle, emptyCartDescription, isUserSignedIn, joinNowFunction, exploreCtaRedirectLink, themeColor, emptyCartButtons, cartComponentsCornerRadius, cartComponentsCornerType, themeTextColor, recProductsList, addCartItem, productRecsCtaButtonText, ctaButtonBackgroundColor, ctaButtonTextColor, primaryTextColor, secondaryTextColor, showVariantSelectionDropdownInProductRecs, productRecsTitleText, emptyProductRecsTitleText, backgroundSubdued, showEmptyCartRecommendations, tertiaryColor, tertiaryTextColor, }: {
3
+ export default function EmptyCart({ showLoyaltyCta, exploreCTAColor, emptyCartTitle, emptyCartDescription, isUserSignedIn, joinNowFunction, exploreCtaRedirectLink, themeColor, emptyCartButtons, cartComponentsCornerRadius, cartComponentsCornerType, themeTextColor, isRecProductsListValid, recProductsList, addCartItem, productRecsCtaButtonText, ctaButtonBackgroundColor, ctaButtonTextColor, primaryTextColor, secondaryTextColor, showVariantSelectionDropdownInProductRecs, productRecsTitleText, emptyProductRecsTitleText, backgroundSubdued, showEmptyCartRecommendations, tertiaryColor, tertiaryTextColor, }: {
4
4
  showLoyaltyCta: boolean;
5
5
  exploreCTAColor: any;
6
6
  emptyCartTitle: string;
@@ -16,6 +16,7 @@ export default function EmptyCart({ showLoyaltyCta, exploreCTAColor, emptyCartTi
16
16
  cartComponentsCornerRadius?: number;
17
17
  cartComponentsCornerType?: "rounded" | "sharp";
18
18
  themeTextColor?: string;
19
+ isRecProductsListValid?: boolean;
19
20
  recProductsList?: any[];
20
21
  addCartItem?: CartProps["addCartItem"];
21
22
  productRecsCtaButtonText?: CartProps["productRecsCtaButtonText"];
package/dist/esm/index.js CHANGED
@@ -996,7 +996,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
996
996
  width: 100%;
997
997
  gap: 10px;
998
998
  margin-top: 16px;
999
- `;function _o({showLoyaltyCta:n,exploreCTAColor:o="#73DABB",emptyCartTitle:r="Your Cart is Empty",emptyCartDescription:i,isUserSignedIn:a=!1,joinNowFunction:l,exploreCtaRedirectLink:c,themeColor:s,emptyCartButtons:d=[],cartComponentsCornerRadius:p=0,cartComponentsCornerType:u="sharp",themeTextColor:m="white",recProductsList:g,addCartItem:x,productRecsCtaButtonText:f,ctaButtonBackgroundColor:y,ctaButtonTextColor:b,primaryTextColor:h,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:w,productRecsTitleText:C,emptyProductRecsTitleText:E="Empty cart Recommendations",backgroundSubdued:k,showEmptyCartRecommendations:T=!1,tertiaryColor:S,tertiaryTextColor:$}){const[N,B]=t(!1),[F,z]=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:S??"#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:$??"black"})),e.createElement("span",{className:"yt-cart-empty-title",style:{color:h,fontWeight:"semibold"}},r),i&&e.createElement("span",{className:"yt-cart-empty-description",style:{color:"#929292",fontSize:"14px"}},i),!a&&n&&e.createElement("div",{className:"yt-cart-empty-signin-cta",style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px"}},e.createElement(nt,{color:o,fontSize:"14px",strokeWidth:2}),e.createElement(Po,null,e.createElement("span",{className:"yt-cart-empty-signin-link",onClick:l,style:{color:o,textDecorationLine:"underline",cursor:"pointer"}},"Sign-in")," ",e.createElement("span",{style:{color:"black"}},"to avail offers"))),d&&d.length>0&&e.createElement(Ao,{className:"yt-cart-empty-button-container"},d.map((t,n)=>e.createElement("button",{key:`empty-cart-button-${n}`,onMouseEnter:()=>z(n),onMouseLeave:()=>z(null),onClick:()=>window.location.href=t.link,className:"yt-cart-empty-button",style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:F===n?s||"#73DABB":"#CACACA30",color:F===n?m:"#333333",padding:"12px 24px",cursor:"pointer",border:"1px solid #D1D1D1",borderRadius:"rounded"===u?`${p}px`:"0px",transition:"all 0.2s ease",width:"100%",fontSize:"14px",fontWeight:500,textTransform:"capitalize"}},t.title)))),T&&g&&g.length>0&&x&&e.createElement("div",{className:"yt-cart-empty-recommendations",style:{width:"100%",marginTop:"20px",marginBottom:"20px"}},e.createElement(Zn,{products:g,addCartItem:x,productRecsTitleText:E,productRecsCtaButtonText:f,ctaButtonBackgroundColor:y,ctaButtonTextColor:b,primaryTextColor:h,secondaryTextColor:v,showVariantSelectionDropdownInProductRecs:w,variant:"scroll",cardLayout:"vertical",cartComponentsCornerRadius:p,cartComponentsCornerType:u,backgroundSubdued:k,tertiaryColor:S,tertiaryTextColor:$}))),e.createElement("button",{className:"yt-cart-empty-continue-shopping",onMouseEnter:()=>B(!0),onMouseLeave:()=>B(!1),onClick:()=>window.location.replace(c??"/"),style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px",backgroundColor:N?"#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(et,{color:h}),e.createElement("span",{style:{textTransform:"uppercase",fontSize:"12px",fontWeight:600,color:h,cursor:"pointer"}},"Continue Shopping")))}const Ro=se("gstNumber",""),Lo=se("gstCompanyName",""),Oo=ie("");yt("/* 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.close-button {\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n transition: transform 0.5s ease-in-out;\n}\n\n.close-button:hover {\n transform: rotate(360deg);\n}\n\n.qty-selector-decrement-button,\n.yt-checkout-button {\n background-image: none !important;\n}\n\nbutton.yt-checkout-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 Mo=se("postalCode",void 0);function Wo({checkoutButtonColor:i,checkoutFontSize:a,checkoutFunction:l,discountApplied:c,discountInCheckoutButton:s,discountAmountApplied:d,minimumCartValue:p,themeTextColor:u,applyGSTToCart:m,showGSTOption:g,applyNoteToCart:x,showNoteOption:f,enableGeoLocationDeliveryRestriction:y,applyPostalCodeAndDeliverySlotToCart:b,enableSlotPicker:h,isStickyCheckout:v,cartComponentsCornerType:w,cartComponentsCornerRadius:C,checkoutSectionMessage:E,checkoutSectionMessageDisplay:k,checkoutSectionMessageRedirectLink:T,showDiscountOnMRP:S,tertiaryColor:$,tertiaryTextColor:N,cartCheckpoints:B,toggleDecimal:F,disableCheckoutButton:z,checkoutButtonBottomSpacing:I=8,showCheckoutButtonPaymentIcons:D,primaryTextColor:P,hideSubtotalAndBadge:A=!1,showTrustedBadge:_,trustedBadgeData:R,isLargeScreen:L}){const O=le(Xt),M=le(Ro),W=le(Lo),V=le(Oo),j=le(Kt),H=le(Zt),q=le(Mo),Q=le(en),U=le(Jt),[Y,G]=t(!1),X=ln(O,O?.currency),[Z,K]=t("closed"),J=r(null),[ee,te]=t(!1),ne=o(()=>((e,t=.2)=>{if(!e)return"#000000";try{const n=e.trim();if(n.startsWith("#")&&(7===n.length||9===n.length)){const e=parseInt(n.slice(1,3),16),o=parseInt(n.slice(3,5),16),r=parseInt(n.slice(5,7),16),i=9===n.length?parseInt(n.slice(7,9),16):void 0,a=Math.max(0,Math.min(255,Math.floor(e*(1-t)))),l=Math.max(0,Math.min(255,Math.floor(o*(1-t)))),c=Math.max(0,Math.min(255,Math.floor(r*(1-t)))),s=`#${a.toString(16).padStart(2,"0")}${l.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`;return void 0!==i?`${s}${i.toString(16).padStart(2,"0")}`:s}return e}catch{return e}})($,.22),[$]),oe=o(()=>rn(p??0,O?.currency??"INR"),[p,O?.currency]),re=o(()=>xn(F?oe.toFixed(2):oe.toFixed(0)),[oe,F]),ie=r(null),ae=r(null),ce=r(null),se=()=>{K("closing"),setTimeout(()=>{K("closed")},300)},de=rn(O?.original_total_price,O?.currency),pe=o(()=>B?.find(e=>"free_delivery"===e.couponType&&void 0!==e.discountValue),[B]),ue=o(()=>!(!pe||!pe.minimumOrderValue)&&de>=pe.minimumOrderValue,[pe,de]),me=ue&&pe&&pe.discountValue||0,ge=d?rn(d,O?.currency??"INR"):0,xe=Number((de-ge).toFixed(2)),fe=o(()=>{if(!O?.items?.length)return 0;const e=O.items.reduce((e,t)=>e+(S&&t?.compare_at_price&&t?.compare_at_price>t?.original_price?t.compare_at_price:t.original_price)*t.quantity,0);return rn(e,O?.currency)},[O?.items,S]),ye=o(()=>ue?fe+me:fe,[ue,fe,me]),be=o(()=>oe&&oe>0?`Add products worth more than ${X}${re}`:"",[oe,X,re]),he=o(()=>O?.items?.length?O.items.reduce((e,t)=>t.compare_at_price&&t.compare_at_price>t.original_price?e+(t.compare_at_price-t.original_price)*t.quantity:e,0):0,[O?.items]),ve=rn(he,O?.currency??"INR");n(()=>{ie.current&&gn(ie.current),ae.current&&gn(ae.current),ce.current&&gn(ce.current)},[i,ge,S,ve,Z,me]);const we=o(()=>{const e={};return O?.items?.length?(O.items.forEach(t=>{t.discounts&&Array.isArray(t.discounts)&&t.discounts.forEach(t=>{e[t.title]=(e[t.title]||0)+t.amount})}),e):e},[O?.items]),Ce=o(()=>{const e=[];for(const t in we)if(Object.prototype.hasOwnProperty.call(we,t)){const n=we[t],o=rn(n,O?.currency??"INR"),r=bn(t);e.push({title:r,amount:o})}return e},[we,O?.currency]),Ee=o(()=>{let e=0;return e+=S?ge+ve:ge,ue&&(e+=me),e},[ge,ve,S,ue,me]),ke=async e=>{if(G(!0),xe<=0)G(!1);else{if(y){if("standard"!==U&&(h?!j:!H.isPostalCodeValid))return void G(!1);if(b)try{"standard"===U?await b(U):await b(U,String(q)||"",Q&&h?new Date(Q).toDateString():"")}catch(e){console.error("Error applying postal code and delivery slot"),alert("There was an error processing your delivery options. Please try again.")}}g&&m&&""!==W&&""!==M&&await m(M,W),f&&x&&""!==V&&await x(V),await l(e),G(!1)}},[Se,$e]=t(!1);n(()=>{$e(xe<=0||(!!z||!!y&&("standard"!==U&&(h?!j:!H.isPostalCodeValid))))},[H,U,y,h,j,Q,z,xe]);const[Ne,Be]=t(!1),Fe=r(null),[ze,Ie]=t("0px");n(()=>{Fe.current&&Ie(Ne?`${Fe.current.scrollHeight}px`:"0px")},[Ne,Ce,ue]);const De=()=>{Be(!Ne)};n(()=>{function e(e){J.current&&!J.current.contains(e.target)&&se()}return"open"!==Z&&"opening"!==Z||document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[Z]);const Pe=(t,n="Checkout")=>t?e.createElement("span",{style:{fontSize:"13px",width:"100%",textAlign:"center"}},"Redirecting to Checkout..."):D?e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},e.createElement("span",{className:"yt-cart-summary-checkout-span",style:{fontSize:"16px"}},n),e.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},e.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),e.createElement(ot,{className:"yt-cart-summary-checkout-next-icon",fontSize:"24px"}))):e.createElement("div",{style:{alignItems:"center",display:"flex",columnGap:"5px",pointerEvents:"none"}},"Proceed to Checkout"!==n&&e.createElement(Te,{fontSize:"20px"}),e.createElement("span",{style:{fontSize:"16px",pointerEvents:"none"}},n));return e.createElement("div",{className:"yt-cart-checkout-section",style:{position:"relative"}},!!E&&E.length>0&&!fn()&&(()=>{const t=k||"ribbon";if("ribbon"===t)return e.createElement("div",{className:"yt-cart-bottom-bar",style:{fontSize:"10px",textAlign:"center",backgroundColor:$,padding:"3px",boxShadow:"1px 2px 4px 0px #00000061",color:N,marginBottom:A?"0px":"4px",borderTopLeftRadius:"14px",borderTopRightRadius:"14px",cursor:T?"pointer":"default"},onClick:()=>{T&&(window.location.href=T)}},E);const n=({children:n})=>e.createElement("div",{className:"yt-cart-checkout-ribbon-container",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",padding:L?"0 55px":"0 13px",marginBottom:"4px",position:"bookmark"===t?"absolute":"static",top:"bookmark"===t?"-11px":void 0,cursor:T?"pointer":"default"},onClick:()=>{T&&(window.location.href=T)}},n);return"tag"===t?e.createElement(n,null,e.createElement("div",{className:"yt-cart-checkout-ribbon-tag-container",style:{display:"flex",alignItems:"center",width:"100%"}},e.createElement("svg",{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:ne}),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:$})),e.createElement("div",{className:"yt-cart-checkout-ribbon-tag-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:$,color:N,padding:"8px 16px",fontSize:"10px",marginTop:"5px",lineHeight:"5px"}},E),e.createElement("svg",{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:ne}),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:$})))):e.createElement(n,null,e.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-container",style:{display:"flex",alignItems:"center",width:"100%"}},e.createElement("svg",{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:ne}),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:$})),e.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:$,color:N,padding:"8px 16px",fontSize:"10px",lineHeight:"3px",marginRight:"-1px",marginLeft:"-1px"}},E),e.createElement("svg",{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:ne}),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:$}))))})(),(!0===s||"true"===s)&&"closed"!==Z&&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"===Z?1:0,transition:"opacity 0.3s ease-in-out",display:"block",zIndex:2147483643},onClick:se}),e.createElement("div",{className:"yt-cart-checkout-popout",ref:J,style:{position:"fixed",bottom:0,left:0,right:0,zIndex:2147483644,transform:"open"===Z?"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",null,"Price Summary"),e.createElement("button",{className:"yt-cart-checkout-popout-close",onClick:se,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,(S&&ve>0||c&&Ce.length>0||ue&&me>0)&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{style:{fontSize:"14px",color:"#212529"}},"Subtotal"),e.createElement("span",{style:{fontSize:"14px",color:"#212529"}},X,xn(ue?F?ye.toFixed(2):ye.toFixed(0):F?fe.toFixed(2):fe.toFixed(0)))),(ge>0||S&&ve>0||ue&&me>0)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",paddingBottom:"5px",marginTop:"5px",fontWeight:"600"}},S&&ve>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},e.createElement("span",null,"Discount on MRP"),e.createElement("span",{style:{color:"#D3122A"}},"-",X,xn(F?ve.toFixed(2):ve.toFixed(0)))),ue&&me>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},e.createElement("span",null,"Free Shipping"),e.createElement("span",{style:{color:"#D3122A"}},"-",X,xn(F?me.toFixed(2):me.toFixed(0)))),Ce.map(t=>e.createElement("div",{key:t.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#1E1E1E"}},e.createElement("span",null,t.title),e.createElement("span",{style:{color:"#D3122A"}},"-",X,xn(F?t.amount.toFixed(2):t.amount.toFixed(0))))),Ee>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529",marginTop:"5px",paddingTop:"5px",borderTop:"1px solid #E5E7EB"}},e.createElement("span",null,"Total Savings"),e.createElement("span",{style:{color:"#D3122A",fontWeight:"bold"}},"-",X,xn(F?Ee.toFixed(2):Ee.toFixed(0))))),(ge>0||S&&ve>0||ue&&me>0)&&e.createElement("div",{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",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:ge>0||S&&ve>0||ue&&me>0?"10px":"0"}},e.createElement("div",{style:{display:"flex",flexDirection:"column"}},e.createElement("span",{style:{fontSize:"14px",fontWeight:"600",color:"#212529"}},"Grand Total"),e.createElement("span",{style:{fontSize:"9px",color:"#4A5157"}},"Inclusive of all taxes")),e.createElement("span",{style:{fontSize:"16px",color:"black",fontWeight:"var(--yt-cart-font-weight)"}},X,xn(F?xe.toFixed(2):xe.toFixed(0)))),e.createElement("div",{style:{display:"flex",background:$,color:N,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",{src:"https://r2.yourtoken.io/image%2016.png",alt:"confetti-image",style:{width:"30px",height:"30px"}}),"You saved"," ",e.createElement("span",null,X,xn(F?Ee.toFixed(2):Ee.toFixed(0)))," ","on your order")),e.createElement("button",{ref:ae,id:"yt-checkout-button-popout",className:"yt-checkout-button",onClick:ke,disabled:Se,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:0,height:"45px",padding:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:i,border:0,textTransform:"uppercase",fontSize:a,letterSpacing:"1px",opacity:Se?.5:1,cursor:Se?"not-allowed":"pointer",borderRadius:"0px",boxShadow:"none",width:"100%"}},Pe(Y)))),(!0===s||"true"===s)&&z&&Se&&be&&e.createElement("div",{style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},be),!0===s||"true"===s?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",{style:{display:"flex",flexDirection:"row",alignItems:"stretch",justifyContent:"space-between",width:"auto",padding:v?"7px 0 8px 8px":`7px 8px ${I}px 8px`}},e.createElement("div",{style:{display:"flex",flexDirection:"column",textAlign:"center",justifyContent:"center",alignItems:"flex-start",paddingRight:"2rem",overflowWrap:"normal"}},(ge>0||S&&ve>0||ue&&me>0)&&e.createElement("div",{className:"yt-cart-checkout-save-badge",ref:ce,style:{fontSize:"9px",backgroundColor:i,width:"max-content",padding:"2px 8px"}},"Saving ",X,xn(F?Ee.toFixed(2):Ee.toFixed(0))),Y?e.createElement("div",{style:{fontSize:"12px",color:"#4a4a4a"}},"Redirecting to Checkout..."):c||ue&&pe?e.createElement("div",null,e.createElement("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"center"}},e.createElement("span",{style:{fontSize:"15px",color:"#1E1E1E",fontWeight:"600"}},X,xn(F?xe.toFixed(2):xe.toFixed(0))),(ge>0||ve>0||ue&&me>0)&&e.createElement("span",{style:{fontSize:"14px",color:"#8C8C8C",textDecoration:"line-through",marginLeft:"4px",fontWeight:"normal"}},X,xn(ue?ye.toFixed(0):fe.toFixed(0))))):e.createElement("div",{style:{fontSize:"18px",color:"#1E1E1E",fontWeight:"600"}},X,xn(F?xe.toFixed(2):xe.toFixed(0))),S&&ve>0||c&&ge>0||ue&&me>0?e.createElement("div",{style:{fontSize:"11px",color:"#4A5157",width:"max-content",cursor:"pointer",textDecoration:"underline"},onClick:e=>{e.stopPropagation(),K("opening"),requestAnimationFrame(()=>{K("open")}),te(!ee)}},"See Details"):e.createElement("div",{style:{fontSize:"9px",color:"#4A5157",width:"max-content"}},"Inclusive of all taxes")),e.createElement("div",{style:{display:"flex",justifyContent:"center",width:"100%"}},e.createElement("button",{ref:ie,id:"yt-checkout-button",className:"yt-checkout-button",onClick:ke,disabled:Se,style:{backgroundColor:i,border:0,textTransform:"uppercase",letterSpacing:"1px",fontSize:"12px",padding:"10px 15px",opacity:Se?.5:1,cursor:Se?"not-allowed":"pointer",borderRadius:"rounded"===w?`${C}px`:"0px",width:"100%",margin:"0 auto",boxShadow:"none"}},D?e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},e.createElement("span",{style:{fontSize:"12px"}},"CHECKOUT"),e.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},e.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),e.createElement(ot,{fontSize:"24px"}))):"CHECKOUT"))),_&&!A&&e.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0 6px"}},e.createElement("img",{src:R?.badgeImage?.path||"https://r2.yourtoken.io/powered-by-badge-v2.png",alt:"Trusted Badge",style:{height:"auto",width:"340px"}}))):e.createElement(e.Fragment,null,z&&Se&&be&&e.createElement("div",{className:"yt-cart-checkout-disabled-message",style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},be),e.createElement("div",{className:"yt-cart-checkout-summary",style:{display:"flex",flexDirection:"column",rowGap:"5px",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:A?"0px":"10px"}},e.createElement("div",{className:"yt-cart-checkout-breakdown",style:{display:A?"none":"flex",flexDirection:"column",rowGap:"2px",margin:"0 1rem",color:P}},(ve>0||c&&Ce.length>0||ue&&me>0)&&Ee>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:"12px"}},"Subtotal"),e.createElement("span",{className:"yt-cart-subtotal-value",style:{fontSize:"14px"}},X,xn(ue?F?ye.toFixed(2):ye.toFixed(0):F?fe.toFixed(2):fe.toFixed(0)))),(ge>0||ve>0||ue&&me>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",e.createElement("button",{onClick:De,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"}},Ne?"Hide details":"See details")),e.createElement("span",{className:"yt-cart-discounts-total",style:{fontSize:"14px",color:"#D3122A",fontWeight:"600"}},"-",X,xn(F?Ee.toFixed(2):Ee.toFixed(0)))),e.createElement("div",{className:"yt-cart-discounts-details",ref:Fe,style:{height:ze,overflow:"hidden",transition:"height 0.3s ease, opacity 0.3s ease",opacity:Ne?1:0,marginTop:Ne?"5px":"0",borderTop:Ne?"1px solid #E5E7EB":"none",paddingTop:Ne?"5px":"0",fontWeight:"600"}},S&&ve>0&&e.createElement("div",{className:"yt-cart-discount-row",style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",null,"Discount on MRP"),e.createElement("span",{style:{color:"#D3122A"}},"-",X,xn(F?ve.toFixed(2):ve.toFixed(0)))),ue&&me>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",null,"Free Shipping"),e.createElement("span",{style:{color:"#D3122A"}},"-",X,xn(F?me.toFixed(2):me.toFixed(0)))),Ce.map(t=>e.createElement("div",{key:t.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",null,t.title),e.createElement("span",{style:{color:"#D3122A"}},"-",X,xn(F?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)"}},X,xn(F?xe.toFixed(2):xe.toFixed(0))))),e.createElement("button",{ref:ie,id:"yt-checkout-button",className:"yt-checkout-button",onClick:ke,disabled:Se,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"closed"!==Z||v?"0":`4px 1rem ${I}px 1rem`,height:"45px",paddingTop:"10px",paddingBottom:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:i,border:0,color:u??"white",textTransform:"uppercase",fontSize:a,letterSpacing:"1px",opacity:Se?.5:1,cursor:Se?"not-allowed":"pointer",borderRadius:"closed"!==Z?"0px":"rounded"===w?`${C}px`:"0px",boxShadow:"none"}},Pe(Y,D?"Checkout":"Proceed to Checkout")),_&&!A&&e.createElement("div",{className:"yt-cart-powered-by-badge",style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0px 6px"}},e.createElement("img",{src:R?.badgeImage?.path||"https://r2.yourtoken.io/powered-by-badge-v2.png",alt:"Trusted Badge",style:{height:"auto",width:"340px"}})))))}const Vo=c.button`
999
+ `;function _o({showLoyaltyCta:n,exploreCTAColor:o="#73DABB",emptyCartTitle:r="Your Cart is Empty",emptyCartDescription:i,isUserSignedIn:a=!1,joinNowFunction:l,exploreCtaRedirectLink:c,themeColor:s,emptyCartButtons:d=[],cartComponentsCornerRadius:p=0,cartComponentsCornerType:u="sharp",themeTextColor:m="white",isRecProductsListValid:g,recProductsList:x,addCartItem:f,productRecsCtaButtonText:y,ctaButtonBackgroundColor:b,ctaButtonTextColor:h,primaryTextColor:v,secondaryTextColor:w,showVariantSelectionDropdownInProductRecs:C,productRecsTitleText:E,emptyProductRecsTitleText:k="Empty cart Recommendations",backgroundSubdued:T,showEmptyCartRecommendations:S=!1,tertiaryColor:$,tertiaryTextColor:N}){const[B,F]=t(!1),[z,I]=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:w??"#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:$??"#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:N??"black"})),e.createElement("span",{className:"yt-cart-empty-title",style:{color:v,fontWeight:"semibold"}},r),i&&e.createElement("span",{className:"yt-cart-empty-description",style:{color:"#929292",fontSize:"14px"}},i),!a&&n&&e.createElement("div",{className:"yt-cart-empty-signin-cta",style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px"}},e.createElement(nt,{color:o,fontSize:"14px",strokeWidth:2}),e.createElement(Po,null,e.createElement("span",{className:"yt-cart-empty-signin-link",onClick:l,style:{color:o,textDecorationLine:"underline",cursor:"pointer"}},"Sign-in")," ",e.createElement("span",{style:{color:"black"}},"to avail offers"))),d&&d.length>0&&e.createElement(Ao,{className:"yt-cart-empty-button-container"},d.map((t,n)=>e.createElement("button",{key:`empty-cart-button-${n}`,onMouseEnter:()=>I(n),onMouseLeave:()=>I(null),onClick:()=>window.location.href=t.link,className:"yt-cart-empty-button",style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",backgroundColor:z===n?s||"#73DABB":"#CACACA30",color:z===n?m:"#333333",padding:"12px 24px",cursor:"pointer",border:"1px solid #D1D1D1",borderRadius:"rounded"===u?`${p}px`:"0px",transition:"all 0.2s ease",width:"100%",fontSize:"14px",fontWeight:500,textTransform:"capitalize"}},t.title)))),S&&x&&g&&f&&e.createElement("div",{className:"yt-cart-empty-recommendations",style:{width:"100%",marginTop:"20px",marginBottom:"20px"}},e.createElement(Zn,{products:x,addCartItem:f,productRecsTitleText:k,productRecsCtaButtonText:y,ctaButtonBackgroundColor:b,ctaButtonTextColor:h,primaryTextColor:v,secondaryTextColor:w,showVariantSelectionDropdownInProductRecs:C,variant:"scroll",cardLayout:"vertical",cartComponentsCornerRadius:p,cartComponentsCornerType:u,backgroundSubdued:T,tertiaryColor:$,tertiaryTextColor:N}))),e.createElement("button",{className:"yt-cart-empty-continue-shopping",onMouseEnter:()=>F(!0),onMouseLeave:()=>F(!1),onClick:()=>window.location.replace(c??"/"),style:{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"4px",backgroundColor:B?"#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(et,{color:v}),e.createElement("span",{style:{textTransform:"uppercase",fontSize:"12px",fontWeight:600,color:v,cursor:"pointer"}},"Continue Shopping")))}const Ro=se("gstNumber",""),Lo=se("gstCompanyName",""),Oo=ie("");yt("/* 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.close-button {\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n cursor: pointer;\n transition: transform 0.5s ease-in-out;\n}\n\n.close-button:hover {\n transform: rotate(360deg);\n}\n\n.qty-selector-decrement-button,\n.yt-checkout-button {\n background-image: none !important;\n}\n\nbutton.yt-checkout-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 Mo=se("postalCode",void 0);function Wo({checkoutButtonColor:i,checkoutFontSize:a,checkoutFunction:l,discountApplied:c,discountInCheckoutButton:s,discountAmountApplied:d,minimumCartValue:p,themeTextColor:u,applyGSTToCart:m,showGSTOption:g,applyNoteToCart:x,showNoteOption:f,enableGeoLocationDeliveryRestriction:y,applyPostalCodeAndDeliverySlotToCart:b,enableSlotPicker:h,isStickyCheckout:v,cartComponentsCornerType:w,cartComponentsCornerRadius:C,checkoutSectionMessage:E,checkoutSectionMessageDisplay:k,checkoutSectionMessageRedirectLink:T,showDiscountOnMRP:S,tertiaryColor:$,tertiaryTextColor:N,cartCheckpoints:B,toggleDecimal:F,disableCheckoutButton:z,checkoutButtonBottomSpacing:I=8,showCheckoutButtonPaymentIcons:D,primaryTextColor:P,hideSubtotalAndBadge:A=!1,showTrustedBadge:_,trustedBadgeData:R,isLargeScreen:L}){const O=le(Xt),M=le(Ro),W=le(Lo),V=le(Oo),j=le(Kt),H=le(Zt),q=le(Mo),Q=le(en),U=le(Jt),[Y,G]=t(!1),X=ln(O,O?.currency),[Z,K]=t("closed"),J=r(null),[ee,te]=t(!1),ne=o(()=>((e,t=.2)=>{if(!e)return"#000000";try{const n=e.trim();if(n.startsWith("#")&&(7===n.length||9===n.length)){const e=parseInt(n.slice(1,3),16),o=parseInt(n.slice(3,5),16),r=parseInt(n.slice(5,7),16),i=9===n.length?parseInt(n.slice(7,9),16):void 0,a=Math.max(0,Math.min(255,Math.floor(e*(1-t)))),l=Math.max(0,Math.min(255,Math.floor(o*(1-t)))),c=Math.max(0,Math.min(255,Math.floor(r*(1-t)))),s=`#${a.toString(16).padStart(2,"0")}${l.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`;return void 0!==i?`${s}${i.toString(16).padStart(2,"0")}`:s}return e}catch{return e}})($,.22),[$]),oe=o(()=>rn(p??0,O?.currency??"INR"),[p,O?.currency]),re=o(()=>xn(F?oe.toFixed(2):oe.toFixed(0)),[oe,F]),ie=r(null),ae=r(null),ce=r(null),se=()=>{K("closing"),setTimeout(()=>{K("closed")},300)},de=rn(O?.original_total_price,O?.currency),pe=o(()=>B?.find(e=>"free_delivery"===e.couponType&&void 0!==e.discountValue),[B]),ue=o(()=>!(!pe||!pe.minimumOrderValue)&&de>=pe.minimumOrderValue,[pe,de]),me=ue&&pe&&pe.discountValue||0,ge=d?rn(d,O?.currency??"INR"):0,xe=Number((de-ge).toFixed(2)),fe=o(()=>{if(!O?.items?.length)return 0;const e=O.items.reduce((e,t)=>e+(S&&t?.compare_at_price&&t?.compare_at_price>t?.original_price?t.compare_at_price:t.original_price)*t.quantity,0);return rn(e,O?.currency)},[O?.items,S]),ye=o(()=>ue?fe+me:fe,[ue,fe,me]),be=o(()=>oe&&oe>0?`Add products worth more than ${X}${re}`:"",[oe,X,re]),he=o(()=>O?.items?.length?O.items.reduce((e,t)=>t.compare_at_price&&t.compare_at_price>t.original_price?e+(t.compare_at_price-t.original_price)*t.quantity:e,0):0,[O?.items]),ve=rn(he,O?.currency??"INR");n(()=>{ie.current&&gn(ie.current),ae.current&&gn(ae.current),ce.current&&gn(ce.current)},[i,ge,S,ve,Z,me]);const we=o(()=>{const e={};return O?.items?.length?(O.items.forEach(t=>{t.discounts&&Array.isArray(t.discounts)&&t.discounts.forEach(t=>{e[t.title]=(e[t.title]||0)+t.amount})}),e):e},[O?.items]),Ce=o(()=>{const e=[];for(const t in we)if(Object.prototype.hasOwnProperty.call(we,t)){const n=we[t],o=rn(n,O?.currency??"INR"),r=bn(t);e.push({title:r,amount:o})}return e},[we,O?.currency]),Ee=o(()=>{let e=0;return e+=S?ge+ve:ge,ue&&(e+=me),e},[ge,ve,S,ue,me]),ke=async e=>{if(G(!0),xe<=0)G(!1);else{if(y){if("standard"!==U&&(h?!j:!H.isPostalCodeValid))return void G(!1);if(b)try{"standard"===U?await b(U):await b(U,String(q)||"",Q&&h?new Date(Q).toDateString():"")}catch(e){console.error("Error applying postal code and delivery slot"),alert("There was an error processing your delivery options. Please try again.")}}g&&m&&""!==W&&""!==M&&await m(M,W),f&&x&&""!==V&&await x(V),await l(e),G(!1)}},[Se,$e]=t(!1);n(()=>{$e(xe<=0||(!!z||!!y&&("standard"!==U&&(h?!j:!H.isPostalCodeValid))))},[H,U,y,h,j,Q,z,xe]);const[Ne,Be]=t(!1),Fe=r(null),[ze,Ie]=t("0px");n(()=>{Fe.current&&Ie(Ne?`${Fe.current.scrollHeight}px`:"0px")},[Ne,Ce,ue]);const De=()=>{Be(!Ne)};n(()=>{function e(e){J.current&&!J.current.contains(e.target)&&se()}return"open"!==Z&&"opening"!==Z||document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[Z]);const Pe=(t,n="Checkout")=>t?e.createElement("span",{style:{fontSize:"13px",width:"100%",textAlign:"center"}},"Redirecting to Checkout..."):D?e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},e.createElement("span",{className:"yt-cart-summary-checkout-span",style:{fontSize:"16px"}},n),e.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},e.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),e.createElement(ot,{className:"yt-cart-summary-checkout-next-icon",fontSize:"24px"}))):e.createElement("div",{style:{alignItems:"center",display:"flex",columnGap:"5px",pointerEvents:"none"}},"Proceed to Checkout"!==n&&e.createElement(Te,{fontSize:"20px"}),e.createElement("span",{style:{fontSize:"16px",pointerEvents:"none"}},n));return e.createElement("div",{className:"yt-cart-checkout-section",style:{position:"relative"}},!!E&&E.length>0&&!fn()&&(()=>{const t=k||"ribbon";if("ribbon"===t)return e.createElement("div",{className:"yt-cart-bottom-bar",style:{fontSize:"10px",textAlign:"center",backgroundColor:$,padding:"3px",boxShadow:"1px 2px 4px 0px #00000061",color:N,marginBottom:A?"0px":"4px",borderTopLeftRadius:"14px",borderTopRightRadius:"14px",cursor:T?"pointer":"default"},onClick:()=>{T&&(window.location.href=T)}},E);const n=({children:n})=>e.createElement("div",{className:"yt-cart-checkout-ribbon-container",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",padding:L?"0 55px":"0 13px",marginBottom:"4px",position:"bookmark"===t?"absolute":"static",top:"bookmark"===t?"-11px":void 0,cursor:T?"pointer":"default"},onClick:()=>{T&&(window.location.href=T)}},n);return"tag"===t?e.createElement(n,null,e.createElement("div",{className:"yt-cart-checkout-ribbon-tag-container",style:{display:"flex",alignItems:"center",width:"100%"}},e.createElement("svg",{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:ne}),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:$})),e.createElement("div",{className:"yt-cart-checkout-ribbon-tag-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:$,color:N,padding:"8px 16px",fontSize:"10px",marginTop:"5px",lineHeight:"5px"}},E),e.createElement("svg",{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:ne}),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:$})))):e.createElement(n,null,e.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-container",style:{display:"flex",alignItems:"center",width:"100%"}},e.createElement("svg",{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:ne}),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:$})),e.createElement("div",{className:"yt-cart-checkout-ribbon-bookmark-center",style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",backgroundColor:$,color:N,padding:"8px 16px",fontSize:"10px",lineHeight:"3px",marginRight:"-1px",marginLeft:"-1px"}},E),e.createElement("svg",{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:ne}),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:$}))))})(),(!0===s||"true"===s)&&"closed"!==Z&&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"===Z?1:0,transition:"opacity 0.3s ease-in-out",display:"block",zIndex:2147483643},onClick:se}),e.createElement("div",{className:"yt-cart-checkout-popout",ref:J,style:{position:"fixed",bottom:0,left:0,right:0,zIndex:2147483644,transform:"open"===Z?"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",null,"Price Summary"),e.createElement("button",{className:"yt-cart-checkout-popout-close",onClick:se,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,(S&&ve>0||c&&Ce.length>0||ue&&me>0)&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},e.createElement("span",{style:{fontSize:"14px",color:"#212529"}},"Subtotal"),e.createElement("span",{style:{fontSize:"14px",color:"#212529"}},X,xn(ue?F?ye.toFixed(2):ye.toFixed(0):F?fe.toFixed(2):fe.toFixed(0)))),(ge>0||S&&ve>0||ue&&me>0)&&e.createElement("div",{style:{display:"flex",flexDirection:"column",paddingBottom:"5px",marginTop:"5px",fontWeight:"600"}},S&&ve>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},e.createElement("span",null,"Discount on MRP"),e.createElement("span",{style:{color:"#D3122A"}},"-",X,xn(F?ve.toFixed(2):ve.toFixed(0)))),ue&&me>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529"}},e.createElement("span",null,"Free Shipping"),e.createElement("span",{style:{color:"#D3122A"}},"-",X,xn(F?me.toFixed(2):me.toFixed(0)))),Ce.map(t=>e.createElement("div",{key:t.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#1E1E1E"}},e.createElement("span",null,t.title),e.createElement("span",{style:{color:"#D3122A"}},"-",X,xn(F?t.amount.toFixed(2):t.amount.toFixed(0))))),Ee>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"#212529",marginTop:"5px",paddingTop:"5px",borderTop:"1px solid #E5E7EB"}},e.createElement("span",null,"Total Savings"),e.createElement("span",{style:{color:"#D3122A",fontWeight:"bold"}},"-",X,xn(F?Ee.toFixed(2):Ee.toFixed(0))))),(ge>0||S&&ve>0||ue&&me>0)&&e.createElement("div",{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",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:ge>0||S&&ve>0||ue&&me>0?"10px":"0"}},e.createElement("div",{style:{display:"flex",flexDirection:"column"}},e.createElement("span",{style:{fontSize:"14px",fontWeight:"600",color:"#212529"}},"Grand Total"),e.createElement("span",{style:{fontSize:"9px",color:"#4A5157"}},"Inclusive of all taxes")),e.createElement("span",{style:{fontSize:"16px",color:"black",fontWeight:"var(--yt-cart-font-weight)"}},X,xn(F?xe.toFixed(2):xe.toFixed(0)))),e.createElement("div",{style:{display:"flex",background:$,color:N,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",{src:"https://r2.yourtoken.io/image%2016.png",alt:"confetti-image",style:{width:"30px",height:"30px"}}),"You saved"," ",e.createElement("span",null,X,xn(F?Ee.toFixed(2):Ee.toFixed(0)))," ","on your order")),e.createElement("button",{ref:ae,id:"yt-checkout-button-popout",className:"yt-checkout-button",onClick:ke,disabled:Se,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:0,height:"45px",padding:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:i,border:0,textTransform:"uppercase",fontSize:a,letterSpacing:"1px",opacity:Se?.5:1,cursor:Se?"not-allowed":"pointer",borderRadius:"0px",boxShadow:"none",width:"100%"}},Pe(Y)))),(!0===s||"true"===s)&&z&&Se&&be&&e.createElement("div",{style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},be),!0===s||"true"===s?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",{style:{display:"flex",flexDirection:"row",alignItems:"stretch",justifyContent:"space-between",width:"auto",padding:v?"7px 0 8px 8px":`7px 8px ${I}px 8px`}},e.createElement("div",{style:{display:"flex",flexDirection:"column",textAlign:"center",justifyContent:"center",alignItems:"flex-start",paddingRight:"2rem",overflowWrap:"normal"}},(ge>0||S&&ve>0||ue&&me>0)&&e.createElement("div",{className:"yt-cart-checkout-save-badge",ref:ce,style:{fontSize:"9px",backgroundColor:i,width:"max-content",padding:"2px 8px"}},"Saving ",X,xn(F?Ee.toFixed(2):Ee.toFixed(0))),Y?e.createElement("div",{style:{fontSize:"12px",color:"#4a4a4a"}},"Redirecting to Checkout..."):c||ue&&pe?e.createElement("div",null,e.createElement("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"center"}},e.createElement("span",{style:{fontSize:"15px",color:"#1E1E1E",fontWeight:"600"}},X,xn(F?xe.toFixed(2):xe.toFixed(0))),(ge>0||ve>0||ue&&me>0)&&e.createElement("span",{style:{fontSize:"14px",color:"#8C8C8C",textDecoration:"line-through",marginLeft:"4px",fontWeight:"normal"}},X,xn(ue?ye.toFixed(0):fe.toFixed(0))))):e.createElement("div",{style:{fontSize:"18px",color:"#1E1E1E",fontWeight:"600"}},X,xn(F?xe.toFixed(2):xe.toFixed(0))),S&&ve>0||c&&ge>0||ue&&me>0?e.createElement("div",{style:{fontSize:"11px",color:"#4A5157",width:"max-content",cursor:"pointer",textDecoration:"underline"},onClick:e=>{e.stopPropagation(),K("opening"),requestAnimationFrame(()=>{K("open")}),te(!ee)}},"See Details"):e.createElement("div",{style:{fontSize:"9px",color:"#4A5157",width:"max-content"}},"Inclusive of all taxes")),e.createElement("div",{style:{display:"flex",justifyContent:"center",width:"100%"}},e.createElement("button",{ref:ie,id:"yt-checkout-button",className:"yt-checkout-button",onClick:ke,disabled:Se,style:{backgroundColor:i,border:0,textTransform:"uppercase",letterSpacing:"1px",fontSize:"12px",padding:"10px 15px",opacity:Se?.5:1,cursor:Se?"not-allowed":"pointer",borderRadius:"rounded"===w?`${C}px`:"0px",width:"100%",margin:"0 auto",boxShadow:"none"}},D?e.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",pointerEvents:"none"}},e.createElement("span",{style:{fontSize:"12px"}},"CHECKOUT"),e.createElement("div",{style:{display:"flex",alignItems:"center",marginLeft:"1.5rem"}},e.createElement("img",{src:"https://r2.yourtoken.io/checkout-button-payment-provider-icons.png",alt:"Payment methods",style:{height:"22px",width:"auto"}}),e.createElement(ot,{fontSize:"24px"}))):"CHECKOUT"))),_&&!A&&e.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0 6px"}},e.createElement("img",{src:R?.badgeImage?.path||"https://r2.yourtoken.io/powered-by-badge-v2.png",alt:"Trusted Badge",style:{height:"auto",width:"340px"}}))):e.createElement(e.Fragment,null,z&&Se&&be&&e.createElement("div",{className:"yt-cart-checkout-disabled-message",style:{display:"flex",justifyContent:"center",textAlign:"center",fontSize:"13px",color:"red"}},be),e.createElement("div",{className:"yt-cart-checkout-summary",style:{display:"flex",flexDirection:"column",rowGap:"5px",backgroundColor:"rgba(138, 138, 138, 0.08)",paddingTop:A?"0px":"10px"}},e.createElement("div",{className:"yt-cart-checkout-breakdown",style:{display:A?"none":"flex",flexDirection:"column",rowGap:"2px",margin:"0 1rem",color:P}},(ve>0||c&&Ce.length>0||ue&&me>0)&&Ee>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:"12px"}},"Subtotal"),e.createElement("span",{className:"yt-cart-subtotal-value",style:{fontSize:"14px"}},X,xn(ue?F?ye.toFixed(2):ye.toFixed(0):F?fe.toFixed(2):fe.toFixed(0)))),(ge>0||ve>0||ue&&me>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",e.createElement("button",{onClick:De,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"}},Ne?"Hide details":"See details")),e.createElement("span",{className:"yt-cart-discounts-total",style:{fontSize:"14px",color:"#D3122A",fontWeight:"600"}},"-",X,xn(F?Ee.toFixed(2):Ee.toFixed(0)))),e.createElement("div",{className:"yt-cart-discounts-details",ref:Fe,style:{height:ze,overflow:"hidden",transition:"height 0.3s ease, opacity 0.3s ease",opacity:Ne?1:0,marginTop:Ne?"5px":"0",borderTop:Ne?"1px solid #E5E7EB":"none",paddingTop:Ne?"5px":"0",fontWeight:"600"}},S&&ve>0&&e.createElement("div",{className:"yt-cart-discount-row",style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",null,"Discount on MRP"),e.createElement("span",{style:{color:"#D3122A"}},"-",X,xn(F?ve.toFixed(2):ve.toFixed(0)))),ue&&me>0&&e.createElement("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",null,"Free Shipping"),e.createElement("span",{style:{color:"#D3122A"}},"-",X,xn(F?me.toFixed(2):me.toFixed(0)))),Ce.map(t=>e.createElement("div",{key:t.title,style:{display:"flex",justifyContent:"space-between",fontSize:"12px"}},e.createElement("span",null,t.title),e.createElement("span",{style:{color:"#D3122A"}},"-",X,xn(F?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)"}},X,xn(F?xe.toFixed(2):xe.toFixed(0))))),e.createElement("button",{ref:ie,id:"yt-checkout-button",className:"yt-checkout-button",onClick:ke,disabled:Se,style:{display:"flex",flexDirection:"row",alignItems:"center",margin:"closed"!==Z||v?"0":`4px 1rem ${I}px 1rem`,height:"45px",paddingTop:"10px",paddingBottom:"10px",justifyContent:"center",columnGap:"8px",backgroundColor:i,border:0,color:u??"white",textTransform:"uppercase",fontSize:a,letterSpacing:"1px",opacity:Se?.5:1,cursor:Se?"not-allowed":"pointer",borderRadius:"closed"!==Z?"0px":"rounded"===w?`${C}px`:"0px",boxShadow:"none"}},Pe(Y,D?"Checkout":"Proceed to Checkout")),_&&!A&&e.createElement("div",{className:"yt-cart-powered-by-badge",style:{display:"flex",justifyContent:"center",alignItems:"center",paddingBlock:"0px 6px"}},e.createElement("img",{src:R?.badgeImage?.path||"https://r2.yourtoken.io/powered-by-badge-v2.png",alt:"Trusted Badge",style:{height:"auto",width:"340px"}})))))}const Vo=c.button`
1000
1000
  background-color: ${e=>e.$ctaButtonBackgroundColor||"#BEB8EC"};
1001
1001
  color: ${e=>e.$ctaButtonTextColor||"black"};
1002
1002
  font-size: 11px;
@@ -2468,7 +2468,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
2468
2468
  font-weight: 400;
2469
2469
  min-width: 14px;
2470
2470
  line-height: 14px;
2471
- `,tc=[...((nc={headerIds:["offers-carousel","timer","info-text"],scroll:{topIds:[],bottomIds:["steal-deal","recs"]},footerIds:["bundle","gst","freebie-claim","shipping","note","gift-wrap","coupon","loyalty","points-preview"]}).headerIds??[]).map(e=>({id:e,zone:"headerIds"})),...(nc.scroll?.topIds??[]).map(e=>({id:e,zone:"scroll.topIds"})),...(nc.scroll?.bottomIds??[]).map(e=>({id:e,zone:"scroll.bottomIds"})),...(nc.footerIds??[]).map(e=>({id:e,zone:"footerIds"}))];var nc;const oc=new Set(tc.map(e=>e.id)),rc=(e,t,n)=>{switch(t){case"headerIds":e.headerIds?.push(n);break;case"scroll.topIds":e.scroll?.topIds?.push(n);break;case"scroll.bottomIds":e.scroll?.bottomIds?.push(n);break;case"footerIds":e.footerIds?.push(n)}},ic=({isOpen:o,setIsOpen:i,backgroundColor:a="white",backgroundSubdued:l="#3947821F",tertiaryColor:c="#067D431A",tertiaryTextColor:s="#000000",exploreCTAColor:d,checkoutFontSize:p,cartTitle:u="My Cart",emptyCartTitle:m,emptyCartDescription:g,emptyCartButtons:x,removeCartItem:f,handleIncrement:y,handleDecrement:b,addCartItem:h,isUserSignedIn:v,showBundle:w,bundleProducts:C,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:T,rewardMultiplier:S,redemptionMultiplier:$,discountApplied:N,removeDiscount:B,applyDiscount:F,checkoutFunction:z,joinNowFunction:I,guestLoyaltyPercentage:D,isDev:A,recProductsList:_,showMultiStepProgressBar:R,cartCheckpoints:L,redemptionRate:O,pointsRewardRate:V,showCartLevelAltPay:j,exploreCtaRedirectLink:H,discountAmountApplied:q,minimumCartValue:Q,discountInCheckoutButton:U,isStickyCheckout:Y,handleCheckpointCrossed:G,customCartProgressBarCriteria:X,checkoutButtonColor:Z="#252E69",ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,productRecsCtaButtonText:oe,productRecsTitleText:ie,emptyProductRecsTitleText:ce,showProductRecsOnDesktop:se,showProductRecsOnMobile:de,themeColor:pe,themeTextColor:ue,companyName:me,gstNumber:ge,showGSTOption:xe,applyGSTToCart:fe,showMOVForProgressTiers:ye,freeProduct:be,showLoyaltyCta:he=!1,freeProductAdjustedCartTotal:ve,minimumOrderValueToAvailDiscount:we,signinCTAButtonVisible:Ce,cartSigninCTAMainText:Ee,applyNoteToCart:ke,note:Te,showNoteOption:Se,inlineCartOfferInfoText:$e,inlineCartOfferInfoRedirectLink:Ne,cartOfferTermsAndConditionsText:Be,showEditOptionOnProducts:Fe,onSetLoading:ze,showVariantSelectionDropdownInProductRecs:Ie,originalCartSubtotal:De,freebieProductsInCart:Pe,showFreebieClaim:Ae,addFreebieToCart:_e,freebiesInCart:Re,effectiveQuantityForProgressBar:Le,productPercentageOffMapping:Oe,removeFreebieFromCart:Me,postalCodeList:We,enableGeoLocationDeliveryRestriction:Ve=!1,getProductDetailsByVariantId:je,applyPostalCodeAndDeliverySlotToCart:He,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe,freebieFlowCheckpoints:Ue,freebieClaimData:Ye,postalCodeBasedItemTrackingParameter:Ge,enableSlotPicker:Xe,deliveryHeaderTitle:Ze,deliveryAvailableText:Ke,deliveryNotAvailableText:Je,giftWrapSetupData:et,giftWrapProductDetail:tt,progressBarFreeProductIconType:nt,enableCustomCartOnCartPage:ot,isCartPage:rt,showCartTimer:it,showFreebieMilestone:at,freebieMilestoneData:lt,cartTimerInMinutes:ct,cartTimerCustomText:st,productRecsCardLayout:dt,productRecsCardListVariant:pt,imageAspectSelector:ut,cartComponentsCornerType:mt,cartComponentsCornerRadius:gt,cartOffersCarousalData:xt,gstSectionCustomizationData:ft,noteSectionTitle:yt,checkoutSectionMessage:bt,checkoutSectionMessageDisplay:ht,showVariantSelectionDropdownInProductClaim:vt,loyaltyDiscount:wt,brandTokenName:Ct,showDiscountOnMRP:Et,switchWidthVariant:kt,prefixMessageText:Tt,suffixMessageText:St,successMessageText:$t,toggleDecimal:Nt,cartOffersCarouselHeight:Bt,disableCheckoutButton:Ft,showEmptyCartRecommendations:zt=!1,checkoutButtonBottomSpacing:It,applyCouponCode:Dt,showApplyCoupon:Pt,enableConfetti:At,checkoutSectionMessageRedirectLink:_t,showCheckoutButtonPaymentIcons:Rt,stealDealCheckpoints:Lt,stealDealProducts:Ot,stealDealAddToCart:Mt,showCouponOptions:Wt,rewardCoupons:Vt,couponSelectionData:jt,useCartShell:Ht,showTrustedBadge:qt,trustedBadgeData:Qt,drawerLayoutData:Ut})=>{const Yt=le(Xt),Gt=le(tn),[Kt,an]=t(!1),[ln,cn]=t(!1),[sn,dn]=t(!0),{setLoading:pn}=nn();e.useEffect(()=>{ze&&ze(pn)},[ze]);const un=r(!!Ht&&(window.ytCartShellState?.isOpen??!1)),mn=r(null),gn=r(null);n(()=>{const e=e=>{"open"!==e.state?.ytCustomCartDrawer&&i(!1)};return o?(un.current||(mn.current=window.history.state,gn.current=window.location.href,window.history.pushState({ytCustomCartDrawer:"open"},"")),window.addEventListener("popstate",e),un.current=!0):(un.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.replaceState(mn.current,"",gn.current??window.location.href),un.current=!1),()=>{window.removeEventListener("popstate",e)}},[o,i]);const[xn,fn]=t(!1);n(()=>{const e=document.querySelector("body");e&&(ot&&rt?e.classList.remove("drawer-open"):!xn&&o?e.classList.add("drawer-open"):e.classList.remove("drawer-open"))},[o,ot,rt,xn]),n(()=>{function e(){const e=window.innerWidth;fn(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const yn=Yt?.items?.reduce((e,t)=>e+t?.quantity,0);n(()=>{const e=()=>{an(!0),window.setTimeout(()=>an(!1),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)},[]);const[bn,hn]=t("normal"),[vn,wn]=t("normal"),[Cn,En]=t("auto");n(()=>{CSS.supports("font-weight","500")?hn("500"):CSS.supports("font-weight","400")?hn("400"):CSS.supports("font-weight","600")&&hn("600"),CSS.supports("font-weight","400")?wn("400"):CSS.supports("font-weight","300")?wn("300"):CSS.supports("font-weight","200")&&wn("200"),CSS.supports("width","-webkit-fill-available")?En("-webkit-fill-available"):CSS.supports("width","-moz-available")&&En("-moz-available")},[]),n(()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",bn),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",vn),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",Cn)},[bn,vn]);const[kn]=ae(Zt),[Tn]=ae(en),[Sn]=ae(Jt);n(()=>{dn(!("all-products"!==Ge&&("specific-tags"!==Ge||kn.isPostalCodeValid||Xe)&&("specific-tags"!==Ge||kn.isPostalCodeValid||Tn||!Xe)&&("specific-tags"===Ge&&"standard"===Sn||ln&&(Xe?kn.isPostalCodeValid&&Tn:kn.isPostalCodeValid))))},[kn.isPostalCodeValid,Tn,ln,Ge,Xe]),ae(on);const[$n,Nn]=t(!0);n(()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&Nn(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&Nn(!1)},[]);const Bn=()=>{Nn(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")},Fn=new Date("2024-11-01"),zn=Ht?document.getElementById("yt-cart-shell-content"):null,In=(e=>{const t={headerIds:[],scroll:{topIds:[],bottomIds:[]},footerIds:[]},n=new Set;return["headerIds","scroll.topIds","scroll.bottomIds","footerIds"].forEach(o=>{((e,t)=>{switch(t){case"headerIds":return e?.headerIds??[];case"scroll.topIds":return e?.scroll?.topIds??[];case"scroll.bottomIds":return e?.scroll?.bottomIds??[];case"footerIds":return e?.footerIds??[];default:return[]}})(e,o).forEach(e=>{!n.has(e)&&oc.has(e)&&(n.add(e),rc(t,o,e))})}),tc.forEach(({id:e,zone:o})=>{n.has(e)||(n.add(e),rc(t,o,e))}),t})(Ut),Dn=(t,n)=>{const r=`drawer-layout-${t}-${n}`;switch(t){case"offers-carousel":return xt?.enableCartOffersCarousel?e.createElement(ul,{key:r,themeColor:pe,cartOffersCarousalData:xt,cartOffersCarouselHeight:Bt,cartData:Yt}):null;case"timer":return it&&$n&&Yt?.item_count?e.createElement(Ha,{key:r,minutes:ct,customText:st,onTimerComplete:Bn}):null;case"info-text":return $e?e.createElement(Na,{key:r,inlineCartOfferInfoText:$e,inlineCartOfferInfoRedirectLink:Ne,themeColor:pe,tooltipText:Be,themeTextColor:ue}):null;case"steal-deal":return Lt&&Lt.length>0&&Ot&&Ot.length>0&&Yt?.item_count>0?e.createElement(Kl,{key:r,stealDealCheckpoints:Lt,stealDealProducts:Ot,freeProductAdjustedCartTotal:ve,effectiveQuantityForProgressBar:Le,addFreebieToCart:Mt??_e,freebiesInCart:Re??[],themeColor:pe,primaryTextColor:te,secondaryTextColor:ne}):null;case"recs":return(t=>{const n=xn&&se&&!!_&&_.length>0&&Yt?.item_count>0&&h,o=!xn&&de&&!!_&&_.length>0&&Yt?.item_count>0&&h;return n||o?e.createElement(e.Fragment,{key:t},n&&e.createElement(Zn,{addCartItem:h,products:_,productRecsCtaButtonText:oe,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,productRecsTitleText:ie,themeColor:pe,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Ie,cardLayout:dt,variant:pt,cartComponentsCornerType:mt,cartComponentsCornerRadius:gt,backgroundSubdued:l,backgroundColor:a,tertiaryColor:c,tertiaryTextColor:s}),o&&e.createElement(Zn,{addCartItem:h,products:_,productRecsCtaButtonText:oe,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,productRecsTitleText:ie,themeColor:pe,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Ie,cardLayout:dt,variant:pt,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,backgroundSubdued:l,tertiaryColor:c,tertiaryTextColor:s})):null})(r);case"bundle":return Yt?.item_count>0&&w&&C?e.createElement(Lr,{key:r,bundleProducts:C}):null;case"gst":return xe&&fe&&Yt?.item_count>0?e.createElement(di,{key:r,companyName:me,gstNumber:ge,themeColor:pe,iconColor:ft?.iconColor,showIcon:ft?.showIcon,backgroundColor:ft?.backgroundColor,textColor:ft?.textColor,title:ft?.title}):null;case"freebie-claim":return Yt&&Yt?.item_count>0&&_e&&Pe&&Re&&Pe.length>0?e.createElement($a,{key:r,freebieProductsInCart:Pe,themeColor:pe,themeTextColor:ue,primaryTextColor:te,addFreebieToCart:_e,freebiesInCart:Re,imageAspectSelector:ut,freebieCouponTemplates:Qe,freebieClaimData:Ye,cartCheckpoints:L,isCartDrawerOpen:o}):null;case"shipping":return Ve&&(We?.length??0)>0&&He&&Yt?.item_count>0?e.createElement("div",{key:r,className:"yt-cart-geolocation-section form-group"},e.createElement("div",{className:"yt-cart-shipping-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>dn(!sn)},e.createElement("span",{className:"yt-cart-shipping-label",style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",e.createElement(J,null)),e.createElement("div",{className:"yt-cart-shipping-toggle-icon icon-transition"},sn?e.createElement(M,null):e.createElement(W,null))),"all-products"===Ge&&sn?e.createElement(za,{postalCodeList:We,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,deliveryHeaderTitle:Ze,deliveryAvailableText:Ke,deliveryNotAvailableText:Je,disabledDates:Fn}):sn&&(ln?e.createElement(za,{postalCodeList:We,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,deliveryHeaderTitle:Ze,deliveryAvailableText:Ke,deliveryNotAvailableText:Je,disabledDates:Fn}):e.createElement(Ia,{postalCodeList:We,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,disabledDates:Fn}))):null;case"note":return Se&&ke&&Yt?.item_count>0?e.createElement(pi,{key:r,note:Te,noteSectionTitle:yt}):null;case"gift-wrap":return et?.showGiftWrapOption&&Yt?.item_count>0?e.createElement(Wa,{key:r,themeColor:pe,id:et?.giftProductId,detail:tt,showPrice:et?.showPrice,errorText:et?.errorText,customText:et?.customText,showGiftIcon:et?.showGiftIcon,showProductImage:et?.showProductImage,addCartItem:h,removeCartItem:f}):null;case"coupon":return Yt?.item_count>0&&Wt&&Vt&&jt&&Dt&&!he?e.createElement(Zr,{key:r,rewardCoupons:Vt,couponSelectionData:jt,applyCouponCode:Dt,removeDiscount:B,enableConfetti:At,backgroundSubdued:l,themeColor:pe,themeTextColor:ue,primaryTextColor:te,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,cartComponentsCornerRadius:gt}):Yt?.item_count>0&&Pt&&!Wt&&!he&&Dt?e.createElement(Or,{key:r,backgroundSubdued:l,themeColor:pe,themeTextColor:ue,primaryTextColor:te,cartComponentsCornerRadius:gt,applyCouponCode:Dt,removeDiscount:B,enableConfetti:At}):null;case"loyalty":return(t=>he&&Yt?.item_count?e.createElement(e.Fragment,{key:t},v||wt?!wt&&void 0!==E&&void 0!==T&&!!k&&!!F&&e.createElement(er,{themeColor:pe,applyDiscount:F,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:T,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,minimumOrderValueToAvailDiscount:we,brandTokenName:Ct,showCartLevelAltPay:j,redemptionMultiplier:$}):!!D&&!!I&&e.createElement(Qo,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:Ce,themeColor:pe,joinNowFunction:I,guestLoyaltyPercentage:D,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,showCartLevelAltPay:j}),!!wt&&!!B&&wt&&void 0!==T&&e.createElement(Xo,{themeColor:pe,removeDiscount:B,loyaltyDiscount:wt,isDev:A,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,pointsToBeUsed:T,brandTokenName:Ct,showCartLevelAltPay:j}),!!we&&we>1&&e.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:pe??"#50D1AA",fontWeight:600,display:"flex",justifyContent:Ce?"space-between":"center"}},"Minimum order value to use ",Ct,":"," ",we)):null)(r);case"points-preview":return he&&j&&O&&k&&Yt?.item_count>0?e.createElement(bl,{key:r,loyaltyIcon:k,backgroundSubdued:l,primaryTextColor:te,pointsRewardRate:V,rewardMultiplier:S}):null;default:return null}},Pn=e.createElement(e.Fragment,null,Gt.cartLoading?e.createElement("div",{className:"yt-cart-loader-overlay",style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},Gt.showLoader&&!Gt.showSkeletonLoader&&e.createElement("div",{className:"loader"},"‎")):e.createElement(e.Fragment,null),e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-drawer-content",style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},e.createElement("div",{className:"yt-cart-header"},e.createElement("div",{className:"yt-cart-header-row",style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",margin:"1rem 1rem 0px"}},e.createElement("span",{className:"yt-cart-title-container",style:{fontWeight:"var(--yt-cart-font-weight, bold)",color:te,fontSize:"16px"}},e.createElement("span",{className:"yt-cart-title-text",style:{whiteSpace:"nowrap",flexShrink:0}},u),Yt?.item_count>0&&j&&!(he&&j)&&V>0&&e.createElement(vl,{pointsRewardRate:V,loyaltyIcon:k,brandTokenName:Ct,themeColor:pe,themeTextColor:ue,rewardMultiplier:S}),yn>0&&e.createElement(ec,{className:"yt-cart-item-count-badge",$backgroundSubdued:l},yn)),e.createElement("div",{className:"yt-cart-header-actions",style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(ot&&rt)&&e.createElement("div",{className:"yt-cart-close-button close-button",style:{backgroundColor:l||"#cacaca30"}},e.createElement(re,{style:{height:"auto",width:"auto",color:te},fontSize:24,cursor:"pointer",onClick:()=>{i(!o)}})))),Gt&&e.createElement(fl,{$themeColor:pe,show:Gt.showLoader}),Kt&&At&&e.createElement(Eo,{particleCount:50,spread:90,origin:{y:.3}}),In.headerIds?.map((e,t)=>Dn(e,t))),R&&Yt?.items_subtotal_price>0&&Yt?.currency&&!!L&&function(e,t,n,o,r){if(!e||0===e.length)return!1;const i=[...e].sort((e,t)=>"minimum_order_value"===o?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold);return i.filter(e=>0!==e?.[bo(o)]&&("minimum_order_value"!==o||1!==e?.[bo(o)])).some((e,a)=>ho(e,a,i,r,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:o,checkpoints:i}).progressPercentage>0)}(L,rn(void 0!==De?De:Yt?.items_subtotal_price,Yt.currency),void 0===Le?Yt?.item_count:Le,X??"minimum_order_value",Yt?.item_count)&&e.createElement(e.Fragment,null,e.createElement(Do,{customCartProgressBarCriteria:X??"minimum_order_value",handleCheckpointCrossed:G,checkpoints:L,effectiveQuantityForProgressBar:void 0===Le?Yt?.item_count:Le,currentCartAmount:rn(void 0!==De?De:Yt?.items_subtotal_price,Yt.currency),themeColor:pe,themeTextColor:ue,primaryTextColor:te,secondaryTextColor:ne,showMOVForProgressTiers:ye,progressBarFreeProductIconType:nt,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,prefixMessageText:Tt,suffixMessageText:St,successMessageText:$t,enableConfetti:At})),Yt?.item_count>0&&e.createElement("div",{className:"yt-cart-divider",style:{display:"flex",height:"12px",background:"#87878717"}}),0===Yt?.items?.length&&0===Yt?.item_count&&!1===Gt?.showSkeletonLoader?e.createElement(_o,{showLoyaltyCta:he,joinNowFunction:I,emptyCartTitle:m,emptyCartDescription:g,exploreCTAColor:d,isUserSignedIn:v,exploreCtaRedirectLink:H,themeColor:pe,emptyCartButtons:x,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,themeTextColor:ue,recProductsList:_,addCartItem:h,productRecsCtaButtonText:oe,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Ie,emptyProductRecsTitleText:ce,backgroundSubdued:l,showEmptyCartRecommendations:zt,tertiaryColor:c,tertiaryTextColor:s}):e.createElement("div",{className:"yt-cart-scroll-area",style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},In.scroll?.topIds?.map((e,t)=>Dn(e,t)),e.createElement(Rr,{isDev:A,themeColor:pe,handleDecrement:b,handleIncrement:y,removeCartItem:f,addCartItem:h,primaryTextColor:te,secondaryTextColor:ne,freeProduct:be,themeTextColor:ue,showEditOptionOnProducts:Fe,productPercentageOffMapping:Oe,removeFreebieFromCart:Me,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe??[],freebieFlowCheckpoints:Ue??[],cartCheckpoints:L,freeProductAdjustedCartTotal:ve,imageAspectSelector:ut,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,giftWrapVariantId:tt?.variants?.nodes[0]?.id,giftWrapProductId:et?.giftProductId,showGiftWrapAsLineItem:et?.showGiftWrapAsLineItem,backgroundSubdued:l,tertiaryColor:c,tertiaryTextColor:s,backgroundColor:a,showDiscountOnMRP:Et,checkoutSectionMessage:bt,checkoutSectionMessageRedirectLink:_t,showFreebieMilestone:at,freebieMilestoneData:lt,freeLabelText:Ye?.freeLabelText}),In.scroll?.bottomIds?.map((e,t)=>Dn(e,t)),"devlhok.myshopify.com"===window.ytapp?.storeDomain&&e.createElement(wl,{showDiscountOnMRP:Et,cartCheckpoints:L,toggleDecimal:Nt,primaryTextColor:te,discountApplied:N,showTrustedBadge:qt,discountAmountApplied:q})),e.createElement(Yo,null,In.footerIds?.map((e,t)=>Dn(e,t)),Yt&&z&&Yt?.item_count>0&&e.createElement("div",{className:"yt-cart-checkout-wrapper"},e.createElement(Wo,{disableCheckoutButton:!!Ft||Gt.cartLoading,discountApplied:N,checkoutFunction:z,checkoutButtonColor:Z,checkoutFontSize:p,discountInCheckoutButton:U,isStickyCheckout:Y,discountAmountApplied:q,minimumCartValue:Q,themeTextColor:ue,applyGSTToCart:fe,showGSTOption:xe,applyNoteToCart:ke,showNoteOption:Se,enableGeoLocationDeliveryRestriction:Ve,applyPostalCodeAndDeliverySlotToCart:He,enableSlotPicker:Xe,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,checkoutSectionMessage:bt,checkoutSectionMessageDisplay:ht,checkoutSectionMessageRedirectLink:_t,showDiscountOnMRP:Et,tertiaryColor:c,tertiaryTextColor:s,cartCheckpoints:L,toggleDecimal:Nt,checkoutButtonBottomSpacing:It,showCheckoutButtonPaymentIcons:Rt,primaryTextColor:te,hideSubtotalAndBadge:"devlhok.myshopify.com"===window.ytapp?.storeDomain,showTrustedBadge:qt,trustedBadgeData:Qt,isLargeScreen:xn}))))));return Ht&&zn?P(Pn,zn):e.createElement(Jl,{className:"yt-cart-drawer",$isDev:A,$isOpen:o,$backgroundColor:a,$enableCustomCartOnCartPage:ot,$isCartPage:rt,$isLargeScreen:xn,$switchWidthVariant:kt},Pn)};yt('@media (max-width: 108px) {\n .yt-fixed-bundle-price-section {\n width: 100% !important;\n }\n .yt-fixed-bundle-product-list {\n max-width: 100% !important;\n width: 100% !important;\n justify-content: center !important;\n }\n .price-text {\n text-align: center !important;\n }\n .bundle-builder-add-to-bundle-button {\n font-size: 12px !important;\n padding: 0px 8px !important;\n }\n .quantity .input-text.qty {\n width: 12px !important;\n height: 18px !important;\n }\n .quantity.buttons_added .minus,\n .quantity.buttons_added .plus {\n padding: 6px !important;\n height: 20px !important;\n }\n .bundle-builder-tracker-container {\n justify-content: center !important;\n }\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n .bundle-builder-title {\n font-size: 2rem !important;\n }\n .bundle-builder-tracker-item {\n width: 64px !important;\n height: 64px !important;\n }\n .bundle-builder-product-title {\n font-size: 14px !important;\n }\n}\n.hide-tracker-scrollbar {\n overflow-x: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n -webkit-overflow-scrolling: touch;\n}\n\n.hide-tracker-scrollbar::-webkit-scrollbar {\n display: none;\n}\n\n.yt-fixed-bundle-border {\n border: 1px solid #c7c7c7;\n}\n\n.yt-fixed-bundle-border-minor-curved {\n border-radius: 8px;\n}\n\n.yt-fixed-bundle-border-minor-curved-image {\n border-radius: 6px;\n}\n\n.yt-fixed-bundle-border-major-curved {\n border-radius: 20px;\n}\n\n.yt-fixed-bundle-border-major-curved-image {\n border-radius: 18px;\n}\n\n@media (min-width: 1200px) {\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-builder-tracker-container {\n gap: 5px !important;\n margin-block: 0 !important;\n }\n .bundle-summary {\n display: flex;\n flex-direction: column !important;\n align-items: flex-start;\n gap: 2px !important;\n }\n .bundle-summary button {\n padding-top: 2px !important;\n padding-inline: 13px !important;\n font-size: 14px !important;\n padding-inline: 10px !important;\n padding: 0px;\n width: -webkit-fill-available;\n }\n .bundle-builder-tracker-progress {\n display: block !important;\n }\n .summary-info {\n width: 100% !important;\n min-width: 200px !important;\n display: flex;\n justify-content: space-between !important;\n flex-direction: row !important;\n flex-grow: 1 !important;\n font-size: 14px !important;\n }\n}\n@media (max-width: 540px) {\n .products-display {\n justify-content: space-between !important;\n column-gap: 5px !important;\n }\n .bundle-builder-product-container {\n width: 49% !important;\n }\n .bundle-builder-title {\n font-size: 1.5rem !important;\n margin-bottom: 8px !important;\n }\n .bundle-builder-subtitle {\n padding-top: 4px;\n font-size: 1rem !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-summary.bundle-filled {\n display: flex !important;\n }\n}\n.yt-bundle-builder-product-price {\n font-weight: 600;\n color: black;\n margin-bottom: 2px;\n}\n\n/* Fixed bundle block */\n.yt-fixed-bundle-fixed-bundle {\n box-sizing: unset;\n max-width: 1000px;\n margin: 0 auto;\n container-type: inline-size;\n text-align: left;\n}\n\n.yt-fixed-bundle-bundle-header {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 10px 0px;\n gap: 8px;\n line-height: normal;\n}\n\n.yt-fixed-bundle-bundle-title {\n font-size: 24px;\n font-weight: 600;\n text-align: center;\n width: 100%;\n}\n\n.yt-fixed-bundle-bundle-subtitle {\n font-size: 16px;\n font-weight: 300;\n text-align: center;\n}\n\n.yt-fixed-bundle-bundle-content {\n display: flex;\n flex-direction: column;\n padding: 10px 0px;\n}\n\n.yt-fixed-bundle-product-list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.yt-product-main {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-card {\n display: flex;\n width: 90%;\n align-items: flex-start;\n padding: 0px;\n box-shadow: 2px 2px 11.8px 0px rgba(0, 0, 0, 0.1411764706);\n transition: transform 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n position: unset;\n}\n\n.yt-fixed-bundle-product-image {\n max-width: none;\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n}\n\n.yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n}\n\n.yt-fixed-bundle-product-title {\n font-size: 16px;\n font-weight: 700;\n display: block;\n line-height: 1.4;\n}\n\n.yt-fixed-bundle-product-price {\n font-size: 16px;\n display: block;\n margin-bottom: 6px;\n}\n\n.yt-fixed-bundle-original-price {\n text-decoration: line-through !important;\n color: #6b7280;\n margin-left: 4px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-checkbox {\n display: none !important;\n}\n\n.yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n}\n\n.yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n}\n\n.yt-fixed-bundle-variant-select {\n appearance: none;\n -webkit-appearance: none;\n width: 100%;\n padding: 4px 20px;\n background-color: #ffffff;\n font-size: 15px;\n background-image: none;\n color: #2d2d2d;\n cursor: pointer;\n transition: border-color 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-variant-select:focus {\n border-color: #cac6c6;\n box-shadow: 0 0 8px 0 rgba(56, 55, 57, 0.3);\n outline: none;\n}\n\n.yt-fixed-bundle-select-dot {\n position: absolute;\n top: 50%;\n left: 10px;\n transform: translateY(-50%);\n font-weight: 700;\n color: #4d4d4d;\n width: 8px; /* Adjust size */\n font-size: 8px;\n border-radius: 50%;\n pointer-events: none;\n}\n\n.yt-fixed-bundle-select-dot::after {\n content: "";\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background-color: #1b1b1b;\n}\n\n.yt-fixed-bundle-select-icon {\n position: absolute;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n pointer-events: none;\n color: #6b7280;\n background-color: rgba(30, 57, 103, 0.1);\n font-size: 20px;\n height: 100%;\n padding: 0px 5px;\n}\n\n.yt-fixed-bundle-plus-sign {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-plus-sign span {\n display: flex;\n justify-content: center;\n width: 24px;\n height: 22px;\n align-items: center;\n padding-bottom: 2px;\n background-color: #f2f2f2;\n color: black;\n border-radius: 2px;\n font-size: 20px;\n font-weight: bold;\n}\n\n.yt-fixed-bundle-price-section {\n display: flex;\n flex-direction: column;\n margin-top: 20px;\n width: 1000px;\n}\n\n.yt-fixed-bundle-subtotal {\n font-size: 13px;\n font-weight: 400 !important;\n}\n\n.yt-fixed-bundle-subtotal-amount {\n font-weight: 600;\n font-size: 13px;\n}\n\n.yt-fixed-bundle-deal-price-container {\n display: flex;\n justify-content: center;\n align-items: center;\n margin-bottom: 12px;\n gap: 8px;\n margin-top: 3px;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-deal-price {\n font-size: 16px;\n font-weight: 600;\n}\n\n.yt-fixed-bundle-extra-savings {\n font-size: 12px;\n color: #f6f8f7;\n padding: 4px 8px;\n background-color: #d3122a;\n border-radius: 2px;\n font-weight: 700 !important;\n}\n\n.yt-fixed-bundle-add-to-cart-button {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background-color: #8b5cf6;\n border: none;\n padding: 8px 0px;\n font-size: 16px;\n font-weight: 500 !important;\n cursor: pointer;\n width: 100%;\n}\n\n.yt-fixed-bundle-add-to-cart-button:disabled,\n.yt-fixed-bundle-add-to-cart-button[disabled] {\n color: #7d7d7d;\n cursor: default;\n}\n\n.yt-fixed-bundle-product-card.horizontal {\n max-width: 100%;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-product-card.horizontal:hover {\n transform: none;\n}\n\n.yt-fixed-bundle-product-list.horizontal {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n}\n\n.yt-product-main.horizontal {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-image-container.horizontal {\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n width: 30%;\n}\n\n.yt-fixed-bundle-product-image.horizontal {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n user-select: none;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop.horizontal {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile.horizontal {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop.horizontal {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-product-details.horizontal {\n padding-left: 0px;\n}\n\n.yt-fixed-bundle-product-price.horizontal {\n margin-bottom: 0px;\n}\n\n@media (min-width: 100px) {\n @container (width > 100px) {\n .yt-fixed-bundle-fixed-bundle {\n padding: 40px;\n }\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: flex;\n width: 100%;\n bottom: 6px;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n display: none;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n }\n .yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n }\n .yt-fixed-bundle-variant-select {\n margin: 0px 4px;\n }\n .yt-fixed-bundle-select-icon {\n right: 4px;\n }\n .yt-fixed-bundle-bundle-title {\n font-size: 32px;\n }\n .yt-fixed-bundle-bundle-subtitle {\n font-size: 20px;\n }\n .yt-fixed-bundle-bundle-content {\n flex-direction: column;\n justify-content: space-between;\n align-items: flex-start;\n }\n .yt-fixed-bundle-product-list {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n }\n .yt-fixed-bundle-product-card {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n text-align: center;\n }\n .yt-fixed-bundle-product-image-container {\n width: 100%;\n height: 100%;\n margin-right: 0;\n margin-bottom: 12px;\n justify-content: center;\n position: relative;\n }\n .yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n }\n .yt-fixed-bundle-product-image {\n height: 230px;\n width: 100%;\n aspect-ratio: 1;\n align-self: center;\n }\n .yt-fixed-bundle-plus-sign {\n align-self: center;\n margin-left: 0;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n margin-top: 32px;\n align-items: center;\n justify-content: center;\n text-align: center;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 10px;\n }\n .yt-fixed-bundle-subtotal {\n font-size: 15px;\n }\n .yt-fixed-bundle-subtotal-amount {\n font-size: 15px;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n top: 8px;\n left: 10px;\n height: auto;\n display: flex;\n align-items: center;\n }\n .yt-fixed-bundle-deal-price {\n font-size: 24px;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 13px;\n padding: 4px 8px;\n }\n .yt-fixed-bundle-add-to-cart-button {\n font-size: 20px;\n padding: 10px 0px;\n width: 100%;\n }\n .yt-product-main {\n width: 29%;\n }\n .yt-fixed-bundle-product-card:hover {\n transform: translateY(-5px);\n box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.1411764706);\n }\n }\n}\n.yt-product-main {\n display: flex;\n position: relative;\n}\n\n/* Container query */\n@container (max-width: 100px) {\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n }\n .yt-product-main {\n width: 100%;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n bottom: 6px;\n }\n .yt-fixed-bundle-product-image {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n .yt-fixed-bundle-variant-select-wrapper {\n position: relative;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n }\n .yt-fixed-bundle-product-card {\n max-width: 100%;\n flex-direction: row;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n }\n}\n.yt-product-card-transition {\n opacity: 0;\n transform: translateY(20px);\n transition: transform 0.6s ease, box-shadow 0.6s ease;\n}\n\n.yt-product-card-transition-up {\n opacity: 0;\n transform: translateY(-20px);\n transition: opacity 0.6s ease, transform 0.6s ease;\n}\n\n.yt-product-card-transition-active {\n opacity: 1;\n transform: translateY(0);\n}\n\n.yt-description-content img,\n.yt-collection-bundle-modal-description img,\n.yt-collection-bundle-modal-description iframe {\n max-width: 100%;\n height: auto;\n display: block;\n margin: 0 auto 15px;\n border-radius: 7px;\n}\n\n.yt-description-content,\n.yt-collection-bundle-modal-description {\n text-align: left;\n overflow-wrap: break-word;\n}\n\n.yt-byob-pagination-observer {\n display: block !important;\n}');const ac=c.div`
2471
+ `,tc=[...((nc={headerIds:["offers-carousel","timer","info-text"],scroll:{topIds:[],bottomIds:["steal-deal","recs"]},footerIds:["bundle","gst","freebie-claim","shipping","note","gift-wrap","coupon","loyalty","points-preview"]}).headerIds??[]).map(e=>({id:e,zone:"headerIds"})),...(nc.scroll?.topIds??[]).map(e=>({id:e,zone:"scroll.topIds"})),...(nc.scroll?.bottomIds??[]).map(e=>({id:e,zone:"scroll.bottomIds"})),...(nc.footerIds??[]).map(e=>({id:e,zone:"footerIds"}))];var nc;const oc=new Set(tc.map(e=>e.id)),rc=(e,t,n)=>{switch(t){case"headerIds":e.headerIds?.push(n);break;case"scroll.topIds":e.scroll?.topIds?.push(n);break;case"scroll.bottomIds":e.scroll?.bottomIds?.push(n);break;case"footerIds":e.footerIds?.push(n)}},ic=({isOpen:o,setIsOpen:i,backgroundColor:a="white",backgroundSubdued:l="#3947821F",tertiaryColor:c="#067D431A",tertiaryTextColor:s="#000000",exploreCTAColor:d,checkoutFontSize:p,cartTitle:u="My Cart",emptyCartTitle:m,emptyCartDescription:g,emptyCartButtons:x,removeCartItem:f,handleIncrement:y,handleDecrement:b,addCartItem:h,isUserSignedIn:v,showBundle:w,bundleProducts:C,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:T,rewardMultiplier:S,redemptionMultiplier:$,discountApplied:N,removeDiscount:B,applyDiscount:F,checkoutFunction:z,joinNowFunction:I,guestLoyaltyPercentage:D,isDev:A,recProductsList:_,showMultiStepProgressBar:R,cartCheckpoints:L,redemptionRate:O,pointsRewardRate:V,showCartLevelAltPay:j,exploreCtaRedirectLink:H,discountAmountApplied:q,minimumCartValue:Q,discountInCheckoutButton:U,isStickyCheckout:Y,handleCheckpointCrossed:G,customCartProgressBarCriteria:X,checkoutButtonColor:Z="#252E69",ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,productRecsCtaButtonText:oe,productRecsTitleText:ie,emptyProductRecsTitleText:ce,showProductRecsOnDesktop:se,showProductRecsOnMobile:de,themeColor:pe,themeTextColor:ue,companyName:me,gstNumber:ge,showGSTOption:xe,applyGSTToCart:fe,showMOVForProgressTiers:ye,freeProduct:be,showLoyaltyCta:he=!1,freeProductAdjustedCartTotal:ve,minimumOrderValueToAvailDiscount:we,signinCTAButtonVisible:Ce,cartSigninCTAMainText:Ee,applyNoteToCart:ke,note:Te,showNoteOption:Se,inlineCartOfferInfoText:$e,inlineCartOfferInfoRedirectLink:Ne,cartOfferTermsAndConditionsText:Be,showEditOptionOnProducts:Fe,onSetLoading:ze,showVariantSelectionDropdownInProductRecs:Ie,originalCartSubtotal:De,freebieProductsInCart:Pe,showFreebieClaim:Ae,addFreebieToCart:_e,freebiesInCart:Re,effectiveQuantityForProgressBar:Le,productPercentageOffMapping:Oe,removeFreebieFromCart:Me,postalCodeList:We,enableGeoLocationDeliveryRestriction:Ve=!1,getProductDetailsByVariantId:je,applyPostalCodeAndDeliverySlotToCart:He,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe,freebieFlowCheckpoints:Ue,freebieClaimData:Ye,postalCodeBasedItemTrackingParameter:Ge,enableSlotPicker:Xe,deliveryHeaderTitle:Ze,deliveryAvailableText:Ke,deliveryNotAvailableText:Je,giftWrapSetupData:et,giftWrapProductDetail:tt,progressBarFreeProductIconType:nt,enableCustomCartOnCartPage:ot,isCartPage:rt,showCartTimer:it,showFreebieMilestone:at,freebieMilestoneData:lt,cartTimerInMinutes:ct,cartTimerCustomText:st,productRecsCardLayout:dt,productRecsCardListVariant:pt,imageAspectSelector:ut,cartComponentsCornerType:mt,cartComponentsCornerRadius:gt,cartOffersCarousalData:xt,gstSectionCustomizationData:ft,noteSectionTitle:yt,checkoutSectionMessage:bt,checkoutSectionMessageDisplay:ht,showVariantSelectionDropdownInProductClaim:vt,loyaltyDiscount:wt,brandTokenName:Ct,showDiscountOnMRP:Et,switchWidthVariant:kt,prefixMessageText:Tt,suffixMessageText:St,successMessageText:$t,toggleDecimal:Nt,cartOffersCarouselHeight:Bt,disableCheckoutButton:Ft,showEmptyCartRecommendations:zt=!1,checkoutButtonBottomSpacing:It,applyCouponCode:Dt,showApplyCoupon:Pt,enableConfetti:At,checkoutSectionMessageRedirectLink:_t,showCheckoutButtonPaymentIcons:Rt,stealDealCheckpoints:Lt,stealDealProducts:Ot,stealDealAddToCart:Mt,showCouponOptions:Wt,rewardCoupons:Vt,couponSelectionData:jt,useCartShell:Ht,showTrustedBadge:qt,trustedBadgeData:Qt,drawerLayoutData:Ut})=>{const Yt=le(Xt),Gt=le(tn),[Kt,an]=t(!1),[ln,cn]=t(!1),[sn,dn]=t(!0),{setLoading:pn}=nn();e.useEffect(()=>{ze&&ze(pn)},[ze]);const un=r(!!Ht&&(window.ytCartShellState?.isOpen??!1)),mn=r(null),gn=r(null);n(()=>{const e=e=>{"open"!==e.state?.ytCustomCartDrawer&&i(!1)};return o?(un.current||(mn.current=window.history.state,gn.current=window.location.href,window.history.pushState({ytCustomCartDrawer:"open"},"")),window.addEventListener("popstate",e),un.current=!0):(un.current&&"open"===window.history.state?.ytCustomCartDrawer&&window.history.replaceState(mn.current,"",gn.current??window.location.href),un.current=!1),()=>{window.removeEventListener("popstate",e)}},[o,i]);const[xn,fn]=t(!1);n(()=>{const e=document.querySelector("body");e&&(ot&&rt?e.classList.remove("drawer-open"):!xn&&o?e.classList.add("drawer-open"):e.classList.remove("drawer-open"))},[o,ot,rt,xn]),n(()=>{function e(){const e=window.innerWidth;fn(e>=450)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const yn=Yt?.items?.reduce((e,t)=>e+t?.quantity,0);n(()=>{const e=()=>{an(!0),window.setTimeout(()=>an(!1),3e3)};return window.addEventListener("yt:autoFreebieAdded",e),()=>window.removeEventListener("yt:autoFreebieAdded",e)},[]);const[bn,hn]=t("normal"),[vn,wn]=t("normal"),[Cn,En]=t("auto");n(()=>{CSS.supports("font-weight","500")?hn("500"):CSS.supports("font-weight","400")?hn("400"):CSS.supports("font-weight","600")&&hn("600"),CSS.supports("font-weight","400")?wn("400"):CSS.supports("font-weight","300")?wn("300"):CSS.supports("font-weight","200")&&wn("200"),CSS.supports("width","-webkit-fill-available")?En("-webkit-fill-available"):CSS.supports("width","-moz-available")&&En("-moz-available")},[]),n(()=>{document.documentElement.style.setProperty("--yt-cart-font-weight",bn),document.documentElement.style.setProperty("--yt-cart-product-rec-price-font-weight",vn),document.documentElement.style.setProperty("--yt-cart-custom-fill-width",Cn)},[bn,vn]);const[kn]=ae(Zt),[Tn]=ae(en),[Sn]=ae(Jt);n(()=>{dn(!("all-products"!==Ge&&("specific-tags"!==Ge||kn.isPostalCodeValid||Xe)&&("specific-tags"!==Ge||kn.isPostalCodeValid||Tn||!Xe)&&("specific-tags"===Ge&&"standard"===Sn||ln&&(Xe?kn.isPostalCodeValid&&Tn:kn.isPostalCodeValid))))},[kn.isPostalCodeValid,Tn,ln,Ge,Xe]),ae(on);const[$n,Nn]=t(!0);n(()=>{"true"===localStorage.getItem("cartTimerRanOnce")&&Nn(!1);const e=localStorage.getItem("cartTimerTimeLeft");e&&parseInt(e,10)<=0&&Nn(!1)},[]);const Bn=()=>{Nn(!1),localStorage.setItem("cartTimerRanOnce","true"),localStorage.removeItem("timeLeft"),localStorage.removeItem("lastUpdate")},Fn=new Date("2024-11-01"),zn=Ht?document.getElementById("yt-cart-shell-content"):null,In=(e=>{const t={headerIds:[],scroll:{topIds:[],bottomIds:[]},footerIds:[]},n=new Set;return["headerIds","scroll.topIds","scroll.bottomIds","footerIds"].forEach(o=>{((e,t)=>{switch(t){case"headerIds":return e?.headerIds??[];case"scroll.topIds":return e?.scroll?.topIds??[];case"scroll.bottomIds":return e?.scroll?.bottomIds??[];case"footerIds":return e?.footerIds??[];default:return[]}})(e,o).forEach(e=>{!n.has(e)&&oc.has(e)&&(n.add(e),rc(t,o,e))})}),tc.forEach(({id:e,zone:o})=>{n.has(e)||(n.add(e),rc(t,o,e))}),t})(Ut),Dn=_&&_?.filter(Boolean).length>0,Pn=_&&_?.filter(Boolean),An=(t,n)=>{const r=`drawer-layout-${t}-${n}`;switch(t){case"offers-carousel":return xt?.enableCartOffersCarousel?e.createElement(ul,{key:r,themeColor:pe,cartOffersCarousalData:xt,cartOffersCarouselHeight:Bt,cartData:Yt}):null;case"timer":return it&&$n&&Yt?.item_count?e.createElement(Ha,{key:r,minutes:ct,customText:st,onTimerComplete:Bn}):null;case"info-text":return $e?e.createElement(Na,{key:r,inlineCartOfferInfoText:$e,inlineCartOfferInfoRedirectLink:Ne,themeColor:pe,tooltipText:Be,themeTextColor:ue}):null;case"steal-deal":return Lt&&Lt.length>0&&Ot&&Ot.length>0&&Yt?.item_count>0?e.createElement(Kl,{key:r,stealDealCheckpoints:Lt,stealDealProducts:Ot,freeProductAdjustedCartTotal:ve,effectiveQuantityForProgressBar:Le,addFreebieToCart:Mt??_e,freebiesInCart:Re??[],themeColor:pe,primaryTextColor:te,secondaryTextColor:ne}):null;case"recs":return(t=>{const n=xn&&se&&!!Pn&&Dn&&Yt?.item_count>0&&h,o=!xn&&de&&!!Pn&&Dn&&Yt?.item_count>0&&h;return n||o?e.createElement(e.Fragment,{key:t},n&&e.createElement(Zn,{addCartItem:h,products:Pn,productRecsCtaButtonText:oe,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,productRecsTitleText:ie,themeColor:pe,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Ie,cardLayout:dt,variant:pt,cartComponentsCornerType:mt,cartComponentsCornerRadius:gt,backgroundSubdued:l,backgroundColor:a,tertiaryColor:c,tertiaryTextColor:s}),o&&e.createElement(Zn,{addCartItem:h,products:Pn,productRecsCtaButtonText:oe,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,productRecsTitleText:ie,themeColor:pe,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Ie,cardLayout:dt,variant:pt,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,backgroundSubdued:l,tertiaryColor:c,tertiaryTextColor:s})):null})(r);case"bundle":return Yt?.item_count>0&&w&&C?e.createElement(Lr,{key:r,bundleProducts:C}):null;case"gst":return xe&&fe&&Yt?.item_count>0?e.createElement(di,{key:r,companyName:me,gstNumber:ge,themeColor:pe,iconColor:ft?.iconColor,showIcon:ft?.showIcon,backgroundColor:ft?.backgroundColor,textColor:ft?.textColor,title:ft?.title}):null;case"freebie-claim":return Yt&&Yt?.item_count>0&&_e&&Pe&&Re&&Pe.length>0?e.createElement($a,{key:r,freebieProductsInCart:Pe,themeColor:pe,themeTextColor:ue,primaryTextColor:te,addFreebieToCart:_e,freebiesInCart:Re,imageAspectSelector:ut,freebieCouponTemplates:Qe,freebieClaimData:Ye,cartCheckpoints:L,isCartDrawerOpen:o}):null;case"shipping":return Ve&&(We?.length??0)>0&&He&&Yt?.item_count>0?e.createElement("div",{key:r,className:"yt-cart-geolocation-section form-group"},e.createElement("div",{className:"yt-cart-shipping-header",style:{display:"flex",justifyContent:"space-between",alignItems:"center",margin:"6px 1rem 1rem 1rem"},onClick:()=>dn(!sn)},e.createElement("span",{className:"yt-cart-shipping-label",style:{fontSize:"12px",display:"flex",gap:"5px",alignItems:"center"}},"Shipping ",e.createElement(J,null)),e.createElement("div",{className:"yt-cart-shipping-toggle-icon icon-transition"},sn?e.createElement(M,null):e.createElement(W,null))),"all-products"===Ge&&sn?e.createElement(za,{postalCodeList:We,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,deliveryHeaderTitle:Ze,deliveryAvailableText:Ke,deliveryNotAvailableText:Je,disabledDates:Fn}):sn&&(ln?e.createElement(za,{postalCodeList:We,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,deliveryHeaderTitle:Ze,deliveryAvailableText:Ke,deliveryNotAvailableText:Je,disabledDates:Fn}):e.createElement(Ia,{postalCodeList:We,themeColor:pe,themeTextColor:ue,enableSlotPicker:Xe,disabledDates:Fn}))):null;case"note":return Se&&ke&&Yt?.item_count>0?e.createElement(pi,{key:r,note:Te,noteSectionTitle:yt}):null;case"gift-wrap":return et?.showGiftWrapOption&&Yt?.item_count>0?e.createElement(Wa,{key:r,themeColor:pe,id:et?.giftProductId,detail:tt,showPrice:et?.showPrice,errorText:et?.errorText,customText:et?.customText,showGiftIcon:et?.showGiftIcon,showProductImage:et?.showProductImage,addCartItem:h,removeCartItem:f}):null;case"coupon":return Yt?.item_count>0&&Wt&&Vt&&jt&&Dt&&!he?e.createElement(Zr,{key:r,rewardCoupons:Vt,couponSelectionData:jt,applyCouponCode:Dt,removeDiscount:B,enableConfetti:At,backgroundSubdued:l,themeColor:pe,themeTextColor:ue,primaryTextColor:te,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,cartComponentsCornerRadius:gt}):Yt?.item_count>0&&Pt&&!Wt&&!he&&Dt?e.createElement(Or,{key:r,backgroundSubdued:l,themeColor:pe,themeTextColor:ue,primaryTextColor:te,cartComponentsCornerRadius:gt,applyCouponCode:Dt,removeDiscount:B,enableConfetti:At}):null;case"loyalty":return(t=>he&&Yt?.item_count?e.createElement(e.Fragment,{key:t},v||wt?!wt&&void 0!==E&&void 0!==T&&!!k&&!!F&&e.createElement(er,{themeColor:pe,applyDiscount:F,discountAmountOff:E,loyaltyIcon:k,pointsToBeUsed:T,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,minimumOrderValueToAvailDiscount:we,brandTokenName:Ct,showCartLevelAltPay:j,redemptionMultiplier:$}):!!D&&!!I&&e.createElement(Qo,{cartSigninCTAMainText:Ee,signinCTAButtonVisible:Ce,themeColor:pe,joinNowFunction:I,guestLoyaltyPercentage:D,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,showCartLevelAltPay:j}),!!wt&&!!B&&wt&&void 0!==T&&e.createElement(Xo,{themeColor:pe,removeDiscount:B,loyaltyDiscount:wt,isDev:A,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,pointsToBeUsed:T,brandTokenName:Ct,showCartLevelAltPay:j}),!!we&&we>1&&e.createElement("span",{className:"yt-cart-loyalty-mov-text",style:{fontSize:"10px",color:pe??"#50D1AA",fontWeight:600,display:"flex",justifyContent:Ce?"space-between":"center"}},"Minimum order value to use ",Ct,":"," ",we)):null)(r);case"points-preview":return he&&j&&O&&k&&Yt?.item_count>0?e.createElement(bl,{key:r,loyaltyIcon:k,backgroundSubdued:l,primaryTextColor:te,pointsRewardRate:V,rewardMultiplier:S}):null;default:return null}},_n=e.createElement(e.Fragment,null,Gt.cartLoading?e.createElement("div",{className:"yt-cart-loader-overlay",style:{backgroundColor:"#fff",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",display:"flex",position:"absolute",opacity:0,zIndex:51}},Gt.showLoader&&!Gt.showSkeletonLoader&&e.createElement("div",{className:"loader"},"‎")):e.createElement(e.Fragment,null),e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-cart-drawer-content",style:{display:"flex",flexDirection:"column",height:"100%",justifyContent:"space-between"}},e.createElement("div",{className:"yt-cart-header"},e.createElement("div",{className:"yt-cart-header-row",style:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",margin:"1rem 1rem 0px"}},e.createElement("span",{className:"yt-cart-title-container",style:{fontWeight:"var(--yt-cart-font-weight, bold)",color:te,fontSize:"16px"}},e.createElement("span",{className:"yt-cart-title-text",style:{whiteSpace:"nowrap",flexShrink:0}},u),Yt?.item_count>0&&j&&!(he&&j)&&V>0&&e.createElement(vl,{pointsRewardRate:V,loyaltyIcon:k,brandTokenName:Ct,themeColor:pe,themeTextColor:ue,rewardMultiplier:S}),yn>0&&e.createElement(ec,{className:"yt-cart-item-count-badge",$backgroundSubdued:l},yn)),e.createElement("div",{className:"yt-cart-header-actions",style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center"}},!(ot&&rt)&&e.createElement("div",{className:"yt-cart-close-button close-button",style:{backgroundColor:l||"#cacaca30"}},e.createElement(re,{style:{height:"auto",width:"auto",color:te},fontSize:24,cursor:"pointer",onClick:()=>{i(!o)}})))),Gt&&e.createElement(fl,{$themeColor:pe,show:Gt.showLoader}),Kt&&At&&e.createElement(Eo,{particleCount:50,spread:90,origin:{y:.3}}),In.headerIds?.map((e,t)=>An(e,t))),R&&Yt?.items_subtotal_price>0&&Yt?.currency&&!!L&&function(e,t,n,o,r){if(!e||0===e.length)return!1;const i=[...e].sort((e,t)=>"minimum_order_value"===o?e?.minimumOrderValue-t?.minimumOrderValue:e?.quantityThreshold-t?.quantityThreshold);return i.filter(e=>0!==e?.[bo(o)]&&("minimum_order_value"!==o||1!==e?.[bo(o)])).some((e,a)=>ho(e,a,i,r,{currentCartAmount:t,effectiveQuantityForProgressBar:n,customCartProgressBarCriteria:o,checkpoints:i}).progressPercentage>0)}(L,rn(void 0!==De?De:Yt?.items_subtotal_price,Yt.currency),void 0===Le?Yt?.item_count:Le,X??"minimum_order_value",Yt?.item_count)&&e.createElement(e.Fragment,null,e.createElement(Do,{customCartProgressBarCriteria:X??"minimum_order_value",handleCheckpointCrossed:G,checkpoints:L,effectiveQuantityForProgressBar:void 0===Le?Yt?.item_count:Le,currentCartAmount:rn(void 0!==De?De:Yt?.items_subtotal_price,Yt.currency),themeColor:pe,themeTextColor:ue,primaryTextColor:te,secondaryTextColor:ne,showMOVForProgressTiers:ye,progressBarFreeProductIconType:nt,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,prefixMessageText:Tt,suffixMessageText:St,successMessageText:$t,enableConfetti:At})),Yt?.item_count>0&&e.createElement("div",{className:"yt-cart-divider",style:{display:"flex",height:"12px",background:"#87878717"}}),0===Yt?.items?.length&&0===Yt?.item_count&&!1===Gt?.showSkeletonLoader?e.createElement(_o,{showLoyaltyCta:he,joinNowFunction:I,emptyCartTitle:m,emptyCartDescription:g,exploreCTAColor:d,isUserSignedIn:v,exploreCtaRedirectLink:H,themeColor:pe,emptyCartButtons:x,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,themeTextColor:ue,isRecProductsListValid:Dn,recProductsList:Pn,addCartItem:h,productRecsCtaButtonText:oe,ctaButtonBackgroundColor:K,ctaButtonTextColor:ee,primaryTextColor:te,secondaryTextColor:ne,showVariantSelectionDropdownInProductRecs:Ie,emptyProductRecsTitleText:ce,backgroundSubdued:l,showEmptyCartRecommendations:zt,tertiaryColor:c,tertiaryTextColor:s}):e.createElement("div",{className:"yt-cart-scroll-area",style:{display:"flex",flexDirection:"column",overflowY:"auto",flex:1,overflowX:"hidden",height:"100%",scrollbarWidth:"none"}},In.scroll?.topIds?.map((e,t)=>An(e,t)),e.createElement(Rr,{isDev:A,themeColor:pe,handleDecrement:b,handleIncrement:y,removeCartItem:f,addCartItem:h,primaryTextColor:te,secondaryTextColor:ne,freeProduct:be,themeTextColor:ue,showEditOptionOnProducts:Fe,productPercentageOffMapping:Oe,removeFreebieFromCart:Me,showDeleteOnFreebies:qe,freebieCouponTemplates:Qe??[],freebieFlowCheckpoints:Ue??[],cartCheckpoints:L,freeProductAdjustedCartTotal:ve,imageAspectSelector:ut,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,giftWrapVariantId:tt?.variants?.nodes[0]?.id,giftWrapProductId:et?.giftProductId,showGiftWrapAsLineItem:et?.showGiftWrapAsLineItem,backgroundSubdued:l,tertiaryColor:c,tertiaryTextColor:s,backgroundColor:a,showDiscountOnMRP:Et,checkoutSectionMessage:bt,checkoutSectionMessageRedirectLink:_t,showFreebieMilestone:at,freebieMilestoneData:lt,freeLabelText:Ye?.freeLabelText}),In.scroll?.bottomIds?.map((e,t)=>An(e,t)),"devlhok.myshopify.com"===window.ytapp?.storeDomain&&e.createElement(wl,{showDiscountOnMRP:Et,cartCheckpoints:L,toggleDecimal:Nt,primaryTextColor:te,discountApplied:N,showTrustedBadge:qt,discountAmountApplied:q})),e.createElement(Yo,null,In.footerIds?.map((e,t)=>An(e,t)),Yt&&z&&Yt?.item_count>0&&e.createElement("div",{className:"yt-cart-checkout-wrapper"},e.createElement(Wo,{disableCheckoutButton:!!Ft||Gt.cartLoading,discountApplied:N,checkoutFunction:z,checkoutButtonColor:Z,checkoutFontSize:p,discountInCheckoutButton:U,isStickyCheckout:Y,discountAmountApplied:q,minimumCartValue:Q,themeTextColor:ue,applyGSTToCart:fe,showGSTOption:xe,applyNoteToCart:ke,showNoteOption:Se,enableGeoLocationDeliveryRestriction:Ve,applyPostalCodeAndDeliverySlotToCart:He,enableSlotPicker:Xe,cartComponentsCornerRadius:gt,cartComponentsCornerType:mt,checkoutSectionMessage:bt,checkoutSectionMessageDisplay:ht,checkoutSectionMessageRedirectLink:_t,showDiscountOnMRP:Et,tertiaryColor:c,tertiaryTextColor:s,cartCheckpoints:L,toggleDecimal:Nt,checkoutButtonBottomSpacing:It,showCheckoutButtonPaymentIcons:Rt,primaryTextColor:te,hideSubtotalAndBadge:"devlhok.myshopify.com"===window.ytapp?.storeDomain,showTrustedBadge:qt,trustedBadgeData:Qt,isLargeScreen:xn}))))));return Ht&&zn?P(_n,zn):e.createElement(Jl,{className:"yt-cart-drawer",$isDev:A,$isOpen:o,$backgroundColor:a,$enableCustomCartOnCartPage:ot,$isCartPage:rt,$isLargeScreen:xn,$switchWidthVariant:kt},_n)};yt('@media (max-width: 108px) {\n .yt-fixed-bundle-price-section {\n width: 100% !important;\n }\n .yt-fixed-bundle-product-list {\n max-width: 100% !important;\n width: 100% !important;\n justify-content: center !important;\n }\n .price-text {\n text-align: center !important;\n }\n .bundle-builder-add-to-bundle-button {\n font-size: 12px !important;\n padding: 0px 8px !important;\n }\n .quantity .input-text.qty {\n width: 12px !important;\n height: 18px !important;\n }\n .quantity.buttons_added .minus,\n .quantity.buttons_added .plus {\n padding: 6px !important;\n height: 20px !important;\n }\n .bundle-builder-tracker-container {\n justify-content: center !important;\n }\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n .bundle-builder-title {\n font-size: 2rem !important;\n }\n .bundle-builder-tracker-item {\n width: 64px !important;\n height: 64px !important;\n }\n .bundle-builder-product-title {\n font-size: 14px !important;\n }\n}\n.hide-tracker-scrollbar {\n overflow-x: auto;\n scrollbar-width: none;\n -ms-overflow-style: none;\n -webkit-overflow-scrolling: touch;\n}\n\n.hide-tracker-scrollbar::-webkit-scrollbar {\n display: none;\n}\n\n.yt-fixed-bundle-border {\n border: 1px solid #c7c7c7;\n}\n\n.yt-fixed-bundle-border-minor-curved {\n border-radius: 8px;\n}\n\n.yt-fixed-bundle-border-minor-curved-image {\n border-radius: 6px;\n}\n\n.yt-fixed-bundle-border-major-curved {\n border-radius: 20px;\n}\n\n.yt-fixed-bundle-border-major-curved-image {\n border-radius: 18px;\n}\n\n@media (min-width: 1200px) {\n .bundle-builder-title .bundle-builder-subtitle {\n font-size: 30px !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-builder-tracker-container {\n gap: 5px !important;\n margin-block: 0 !important;\n }\n .bundle-summary {\n display: flex;\n flex-direction: column !important;\n align-items: flex-start;\n gap: 2px !important;\n }\n .bundle-summary button {\n padding-top: 2px !important;\n padding-inline: 13px !important;\n font-size: 14px !important;\n padding-inline: 10px !important;\n padding: 0px;\n width: -webkit-fill-available;\n }\n .bundle-builder-tracker-progress {\n display: block !important;\n }\n .summary-info {\n width: 100% !important;\n min-width: 200px !important;\n display: flex;\n justify-content: space-between !important;\n flex-direction: row !important;\n flex-grow: 1 !important;\n font-size: 14px !important;\n }\n}\n@media (max-width: 540px) {\n .products-display {\n justify-content: space-between !important;\n column-gap: 5px !important;\n }\n .bundle-builder-product-container {\n width: 49% !important;\n }\n .bundle-builder-title {\n font-size: 1.5rem !important;\n margin-bottom: 8px !important;\n }\n .bundle-builder-subtitle {\n padding-top: 4px;\n font-size: 1rem !important;\n }\n}\n@media (max-width: 540px) {\n .bundle-summary.bundle-filled {\n display: flex !important;\n }\n}\n.yt-bundle-builder-product-price {\n font-weight: 600;\n color: black;\n margin-bottom: 2px;\n}\n\n/* Fixed bundle block */\n.yt-fixed-bundle-fixed-bundle {\n box-sizing: unset;\n max-width: 1000px;\n margin: 0 auto;\n container-type: inline-size;\n text-align: left;\n}\n\n.yt-fixed-bundle-bundle-header {\n display: flex;\n flex-direction: column;\n align-items: center;\n padding: 10px 0px;\n gap: 8px;\n line-height: normal;\n}\n\n.yt-fixed-bundle-bundle-title {\n font-size: 24px;\n font-weight: 600;\n text-align: center;\n width: 100%;\n}\n\n.yt-fixed-bundle-bundle-subtitle {\n font-size: 16px;\n font-weight: 300;\n text-align: center;\n}\n\n.yt-fixed-bundle-bundle-content {\n display: flex;\n flex-direction: column;\n padding: 10px 0px;\n}\n\n.yt-fixed-bundle-product-list {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.yt-product-main {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-card {\n display: flex;\n width: 90%;\n align-items: flex-start;\n padding: 0px;\n box-shadow: 2px 2px 11.8px 0px rgba(0, 0, 0, 0.1411764706);\n transition: transform 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n position: unset;\n}\n\n.yt-fixed-bundle-product-image {\n max-width: none;\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n}\n\n.yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n}\n\n.yt-fixed-bundle-product-title {\n font-size: 16px;\n font-weight: 700;\n display: block;\n line-height: 1.4;\n}\n\n.yt-fixed-bundle-product-price {\n font-size: 16px;\n display: block;\n margin-bottom: 6px;\n}\n\n.yt-fixed-bundle-original-price {\n text-decoration: line-through !important;\n color: #6b7280;\n margin-left: 4px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-checkbox {\n display: none !important;\n}\n\n.yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n}\n\n.yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n}\n\n.yt-fixed-bundle-variant-select {\n appearance: none;\n -webkit-appearance: none;\n width: 100%;\n padding: 4px 20px;\n background-color: #ffffff;\n font-size: 15px;\n background-image: none;\n color: #2d2d2d;\n cursor: pointer;\n transition: border-color 0.3s ease, box-shadow 0.3s ease;\n}\n\n.yt-fixed-bundle-variant-select:focus {\n border-color: #cac6c6;\n box-shadow: 0 0 8px 0 rgba(56, 55, 57, 0.3);\n outline: none;\n}\n\n.yt-fixed-bundle-select-dot {\n position: absolute;\n top: 50%;\n left: 10px;\n transform: translateY(-50%);\n font-weight: 700;\n color: #4d4d4d;\n width: 8px; /* Adjust size */\n font-size: 8px;\n border-radius: 50%;\n pointer-events: none;\n}\n\n.yt-fixed-bundle-select-dot::after {\n content: "";\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background-color: #1b1b1b;\n}\n\n.yt-fixed-bundle-select-icon {\n position: absolute;\n top: 50%;\n right: 0;\n transform: translateY(-50%);\n pointer-events: none;\n color: #6b7280;\n background-color: rgba(30, 57, 103, 0.1);\n font-size: 20px;\n height: 100%;\n padding: 0px 5px;\n}\n\n.yt-fixed-bundle-plus-sign {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-plus-sign span {\n display: flex;\n justify-content: center;\n width: 24px;\n height: 22px;\n align-items: center;\n padding-bottom: 2px;\n background-color: #f2f2f2;\n color: black;\n border-radius: 2px;\n font-size: 20px;\n font-weight: bold;\n}\n\n.yt-fixed-bundle-price-section {\n display: flex;\n flex-direction: column;\n margin-top: 20px;\n width: 1000px;\n}\n\n.yt-fixed-bundle-subtotal {\n font-size: 13px;\n font-weight: 400 !important;\n}\n\n.yt-fixed-bundle-subtotal-amount {\n font-weight: 600;\n font-size: 13px;\n}\n\n.yt-fixed-bundle-deal-price-container {\n display: flex;\n justify-content: center;\n align-items: center;\n margin-bottom: 12px;\n gap: 8px;\n margin-top: 3px;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-deal-price {\n font-size: 16px;\n font-weight: 600;\n}\n\n.yt-fixed-bundle-extra-savings {\n font-size: 12px;\n color: #f6f8f7;\n padding: 4px 8px;\n background-color: #d3122a;\n border-radius: 2px;\n font-weight: 700 !important;\n}\n\n.yt-fixed-bundle-add-to-cart-button {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background-color: #8b5cf6;\n border: none;\n padding: 8px 0px;\n font-size: 16px;\n font-weight: 500 !important;\n cursor: pointer;\n width: 100%;\n}\n\n.yt-fixed-bundle-add-to-cart-button:disabled,\n.yt-fixed-bundle-add-to-cart-button[disabled] {\n color: #7d7d7d;\n cursor: default;\n}\n\n.yt-fixed-bundle-product-card.horizontal {\n max-width: 100%;\n flex-direction: row;\n}\n\n.yt-fixed-bundle-product-card.horizontal:hover {\n transform: none;\n}\n\n.yt-fixed-bundle-product-list.horizontal {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n}\n\n.yt-product-main.horizontal {\n width: 100%;\n}\n\n.yt-fixed-bundle-product-image-container.horizontal {\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n width: 30%;\n}\n\n.yt-fixed-bundle-product-image.horizontal {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n user-select: none;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-desktop.horizontal {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n}\n\n.yt-fixed-bundle-variant-select-wrapper-mobile.horizontal {\n width: 98%;\n position: relative;\n display: flex;\n}\n\n.yt-fixed-bundle-checkbox-container-desktop.horizontal {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.yt-fixed-bundle-product-details.horizontal {\n padding-left: 0px;\n}\n\n.yt-fixed-bundle-product-price.horizontal {\n margin-bottom: 0px;\n}\n\n@media (min-width: 100px) {\n @container (width > 100px) {\n .yt-fixed-bundle-fixed-bundle {\n padding: 40px;\n }\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: flex;\n width: 100%;\n bottom: 6px;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n display: none;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-label {\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid #000;\n background: white;\n cursor: pointer;\n color: white !important;\n }\n .yt-fixed-bundle-checkbox:checked + .yt-fixed-bundle-checkbox-label {\n border-color: #000;\n color: white !important;\n border: 0px;\n font-size: 16px;\n }\n .yt-fixed-bundle-variant-select {\n margin: 0px 4px;\n }\n .yt-fixed-bundle-select-icon {\n right: 4px;\n }\n .yt-fixed-bundle-bundle-title {\n font-size: 32px;\n }\n .yt-fixed-bundle-bundle-subtitle {\n font-size: 20px;\n }\n .yt-fixed-bundle-bundle-content {\n flex-direction: column;\n justify-content: space-between;\n align-items: flex-start;\n }\n .yt-fixed-bundle-product-list {\n width: 100%;\n flex-direction: row;\n justify-content: center;\n align-items: stretch;\n flex-wrap: wrap;\n gap: 15px;\n }\n .yt-fixed-bundle-product-card {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: center;\n text-align: center;\n }\n .yt-fixed-bundle-product-image-container {\n width: 100%;\n height: 100%;\n margin-right: 0;\n margin-bottom: 12px;\n justify-content: center;\n position: relative;\n }\n .yt-fixed-bundle-product-details {\n width: 100%;\n align-self: center;\n display: flex;\n flex-direction: column;\n gap: 6px;\n text-align: left;\n }\n .yt-fixed-bundle-product-image {\n height: 230px;\n width: 100%;\n aspect-ratio: 1;\n align-self: center;\n }\n .yt-fixed-bundle-plus-sign {\n align-self: center;\n margin-left: 0;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n margin-top: 32px;\n align-items: center;\n justify-content: center;\n text-align: center;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 10px;\n }\n .yt-fixed-bundle-subtotal {\n font-size: 15px;\n }\n .yt-fixed-bundle-subtotal-amount {\n font-size: 15px;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n top: 8px;\n left: 10px;\n height: auto;\n display: flex;\n align-items: center;\n }\n .yt-fixed-bundle-deal-price {\n font-size: 24px;\n }\n .yt-fixed-bundle-extra-savings {\n font-size: 13px;\n padding: 4px 8px;\n }\n .yt-fixed-bundle-add-to-cart-button {\n font-size: 20px;\n padding: 10px 0px;\n width: 100%;\n }\n .yt-product-main {\n width: 29%;\n }\n .yt-fixed-bundle-product-card:hover {\n transform: translateY(-5px);\n box-shadow: 0px 10px 20px 0px rgba(0, 0, 0, 0.1411764706);\n }\n }\n}\n.yt-product-main {\n display: flex;\n position: relative;\n}\n\n/* Container query */\n@container (max-width: 100px) {\n .yt-fixed-bundle-variant-select-wrapper-desktop {\n position: absolute;\n display: none;\n width: 100%;\n bottom: 6px;\n }\n .yt-product-main {\n width: 100%;\n }\n .yt-fixed-bundle-variant-select-wrapper-mobile {\n width: 98%;\n position: relative;\n display: flex;\n bottom: 6px;\n }\n .yt-fixed-bundle-product-image {\n height: 110px;\n aspect-ratio: 1;\n object-fit: cover;\n }\n .yt-fixed-bundle-variant-select-wrapper {\n position: relative;\n width: 100%;\n }\n .yt-fixed-bundle-checkbox-container-desktop {\n position: absolute;\n height: 100%;\n left: -8px;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .yt-fixed-bundle-product-image-container {\n margin-right: 8px;\n height: 110px;\n margin-bottom: 0px;\n position: unset;\n }\n .yt-fixed-bundle-product-card {\n max-width: 100%;\n flex-direction: row;\n }\n .yt-fixed-bundle-price-section {\n width: 100%;\n }\n}\n.yt-product-card-transition {\n opacity: 0;\n transform: translateY(20px);\n transition: transform 0.6s ease, box-shadow 0.6s ease;\n}\n\n.yt-product-card-transition-up {\n opacity: 0;\n transform: translateY(-20px);\n transition: opacity 0.6s ease, transform 0.6s ease;\n}\n\n.yt-product-card-transition-active {\n opacity: 1;\n transform: translateY(0);\n}\n\n.yt-description-content img,\n.yt-collection-bundle-modal-description img,\n.yt-collection-bundle-modal-description iframe {\n max-width: 100%;\n height: auto;\n display: block;\n margin: 0 auto 15px;\n border-radius: 7px;\n}\n\n.yt-description-content,\n.yt-collection-bundle-modal-description {\n text-align: left;\n overflow-wrap: break-word;\n}\n\n.yt-byob-pagination-observer {\n display: block !important;\n}');const ac=c.div`
2472
2472
  display: flex;
2473
2473
  flex-direction: row;
2474
2474
  height: 100%;
@@ -3151,7 +3151,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
3151
3151
  font-size: 1em;
3152
3152
  justify-content: center;
3153
3153
  align-items: center;
3154
- `;const rs=({options:t,selectedValue:n,onChange:o,type:r="text",isOptionAvailable:i,isMobile:a})=>e.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},t?.map(t=>{const a=!i||i(t.name);return e.createElement("div",{key:t.name,onClick:()=>{a&&o(t)},style:{cursor:a?"pointer":"not-allowed"}},((t,n)=>{const o=!i||i(t.name),a={cursor:o?"pointer":"not-allowed",border:n?"2px solid #333":"1px solid #d1d5db",transition:"all 0.2s ease",opacity:o?1:.5};if("color"===r)return t.value&&(()=>{if(!t.value.trim())return!1;if(t.value===t.name||t.value.length<3)return!1;try{const e=document.createElement("div");return e.style.color=t.value,""!==e.style.color}catch{return!1}})()?e.createElement("div",{style:{...a,width:24,height:24,borderRadius:"50%",backgroundColor:t.value,display:"block"}}):e.createElement("div",{style:{...a,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},t.name);return"image"===r?e.createElement("img",{src:yn(t.value,48,85,"webp")||"/placeholder.svg",alt:t.name,style:{...a,width:24,height:24,borderRadius:"50%",objectFit:"cover"}}):e.createElement("div",{style:{...a,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},t.name)})(t,n?.name===t.name))})),is=({product:r,isOpen:i,onClose:a,variantOptions:l,cta:c,onConfirm:s})=>{const d=o(()=>e=>e?r?.tracksInventory&&e?.inventoryItem?.tracked?e.inventoryQuantity>0?e?.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0,[r?.tracksInventory]),p=o(()=>{const e=r.variants.edges.find(e=>{const t=e.node;return d(t)>0})?.node;return e?.title&&"Default Title"!==e.title?e.title.split(" / "):r.options?.map(e=>e.values[0])||[]},[r,d]),[u,m]=t(p),[g,x]=t(window.innerWidth<1024);n(()=>{const e=()=>x(window.innerWidth<1024);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),n(()=>{const e=e=>{"Escape"===e.key&&a()};return i&&document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[i,a]);const f=r.variants.edges.find(e=>e.node.title===(r.options?.length>0?u.join(" / "):u[0]))?.node,y=f?.image?.url||r.featuredMedia?.preview?.image?.url,b=yn(y,150,85,"webp"),h=e=>{if(!l?.options)return"text";const t=l.options.find(t=>t.name===e);return t?.type||"text"},v=e=>{if(!l?.options)return e.values.map(e=>({name:e,value:e}));const t=l.options.find(t=>t.name===e.name);return e.values.map(e=>{const n=t?.values?.find(t=>t.name===e);return{name:e,value:n?.value||e}})},w=(e,t)=>{const n=u[t];if(!n)return null;return v(e).find(e=>e.name===n)||null};if(!i)return null;const C=e.createElement("div",{onClick:a,style:{position:"fixed",top:0,left:0,right:0,bottom:0,width:"100vw",height:"100vh",background:"rgba(0, 0, 0, 0.4)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center"},role:"dialog","aria-modal":"true","aria-labelledby":"yt-variant-options-modal-title"},e.createElement("div",{onClick:e=>e.stopPropagation(),style:{background:"white",borderRadius:16,width:"fit-content",minWidth:350,maxWidth:450,maxHeight:"90vh",overflowY:"auto",position:"relative",zIndex:999,...window.innerWidth<=600&&{width:"90vw",maxWidth:"90vw",minWidth:"90vw"}}},e.createElement("div",{id:"yt-variant-options-modal-title",style:{width:"100%",padding:"16px 0",fontWeight:600,fontSize:14,textTransform:"uppercase",backgroundColor:"rgba(217, 217, 217)",color:"black",textAlign:"center",borderTopLeftRadius:16,borderTopRightRadius:16}},"Select Options"),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 20px",borderBottom:"1px solid #f0f0f0"}},e.createElement("img",{src:b,alt:r.title,style:{width:60,height:60,borderRadius:8,objectFit:"cover",flexShrink:0,transition:"opacity 0.3s ease"}}),e.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,gap:4}},e.createElement("div",{style:{fontSize:14,fontWeight:600,color:"#333"}},r.title))),e.createElement("div",{style:{padding:"20px"}},r.options.map((t,n)=>e.createElement("div",{key:t.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:t?.values?.length>1?16:0}},t?.values?.length>1&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},e.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",t.name),e.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},w(t,n)?.name||t.values[0])),e.createElement(rs,{options:v(t),selectedValue:w(t,n),onChange:e=>{((e,t)=>{const n=[...u];n[e]=t.name,m(n)})(n,e)},type:h(t.name),isOptionAvailable:e=>((e,t)=>{const n=[...u];n[e]=t;const o=r.options?.length>0?n.join(" / "):n[0],i=r.variants.edges.find(e=>e.node.title===o)?.node;return!!i&&d(i)>0})(n,e),isMobile:g}))))),e.createElement("button",{onClick:()=>{const e=r.variants.edges.find(e=>e.node.title===(r.options?.length>0?u.join(" / "):u[0]))?.node,t=!!e&&d(e)>0;if(e?.id&&t)s(e.id),a();else{console.warn("yt::variant options modal - selected variant not available or out of stock:",u);const e=r.variants.edges.find(e=>d(e.node)>0)?.node.id;e&&(s(e),a())}},style:{width:"100%",fontSize:14,fontWeight:600,textTransform:"uppercase",backgroundColor:c.backgroundColor,color:c.textColor,textAlign:"center",padding:"16px 0",border:"none",cursor:"pointer",borderBottomLeftRadius:16,borderBottomRightRadius:16},onMouseEnter:e=>{e.currentTarget.style.opacity="0.9"},onMouseLeave:e=>{e.currentTarget.style.opacity="1"}},"Add to Bundle")));return D.createPortal(C,document.body)},as=l((a,l)=>{const[c,s]=ae(Jc),d=o(()=>e=>{const t=a?.customVariantsQuantity?.find(t=>t.variantId===e?.id)?.quantity;return void 0!==t?t:a?.bundleProductsCustomQuantity?a?.bundleProductsCustomQuantity:e?c?.tracksInventory&&e.inventoryItem?.tracked?e.inventoryQuantity>0?e.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?.toLocaleLowerCase()?1/0:0:1/0:0},[c?.tracksInventory,a?.customVariantsQuantity,a?.bundleProductsCustomQuantity]),p=c?.variants.edges?.filter(e=>d(e.node)>0)||[],[u,m]=t(p?.[0]?.node),[g,x]=t(0),[f,y]=t("undefined"!=typeof window&&window.innerWidth<=600),[b,h]=t(1),[v,w]=t("idle"),C=r(null),E=r(null),k=r(!1),[T,S]=t(0),[$,N]=t(),B=o(()=>{const e=c?.variants.edges.find(e=>{const t=e.node;return d(t)>0})?.node;return e?.title&&"Default Title"!==e.title?e.title.split(" / "):c?.options?.map(e=>e.values[0])||[]},[c,d]),[F,z]=t(B);n(()=>{if(c){const e=c.variants.edges?.filter(e=>d(e.node)>0),t=c?.selectedVariant??e[0]?.node;m(t),t?.title&&"Default Title"!==t.title&&z(t.title.split(" / "))}},[c,d]),n(()=>{const e=a.selectedProducts.find(e=>e.variantId===u?.id);h(e?e.quantity:0)},[b,a.selectedProducts,u]),n(()=>{if(E.current&&-1!==g&&k.current){const e=E.current.children;e[g]&&e[g].scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),k.current=!1}},[g]);if(n(()=>{const e=()=>y(window.innerWidth<=600);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),!c)return null;const{title:I,descriptionHtml:P,media:A,variants:_}=c,R=A.edges.map(e=>e?.node.preview.image??e?.node.image).filter(e=>e?.url?.length>0),L=i(e=>{const t=e.target.value,n=p?.find(e=>e.node.id===t)?.node;n&&d(n)>0&&(k.current=!0,m(n),N(n?.image?.url),n.title&&"Default Title"!==n.title&&z(n.title.split(" / ")))},[p,d]),O=i(e=>{if(!a.bundleVariantOptions?.options)return"text";const t=a.bundleVariantOptions?.options.find(t=>t.name===e);return t?.type||"text"},[a.bundleVariantOptions]),M=i(e=>{if(!a?.bundleVariantOptions?.options)return e.values.map(e=>({name:e,value:e}));const t=a?.bundleVariantOptions?.options.find(t=>t.name===e.name);return e.values.map(e=>{const n=t?.values?.find(t=>t.name===e);return{name:e,value:n?.value||e}})},[a.bundleVariantOptions]),W=i((e,t)=>{const n=[...F];n[e]=t.name,z(n);const o=c?.options?.length>0?n.join(" / "):n[0],r=c?.variants.edges.find(e=>e.node.title===o)?.node;N(r?.image?.url),r&&d(r)>0&&(k.current=!0,m(r))},[F,c,d]),V=i((e,t)=>{const n=F[t];if(!n)return null;return M(e).find(e=>e.name===n)||null},[F,M]),j=i((e,t)=>{const n=[...F];n[e]=t;const o=c?.options?.length>0?n.join(" / "):n[0],r=c?.variants.edges.find(e=>e.node.title===o)?.node;return!!r&&d(r)>0},[F,c,d]);n(()=>{if(c){document.body.style.overflow="hidden",window.history.pushState({modalOpen:!0},"",window.location.href);const e=e=>{s(void 0),e.preventDefault()};return window.addEventListener("popstate",e),()=>{document.body.style.overflow="unset",window.removeEventListener("popstate",e),window.history.state?.modalOpen&&window.history.back()}}},[c,s]),n(()=>{if(f&&c&&C.current){const e=()=>{C.current&&S(C.current.offsetHeight)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}},[f,c]);const H=a.selectedProducts.filter(e=>e.variantId===u?.id).reduce((e,t)=>e+t.quantity,0),q=a.customVariantsQuantity?.find(e=>e.variantId===u?.id)?.quantity??a.bundleProductsCustomQuantity??1/0,Q=q!==1/0&&H>=q,U=a.hideAddToBundle||!u||d(u)<=0||Q||"idle"!==v||a?.disableQuantitySelector&&1===b,G=({className:t})=>{const n=c?.rating?.averageRating??a?.rating?.averageRating??0,o=c?.rating?.ratingCount??a?.rating?.ratingCount??0;return n<=0?null:e.createElement(e.Fragment,null,"ratingOnly"===a.reviewRatingType&&e.createElement("div",{className:t,style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Be,{color:"gold",size:14}),e.createElement("span",{style:{marginLeft:6}},n," rating")),"ratingAndReviewCount"===a.reviewRatingType&&e.createElement("div",{className:t,style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Be,{color:"gold",size:14}),n,e.createElement(Ce,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}}),"(",o," reviews)"))},X=({isMobile:t})=>e.createElement(e.Fragment,null,e.createElement("div",{style:{position:t?"relative":void 0}},t?e.createElement("div",{ref:E,style:{display:"flex",flexDirection:"row",overflowX:"auto",WebkitOverflowScrolling:"touch",scrollSnapType:"x mandatory",scrollbarWidth:"none",msOverflowStyle:"none"}},R.length>0&&R.map((t,n)=>e.createElement("div",{key:n,style:{width:"100%",flex:"0 0 auto",scrollSnapAlign:"center",objectFit:"contain",maxHeight:"50vh",zIndex:999}},e.createElement(xt,{small:au(t?.url),medium:au(t?.url),large:au(t?.url),alt:t.altText||`${I} - Image ${n+1}`,hideDownload:!0,imageBackgroundColor:"#000",className:"yt-byob-modal-desktop-main-image"})))):e.createElement(e.Fragment,null,e.createElement(xt,{small:au($??"")||au(R[g]?.url),medium:au($??"")||au(R[g]?.url),large:au($??"")||au(R[g]?.url),hideDownload:!0,imageBackgroundColor:"#000",className:"yt-byob-modal-desktop-main-image main-image"}),e.createElement("div",{style:{display:"flex",flexDirection:"row",overflowX:"auto",gap:t?"8px":"12px",padding:"12px 0",WebkitOverflowScrolling:"touch",scrollSnapType:"x mandatory",scrollbarWidth:"none",msOverflowStyle:"none"}},R.length>1&&R.filter(e=>e?.url?.length>0).map((n,o)=>e.createElement("img",{key:o,src:au(n?.url),alt:n.altText||`${I} - Image ${o+1}`,onClick:()=>x(o),style:{width:t?"60px":"73px",height:t?"60px":"73px",flex:"0 0 auto",scrollSnapAlign:"center",borderRadius:"7px",border:g===o?`2px solid ${a.themeColor||"#111"}`:"1px solid lightgray",objectFit:"cover",cursor:"pointer"},loading:"lazy"})))))),Z=({className:t})=>c?.variants?.edges?.length<=1?null:e.createElement("div",{className:t},e.createElement("div",{className:`${t}-label`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",marginBottom:"10px"}},e.createElement("span",{style:{flexShrink:0}},c.options[0].name," :"," ",e.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},u?.title)),e.createElement("select",{className:`${t}-select`,value:u?.id||"",onChange:L,style:{appearance:"none",border:"none",background:"transparent",fontWeight:"bold",color:"#000",cursor:"pointer",paddingRight:"20px",position:"absolute",right:0,top:0,bottom:0,width:"100%",opacity:0,zIndex:2}},c?.variants?.edges?.map(({node:t})=>e.createElement("option",{key:t.id,value:t.id,disabled:0===d(t)},t.title))),e.createElement("span",{className:`${t}-chevron`,style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},e.createElement(Ke,null)))),K=({isMobile:t})=>e.createElement(e.Fragment,null,c.options.map((n,o)=>e.createElement("div",{key:n.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:n?.values?.length>1?16:0}},n?.values?.length>1&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},e.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",n.name),e.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},F[o]||n.values[0])),e.createElement(rs,{options:M(n),selectedValue:V(n,o),onChange:e=>{W(o,e)},type:O(n.name),isOptionAvailable:e=>j(o,e),isMobile:t}))))),J=({isMobile:t})=>e.createElement("div",{className:t?"yt-byob-modal-mobile-price":"yt-byob-modal-desktop-price",style:{width:"fit-content",minWidth:"fit-content",paddingRight:"10px",display:"flex",flexDirection:"row",alignItems:t?"center":"baseline",gap:"6px"}},a?.isFreebieTier&&!a.showFreebieTierProductPrices?e.createElement(e.Fragment,null,e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"20px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},iu(a.styles.general.currencySymbol,a.styles.general.currencySymbol),ru(u?.price)),e.createElement("span",{className:"yt-byob-current-price",style:{color:a.styles.general.primaryColor||"#d32f2f",fontWeight:"bold",fontSize:"20px"}},"FREE")):e.createElement(e.Fragment,null,u?.compareAtPrice&&parseFloat(u.compareAtPrice)>parseFloat(u?.price)&&e.createElement("div",{className:t?"yt-byob-modal-mobile-compare-price":"yt-byob-modal-desktop-compare-price",style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},iu(a.styles.general.currencySymbol,a.styles.general.currencySymbol),ru(u?.compareAtPrice)),e.createElement("div",{className:t?"yt-byob-modal-mobile-current-price":"yt-byob-modal-desktop-current-price"},e.createElement("span",{style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},iu(a.styles.general.currencySymbol,a.styles.general.currencySymbol),ru(u?.price))))),ee=({isMobile:t})=>e.createElement("div",{className:t?"yt-byob-modal-mobile-atc-wrapper":"yt-byob-modal-desktop-atc-wrapper yt-product-modal-atc-wrapper",style:{width:t?"100%":"80%"}},e.createElement("button",{className:t?"yt-byob-modal-mobile-atc-button":"yt-byob-modal-desktop-atc-button yt-product-modal-atc-button",style:{textTransform:"uppercase",fontWeight:"800",width:"100%",border:"none",backgroundColor:a.themeColor||"#111",borderRadius:a.cornerRadius,color:a.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden",opacity:U?.5:1,cursor:U?"not-allowed":"pointer"},onClick:e=>{e.stopPropagation(),e.preventDefault(),u?.id&&c&&(w("check"),a.handleAddToBundle(u?.id,c,1),setTimeout(()=>{w("idle"),s(void 0)},500))},disabled:U},a.styles.byob.addToBundleCTAText??"Add to bundle")),te=e.createElement(ts,{className:"yt-byob-modal-desktop-overlay"},e.createElement(ns,{$isSmallScreen:f,ref:l},e.createElement(os,{ref:l,className:"yt-byob-modal-desktop-container yt-variant-selection-modal"},e.createElement("div",{className:"yt-byob-modal-desktop yt-variant-selection-modal "+(f?"small-screen":"large-screen")},e.createElement(es,{className:"yt-byob-modal-desktop-close",onClick:()=>{s(void 0)},style:{backgroundColor:"white"}},e.createElement(Y,{size:"25"})),e.createElement("div",{className:"yt-byob-modal-desktop-image-section image-section"},e.createElement(X,null)),e.createElement("div",{className:"yt-byob-modal-desktop-details-section details-section",style:{marginLeft:"20px",minHeight:"100%",maxHeight:"70vh",scrollbarWidth:"none",overflowY:"auto",display:"flex",flexDirection:"column"}},e.createElement("h2",{className:"yt-byob-modal-desktop-title"},"variant-display-name"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.displayName:"variant-title"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.title:c?.title),e.createElement(G,{className:"yt-byob-modal-desktop-rating"}),e.createElement("div",{className:"yt-byob-modal-desktop-variant-price-wrapper",style:{display:"flex",flexDirection:"column",gap:"2px",marginTop:"20px"}},"dropdown"===a?.styles?.byob.variantSelectorType&&e.createElement(Z,{className:"yt-byob-modal-desktop-variant-selector"}),"customOptions"===a?.styles?.byob.variantSelectorType&&e.createElement(K,null),e.createElement("div",{className:"yt-byob-modal-desktop-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},e.createElement(J,{isMobile:!1}),e.createElement(ee,{isMobile:!1}))),e.createElement("div",{className:"yt-byob-modal-desktop-divider",style:{height:"10px",minHeight:"10px",border:"none",backgroundColor:"#D9D9D96B",margin:"20px 0 10px 0",display:"block !important"}},e.createElement("span",null)),e.createElement("span",{className:"yt-byob-modal-desktop-description yt-description-content",style:{scrollBehavior:"smooth"},dangerouslySetInnerHTML:{__html:P}})))))),ne=e.createElement(ts,{className:"yt-byob-modal-mobile-overlay"},e.createElement(ns,{className:"yt-byob-modal-mobile-content",style:{padding:"0px",position:"relative"},$isSmallScreen:f,ref:l},e.createElement(os,{ref:l,className:"yt-byob-modal-mobile-container yt-variant-selection-modal"},e.createElement("button",{className:"yt-byob-modal-mobile-close-btn",style:{position:"fixed",top:"20px",right:"20px",zIndex:9999999999,backgroundColor:"#FFFFFF",padding:"4px",borderRadius:"50%",border:"1px solid lightgray",display:"flex",justifyContent:"center",alignItems:"center"},onClick:()=>{s(void 0)}},e.createElement(Ze,{className:"yt-byob-modal-mobile-close-icon",style:{height:"22px",width:"22px",padding:"4px",color:"black"},onMouseEnter:e=>e.currentTarget.style.color="black"})),e.createElement("div",{className:"yt-byob-modal-mobile yt-variant-selection-modal small-screen",style:{padding:"0px"}},e.createElement("div",{className:"yt-byob-modal-mobile-image-section image-section"},e.createElement(X,{isMobile:!0})),e.createElement("div",{className:"yt-byob-modal-mobile-details-section details-section",style:{padding:"0 30px",margin:"15px 0",paddingBottom:T?`${T+20}px`:"120px"}},e.createElement("h2",{className:"yt-byob-modal-mobile-title",style:{margin:"0px"}},"variant-display-name"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.displayName:"variant-title"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.title:c?.title),e.createElement("div",{style:{paddingBlockStart:"10px"}},e.createElement(G,{className:"yt-byob-modal-mobile-rating"})),e.createElement("div",{className:"yt-byob-modal-mobile-divider",style:{opacity:"0.2",border:"none",height:"2px",backgroundColor:"#000000",margin:"10px 0px",display:"block !important"}},e.createElement("span",null)),e.createElement("div",{className:"yt-byob-modal-mobile-description yt-description-content",style:{scrollbarWidth:"none",scrollBehavior:"smooth",margin:"0px"},dangerouslySetInnerHTML:{__html:P}})))),e.createElement("div",{className:"yt-byob-modal-mobile-bottom-bar",ref:C,style:{position:"fixed",bottom:"0px",left:"0px",right:"0px",padding:"12px 15px",borderTop:"1px solid lightgray",boxShadow:"0px -4px 5px rgba(0, 0, 0, 0.1)",backgroundColor:"#fff",display:"flex",flexDirection:"column",gap:"2px",zIndex:9999999999}},"customOptions"===a?.styles?.byob.variantSelectorType?e.createElement(K,{isMobile:!0}):e.createElement(Z,{className:"yt-byob-modal-desktop-variant-selector"}),e.createElement("div",{className:"yt-byob-modal-mobile-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},e.createElement(J,{isMobile:!0}),e.createElement(ee,{isMobile:!0})))));return D.createPortal(f?ne:te,document.body)}),ls=({coverImageUrl:t,mobileCoverImageUrl:n,alt:o="Background",styles:r})=>{const i=[{imageWidth:21,descriptor:36},{imageWidth:48,descriptor:80},{imageWidth:99,descriptor:165},{imageWidth:216,descriptor:360},{imageWidth:225,descriptor:375},{imageWidth:319,descriptor:533},{imageWidth:330,descriptor:550},{imageWidth:432,descriptor:720},{imageWidth:564,descriptor:940},{imageWidth:639,descriptor:1066},{imageWidth:648,descriptor:1080},{imageWidth:900,descriptor:1500},{imageWidth:1068,descriptor:1780},{imageWidth:1296,descriptor:2160}],a=(e,t)=>{if(e&&e.includes("cdn.shopify"))try{const n=new URL(e),o=n.searchParams;return o.has("format")||o.set("format","webp"),o.has("quality")||o.set("quality","80"),o.set("width",t.toString()),n.toString()}catch{const n=e.includes("?")?"&":"?";return`${e}${n}format=webp&quality=80&width=${t}`}},l=e=>e?i.map(({imageWidth:t,descriptor:n})=>{const o=a(e,t);return o?`${o} ${n}w`:""}).filter(Boolean).join(", "):"";if(!t&&!n)return null;const c=t||n||"",s=a(c,800)||c,d=[];if(n&&n!==t){const t=l(n);t&&d.push(e.createElement("source",{key:"mobile",media:"(max-width: 768px)",srcSet:t}))}if(t){const n=l(t);n&&(d.length>0?d.push(e.createElement("source",{key:"desktop",media:"(min-width: 769px)",srcSet:n})):d.push(e.createElement("source",{key:"desktop",srcSet:n})))}else if(n){const t=l(n);t&&d.push(e.createElement("source",{key:"mobile",srcSet:t}))}return e.createElement("div",{style:{width:"100%",display:"block"}},e.createElement("picture",{style:{display:"block",width:"100%"}},d,e.createElement("img",{src:s,alt:o,style:{width:"100%",height:"auto",display:"block",...r},loading:"eager",fetchPriority:"high",sizes:"100vw"})))},cs=({title:t,isOpen:n,onToggle:o,children:r})=>e.createElement("div",{className:"yt-byob-filter-section",style:{borderBottom:"1px solid #eee",paddingBottom:n?"20px":"12px",marginBottom:"12px"}},e.createElement("div",{className:"yt-byob-filter-section-header",onClick:o,style:{display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",padding:"8px 0"}},e.createElement("span",{className:"yt-byob-filter-section-title",style:{fontSize:"16px",fontWeight:500,color:"#111"}},t),n?e.createElement(Oe,{className:"yt-byob-icon-minus",size:20}):e.createElement(Ae,{className:"yt-byob-icon-plus",size:20})),n&&e.createElement("div",{className:"yt-byob-filter-section-body",style:{marginTop:"16px"}},r)),ss=({availableFilters:n,appliedFilters:o,toggleFilter:r,clearAllFilters:i,applyPriceFilter:a,priceMin:l,setPriceMin:c,priceMax:s,setPriceMax:d,maxPossiblePrice:p,styles:u,availableProductCount:m,products:g,unavailableProductCount:x,storeCurrencyCode:f,showActions:y=!0,openSections:b,toggleSection:h})=>{const[v,w]=t(null),C=iu(u?.general?.currencySymbol,f)??f??"USD";return e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-filters-content-wrapper",style:{overflowY:"auto",scrollbarWidth:"none",padding:"20px",flex:1,minHeight:0,overscrollBehavior:"contain"}},n.map(t=>e.createElement(cs,{key:t.id,title:t.label,isOpen:!!b[t.id],onToggle:()=>h(t.id)},"LIST"===t.type&&e.createElement("div",{className:"yt-byob-filter-list",style:{display:"flex",flexDirection:"column",gap:"14px"}},t.values.map(n=>{const i=o[t.id]?.includes(n.id)||!1;return"filter.v.availability.1"===n.id?m??g.length:"filter.v.availability.0"===n.id||n.count,e.createElement("label",{key:n.id,className:"yt-byob-filter-item-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer"}},e.createElement("div",{className:"yt-byob-filter-item-left",style:{display:"flex",alignItems:"center",gap:"10px"}},e.createElement("input",{className:"yt-byob-filter-checkbox",type:"checkbox",checked:i,onChange:()=>r(t.id,n.id),style:{width:"18px",height:"18px",accentColor:u?.general?.primaryColor||"#333",cursor:"pointer"}}),e.createElement("span",{className:"yt-byob-filter-item-text",style:{fontSize:"15px",color:"#333"}},n.label)))})),"PRICE_RANGE"===t.type&&e.createElement("div",{className:"yt-byob-price-filter",style:{padding:"0 4px"}},e.createElement("div",{className:"yt-byob-price-range-display",style:{fontSize:"15px",color:"#333",marginBottom:"24px",fontWeight:500}},C,l.toLocaleString()," – ",C,s.toLocaleString()),e.createElement("div",{className:"yt-byob-price-slider-container",style:{position:"relative",width:"100%",height:"4px",background:"#e5e7eb",borderRadius:"4px",marginBottom:"10px"}},e.createElement("div",{className:"yt-byob-price-slider-track",style:{position:"absolute",height:"100%",background:"#333",borderRadius:"4px",left:l/p*100+"%",right:100-s/p*100+"%"}}),e.createElement("input",{type:"range",min:0,max:p,value:l,onMouseDown:()=>w("min"),onTouchStart:()=>w("min"),onChange:e=>{const t=Math.min(Number(e.target.value),s-10);c(t)},style:{position:"absolute",width:"100%",height:"0px",top:"50%",transform:"translateY(-50%)",background:"none",pointerEvents:"none",appearance:"none",WebkitAppearance:"none",zIndex:"min"===v?11:5,margin:0},className:"yt-byob-dual-range-input-min"}),e.createElement("input",{type:"range",min:0,max:p,value:s,onMouseDown:()=>w("max"),onTouchStart:()=>w("max"),onChange:e=>{const t=Math.max(Number(e.target.value),l+10);d(t)},style:{position:"absolute",width:"100%",height:"0px",top:"50%",transform:"translateY(-50%)",background:"none",pointerEvents:"none",appearance:"none",WebkitAppearance:"none",zIndex:"max"===v?11:4,margin:0},className:"yt-byob-dual-range-input-max"})),e.createElement("style",null,"\n .yt-byob-dual-range-input-min::-webkit-slider-thumb,\n .yt-byob-dual-range-input-max::-webkit-slider-thumb {\n pointer-events: auto;\n appearance: none;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: #444;\n border: 3px solid white;\n cursor: pointer;\n box-shadow: 0 2px 5px rgba(0,0,0,0.2);\n position: relative;\n z-index: 20;\n }\n .yt-byob-dual-range-input-min::-moz-range-thumb,\n .yt-byob-dual-range-input-max::-moz-range-thumb {\n pointer-events: auto;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: #444;\n border: 3px solid white;\n cursor: pointer;\n box-shadow: 0 2px 5px rgba(0,0,0,0.2);\n position: relative;\n z-index: 20;\n }\n "))))),y&&e.createElement("div",{className:"yt-byob-filter-actions",style:{display:"flex",gap:"12px",borderTop:"1px solid #eee",padding:"16px 0px",position:"sticky",bottom:"2px",paddingInline:"10px"}},e.createElement("button",{className:"yt-byob-filter-clear-button",onClick:i,style:{flex:1,padding:"8px",background:"#f3f4f6",border:"none",borderRadius:u?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px",color:"#333",fontFamily:"inherit"}},"Clear All"),e.createElement("button",{className:"yt-byob-filter-apply-button",onClick:a,style:{flex:1,padding:"8px",background:u?.general?.primaryColor||"#333",color:"white",border:"none",borderRadius:u?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px",fontFamily:"inherit"}},"Apply")))},ds=t=>{const{showFiltersDrawer:n,handleClose:o,isAnimating:r,isMobile:i}=t;return n?P(e.createElement("div",{className:"yt-byob-filter-drawer-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:1e3,display:"flex",justifyContent:"flex-end",opacity:r?1:0,transition:"opacity 300ms ease-in-out"},onClick:o},e.createElement("div",{className:"yt-byob-filter-drawer-content",style:{width:i?"85%":"380px",height:"100%",background:"white",boxShadow:"-4px 0 12px rgba(0,0,0,0.15)",transform:r?"translateX(0)":"translateX(100%)",transition:"transform 300ms ease-in-out",display:"flex",flexDirection:"column",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement(ss,{...t,applyPriceFilter:()=>{t.applyPriceFilter(),o()},openSections:t.openSections||{},toggleSection:t.toggleSection||(()=>{})}))),document.body):null},ps=t=>{const{showFiltersDrawer:n}=t;return n&&0!==t?.availableFilters?.length?e.createElement("div",{className:"yt-byob-filters-sidebar",style:{width:"280px",minWidth:"280px",padding:"0",height:"auto",maxHeight:"calc(100vh - 40px)",position:"sticky",top:"20px",display:"flex",flexDirection:"column",borderRight:"1px solid #eee",marginRight:"20px"}},e.createElement(ss,{...t,showActions:!0,openSections:t.openSections||{},toggleSection:t.toggleSection||(()=>{})})):null},us=({enableSortAndFilter:o,isMobile:r,setSearchTerm:i,searchTerm:a,styles:l,setSortBy:c,appliedFilters:s,setAppliedFilters:d,availableFilters:p=[],products:u,availableProductCount:m,unavailableProductCount:g,maxPossiblePrice:x,storeCurrencyCode:f,sharedFiltersState:b,openSections:h,toggleSection:v,sortBy:w})=>{const[C,E]=t(!1),[k,T]=t(a),{showFilters:S,setShowFilters:$,priceMax:N,setPriceMax:B,priceMin:F,setPriceMin:z}=b,[I,D]=t(!1),P=l?.byob?.productFiltersDisplay||"drawer",A=!r&&"sidebar"===P,_="none"===P;n(()=>{s["filter.v.price"]||(B(x),z(0))},[x,s]);n(()=>{const e=setTimeout(()=>{i(k)},300);return()=>clearTimeout(e)},[k,i]),n(()=>(S&&!A?(document.body.style.overflow="hidden",D(!0)):(document.body.style.overflow="",D(!1)),()=>{document.body.style.overflow=""}),[S,A]);const R=Object.entries(s).reduce((e,[t,n])=>"filter.v.price"===t?F>0||N<x?e+1:e:e+(n?n.length:0),0);return e.createElement("div",{className:"yt-byob-sort-filter-container",style:{display:"flex",flexDirection:r?"column":"row",justifyContent:"space-between",alignItems:r?"flex-end":"center",marginBottom:"20px",width:"100%",gap:r?"10px":"0"}},e.createElement("div",{className:"yt-byob-search-filter-controls",style:{display:"flex",flexDirection:o?"row-reverse":"row",justifyContent:"space-between",alignItems:C?void 0:"center",gap:"12px",width:"100%"}},o&&e.createElement("div",{className:"yt-byob-search-wrapper",style:{position:"relative",display:"flex",alignItems:"center",width:r?C?"100%":"auto":"400px",transition:"width 0.3s ease-in-out"}},r&&!C?e.createElement(_e,{className:"yt-byob-search-icon-trigger",fontSize:"20px",color:"#555",style:{cursor:"pointer"},onClick:()=>E(!0)}):e.createElement(e.Fragment,null,e.createElement("input",{className:"yt-byob-search-input",style:{width:"100%",padding:r?"10px 12px":"10px 14px",fontSize:"14px",outline:"none",color:"#333",border:"1px solid #c7c7c7",borderRadius:l?.byob.borderRadius,boxShadow:l?.byob.borderColor?"0 2px 4px rgba(0,0,0,0.1)":"none"},placeholder:"Search by Product Name",value:k,onChange:e=>T(e.target.value)}),!C&&e.createElement(_e,{className:"yt-byob-search-icon",fontSize:"18px",style:{position:"absolute",right:"12px",color:"#aaa",pointerEvents:"none"}})),r&&C&&e.createElement("span",{className:"yt-byob-search-close",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",cursor:"pointer"},onClick:()=>E(!1)},"X")),e.createElement("div",{className:"yt-byob-actions-wrapper",style:{display:"flex",flexDirection:"row",gap:"10px"}},p?.length>0&&e.createElement("button",{className:"yt-byob-filter-toggle-button",onClick:()=>$(!S),style:{display:_?"none":"flex",alignItems:"center",gap:r?"0px":"6px",background:S&&A?"#f3f4f6":"white",cursor:"pointer",fontSize:"14px",color:"#333",whiteSpace:"nowrap",border:"1px solid #d1d5db",padding:"8px 12px",borderRadius:l?.byob.borderRadius,boxShadow:"0 2px 4px rgba(0,0,0,0.1)"}},e.createElement(Re,{className:"yt-byob-filter-toggle-icon",size:18}),!r&&"Filters",R>0&&e.createElement("span",{className:"yt-byob-active-filter-badge",style:{background:l?.general?.primaryColor||"#ef4444",color:"white",borderRadius:"999px",padding:"2px 8px",fontSize:"12px",lineHeight:1}},R)),o&&e.createElement("div",{className:"yt-byob-sort-wrapper",style:{display:"flex",alignItems:"center",border:"1px solid #d1d5db",padding:"8px 12px",borderRadius:l?.byob.borderRadius,boxShadow:"0 2px 4px rgba(0,0,0,0.1)",position:"relative"}},!r&&e.createElement("span",{className:"yt-byob-sort-label",style:{fontSize:"14px",color:"#555",marginRight:"6px"}},"Sort:"),r&&e.createElement(Le,{className:"yt-byob-sort-icon",size:18,style:{color:"#555"}}),e.createElement("select",{className:"yt-byob-sort-select",style:{border:"none",background:"transparent",fontSize:"14px",color:"#333",cursor:"pointer",outline:"none",appearance:"none",WebkitAppearance:"none",paddingRight:"20px"},value:w,onChange:e=>c(e.target.value)},e.createElement("option",{className:"yt-byob-sort-option",value:""},"Featured"),e.createElement("option",{className:"yt-byob-sort-option",value:"price-low-to-high"},"Price: Low to High"),e.createElement("option",{className:"yt-byob-sort-option",value:"price-high-to-low"},"Price: High to Low"),e.createElement("option",{className:"yt-byob-sort-option",value:"title-asc"},"Alphabetical: A-Z"),e.createElement("option",{className:"yt-byob-sort-option",value:"title-desc"},"Alphabetical: Z-A")),e.createElement(y,{className:"yt-byob-sort-chevron",size:14,style:{position:"absolute",right:"10px",pointerEvents:"none",color:"#555"}})))),!A&&!_&&e.createElement(ds,{showFiltersDrawer:S,handleClose:()=>{A?$(!1):(document.body.style.overflow="",D(!1),setTimeout(()=>{$(!1)},300))},isAnimating:I,isMobile:r,availableFilters:p,appliedFilters:s,toggleFilter:(e,t)=>{d(n=>{const o=n[e]||[],r=o.includes(t)?o.filter(e=>e!==t):[...o,t],i={...n,[e]:r.length?r:void 0};return Object.fromEntries(Object.entries(i).filter(([,e])=>void 0!==e))})},clearAllFilters:()=>{B(x),z(0),d({})},applyPriceFilter:()=>{d(e=>{const t={...e};return t["filter.v.price"]=[`min:${F}-max:${N}`],t})},priceMin:F,setPriceMin:z,priceMax:N,setPriceMax:B,maxPossiblePrice:x,styles:l,availableProductCount:m,products:u,unavailableProductCount:g,storeCurrencyCode:f,openSections:h,toggleSection:v}))},ms=()=>e.createElement(e.Fragment,null,e.createElement("style",null,"@keyframes spin { to { transform: rotate(360deg); } }"),e.createElement("div",{className:"yt-collection-bundle-loader-spinner",style:{width:"14px",height:"14px",border:"2px solid #f3f3f3",borderTop:"2px solid #007bff",borderRadius:"50%",animation:"spin 1s linear infinite",display:"block"}})),gs=({title:t,uploadState:n,onUpload:o,onRemove:r,onRetry:i})=>{const a="string"==typeof n?{url:n,name:"Attachment"}:n,l=a?.loading,c=a?.error,s=a?.url;return e.createElement("div",{className:"yt-personalization-upload-field",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",border:"1px dashed #ccc",borderRadius:"10px",background:"#fff",gap:"12px"}},e.createElement("div",{style:{flex:1,minWidth:0}},e.createElement("div",{style:{fontWeight:600,fontSize:"14px",color:"#1a1a1a"}},t),!a&&!l&&!c&&e.createElement("div",{style:{fontSize:"12px",color:"#888",marginTop:"2px"}},"jpeg/png/img (max size: 5MB)"),l&&e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px",color:"#007bff",fontSize:"12px",marginTop:"4px"}},e.createElement(ms,null)," Uploading ",a?.name||"image","..."),c&&e.createElement("div",{style:{fontSize:"12px",color:"#dc3545",marginTop:"2px"}},"Upload failed."),s&&!l&&!c&&e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"6px"}},e.createElement("img",{src:a.url,alt:"Uploaded",style:{width:"36px",height:"36px",objectFit:"cover",borderRadius:"4px",border:"1px solid #eee"}}),e.createElement("span",{style:{fontSize:"12px",color:"#28a745",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},a.name))),e.createElement("div",{style:{flexShrink:0}},c&&e.createElement("button",{type:"button",onClick:i,style:{fontSize:"13px",fontWeight:600,color:"#303030",background:"white",border:"1.5px solid #E3E3E3",borderRadius:"10px",padding:"8px 16px",cursor:"pointer",whiteSpace:"nowrap"}},"Retry"),s&&!l&&!c&&e.createElement("button",{type:"button",onClick:r,style:{fontSize:"13px",fontWeight:600,color:"#fff",background:"#dc3545",border:"none",borderRadius:"10px",padding:"8px 16px",cursor:"pointer",whiteSpace:"nowrap"}},"Remove"),!a&&!l&&e.createElement("button",{type:"button",onClick:o,style:{fontSize:"13px",fontWeight:600,color:"#303030",background:"white",border:"1.5px solid #E3E3E3",borderRadius:"10px",padding:"8px 16px",cursor:"pointer",whiteSpace:"nowrap"}},"Upload Image")))},xs=({form:o,formData:i,setFormData:a,barHeight:l=0,isUploading:c,setIsUploading:s})=>{const d=r(new Map),[p,u]=t(!1),m=s??u;n(()=>()=>{d.current.forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),d.current.clear()},[]);const g=e=>{if(!d.current.has(e)){const t=document.createElement("input");t.type="file",t.accept="image/jpeg,image/png",t.style.display="none",t.multiple=!1,t.onchange=async t=>{const n=t.target.files?.[0];if(n){if(n.size>5242880)return alert("Max 5MB");if(!n.type.match(/^image\/(jpeg|png)$/i))return alert("JPEG/PNG only");a(t=>({...t,[e]:{loading:!0,name:n.name}}));try{const t=await(async e=>{const t=new FormData;t.append("file",e),m(!0);try{const e=window?.Shopify?.shop||"falah-devstore.myshopify.com",n=window?.Shopify?.shop?"https://products.yourtoken.io":"http://localhost:8000",o=await fetch(`${n}/shopify/upload?shop=${e}`,{method:"POST",headers:{"x-yourtoken-app-name":"bundles"},body:t});if(!o.ok)throw new Error("Upload failed");return(await o.json()).url}catch(e){throw alert("Upload failed. Try again."),e}finally{m(!1)}})(n);a(o=>({...o,[e]:{url:t,name:n.name}}))}catch{a(t=>({...t,[e]:{error:!0,name:n.name}}))}}},document.body.appendChild(t),d.current.set(e,t)}return d.current.get(e)};return e.createElement("div",{style:{width:"100%",padding:"8px 0",marginBottom:`${l}px`,boxSizing:"border-box"}},o.sections?.map((t,n)=>e.createElement("div",{key:`sec_${n}`,style:{marginBottom:"28px"}},e.createElement("label",{style:{display:"block",fontWeight:700,marginBottom:"10px",color:"#1a1a1a",fontSize:"15px",lineHeight:"normal"}},t?.title),"text"===t.type&&e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"12px"}},t.fields.map((t,n)=>{const o=t?.title??"Field "+n;return e.createElement("textarea",{key:o,placeholder:t?.title,rows:3,maxLength:500,value:i[o]||"",onChange:e=>a(t=>({...t,[o]:e.target.value})),style:{width:"100%",padding:"8px 0",border:"none",borderBottom:"1.5px solid #ddd",borderRadius:0,fontSize:"14px",color:"#1a1a1a",background:"transparent",resize:"none",outline:"none",lineHeight:"1.5",boxSizing:"border-box"}})})),"image"===t.type&&e.createElement("div",null,e.createElement("div",{style:{fontSize:"12px",color:"#888",marginBottom:"10px"}},"Supported formats - jpeg/png/img (max size: 5MB)"),e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"10px"}},t.fields.map((t,n)=>{const o=t?.title??"Field "+n;return e.createElement(gs,{key:o,title:t?.title,uploadState:i[o],onUpload:()=>g(o).click(),onRemove:()=>a(e=>{const{[o]:t,...n}=e;return n}),onRetry:()=>g(o).click()})}))))))};function fs({quantity:t,setQuantity:n,remainingQuantity:o,handleAddToBundle:r,variantId:i,product:a,handleRemoveItem:l,hideAddToBundle:c,selectedVariantInventoryQty:s}){const d={display:"flex",alignItems:"center",justifyContent:"center",width:"33%",cursor:"pointer",backgroundColor:"#f2f2f2",userSelect:"none",border:"none",padding:"8px",margin:"0",fontSize:"20px",color:"#333",textDecoration:"none",boxShadow:"none",outline:"none",borderRadius:"0",boxSizing:"border-box"},p=t<s;return e.createElement(ac,{className:"yt-byob-quantity-selector-container"},e.createElement("button",{className:"yt-byob-quantity-minus-button",onClick:e=>{e.stopPropagation();const o=Math.max(0,t-1);n(o),l&&i&&l(i,1)},style:d},"-"),e.createElement(lc,{className:"yt-byob-quantity-display"},t," added"),e.createElement("button",{className:"yt-byob-quantity-plus-button",onClick:e=>{e.stopPropagation();const l=Math.min(o,t+1,s);n(l),r&&i&&a&&r(i,a,1)},disabled:!p||c,style:{...d,cursor:!p||c?"not-allowed":"pointer",opacity:!p||c?.6:1}},"+"))}const ys=({product:r,styles:i,selectedVariant:a})=>{const[l,c]=t(!1),s=o(()=>au(a?.image?.url||r?.featuredMedia?.preview?.image?.url||r?.media?.edges?.[0]?.node?.image?.url)||"",[a?.image?.url,r?.featuredMedia?.preview?.image?.url,r?.media?.edges]),d=o(()=>r?.media?.edges?.map(e=>au(e?.node?.preview?.image?.url??e?.node?.image?.url)).filter(Boolean)??[],[r?.media?.edges]),p=o(()=>d?.[1]??s??"",[d,s]);n(()=>{if(s){(new Image).src=s}},[s]);const u=o(()=>s||d?.[0],[s,d]);return e.createElement("div",{className:"yt-byob-image-hover-container",style:{position:"relative",width:"100%",overflow:"hidden",aspectRatio:i.general.imageAspectRatio||"1/1"},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1)},e.createElement("div",{className:"yt-byob-image-inner-container",style:{width:"100%",height:"100%",position:"relative"}},e.createElement("img",{className:"yt-byob-image-main",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"top",opacity:l&&u!==p?0:1,transition:d?.length>0?"opacity 300ms ease, transform 300ms ease":"",transform:l?"scale(1.1)":"scale(1)"},src:u,alt:r.title}),u!==p&&e.createElement("img",{className:"yt-byob-image-hover",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",opacity:l?1:0,transition:"opacity 400ms ease, transform 400ms ease",transform:l?"scale(1.1)":"scale(1)",position:"absolute",top:0,left:0,objectPosition:"top"},src:p,alt:r.title})))},bs=({product:o,bundle:r,handleAddToBundle:a,hideAddToBundle:l,remainingQuantity:c,themeColor:s,handleRemoveItem:d,transitionActive:p,idx:u,selecteditems:m,customVariantsQuantity:g,currentProductTier:x,showFreebieTierProductPrices:f,tierIndex:b})=>{const h=ce(Jc),v=r.customizations,w=v?.byob?.variantSelectorType,[C,E]=t(!1),k=v.general?.variantTitleSuffix?o?.variants?.edges:(e=>{if(!e||e.length<2)return e;const t=e.map(e=>e.node.title).map(e=>e.split(" "));let n=[...t[0]];for(let e=1;e<t.length;e++){const o=t[e];let r=0;for(;r<n.length&&r<o.length&&n[n.length-1-r]===o[o.length-1-r];)r++;n=n.slice(n.length-r)}return n.length<1?e:e.map(e=>{const t=e.node.title.split(" "),o=t.slice(0,t.length-n.length).join(" ");return{...e,node:{...e.node,title:o,commonSuffix:n.join(" ")}}})})(o?.variants?.edges);if(!k||!k.length)return e.createElement(e.Fragment,null);const T=i(e=>{const t=g?.find(t=>t.variantId===e)?.quantity;if(void 0!==t)return t;if(r?.customProductsQuantity)return r?.customProductsQuantity;const n=k?.find(t=>t.node.id===e),i=n?.node;return i?o.tracksInventory&&i.inventoryItem?.tracked?i.inventoryQuantity>0?i.inventoryQuantity:i.inventoryQuantity<=0&&"continue"===i.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[k,g,o.tracksInventory]),S=k?.find(e=>T(e.node.id)>0)?.node?.id;if(!S&&!v.general.showOutOfStockProducts)return e.createElement(e.Fragment,null);const[$,N]=t(k?.find(e=>T(e.node.id)>0)?.node?.id||k[0]?.node?.id),[B,F]=t(0),[z,I]=t(window.innerWidth<450),[D,P]=t("normal"),A=k?.find(e=>e?.node?.id===$)?.node,_=T($||"");n(()=>{const e=m.find(e=>e.variantId===$&&(void 0===b||e.tierIndex===b));F(e?e.quantity:0)},[m,$,b]),n(()=>{const e=()=>{I(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{CSS.supports("font-weight","500")?P("500"):CSS.supports("font-weight","400")?P("400"):CSS.supports("font-weight","600")&&P("600")},[]),n(()=>{document.documentElement.style.setProperty("--yt-bundle-font-weight",D)},[D]),n(()=>{if($&&!k?.some(e=>e.node.id===$)){const e=k.find(e=>T(e.node.id)>0)?.node.id||k[0]?.node?.id;e&&N(e)}},[$,k,T]);const R=o.variants&&o.variants.edges?.length>1&&"customOptions"!==w,L="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,O="53933408435"===L,M="75851235630"===L,W=(e=>{if(e.metafield&&"yourtoken_bundles_app"===e.metafield.namespace&&"categories"===e.metafield.key){if(e.metafield.jsonValue&&Array.isArray(e.metafield.jsonValue))return e.metafield.jsonValue;if(e.metafield.value)try{const t=JSON.parse(e.metafield.value);if(Array.isArray(t))return t}catch(e){console.error("Failed to parse categories:",e)}}return[]})(o),V=W.length>0;return e.createElement(e.Fragment,null,e.createElement(dc,{borderRadius:v?.byob.borderRadius,borderColor:v?.byob.borderColor,shadowType:v?.byob.shadowType,backgroundColor:v?.byob.cardBackgroundColor,className:"yt-byob-product-container bundle-builder-product-container "+(p?"yt-product-card-transition-active":u%2==0?"yt-product-card-transition":"yt-product-card-transition-up"),onClick:()=>{if(_<=0)return;const e={...o,variants:{...o.variants,edges:k},selectedVariant:A};h(e)},onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.01)"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)"},style:{WebkitTapHighlightColor:"transparent",textAlign:v?.byob?.productCardDetailsAlignment||"left"}},e.createElement(pc,{className:"yt-byob-image-wrapper"},e.createElement(ys,{product:o,styles:v,selectedVariant:A}),r?.productCardBadgeText&&e.createElement("div",{className:"yt-byob-product-badge",style:{position:"absolute",top:"0px",left:"0px",backgroundColor:v?.general.primaryColor||"#111",color:v?.general.primaryContrastColor||"#fff",zIndex:1,margin:"0px",whiteSpace:"pre",padding:"4px 8px",fontSize:"12px",borderTopLeftRadius:v.byob.borderRadius}},r.productCardBadgeText),R&&e.createElement("div",{className:"yt-byob-variant-selector-wrapper",style:{position:"relative",width:"100%"}},e.createElement(uc,{className:"yt-byob-variant-selector",isCoralHaze:O,onClick:e=>{e.preventDefault(),e.stopPropagation()},value:$||"",onChange:e=>{e.stopPropagation(),e.preventDefault(),N(e.target.value)}},k?.map(t=>{const n=window.innerWidth<=320?10:window.innerWidth<=420?15:22,o=t.node.title.length>n?t.node.title.substring(0,n)+"...":t.node.title;return e.createElement("option",{key:t.node.id,value:t.node.id},o)})),e.createElement("div",{className:"yt-byob-variant-chevron",style:{position:"absolute",right:"16px",bottom:"10px",pointerEvents:"none"}},e.createElement(y,null)))),e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",alignItems:"flex-start"},className:"yt-byob-product-details-wrapper"},e.createElement("div",{className:"yt-byob-product-content"},"enabled"===r?.customizations?.byob?.productCardCategoryVisibility&&V&&e.createElement("div",{className:"yt-byob-product-categories-wrapper",style:{padding:"2px 4px"}},e.createElement("div",{className:"yt-byob-product-categories",style:{display:"flex",flexWrap:"wrap",gap:"4px"}},W.slice(0,2).map((t,n)=>e.createElement("span",{className:"yt-byob-category-tag",key:n,style:{fontSize:z?"10px":"14px",color:"#666",fontWeight:"500",paddingBottom:"4px"}},t.charAt(0).toUpperCase()+t.slice(1))),W.length>2&&e.createElement("span",{className:"yt-byob-more-categories",style:{fontSize:"10px",padding:"2px 6px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",color:"#666",fontWeight:"500"}},"+",W.length-2," more"))),e.createElement(mc,{isMobile:z,showBorder:r?.showBorder??!0,style:{...!v?.byob.productsPriceVisibility&&{padding:"8px"},...v?.byob.productTitleFontSize&&{fontSize:v?.byob.productTitleFontSize||"18px"}},className:"yt-byob-product-title-wrapper"},e.createElement("div",{style:{display:"-webkit-box",WebkitLineClamp:v?.byob?.productTitleWrapLines||2,WebkitBoxOrient:"vertical",overflow:"hidden",lineHeight:"normal"},className:"yt-byob-product-title"},M?String(A?.displayName).replace("- Default Title",""):o.title,A?.commonSuffix?" -"+A?.commonSuffix:""))),"Default Title"!==A?.title&&v?.byob?.showVariantTitleInCard&&e.createElement("p",{style:{padding:r?.showBorder??1?"0px 10px":"0 4px",fontSize:"12px",margin:"0",fontWeight:"600",color:"#888",lineHeight:"normal"},className:"yt-byob-product-variant-title"},A?.title),"ratingOnly"===r?.reviewRatingType&&(o?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-byob-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Be,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6}},o?.rating?.averageRating," rating")),"ratingAndReviewCount"===r?.reviewRatingType&&(o?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-byob-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Be,{color:"gold",size:14})," ",o?.rating?.averageRating,e.createElement(Ce,{className:"yt-byob-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",o?.rating?.ratingCount," reviews)"),v?.byob.productsPriceVisibility&&e.createElement("div",{className:"yt-byob-product-price yt-bundle-builder-product-price",style:{marginBottom:"5px",padding:r?.showBorder?"0px 10px":"0 4px"}},x?.isFreebieTier&&!f?e.createElement(e.Fragment,null,e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},iu(v.general.currencySymbol,r?.storeCurrencyCode)??"Rs.",ru(A?.price)),e.createElement("span",{className:"yt-byob-current-price",style:{color:v.general.primaryColor||"#d32f2f",fontWeight:"bold"}},"FREE")):parseFloat(A?.price??"0")>0?e.createElement("span",{className:"yt-byob-current-price"},iu(v.general.currencySymbol,r?.storeCurrencyCode)??"Rs.",ru(A?.price)):e.createElement("span",{className:"yt-byob-free-price"},"Free"),(!x?.isFreebieTier||f)&&A?.compareAtPrice&&v?.byob.compareAtPriceVisibility&&parseFloat(A.compareAtPrice)>parseFloat(A?.price)&&e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px"}},iu(v.general.currencySymbol,r?.storeCurrencyCode)??"Rs.",ru(A.compareAtPrice)))),(_>0||_===1/0)&&e.createElement(gc,{borderRadius:v?.byob.borderRadius,className:"yt-byob-add-to-bundle-wrapper yt-product-atc-wrapper"},(0===B||void 0===B)&&e.createElement(cc,{style:{...!l&&{backgroundColor:v?.general.primaryColor||"#111",color:v?.general.primaryContrastColor||"#fff"}},disabled:l,onClick:e=>{e.stopPropagation(),e.preventDefault(),F(1),(()=>{if(!$)return;"customOptions"===w&&k.length>1?E(!0):a($,o,1)})()},className:"yt-byob-add-to-bundle-button yt-product-atc-button"},v?.byob.addToBundleCTAText),!r?.disableQuantitySelector&&B>0&&$&&e.createElement(sc,{className:"yt-byob-quantity-selector-container visible",style:{overflow:"hidden"}},e.createElement(fs,{remainingQuantity:c,setQuantity:F,quantity:B,handleAddToBundle:a,variantId:$,product:o,handleRemoveItem:d,hideAddToBundle:l,selectedVariantInventoryQty:_})),r?.disableQuantitySelector&&B>0&&$&&e.createElement(cc,{style:{backgroundColor:"#747474",color:v?.general.primaryContrastColor||"#fff",display:"flex",justifyContent:"space-between",overflow:"hidden",height:"40px"},className:"yt-byob-added-button yt-product-atc-single-qty-selector"},e.createElement(xc,{className:"yt-byob-added-text yt-product-atc-single-qty-selector-added"},"ADDED"),e.createElement(fc,{className:"yt-byob-single-qty-remove yt-product-atc-single-qty-selector-remove",onClick:e=>{e.stopPropagation();const t=Math.max(0,B-1);F(t),d&&$&&d($,b)}},e.createElement(Me,{style:{color:"#fff",fontSize:"20px"}})))),_<=0&&_!==1/0&&e.createElement(cc,{style:{backgroundColor:v.general.disabledButtonColor,color:"#fff",cursor:"not-allowed",transition:"transform 0.2s ease-in-out"},className:"yt-product-atc-disabled"},v?.general.outOfStockLabel||"Out of Stock")),"customOptions"===w&&C&&k.length>1&&e.createElement(is,{product:o,isOpen:C,onClose:()=>E(!1),variantOptions:r.variantOptions,cta:{textColor:v.general.ctaTextColor,backgroundColor:v.general.primaryColor},onConfirm:e=>{N(e),a(e,o,1)}}))},hs=({currentStep:t,setCurrentProductTier:n,totalSteps:o,tiers:r,isMobile:i,selectedProductsByTier:a,primaryColor:l="#000",primaryTextColorCta:c="#fff",tierNavigation:s})=>e.createElement("div",{className:"yt-byob-stepper-container",style:{textAlign:"center",fontSize:"20px"}},e.createElement("div",{className:"yt-byob-stepper-steps",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center"}},Array.from({length:o}).map((c,d)=>{const p=d+1,u=!r[d].isFormStep&&r[d].minimumQuantity-(a[d]?.length??0)===0,m=d===t;return l="black"===l?"#000000":l,e.createElement(e.Fragment,{key:p},e.createElement("div",{className:"yt-byob-stepper-step-wrapper",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",gap:i?"4px":"8px"},onClick:()=>!1===s?()=>{}:n(p-1)},e.createElement("div",{className:"yt-byob-stepper-step-number",style:{fontSize:"14px"}},"Step ",p),e.createElement("div",{className:"yt-byob-stepper-step-bar",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",cursor:"pointer"}},e.createElement("div",{className:"yt-byob-stepper-step-left-bar",style:{height:"3px",width:i?"30px":"50px",backgroundColor:m?"#666666":u?l:"#CBD5E0",display:"block",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px"}}),e.createElement("div",{className:"yt-byob-stepper-step-circle",style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:m?"white":u?`${l}50`:"white",border:`2px solid ${m?"#666666":u?l:"#CBD5E0"}`,display:"flex",alignItems:"center",justifyContent:"center"}}),e.createElement("div",{className:"yt-byob-stepper-step-right-bar",style:{height:"3px",width:i?"30px":"50px",backgroundColor:m?"#666666":u?l:"#CBD5E0",display:"block",marginRight:d<o?i?"4px":"6px":"",borderTopRightRadius:"5px",borderBottomRightRadius:"5px"}}))))})),e.createElement("div",{className:"yt-byob-stepper-title",style:{margin:i?"16px 0px":"15px 0px",fontSize:i?"16px":"18px",padding:"4px",background:"rgba(0, 0, 0, 0.03)",borderBottom:"1px solid rgba(130, 130, 130, 0.28)"}},r[t]?.title)),vs=({styles:t,isMobile:n,categories:o,activeCategory:r,onCategoryChange:i})=>{const a=e=>{i(e)},l=(e,t)=>{const n=e.replace("#","");return`rgba(${parseInt(n.substring(0,2),16)}, ${parseInt(n.substring(2,4),16)}, ${parseInt(n.substring(4,6),16)}, ${t})`};return"tabs"===t?.byob?.categoryFilterOnPage?e.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"}},e.createElement("div",{className:"yt-byob-category-tabs-container",style:{display:"flex",gap:"0px",minWidth:"max-content",paddingBottom:"1px",flexWrap:"nowrap",justifyContent:"center",borderBottom:"1px solid #e0e0e0",width:"auto",height:n?"28px":"45px"}},["All",...o].map(o=>{const i=r===o;return e.createElement("button",{key:o,onClick:()=>a(o),className:"yt-byob-category-tab-button",style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:i?"600":"400",color:i?t.general.primaryColor:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:i?l(t.general.primaryColor,.07):"transparent",borderBottom:i?`2px solid ${t?.general.primaryColor}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:e=>{i||(e.currentTarget.style.color=t?.general.primaryColor)},onMouseLeave:e=>{i||(e.currentTarget.style.color="#666")}},e.createElement("span",{style:{visibility:"hidden",height:0,display:"block",overflow:"hidden",fontWeight:600},"aria-hidden":"true"},o.charAt(0).toUpperCase()+o.slice(1)),e.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},o.charAt(0).toUpperCase()+o.slice(1)))}))):e.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"}},e.createElement("div",{className:"yt-byob-category-buttons-container",style:{display:"flex",gap:"8px",minWidth:"max-content",flexWrap:"nowrap",justifyContent:"center",paddingRight:n?"10px":"0px"}},["All",...o].map(o=>e.createElement("button",{key:o,onClick:()=>a(o),className:"yt-byob-category-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${r===o?t?.general.primaryColor:"#e0e0e0"}`,borderRadius:t?.general.ctaBorderRadius,backgroundColor:r===o?t?.general.primaryColor:"white",color:r===o?"white":"#333",cursor:"pointer",transition:"all 0.3s ease",outline:"none",whiteSpace:"nowrap",minWidth:"fit-content",flexShrink:0},onMouseEnter:e=>{r!==o&&(e.currentTarget.style.borderColor=t?.general.primaryColor,e.currentTarget.style.color=t?.general.primaryColor)},onMouseLeave:e=>{r!==o&&(e.currentTarget.style.borderColor="#e0e0e0",e.currentTarget.style.color="#333")}},o.charAt(0).toUpperCase()+o.slice(1)))))},ws=({bundle:a,selectedItems:l,setSelectedItems:c,handleAddToCart:s,bundleAddToCartLoading:d,renderingOnPage:p,selectedItemsQuantity:u,handleRemoveItem:m,bundleSubtotal:g,dispatchAnalyticsEvent:x,fetchStoreDetails:f,productsPagination:y})=>{const[b,h]=t(void 0),[v,w]=t(window.innerWidth<450),[C,E]=t(0),[k,T]=t({}),S=!!a.personalizedForm?.title&&"productTier"===a.builderTiers?.type,[$,N]=t({}),[B,F]=t(!1),z=S&&C===(a.builderTiers?.productTier?.length||0),I=C===(a.builderTiers?.productTier?.length||0)-1,D=S&&I&&!z,[P,A]=t(a?.products),[_,R]=t(!1),[L,O]=t({}),[M,W]=t(a?.products),[V,j]=t({}),[H,q]=t(y?.cursorData),Q=a.builderTiers?.type,U=a.customizations,Y=a.builderTiers?.productTier??[],G=a.builderTiers?.offerTier??[],[X,Z]=t([]),[K,J]=t(!1),[ee,te]=t("All"),ne=r(null),[oe,re]=t({}),[ie,le]=t([]),[ce,se]=t(!1),[de,pe]=t(0),[ue,ge]=t(0),[xe,fe]=t({}),ye=e=>{fe(t=>{const n=!1!==t[e];return{...t,[e]:!n}})};n(()=>{ie.length>0&&fe(e=>{const t={...e};return ie.forEach(e=>{void 0===t[e.id]&&(t[e.id]=!1)}),t})},[ie]),n(()=>{!(Object.values(oe).length>0)&&y?.cursorData&&q(y.cursorData)},[oe,y?.cursorData]);const be=a.customStoreDetails?.fixedInventoryDetails;n(()=>{const e=new Set;let t=!1;P?.forEach(n=>{const o=n?.productDetails;if(o.metafield&&"yourtoken_bundles_app"===o.metafield.namespace&&"categories"===o.metafield.key){let n=[];if(o.metafield.jsonValue&&Array.isArray(o.metafield.jsonValue))n=o.metafield.jsonValue;else if(o.metafield.value)try{const e=JSON.parse(o.metafield.value);Array.isArray(e)&&(n=e)}catch(e){console.error("Failed to parse categories:",e)}n.length>0&&(t=!0,n.forEach(t=>e.add(t)))}}),Z(Array.from(e)),J(t);U?.byob?.productFiltersDisplay&&"none"!==U?.byob?.productFiltersDisplay&&(async()=>{const e=U?.byob?.productFiltersDisplay??"none";if("drawer"===e||"sidebar"===e)try{const e=await(f?.());e?.productFilters&&le(e.productFilters??[])}catch(e){console.error("no filters data found")}})()},[U?.byob,f,P]),n(()=>{re({})},[C,ee]);const he=((e,t)=>"All"===t?e:e.filter(e=>{const n=e?.productDetails;if(n.metafield&&"yourtoken_bundles_app"===n.metafield.namespace&&"categories"===n.metafield.key){let e=[];if(n.metafield.jsonValue&&Array.isArray(n.metafield.jsonValue))e=n.metafield.jsonValue;else if(n.metafield.value)try{const t=JSON.parse(n.metafield.value);Array.isArray(t)&&(e=t)}catch(e){console.error("Failed to parse categories:",e)}return e.includes(t)}return!1}))(P.filter(e=>{const t=e.productDetails.status?.toLowerCase(),n="active"===t||"unlisted"===t||void 0===e.productDetails.status||""===e.productDetails.status,o="estailofashion.myshopify.com"!==window?.Shopify?.shop||null!==e?.productDetails?.publishedAt;return n&&o}),ee),ve="productTier"===Q?Y.reduce((e,t)=>e+t.minimumQuantity,0):"offerTier"===Q?G.reduce((e,t)=>e+t.minimumQuantity,0):a.minimumQuantity,we=i((e,t)=>{const n=be?.find(e=>e.variantId===t)?.quantity;if(void 0!==n)return n;const o=(e.variants?.edges||[]).find(e=>e.node.id===t),r=o?.node;return r?e.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[be]),[Ce,Ee]=t(3e3);n(()=>{const e=ie?.find(e=>"PRICE_RANGE"===e.type||"filter.v.price"===e.id);e&&e.values?.[0]?.input?.price?.max&&Ee(e.values[0].input.price.max)},[P,ie]);const[ke,Te]=t(""),[Se,$e]=t(""),Ne=((e,t)=>e.filter(e=>e?.productDetails?.title?.toLowerCase().includes(t?.toLowerCase())))(he,ke),Be=((e,t)=>[...e].sort((e,n)=>{const o=e?.productDetails?.title?.toLowerCase(),r=n?.productDetails?.title?.toLowerCase(),i=parseFloat(e?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),a=parseFloat(n?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(t){case"title-asc":return o.localeCompare(r);case"title-desc":return r.localeCompare(o);case"price-low-to-high":return i-a;case"price-high-to-low":return a-i;default:return 0}}))(Ne,Se);n(()=>{(async e=>{if(!y)return;const{initialCursorData:t,cursorData:n,fetchFn:o,setCursorData:r}=y,i="productTier"===Q?Y?.[C]?.tier:1;if(0===Object.values(e)?.length)return void("productTier"===Q?(O(e=>({...e,[C]:V?.[C]||[]})),r(H||{...n})):(A(M),r(H||{1:t?.[1]})));const a=await o(e,i,null);a&&("productTier"===Q?(O(e=>({...e,[C]:a})),A(e=>{const t=new Set(e.map(e=>e.productId)),n=a.filter(e=>!t.has(e.productId));return[...e,...n]})):A(a))})(oe)},[oe]);const[Fe,ze]=ae(Jc),[Ie,De]=t(!1);n(()=>{x?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:a?._id,bundleType:"byob-page-bundle",byobBundleType:a.builderTiers?.type??"builder"}}),setTimeout(()=>{De(!0)},100)},[]);const Pe=r(null);n(()=>{const e=()=>{w(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{if(a.coverImageUrl){const e=new Image;e.src=au(a.coverImageUrl)??"",e.onload=()=>{h(e.width/e.height)}}},[a.coverImageUrl]),n(()=>{De(!1),setTimeout(()=>De(!0),100)},[C]);const Ae=(e,t)=>{if("productTier"===Q){let n={...k},o=!1;if(n[t]){const r=n[t].indexOf(e);-1!==r&&(n[t]=[...n[t]],n[t].splice(r,1),o=!0)}if(!o)for(let t=Y.length;t>=0;t--){const o=n[t].indexOf(e);if(-1!==o){n[t]=[...n[t]],n[t].splice(o,1);break}}T(n);const r=Y.findIndex((e,t)=>n[t]?.length<e.minimumQuantity);-1!==r&&E(r)}m(e,t)},_e=()=>{const e=document.querySelector(".products-display");e&&e.scrollIntoView({behavior:"smooth"})};n(()=>{if(a)return"productTier"!==a?.builderTiers?.type?(A(a?.products??[]),void W(a?.products??[])):void("productTier"===a?.builderTiers?.type&&(O({0:a?.products}),j({0:a?.products})))},[a]),n(()=>{if("productTier"!==Q||!Y[C])return;if(ve===u)return;const e=Y.findIndex((e,t)=>{const n=k[t]||[];return t>=C&&n.length<e.minimumQuantity});if(-1!==e&&e!==C){E(e);const t=Y[C];t?.products?.length>1&&_e()}else if(-1===e&&S&&C<Y.length){Y.every((e,t)=>(k[t]?.length||0)>=e.minimumQuantity)&&E(Y.length)}},[k,Y,Q,S]),n(()=>{Te("")},[C]),n(()=>{function e(e){if(!Pe.current||!e.target)return;!Pe.current.contains(e.target)&&ze(void 0)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const Re=(e,t,n)=>{var o;"productTier"===Q&&(o=e,T(e=>{const t={...e},n=Y.findIndex((e,n)=>{const o=t[n]||[];return n>=C&&o.length<e.minimumQuantity}),r=-1!==n?n:C;return-1!==n&&E(n),t[r]||(t[r]=[]),t[r].push(o),t}));const r=!0===Y[C]?.isFreebieTier;x?.({eventNameCustom:"byob_add_to_bundle",eventTypeCustom:"clicks",data:{bundleId:a._id,bundleType:"byob-page-bundle",byobBundleType:a.builderTiers?.type??"builder",addedProduct:{id:t?.id,title:t?.title}}}),lu(e,t,n,l,c,r,C)},Le=(()=>{if(!a?.builderTiers)return a.minimumQuantity;const{type:e,offerTier:t,productTier:n}=a.builderTiers,o="offerTier"===e?t:"productTier"===e?n:null;if(!o)return a.minimumQuantity;let r=0;return o.map(e=>{r+=e.minimumQuantity}),r})(),Oe=v&&a.mobileCoverImageUrl?au(a.mobileCoverImageUrl):au(a.coverImageUrl??"")||null,Me=i(e=>{const t=U?.general?.showOutOfStockProducts;if(t)return!0;const n=e?.productDetails,o=n?.variants?.edges||[];if(be){if(o.some(e=>be.some(t=>t.variantId===e.node.id&&t.quantity>0)))return!0}return o.some(e=>we(n,e.node.id)>0)},[U?.general?.showOutOfStockProducts,be,we]),We=o(()=>{if("productTier"===Q&&Y.length>0){const e=L?.[C]??[];return Se?Be.filter(t=>e.some(e=>e.productId===t.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds?.[0])))&&Me(t)):e.map(e=>Be.find(t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds?.[0])))).filter(e=>e&&Me(e))}return Be.filter(Me)},[Q,Y,L,C,Be,Me,Se]),Ve=We;n(()=>{if("productTier"!==Q)return;const e=Y[C];if(!e)return;if(1!==e.minimumQuantity)return;if(1!==e.products.length)return;if(1!==L?.[C]?.length)return;const t=e.products[0],n=P.find(e=>e.productId===t.productId)?.productDetails;if(!n)return;if(n.variants?.edges?.length>1)return;const o=n.variants?.edges?.find(e=>we(n,e.node.id)>0)?.node;if(!o)return;const r=o.id,i=k[C]?.includes(r);if(!i&&(Re(r,n,1),C<Y.length-(S?0:1))){E(C+1);const e=Y?.[C];e?.products?.length>1&&_e()}},[Q,Y,C,P,k,we,Re]);const je=o(()=>he.filter(e=>{const t=e?.productDetails;return(t.variants?.edges||[]).some(e=>we(t,e.node.id)>0)}).length,[he,we]),He=o(()=>he.length-je,[he,je]),qe="bundles"==a.appName?a.pageHeader?.title:a?.title,Qe="bundles"==a.appName?a.pageHeader?.description:a?.subtitle;n(()=>{if(!y)return;const{cursorData:e,fetchFn:t}=y,n=Y[C]?.tier,o="productTier"===Q?n:1;if(e?.[o]&&!e?.[o]?.hasNext||!t)return;const r=new IntersectionObserver(async([n])=>{if(n.isIntersecting&&!_){R(!0);try{const n=await t(oe,o,e?.[o]?.cursor);if(n?.length>0){const e=Object.values(oe).length>0;"productTier"===Q?(O(e=>({...e,[C]:[...e[C]||[],...n]})),e||j(e=>({...e,[C]:[...e[C]||[],...n]})),A(e=>[...e,...n])):(A(e=>[...e,...n]),e||W(e=>[...e,...n]))}}catch(e){console.error("Pagination fetch failed:",e)}finally{R(!1)}}},{root:null,rootMargin:"300px",threshold:.01}),i=ne.current;return i&&r.observe(i),()=>{i&&r.unobserve(i)}},[y,_,Q,C,Y]);const Ue=()=>{x?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:a._id,bundleType:"byob-page-bundle",byobBundleType:a.builderTiers?.type??"builder",selectedProducts:l.map(e=>({id:e?.product?.id,title:e?.product?.title,quantity:e?.quantity}))}})};return e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-builder-section",style:{display:"flex",flexDirection:"column",width:"100%",alignItems:"center",justifyContent:"center",rowGap:"15px",padding:"20px 0px",marginBottom:"20px",backgroundColor:U.byob.sectionBackgroundColor,..."transparent"!==U.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},Oe?e.createElement("div",{className:"yt-byob-cover-image-container",style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",overflow:"hidden",...a?.coverImageVerticalMargin&&{marginBottom:a?.coverImageVerticalMargin,marginTop:a?.coverImageVerticalMargin}}},Oe&&e.createElement(ls,{coverImageUrl:Oe,alt:"Background",styles:{width:"100%",height:"auto",display:"block"}}),e.createElement("div",{className:"yt-byob-cover-image-overlay",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px",textShadow:"2px 2px 8px rgba(0, 0, 0, 0.4)"}},e.createElement("span",{style:{lineHeight:"normal",fontSize:U?.byob?.titleFontSize??"3rem",fontWeight:"700",color:U?.byob?.titleTextColor??"#000",marginBottom:"15px",backgroundColor:U?.byob?.titleBackgroundColor??"transparent",width:"100%",textAlign:"center"},className:"bundle-builder-title"},qe),e.createElement("span",{style:{lineHeight:"normal",fontSize:U?.byob?.subtitleFontSize??"1.5rem",color:U?.byob?.titleTextColor??"#000"},className:"bundle-builder-subtitle"},Qe))):(qe||Qe)&&e.createElement("div",{className:"yt-byob-header-content",style:{zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px"}},qe&&e.createElement("span",{className:"bundle-builder-title",style:{lineHeight:"normal",fontSize:U?.byob?.titleFontSize??"3rem",fontWeight:"700",color:U?.byob?.titleTextColor??"#000",marginBottom:"15px",textAlign:"center",width:"100%",backgroundColor:U?.byob?.titleBackgroundColor??"transparent"}},qe),Qe&&e.createElement("span",{className:"bundle-builder-subtitle",style:{lineHeight:"normal",fontSize:U?.byob?.subtitleFontSize??"1.5rem",color:U?.byob?.titleTextColor??"#000"}},Qe)),e.createElement("div",{style:{fontSize:"20px",width:"100%"},className:"products-display"},"productTier"===Q&&Y.length>0&&U?.byob.productTiersVisibility&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-stepper-wrapper"},e.createElement(hs,{currentStep:C,totalSteps:Y.length+(S?1:0),tiers:S?[...Y,{title:a.personalizedForm?.title||"Personalize",tier:Y.length,minimumQuantity:0,products:[],isFormStep:!0}]:Y,isMobile:v,primaryColor:U?.general?.primaryColor,primaryTextColorCta:U?.general?.primaryContrastColor,setCurrentProductTier:E,selectedProductsByTier:k,tierNavigation:U.byob.tierNavigation})))),e.createElement("div",{className:"yt-byob-layout-wrapper",style:{display:"flex",flexDirection:"row",width:v?"100%":"90%",marginInline:"auto"}},"sidebar"===U?.byob?.productFiltersDisplay&&!v&&!z&&e.createElement(ps,{showFiltersDrawer:ce,handleClose:()=>se(!1),isAnimating:!1,isMobile:!1,availableFilters:ie,appliedFilters:oe,toggleFilter:(e,t)=>{re(n=>{const o=n[e]||[],r=o.includes(t)?o.filter(e=>e!==t):[...o,t],i={...n,[e]:r.length?r:void 0};return Object.fromEntries(Object.entries(i).filter(([,e])=>void 0!==e))})},clearAllFilters:()=>{re({}),ge(0),pe(Ce)},applyPriceFilter:()=>{re(e=>{const t={...e};return t["filter.v.price"]=[`min:${ue}-max:${de}`],t})},priceMin:ue,setPriceMin:ge,priceMax:de,setPriceMax:pe,maxPossiblePrice:Ce,styles:U,products:P,unavailableProductCount:He,storeCurrencyCode:a?.storeCurrencyCode,openSections:xe,toggleSection:ye}),e.createElement("div",{className:"yt-byob-products-column",style:{display:"flex",flexDirection:"column",flex:1,minWidth:0}},!z&&e.createElement("div",{className:"yt-byob-filters-wrapper",style:{width:"100%",marginBottom:"20px",display:"flex",flexDirection:"column",gap:"20px"}},e.createElement(us,{enableSortAndFilter:a?.enableSortAndFilter??!1,isMobile:v,searchTerm:ke,setSearchTerm:Te,setSortBy:$e,styles:U,appliedFilters:oe,setAppliedFilters:re,availableFilters:ie,products:P,availableProductCount:je,unavailableProductCount:He,maxPossiblePrice:Ce,storeCurrencyCode:a?.storeCurrencyCode,sharedFiltersState:{showFilters:ce,setShowFilters:se,priceMax:de,setPriceMax:pe,priceMin:ue,setPriceMin:ge},openSections:xe,toggleSection:ye}),a?.customizations?.byob?.enableProductCategories&&K&&e.createElement("div",{className:"yt-byob-category-filter-container"},e.createElement(vs,{styles:U,isMobile:v,categories:X,activeCategory:ee,onCategoryChange:e=>{te(e)}}))),e.createElement("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"12px",justifyContent:ce&&"sidebar"===U?.byob?.productFiltersDisplay?"flex-start":"center",width:"100%",height:"fit-content",paddingBottom:p?"100px":"20px"},className:"products-display"},z&&a.personalizedForm?.title?e.createElement(xs,{form:a.personalizedForm,formData:$,setFormData:N,isUploading:B,setIsUploading:F}):0!==Ve?.length||_?We.map((t,n)=>{if("productTier"===Q){const o=(Y[C]?.minimumQuantity??0)>(k[C]?.length??0),r=Be.find(e=>e.productId===t.productId&&(t.variantIds.length<1||e.variantIds.includes(t.variantIds[0])));return r?e.createElement(bs,{bundle:a,idx:n,key:t?.variantIds?.[0]??t.productId,product:r?.productDetails,handleAddToBundle:Re,hideAddToBundle:!o,remainingQuantity:Le-u,themeColor:a?.dealTextColor,handleRemoveItem:e=>Ae(e,C),selecteditems:l,transitionActive:Ie,customVariantsQuantity:be,currentProductTier:Y[C],showFreebieTierProductPrices:a?.customStoreDetails?.showFreebieTierProductPrices,tierIndex:C}):null}return e.createElement(bs,{bundle:a,idx:n,key:t.productId,product:t?.productDetails,handleAddToBundle:Re,hideAddToBundle:u>=Le,remainingQuantity:Le-u,themeColor:a?.dealTextColor,handleRemoveItem:e=>m(e),selecteditems:l,transitionActive:Ie,customVariantsQuantity:be,tierIndex:C})}):e.createElement("div",{className:"yt-byob-empty-state",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",padding:"40px 20px",gap:"16px"}},e.createElement("p",{style:{fontSize:"20px",color:"#333",textAlign:"center",margin:0}},Object.values(oe).length>0?"No products match your filters":"No products found"),Object.values(oe).length>0&&e.createElement("button",{onClick:()=>{re({}),ge(0),pe(Ce)},style:{padding:"8px 16px",background:U?.general?.primaryColor||"#333",color:"white",border:"none",borderRadius:U?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px"}},"Clear All Filters")),!z&&_&&e.createElement("div",{className:"yt-byob-loading-wrapper",style:{width:"100%",display:"flex",justifyContent:"center",padding:"20px"}},e.createElement(me,{color:U?.general?.primaryColor||"#333",size:30})),e.createElement("div",{ref:ne,className:"yt-byob-pagination-observer",style:{height:"1px",width:"100%",display:"block"}},e.createElement("span",null))),!p&&e.createElement(Kc,{builderTiers:a?.builderTiers,showNextStep:D,handleAddToCart:async e=>{if(D)return E(C+1),void _e();const t={};S&&Object.entries($).forEach(([e,n])=>{const o=e.split("|").pop()?.replace(/^f_\d+$/,"")||e;"string"==typeof n&&n.trim()?t[o]=n:n&&"object"==typeof n&&"url"in n&&(t[o]=n.url)}),await s(e,t),Ue()},minimumQuantity:ve,selectedProducts:l,showProductDetailsInTracker:a.showProductDetailsInTracker,handleRemoveItem:m,handleRemoveItemProductTier:Ae,selectedItemsQuantity:u,percentageOff:a.percentageOff,loading:d,bundleSubtotal:g,amountOff:a.amountOff,styles:a.customizations,dealAmount:a.dealAmount,themeColor:a?.dealTextColor??"#333",primaryTextColorCta:a?.primaryTextColorCta??"#fff",cornerRadiusType:a?.cornerRadiusType??"",selectedProductsByTier:k,renderingOnPage:p,isUploading:B}),p&&e.createElement("div",{className:"yt-byob-sticky-tracker-wrapper",style:{width:"100%",marginTop:"20px",position:"sticky",bottom:"10px",zIndex:999}},e.createElement(Kc,{showNextStep:D,handleAddToCart:async e=>{if(D)return E(C+1),void _e();const t={};S&&Object.entries($).forEach(([e,n])=>{const o=e.split("|").pop()?.replace(/^f_\d+$/,"")||e;"string"==typeof n&&n.trim()?t[o]=n:n&&"object"==typeof n&&"url"in n&&(t[o]=n.url)}),await s(e,t),Ue()},minimumQuantity:ve,builderTiers:a?.builderTiers,selectedProducts:l,showProductDetailsInTracker:a.showProductDetailsInTracker,loading:d,handleRemoveItem:m,handleRemoveItemProductTier:Ae,percentageOff:a.percentageOff,selectedItemsQuantity:u??0,bundleSubtotal:g??{price:0,compareAtPrice:0},amountOff:a.amountOff,styles:a.customizations,dealAmount:a.dealAmount,themeColor:U?.general.primaryColor||"#000",primaryTextColorCta:U.general.primaryContrastColor??"#fff",cornerRadiusType:a?.cornerRadiusType??"",selectedProductsByTier:k,renderingOnPage:p,isUploading:B})))),Fe&&void 0!==u&&(()=>{let t=u<a.minimumQuantity;return"productTier"==Q?t=(Y[C]?.minimumQuantity??0)>(k[C]?.length??0):"offerTier"==Q&&(t=u<G.reduce((e,t)=>e+t.minimumQuantity,0)),e.createElement(as,{handleAddToBundle:Re,ref:Pe,remainingQuantity:a.minimumQuantity-u,hideAddToBundle:!t,disableQuantitySelector:a?.disableQuantitySelector??!1,selectedProducts:l,selectedProductsByTier:k,themeColor:U?.general.primaryColor||"#000",primaryTextColorCta:a?.customizations?.general.primaryContrastColor??"#fff",primaryBackgroundColorCta:U?.general.primaryColor||"#000",cornerRadius:a?.customizations.byob.borderRadius,styles:a.customizations,reviewRatingType:a?.reviewRatingType??"none",customVariantsQuantity:be,bundleProductsCustomQuantity:a?.customProductsQuantity,isFreebieTier:Y?.[C]?.isFreebieTier,showFreebieTierProductPrices:a?.customStoreDetails?.showFreebieTierProductPrices,bundleVariantOptions:a?.variantOptions})})()))},Cs=({isOpen:o,onClose:r,formConfig:i,onCheckout:a,cta:l,isMobile:c})=>{const[s,d]=t({}),[p,u]=t(!1);n(()=>{o||d({})},[o]);const m=e=>{if(p)return;const t={};Object.entries(s).forEach(([e,n])=>{const o=e.split("|").pop()?.replace(/^f_\d+$/,"")||e;"string"==typeof n&&n.trim()?t[o]=n:n&&"object"==typeof n&&"url"in n&&(t[o]=n.url)}),a(e?{}:t)};if(!o)return null;const g=e.createElement("div",{onClick:r,style:{position:"fixed",top:0,left:0,right:0,bottom:0,width:"100vw",height:"100vh",background:"rgba(0, 0, 0, 0.4)",zIndex:9999,display:"flex",alignItems:c?"flex-end":"center",justifyContent:"center"}},e.createElement("style",null,"\n @keyframes slideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n @keyframes fadeIn {\n from { opacity: 0; transform: scale(0.95); }\n to { opacity: 1; transform: scale(1); }\n }\n "),e.createElement("div",{onClick:e=>e.stopPropagation(),style:{background:"white",width:c?"100vw":"500px",maxWidth:c?"100vw":"560px",height:c?"80vh":"auto",maxHeight:c?"80vh":"90vh",borderRadius:c?"20px 20px 0 0":"20px",display:"flex",flexDirection:"column",overflow:"hidden",zIndex:999,animation:c?"slideUp 0.3s ease-out":"fadeIn 0.2s ease-out"}},e.createElement("div",{style:{width:"100%",padding:c?"20px 20px 16px":"18px 20px",fontWeight:700,fontSize:c?"18px":"16px",textAlign:"center",position:"relative",borderBottom:"1px solid #eee",flexShrink:0,backgroundColor:"#ffffff",color:"#1a1a1a",boxSizing:"border-box",lineHeight:"1.4"}},i.title||"Personalization",!c&&e.createElement("button",{onClick:r,style:{position:"absolute",right:"16px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",fontSize:"24px",lineHeight:1,cursor:"pointer",color:"#666",padding:"4px"}},"×")),e.createElement("div",{style:{flex:1,overflowY:"auto",padding:c?"20px 20px":"16px 20px"}},e.createElement(xs,{form:i,formData:s,setFormData:d,isUploading:p,setIsUploading:u})),e.createElement("div",{style:{padding:c?"12px 16px":"12px 24px 16px",borderTop:"1px solid #eee",flexShrink:0,background:"white",display:"flex",flexDirection:"column",alignItems:"center",gap:"10px"}},e.createElement("button",{onClick:()=>{m(),r()},disabled:p,style:{width:"100%",fontSize:"15px",fontWeight:700,textAlign:"center",padding:"15px 0",border:"none",borderRadius:"10px",cursor:p?"not-allowed":"pointer",opacity:p?.7:1,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:l.backgroundColor,color:l.textColor,letterSpacing:"0.01em"}},p?e.createElement(me,{color:l.textColor,size:15}):"Submit"),e.createElement("button",{onClick:()=>{m(!0),r()},style:{background:"none",border:"none",fontSize:"14px",fontWeight:600,color:"#1a1a1a",cursor:"pointer",padding:"4px 8px",textAlign:"center"}},"Add without customization"))));return D.createPortal(g,document.body)},Es=({product:t,selectedVariantId:n,onVariantChange:r,styles:i,originalPrice:a,dealPrice:l,totalPriceSum:c,isVertical:s=!1,variantOptions:d,storeCurrencyCode:p})=>{const u=o(()=>e=>{const n=t?.productDetails?.variants?.edges?.find(t=>t.node.id===e),o=n?.node;return o?t.productDetails.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLocaleLowerCase()?1/0:0:1/0:0},[t.productDetails]),m=t?.productDetails?.variants?.edges?.find(e=>e?.node?.id===n)?.node;u(n);const g=o(()=>{if(m?.title&&t.productDetails.options){const e=m.title.split(" / ");if(e.length===t.productDetails.options.length)return e}return t.productDetails.options?.map(e=>e.values[0])||[]},[m,t.productDetails.options]),x=e=>{r(e)};return s?e.createElement("div",{className:"yt-comboBundle-product-card-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",lineHeight:"normal",width:"165px",backgroundColor:"#F6F6F6",borderRadius:"20px",border:"1px solid #B3B3B3",boxShadow:"4px 4px 0px -1px #00000033",overflow:"hidden"}},e.createElement("div",{className:"yt-comboBundle-product-card-image-container-vertical",style:{position:"relative",width:"100%"}},i.comboBundle.subProductsImageVisibility&&e.createElement(e.Fragment,null,e.createElement("img",{className:"yt-comboBundle-product-image-vertical",src:au(m?.image?.url||t?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:t?.productDetails?.featuredMedia?.alt,width:165,height:165,style:{objectFit:"cover",borderRadius:"20px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",height:"100%",aspectRatio:i.general?.imageAspectRatio||"1/1"}}),e.createElement("div",{className:"yt-comboBundle-product-variant-selector-container-vertical",style:{marginTop:"8px",position:"absolute",bottom:"10px",left:"5px",right:"5px"}},t?.productDetails?.variants?.edges?.filter(e=>"Default Title"!==e.node.title)?.length>0&&e.createElement(e.Fragment,null,e.createElement("select",{className:"yt-comboBundle-product-variant-select-vertical",value:n,onChange:e=>x(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",width:"100%",appearance:"none",marginRight:"30px",fontSize:"12px",fontWeight:600}},t?.productDetails?.variants?.edges.map(t=>{const n=u(t?.node?.id);return e.createElement("option",{key:t?.node?.id,value:t?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},t?.node?.title)})),e.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-vertical",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},e.createElement(y,null)))))),(i.comboBundle.subProductsProductTitleVisibility||i.comboBundle.subProductsProductPriceVisibility)&&e.createElement("div",{className:"yt-comboBundle-product-info-container-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"40px",width:"100%",paddingBlock:"5px"}},i.comboBundle.subProductsProductTitleVisibility&&e.createElement("span",{className:"yt-comboBundle-product-title-vertical",style:{fontSize:"12px",color:"#333",fontWeight:"600",lineHeight:"normal",textAlign:"center",width:"fit-content"}},t?.productDetails?.title),i.comboBundle.subProductsProductPriceVisibility&&e.createElement("div",{className:"yt-comboBundle-product-price-container-vertical",style:{display:"flex",alignItems:"center",gap:"8px",lineHeight:"normal",fontSize:"14px"}},e.createElement("span",{className:"yt-comboBundle-product-deal-price-vertical",style:{lineHeight:"normal"}},iu(i.general.currencySymbol,p),ru((Number(m?.price||0)/Number(c)*Number(l)).toFixed(2))),!1!==i.comboBundle.discountBadgeVisibility&&("discount-on-compare"===i.comboBundle.discountBadgeDisplay?e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},iu(i.general.currencySymbol,p),ru(m?.compareAtPrice?m.compareAtPrice:m?.price)):Number(l)<Number(c)&&e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},iu(i.general.currencySymbol,p),ru(m?.price)))))):e.createElement("div",{className:"yt-comboBundle-product-card-horizontal",style:{display:"flex",alignItems:"center",gap:"16px",padding:"4px",lineHeight:"normal",borderRadius:"8px",transition:"background-color 0.3s",width:"100%",border:"1px solid transparent",..."right"===i.comboBundle.infoAlignment&&{flexDirection:"row-reverse"},..."center"===i.comboBundle.infoAlignment&&{justifyContent:"center"}},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#fafafa",e.currentTarget.style.border="1px solid #DFDFDF"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent",e.currentTarget.style.border="1px solid transparent"}},i.comboBundle.subProductsImageVisibility&&e.createElement("div",{className:"yt-comboBundle-product-image-wrapper-horizontal"},e.createElement("img",{className:"yt-comboBundle-product-image-horizontal",src:au(m?.image?.url||t?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:t?.productDetails?.featuredMedia?.alt,height:80,style:{objectFit:"cover",borderRadius:"10px",border:"1px solid #DEDEDE",aspectRatio:"1/1",width:"90px",height:"90px"}})),e.createElement("div",{className:"yt-comboBundle-product-info-horizontal",style:{display:"flex",flexDirection:"column",alignItems:"left"===i.comboBundle?.infoAlignment?"flex-start":"right"===i.comboBundle?.infoAlignment?"flex-end":"center"===i.comboBundle?.infoAlignment?"flex-start":void 0}},i.comboBundle.subProductsProductTitleVisibility&&e.createElement("span",{className:"yt-comboBundle-product-title-horizontal",style:{fontSize:"14px",fontWeight:"600",lineHeight:"normal",display:"flex",alignItems:"center",gap:"8px"}},e.createElement("span",{className:"yt-comboBundle-product-title-text"}," ",t?.productDetails?.title," "),"dropdown"!==i.comboBundle.comboVariantTypeSelector&&t.productDetails.variants.edges.filter(e=>"Default Title"!==e.node.title).length>0&&d&&g&&e.createElement("span",{className:"yt-comboBundle-product-variant-tag-horizontal",style:{fontSize:"10px",color:"#666",backgroundColor:"#F4F4F4",padding:"2px 8px",borderRadius:"10px",border:"1px solid #ddd"}},g.length>1?g.join(" / "):g)),i.comboBundle.subProductsProductPriceVisibility&&e.createElement("div",{className:"yt-comboBundle-product-price-wrapper-horizontal",style:{display:"flex",gap:"8px",marginTop:"5px",alignItems:"baseline"}},e.createElement("span",{className:"yt-comboBundle-product-deal-price-horizontal",style:{lineHeight:"normal"}},iu(i.general.currencySymbol,p),ru((Number(m?.price||0)/Number(c)*Number(l)).toFixed(2))),!1!==i.comboBundle.discountBadgeVisibility&&("discount-on-compare"===i.comboBundle.discountBadgeDisplay?e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},iu(i.general.currencySymbol,p),ru(m?.compareAtPrice?m?.compareAtPrice:m?.price)):Number(l)<Number(c)&&e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},iu(i.general.currencySymbol,p),ru(m?.price)))),t.productDetails.variants.edges.length>1&&("dropdown"===i.comboBundle.comboVariantTypeSelector?e.createElement("div",{className:"yt-comboBundle-product-variant-dropdown-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},e.createElement("select",{className:"yt-comboBundle-product-variant-select-horizontal",value:n,onChange:e=>x(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",fontSize:"12px",fontWeight:600,borderRadius:"4px"}},t.productDetails.variants.edges.map(t=>{const n=u(t?.node?.id);return e.createElement("option",{key:t?.node?.id,value:t?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},t?.node?.title)})),e.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-horizontal",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},e.createElement(y,null))):t.productDetails.options.length>0?e.createElement(e.Fragment,null,t.productDetails.options.map((n,o)=>e.createElement("div",{key:n.name,className:"yt-comboBundle-product-option-group-horizontal",style:{...n?.values?.length>1&&{marginTop:"10px"},display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"}},t.productDetails.options.length>1&&n?.values?.length>1&&e.createElement("label",{className:"yt-comboBundle-product-option-label",style:{fontSize:"12px",fontWeight:"500",color:"#333"}},n.name,":"),n?.values?.length>1&&e.createElement("div",{className:"yt-comboBundle-product-option-values-horizontal",style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"}},n.values.map(r=>{const a=[...g];a[o]=r;const l=t.productDetails.options.length>0?a.join(" / "):a[o],c=t.productDetails.variants.edges.find(e=>e.node.title===l)?.node,s=0===(c?u(c.id):0),p=g[o]===r,m=d&&d?.options?.find(e=>e.name===n.name);return m&&"color"===m?.type?e.createElement("button",{key:r,className:`yt-comboBundle-product-option-button-color ${p?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&x(c.id)},disabled:s,style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:"1px solid transparent",opacity:s?.5:1,cursor:s?"not-allowed":"pointer"}},m?.values.find(e=>e.name===r)?.value?e.createElement("div",{className:"yt-comboBundle-product-option-color-swatch",style:{width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",borderRadius:"50%",backgroundColor:m?.values.find(e=>e.name===r)?.value}},e.createElement("span",null)):e.createElement("span",{key:r,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},r)):m&&"image"===m?.type?e.createElement("button",{key:r,className:`yt-comboBundle-product-option-button-image ${p?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&x(c.id)},disabled:s,style:{border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:p&&!s?"#F7F7F7":"transparent",cursor:s?"not-allowed":"pointer",padding:"0px",width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",overflow:"hidden",opacity:s?.5:1}},m?.values.find(e=>e.name===r)?.value?e.createElement("img",{className:"yt-comboBundle-product-option-image",src:au(m?.values.find(e=>e.name===r)?.value||"/placeholder.svg"),alt:r,style:{width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):e.createElement("span",{key:r,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},r)):e.createElement("button",{key:r,className:`yt-comboBundle-product-option-button-text ${p?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&x(c.id)},disabled:s,style:{padding:"4px 8px",border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",cursor:s?"not-allowed":"pointer",fontSize:"10px",fontWeight:"600",opacity:s?.5:1}},r)}))))):e.createElement(e.Fragment,null,t?.productDetails?.variants?.edges?.length>1&&e.createElement("div",{className:"yt-comboBundle-product-variant-buttons-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},t?.productDetails?.variants?.edges.map(t=>{const o=0===u(t?.node?.id);return e.createElement("button",{key:t?.node?.id,className:`yt-comboBundle-product-variant-button ${n===t?.node?.id?"yt-comboBundle-product-variant-button-selected":""} ${o?"yt-comboBundle-product-variant-button-disabled":""}`,onClick:()=>x(t?.node?.id),disabled:o,style:{padding:"4px 8px",border:n===t?.node?.id?`1px solid ${i.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:n===t?.node?.id?"#F7F7F7":"transparent",color:o?"#ccc":"#707070",cursor:o?"not-allowed":"pointer",fontSize:"12px",fontWeight:"500",opacity:o?.5:1}},t?.node?.title)}))))))},ks=({bundle:r,addToCartFunction:i,dispatchAnalyticsEvent:a})=>{const[l,c]=t(!1),[s,d]=t(window.innerWidth<786),[p,u]=t(!1),m=o(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),o=n?.node;return o?e.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[]),[g,x]=t(()=>{const e={};return r.products.forEach((t,n)=>{const o=t.productDetails?.variants?.edges?.find(e=>m(t.productDetails,e?.node?.id)>0)?.node;e[n]=o?o.id:t?.productDetails?.variants?.edges[0]?.node?.id}),e});n(()=>(i&&(window.ytComboBundle={bundle:r,addToCart:i,selectedVariants:g},window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:window.ytComboBundle}))),()=>{window.ytComboBundle=void 0,window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:void 0}))}),[r,i,g]);const f=r.products?.every((e,t)=>{const n=g[t];return m(e.productDetails,n)>0}),y=(e,t)=>{x(n=>({...n,[e]:t}))},b=async e=>{const t=Object.entries(g).map(([e])=>({id:r.products[parseInt(e)].productId,title:r.products[parseInt(e)]?.productDetails?.title}));a?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:r._id,bundleType:"combo-bundle",selectedProducts:t}});try{if(c(!0),!i)return console.error("[ComboBundle.tsx] No addToCartFunction available"),void c(!1);const t=Object.entries(g).map(([e,t])=>{const n=r.products[parseInt(e)],o=n.productDetails.variants.edges.find(e=>e.node.id===t)?.node;return o?{variantId:t,price:Number(o.price)}:null}).filter(e=>null!==e),n=Object.values(g);await i(Number(h),n,Number(v),t,e)}catch(e){console.error("[ComboBundle.tsx] Error adding to cart:",e)}c(!1)},{originalPrice:h,dealPrice:v,offerValue:w,totalPriceSum:C,offerPercentage:E}=o(()=>{const{price:e,compareAtPrice:t}=Object.entries(g).reduce((e,[t,n])=>{const o=r.products[parseInt(t)],i=o.productDetails.variants.edges?.find(e=>e.node.id===n)?.node,a=parseFloat(i?.price??"0"),l=parseFloat(i?.compareAtPrice||a.toString());return e.price+=a,e.compareAtPrice+=l,e},{price:0,compareAtPrice:0}),n=r?.customizations?.comboBundle?.discountBadgeDisplay,o="discount-on-price"===n?e:t;let i=e;r?.percentageOff?i=e*(1-r.percentageOff/100):r?.dealAmount?i=r.dealAmount:r?.amountOff&&(i=e-r.amountOff);const a=o-i,l=o>0?Math.round((o-i)/o*100):0;return{originalPrice:o.toFixed(2),dealPrice:i.toFixed(2),offerValue:a.toFixed(2),totalPriceSum:e.toFixed(2),offerPercentage:l}},[g,r.products,r.percentageOff,r.dealAmount,r.amountOff,r?.customizations?.comboBundle?.discountBadgeDisplay]);n(()=>{a?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:r._id,bundleType:"combo-bundle"}});const e=()=>{d(window.innerWidth<786)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const k=r.customizations,T=k.comboBundle?.comboCardStyle||"auto",S="vertical"===T||"auto"===T&&!s,$=k.comboBundle?.embedContentVisibility,N="bundles"==r.appName?r.pageHeader?.title:r?.title,B="bundles"==r.appName?r.pageHeader?.description:r?.subtitle;return e.createElement("div",{className:`yt-comboBundle-bundle-container ${"left"===k.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-left":"right"===k.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-right":"center"===k.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-center":void 0}`,style:{lineHeight:"normal",maxWidth:"800px",marginBlock:k.comboBundle?.verticalMargin||"0px",display:"flex",flexDirection:"column",alignItems:"left"===k.comboBundle?.infoAlignment?"flex-start":"right"===k.comboBundle?.infoAlignment?"flex-end":"center"===k.comboBundle?.infoAlignment?"center":void 0,textAlign:k.comboBundle?.infoAlignment??"left",fontFamily:"system-ui, -apple-system, sans-serif"}},$&&k.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&e.createElement("div",{className:"yt-comboBundle-bundle-title-container",style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px"}},e.createElement("h2",{className:"yt-comboBundle-bundle-title",style:{fontSize:k.comboBundle?.productTitleFontSize||"28px",color:k.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},N)),$&&k?.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-comboBundle-bundle-price-container",style:{display:"flex",alignItems:"center",gap:"8px",color:k.comboBundle?.titleTextColor||"#000",fontSize:(parseInt(k.comboBundle?.productTitleFontSize?.replace("px",""))||28)-4+"px"}},e.createElement("div",{className:"yt-comboBundle-bundle-price-details",style:{display:"flex",alignItems:"center",gap:"5px",flexWrap:"wrap"}},e.createElement("span",{className:"yt-comboBundle-bundle-deal-price-text",style:{fontWeight:"bold",lineHeight:"1",minWidth:"fit-content"}},iu(k.general.currencySymbol,r.storeCurrencyCode),ru(v)),!isNaN(Number(h))&&!isNaN(Number(v))&&Number(h)>Number(v)&&e.createElement("div",{className:"yt-comboBundle-bundle-original-price-text",style:{color:k.comboBundle?.titleTextColor||"#666",textDecoration:"line-through",verticalAlign:"middle",display:"inline-block",minWidth:"fit-content"}},iu(k.general.currencySymbol,r.storeCurrencyCode),ru(h)),Number(w)>0&&e.createElement("span",{className:"yt-comboBundle-bundle-offer-badge",style:{backgroundColor:"#D3122A",color:"white",padding:"4px 8px",fontSize:"14px",borderRadius:"20px",fontWeight:"500",lineHeight:"1",minWidth:"fit-content"}},"discount-on-compare"===k.comboBundle.discountBadgeDisplay?`${E}% Off`:r?.percentageOff?`${r?.percentageOff}% Off`:r?.amountOff?`${iu(k.general.currencySymbol,r.storeCurrencyCode)}${ru(r?.amountOff)} Off`:`Save ${iu(k.general.currencySymbol,r.storeCurrencyCode)}${ru(w)}`))),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",margin:"15px 0px"},className:"yt-comboBundle-checkoutSpecific-container"},e.createElement("div",{style:{display:"flex",width:"12px",height:"12px",justifyContent:"center",alignItems:"center",alignContent:"center",borderRadius:"50%",backgroundColor:k.general?.ctaBackgroundColor||"#1e1e1e",flexShrink:0},className:"yt-comboBundle-checkoutSpecific-dot"},e.createElement("span",null)),e.createElement("p",{style:{fontSize:k.comboBundle.productDescriptionFontSize||"16px",color:k.comboBundle?.descriptionTextColor||"#000",alignItems:"center",margin:0,lineHeight:"1.2"},className:"yt-comboBundle-checkoutSpecific-text"},"Tax included. ",e.createElement("u",null,"Shipping")," calculated at checkout."))),k.comboBundle.subProductsSectionVisibility&&e.createElement(e.Fragment,null,S?e.createElement("div",{className:"yt-comboBundle-products-grid-vertical "+(s?"yt-comboBundle-products-grid-mobile":""),style:{display:"flex",flexDirection:"row",gap:"20px",marginTop:"10px",flexWrap:"wrap"}},r.products.map((t,n)=>{const o=t?.productDetails?.variants?.edges?.find(e=>e?.node?.id===g[n])?.node;return o?e.createElement(Es,{key:`combo-product-${n}-${t.productId}`,product:t,styles:k,originalPrice:h,dealPrice:v,totalPriceSum:C,selectedVariantId:g[n],onVariantChange:e=>y(n,e),isVertical:S,variantOptions:r.variantOptions,storeCurrencyCode:r.storeCurrencyCode}):null})):e.createElement("div",{className:"yt-comboBundle-products-list-horizontal "+(s?"yt-comboBundle-products-list-mobile":""),style:{display:"flex",flexDirection:"column",gap:"10px",width:"100%"}},k.comboBundle.subProductsSectionVisibility&&r.products.map((t,n)=>e.createElement(Es,{key:`combo-product-horizontal-${n}-${t.productId}`,product:t,styles:k,originalPrice:h,dealPrice:v,totalPriceSum:C,selectedVariantId:g[n],onVariantChange:e=>y(n,e),variantOptions:r.variantOptions})))),e.createElement("div",{className:"yt-comboBundle-bundle-cta-section",style:{borderTop:"1px solid #eee",display:"flex",flexDirection:"column",rowGap:"5px",marginTop:"20px",width:"100%"}},e.createElement("button",{className:`yt-comboBundle-bundle-cta-button ${f?"":"yt-comboBundle-bundle-cta-button-disabled"} ${s?"yt-comboBundle-bundle-cta-button-mobile":""}`,style:{backgroundColor:f?k.general?.ctaBackgroundColor||"#121212":k.general.disabledButtonColor,color:k.general?.ctaTextColor||"#FFFFFF",fontSize:"16px",borderRadius:k.general.ctaBorderRadius??"20px",fontWeight:"bold",cursor:f?"pointer":"not-allowed",border:`1px solid ${f?k.general?.ctaBackgroundColor||"#121212":k.general.disabledButtonColor}`,boxShadow:k.general.ctaShadowType,padding:k.general?.ctaPadding,width:k.general?.ctaWidth,margin:"0"},disabled:!f,onMouseOver:e=>{k.general.customizeHoverState&&f&&(e.currentTarget.style.backgroundColor=k.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=k.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{k.general.customizeHoverState&&f&&(e.currentTarget.style.backgroundColor=k.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=k.general?.ctaTextColor||"#FFFFFF")},onClick:async()=>{r?.personalizedForm?.title?u(!0):await b()}},l?e.createElement(me,{color:"white",loading:l,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):e.createElement(e.Fragment,null,f?k.comboBundle?.ctaTitle??"Add Bundle to cart":k.general.outOfStockLabel||"Out of Stock"," "))),$&&k.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&e.createElement("div",{className:"yt-comboBundle-bundle-description-section",style:{margin:"20px 0px"}},e.createElement("h4",{className:"yt-comboBundle-bundle-description-header",style:{fontSize:"16px",color:k.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:k.general.primaryColor+"20"}},"Description"),e.createElement("div",{className:"yt-comboBundle-bundle-description-content",style:{fontSize:k.comboBundle.productDescriptionFontSize||"16px",color:k.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:k.general.primaryColor+"08"}},e.createElement("p",null,B))),r?.personalizedForm?.title&&e.createElement(Cs,{isOpen:p,onClose:()=>u(!1),formConfig:r.personalizedForm,onCheckout:async e=>{await b(e),u(!1)},cta:{backgroundColor:k.general?.ctaBackgroundColor||"#121212",textColor:k.general?.ctaTextColor||"#FFFFFF"},isMobile:s}))},Ts=c.div`
3154
+ `;const rs=({options:t,selectedValue:n,onChange:o,type:r="text",isOptionAvailable:i,isMobile:a})=>e.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},t?.map(t=>{const a=!i||i(t.name);return e.createElement("div",{key:t.name,onClick:()=>{a&&o(t)},style:{cursor:a?"pointer":"not-allowed"}},((t,n)=>{const o=!i||i(t.name),a={cursor:o?"pointer":"not-allowed",border:n?"2px solid #333":"1px solid #d1d5db",transition:"all 0.2s ease",opacity:o?1:.5};if("color"===r)return t.value&&(()=>{if(!t.value.trim())return!1;if(t.value===t.name||t.value.length<3)return!1;try{const e=document.createElement("div");return e.style.color=t.value,""!==e.style.color}catch{return!1}})()?e.createElement("div",{style:{...a,width:24,height:24,borderRadius:"50%",backgroundColor:t.value,display:"block"}}):e.createElement("div",{style:{...a,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},t.name);return"image"===r?e.createElement("img",{src:yn(t.value,48,85,"webp")||"/placeholder.svg",alt:t.name,style:{...a,width:24,height:24,borderRadius:"50%",objectFit:"cover"}}):e.createElement("div",{style:{...a,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},t.name)})(t,n?.name===t.name))})),is=({product:r,isOpen:i,onClose:a,variantOptions:l,cta:c,onConfirm:s})=>{const d=o(()=>e=>e?r?.tracksInventory&&e?.inventoryItem?.tracked?e.inventoryQuantity>0?e?.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0,[r?.tracksInventory]),p=o(()=>{const e=r.variants.edges.find(e=>{const t=e.node;return d(t)>0})?.node;return e?.title&&"Default Title"!==e.title?e.title.split(" / "):r.options?.map(e=>e.values[0])||[]},[r,d]),[u,m]=t(p),[g,x]=t(window.innerWidth<1024);n(()=>{const e=()=>x(window.innerWidth<1024);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),n(()=>{const e=e=>{"Escape"===e.key&&a()};return i&&document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[i,a]);const f=r.variants.edges.find(e=>e.node.title===(r.options?.length>0?u.join(" / "):u[0]))?.node,y=f?.image?.url||r.featuredMedia?.preview?.image?.url,b=yn(y,150,85,"webp"),h=e=>{if(!l?.options)return"text";const t=l.options.find(t=>t.name===e);return t?.type||"text"},v=e=>{if(!l?.options)return e.values.map(e=>({name:e,value:e}));const t=l.options.find(t=>t.name===e.name);return e.values.map(e=>{const n=t?.values?.find(t=>t.name===e);return{name:e,value:n?.value||e}})},w=(e,t)=>{const n=u[t];if(!n)return null;return v(e).find(e=>e.name===n)||null};if(!i)return null;const C=e.createElement("div",{onClick:a,style:{position:"fixed",top:0,left:0,right:0,bottom:0,width:"100vw",height:"100vh",background:"rgba(0, 0, 0, 0.4)",zIndex:9999,display:"flex",alignItems:"center",justifyContent:"center"},role:"dialog","aria-modal":"true","aria-labelledby":"yt-variant-options-modal-title"},e.createElement("div",{onClick:e=>e.stopPropagation(),style:{background:"white",borderRadius:16,width:"fit-content",minWidth:350,maxWidth:450,maxHeight:"90vh",overflowY:"auto",position:"relative",zIndex:999,...window.innerWidth<=600&&{width:"90vw",maxWidth:"90vw",minWidth:"90vw"}}},e.createElement("div",{id:"yt-variant-options-modal-title",style:{width:"100%",padding:"16px 0",fontWeight:600,fontSize:14,textTransform:"uppercase",backgroundColor:"rgba(217, 217, 217)",color:"black",textAlign:"center",borderTopLeftRadius:16,borderTopRightRadius:16}},"Select Options"),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 20px",borderBottom:"1px solid #f0f0f0"}},e.createElement("img",{src:b,alt:r.title,style:{width:60,height:60,borderRadius:8,objectFit:"cover",flexShrink:0,transition:"opacity 0.3s ease"}}),e.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,gap:4}},e.createElement("div",{style:{fontSize:14,fontWeight:600,color:"#333"}},r.title))),e.createElement("div",{style:{padding:"20px"}},r.options.map((t,n)=>e.createElement("div",{key:t.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:t?.values?.length>1?16:0}},t?.values?.length>1&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},e.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",t.name),e.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},w(t,n)?.name||t.values[0])),e.createElement(rs,{options:v(t),selectedValue:w(t,n),onChange:e=>{((e,t)=>{const n=[...u];n[e]=t.name,m(n)})(n,e)},type:h(t.name),isOptionAvailable:e=>((e,t)=>{const n=[...u];n[e]=t;const o=r.options?.length>0?n.join(" / "):n[0],i=r.variants.edges.find(e=>e.node.title===o)?.node;return!!i&&d(i)>0})(n,e),isMobile:g}))))),e.createElement("button",{onClick:()=>{const e=r.variants.edges.find(e=>e.node.title===(r.options?.length>0?u.join(" / "):u[0]))?.node,t=!!e&&d(e)>0;if(e?.id&&t)s(e.id),a();else{console.warn("yt::variant options modal - selected variant not available or out of stock:",u);const e=r.variants.edges.find(e=>d(e.node)>0)?.node.id;e&&(s(e),a())}},style:{width:"100%",fontSize:14,fontWeight:600,textTransform:"uppercase",backgroundColor:c.backgroundColor,color:c.textColor,textAlign:"center",padding:"16px 0",border:"none",cursor:"pointer",borderBottomLeftRadius:16,borderBottomRightRadius:16},onMouseEnter:e=>{e.currentTarget.style.opacity="0.9"},onMouseLeave:e=>{e.currentTarget.style.opacity="1"}},"Add to Bundle")));return D.createPortal(C,document.body)},as=l((a,l)=>{const[c,s]=ae(Jc),d=o(()=>e=>{const t=a?.customVariantsQuantity?.find(t=>t.variantId===e?.id)?.quantity;return void 0!==t?t:a?.bundleProductsCustomQuantity?a?.bundleProductsCustomQuantity:e?c?.tracksInventory&&e.inventoryItem?.tracked?e.inventoryQuantity>0?e.inventoryQuantity:e.inventoryQuantity<=0&&"continue"===e.inventoryPolicy?.toLocaleLowerCase()?1/0:0:1/0:0},[c?.tracksInventory,a?.customVariantsQuantity,a?.bundleProductsCustomQuantity]),p=c?.variants.edges?.filter(e=>d(e.node)>0)||[],[u,m]=t(p?.[0]?.node),[g,x]=t(0),[f,y]=t("undefined"!=typeof window&&window.innerWidth<=600),[b,h]=t(1),[v,w]=t("idle"),C=r(null),E=r(null),k=r(!1),[T,S]=t(0),[$,N]=t(),B=o(()=>{const e=c?.variants.edges.find(e=>{const t=e.node;return d(t)>0})?.node;return e?.title&&"Default Title"!==e.title?e.title.split(" / "):c?.options?.map(e=>e.values[0])||[]},[c,d]),[F,z]=t(B);n(()=>{if(c){const e=c.variants.edges?.filter(e=>d(e.node)>0),t=c?.selectedVariant??e[0]?.node;m(t),t?.title&&"Default Title"!==t.title&&z(t.title.split(" / "))}},[c,d]),n(()=>{const e=a.selectedProducts.find(e=>e.variantId===u?.id);h(e?e.quantity:0)},[b,a.selectedProducts,u]),n(()=>{if(E.current&&-1!==g&&k.current){const e=E.current.children;e[g]&&e[g].scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"}),k.current=!1}},[g]);if(n(()=>{const e=()=>y(window.innerWidth<=600);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),!c)return null;const{title:I,descriptionHtml:P,media:A,variants:_}=c,R=A.edges.map(e=>e?.node.preview.image??e?.node.image).filter(e=>e?.url?.length>0),L=i(e=>{const t=e.target.value,n=p?.find(e=>e.node.id===t)?.node;n&&d(n)>0&&(k.current=!0,m(n),N(n?.image?.url),n.title&&"Default Title"!==n.title&&z(n.title.split(" / ")))},[p,d]),O=i(e=>{if(!a.bundleVariantOptions?.options)return"text";const t=a.bundleVariantOptions?.options.find(t=>t.name===e);return t?.type||"text"},[a.bundleVariantOptions]),M=i(e=>{if(!a?.bundleVariantOptions?.options)return e.values.map(e=>({name:e,value:e}));const t=a?.bundleVariantOptions?.options.find(t=>t.name===e.name);return e.values.map(e=>{const n=t?.values?.find(t=>t.name===e);return{name:e,value:n?.value||e}})},[a.bundleVariantOptions]),W=i((e,t)=>{const n=[...F];n[e]=t.name,z(n);const o=c?.options?.length>0?n.join(" / "):n[0],r=c?.variants.edges.find(e=>e.node.title===o)?.node;N(r?.image?.url),r&&d(r)>0&&(k.current=!0,m(r))},[F,c,d]),V=i((e,t)=>{const n=F[t];if(!n)return null;return M(e).find(e=>e.name===n)||null},[F,M]),j=i((e,t)=>{const n=[...F];n[e]=t;const o=c?.options?.length>0?n.join(" / "):n[0],r=c?.variants.edges.find(e=>e.node.title===o)?.node;return!!r&&d(r)>0},[F,c,d]);n(()=>{if(c){document.body.style.overflow="hidden",window.history.pushState({modalOpen:!0},"",window.location.href);const e=e=>{s(void 0),e.preventDefault()};return window.addEventListener("popstate",e),()=>{document.body.style.overflow="unset",window.removeEventListener("popstate",e),window.history.state?.modalOpen&&window.history.back()}}},[c,s]),n(()=>{if(f&&c&&C.current){const e=()=>{C.current&&S(C.current.offsetHeight)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}},[f,c]);const H=a.selectedProducts.filter(e=>e.variantId===u?.id).reduce((e,t)=>e+t.quantity,0),q=a.customVariantsQuantity?.find(e=>e.variantId===u?.id)?.quantity??a.bundleProductsCustomQuantity??1/0,Q=q!==1/0&&H>=q,U=a.hideAddToBundle||!u||d(u)<=0||Q||"idle"!==v||a?.disableQuantitySelector&&1===b,G=({className:t})=>{const n=c?.rating?.averageRating??a?.rating?.averageRating??0,o=c?.rating?.ratingCount??a?.rating?.ratingCount??0;return n<=0?null:e.createElement(e.Fragment,null,"ratingOnly"===a.reviewRatingType&&e.createElement("div",{className:t,style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Be,{color:"gold",size:14}),e.createElement("span",{style:{marginLeft:6}},n," rating")),"ratingAndReviewCount"===a.reviewRatingType&&e.createElement("div",{className:t,style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Be,{color:"gold",size:14}),n,e.createElement(Ce,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}}),"(",o," reviews)"))},X=({isMobile:t})=>e.createElement(e.Fragment,null,e.createElement("div",{style:{position:t?"relative":void 0}},t?e.createElement("div",{ref:E,style:{display:"flex",flexDirection:"row",overflowX:"auto",WebkitOverflowScrolling:"touch",scrollSnapType:"x mandatory",scrollbarWidth:"none",msOverflowStyle:"none"}},R.length>0&&R.map((t,n)=>e.createElement("div",{key:n,style:{width:"100%",flex:"0 0 auto",scrollSnapAlign:"center",objectFit:"contain",maxHeight:"50vh",zIndex:999}},e.createElement(xt,{small:au(t?.url),medium:au(t?.url),large:au(t?.url),alt:t.altText||`${I} - Image ${n+1}`,hideDownload:!0,imageBackgroundColor:"#000",className:"yt-byob-modal-desktop-main-image"})))):e.createElement(e.Fragment,null,e.createElement(xt,{small:au($??"")||au(R[g]?.url),medium:au($??"")||au(R[g]?.url),large:au($??"")||au(R[g]?.url),hideDownload:!0,imageBackgroundColor:"#000",className:"yt-byob-modal-desktop-main-image main-image"}),e.createElement("div",{style:{display:"flex",flexDirection:"row",overflowX:"auto",gap:t?"8px":"12px",padding:"12px 0",WebkitOverflowScrolling:"touch",scrollSnapType:"x mandatory",scrollbarWidth:"none",msOverflowStyle:"none"}},R.length>1&&R.filter(e=>e?.url?.length>0).map((n,o)=>e.createElement("img",{key:o,src:au(n?.url),alt:n.altText||`${I} - Image ${o+1}`,onClick:()=>x(o),style:{width:t?"60px":"73px",height:t?"60px":"73px",flex:"0 0 auto",scrollSnapAlign:"center",borderRadius:"7px",border:g===o?`2px solid ${a.themeColor||"#111"}`:"1px solid lightgray",objectFit:"cover",cursor:"pointer"},loading:"lazy"})))))),Z=({className:t})=>c?.variants?.edges?.length<=1?null:e.createElement("div",{className:t},e.createElement("div",{className:`${t}-label`,style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",marginBottom:"10px"}},e.createElement("span",{style:{flexShrink:0}},c.options[0].name," :"," ",e.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},u?.title)),e.createElement("select",{className:`${t}-select`,value:u?.id||"",onChange:L,style:{appearance:"none",border:"none",background:"transparent",fontWeight:"bold",color:"#000",cursor:"pointer",paddingRight:"20px",position:"absolute",right:0,top:0,bottom:0,width:"100%",opacity:0,zIndex:2}},c?.variants?.edges?.map(({node:t})=>e.createElement("option",{key:t.id,value:t.id,disabled:0===d(t)},t.title))),e.createElement("span",{className:`${t}-chevron`,style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},e.createElement(Ke,null)))),K=({isMobile:t})=>e.createElement(e.Fragment,null,c.options.map((n,o)=>e.createElement("div",{key:n.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:n?.values?.length>1?16:0}},n?.values?.length>1&&e.createElement(e.Fragment,null,e.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},e.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",n.name),e.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},F[o]||n.values[0])),e.createElement(rs,{options:M(n),selectedValue:V(n,o),onChange:e=>{W(o,e)},type:O(n.name),isOptionAvailable:e=>j(o,e),isMobile:t}))))),J=({isMobile:t})=>e.createElement("div",{className:t?"yt-byob-modal-mobile-price":"yt-byob-modal-desktop-price",style:{width:"fit-content",minWidth:"fit-content",paddingRight:"10px",display:"flex",flexDirection:"row",alignItems:t?"center":"baseline",gap:"6px"}},a?.isFreebieTier&&!a.showFreebieTierProductPrices?e.createElement(e.Fragment,null,e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"20px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},iu(a.styles.general.currencySymbol,a.styles.general.currencySymbol),ru(u?.price)),e.createElement("span",{className:"yt-byob-current-price",style:{color:a.styles.general.primaryColor||"#d32f2f",fontWeight:"bold",fontSize:"20px"}},"FREE")):e.createElement(e.Fragment,null,u?.compareAtPrice&&parseFloat(u.compareAtPrice)>parseFloat(u?.price)&&e.createElement("div",{className:t?"yt-byob-modal-mobile-compare-price":"yt-byob-modal-desktop-compare-price",style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},iu(a.styles.general.currencySymbol,a.styles.general.currencySymbol),ru(u?.compareAtPrice)),e.createElement("div",{className:t?"yt-byob-modal-mobile-current-price":"yt-byob-modal-desktop-current-price"},e.createElement("span",{style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},iu(a.styles.general.currencySymbol,a.styles.general.currencySymbol),ru(u?.price))))),ee=({isMobile:t})=>e.createElement("div",{className:t?"yt-byob-modal-mobile-atc-wrapper":"yt-byob-modal-desktop-atc-wrapper yt-product-modal-atc-wrapper",style:{width:t?"100%":"80%"}},e.createElement("button",{className:t?"yt-byob-modal-mobile-atc-button":"yt-byob-modal-desktop-atc-button yt-product-modal-atc-button",style:{textTransform:"uppercase",fontWeight:"800",width:"100%",border:"none",backgroundColor:a.themeColor||"#111",borderRadius:a.cornerRadius,color:a.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden",opacity:U?.5:1,cursor:U?"not-allowed":"pointer"},onClick:e=>{e.stopPropagation(),e.preventDefault(),u?.id&&c&&(w("check"),a.handleAddToBundle(u?.id,c,1),setTimeout(()=>{w("idle"),s(void 0)},500))},disabled:U},a.styles.byob.addToBundleCTAText??"Add to bundle")),te=e.createElement(ts,{className:"yt-byob-modal-desktop-overlay"},e.createElement(ns,{$isSmallScreen:f,ref:l},e.createElement(os,{ref:l,className:"yt-byob-modal-desktop-container yt-variant-selection-modal"},e.createElement("div",{className:"yt-byob-modal-desktop yt-variant-selection-modal "+(f?"small-screen":"large-screen")},e.createElement(es,{className:"yt-byob-modal-desktop-close",onClick:()=>{s(void 0)},style:{backgroundColor:"white"}},e.createElement(Y,{size:"25"})),e.createElement("div",{className:"yt-byob-modal-desktop-image-section image-section"},e.createElement(X,null)),e.createElement("div",{className:"yt-byob-modal-desktop-details-section details-section",style:{marginLeft:"20px",minHeight:"100%",maxHeight:"70vh",scrollbarWidth:"none",overflowY:"auto",display:"flex",flexDirection:"column"}},e.createElement("h2",{className:"yt-byob-modal-desktop-title"},"variant-display-name"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.displayName:"variant-title"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.title:c?.title),e.createElement(G,{className:"yt-byob-modal-desktop-rating"}),e.createElement("div",{className:"yt-byob-modal-desktop-variant-price-wrapper",style:{display:"flex",flexDirection:"column",gap:"2px",marginTop:"20px"}},"dropdown"===a?.styles?.byob.variantSelectorType&&e.createElement(Z,{className:"yt-byob-modal-desktop-variant-selector"}),"customOptions"===a?.styles?.byob.variantSelectorType&&e.createElement(K,null),e.createElement("div",{className:"yt-byob-modal-desktop-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},e.createElement(J,{isMobile:!1}),e.createElement(ee,{isMobile:!1}))),e.createElement("div",{className:"yt-byob-modal-desktop-divider",style:{height:"10px",minHeight:"10px",border:"none",backgroundColor:"#D9D9D96B",margin:"20px 0 10px 0",display:"block !important"}},e.createElement("span",null)),e.createElement("span",{className:"yt-byob-modal-desktop-description yt-description-content",style:{scrollBehavior:"smooth"},dangerouslySetInnerHTML:{__html:P}})))))),ne=e.createElement(ts,{className:"yt-byob-modal-mobile-overlay"},e.createElement(ns,{className:"yt-byob-modal-mobile-content",style:{padding:"0px",position:"relative"},$isSmallScreen:f,ref:l},e.createElement(os,{ref:l,className:"yt-byob-modal-mobile-container yt-variant-selection-modal"},e.createElement("button",{className:"yt-byob-modal-mobile-close-btn",style:{position:"fixed",top:"20px",right:"20px",zIndex:9999999999,backgroundColor:"#FFFFFF",padding:"4px",borderRadius:"50%",border:"1px solid lightgray",display:"flex",justifyContent:"center",alignItems:"center"},onClick:()=>{s(void 0)}},e.createElement(Ze,{className:"yt-byob-modal-mobile-close-icon",style:{height:"22px",width:"22px",padding:"4px",color:"black"},onMouseEnter:e=>e.currentTarget.style.color="black"})),e.createElement("div",{className:"yt-byob-modal-mobile yt-variant-selection-modal small-screen",style:{padding:"0px"}},e.createElement("div",{className:"yt-byob-modal-mobile-image-section image-section"},e.createElement(X,{isMobile:!0})),e.createElement("div",{className:"yt-byob-modal-mobile-details-section details-section",style:{padding:"0 30px",margin:"15px 0",paddingBottom:T?`${T+20}px`:"120px"}},e.createElement("h2",{className:"yt-byob-modal-mobile-title",style:{margin:"0px"}},"variant-display-name"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.displayName:"variant-title"===a?.styles?.byob?.productVariantTitleType?c?.selectedVariant?.title:c?.title),e.createElement("div",{style:{paddingBlockStart:"10px"}},e.createElement(G,{className:"yt-byob-modal-mobile-rating"})),e.createElement("div",{className:"yt-byob-modal-mobile-divider",style:{opacity:"0.2",border:"none",height:"2px",backgroundColor:"#000000",margin:"10px 0px",display:"block !important"}},e.createElement("span",null)),e.createElement("div",{className:"yt-byob-modal-mobile-description yt-description-content",style:{scrollbarWidth:"none",scrollBehavior:"smooth",margin:"0px"},dangerouslySetInnerHTML:{__html:P}})))),e.createElement("div",{className:"yt-byob-modal-mobile-bottom-bar",ref:C,style:{position:"fixed",bottom:"0px",left:"0px",right:"0px",padding:"12px 15px",borderTop:"1px solid lightgray",boxShadow:"0px -4px 5px rgba(0, 0, 0, 0.1)",backgroundColor:"#fff",display:"flex",flexDirection:"column",gap:"2px",zIndex:9999999999}},"customOptions"===a?.styles?.byob.variantSelectorType?e.createElement(K,{isMobile:!0}):e.createElement(Z,{className:"yt-byob-modal-desktop-variant-selector"}),e.createElement("div",{className:"yt-byob-modal-mobile-price-atc-wrapper",style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},e.createElement(J,{isMobile:!0}),e.createElement(ee,{isMobile:!0})))));return D.createPortal(f?ne:te,document.body)}),ls=({coverImageUrl:t,mobileCoverImageUrl:n,alt:o="Background",styles:r})=>{const i=[{imageWidth:21,descriptor:36},{imageWidth:48,descriptor:80},{imageWidth:99,descriptor:165},{imageWidth:216,descriptor:360},{imageWidth:225,descriptor:375},{imageWidth:319,descriptor:533},{imageWidth:330,descriptor:550},{imageWidth:432,descriptor:720},{imageWidth:564,descriptor:940},{imageWidth:639,descriptor:1066},{imageWidth:648,descriptor:1080},{imageWidth:900,descriptor:1500},{imageWidth:1068,descriptor:1780},{imageWidth:1296,descriptor:2160}],a=(e,t)=>{if(e&&e.includes("cdn.shopify"))try{const n=new URL(e),o=n.searchParams;return o.has("format")||o.set("format","webp"),o.has("quality")||o.set("quality","80"),o.set("width",t.toString()),n.toString()}catch{const n=e.includes("?")?"&":"?";return`${e}${n}format=webp&quality=80&width=${t}`}},l=e=>e?i.map(({imageWidth:t,descriptor:n})=>{const o=a(e,t);return o?`${o} ${n}w`:""}).filter(Boolean).join(", "):"";if(!t&&!n)return null;const c=t||n||"",s=a(c,800)||c,d=[];if(n&&n!==t){const t=l(n);t&&d.push(e.createElement("source",{key:"mobile",media:"(max-width: 768px)",srcSet:t}))}if(t){const n=l(t);n&&(d.length>0?d.push(e.createElement("source",{key:"desktop",media:"(min-width: 769px)",srcSet:n})):d.push(e.createElement("source",{key:"desktop",srcSet:n})))}else if(n){const t=l(n);t&&d.push(e.createElement("source",{key:"mobile",srcSet:t}))}return e.createElement("div",{style:{width:"100%",display:"block"}},e.createElement("picture",{style:{display:"block",width:"100%"}},d,e.createElement("img",{src:s,alt:o,style:{width:"100%",height:"auto",display:"block",...r},loading:"eager",fetchPriority:"high",sizes:"100vw"})))},cs=({title:t,isOpen:n,onToggle:o,children:r})=>e.createElement("div",{className:"yt-byob-filter-section",style:{borderBottom:"1px solid #eee",paddingBottom:n?"20px":"12px",marginBottom:"12px"}},e.createElement("div",{className:"yt-byob-filter-section-header",onClick:o,style:{display:"flex",justifyContent:"space-between",alignItems:"center",cursor:"pointer",padding:"8px 0"}},e.createElement("span",{className:"yt-byob-filter-section-title",style:{fontSize:"16px",fontWeight:500,color:"#111"}},t),n?e.createElement(Oe,{className:"yt-byob-icon-minus",size:20}):e.createElement(Ae,{className:"yt-byob-icon-plus",size:20})),n&&e.createElement("div",{className:"yt-byob-filter-section-body",style:{marginTop:"16px"}},r)),ss=({availableFilters:n,appliedFilters:o,toggleFilter:r,clearAllFilters:i,applyPriceFilter:a,priceMin:l,setPriceMin:c,priceMax:s,setPriceMax:d,maxPossiblePrice:p,styles:u,availableProductCount:m,products:g,unavailableProductCount:x,storeCurrencyCode:f,showActions:y=!0,openSections:b,toggleSection:h})=>{const[v,w]=t(null),C=iu(u?.general?.currencySymbol,f)??f??"USD";return e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-filters-content-wrapper",style:{overflowY:"auto",scrollbarWidth:"none",padding:"20px",flex:1,minHeight:0,overscrollBehavior:"contain"}},n.map(t=>e.createElement(cs,{key:t.id,title:t.label,isOpen:!!b[t.id],onToggle:()=>h(t.id)},"LIST"===t.type&&e.createElement("div",{className:"yt-byob-filter-list",style:{display:"flex",flexDirection:"column",gap:"14px"}},t.values.map(n=>{const i=o[t.id]?.includes(n.id)||!1;return"filter.v.availability.1"===n.id?m??g.length:"filter.v.availability.0"===n.id||n.count,e.createElement("label",{key:n.id,className:"yt-byob-filter-item-label",style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:"pointer"}},e.createElement("div",{className:"yt-byob-filter-item-left",style:{display:"flex",alignItems:"center",gap:"10px"}},e.createElement("input",{className:"yt-byob-filter-checkbox",type:"checkbox",checked:i,onChange:()=>r(t.id,n.id),style:{width:"18px",height:"18px",accentColor:u?.general?.primaryColor||"#333",cursor:"pointer"}}),e.createElement("span",{className:"yt-byob-filter-item-text",style:{fontSize:"15px",color:"#333"}},n.label)))})),"PRICE_RANGE"===t.type&&e.createElement("div",{className:"yt-byob-price-filter",style:{padding:"0 4px"}},e.createElement("div",{className:"yt-byob-price-range-display",style:{fontSize:"15px",color:"#333",marginBottom:"24px",fontWeight:500}},C,l.toLocaleString()," – ",C,s.toLocaleString()),e.createElement("div",{className:"yt-byob-price-slider-container",style:{position:"relative",width:"100%",height:"4px",background:"#e5e7eb",borderRadius:"4px",marginBottom:"10px"}},e.createElement("div",{className:"yt-byob-price-slider-track",style:{position:"absolute",height:"100%",background:"#333",borderRadius:"4px",left:l/p*100+"%",right:100-s/p*100+"%"}}),e.createElement("input",{type:"range",min:0,max:p,value:l,onMouseDown:()=>w("min"),onTouchStart:()=>w("min"),onChange:e=>{const t=Math.min(Number(e.target.value),s-10);c(t)},style:{position:"absolute",width:"100%",height:"0px",top:"50%",transform:"translateY(-50%)",background:"none",pointerEvents:"none",appearance:"none",WebkitAppearance:"none",zIndex:"min"===v?11:5,margin:0},className:"yt-byob-dual-range-input-min"}),e.createElement("input",{type:"range",min:0,max:p,value:s,onMouseDown:()=>w("max"),onTouchStart:()=>w("max"),onChange:e=>{const t=Math.max(Number(e.target.value),l+10);d(t)},style:{position:"absolute",width:"100%",height:"0px",top:"50%",transform:"translateY(-50%)",background:"none",pointerEvents:"none",appearance:"none",WebkitAppearance:"none",zIndex:"max"===v?11:4,margin:0},className:"yt-byob-dual-range-input-max"})),e.createElement("style",null,"\n .yt-byob-dual-range-input-min::-webkit-slider-thumb,\n .yt-byob-dual-range-input-max::-webkit-slider-thumb {\n pointer-events: auto;\n appearance: none;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: #444;\n border: 3px solid white;\n cursor: pointer;\n box-shadow: 0 2px 5px rgba(0,0,0,0.2);\n position: relative;\n z-index: 20;\n }\n .yt-byob-dual-range-input-min::-moz-range-thumb,\n .yt-byob-dual-range-input-max::-moz-range-thumb {\n pointer-events: auto;\n width: 22px;\n height: 22px;\n border-radius: 50%;\n background: #444;\n border: 3px solid white;\n cursor: pointer;\n box-shadow: 0 2px 5px rgba(0,0,0,0.2);\n position: relative;\n z-index: 20;\n }\n "))))),y&&e.createElement("div",{className:"yt-byob-filter-actions",style:{display:"flex",gap:"12px",borderTop:"1px solid #eee",padding:"16px 0px",position:"sticky",bottom:"2px",paddingInline:"10px"}},e.createElement("button",{className:"yt-byob-filter-clear-button",onClick:i,style:{flex:1,padding:"8px",background:"#f3f4f6",border:"none",borderRadius:u?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px",color:"#333",fontFamily:"inherit"}},"Clear All"),e.createElement("button",{className:"yt-byob-filter-apply-button",onClick:a,style:{flex:1,padding:"8px",background:u?.general?.primaryColor||"#333",color:"white",border:"none",borderRadius:u?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px",fontFamily:"inherit"}},"Apply")))},ds=t=>{const{showFiltersDrawer:n,handleClose:o,isAnimating:r,isMobile:i}=t;return n?P(e.createElement("div",{className:"yt-byob-filter-drawer-overlay",style:{position:"fixed",inset:0,background:"rgba(0,0,0,0.5)",zIndex:1e3,display:"flex",justifyContent:"flex-end",opacity:r?1:0,transition:"opacity 300ms ease-in-out"},onClick:o},e.createElement("div",{className:"yt-byob-filter-drawer-content",style:{width:i?"85%":"380px",height:"100%",background:"white",boxShadow:"-4px 0 12px rgba(0,0,0,0.15)",transform:r?"translateX(0)":"translateX(100%)",transition:"transform 300ms ease-in-out",display:"flex",flexDirection:"column",position:"relative"},onClick:e=>e.stopPropagation()},e.createElement(ss,{...t,applyPriceFilter:()=>{t.applyPriceFilter(),o()},openSections:t.openSections||{},toggleSection:t.toggleSection||(()=>{})}))),document.body):null},ps=t=>{const{showFiltersDrawer:n}=t;return n&&0!==t?.availableFilters?.length?e.createElement("div",{className:"yt-byob-filters-sidebar",style:{width:"280px",minWidth:"280px",padding:"0",height:"auto",maxHeight:"calc(100vh - 40px)",position:"sticky",top:"20px",display:"flex",flexDirection:"column",borderRight:"1px solid #eee",marginRight:"20px"}},e.createElement(ss,{...t,showActions:!0,openSections:t.openSections||{},toggleSection:t.toggleSection||(()=>{})})):null},us=({enableSortAndFilter:o,isMobile:r,setSearchTerm:i,searchTerm:a,styles:l,setSortBy:c,appliedFilters:s,setAppliedFilters:d,availableFilters:p=[],products:u,availableProductCount:m,unavailableProductCount:g,maxPossiblePrice:x,storeCurrencyCode:f,sharedFiltersState:b,openSections:h,toggleSection:v,sortBy:w})=>{const[C,E]=t(!1),[k,T]=t(a),{showFilters:S,setShowFilters:$,priceMax:N,setPriceMax:B,priceMin:F,setPriceMin:z}=b,[I,D]=t(!1),P=l?.byob?.productFiltersDisplay||"drawer",A=!r&&"sidebar"===P,_="none"===P;n(()=>{s["filter.v.price"]||(B(x),z(0))},[x,s]);n(()=>{const e=setTimeout(()=>{i(k)},300);return()=>clearTimeout(e)},[k,i]),n(()=>(S&&!A?(document.body.style.overflow="hidden",D(!0)):(document.body.style.overflow="",D(!1)),()=>{document.body.style.overflow=""}),[S,A]);const R=Object.entries(s).reduce((e,[t,n])=>"filter.v.price"===t?F>0||N<x?e+1:e:e+(n?n.length:0),0);return e.createElement("div",{className:"yt-byob-sort-filter-container",style:{display:"flex",flexDirection:r?"column":"row",justifyContent:"space-between",alignItems:r?"flex-end":"center",marginBottom:"20px",width:"100%",gap:r?"10px":"0"}},e.createElement("div",{className:"yt-byob-search-filter-controls",style:{display:"flex",flexDirection:o?"row-reverse":"row",justifyContent:"space-between",alignItems:C?void 0:"center",gap:"12px",width:"100%"}},o&&e.createElement("div",{className:"yt-byob-search-wrapper",style:{position:"relative",display:"flex",alignItems:"center",width:r?C?"100%":"auto":"400px",transition:"width 0.3s ease-in-out"}},r&&!C?e.createElement(_e,{className:"yt-byob-search-icon-trigger",fontSize:"20px",color:"#555",style:{cursor:"pointer"},onClick:()=>E(!0)}):e.createElement(e.Fragment,null,e.createElement("input",{className:"yt-byob-search-input",style:{width:"100%",padding:r?"10px 12px":"10px 14px",fontSize:"14px",outline:"none",color:"#333",border:"1px solid #c7c7c7",borderRadius:l?.byob.borderRadius,boxShadow:l?.byob.borderColor?"0 2px 4px rgba(0,0,0,0.1)":"none"},placeholder:"Search by Product Name",value:k,onChange:e=>T(e.target.value)}),!C&&e.createElement(_e,{className:"yt-byob-search-icon",fontSize:"18px",style:{position:"absolute",right:"12px",color:"#aaa",pointerEvents:"none"}})),r&&C&&e.createElement("span",{className:"yt-byob-search-close",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",cursor:"pointer"},onClick:()=>E(!1)},"X")),e.createElement("div",{className:"yt-byob-actions-wrapper",style:{display:"flex",flexDirection:"row",gap:"10px"}},p?.length>0&&e.createElement("button",{className:"yt-byob-filter-toggle-button",onClick:()=>$(!S),style:{display:_?"none":"flex",alignItems:"center",gap:r?"0px":"6px",background:S&&A?"#f3f4f6":"white",cursor:"pointer",fontSize:"14px",color:"#333",whiteSpace:"nowrap",border:"1px solid #d1d5db",padding:"8px 12px",borderRadius:l?.byob.borderRadius,boxShadow:"0 2px 4px rgba(0,0,0,0.1)"}},e.createElement(Re,{className:"yt-byob-filter-toggle-icon",size:18}),!r&&"Filters",R>0&&e.createElement("span",{className:"yt-byob-active-filter-badge",style:{background:l?.general?.primaryColor||"#ef4444",color:"white",borderRadius:"999px",padding:"2px 8px",fontSize:"12px",lineHeight:1}},R)),o&&e.createElement("div",{className:"yt-byob-sort-wrapper",style:{display:"flex",alignItems:"center",border:"1px solid #d1d5db",padding:"8px 12px",borderRadius:l?.byob.borderRadius,boxShadow:"0 2px 4px rgba(0,0,0,0.1)",position:"relative"}},!r&&e.createElement("span",{className:"yt-byob-sort-label",style:{fontSize:"14px",color:"#555",marginRight:"6px"}},"Sort:"),r&&e.createElement(Le,{className:"yt-byob-sort-icon",size:18,style:{color:"#555"}}),e.createElement("select",{className:"yt-byob-sort-select",style:{border:"none",background:"transparent",fontSize:"14px",color:"#333",cursor:"pointer",outline:"none",appearance:"none",WebkitAppearance:"none",paddingRight:"20px"},value:w,onChange:e=>c(e.target.value)},e.createElement("option",{className:"yt-byob-sort-option",value:""},"Featured"),e.createElement("option",{className:"yt-byob-sort-option",value:"price-low-to-high"},"Price: Low to High"),e.createElement("option",{className:"yt-byob-sort-option",value:"price-high-to-low"},"Price: High to Low"),e.createElement("option",{className:"yt-byob-sort-option",value:"title-asc"},"Alphabetical: A-Z"),e.createElement("option",{className:"yt-byob-sort-option",value:"title-desc"},"Alphabetical: Z-A")),e.createElement(y,{className:"yt-byob-sort-chevron",size:14,style:{position:"absolute",right:"10px",pointerEvents:"none",color:"#555"}})))),!A&&!_&&e.createElement(ds,{showFiltersDrawer:S,handleClose:()=>{A?$(!1):(document.body.style.overflow="",D(!1),setTimeout(()=>{$(!1)},300))},isAnimating:I,isMobile:r,availableFilters:p,appliedFilters:s,toggleFilter:(e,t)=>{d(n=>{const o=n[e]||[],r=o.includes(t)?o.filter(e=>e!==t):[...o,t],i={...n,[e]:r.length?r:void 0};return Object.fromEntries(Object.entries(i).filter(([,e])=>void 0!==e))})},clearAllFilters:()=>{B(x),z(0),d({})},applyPriceFilter:()=>{d(e=>{const t={...e};return t["filter.v.price"]=[`min:${F}-max:${N}`],t})},priceMin:F,setPriceMin:z,priceMax:N,setPriceMax:B,maxPossiblePrice:x,styles:l,availableProductCount:m,products:u,unavailableProductCount:g,storeCurrencyCode:f,openSections:h,toggleSection:v}))},ms=()=>e.createElement(e.Fragment,null,e.createElement("style",null,"@keyframes spin { to { transform: rotate(360deg); } }"),e.createElement("div",{className:"yt-collection-bundle-loader-spinner",style:{width:"14px",height:"14px",border:"2px solid #f3f3f3",borderTop:"2px solid #007bff",borderRadius:"50%",animation:"spin 1s linear infinite",display:"block"}})),gs=({title:t,uploadState:n,onUpload:o,onRemove:r,onRetry:i})=>{const a="string"==typeof n?{url:n,name:"Attachment"}:n,l=a?.loading,c=a?.error,s=a?.url;return e.createElement("div",{className:"yt-personalization-upload-field",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 16px",border:"1px dashed #ccc",borderRadius:"10px",background:"#fff",gap:"12px"}},e.createElement("div",{style:{flex:1,minWidth:0}},e.createElement("div",{style:{fontWeight:600,fontSize:"14px",color:"#1a1a1a"}},t),!a&&!l&&!c&&e.createElement("div",{style:{fontSize:"12px",color:"#888",marginTop:"2px"}},"jpeg/png/img (max size: 5MB)"),l&&e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"6px",color:"#007bff",fontSize:"12px",marginTop:"4px"}},e.createElement(ms,null)," Uploading ",a?.name||"image","..."),c&&e.createElement("div",{style:{fontSize:"12px",color:"#dc3545",marginTop:"2px"}},"Upload failed."),s&&!l&&!c&&e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"6px"}},e.createElement("img",{src:a.url,alt:"Uploaded",style:{width:"36px",height:"36px",objectFit:"cover",borderRadius:"4px",border:"1px solid #eee"}}),e.createElement("span",{style:{fontSize:"12px",color:"#28a745",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},a.name))),e.createElement("div",{style:{flexShrink:0}},c&&e.createElement("button",{type:"button",onClick:i,style:{fontSize:"13px",fontWeight:600,color:"#303030",background:"white",border:"1.5px solid #E3E3E3",borderRadius:"10px",padding:"8px 16px",cursor:"pointer",whiteSpace:"nowrap"}},"Retry"),s&&!l&&!c&&e.createElement("button",{type:"button",onClick:r,style:{fontSize:"13px",fontWeight:600,color:"#fff",background:"#dc3545",border:"none",borderRadius:"10px",padding:"8px 16px",cursor:"pointer",whiteSpace:"nowrap"}},"Remove"),!a&&!l&&e.createElement("button",{type:"button",onClick:o,style:{fontSize:"13px",fontWeight:600,color:"#303030",background:"white",border:"1.5px solid #E3E3E3",borderRadius:"10px",padding:"8px 16px",cursor:"pointer",whiteSpace:"nowrap"}},"Upload Image")))},xs=({form:o,formData:i,setFormData:a,barHeight:l=0,isUploading:c,setIsUploading:s})=>{const d=r(new Map),[p,u]=t(!1),m=s??u;n(()=>()=>{d.current.forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),d.current.clear()},[]);const g=e=>{if(!d.current.has(e)){const t=document.createElement("input");t.type="file",t.accept="image/jpeg,image/png",t.style.display="none",t.multiple=!1,t.onchange=async t=>{const n=t.target.files?.[0];if(n){if(n.size>5242880)return alert("Max 5MB");if(!n.type.match(/^image\/(jpeg|png)$/i))return alert("JPEG/PNG only");a(t=>({...t,[e]:{loading:!0,name:n.name}}));try{const t=await(async e=>{const t=new FormData;t.append("file",e),m(!0);try{const e=window?.Shopify?.shop||"falah-devstore.myshopify.com",n=window?.Shopify?.shop?"https://products.yourtoken.io":"http://localhost:8000",o=await fetch(`${n}/shopify/upload?shop=${e}`,{method:"POST",headers:{"x-yourtoken-app-name":"bundles"},body:t});if(!o.ok)throw new Error("Upload failed");return(await o.json()).url}catch(e){throw alert("Upload failed. Try again."),e}finally{m(!1)}})(n);a(o=>({...o,[e]:{url:t,name:n.name}}))}catch{a(t=>({...t,[e]:{error:!0,name:n.name}}))}}},document.body.appendChild(t),d.current.set(e,t)}return d.current.get(e)};return e.createElement("div",{style:{width:"100%",padding:"8px 0",marginBottom:`${l}px`,boxSizing:"border-box"}},o.sections?.map((t,n)=>e.createElement("div",{key:`sec_${n}`,style:{marginBottom:"28px"}},e.createElement("label",{style:{display:"block",fontWeight:700,marginBottom:"10px",color:"#1a1a1a",fontSize:"15px",lineHeight:"normal"}},t?.title),"text"===t.type&&e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"12px"}},t.fields.map((t,n)=>{const o=t?.title??"Field "+n;return e.createElement("textarea",{key:o,placeholder:t?.title,rows:3,maxLength:500,value:i[o]||"",onChange:e=>a(t=>({...t,[o]:e.target.value})),style:{width:"100%",padding:"8px 0",border:"none",borderBottom:"1.5px solid #ddd",borderRadius:0,fontSize:"14px",color:"#1a1a1a",background:"transparent",resize:"none",outline:"none",lineHeight:"1.5",boxSizing:"border-box"}})})),"image"===t.type&&e.createElement("div",null,e.createElement("div",{style:{fontSize:"12px",color:"#888",marginBottom:"10px"}},"Supported formats - jpeg/png/img (max size: 5MB)"),e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"10px"}},t.fields.map((t,n)=>{const o=t?.title??"Field "+n;return e.createElement(gs,{key:o,title:t?.title,uploadState:i[o],onUpload:()=>g(o).click(),onRemove:()=>a(e=>{const{[o]:t,...n}=e;return n}),onRetry:()=>g(o).click()})}))))))};function fs({quantity:t,setQuantity:n,remainingQuantity:o,handleAddToBundle:r,variantId:i,product:a,handleRemoveItem:l,hideAddToBundle:c,selectedVariantInventoryQty:s}){const d={display:"flex",alignItems:"center",justifyContent:"center",width:"33%",cursor:"pointer",backgroundColor:"#f2f2f2",userSelect:"none",border:"none",padding:"8px",margin:"0",fontSize:"20px",color:"#333",textDecoration:"none",boxShadow:"none",outline:"none",borderRadius:"0",boxSizing:"border-box"},p=t<s;return e.createElement(ac,{className:"yt-byob-quantity-selector-container"},e.createElement("button",{className:"yt-byob-quantity-minus-button",onClick:e=>{e.stopPropagation();const o=Math.max(0,t-1);n(o),l&&i&&l(i,1)},style:d},"-"),e.createElement(lc,{className:"yt-byob-quantity-display"},t," added"),e.createElement("button",{className:"yt-byob-quantity-plus-button",onClick:e=>{e.stopPropagation();const l=Math.min(o,t+1,s);n(l),r&&i&&a&&r(i,a,1)},disabled:!p||c,style:{...d,cursor:!p||c?"not-allowed":"pointer",opacity:!p||c?.6:1}},"+"))}const ys=({product:r,styles:i,selectedVariant:a})=>{const[l,c]=t(!1),s=o(()=>au(a?.image?.url||r?.featuredMedia?.preview?.image?.url||r?.media?.edges?.[0]?.node?.image?.url)||"",[a?.image?.url,r?.featuredMedia?.preview?.image?.url,r?.media?.edges]),d=o(()=>r?.media?.edges?.map(e=>au(e?.node?.preview?.image?.url??e?.node?.image?.url)).filter(Boolean)??[],[r?.media?.edges]),p=o(()=>d?.[1]??s??"",[d,s]);n(()=>{if(s){(new Image).src=s}},[s]);const u=o(()=>s||d?.[0],[s,d]);return e.createElement("div",{className:"yt-byob-image-hover-container",style:{position:"relative",width:"100%",overflow:"hidden",aspectRatio:i.general.imageAspectRatio||"1/1"},onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1)},e.createElement("div",{className:"yt-byob-image-inner-container",style:{width:"100%",height:"100%",position:"relative"}},e.createElement("img",{className:"yt-byob-image-main",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"top",opacity:l&&u!==p?0:1,transition:d?.length>0?"opacity 300ms ease, transform 300ms ease":"",transform:l?"scale(1.1)":"scale(1)"},src:u,alt:r.title}),u!==p&&e.createElement("img",{className:"yt-byob-image-hover",loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",opacity:l?1:0,transition:"opacity 400ms ease, transform 400ms ease",transform:l?"scale(1.1)":"scale(1)",position:"absolute",top:0,left:0,objectPosition:"top"},src:p,alt:r.title})))},bs=({product:o,bundle:r,handleAddToBundle:a,hideAddToBundle:l,remainingQuantity:c,themeColor:s,handleRemoveItem:d,transitionActive:p,idx:u,selecteditems:m,customVariantsQuantity:g,currentProductTier:x,showFreebieTierProductPrices:f,tierIndex:b})=>{const h=ce(Jc),v=r.customizations,w=v?.byob?.variantSelectorType,[C,E]=t(!1),k=v.general?.variantTitleSuffix?o?.variants?.edges:(e=>{if(!e||e.length<2)return e;const t=e.map(e=>e.node.title).map(e=>e.split(" "));let n=[...t[0]];for(let e=1;e<t.length;e++){const o=t[e];let r=0;for(;r<n.length&&r<o.length&&n[n.length-1-r]===o[o.length-1-r];)r++;n=n.slice(n.length-r)}return n.length<1?e:e.map(e=>{const t=e.node.title.split(" "),o=t.slice(0,t.length-n.length).join(" ");return{...e,node:{...e.node,title:o,commonSuffix:n.join(" ")}}})})(o?.variants?.edges);if(!k||!k.length)return e.createElement(e.Fragment,null);const T=i(e=>{const t=g?.find(t=>t.variantId===e)?.quantity;if(void 0!==t)return t;if(r?.customProductsQuantity)return r?.customProductsQuantity;const n=k?.find(t=>t.node.id===e),i=n?.node;return i?o.tracksInventory&&i.inventoryItem?.tracked?i.inventoryQuantity>0?i.inventoryQuantity:i.inventoryQuantity<=0&&"continue"===i.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[k,g,o.tracksInventory]),S=k?.find(e=>T(e.node.id)>0)?.node?.id;if(!S&&!v.general.showOutOfStockProducts)return e.createElement(e.Fragment,null);const[$,N]=t(k?.find(e=>T(e.node.id)>0)?.node?.id||k[0]?.node?.id),[B,F]=t(0),[z,I]=t(window.innerWidth<450),[D,P]=t("normal"),A=k?.find(e=>e?.node?.id===$)?.node,_=T($||"");n(()=>{const e=m.find(e=>e.variantId===$&&(void 0===b||e.tierIndex===b));F(e?e.quantity:0)},[m,$,b]),n(()=>{const e=()=>{I(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{CSS.supports("font-weight","500")?P("500"):CSS.supports("font-weight","400")?P("400"):CSS.supports("font-weight","600")&&P("600")},[]),n(()=>{document.documentElement.style.setProperty("--yt-bundle-font-weight",D)},[D]),n(()=>{if($&&!k?.some(e=>e.node.id===$)){const e=k.find(e=>T(e.node.id)>0)?.node.id||k[0]?.node?.id;e&&N(e)}},[$,k,T]);const R=o.variants&&o.variants.edges?.length>1&&"customOptions"!==w,L="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,O="53933408435"===L,M="75851235630"===L,W=(e=>{if(e.metafield&&"yourtoken_bundles_app"===e.metafield.namespace&&"categories"===e.metafield.key){if(e.metafield.jsonValue&&Array.isArray(e.metafield.jsonValue))return e.metafield.jsonValue;if(e.metafield.value)try{const t=JSON.parse(e.metafield.value);if(Array.isArray(t))return t}catch(e){console.error("Failed to parse categories:",e)}}return[]})(o),V=W.length>0;return e.createElement(e.Fragment,null,e.createElement(dc,{borderRadius:v?.byob.borderRadius,borderColor:v?.byob.borderColor,shadowType:v?.byob.shadowType,backgroundColor:v?.byob.cardBackgroundColor,className:"yt-byob-product-container bundle-builder-product-container "+(p?"yt-product-card-transition-active":u%2==0?"yt-product-card-transition":"yt-product-card-transition-up"),onClick:()=>{if(_<=0)return;const e={...o,variants:{...o.variants,edges:k},selectedVariant:A};h(e)},onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.01)"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)"},style:{WebkitTapHighlightColor:"transparent",textAlign:v?.byob?.productCardDetailsAlignment||"left"}},e.createElement(pc,{className:"yt-byob-image-wrapper"},e.createElement(ys,{product:o,styles:v,selectedVariant:A}),r?.productCardBadgeText&&e.createElement("div",{className:"yt-byob-product-badge",style:{position:"absolute",top:"0px",left:"0px",backgroundColor:v?.general.primaryColor||"#111",color:v?.general.primaryContrastColor||"#fff",zIndex:1,margin:"0px",whiteSpace:"pre",padding:"4px 8px",fontSize:"12px",borderTopLeftRadius:v.byob.borderRadius}},r.productCardBadgeText),R&&e.createElement("div",{className:"yt-byob-variant-selector-wrapper",style:{position:"relative",width:"100%"}},e.createElement(uc,{className:"yt-byob-variant-selector",isCoralHaze:O,onClick:e=>{e.preventDefault(),e.stopPropagation()},value:$||"",onChange:e=>{e.stopPropagation(),e.preventDefault(),N(e.target.value)}},k?.map(t=>{const n=window.innerWidth<=320?10:window.innerWidth<=420?15:22,o=t.node.title.length>n?t.node.title.substring(0,n)+"...":t.node.title;return e.createElement("option",{key:t.node.id,value:t.node.id},o)})),e.createElement("div",{className:"yt-byob-variant-chevron",style:{position:"absolute",right:"16px",bottom:"10px",pointerEvents:"none"}},e.createElement(y,null)))),e.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"8px",alignItems:"flex-start"},className:"yt-byob-product-details-wrapper"},e.createElement("div",{className:"yt-byob-product-content"},"enabled"===r?.customizations?.byob?.productCardCategoryVisibility&&V&&e.createElement("div",{className:"yt-byob-product-categories-wrapper",style:{padding:"2px 4px"}},e.createElement("div",{className:"yt-byob-product-categories",style:{display:"flex",flexWrap:"wrap",gap:"4px"}},W.slice(0,2).map((t,n)=>e.createElement("span",{className:"yt-byob-category-tag",key:n,style:{fontSize:z?"10px":"14px",color:"#666",fontWeight:"500",paddingBottom:"4px"}},t.charAt(0).toUpperCase()+t.slice(1))),W.length>2&&e.createElement("span",{className:"yt-byob-more-categories",style:{fontSize:"10px",padding:"2px 6px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",color:"#666",fontWeight:"500"}},"+",W.length-2," more"))),e.createElement(mc,{isMobile:z,showBorder:r?.showBorder??!0,style:{...!v?.byob.productsPriceVisibility&&{padding:"8px"},...v?.byob.productTitleFontSize&&{fontSize:v?.byob.productTitleFontSize||"18px"}},className:"yt-byob-product-title-wrapper"},e.createElement("div",{style:{display:"-webkit-box",WebkitLineClamp:v?.byob?.productTitleWrapLines||2,WebkitBoxOrient:"vertical",overflow:"hidden",lineHeight:"normal"},className:"yt-byob-product-title"},M?String(A?.displayName).replace("- Default Title",""):o.title,A?.commonSuffix?" -"+A?.commonSuffix:""))),"Default Title"!==A?.title&&v?.byob?.showVariantTitleInCard&&e.createElement("p",{style:{padding:r?.showBorder??1?"0px 10px":"0 4px",fontSize:"12px",margin:"0",fontWeight:"600",color:"#888",lineHeight:"normal"},className:"yt-byob-product-variant-title"},A?.title),"ratingOnly"===r?.reviewRatingType&&(o?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-byob-product-ratings",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Be,{color:"gold",size:14})," ",e.createElement("span",{style:{marginLeft:6}},o?.rating?.averageRating," rating")),"ratingAndReviewCount"===r?.reviewRatingType&&(o?.rating?.averageRating??0)>0&&e.createElement("div",{className:"yt-byob-product-ratings-count",style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},e.createElement(Be,{color:"gold",size:14})," ",o?.rating?.averageRating,e.createElement(Ce,{className:"yt-byob-verified-icon",size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",o?.rating?.ratingCount," reviews)"),v?.byob.productsPriceVisibility&&e.createElement("div",{className:"yt-byob-product-price yt-bundle-builder-product-price",style:{marginBottom:"5px",padding:r?.showBorder?"0px 10px":"0 4px"}},x?.isFreebieTier&&!f?e.createElement(e.Fragment,null,e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px",textDecoration:"line-through",color:"#888",marginRight:"6px"}},iu(v.general.currencySymbol,r?.storeCurrencyCode)??"Rs.",ru(A?.price)),e.createElement("span",{className:"yt-byob-current-price",style:{color:v.general.primaryColor||"#d32f2f",fontWeight:"bold"}},"FREE")):parseFloat(A?.price??"0")>0?e.createElement("span",{className:"yt-byob-current-price"},iu(v.general.currencySymbol,r?.storeCurrencyCode)??"Rs.",ru(A?.price)):e.createElement("span",{className:"yt-byob-free-price"},"Free"),(!x?.isFreebieTier||f)&&A?.compareAtPrice&&v?.byob.compareAtPriceVisibility&&parseFloat(A.compareAtPrice)>parseFloat(A?.price)&&e.createElement("span",{className:"yt-byob-compare-price yt-fixed-bundle-original-price",style:{fontSize:"14px"}},iu(v.general.currencySymbol,r?.storeCurrencyCode)??"Rs.",ru(A.compareAtPrice)))),(_>0||_===1/0)&&e.createElement(gc,{borderRadius:v?.byob.borderRadius,className:"yt-byob-add-to-bundle-wrapper yt-product-atc-wrapper"},(0===B||void 0===B)&&e.createElement(cc,{style:{...!l&&{backgroundColor:v?.general.primaryColor||"#111",color:v?.general.primaryContrastColor||"#fff"}},disabled:l,onClick:e=>{e.stopPropagation(),e.preventDefault(),F(1),(()=>{if(!$)return;"customOptions"===w&&k.length>1?E(!0):a($,o,1)})()},className:"yt-byob-add-to-bundle-button yt-product-atc-button"},v?.byob.addToBundleCTAText),!r?.disableQuantitySelector&&B>0&&$&&e.createElement(sc,{className:"yt-byob-quantity-selector-container visible",style:{overflow:"hidden"}},e.createElement(fs,{remainingQuantity:c,setQuantity:F,quantity:B,handleAddToBundle:a,variantId:$,product:o,handleRemoveItem:d,hideAddToBundle:l,selectedVariantInventoryQty:_})),r?.disableQuantitySelector&&B>0&&$&&e.createElement(cc,{style:{backgroundColor:"#747474",color:v?.general.primaryContrastColor||"#fff",display:"flex",justifyContent:"space-between",overflow:"hidden",height:"40px"},className:"yt-byob-added-button yt-product-atc-single-qty-selector"},e.createElement(xc,{className:"yt-byob-added-text yt-product-atc-single-qty-selector-added"},"ADDED"),e.createElement(fc,{className:"yt-byob-single-qty-remove yt-product-atc-single-qty-selector-remove",onClick:e=>{e.stopPropagation();const t=Math.max(0,B-1);F(t),d&&$&&d($,b)}},e.createElement(Me,{style:{color:"#fff",fontSize:"20px"}})))),_<=0&&_!==1/0&&e.createElement(cc,{style:{backgroundColor:v.general.disabledButtonColor,color:"#fff",cursor:"not-allowed",transition:"transform 0.2s ease-in-out"},className:"yt-product-atc-disabled"},v?.general.outOfStockLabel||"Out of Stock")),"customOptions"===w&&C&&k.length>1&&e.createElement(is,{product:o,isOpen:C,onClose:()=>E(!1),variantOptions:r.variantOptions,cta:{textColor:v.general.ctaTextColor,backgroundColor:v.general.primaryColor},onConfirm:e=>{N(e),a(e,o,1)}}))},hs=({currentStep:t,setCurrentProductTier:n,totalSteps:o,tiers:r,isMobile:i,selectedProductsByTier:a,primaryColor:l="#000",primaryTextColorCta:c="#fff",tierNavigation:s})=>e.createElement("div",{className:"yt-byob-stepper-container",style:{textAlign:"center",fontSize:"20px"}},e.createElement("div",{className:"yt-byob-stepper-steps",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center"}},Array.from({length:o}).map((c,d)=>{const p=d+1,u=!r[d].isFormStep&&r[d].minimumQuantity-(a[d]?.length??0)===0,m=d===t;return l="black"===l?"#000000":l,e.createElement(e.Fragment,{key:p},e.createElement("div",{className:"yt-byob-stepper-step-wrapper",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",gap:i?"4px":"8px"},onClick:()=>!1===s?()=>{}:n(p-1)},e.createElement("div",{className:"yt-byob-stepper-step-number",style:{fontSize:"14px"}},"Step ",p),e.createElement("div",{className:"yt-byob-stepper-step-bar",style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",cursor:"pointer"}},e.createElement("div",{className:"yt-byob-stepper-step-left-bar",style:{height:"3px",width:i?"30px":"50px",backgroundColor:m?"#666666":u?l:"#CBD5E0",display:"block",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px"}}),e.createElement("div",{className:"yt-byob-stepper-step-circle",style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:m?"white":u?`${l}50`:"white",border:`2px solid ${m?"#666666":u?l:"#CBD5E0"}`,display:"flex",alignItems:"center",justifyContent:"center"}}),e.createElement("div",{className:"yt-byob-stepper-step-right-bar",style:{height:"3px",width:i?"30px":"50px",backgroundColor:m?"#666666":u?l:"#CBD5E0",display:"block",marginRight:d<o?i?"4px":"6px":"",borderTopRightRadius:"5px",borderBottomRightRadius:"5px"}}))))})),e.createElement("div",{className:"yt-byob-stepper-title",style:{margin:i?"16px 0px":"15px 0px",fontSize:i?"16px":"18px",padding:"4px",background:"rgba(0, 0, 0, 0.03)",borderBottom:"1px solid rgba(130, 130, 130, 0.28)"}},r[t]?.title)),vs=({styles:t,isMobile:n,categories:o,activeCategory:r,onCategoryChange:i})=>{const a=e=>{i(e)},l=(e,t)=>{const n=e.replace("#","");return`rgba(${parseInt(n.substring(0,2),16)}, ${parseInt(n.substring(2,4),16)}, ${parseInt(n.substring(4,6),16)}, ${t})`};return"tabs"===t?.byob?.categoryFilterOnPage?e.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:"auto",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"}},e.createElement("div",{className:"yt-byob-category-tabs-container",style:{display:"flex",gap:"0px",minWidth:"max-content",paddingBottom:"1px",flexWrap:"nowrap",justifyContent:"center",borderBottom:"1px solid #e0e0e0",width:"auto",height:n?"28px":"45px"}},["All",...o].map(o=>{const i=r===o;return e.createElement("button",{key:o,onClick:()=>a(o),className:"yt-byob-category-tab-button",style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:i?"600":"400",color:i?t.general.primaryColor:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:i?l(t.general.primaryColor,.07):"transparent",borderBottom:i?`2px solid ${t?.general.primaryColor}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:e=>{i||(e.currentTarget.style.color=t?.general.primaryColor)},onMouseLeave:e=>{i||(e.currentTarget.style.color="#666")}},e.createElement("span",{style:{visibility:"hidden",height:0,display:"block",overflow:"hidden",fontWeight:600},"aria-hidden":"true"},o.charAt(0).toUpperCase()+o.slice(1)),e.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},o.charAt(0).toUpperCase()+o.slice(1)))}))):e.createElement("div",{className:"yt-byob-category-filter-wrapper",style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"}},e.createElement("div",{className:"yt-byob-category-buttons-container",style:{display:"flex",gap:"8px",minWidth:"max-content",flexWrap:"nowrap",justifyContent:"center",paddingRight:n?"10px":"0px"}},["All",...o].map(o=>e.createElement("button",{key:o,onClick:()=>a(o),className:"yt-byob-category-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${r===o?t?.general.primaryColor:"#e0e0e0"}`,borderRadius:t?.general.ctaBorderRadius,backgroundColor:r===o?t?.general.primaryColor:"white",color:r===o?"white":"#333",cursor:"pointer",transition:"all 0.3s ease",outline:"none",whiteSpace:"nowrap",minWidth:"fit-content",flexShrink:0},onMouseEnter:e=>{r!==o&&(e.currentTarget.style.borderColor=t?.general.primaryColor,e.currentTarget.style.color=t?.general.primaryColor)},onMouseLeave:e=>{r!==o&&(e.currentTarget.style.borderColor="#e0e0e0",e.currentTarget.style.color="#333")}},o.charAt(0).toUpperCase()+o.slice(1)))))},ws=({bundle:a,selectedItems:l,setSelectedItems:c,handleAddToCart:s,bundleAddToCartLoading:d,renderingOnPage:p,selectedItemsQuantity:u,handleRemoveItem:m,bundleSubtotal:g,dispatchAnalyticsEvent:x,fetchStoreDetails:f,productsPagination:y})=>{const[b,h]=t(void 0),[v,w]=t(window.innerWidth<450),[C,E]=t(0),[k,T]=t({}),S=!!a.personalizedForm?.title&&"productTier"===a.builderTiers?.type,[$,N]=t({}),[B,F]=t(!1),z=S&&C===(a.builderTiers?.productTier?.length||0),I=C===(a.builderTiers?.productTier?.length||0)-1,D=S&&I&&!z,[P,A]=t(a?.products),[_,R]=t(!1),[L,O]=t({}),[M,W]=t(a?.products),[V,j]=t({}),[H,q]=t(y?.cursorData),Q=a.builderTiers?.type,U=a.customizations,Y=a.builderTiers?.productTier??[],G=a.builderTiers?.offerTier??[],[X,Z]=t([]),[K,J]=t(!1),[ee,te]=t("All"),ne=r(null),[oe,re]=t({}),[ie,le]=t([]),[ce,se]=t(!1),[de,pe]=t(0),[ue,ge]=t(0),[xe,fe]=t({}),ye=e=>{fe(t=>{const n=!1!==t[e];return{...t,[e]:!n}})};n(()=>{ie.length>0&&fe(e=>{const t={...e};return ie.forEach(e=>{void 0===t[e.id]&&(t[e.id]=!1)}),t})},[ie]),n(()=>{!(Object.values(oe).length>0)&&y?.cursorData&&q(y.cursorData)},[oe,y?.cursorData]);const be=a.customStoreDetails?.fixedInventoryDetails;n(()=>{const e=new Set;let t=!1;P?.forEach(n=>{const o=n?.productDetails;if(o.metafield&&"yourtoken_bundles_app"===o.metafield.namespace&&"categories"===o.metafield.key){let n=[];if(o.metafield.jsonValue&&Array.isArray(o.metafield.jsonValue))n=o.metafield.jsonValue;else if(o.metafield.value)try{const e=JSON.parse(o.metafield.value);Array.isArray(e)&&(n=e)}catch(e){console.error("Failed to parse categories:",e)}n.length>0&&(t=!0,n.forEach(t=>e.add(t)))}}),Z(Array.from(e)),J(t);U?.byob?.productFiltersDisplay&&"none"!==U?.byob?.productFiltersDisplay&&(async()=>{const e=U?.byob?.productFiltersDisplay??"none";if("drawer"===e||"sidebar"===e)try{const e=await(f?.());e?.productFilters&&le(e.productFilters??[])}catch(e){console.error("no filters data found")}})()},[U?.byob,f,P]),n(()=>{re({})},[C,ee]);const he=((e,t)=>"All"===t?e:e.filter(e=>{const n=e?.productDetails;if(n.metafield&&"yourtoken_bundles_app"===n.metafield.namespace&&"categories"===n.metafield.key){let e=[];if(n.metafield.jsonValue&&Array.isArray(n.metafield.jsonValue))e=n.metafield.jsonValue;else if(n.metafield.value)try{const t=JSON.parse(n.metafield.value);Array.isArray(t)&&(e=t)}catch(e){console.error("Failed to parse categories:",e)}return e.includes(t)}return!1}))(P.filter(e=>{const t=e.productDetails.status?.toLowerCase(),n="active"===t||"unlisted"===t||void 0===e.productDetails.status||""===e.productDetails.status,o="estailofashion.myshopify.com"!==window?.Shopify?.shop||null!==e?.productDetails?.publishedAt;return n&&o}),ee),ve="productTier"===Q?Y.reduce((e,t)=>e+t.minimumQuantity,0):"offerTier"===Q?G.reduce((e,t)=>e+t.minimumQuantity,0):a.minimumQuantity,we=i((e,t)=>{const n=be?.find(e=>e.variantId===t)?.quantity;if(void 0!==n)return n;const o=(e.variants?.edges||[]).find(e=>e.node.id===t),r=o?.node;return r?e.tracksInventory&&r.inventoryItem?.tracked?r.inventoryQuantity>0?r.inventoryQuantity:r.inventoryQuantity<=0&&"continue"===r.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[be]),[Ce,Ee]=t(3e3);n(()=>{const e=ie?.find(e=>"PRICE_RANGE"===e.type||"filter.v.price"===e.id);e&&e.values?.[0]?.input?.price?.max&&Ee(e.values[0].input.price.max)},[P,ie]);const[ke,Te]=t(""),[Se,$e]=t(""),Ne=((e,t)=>e.filter(e=>e?.productDetails?.title?.toLowerCase().includes(t?.toLowerCase())))(he,ke),Be=((e,t)=>[...e].sort((e,n)=>{const o=e?.productDetails?.title?.toLowerCase(),r=n?.productDetails?.title?.toLowerCase(),i=parseFloat(e?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),a=parseFloat(n?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(t){case"title-asc":return o.localeCompare(r);case"title-desc":return r.localeCompare(o);case"price-low-to-high":return i-a;case"price-high-to-low":return a-i;default:return 0}}))(Ne,Se);n(()=>{(async e=>{if(!y)return;const{initialCursorData:t,cursorData:n,fetchFn:o,setCursorData:r}=y,i="productTier"===Q?Y?.[C]?.tier:1;if(0===Object.values(e)?.length)return void("productTier"===Q?(O(e=>({...e,[C]:V?.[C]||[]})),r(H||{...n})):(A(M),r(H||{1:t?.[1]})));const a=await o(e,i,null);a&&("productTier"===Q?(O(e=>({...e,[C]:a})),A(e=>{const t=new Set(e.map(e=>e.productId)),n=a.filter(e=>!t.has(e.productId));return[...e,...n]})):A(a))})(oe)},[oe]);const[Fe,ze]=ae(Jc),[Ie,De]=t(!1);n(()=>{x?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:a?._id,bundleType:"byob-page-bundle",byobBundleType:a.builderTiers?.type??"builder"}}),setTimeout(()=>{De(!0)},100)},[]);const Pe=r(null);n(()=>{const e=()=>{w(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),n(()=>{if(a.coverImageUrl){const e=new Image;e.src=au(a.coverImageUrl)??"",e.onload=()=>{h(e.width/e.height)}}},[a.coverImageUrl]),n(()=>{De(!1),setTimeout(()=>De(!0),100)},[C]);const Ae=(e,t)=>{if("productTier"===Q){let n={...k},o=!1;if(n[t]){const r=n[t].indexOf(e);-1!==r&&(n[t]=[...n[t]],n[t].splice(r,1),o=!0)}if(!o)for(let t=Y.length;t>=0;t--){const o=n[t].indexOf(e);if(-1!==o){n[t]=[...n[t]],n[t].splice(o,1);break}}T(n);const r=Y.findIndex((e,t)=>n[t]?.length<e.minimumQuantity);-1!==r&&E(r)}m(e,t)},_e=()=>{const e=document.querySelector(".products-display");e&&e.scrollIntoView({behavior:"smooth"})};n(()=>{if(a)return"productTier"!==a?.builderTiers?.type?(A(a?.products??[]),void W(a?.products??[])):void("productTier"===a?.builderTiers?.type&&(O({0:a?.products}),j({0:a?.products})))},[a]),n(()=>{if("productTier"!==Q||!Y[C])return;if(ve===u)return;const e=Y.findIndex((e,t)=>{const n=k[t]||[];return t>=C&&n.length<e.minimumQuantity});if(-1!==e&&e!==C){E(e);const t=Y[C];t?.products?.length>1&&_e()}else if(-1===e&&S&&C<Y.length){Y.every((e,t)=>(k[t]?.length||0)>=e.minimumQuantity)&&E(Y.length)}},[k,Y,Q,S]),n(()=>{Te("")},[C]),n(()=>{function e(e){if(!Pe.current||!e.target)return;!Pe.current.contains(e.target)&&ze(void 0)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const Re=(e,t,n)=>{var o;"productTier"===Q&&(o=e,T(e=>{const t={...e},n=Y.findIndex((e,n)=>{const o=t[n]||[];return n>=C&&o.length<e.minimumQuantity}),r=-1!==n?n:C;return-1!==n&&E(n),t[r]||(t[r]=[]),t[r].push(o),t}));const r=!0===Y[C]?.isFreebieTier;x?.({eventNameCustom:"byob_add_to_bundle",eventTypeCustom:"clicks",data:{bundleId:a._id,bundleType:"byob-page-bundle",byobBundleType:a.builderTiers?.type??"builder",addedProduct:{id:t?.id,title:t?.title}}}),lu(e,t,n,l,c,r,C)},Le=(()=>{if(!a?.builderTiers)return a.minimumQuantity;const{type:e,offerTier:t,productTier:n}=a.builderTiers,o="offerTier"===e?t:"productTier"===e?n:null;if(!o)return a.minimumQuantity;let r=0;return o.map(e=>{r+=e.minimumQuantity}),r})(),Oe=v&&a.mobileCoverImageUrl?au(a.mobileCoverImageUrl):au(a.coverImageUrl??"")||null,Me=i(e=>{const t=U?.general?.showOutOfStockProducts;if(t)return!0;const n=e?.productDetails,o=n?.variants?.edges||[];if(be){if(o.some(e=>be.some(t=>t.variantId===e.node.id&&t.quantity>0)))return!0}return o.some(e=>we(n,e.node.id)>0)},[U?.general?.showOutOfStockProducts,be,we]),We=o(()=>{if("productTier"===Q&&Y.length>0){const e=L?.[C]??[];return Se?Be.filter(t=>e.some(e=>e.productId===t.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds?.[0])))&&Me(t)):e.map(e=>Be.find(t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds?.[0])))).filter(e=>e&&Me(e))}return Be.filter(Me)},[Q,Y,L,C,Be,Me,Se]),Ve=We;n(()=>{if("productTier"!==Q)return;const e=Y[C];if(!e)return;if(1!==e.minimumQuantity)return;if(1!==e.products.length)return;if(1!==L?.[C]?.length)return;const t=e.products[0],n=P.find(e=>e.productId===t.productId)?.productDetails;if(!n)return;if(n.variants?.edges?.length>1)return;const o=n.variants?.edges?.find(e=>we(n,e.node.id)>0)?.node;if(!o)return;const r=o.id,i=k[C]?.includes(r);if(!i&&(Re(r,n,1),C<Y.length-(S?0:1))){E(C+1);const e=Y?.[C];e?.products?.length>1&&_e()}},[Q,Y,C,P,k,we,Re]);const je=o(()=>he.filter(e=>{const t=e?.productDetails;return(t.variants?.edges||[]).some(e=>we(t,e.node.id)>0)}).length,[he,we]),He=o(()=>he.length-je,[he,je]),qe="bundles"==a.appName?a.pageHeader?.title:a?.title,Qe="bundles"==a.appName?a.pageHeader?.description:a?.subtitle;n(()=>{if(!y)return;const{cursorData:e,fetchFn:t}=y,n=Y[C]?.tier,o="productTier"===Q?n:1;if(e?.[o]&&!e?.[o]?.hasNext||!t)return;const r=new IntersectionObserver(async([n])=>{if(n.isIntersecting&&!_){R(!0);try{const n=await t(oe,o,e?.[o]?.cursor);if(n?.length>0){const e=Object.values(oe).length>0;"productTier"===Q?(O(e=>({...e,[C]:[...e[C]||[],...n]})),e||j(e=>({...e,[C]:[...e[C]||[],...n]})),A(e=>[...e,...n])):(A(e=>[...e,...n]),e||W(e=>[...e,...n]))}}catch(e){console.error("Pagination fetch failed:",e)}finally{R(!1)}}},{root:null,rootMargin:"300px",threshold:.01}),i=ne.current;return i&&r.observe(i),()=>{i&&r.unobserve(i)}},[y,_,Q,C,Y]);const Ue=()=>{x?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:a._id,bundleType:"byob-page-bundle",byobBundleType:a.builderTiers?.type??"builder",selectedProducts:l.map(e=>({id:e?.product?.id,title:e?.product?.title,quantity:e?.quantity}))}})};return e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-builder-section",style:{display:"flex",flexDirection:"column",width:"100%",alignItems:"center",justifyContent:"center",rowGap:"15px",padding:"20px 0px",marginBottom:"20px",backgroundColor:U.byob.sectionBackgroundColor,..."transparent"!==U.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},Oe?e.createElement("div",{className:"yt-byob-cover-image-container",style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",overflow:"hidden",...a?.coverImageVerticalMargin&&{marginBottom:a?.coverImageVerticalMargin,marginTop:a?.coverImageVerticalMargin}}},Oe&&e.createElement(ls,{coverImageUrl:Oe,alt:"Background",styles:{width:"100%",height:"auto",display:"block"}}),e.createElement("div",{className:"yt-byob-cover-image-overlay",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px",textShadow:"2px 2px 8px rgba(0, 0, 0, 0.4)"}},e.createElement("span",{style:{lineHeight:"normal",fontSize:U?.byob?.titleFontSize??"3rem",fontWeight:"700",color:U?.byob?.titleTextColor??"#000",marginBottom:"15px",backgroundColor:U?.byob?.titleBackgroundColor??"transparent",width:"100%",textAlign:"center"},className:"bundle-builder-title"},qe),e.createElement("span",{style:{lineHeight:"normal",fontSize:U?.byob?.subtitleFontSize??"1.5rem",color:U?.byob?.titleTextColor??"#000"},className:"bundle-builder-subtitle"},Qe))):(qe||Qe)&&e.createElement("div",{className:"yt-byob-header-content",style:{zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px"}},qe&&e.createElement("span",{className:"bundle-builder-title",style:{lineHeight:"normal",fontSize:U?.byob?.titleFontSize??"3rem",fontWeight:"700",color:U?.byob?.titleTextColor??"#000",marginBottom:"15px",textAlign:"center",width:"100%",backgroundColor:U?.byob?.titleBackgroundColor??"transparent"}},qe),Qe&&e.createElement("span",{className:"bundle-builder-subtitle",style:{lineHeight:"normal",fontSize:U?.byob?.subtitleFontSize??"1.5rem",color:U?.byob?.titleTextColor??"#000"}},Qe)),e.createElement("div",{style:{fontSize:"20px",width:"100%"},className:"products-display"},"productTier"===Q&&Y.length>0&&U?.byob.productTiersVisibility&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-byob-stepper-wrapper"},e.createElement(hs,{currentStep:C,totalSteps:Y.length+(S?1:0),tiers:S?[...Y,{title:a.personalizedForm?.title||"Personalize",tier:Y.length,minimumQuantity:0,products:[],isFormStep:!0}]:Y,isMobile:v,primaryColor:U?.general?.primaryColor,primaryTextColorCta:U?.general?.primaryContrastColor,setCurrentProductTier:E,selectedProductsByTier:k,tierNavigation:U.byob.tierNavigation})))),e.createElement("div",{className:"yt-byob-layout-wrapper",style:{display:"flex",flexDirection:"row",width:v?"100%":"90%",marginInline:"auto"}},"sidebar"===U?.byob?.productFiltersDisplay&&!v&&!z&&e.createElement(ps,{showFiltersDrawer:ce,handleClose:()=>se(!1),isAnimating:!1,isMobile:!1,availableFilters:ie,appliedFilters:oe,toggleFilter:(e,t)=>{re(n=>{const o=n[e]||[],r=o.includes(t)?o.filter(e=>e!==t):[...o,t],i={...n,[e]:r.length?r:void 0};return Object.fromEntries(Object.entries(i).filter(([,e])=>void 0!==e))})},clearAllFilters:()=>{re({}),ge(0),pe(Ce)},applyPriceFilter:()=>{re(e=>{const t={...e};return t["filter.v.price"]=[`min:${ue}-max:${de}`],t})},priceMin:ue,setPriceMin:ge,priceMax:de,setPriceMax:pe,maxPossiblePrice:Ce,styles:U,products:P,unavailableProductCount:He,storeCurrencyCode:a?.storeCurrencyCode,openSections:xe,toggleSection:ye}),e.createElement("div",{className:"yt-byob-products-column",style:{display:"flex",flexDirection:"column",flex:1,minWidth:0}},!z&&e.createElement("div",{className:"yt-byob-filters-wrapper",style:{width:"100%",marginBottom:"20px",display:"flex",flexDirection:"column",gap:"20px"}},e.createElement(us,{enableSortAndFilter:a?.enableSortAndFilter??!1,isMobile:v,searchTerm:ke,setSearchTerm:Te,setSortBy:$e,styles:U,appliedFilters:oe,setAppliedFilters:re,availableFilters:ie,products:P,availableProductCount:je,unavailableProductCount:He,maxPossiblePrice:Ce,storeCurrencyCode:a?.storeCurrencyCode,sharedFiltersState:{showFilters:ce,setShowFilters:se,priceMax:de,setPriceMax:pe,priceMin:ue,setPriceMin:ge},openSections:xe,toggleSection:ye}),a?.customizations?.byob?.enableProductCategories&&K&&e.createElement("div",{className:"yt-byob-category-filter-container"},e.createElement(vs,{styles:U,isMobile:v,categories:X,activeCategory:ee,onCategoryChange:e=>{te(e)}}))),e.createElement("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"12px",justifyContent:ce&&"sidebar"===U?.byob?.productFiltersDisplay?"flex-start":"center",width:"100%",height:"fit-content",paddingBottom:p?"100px":"20px"},className:"products-display"},z&&a.personalizedForm?.title?e.createElement(xs,{form:a.personalizedForm,formData:$,setFormData:N,isUploading:B,setIsUploading:F}):0!==Ve?.length||_?We.map((t,n)=>{if("productTier"===Q){const o=(Y[C]?.minimumQuantity??0)>(k[C]?.length??0),r=Be.find(e=>e.productId===t.productId&&(t.variantIds.length<1||e.variantIds.includes(t.variantIds[0])));return r?e.createElement(bs,{bundle:a,idx:n,key:t?.variantIds?.[0]??t.productId,product:r?.productDetails,handleAddToBundle:Re,hideAddToBundle:!o,remainingQuantity:Le-u,themeColor:a?.dealTextColor,handleRemoveItem:e=>Ae(e,C),selecteditems:l,transitionActive:Ie,customVariantsQuantity:be,currentProductTier:Y[C],showFreebieTierProductPrices:a?.customStoreDetails?.showFreebieTierProductPrices,tierIndex:C}):null}return e.createElement(bs,{bundle:a,idx:n,key:t.productId,product:t?.productDetails,handleAddToBundle:Re,hideAddToBundle:u>=Le,remainingQuantity:Le-u,themeColor:a?.dealTextColor,handleRemoveItem:e=>m(e),selecteditems:l,transitionActive:Ie,customVariantsQuantity:be,tierIndex:C})}):e.createElement("div",{className:"yt-byob-empty-state",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:"100%",padding:"40px 20px",gap:"16px"}},e.createElement("p",{style:{fontSize:"20px",color:"#333",textAlign:"center",margin:0}},Object.values(oe).length>0?"No products match your filters":"No products found"),Object.values(oe).length>0&&e.createElement("button",{onClick:()=>{re({}),ge(0),pe(Ce)},style:{padding:"8px 16px",background:U?.general?.primaryColor||"#333",color:"white",border:"none",borderRadius:U?.byob?.borderRadius||"8px",cursor:"pointer",fontWeight:600,fontSize:"14px"}},"Clear All Filters")),!z&&_&&e.createElement("div",{className:"yt-byob-loading-wrapper",style:{width:"100%",display:"flex",justifyContent:"center",padding:"20px"}},e.createElement(me,{color:U?.general?.primaryColor||"#333",size:30})),e.createElement("div",{ref:ne,className:"yt-byob-pagination-observer",style:{height:"1px",width:"100%",display:"block"}},e.createElement("span",null))),!p&&e.createElement(Kc,{builderTiers:a?.builderTiers,showNextStep:D,handleAddToCart:async e=>{if(D)return E(C+1),void _e();const t={};S&&Object.entries($).forEach(([e,n])=>{const o=e.split("|").pop()?.replace(/^f_\d+$/,"")||e;"string"==typeof n&&n.trim()?t[o]=n:n&&"object"==typeof n&&"url"in n&&(t[o]=n.url)}),await s(e,t),Ue()},minimumQuantity:ve,selectedProducts:l,showProductDetailsInTracker:a.showProductDetailsInTracker,handleRemoveItem:m,handleRemoveItemProductTier:Ae,selectedItemsQuantity:u,percentageOff:a.percentageOff,loading:d,bundleSubtotal:g,amountOff:a.amountOff,styles:a.customizations,dealAmount:a.dealAmount,themeColor:a?.dealTextColor??"#333",primaryTextColorCta:a?.primaryTextColorCta??"#fff",cornerRadiusType:a?.cornerRadiusType??"",selectedProductsByTier:k,renderingOnPage:p,isUploading:B}),p&&e.createElement("div",{className:"yt-byob-sticky-tracker-wrapper",style:{width:"100%",marginTop:"20px",position:"sticky",bottom:"10px",zIndex:999}},e.createElement(Kc,{showNextStep:D,handleAddToCart:async e=>{if(D)return E(C+1),void _e();const t={};S&&Object.entries($).forEach(([e,n])=>{const o=e.split("|").pop()?.replace(/^f_\d+$/,"")||e;"string"==typeof n&&n.trim()?t[o]=n:n&&"object"==typeof n&&"url"in n&&(t[o]=n.url)}),await s(e,t),Ue()},minimumQuantity:ve,builderTiers:a?.builderTiers,selectedProducts:l,showProductDetailsInTracker:a.showProductDetailsInTracker,loading:d,handleRemoveItem:m,handleRemoveItemProductTier:Ae,percentageOff:a.percentageOff,selectedItemsQuantity:u??0,bundleSubtotal:g??{price:0,compareAtPrice:0},amountOff:a.amountOff,styles:a.customizations,dealAmount:a.dealAmount,themeColor:U?.general.primaryColor||"#000",primaryTextColorCta:U.general.primaryContrastColor??"#fff",cornerRadiusType:a?.cornerRadiusType??"",selectedProductsByTier:k,renderingOnPage:p,isUploading:B})))),Fe&&void 0!==u&&(()=>{let t=u<a.minimumQuantity;return"productTier"==Q?t=(Y[C]?.minimumQuantity??0)>(k[C]?.length??0):"offerTier"==Q&&(t=u<G.reduce((e,t)=>e+t.minimumQuantity,0)),e.createElement(as,{handleAddToBundle:Re,ref:Pe,remainingQuantity:a.minimumQuantity-u,hideAddToBundle:!t,disableQuantitySelector:a?.disableQuantitySelector??!1,selectedProducts:l,selectedProductsByTier:k,themeColor:U?.general.primaryColor||"#000",primaryTextColorCta:a?.customizations?.general.primaryContrastColor??"#fff",primaryBackgroundColorCta:U?.general.primaryColor||"#000",cornerRadius:a?.customizations.byob.borderRadius,styles:a.customizations,reviewRatingType:a?.reviewRatingType??"none",customVariantsQuantity:be,bundleProductsCustomQuantity:a?.customProductsQuantity,isFreebieTier:Y?.[C]?.isFreebieTier,showFreebieTierProductPrices:a?.customStoreDetails?.showFreebieTierProductPrices,bundleVariantOptions:a?.variantOptions})})()))},Cs=({isOpen:o,onClose:r,formConfig:i,onCheckout:a,cta:l,isMobile:c})=>{const[s,d]=t({}),[p,u]=t(!1);n(()=>{o||d({})},[o]);const m=e=>{if(p)return;const t={};Object.entries(s).forEach(([e,n])=>{const o=e.split("|").pop()?.replace(/^f_\d+$/,"")||e;"string"==typeof n&&n.trim()?t[o]=n:n&&"object"==typeof n&&"url"in n&&(t[o]=n.url)}),a(e?{}:t)};if(!o)return null;const g=e.createElement("div",{onClick:r,style:{position:"fixed",top:0,left:0,right:0,bottom:0,width:"100vw",height:"100vh",background:"rgba(0, 0, 0, 0.4)",zIndex:9999,display:"flex",alignItems:c?"flex-end":"center",justifyContent:"center"}},e.createElement("style",null,"\n @keyframes slideUp {\n from { transform: translateY(100%); }\n to { transform: translateY(0); }\n }\n @keyframes fadeIn {\n from { opacity: 0; transform: scale(0.95); }\n to { opacity: 1; transform: scale(1); }\n }\n "),e.createElement("div",{onClick:e=>e.stopPropagation(),style:{background:"white",width:c?"100vw":"500px",maxWidth:c?"100vw":"560px",height:c?"80vh":"auto",maxHeight:c?"80vh":"90vh",borderRadius:c?"20px 20px 0 0":"20px",display:"flex",flexDirection:"column",overflow:"hidden",zIndex:999,animation:c?"slideUp 0.3s ease-out":"fadeIn 0.2s ease-out"}},e.createElement("div",{style:{width:"100%",padding:c?"20px 20px 16px":"18px 20px",fontWeight:700,fontSize:c?"18px":"16px",textAlign:"center",position:"relative",borderBottom:"1px solid #eee",flexShrink:0,backgroundColor:"#ffffff",color:"#1a1a1a",boxSizing:"border-box",lineHeight:"1.4"}},i.title||"Personalization",!c&&e.createElement("button",{onClick:r,style:{position:"absolute",right:"16px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",fontSize:"24px",lineHeight:1,cursor:"pointer",color:"#666",padding:"4px"}},"×")),e.createElement("div",{style:{flex:1,overflowY:"auto",padding:c?"20px 20px":"16px 20px"}},e.createElement(xs,{form:i,formData:s,setFormData:d,isUploading:p,setIsUploading:u})),e.createElement("div",{style:{padding:c?"12px 16px":"12px 24px 16px",borderTop:"1px solid #eee",flexShrink:0,background:"white",display:"flex",flexDirection:"column",alignItems:"center",gap:"10px"}},e.createElement("button",{onClick:()=>{m(),r()},disabled:p,style:{width:"100%",fontSize:"15px",fontWeight:700,textAlign:"center",padding:"15px 0",border:"none",borderRadius:"10px",cursor:p?"not-allowed":"pointer",opacity:p?.7:1,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:l.backgroundColor,color:l.textColor,letterSpacing:"0.01em"}},p?e.createElement(me,{color:l.textColor,size:15}):"Submit"),e.createElement("button",{onClick:()=>{m(!0),r()},style:{background:"none",border:"none",fontSize:"14px",fontWeight:600,color:"#1a1a1a",cursor:"pointer",padding:"4px 8px",textAlign:"center"}},"Add without customization"))));return D.createPortal(g,document.body)},Es=({product:t,selectedVariantId:n,onVariantChange:r,styles:i,originalPrice:a,dealPrice:l,totalPriceSum:c,isVertical:s=!1,variantOptions:d,storeCurrencyCode:p})=>{const u=o(()=>e=>{const n=t?.productDetails?.variants?.edges?.find(t=>t.node.id===e),o=n?.node;return o?t.productDetails.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLocaleLowerCase()?1/0:0:1/0:0},[t.productDetails]),m=t?.productDetails?.variants?.edges?.find(e=>e?.node?.id===n)?.node;u(n);const g=o(()=>{if(m?.title&&t.productDetails.options){const e=m.title.split(" / ");if(e.length===t.productDetails.options.length)return e}return t.productDetails.options?.map(e=>e.values[0])||[]},[m,t.productDetails.options]),x=e=>{r(e)};return s?e.createElement("div",{className:"yt-comboBundle-product-card-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",lineHeight:"normal",width:"165px",backgroundColor:"#F6F6F6",borderRadius:"20px",border:"1px solid #B3B3B3",boxShadow:"4px 4px 0px -1px #00000033",overflow:"hidden"}},e.createElement("div",{className:"yt-comboBundle-product-card-image-container-vertical",style:{position:"relative",width:"100%"}},i.comboBundle.subProductsImageVisibility&&e.createElement(e.Fragment,null,e.createElement("img",{className:"yt-comboBundle-product-image-vertical",src:au(m?.image?.url||t?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:t?.productDetails?.featuredMedia?.alt,width:165,height:165,style:{objectFit:"cover",borderRadius:"20px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",height:"100%",aspectRatio:i.general?.imageAspectRatio||"1/1"}}),e.createElement("div",{className:"yt-comboBundle-product-variant-selector-container-vertical",style:{marginTop:"8px",position:"absolute",bottom:"10px",left:"5px",right:"5px"}},t?.productDetails?.variants?.edges?.filter(e=>"Default Title"!==e.node.title)?.length>0&&e.createElement(e.Fragment,null,e.createElement("select",{className:"yt-comboBundle-product-variant-select-vertical",value:n,onChange:e=>x(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",width:"100%",appearance:"none",marginRight:"30px",fontSize:"12px",fontWeight:600}},t?.productDetails?.variants?.edges.map(t=>{const n=u(t?.node?.id);return e.createElement("option",{key:t?.node?.id,value:t?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},t?.node?.title)})),e.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-vertical",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},e.createElement(y,null)))))),(i.comboBundle.subProductsProductTitleVisibility||i.comboBundle.subProductsProductPriceVisibility)&&e.createElement("div",{className:"yt-comboBundle-product-info-container-vertical",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"40px",width:"100%",paddingBlock:"5px"}},i.comboBundle.subProductsProductTitleVisibility&&e.createElement("span",{className:"yt-comboBundle-product-title-vertical",style:{fontSize:"12px",color:"#333",fontWeight:"600",lineHeight:"normal",textAlign:"center",width:"fit-content"}},t?.productDetails?.title),i.comboBundle.subProductsProductPriceVisibility&&e.createElement("div",{className:"yt-comboBundle-product-price-container-vertical",style:{display:"flex",alignItems:"center",gap:"8px",lineHeight:"normal",fontSize:"14px"}},e.createElement("span",{className:"yt-comboBundle-product-deal-price-vertical",style:{lineHeight:"normal"}},iu(i.general.currencySymbol,p),ru((Number(m?.price||0)/Number(c)*Number(l)).toFixed(2))),!1!==i.comboBundle.discountBadgeVisibility&&("discount-on-compare"===i.comboBundle.discountBadgeDisplay?e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},iu(i.general.currencySymbol,p),ru(m?.compareAtPrice?m.compareAtPrice:m?.price)):Number(l)<Number(c)&&e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},iu(i.general.currencySymbol,p),ru(m?.price)))))):e.createElement("div",{className:"yt-comboBundle-product-card-horizontal",style:{display:"flex",alignItems:"center",gap:"16px",padding:"4px",lineHeight:"normal",borderRadius:"8px",transition:"background-color 0.3s",width:"100%",border:"1px solid transparent",..."right"===i.comboBundle.infoAlignment&&{flexDirection:"row-reverse"},..."center"===i.comboBundle.infoAlignment&&{justifyContent:"center"}},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#fafafa",e.currentTarget.style.border="1px solid #DFDFDF"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent",e.currentTarget.style.border="1px solid transparent"}},i.comboBundle.subProductsImageVisibility&&e.createElement("div",{className:"yt-comboBundle-product-image-wrapper-horizontal"},e.createElement("img",{className:"yt-comboBundle-product-image-horizontal",src:au(m?.image?.url||t?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:t?.productDetails?.featuredMedia?.alt,height:80,style:{objectFit:"cover",borderRadius:"10px",border:"1px solid #DEDEDE",aspectRatio:"1/1",width:"90px",height:"90px"}})),e.createElement("div",{className:"yt-comboBundle-product-info-horizontal",style:{display:"flex",flexDirection:"column",alignItems:"left"===i.comboBundle?.infoAlignment?"flex-start":"right"===i.comboBundle?.infoAlignment?"flex-end":"center"===i.comboBundle?.infoAlignment?"flex-start":void 0}},i.comboBundle.subProductsProductTitleVisibility&&e.createElement("span",{className:"yt-comboBundle-product-title-horizontal",style:{fontSize:"14px",fontWeight:"600",lineHeight:"normal",display:"flex",alignItems:"center",gap:"8px"}},e.createElement("span",{className:"yt-comboBundle-product-title-text"}," ",t?.productDetails?.title," "),"dropdown"!==i.comboBundle.comboVariantTypeSelector&&t.productDetails.variants.edges.filter(e=>"Default Title"!==e.node.title).length>0&&d&&g&&e.createElement("span",{className:"yt-comboBundle-product-variant-tag-horizontal",style:{fontSize:"10px",color:"#666",backgroundColor:"#F4F4F4",padding:"2px 8px",borderRadius:"10px",border:"1px solid #ddd"}},g.length>1?g.join(" / "):g)),i.comboBundle.subProductsProductPriceVisibility&&e.createElement("div",{className:"yt-comboBundle-product-price-wrapper-horizontal",style:{display:"flex",gap:"8px",marginTop:"5px",alignItems:"baseline"}},e.createElement("span",{className:"yt-comboBundle-product-deal-price-horizontal",style:{lineHeight:"normal"}},iu(i.general.currencySymbol,p),ru((Number(m?.price||0)/Number(c)*Number(l)).toFixed(2))),!1!==i.comboBundle.discountBadgeVisibility&&("discount-on-compare"===i.comboBundle.discountBadgeDisplay?e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},iu(i.general.currencySymbol,p),ru(m?.compareAtPrice?m?.compareAtPrice:m?.price)):Number(l)<Number(c)&&e.createElement("span",{className:"yt-comboBundle-product-original-price-horizontal",style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},iu(i.general.currencySymbol,p),ru(m?.price)))),t.productDetails.variants.edges.length>1&&("dropdown"===i.comboBundle.comboVariantTypeSelector?e.createElement("div",{className:"yt-comboBundle-product-variant-dropdown-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},e.createElement("select",{className:"yt-comboBundle-product-variant-select-horizontal",value:n,onChange:e=>x(e.target.value),style:{padding:"6px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",fontSize:"12px",fontWeight:600,borderRadius:"4px"}},t.productDetails.variants.edges.map(t=>{const n=u(t?.node?.id);return e.createElement("option",{key:t?.node?.id,value:t?.node?.id,disabled:0===n,className:"yt-comboBundle-product-variant-option"},t?.node?.title)})),e.createElement("div",{className:"yt-comboBundle-product-variant-select-icon-horizontal",style:{position:"absolute",right:"1px",top:"2px",bottom:"0px",pointerEvents:"none",backgroundColor:"#F3F3F3",width:"15%",height:"calc(100% - 4px)",display:"flex",justifyContent:"center",alignItems:"center"}},e.createElement(y,null))):t.productDetails.options.length>0?e.createElement(e.Fragment,null,t.productDetails.options.map((n,o)=>e.createElement("div",{key:n.name,className:"yt-comboBundle-product-option-group-horizontal",style:{...n?.values?.length>1&&{marginTop:"10px"},display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"}},t.productDetails.options.length>1&&n?.values?.length>1&&e.createElement("label",{className:"yt-comboBundle-product-option-label",style:{fontSize:"12px",fontWeight:"500",color:"#333"}},n.name,":"),n?.values?.length>1&&e.createElement("div",{className:"yt-comboBundle-product-option-values-horizontal",style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"}},n.values.map(r=>{const a=[...g];a[o]=r;const l=t.productDetails.options.length>0?a.join(" / "):a[o],c=t.productDetails.variants.edges.find(e=>e.node.title===l)?.node,s=0===(c?u(c.id):0),p=g[o]===r,m=d&&d?.options?.find(e=>e.name===n.name);return m&&"color"===m?.type?e.createElement("button",{key:r,className:`yt-comboBundle-product-option-button-color ${p?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&x(c.id)},disabled:s,style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:"1px solid transparent",opacity:s?.5:1,cursor:s?"not-allowed":"pointer"}},m?.values.find(e=>e.name===r)?.value?e.createElement("div",{className:"yt-comboBundle-product-option-color-swatch",style:{width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",borderRadius:"50%",backgroundColor:m?.values.find(e=>e.name===r)?.value}},e.createElement("span",null)):e.createElement("span",{key:r,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},r)):m&&"image"===m?.type?e.createElement("button",{key:r,className:`yt-comboBundle-product-option-button-image ${p?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&x(c.id)},disabled:s,style:{border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:p&&!s?"#F7F7F7":"transparent",cursor:s?"not-allowed":"pointer",padding:"0px",width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",overflow:"hidden",opacity:s?.5:1}},m?.values.find(e=>e.name===r)?.value?e.createElement("img",{className:"yt-comboBundle-product-option-image",src:au(m?.values.find(e=>e.name===r)?.value||"/placeholder.svg"),alt:r,style:{width:p&&!s?"26px":"24px",height:p&&!s?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):e.createElement("span",{key:r,className:"yt-comboBundle-product-option-text",style:{padding:"4px 8px",border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",fontSize:"10px",fontWeight:"600"}},r)):e.createElement("button",{key:r,className:`yt-comboBundle-product-option-button-text ${p?"yt-comboBundle-product-option-button-selected":""} ${s?"yt-comboBundle-product-option-button-disabled":""}`,onClick:()=>{!s&&c&&x(c.id)},disabled:s,style:{padding:"4px 8px",border:p&&!s?`1px solid ${i.general?.ctaBackgroundColor}`:s?"1px solid #ccc":"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:p&&!s?"#F7F7F7":"transparent",color:s?"#ccc":"#707070",cursor:s?"not-allowed":"pointer",fontSize:"10px",fontWeight:"600",opacity:s?.5:1}},r)}))))):e.createElement(e.Fragment,null,t?.productDetails?.variants?.edges?.length>1&&e.createElement("div",{className:"yt-comboBundle-product-variant-buttons-horizontal",style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},t?.productDetails?.variants?.edges.map(t=>{const o=0===u(t?.node?.id);return e.createElement("button",{key:t?.node?.id,className:`yt-comboBundle-product-variant-button ${n===t?.node?.id?"yt-comboBundle-product-variant-button-selected":""} ${o?"yt-comboBundle-product-variant-button-disabled":""}`,onClick:()=>x(t?.node?.id),disabled:o,style:{padding:"4px 8px",border:n===t?.node?.id?`1px solid ${i.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:n===t?.node?.id?"#F7F7F7":"transparent",color:o?"#ccc":"#707070",cursor:o?"not-allowed":"pointer",fontSize:"12px",fontWeight:"500",opacity:o?.5:1}},t?.node?.title)}))))))},ks=({bundle:r,addToCartFunction:i,dispatchAnalyticsEvent:a})=>{const[l,c]=t(!1),[s,d]=t(window.innerWidth<786),[p,u]=t(!1),m=o(()=>(e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),o=n?.node;return o?e.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[]),[g,x]=t(()=>{const e={};return r.products.forEach((t,n)=>{const o=t.productDetails?.variants?.edges?.find(e=>m(t.productDetails,e?.node?.id)>0)?.node;e[n]=o?o.id:t?.productDetails?.variants?.edges[0]?.node?.id}),e}),f=r.products?.every((e,t)=>{const n=g[t];return m(e.productDetails,n)>0});n(()=>(i&&(window.ytComboBundle={bundle:r,addToCart:i,selectedVariants:g},window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:window.ytComboBundle}))),()=>{window.ytComboBundle=void 0,window.dispatchEvent(new CustomEvent("yt-combo-bundle-updated",{detail:void 0}))}),[r,i,g]);const y=(e,t)=>{x(n=>({...n,[e]:t}))},b=async e=>{const t=Object.entries(g).map(([e])=>({id:r.products[parseInt(e)].productId,title:r.products[parseInt(e)]?.productDetails?.title}));a?.({eventNameCustom:"bundle_add_to_cart",eventTypeCustom:"clicks",data:{bundleId:r._id,bundleType:"combo-bundle",selectedProducts:t}});try{if(c(!0),!i)return console.error("[ComboBundle.tsx] No addToCartFunction available"),void c(!1);const t=Object.entries(g).map(([e,t])=>{const n=r.products[parseInt(e)],o=n.productDetails.variants.edges.find(e=>e.node.id===t)?.node;return o?{variantId:t,price:Number(o.price)}:null}).filter(e=>null!==e),n=Object.values(g);await i(Number(h),n,Number(v),t,e)}catch(e){console.error("[ComboBundle.tsx] Error adding to cart:",e)}c(!1)},{originalPrice:h,dealPrice:v,offerValue:w,totalPriceSum:C,offerPercentage:E}=o(()=>{const{price:e,compareAtPrice:t}=Object.entries(g).reduce((e,[t,n])=>{const o=r.products[parseInt(t)],i=o.productDetails.variants.edges?.find(e=>e.node.id===n)?.node,a=parseFloat(i?.price??"0"),l=parseFloat(i?.compareAtPrice||a.toString());return e.price+=a,e.compareAtPrice+=l,e},{price:0,compareAtPrice:0}),n=r?.customizations?.comboBundle?.discountBadgeDisplay,o="discount-on-price"===n?e:t;let i=e;r?.percentageOff?i=e*(1-r.percentageOff/100):r?.dealAmount?i=r.dealAmount:r?.amountOff&&(i=e-r.amountOff);const a=o-i,l=o>0?Math.round((o-i)/o*100):0;return{originalPrice:o.toFixed(2),dealPrice:i.toFixed(2),offerValue:a.toFixed(2),totalPriceSum:e.toFixed(2),offerPercentage:l}},[g,r.products,r.percentageOff,r.dealAmount,r.amountOff,r?.customizations?.comboBundle?.discountBadgeDisplay]);n(()=>{a?.({eventNameCustom:"block_visibility",eventTypeCustom:"views",data:{bundleId:r._id,bundleType:"combo-bundle"}});const e=()=>{d(window.innerWidth<786)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]);const k=r.customizations,T=k.comboBundle?.comboCardStyle||"auto",S="vertical"===T||"auto"===T&&!s,$=k.comboBundle?.embedContentVisibility,N="bundles"==r.appName?r.pageHeader?.title:r?.title,B="bundles"==r.appName?r.pageHeader?.description:r?.subtitle;return e.createElement("div",{className:`yt-comboBundle-bundle-container ${"left"===k.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-left":"right"===k.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-right":"center"===k.comboBundle?.infoAlignment?"yt-comboBundle-bundle-align-center":void 0}`,style:{lineHeight:"normal",maxWidth:"800px",marginBlock:k.comboBundle?.verticalMargin||"0px",display:"flex",flexDirection:"column",alignItems:"left"===k.comboBundle?.infoAlignment?"flex-start":"right"===k.comboBundle?.infoAlignment?"flex-end":"center"===k.comboBundle?.infoAlignment?"center":void 0,textAlign:k.comboBundle?.infoAlignment??"left",fontFamily:"system-ui, -apple-system, sans-serif"}},$&&k.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&e.createElement("div",{className:"yt-comboBundle-bundle-title-container",style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px"}},e.createElement("h2",{className:"yt-comboBundle-bundle-title",style:{fontSize:k.comboBundle?.productTitleFontSize||"28px",color:k.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},N)),$&&k?.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&e.createElement(e.Fragment,null,e.createElement("div",{className:"yt-comboBundle-bundle-price-container",style:{display:"flex",alignItems:"center",gap:"8px",color:k.comboBundle?.titleTextColor||"#000",fontSize:(parseInt(k.comboBundle?.productTitleFontSize?.replace("px",""))||28)-4+"px"}},e.createElement("div",{className:"yt-comboBundle-bundle-price-details",style:{display:"flex",alignItems:"center",gap:"5px",flexWrap:"wrap"}},e.createElement("span",{className:"yt-comboBundle-bundle-deal-price-text",style:{fontWeight:"bold",lineHeight:"1",minWidth:"fit-content"}},iu(k.general.currencySymbol,r.storeCurrencyCode),ru(v)),!isNaN(Number(h))&&!isNaN(Number(v))&&Number(h)>Number(v)&&e.createElement("div",{className:"yt-comboBundle-bundle-original-price-text",style:{color:k.comboBundle?.titleTextColor||"#666",textDecoration:"line-through",verticalAlign:"middle",display:"inline-block",minWidth:"fit-content"}},iu(k.general.currencySymbol,r.storeCurrencyCode),ru(h)),Number(w)>0&&e.createElement("span",{className:"yt-comboBundle-bundle-offer-badge",style:{backgroundColor:"#D3122A",color:"white",padding:"4px 8px",fontSize:"14px",borderRadius:"20px",fontWeight:"500",lineHeight:"1",minWidth:"fit-content"}},"discount-on-compare"===k.comboBundle.discountBadgeDisplay?`${E}% Off`:r?.percentageOff?`${r?.percentageOff}% Off`:r?.amountOff?`${iu(k.general.currencySymbol,r.storeCurrencyCode)}${ru(r?.amountOff)} Off`:`Save ${iu(k.general.currencySymbol,r.storeCurrencyCode)}${ru(w)}`))),e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",margin:"15px 0px"},className:"yt-comboBundle-checkoutSpecific-container"},e.createElement("div",{style:{display:"flex",width:"12px",height:"12px",justifyContent:"center",alignItems:"center",alignContent:"center",borderRadius:"50%",backgroundColor:k.general?.ctaBackgroundColor||"#1e1e1e",flexShrink:0},className:"yt-comboBundle-checkoutSpecific-dot"},e.createElement("span",null)),e.createElement("p",{style:{fontSize:k.comboBundle.productDescriptionFontSize||"16px",color:k.comboBundle?.descriptionTextColor||"#000",alignItems:"center",margin:0,lineHeight:"1.2"},className:"yt-comboBundle-checkoutSpecific-text"},"Tax included. ",e.createElement("u",null,"Shipping")," calculated at checkout."))),k.comboBundle.subProductsSectionVisibility&&e.createElement(e.Fragment,null,S?e.createElement("div",{className:"yt-comboBundle-products-grid-vertical "+(s?"yt-comboBundle-products-grid-mobile":""),style:{display:"flex",flexDirection:"row",gap:"20px",marginTop:"10px",flexWrap:"wrap"}},r.products.map((t,n)=>{const o=t?.productDetails?.variants?.edges?.find(e=>e?.node?.id===g[n])?.node;return o?e.createElement(Es,{key:`combo-product-${n}-${t.productId}`,product:t,styles:k,originalPrice:h,dealPrice:v,totalPriceSum:C,selectedVariantId:g[n],onVariantChange:e=>y(n,e),isVertical:S,variantOptions:r.variantOptions,storeCurrencyCode:r.storeCurrencyCode}):null})):e.createElement("div",{className:"yt-comboBundle-products-list-horizontal "+(s?"yt-comboBundle-products-list-mobile":""),style:{display:"flex",flexDirection:"column",gap:"10px",width:"100%"}},k.comboBundle.subProductsSectionVisibility&&r.products.map((t,n)=>e.createElement(Es,{key:`combo-product-horizontal-${n}-${t.productId}`,product:t,styles:k,originalPrice:h,dealPrice:v,totalPriceSum:C,selectedVariantId:g[n],onVariantChange:e=>y(n,e),variantOptions:r.variantOptions})))),e.createElement("div",{className:"yt-comboBundle-bundle-cta-section",style:{borderTop:"1px solid #eee",display:"flex",flexDirection:"column",rowGap:"5px",marginTop:"20px",width:"100%"}},e.createElement("button",{className:`yt-comboBundle-bundle-cta-button ${f?"":"yt-comboBundle-bundle-cta-button-disabled"} ${s?"yt-comboBundle-bundle-cta-button-mobile":""}`,style:{backgroundColor:f?k.general?.ctaBackgroundColor||"#121212":k.general.disabledButtonColor,color:k.general?.ctaTextColor||"#FFFFFF",fontSize:"16px",borderRadius:k.general.ctaBorderRadius??"20px",fontWeight:"bold",cursor:f?"pointer":"not-allowed",border:`1px solid ${f?k.general?.ctaBackgroundColor||"#121212":k.general.disabledButtonColor}`,boxShadow:k.general.ctaShadowType,padding:k.general?.ctaPadding,width:k.general?.ctaWidth,margin:"0"},disabled:!f,onMouseOver:e=>{k.general.customizeHoverState&&f&&(e.currentTarget.style.backgroundColor=k.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=k.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{k.general.customizeHoverState&&f&&(e.currentTarget.style.backgroundColor=k.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=k.general?.ctaTextColor||"#FFFFFF")},onClick:async()=>{r?.personalizedForm?.title?u(!0):await b()}},l?e.createElement(me,{color:"white",loading:l,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):e.createElement(e.Fragment,null,f?k.comboBundle?.ctaTitle??"Add Bundle to cart":k.general.outOfStockLabel||"Out of Stock"," "))),$&&k.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&e.createElement("div",{className:"yt-comboBundle-bundle-description-section",style:{margin:"20px 0px"}},e.createElement("h4",{className:"yt-comboBundle-bundle-description-header",style:{fontSize:"16px",color:k.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:k.general.primaryColor+"20"}},"Description"),e.createElement("div",{className:"yt-comboBundle-bundle-description-content",style:{fontSize:k.comboBundle.productDescriptionFontSize||"16px",color:k.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:k.general.primaryColor+"08"}},e.createElement("p",null,B))),r?.personalizedForm?.title&&e.createElement(Cs,{isOpen:p,onClose:()=>u(!1),formConfig:r.personalizedForm,onCheckout:async e=>{await b(e),u(!1)},cta:{backgroundColor:k.general?.ctaBackgroundColor||"#121212",textColor:k.general?.ctaTextColor||"#FFFFFF"},isMobile:s}))},Ts=c.div`
3155
3155
  max-width: 800px;
3156
3156
  container-type: inline-size;
3157
3157
  margin-top: ${e=>e.verticalMargin||"0px"};
@@ -4875,7 +4875,7 @@ import e,{useState as t,useEffect as n,useMemo as o,useRef as r,useCallback as i
4875
4875
  transform: scale(1.01);
4876
4876
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
4877
4877
  }
4878
- `,Su={showPrice:!0,productImage:{id:"",path:""},buyNowCtaTitle:"BUY NOW",desktopBarType:"stretch",showProductName:!0,showBuyNowButton:!1,showProductImage:!0,addToCartCtaTitle:"ADD TO CART",showAddToCartButton:!0,showVariantSelector:!1,productInfoVisibility:!0,excludeProducts:[],showBarOnDesktop:!0,ctaButtonFontSize:18,startsAppearingAtHeight:200,fullyAppearsAtHeight:400,alwaysPersistent:!1},$u=({showStickyCart:o,product:a,addCartItem:l,onSetLoading:c,themeColor:s,cartData:d,isCartOpen:p,setIsCartOpen:u,ctaButtonBackgroundColor:m,ctaButtonTextColor:g,addToStickyCart:x,cartComponentsCornerType:f,cartComponentsCornerRadius:y,themeTextColor:b,stickyCartCustomizationData:h,checkoutFunction:v,backgroundColor:w,primaryTextColor:C,comboBundleData:E,comboBundleAddToCartFunction:k,volumeBundleCurrentTier:T,volumeBundleData:S,volumeBundleAddToCartFunction:$})=>{const[N,B]=t(""),[F,z]=t(null),[I,D]=t({}),P=cr(),[A,_]=t(null),R=r(null);n(()=>{const e=e=>{R.current&&!R.current.contains(e.target)&&_(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const L=i((e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),o=n?.node;return o?e.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[]),O=i(()=>E&&"combo"===E.type?E?.products?.[0]?.productDetails?.variants?.edges?.find(e=>L(E.products[0].productDetails,e?.node?.id)>0)?.node:a?.variants?.find(e=>e?.available),[E,a,L]),[M,W]=t(()=>{if(!E||"combo"!==E.type)return{};const e={};return E?.products?.forEach((t,n)=>{const o=t?.productDetails?.variants?.edges?.find(e=>L(t.productDetails,e?.node?.id)>0)?.node;o?e[n]=o.id:t?.productDetails?.variants?.edges?.length>0&&(e[n]=t.productDetails.variants.edges[0].node.id)}),e}),V=i(e=>{if(!E||"combo"!==E.type)return;const t={};E?.products?.forEach((n,o)=>{const r=n?.productDetails?.variants?.edges?.find(t=>{const o=t?.node;return n?.productDetails?.options?.every((t,n)=>{const r=e?.[t?.name],i=o?.title?.split(" / ")?.at(n);return!(!r||!i)&&r.trim().toLowerCase()===i.trim().toLowerCase()})});r?.node?.id&&(t[o]=r.node.id)}),Object.keys(t).length>0&&W(e=>({...e,...t}))},[E]);n(()=>{const e=O();if(e){B(String(e.id)),z(e);const t={};a?.options&&Array.isArray(a.options)&&a.options.forEach((n,o)=>{const r=`option${o+1}`;e?.[r]&&(t[n?.name]=e[r])}),D(t)}else if(a?.variants?.length>0){const e=a.variants[0];B(String(e.id)),z(e);const t={};a?.options&&Array.isArray(a.options)&&a.options.forEach((n,o)=>{const r=`option${o+1}`;e?.[r]&&(t[n?.name]=e[r])}),D(t)}},[a,O]);const j=i(()=>new URLSearchParams(window.location.search).get("variant")||"",[]),H=()=>{const e=j();if(e){const t=a?.variants?.find(t=>String(t?.id)===String(e));if(t&&t?.available){B(String(t.id)),z(t);const e={};a?.options?.forEach((n,o)=>{const r=`option${o+1}`;t?.[r]&&(e[n?.name]=t[r])}),D(e)}else{const e=O();e?(B(String(e.id)),z(e)):a?.variants?.length>0&&(B(String(a.variants[0].id)),z(a.variants[0]))}}};n(()=>{H();const e=new Event("urlChange");let t=!0;const n=window.history.pushState,o=window.history.replaceState;return window.history.pushState=function(){t&&(n.apply(this,arguments),window.dispatchEvent(e))},window.history.replaceState=function(){t&&(o.apply(this,arguments),window.dispatchEvent(e))},window.addEventListener("urlChange",H),()=>{t=!1,window.removeEventListener("urlChange",H),window.history.pushState=n,window.history.replaceState=o}},[j,a,O]);const q=r(null),[Q,U]=t(1),Y=ln(d,d?.currency),G=e.useMemo(()=>{if(!E||"combo"!==E.type)return null;const{price:e,compareAtPrice:t}=Object.entries(M).reduce((e,[t,n])=>{const o=E.products?.[Number(t)],r=o?.productDetails?.variants?.edges?.find(e=>e?.node?.id===n)?.node,i=parseFloat(r?.price??"0"),a=parseFloat(r?.compareAtPrice||i.toString());return e.price+=i,e.compareAtPrice+=a,e},{price:0,compareAtPrice:0}),n=Math.max(e,t);let o=Math.min(e,t);return E?.percentageOff?o=e*(1-E.percentageOff/100):E?.dealAmount?o=E.dealAmount:E?.amountOff&&(o=e-E.amountOff),{originalPrice:n.toFixed(2),dealPrice:o.toFixed(2),savings:(n-o).toFixed(2),hasSavings:n>o}},[E,M]),X=e.useMemo(()=>{if(!T||!F)return null;const e=parseFloat(F.price??"0"),t=parseFloat(F.compare_at_price||e.toString()),n=rn(e,d?.currency),o=rn(t,d?.currency),r=T.minimumQuantity,i=Math.max(n,o)*r;let a=n*r;const l=S?.discountType||T.discountType;"percentOff"===l?a*=1-T.discountValue/100:"amountOff"===l&&(a-=T.discountValue);const c=Math.max(0,a);return{originalPrice:i.toFixed(2),dealPrice:c.toFixed(2),savings:(i-c).toFixed(2),hasSavings:i>c&&void 0!==l}},[T,S,F,d]);n(()=>{(async()=>{try{if(E&&"combo"===E.type)return;a&&N&&z(a?.variants?.filter(e=>String(e?.id)===String(N))[0])}catch(e){console.error("Error getting selected product variant id")}})()},[a,N,E]),n(()=>{const e=e=>{const t=e;t.detail?.selectedVariants&&W(t.detail.selectedVariants)};return window.addEventListener("yt-combo-bundle-updated",e),()=>{window.removeEventListener("yt-combo-bundle-updated",e)}},[]);const{cartLoading:Z}=nn(),K=r(null),[J,ee]=t(0);n(()=>{K.current&&ee(K.current.offsetWidth)},[]);const te=a?.options?.find(e=>e?.name?.toLowerCase()?.includes("color"))?.name,ne=te?I?.[te]:null,oe=h&&(re=h,0!==Object.keys(re).length||re.constructor!==Object)?h:Su;var re;const{showProductName:ie,showPrice:ae,showVariantSelector:le,showBuyNowButton:ce,showAddToCartButton:se,desktopBarType:de,showProductImage:pe,buyNowCtaTitle:ue,addToCartCtaTitle:ge,productInfoVisibility:xe,showBarOnDesktop:fe,ctaButtonFontSize:ye,startsAppearingAtHeight:be,fullyAppearsAtHeight:he,topRibbonText:ve,alwaysPersistent:we}=oe,[Ce,Ee]=t(we?1:0),[ke,Te]=t(we?0:100),[Se,$e]=t(!1);if(n(()=>{if(we)return Ee(1),void Te(0);const e=()=>{const e=window.scrollY;document.documentElement.scrollHeight;const t=be||200,n=he||400;if(e>t){const o=Math.min((e-t)/(n-t),1);Ee(o),Te(100-100*o)}else Ee(0),Te(100)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[we,be,he]),n(()=>{const e=()=>{const e=window.innerWidth<768;$e(e||!1!==fe)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[fe]),a?.variants?.length<1)return null;const Ne=O(),Be=E&&"combo"===E.type?E?.products?.[0]?.productDetails?.variants?.edges?.find(e=>e?.node?.id===M?.[0])?.node?.price:F?.price??Ne?.price??a?.variants?.[0]?.price;if(0===Number(Be)&&(!E||"combo"!==E.type))return null;if(!o||!Se)return null;if(h?.excludeProducts?.includes(a?.handle))return null;const Fe=E&&"combo"===E.type?E.products?.every((e,t)=>{const n=M[t];return!!n&&L(e.productDetails,n)>0})??!1:F?.available??!0;return e.createElement(bu,{className:"yt-sticky-bar-container",$opacity:Ce,$translateY:ke,$desktopBarType:de||"stretch"},e.createElement(hu,{className:"yt-sticky-bar-inner-container",$desktopBarType:de||"stretch",$themeColor:s,$cornerType:f??"sharp",$cornerRadius:y??20,$themeTextColor:b,$productInfoVisibility:xe,$topRibbonText:ve,$backgroundColor:w},xe&&e.createElement(vu,null,pe&&e.createElement(wu,{className:"yt-sticky-bar-product-image",src:((e,t)=>"string"==typeof e?.featured_image?e.featured_image:e?.featured_image?.src?e.featured_image.src:t?.featured_image)(F,a),alt:F?.name}),e.createElement(Cu,{ref:K,className:"yt-sticky-bar-product-details"},ie&&e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},e.createElement("span",{style:{fontSize:"20px",fontWeight:"500",color:C,display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",lineHeight:"normal"}},`${a?.title}`),ne&&e.createElement("span",{style:{fontSize:"11px",color:"#666",backgroundColor:"#f1f1f1",padding:"2px 6px",borderRadius:"10px",border:"1px solid #ddd"}},ne)),a?.variants?.length>1&&le&&e.createElement(fu,{className:"yt-sticky-bar-option-container",ref:R},a?.options?.map(t=>{const n=P?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase()),o=I[t.name],r=A===t.name,i=e=>{((e,t)=>{const n={...I,[e]:t};D(n);const o=a?.variants?.find(e=>a?.options?.every((t,o)=>{const r=n?.[t?.name],i=e?.[`option${o+1}`];return"string"==typeof r&&"string"==typeof i?r.trim().toLowerCase()===i.trim().toLowerCase():r===i}));o&&(B(String(o.id)),z(o)),E&&"combo"===E?.type&&V(n)})(t.name,e),_(null)},l=lr(n,o);return e.createElement("div",{key:t.name,style:{display:"flex",alignItems:"center",gap:"8px"}},e.createElement(yu,null,t.name),e.createElement(su,null,e.createElement(du,{onClick:()=>{_(r?null:t.name)},className:"yt-sticky-bar-dropdown-button"},"color"===n?.type&&l?.value?e.createElement(mu,{$colorValue:l.value}):"image"===n?.type&&l?.value?e.createElement(gu,{src:l.value}):null,o,e.createElement(xu,{size:8,$isOpen:r})),r&&e.createElement(pu,{$backgroundColor:w,className:"yt-sticky-bar-dropdown-panel"},t.values.map(t=>{const o=lr(n,t);return e.createElement(uu,{className:"yt-sticky-bar-dropdown-item",key:t,onClick:()=>i(t)},"color"===n?.type&&o?.value?e.createElement(mu,{$colorValue:o.value}):"image"===n?.type&&o?.value?e.createElement(gu,{src:o.value}):null,t)}))))})),ae&&e.createElement(e.Fragment,null,G?G.hasSavings?e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:5,alignItems:"center"}},e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,ru(G.dealPrice)),e.createElement("span",{style:{textDecoration:"line-through",color:"#6b7280",fontSize:14},className:"yt-sticky-bar-product-compare-price"},`${Y}`,ru(G.originalPrice)),e.createElement("span",{style:{backgroundColor:s??"black",color:b??"white",padding:"3px 9px",fontSize:"12px",borderRadius:"rounded"===f?`${y}px`:"0"},className:"yt-sticky-bar-product-discount"},"Save ",`${Y}`,ru(G.savings))):e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,ru(G.dealPrice)):X?X.hasSavings?e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:5,alignItems:"center"}},e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,ru(X.dealPrice)),e.createElement("span",{style:{textDecoration:"line-through",color:"#6b7280",fontSize:14},className:"yt-sticky-bar-product-compare-price"},`${Y}`,ru(X.originalPrice)),e.createElement("span",{style:{backgroundColor:s??"black",color:b??"white",padding:"3px 9px",fontSize:"12px",borderRadius:"rounded"===f?`${y}px`:"0"},className:"yt-sticky-bar-product-discount"},"Save ",`${Y}`,ru(X.savings))):e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,ru(X.dealPrice)):F?.compare_at_price&&F?.compare_at_price>F?.price?e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:5,alignItems:"center"}},e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,rn(F?.price,d?.currency)),e.createElement("span",{style:{textDecoration:"line-through",color:"#6b7280",fontSize:14},className:"yt-sticky-bar-product-compare-price"},`${Y}`,rn(F?.compare_at_price,d?.currency)),e.createElement("span",{style:{backgroundColor:s??"black",color:b??"white",padding:"3px 9px",fontSize:"12px",borderRadius:"rounded"===f?`${y}px`:"0"},className:"yt-sticky-bar-product-discount"},"Save ",`${Y}`,rn(F?.compare_at_price-F?.price,d?.currency))):e.createElement(e.Fragment,null,e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${Y}`,rn(F?.price,d?.currency)))),e.createElement("span",{style:{color:"#6E747B",fontSize:10},className:"yt-sticky-bar-product-tax-inclusion"},"Inclusive of all taxes"))),e.createElement(Eu,{className:"yt-sticky-bar-product-line-item-control",$flexDirection:xe?"row":"column"},se&&e.createElement(Tu,{ref:q,onClick:async()=>{if(E&&"combo"===E.type){if(!k)return void console.error("[StickyCart.tsx] comboBundleAddToCartFunction is undefined");const e=Object.entries(M);if(0===e.length)return;const t=e.map(([,e])=>e),n=e.map(([e,t])=>{const n=E?.products?.[Number(e)],o=n?.productDetails?.variants?.edges?.find(e=>e?.node?.id===t)?.node;return o?{variantId:t,price:Number(o?.price),compareAtPrice:Number(o?.compareAtPrice||o?.price)}:null}).filter(e=>null!==e),o=n.reduce((e,t)=>e+Math.max(t.compareAtPrice,t.price),0),r=n.reduce((e,t)=>e+t.price,0);let i=Math.min(o,r);E?.percentageOff?i=r*(1-E.percentageOff/100):E?.dealAmount?i=E.dealAmount:E?.amountOff&&(i=r-E.amountOff);const a=n.map(({variantId:e,price:t})=>({variantId:e,price:t}));try{await k(Number(o.toFixed(2)),t,Number(i.toFixed(2)),a)}catch(e){console.error("[StickyCart.tsx] Error adding combo bundle to cart:",e)}return}if(T&&T.minimumQuantity>1){if(!$)return void console.error("[StickyCart.tsx] volumeBundleAddToCartFunction is undefined");const e=String(N)??String(a?.variants[0]?.id),t=Array(T.minimumQuantity).fill(e),n=X?Number(X.originalPrice):0;try{await $(n,t)}catch(e){console.error("[StickyCart.tsx] Error adding volume bundle to cart:",e)}return}x&&await x(String(N)??String(a?.variants[0]?.id),Q)},disabled:Z.cartLoading||!Fe,$bgColor:Fe?m:"#d1d5db",$textColor:Fe?g:"#6b7280",className:"yt-sticky-add-to-cart-button",$cornerType:f??"sharp",$cornerRadius:y??20,$fontSize:ye,style:{cursor:Fe?"pointer":"not-allowed",opacity:Fe?1:.6}},Z.cartLoading?e.createElement(me,{color:"white",loading:Z.cartLoading,size:15}):e.createElement(e.Fragment,null,Fe?ge??"Add to Cart":"Out of Stock")),ce&&e.createElement(ku,{onClick:async()=>{try{v&&await v(String(N)??String(a?.variants[0]?.id),Q)}catch(e){console.error("Error checking out from sticky bar")}},id:"yt-checkout-button",className:"yt-checkout-button",disabled:Z.cartLoading||!Fe,$bgColor:Fe?s:"#d1d5db",$textColor:Fe?b:"#6b7280",$cornerType:f??"sharp",$cornerRadius:y??20,$fontSize:ye,style:{cursor:Fe?"pointer":"not-allowed",opacity:Fe?1:.6}},Z.cartLoading?e.createElement(me,{color:"white",loading:Z.cartLoading,size:15}):e.createElement(e.Fragment,null,Fe?ue??"Buy Now":"Out of Stock")))))},Nu=c.div`
4878
+ `,Su={showPrice:!0,productImage:{id:"",path:""},buyNowCtaTitle:"BUY NOW",desktopBarType:"stretch",showProductName:!0,showBuyNowButton:!1,showProductImage:!0,addToCartCtaTitle:"ADD TO CART",showAddToCartButton:!0,showVariantSelector:!1,productInfoVisibility:!0,excludeProducts:[],showBarOnDesktop:!0,ctaButtonFontSize:18,startsAppearingAtHeight:200,fullyAppearsAtHeight:400,alwaysPersistent:!1},$u=({showStickyCart:o,product:a,addCartItem:l,onSetLoading:c,themeColor:s,cartData:d,isCartOpen:p,setIsCartOpen:u,ctaButtonBackgroundColor:m,ctaButtonTextColor:g,addToStickyCart:x,cartComponentsCornerType:f,cartComponentsCornerRadius:y,themeTextColor:b,stickyCartCustomizationData:h,checkoutFunction:v,backgroundColor:w,primaryTextColor:C,comboBundleData:E,comboBundleAddToCartFunction:k,volumeBundleCurrentTier:T,volumeBundleData:S,volumeBundleAddToCartFunction:$})=>{const[N,B]=t(""),[F,z]=t(null),[I,D]=t({}),P=cr(),[A,_]=t(null),R=r(null),{cartLoading:L,setLoading:O}=nn();n(()=>{const e=e=>{R.current&&!R.current.contains(e.target)&&_(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]);const M=i((e,t)=>{const n=e?.variants?.edges?.find(e=>e.node.id===t),o=n?.node;return o?e.tracksInventory&&o.inventoryItem?.tracked?o.inventoryQuantity>0?o.inventoryQuantity:o.inventoryQuantity<=0&&"continue"===o.inventoryPolicy?.toLowerCase()?1/0:0:1/0:0},[]),W=i(()=>E&&"combo"===E.type?E?.products?.[0]?.productDetails?.variants?.edges?.find(e=>M(E.products[0].productDetails,e?.node?.id)>0)?.node:a?.variants?.find(e=>e?.available),[E,a,M]),[V,j]=t(()=>{if(!E||"combo"!==E.type)return{};const e={};return E?.products?.forEach((t,n)=>{const o=t?.productDetails?.variants?.edges?.find(e=>M(t.productDetails,e?.node?.id)>0)?.node;o?e[n]=o.id:t?.productDetails?.variants?.edges?.length>0&&(e[n]=t.productDetails.variants.edges[0].node.id)}),e}),H=i(e=>{if(!E||"combo"!==E.type)return;const t={};E?.products?.forEach((n,o)=>{const r=n?.productDetails?.variants?.edges?.find(t=>{const o=t?.node;return n?.productDetails?.options?.every((t,n)=>{const r=e?.[t?.name],i=o?.title?.split(" / ")?.at(n);return!(!r||!i)&&r.trim().toLowerCase()===i.trim().toLowerCase()})});r?.node?.id&&(t[o]=r.node.id)}),Object.keys(t).length>0&&j(e=>({...e,...t}))},[E]);n(()=>{const e=W();if(e){B(String(e.id)),z(e);const t={};a?.options&&Array.isArray(a.options)&&a.options.forEach((n,o)=>{const r=`option${o+1}`;e?.[r]&&(t[n?.name]=e[r])}),D(t)}else if(a?.variants?.length>0){const e=a.variants[0];B(String(e.id)),z(e);const t={};a?.options&&Array.isArray(a.options)&&a.options.forEach((n,o)=>{const r=`option${o+1}`;e?.[r]&&(t[n?.name]=e[r])}),D(t)}},[a,W]);const q=i(()=>new URLSearchParams(window.location.search).get("variant")||"",[]),Q=()=>{const e=q();if(e){const t=a?.variants?.find(t=>String(t?.id)===String(e));if(t&&t?.available){B(String(t.id)),z(t);const e={};a?.options?.forEach((n,o)=>{const r=`option${o+1}`;t?.[r]&&(e[n?.name]=t[r])}),D(e)}else{const e=W();e?(B(String(e.id)),z(e)):a?.variants?.length>0&&(B(String(a.variants[0].id)),z(a.variants[0]))}}};n(()=>{Q();const e=new Event("urlChange");let t=!0;const n=window.history.pushState,o=window.history.replaceState;return window.history.pushState=function(){t&&(n.apply(this,arguments),window.dispatchEvent(e))},window.history.replaceState=function(){t&&(o.apply(this,arguments),window.dispatchEvent(e))},window.addEventListener("urlChange",Q),()=>{t=!1,window.removeEventListener("urlChange",Q),window.history.pushState=n,window.history.replaceState=o}},[q,a,W]);const U=r(null),[Y,G]=t(1),X=ln(d,d?.currency),Z=e.useMemo(()=>{if(!E||"combo"!==E.type)return null;const{price:e,compareAtPrice:t}=Object.entries(V).reduce((e,[t,n])=>{const o=E.products?.[Number(t)],r=o?.productDetails?.variants?.edges?.find(e=>e?.node?.id===n)?.node,i=parseFloat(r?.price??"0"),a=parseFloat(r?.compareAtPrice||i.toString());return e.price+=i,e.compareAtPrice+=a,e},{price:0,compareAtPrice:0}),n=Math.max(e,t);let o=Math.min(e,t);return E?.percentageOff?o=e*(1-E.percentageOff/100):E?.dealAmount?o=E.dealAmount:E?.amountOff&&(o=e-E.amountOff),{originalPrice:n.toFixed(2),dealPrice:o.toFixed(2),savings:(n-o).toFixed(2),hasSavings:n>o}},[E,V]),K=e.useMemo(()=>{if(!T||!F)return null;const e=parseFloat(F.price??"0"),t=parseFloat(F.compare_at_price||e.toString()),n=rn(e,d?.currency),o=rn(t,d?.currency),r=T.minimumQuantity,i=Math.max(n,o)*r;let a=n*r;const l=S?.discountType||T.discountType;"percentOff"===l?a*=1-T.discountValue/100:"amountOff"===l&&(a-=T.discountValue);const c=Math.max(0,a);return{originalPrice:i.toFixed(2),dealPrice:c.toFixed(2),savings:(i-c).toFixed(2),hasSavings:i>c&&void 0!==l}},[T,S,F,d]);n(()=>{(async()=>{try{if(E&&"combo"===E.type)return;a&&N&&z(a?.variants?.filter(e=>String(e?.id)===String(N))[0])}catch(e){console.error("Error getting selected product variant id")}})()},[a,N,E]),n(()=>{const e=e=>{const t=e;t.detail?.selectedVariants&&j(t.detail.selectedVariants)};return window.addEventListener("yt-combo-bundle-updated",e),()=>{window.removeEventListener("yt-combo-bundle-updated",e)}},[]);const J=r(null),[ee,te]=t(0);n(()=>{J.current&&te(J.current.offsetWidth)},[]);const ne=a?.options?.find(e=>e?.name?.toLowerCase()?.includes("color"))?.name,oe=ne?I?.[ne]:null,re=h&&(ie=h,0!==Object.keys(ie).length||ie.constructor!==Object)?h:Su;var ie;const{showProductName:ae,showPrice:le,showVariantSelector:ce,showBuyNowButton:se,showAddToCartButton:de,desktopBarType:pe,showProductImage:ue,buyNowCtaTitle:ge,addToCartCtaTitle:xe,productInfoVisibility:fe,showBarOnDesktop:ye,ctaButtonFontSize:be,startsAppearingAtHeight:he,fullyAppearsAtHeight:ve,topRibbonText:we,alwaysPersistent:Ce}=re,[Ee,ke]=t(Ce?1:0),[Te,Se]=t(Ce?0:100),[$e,Ne]=t(!1);if(n(()=>{if(Ce)return ke(1),void Se(0);const e=()=>{const e=window.scrollY;document.documentElement.scrollHeight;const t=he||200,n=ve||400;if(e>t){const o=Math.min((e-t)/(n-t),1);ke(o),Se(100-100*o)}else ke(0),Se(100)};return window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[Ce,he,ve]),n(()=>{const e=()=>{const e=window.innerWidth<768;Ne(e||!1!==ye)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[ye]),a?.variants?.length<1)return null;const Be=W(),Fe=E&&"combo"===E.type?E?.products?.[0]?.productDetails?.variants?.edges?.find(e=>e?.node?.id===V?.[0])?.node?.price:F?.price??Be?.price??a?.variants?.[0]?.price;if(0===Number(Fe)&&(!E||"combo"!==E.type))return null;if(!o||!$e)return null;if(h?.excludeProducts?.includes(a?.handle))return null;const ze=E&&"combo"===E.type?E.products?.every((e,t)=>{const n=V[t];return!!n&&M(e.productDetails,n)>0})??!1:F?.available??!0;return e.createElement(bu,{className:"yt-sticky-bar-container",$opacity:Ee,$translateY:Te,$desktopBarType:pe||"stretch"},e.createElement(hu,{className:"yt-sticky-bar-inner-container",$desktopBarType:pe||"stretch",$themeColor:s,$cornerType:f??"sharp",$cornerRadius:y??20,$themeTextColor:b,$productInfoVisibility:fe,$topRibbonText:we,$backgroundColor:w},fe&&e.createElement(vu,null,ue&&e.createElement(wu,{className:"yt-sticky-bar-product-image",src:((e,t)=>"string"==typeof e?.featured_image?e.featured_image:e?.featured_image?.src?e.featured_image.src:t?.featured_image)(F,a),alt:F?.name}),e.createElement(Cu,{ref:J,className:"yt-sticky-bar-product-details"},ae&&e.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px"}},e.createElement("span",{style:{fontSize:"20px",fontWeight:"500",color:C,display:"-webkit-box",WebkitLineClamp:1,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis",lineHeight:"normal"}},`${a?.title}`),oe&&e.createElement("span",{style:{fontSize:"11px",color:"#666",backgroundColor:"#f1f1f1",padding:"2px 6px",borderRadius:"10px",border:"1px solid #ddd"}},oe)),a?.variants?.length>1&&ce&&e.createElement(fu,{className:"yt-sticky-bar-option-container",ref:R},a?.options?.map(t=>{const n=P?.options?.find(e=>e.name.trim().toLowerCase()===t.name.trim().toLowerCase()),o=I[t.name],r=A===t.name,i=e=>{((e,t)=>{const n={...I,[e]:t};D(n);const o=a?.variants?.find(e=>a?.options?.every((t,o)=>{const r=n?.[t?.name],i=e?.[`option${o+1}`];return"string"==typeof r&&"string"==typeof i?r.trim().toLowerCase()===i.trim().toLowerCase():r===i}));o&&(B(String(o.id)),z(o)),E&&"combo"===E?.type&&H(n)})(t.name,e),_(null)},l=lr(n,o);return e.createElement("div",{key:t.name,style:{display:"flex",alignItems:"center",gap:"8px"}},e.createElement(yu,null,t.name),e.createElement(su,null,e.createElement(du,{onClick:()=>{_(r?null:t.name)},className:"yt-sticky-bar-dropdown-button"},"color"===n?.type&&l?.value?e.createElement(mu,{$colorValue:l.value}):"image"===n?.type&&l?.value?e.createElement(gu,{src:l.value}):null,o,e.createElement(xu,{size:8,$isOpen:r})),r&&e.createElement(pu,{$backgroundColor:w,className:"yt-sticky-bar-dropdown-panel"},t.values.map(t=>{const o=lr(n,t);return e.createElement(uu,{className:"yt-sticky-bar-dropdown-item",key:t,onClick:()=>i(t)},"color"===n?.type&&o?.value?e.createElement(mu,{$colorValue:o.value}):"image"===n?.type&&o?.value?e.createElement(gu,{src:o.value}):null,t)}))))})),le&&e.createElement(e.Fragment,null,Z?Z.hasSavings?e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:5,alignItems:"center"}},e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${X}`,ru(Z.dealPrice)),e.createElement("span",{style:{textDecoration:"line-through",color:"#6b7280",fontSize:14},className:"yt-sticky-bar-product-compare-price"},`${X}`,ru(Z.originalPrice)),e.createElement("span",{style:{backgroundColor:s??"black",color:b??"white",padding:"3px 9px",fontSize:"12px",borderRadius:"rounded"===f?`${y}px`:"0"},className:"yt-sticky-bar-product-discount"},"Save ",`${X}`,ru(Z.savings))):e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${X}`,ru(Z.dealPrice)):K?K.hasSavings?e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:5,alignItems:"center"}},e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${X}`,ru(K.dealPrice)),e.createElement("span",{style:{textDecoration:"line-through",color:"#6b7280",fontSize:14},className:"yt-sticky-bar-product-compare-price"},`${X}`,ru(K.originalPrice)),e.createElement("span",{style:{backgroundColor:s??"black",color:b??"white",padding:"3px 9px",fontSize:"12px",borderRadius:"rounded"===f?`${y}px`:"0"},className:"yt-sticky-bar-product-discount"},"Save ",`${X}`,ru(K.savings))):e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${X}`,ru(K.dealPrice)):F?.compare_at_price&&F?.compare_at_price>F?.price?e.createElement("div",{style:{display:"flex",flexDirection:"row",gap:5,alignItems:"center"}},e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${X}`,rn(F?.price,d?.currency)),e.createElement("span",{style:{textDecoration:"line-through",color:"#6b7280",fontSize:14},className:"yt-sticky-bar-product-compare-price"},`${X}`,rn(F?.compare_at_price,d?.currency)),e.createElement("span",{style:{backgroundColor:s??"black",color:b??"white",padding:"3px 9px",fontSize:"12px",borderRadius:"rounded"===f?`${y}px`:"0"},className:"yt-sticky-bar-product-discount"},"Save ",`${X}`,rn(F?.compare_at_price-F?.price,d?.currency))):e.createElement(e.Fragment,null,e.createElement("span",{style:{fontWeight:"500",fontSize:18,color:C},className:"yt-sticky-bar-product-price"},`${X}`,rn(F?.price,d?.currency)))),e.createElement("span",{style:{color:"#6E747B",fontSize:10},className:"yt-sticky-bar-product-tax-inclusion"},"Inclusive of all taxes"))),e.createElement(Eu,{className:"yt-sticky-bar-product-line-item-control",$flexDirection:fe?"row":"column"},de&&e.createElement(Tu,{ref:U,onClick:async()=>{if(E&&"combo"===E.type){if(!k)return void console.error("[StickyCart.tsx] comboBundleAddToCartFunction is undefined");const e=Object.entries(V);if(0===e.length)return;const t=e.map(([,e])=>e),n=e.map(([e,t])=>{const n=E?.products?.[Number(e)],o=n?.productDetails?.variants?.edges?.find(e=>e?.node?.id===t)?.node;return o?{variantId:t,price:Number(o?.price),compareAtPrice:Number(o?.compareAtPrice||o?.price)}:null}).filter(e=>null!==e),o=n.reduce((e,t)=>e+Math.max(t.compareAtPrice,t.price),0),r=n.reduce((e,t)=>e+t.price,0);let i=Math.min(o,r);E?.percentageOff?i=r*(1-E.percentageOff/100):E?.dealAmount?i=E.dealAmount:E?.amountOff&&(i=r-E.amountOff);const a=n.map(({variantId:e,price:t})=>({variantId:e,price:t}));O(!0,!1);try{await k(Number(o.toFixed(2)),t,Number(i.toFixed(2)),a)}catch(e){console.error("[StickyCart.tsx] Error adding combo bundle to cart:",e)}finally{O(!1,!1)}return}if(T&&T.minimumQuantity>1){if(!$)return void console.error("[StickyCart.tsx] volumeBundleAddToCartFunction is undefined");const e=String(N)??String(a?.variants[0]?.id),t=Array(T.minimumQuantity).fill(e),n=K?Number(K.originalPrice):0;O(!0,!1);try{await $(n,t)}catch(e){console.error("[StickyCart.tsx] Error adding volume bundle to cart:",e)}finally{O(!1,!1)}return}x&&await x(String(N)??String(a?.variants[0]?.id),Y)},disabled:L.cartLoading||!ze,$bgColor:ze?m:"#d1d5db",$textColor:ze?g:"#6b7280",className:"yt-sticky-add-to-cart-button",$cornerType:f??"sharp",$cornerRadius:y??20,$fontSize:be,style:{cursor:ze?"pointer":"not-allowed",opacity:ze?1:.6}},L.cartLoading?e.createElement(me,{color:"white",loading:L.cartLoading,size:15}):e.createElement(e.Fragment,null,ze?xe??"Add to Cart":"Out of Stock")),se&&e.createElement(ku,{onClick:async()=>{try{v&&await v(String(N)??String(a?.variants[0]?.id),Y)}catch(e){console.error("Error checking out from sticky bar")}},id:"yt-checkout-button",className:"yt-checkout-button",disabled:L.cartLoading||!ze,$bgColor:ze?s:"#d1d5db",$textColor:ze?b:"#6b7280",$cornerType:f??"sharp",$cornerRadius:y??20,$fontSize:be,style:{cursor:ze?"pointer":"not-allowed",opacity:ze?1:.6}},L.cartLoading?e.createElement(me,{color:"white",loading:L.cartLoading,size:15}):e.createElement(e.Fragment,null,ze?ge??"Buy Now":"Out of Stock")))))},Nu=c.div`
4879
4879
  width: 100%;
4880
4880
  height: 100%;
4881
4881
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yt-uikit",
3
- "version": "0.9.37",
3
+ "version": "0.9.38",
4
4
  "description": "YourToken UI Kit",
5
5
  "scripts": {
6
6
  "rollup": "rm -rf dist && tsc && rollup -c",