yt-uikit 0.7.361-optimizations-test.2 → 0.7.361-optimizations-test.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js +2 -2
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -3530,7 +3530,7 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
3530
3530
|
font-size: 1em;
|
|
3531
3531
|
justify-content: center;
|
|
3532
3532
|
align-items: center;
|
|
3533
|
-
`;const Lm=n(((e,n)=>{const[r,o]=Gt(Zu),a=(e.disableInventoryTracking?r?.variants.edges?.filter((t=>t.node.inventoryQuantity>0||e.disableInventoryTracking)):r?.variants.edges)??[],[i,s]=c(a[0]?.node),[d,p]=c(0),[u,m]=c("undefined"!=typeof window&&window.innerWidth<=600),[f,g]=c(1),[h,x]=c("idle"),[y,b]=c(null),[w,C]=c(null);l((()=>{if(r){const t=r.variants.edges?.filter((t=>t.node.inventoryQuantity>0||e.disableQuantitySelector));s(r?.selectedVariant??t[0]?.node)}}),[r]),l((()=>{const t=e.selectedProducts.find((e=>e.variantId===i?.id));g(t?t.quantity:0)}),[f,e.selectedProducts,i]);const k=()=>{i?.id&&r&&(x("check"),e.handleAddToBundle(i?.id,r,1),setTimeout((()=>{x("idle"),o(void 0)}),500))};if(l((()=>{const e=()=>m(window.innerWidth<=600);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),!r||0===a.length)return null;const{title:E,descriptionHtml:T,media:S,variants:$}=r,B=S.edges.map((e=>e?.node.preview.image??e?.node.image)).filter((e=>e?.url?.length>0));l((()=>{if(r&&i?.image?.url&&Array.isArray(B)){const e=B.findIndex((e=>e?.url===i?.image?.url));-1!==e&&e!==d&&p(e)}}),[i]);const z=t=>{const n=t.target.value,r=a.find((e=>e.node.id===n))?.node;r&&(r.inventoryQuantity>0||e.disableInventoryTracking)&&s(r)};l((()=>{if(r){window.history.pushState({modalOpen:!0},"",window.location.href);const e=e=>{o(void 0),e.preventDefault()};return window.addEventListener("popstate",e),()=>{window.removeEventListener("popstate",e),window.history.state?.modalOpen&&window.history.back()}}}),[r,o]);const D=e=>{b(e.targetTouches[0].clientX),C(null)},I=e=>{C(e.targetTouches[0].clientX)},_=()=>{if(null!==y&&null!==w&&B.length>1){const e=y-w,t=50;e>t?p((e=>e<B.length-1?e+1:0)):e<-t&&p((e=>e>0?e-1:B.length-1))}b(null),C(null)},O=e.hideAddToBundle||(i?.inventoryQuantity??0)<=0&&!e.disableInventoryTracking||e?.disableQuantitySelector&&f>=1||"idle"!==h,P=t.createElement(Fm,null,t.createElement(Mm,{$isSmallScreen:u,ref:n},t.createElement(Rm,{ref:n,className:"yt-variant-selection-modal"},t.createElement("div",{className:"yt-variant-selection-modal "+(u?"small-screen":"large-screen")},t.createElement(Nm,{onClick:()=>{o(void 0)},style:{backgroundColor:"white"}},t.createElement(lt,{size:"25"})),t.createElement("div",{className:"image-section"},t.createElement(t.Fragment,null,t.createElement("div",{onTouchStart:D,onTouchMove:I,onTouchEnd:_},t.createElement(Am,{small:$h(B[d]?.url),medium:$h(B[d]?.url),large:$h(B[d]?.url),hideDownload:!0,className:"main-image",imageBackgroundColor:"#000"})),t.createElement("div",{className:"image-gallery",style:{display:"flex",flexDirection:"row",overflow:"auto",gap:"10px",scrollbarWidth:"none"}},B.length>1&&B.filter((e=>e?.url.length>0)).map(((n,r)=>t.createElement("img",{key:r,src:$h(n?.url),alt:n.altText||`${E} - Image ${r+1}`,onClick:()=>p(r),className:d===r?"active":"",style:{width:"73px",height:"73px",cursor:"pointer",borderRadius:"7px",border:"1px solid lightgray",...d===r&&{border:`2px solid ${e.themeColor||"#111"}`},objectFit:"cover"},loading:"lazy"})))))),t.createElement("div",{className:"details-section",style:{marginLeft:"20px",minHeight:"100%",maxHeight:"70vh",scrollbarWidth:"none",overflowY:"auto",display:"flex",flexDirection:"column"}},t.createElement("h2",null,a.length>1?i?.displayName:r.title),"ratingOnly"===e.reviewRatingType&&(r?.rating?.averageRating??0)>0&&t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Wr,{color:"gold",size:14})," ",t.createElement("span",{style:{marginLeft:6}},r?.rating?.averageRating,"rating")),"ratingAndReviewCount"===e.reviewRatingType&&(r?.rating?.averageRating??0)>0&&t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Wr,{color:"gold",size:14})," ",r?.rating?.averageRating,t.createElement(Qn,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",r?.rating?.ratingCount," reviews)"),t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"2px",marginTop:"20px"}},a.length>1&&t.createElement("div",null,t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",marginBottom:"10px"}},t.createElement("span",{style:{flexShrink:0}},r.options[0].name," :"," ",t.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},i?.title)),t.createElement("select",{value:i?.id||"",onChange:z,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}},a.map((({node:n})=>t.createElement("option",{key:n.id,value:n.id,disabled:!n.inventoryQuantity&&!e.disableInventoryTracking},n.title)))),t.createElement("span",{style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},t.createElement(ao,null)))),t.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},t.createElement("div",{style:{width:"fit-content",minWidth:"fit-content",paddingRight:"10px",display:"flex",flexDirection:"column"}},i?.compareAtPrice&&parseFloat(i.compareAtPrice)>parseFloat(i?.price)&&t.createElement("div",{style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},Sh(e.styles.general.currencySymbol,e.styles.general.currencySymbol),Th(i?.compareAtPrice)),t.createElement("div",null,t.createElement("span",{style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},Sh(e.styles.general.currencySymbol,e.styles.general.currencySymbol),Th(i?.price)))),t.createElement("div",{style:{width:"80%"},className:"yt-product-modal-atc-wrapper"},t.createElement("button",{style:{textTransform:"uppercase",fontWeight:"800",width:"100%",border:"none",backgroundColor:e.themeColor||"#111",borderRadius:e.cornerRadius,color:e.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden",opacity:O?.5:1,cursor:O?"not-allowed":"pointer"},className:"yt-product-modal-atc-button",onClick:e=>{e.stopPropagation(),e.preventDefault(),k()},disabled:O},e.styles.byob.addToBundleCTAText??"Add to bundle")))),t.createElement("div",{style:{height:"10px",minHeight:"10px",border:"none",backgroundColor:"#D9D9D96B",margin:"20px 0 10px 0",display:"block !important"}},t.createElement("span",null)),t.createElement("span",{className:"yt-description-content",style:{scrollBehavior:"smooth"},dangerouslySetInnerHTML:{__html:T}})))))),A=t.createElement(Fm,null,t.createElement(Mm,{style:{padding:"0px",position:"relative"},$isSmallScreen:u,ref:n},t.createElement(Rm,{ref:n,className:"yt-variant-selection-modal"},t.createElement("button",{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:()=>{o(void 0)}},t.createElement(io,{style:{height:"22px",width:"22px",padding:"4px",color:"black"},onMouseEnter:e=>e.currentTarget.style.color="black"})),t.createElement("div",{className:"yt-variant-selection-modal small-screen",style:{padding:"0px"}},t.createElement("div",{className:"image-section"},t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"relative"},onTouchStart:D,onTouchMove:I,onTouchEnd:_},t.createElement(Am,{small:$h(B[d]?.url),medium:$h(B[d]?.url),large:$h(B[d]?.url),hideDownload:!0,className:"main-image",imageBackgroundColor:"#000"}),t.createElement("div",{style:{position:"absolute",bottom:"20px",width:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},B.length>1&&B.map(((e,n)=>t.createElement("span",{style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:d===n?"#FFFFFF":"#EBEBEB",margin:"0 3px",cursor:"pointer",backdropFilter:"blur(10px)"}}))))),t.createElement("div",{className:"image-gallery",style:{display:"flex",flexDirection:"row",overflowX:"auto",padding:"5px 20px",gap:"5px",scrollbarWidth:"none"}},B.length>1&&B.map(((n,r)=>t.createElement("img",{key:r,src:$h(n?.url),alt:n.altText||`${E} - Image ${r+1}`,onClick:()=>p(r),className:d===r?"active":"",style:{width:"60px",height:"60px",cursor:"pointer",borderRadius:"7px",border:"1px solid lightgray",...d===r&&{border:`2px solid ${e.themeColor||"#111"}`},objectFit:"cover"},loading:"lazy"})))))),t.createElement("div",{className:"details-section",style:{padding:"0 30px",margin:"15px 0",paddingBottom:"120px"}},t.createElement("h2",{style:{margin:"0px"}},a.length>1?i?.displayName:r.title),"ratingOnly"===e.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Wr,{color:"gold",size:14})," ",t.createElement("span",{style:{marginLeft:6}},e?.rating?.averageRating," rating")),"ratingAndReviewCount"===e.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Wr,{color:"gold",size:14})," ",e?.rating?.averageRating,t.createElement(Qn,{style:{color:"dodgerblue",marginLeft:"4px"},size:14})," ","(",e?.rating?.ratingCount," reviews)"),t.createElement("div",{style:{opacity:"0.2",border:"none",height:"2px",backgroundColor:"#000000",margin:"10px 0px",display:"block !important"}},t.createElement("span",null)),t.createElement("div",{className:"yt-description-content",style:{scrollbarWidth:"none",scrollBehavior:"smooth",margin:"0px"},dangerouslySetInnerHTML:{__html:T}})))),t.createElement("div",{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}},a.length>1&&t.createElement("div",null,t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",margin:"10px 0"}},t.createElement("span",{style:{flexShrink:0}},r.options[0].name," :"," ",t.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},i?.title)),t.createElement("select",{value:i?.id||"",onChange:z,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}},a.map((({node:n})=>t.createElement("option",{key:n.id,value:n.id,disabled:!n.inventoryQuantity&&!e.disableInventoryTracking},n.title)))),t.createElement("span",{style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},t.createElement(ao,null)))),t.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},t.createElement("div",{style:{width:"fit-content",minWidth:"fit-content",display:"flex",flexDirection:"column",paddingRight:"10px"}},i?.compareAtPrice&&t.createElement("div",{style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},Sh(e.styles.general.currencySymbol,e.styles.general.currencySymbol),Th(i?.compareAtPrice)),t.createElement("div",null,t.createElement("span",{style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},Sh(e.styles.general.currencySymbol,e.styles.general.currencySymbol),Th(i?.price)))),!e.hideAddToBundle&&((i?.inventoryQuantity??0)>0||e.disableInventoryTracking)&&(!e?.disableQuantitySelector||f<1)&&t.createElement("div",{style:{width:"100%"}},t.createElement("button",{style:{textTransform:"uppercase",fontWeight:"800",width:"100%",cursor:"pointer",border:"none",backgroundColor:e.themeColor||"#111",borderRadius:e.cornerRadius,color:e.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden"},onClick:e=>{e.stopPropagation(),e.preventDefault(),k()},disabled:"idle"!==h},e.styles.byob.addToBundleCTAText||"Add to Bundle"))))));return v.createPortal(u?A:P,document.body)})),jm=({options:e,selectedValue:n,onChange:r,type:o="text",isOptionAvailable:a,isMobile:i})=>t.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},e?.map((e=>{const l=!a||a(e.name);return i&&!l?null:t.createElement("div",{key:e.name,onClick:()=>{l&&r(e)},style:{cursor:l?"pointer":"not-allowed"}},((e,n)=>{const r=!a||a(e.name),i={cursor:r?"pointer":"not-allowed",border:n?"2px solid #333":"1px solid #d1d5db",transition:"all 0.2s ease",opacity:r?1:.5};if("color"===o)return e.value&&(()=>{if(!e.value.trim())return!1;if(e.value===e.name||e.value.length<3)return!1;try{const t=document.createElement("div");return t.style.color=e.value,""!==t.style.color}catch{return!1}})()?t.createElement("div",{style:{...i,width:24,height:24,borderRadius:"50%",backgroundColor:e.value}}):t.createElement("div",{style:{...i,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},e.name);return"image"===o?t.createElement("img",{src:En(e.value,48,85,"webp")||"/placeholder.svg",alt:e.name,style:{...i,width:24,height:24,borderRadius:"50%",objectFit:"cover"}}):t.createElement("div",{style:{...i,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},e.name)})(e,n?.name===e.name))}))),Vm=({product:e,isOpen:n,onClose:r,variantOptions:o,cta:a,onConfirm:i,disableInventoryTracking:s})=>{const[d,p]=c((()=>{const t=e.variants.edges.find((e=>s||e.node.inventoryQuantity>0))?.node;return t?.title&&"Default Title"!==t.title?t.title.split(" / "):e.options?.map((e=>e.values[0]))||[]})),[u,m]=c(window.innerWidth<1024);l((()=>{const e=()=>m(window.innerWidth<1024);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),l((()=>{const e=e=>{"Escape"===e.key&&r()};return n&&document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[n,r]);const f=e.variants.edges.find((t=>t.node.title===(e.options?.length>0?d.join(" / "):d[0])))?.node,g=f?.image?.url||e.featuredMedia?.preview?.image?.url,h=En(g,150,85,"webp"),x=e=>{if(!o?.options)return"text";const t=o.options.find((t=>t.name===e));return t?.type||"text"},y=e=>{if(!o?.options)return e.values.map((e=>({name:e,value:e})));const t=o.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}}))},b=(e,t)=>{const n=d[t];if(!n)return null;return y(e).find((e=>e.name===n))||null};if(!n)return null;const w=t.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:"center",justifyContent:"center"},role:"dialog","aria-modal":"true","aria-labelledby":"yt-variant-options-modal-title"},t.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"}}},t.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"),t.createElement("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 20px",borderBottom:"1px solid #f0f0f0"}},t.createElement("img",{src:h,alt:e.title,style:{width:60,height:60,borderRadius:8,objectFit:"cover",flexShrink:0,transition:"opacity 0.3s ease"}}),t.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,gap:4}},t.createElement("div",{style:{fontSize:14,fontWeight:600,color:"#333"}},e.title))),t.createElement("div",{style:{padding:"20px"}},e.options.map(((n,r)=>t.createElement("div",{key:n.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:n?.values?.length>1?16:0}},n?.values?.length>1&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},t.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",n.name),t.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},b(n,r)?.name||n.values[0])),t.createElement(jm,{options:y(n),selectedValue:b(n,r),onChange:e=>{((e,t)=>{const n=[...d];n[e]=t.name,p(n)})(r,e)},type:x(n.name),isOptionAvailable:t=>((t,n)=>{if(s)return!0;const r=[...d];r[t]=n;const o=e.options?.length>0?r.join(" / "):r[0],a=e.variants.edges.find((e=>e.node.title===o))?.node;return!!a&&a.inventoryQuantity>0})(r,t),isMobile:u})))))),t.createElement("button",{onClick:()=>{const t=e.variants.edges.find((t=>t.node.title===(e.options?.length>0?d.join(" / "):d[0])))?.node,n=t&&(s||t.inventoryQuantity>0);if(t?.id&&n)i(t.id),r();else{console.warn("yt::variant options modal - selected variant not available or out of stock:",d);const t=e.variants.edges.find((e=>s||e.node.inventoryQuantity>0))?.node.id;t&&(i(t),r())}},style:{width:"100%",fontSize:14,fontWeight:600,textTransform:"uppercase",backgroundColor:a.backgroundColor,color:a.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 v.createPortal(w,document.body)},Hm=({coverImageUrl:e,mobileCoverImageUrl:n,alt:r="Background",styles:o})=>{const a=[{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}],i=(e,t)=>{if(e)try{const n=new URL(e),r=n.searchParams;return r.has("format")||r.set("format","webp"),r.has("quality")||r.set("quality","80"),r.set("width",t.toString()),n.toString()}catch{const n=e.includes("?")?"&":"?";return`${e}${n}format=webp&quality=80&width=${t}`}},l=e=>e?a.map((({imageWidth:t,descriptor:n})=>{const r=i(e,t);return r?`${r} ${n}w`:""})).filter(Boolean).join(", "):"";if(!e&&!n)return null;const c=e||n||"",s=i(c,800)||c,d=[];if(n&&n!==e){const e=l(n);e&&d.push(t.createElement("source",{key:"mobile",media:"(max-width: 768px)",srcSet:e}))}if(e){const n=l(e);n&&(d.length>0?d.push(t.createElement("source",{key:"desktop",media:"(min-width: 769px)",srcSet:n})):d.push(t.createElement("source",{key:"desktop",srcSet:n})))}else if(n){const e=l(n);e&&d.push(t.createElement("source",{key:"mobile",srcSet:e}))}return t.createElement("div",{style:{width:"100%",display:"block"}},t.createElement("picture",{style:{display:"block",width:"100%"}},d,t.createElement("img",{src:s,alt:r,style:{width:"100%",height:"auto",display:"block",...o},loading:"eager",fetchPriority:"high",sizes:"100vw"})))};function Wm({quantity:e,setQuantity:n,remainingQuantity:r,handleAddToBundle:o,variantId:a,product:i,handleRemoveItem:l,hideAddToBundle:c,disableInventoryTracking:s,selectedVariantInventoryQty:d}){const p={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"},u=s||e<d;return t.createElement(ru,null,t.createElement("button",{onClick:t=>{t.stopPropagation();const r=Math.max(0,e-1);n(r),l&&a&&l(a,1)},style:p},"-"),t.createElement(ou,null,e," added"),t.createElement("button",{onClick:t=>{t.stopPropagation();const l=Math.min(r,e+1);n(l),o&&a&&i&&o(a,i,1)},disabled:!u||c,style:{...p,cursor:!u||c?"not-allowed":"pointer",opacity:!u||c?.6:1}},"+"))}const Um=({product:e,styles:n,selectedVariant:r})=>{const[o,a]=c(!1),[s,d]=c(""),p=i((()=>$h(r?.image?.url||e?.featuredMedia?.preview?.image?.url||e?.media?.edges?.[0]?.node?.image?.url)||""),[r?.image?.url,e?.featuredMedia?.preview?.image?.url,e?.media?.edges]),u=i((()=>e?.media?.edges?.map((e=>$h(e?.node?.preview?.image?.url??e?.node?.image?.url))).filter(Boolean)??[]),[e?.media?.edges]),m=i((()=>u?.[1]??p??""),[u,p]);l((()=>{if(p){(new Image).src=p}}),[p]),l((()=>{if(o&&m&&!s){const e=new Image;e.onload=()=>d(m),e.src=m}}),[o,m,s]);const f=i((()=>p||u?.[0]),[p,u]);return t.createElement("div",{style:{position:"relative",width:"100%",overflow:"hidden",aspectRatio:n.general.imageAspectRatio||"1/1"},onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1)},t.createElement("div",{style:{width:"100%",height:"100%",position:"relative"}},t.createElement("img",{loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"top",opacity:o&&f!==m?0:1,transition:u?.length>0?"opacity 300ms ease, transform 300ms ease":"",transform:o?"scale(1.1)":"scale(1)"},src:f,alt:e.title}),f!==m&&t.createElement("img",{loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",opacity:o?1:0,transition:"opacity 400ms ease, transform 400ms ease",transform:o?"scale(1.1)":"scale(1)",position:"absolute",top:0,left:0,objectPosition:"top"},src:s||"",alt:e.title})))},Gm=({product:e,bundle:n,handleAddToBundle:r,hideAddToBundle:o,remainingQuantity:a,themeColor:i,handleRemoveItem:s,transitionActive:d,idx:p,selecteditems:u,customVariantsQuantity:m})=>{const f=Ut(Zu),g=n.customizations,h=g?.byob?.variantSelectorType,[x,y]=c(!1),b=g.general?.variantTitleSuffix?e?.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 r=t[e];let o=0;for(;o<n.length&&o<r.length&&n[n.length-1-o]===r[r.length-1-o];)o++;n=n.slice(n.length-o)}return n.length<1?e:e.map((e=>{const t=e.node.title.split(" "),r=t.slice(0,t.length-n.length).join(" ");return{...e,node:{...e.node,title:r,commonSuffix:n.join(" ")}}}))})(e?.variants?.edges);if(!b||!b.length)return t.createElement(t.Fragment,null);const v=b?.find((e=>e.node.inventoryQuantity>0||!g?.general.trackInventory))?.node?.id;if(!v&&!g.general.showOutOfStockProducts)return t.createElement(t.Fragment,null);const[w,C]=c(b?.find((e=>!g?.general.trackInventory||e.node.inventoryQuantity>0))?.node?.id||b[0]?.node?.id),[k,E]=c(0),[T,S]=c(window.innerWidth<450),[$,B]=c("normal"),z=b?.find((e=>e?.node?.id===w))?.node,D=m&&m.length>0&&m.find((e=>e.variantId==z?.id))?.quantity||z&&z?.inventoryQuantity;l((()=>{const e=u.find((e=>e.variantId===w));E(e?e.quantity:0)}),[k,u,w]),l((()=>{const e=()=>{S(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),l((()=>{CSS.supports("font-weight","500")?B("500"):CSS.supports("font-weight","400")?B("400"):CSS.supports("font-weight","600")&&B("600")}),[]),l((()=>{document.documentElement.style.setProperty("--yt-bundle-font-weight",$)}),[$]),l((()=>{if(w&&!b?.some((e=>e.node.id===w))){const e=b[0]?.node.id;e&&C(e)}}),[w,b]);const I=e.variants&&e.variants.edges?.length>1&&"customOptions"!==h,_="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,O="53933408435"===_,P="75851235630"===_,A=(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[]})(e),N=A.length>0;return t.createElement(t.Fragment,null,t.createElement(lu,{borderRadius:g?.byob.borderRadius,borderColor:g?.byob.borderColor,shadowType:g?.byob.shadowType,backgroundColor:g?.byob.cardBackgroundColor,className:"bundle-builder-product-container "+(d?"yt-product-card-transition-active":p%2==0?"yt-product-card-transition":"yt-product-card-transition-up"),onClick:()=>{if(D<=0&&g?.general.trackInventory)return;const t={...e,variants:{...e.variants,edges:b},selectedVariant:z};f(t)},onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.01)"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)"},style:{WebkitTapHighlightColor:"transparent"}},t.createElement(cu,null,t.createElement(Um,{product:e,styles:g,selectedVariant:z}),n?.productCardBadgeText&&t.createElement("div",{style:{position:"absolute",top:"0px",left:"0px",backgroundColor:g?.general.primaryColor||"#111",color:g?.general.primaryContrastColor||"#fff",zIndex:1,margin:"0px",whiteSpace:"pre",padding:"4px 8px",fontSize:"12px",borderTopLeftRadius:g.byob.borderRadius}},n.productCardBadgeText),I&&t.createElement("div",{style:{position:"relative",width:"100%"}},t.createElement(su,{isCoralHaze:O,onClick:e=>{e.preventDefault(),e.stopPropagation()},value:w||"",onChange:e=>{e.stopPropagation(),e.preventDefault(),C(e.target.value)}},b?.map((e=>{const n=window.innerWidth<=320?10:window.innerWidth<=420?15:22,r=e.node.title.length>n?e.node.title.substring(0,n)+"...":e.node.title;return t.createElement("option",{key:e.node.id,value:e.node.id},r)}))),t.createElement("div",{style:{position:"absolute",right:"16px",bottom:"10px",pointerEvents:"none"}},t.createElement(F,null)))),t.createElement("div",null,"enabled"===n?.customizations?.byob?.productCardCategoryVisibility&&N&&t.createElement("div",{style:{padding:"2px 4px"}},t.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px"}},A.slice(0,2).map(((e,n)=>t.createElement("span",{key:n,style:{fontSize:T?"8px":"12px",color:"#666",fontWeight:"500"}},e.charAt(0).toUpperCase()+e.slice(1)))),A.length>2&&t.createElement("span",{style:{fontSize:"10px",padding:"2px 6px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",color:"#666",fontWeight:"500"}},"+",A.length-2," more"))),t.createElement(du,{isMobile:T,showBorder:n?.showBorder??!0,style:{...!g?.byob.productsPriceVisibility&&{padding:"8px"},...g?.byob.productTitleFontSize&&{fontSize:g?.byob.productTitleFontSize}}},P?String(z?.displayName).replace("- Default Title",""):e.title,z?.commonSuffix?" -"+z?.commonSuffix:"")),"ratingOnly"===n?.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Wr,{color:"gold",size:14})," ",t.createElement("span",{style:{marginLeft:6}},e?.rating?.averageRating," rating")),"ratingAndReviewCount"===n?.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Wr,{color:"gold",size:14})," ",e?.rating?.averageRating,t.createElement(Qn,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",e?.rating?.ratingCount," reviews)"),g?.byob.productsPriceVisibility&&t.createElement("div",{className:"yt-bundle-builder-product-price",style:{marginBottom:"5px",padding:n?.showBorder?"0px 10px":"0 4px"}},parseFloat(z?.price??"0")>0?t.createElement("span",null,Sh(g.general.currencySymbol,n?.storeCurrencyCode)??"Rs.",Th(z?.price)):t.createElement("span",null,"Free"),z?.compareAtPrice&&g?.byob.compareAtPriceVisibility&&parseFloat(z.compareAtPrice)>parseFloat(z?.price)&&t.createElement("span",{className:"yt-fixed-bundle-original-price",style:{fontSize:"14px"}},Sh(g.general.currencySymbol,n?.storeCurrencyCode)??"Rs.",Th(z.compareAtPrice))),(D>0||!g?.general.trackInventory)&&t.createElement(pu,{borderRadius:g?.byob.borderRadius,className:"yt-product-atc-wrapper"},(0===k||void 0===k)&&t.createElement(au,{style:{...!o&&{backgroundColor:g?.general.primaryColor||"#111",color:g?.general.primaryContrastColor||"#fff"}},disabled:o,onClick:t=>{t.stopPropagation(),t.preventDefault(),E(1),(()=>{if(!w)return;"customOptions"===h&&b.length>1?y(!0):r(w,e,1)})()},className:"yt-product-atc-button"},g?.byob.addToBundleCTAText),!n?.disableQuantitySelector&&k>0&&w&&t.createElement(iu,{className:"visible",style:{overflow:"hidden"}},t.createElement(Wm,{remainingQuantity:a,setQuantity:E,quantity:k,handleAddToBundle:r,variantId:w,product:e,handleRemoveItem:s,hideAddToBundle:o,disableInventoryTracking:!g?.general.trackInventory,selectedVariantInventoryQty:D})),n?.disableQuantitySelector&&k>0&&w&&t.createElement(au,{style:{backgroundColor:"#747474",color:g?.general.primaryContrastColor||"#fff",display:"flex",justifyContent:"space-between",overflow:"hidden",height:"40px"},className:"yt-product-atc-single-qty-selector"},t.createElement(uu,{className:"yt-product-atc-single-qty-selector-added"},"ADDED"),t.createElement(mu,{onClick:e=>{e.stopPropagation();const t=Math.max(0,k-1);E(t),s&&w&&s(w,1)},className:"yt-product-atc-single-qty-selector-remove"},t.createElement(no,{style:{color:"#fff",fontSize:"20px"}})))),D<=0&&g?.general.trackInventory&&t.createElement(au,{style:{backgroundColor:g.general.disabledButtonColor,color:"#fff",cursor:"not-allowed",transition:"transform 0.2s ease-in-out"},className:"yt-product-atc-disabled"},g?.general.outOfStockLabel||"Out of Stock")),"customOptions"===h&&x&&b.length>1&&t.createElement(Vm,{product:e,isOpen:x,onClose:()=>y(!1),variantOptions:n.variantOptions,cta:{textColor:g.general.ctaTextColor,backgroundColor:g.general.primaryColor},onConfirm:t=>{C(t),r(t,e,1)},disableInventoryTracking:!g?.general.trackInventory}))},Qm=({currentStep:e,setCurrentProductTier:n,totalSteps:r,tiers:o,isMobile:a,selectedProductsByTier:i,primaryColor:l="#000",primaryTextColorCta:c="#fff",tierNavigation:s})=>t.createElement("div",{style:{textAlign:"center",fontSize:"20px"}},t.createElement("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center"}},Array.from({length:r}).map(((c,d)=>{const p=d+1,u=o[d].minimumQuantity-(i[d]?.length??0)==0,m=d===e;return l="black"===l?"#000000":l,t.createElement(t.Fragment,{key:p},t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",gap:a?"4px":"8px"},onClick:()=>!1===s?()=>{}:n(p-1)},t.createElement("div",{style:{fontSize:"14px"}},"Step ",p),t.createElement("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",cursor:"pointer"}},t.createElement("div",{style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px"}}),t.createElement("div",{style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:u?`${l}50`:"white",border:`2px solid ${u?l:m?"#666666":"#CBD5E0"}`,display:"flex",alignItems:"center",justifyContent:"center"}}),t.createElement("div",{style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",marginRight:d<r?a?"4px":"6px":"",borderTopRightRadius:"5px",borderBottomRightRadius:"5px"}}))))}))),t.createElement("div",{style:{margin:a?"16px 0px":"15px 0px",fontSize:a?"16px":"18px",padding:"4px",background:"rgba(0, 0, 0, 0.03)",borderBottom:"1px solid rgba(130, 130, 130, 0.28)"}},o[e]?.title)),Ym=({isMobile:e,setSearchTerm:n,searchTerm:r,styles:o,setSortBy:a})=>{const[i,s]=c(!1),[d,p]=c(r);return l((()=>{const e=setTimeout((()=>{n(d)}),300);return()=>clearTimeout(e)}),[d,n]),t.createElement("div",{className:"yt-byob-sort-filter-container",style:{display:"flex",flexDirection:e?"column":"row",justifyContent:"space-between",alignItems:e?"flex-end":"center",textAlign:"center",marginBottom:"20px",width:"97%",gap:e?"10px":"0"}},t.createElement("div",{className:"yt-byob-sort-filter-inner",style:{display:"flex",flexDirection:i&&e?"column":e?"row-reverse":"row",justifyContent:"space-between",alignItems:i?"":"center",gap:"12px",width:"100%"}},t.createElement("div",{className:"yt-byob-search-wrapper",style:{position:"relative",display:"flex",alignItems:"center",width:e?i?"100%":"auto":"400px",transition:"width 0.3s ease-in-out"}},e&&!i?t.createElement(to,{className:"yt-byob-search-icon",fontSize:"20px",color:"#555",style:{cursor:"pointer",lineHeight:"normal"},onClick:()=>s(!0)}):t.createElement(t.Fragment,null,t.createElement("input",{className:"yt-byob-search-input",style:{width:"100%",padding:e?"10px 12px":"10px 14px",fontSize:"14px",outline:"none",color:"#333",border:"1px solid #c7c7c7",borderRadius:o?.byob.borderRadius,boxShadow:o?.byob.borderColor?"0 2px 4px rgba(0, 0, 0, 0.1)":"none",textAlign:"start"},placeholder:"Search by Product Name",value:d,onChange:e=>p(e.target.value)}),!i&&t.createElement("span",{className:"yt-byob-search-icon-input",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",display:"flex",alignItems:"center",justifyContent:"center",background:"white",paddingLeft:"5px"}},t.createElement(to,{fontSize:"18px",style:{lineHeight:"normal"}}))),e&&i&&t.createElement("span",{className:"yt-byob-search-close-icon",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",cursor:"pointer"},onClick:()=>s(!1)},"✖")),t.createElement("div",{className:"yt-byob-filter-wrapper",style:{display:"flex",alignItems:"center",textAlign:"center",border:window.innerWidth>600?"1px solid #d1d5db":"",padding:"8px 12px",fontSize:"14px",cursor:"pointer",borderRadius:o?.byob.borderRadius,boxShadow:o?.byob.borderColor?window.innerWidth>600?"0 2px 4px rgba(0, 0, 0, 0.1)":" ":"none"}},t.createElement("span",{className:"yt-byob-filter-label",style:{fontSize:"14px",color:"#555",marginRight:"6px"}},"Sort:"),t.createElement("select",{className:"yt-byob-filter-select",style:{flex:1,border:"none",height:"auto",padding:"0px",marginBottom:"0px",background:"transparent",fontSize:"14px",color:"#333",fontWeight:"500",width:e?"120px":"",outline:"none",cursor:"pointer",textAlign:"start"},onChange:e=>a(e.target.value)},t.createElement("option",{value:"best-selling"},"Featured"),t.createElement("option",{value:"title-asc"},"Product Title (A-Z)"),t.createElement("option",{value:"title-desc"},"Product Title (Z-A)"),t.createElement("option",{value:"price-low-to-high"},"Price (Low to High)"),t.createElement("option",{value:"price-high-to-low"},"Price (High to Low)")))))},qm=({styles:e,isMobile:n,categories:r,activeCategory:o,onCategoryChange:a})=>{const i=e=>{a(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"===e?.byob?.categoryFilterOnPage?t.createElement("div",{style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"},className:"yt-categoryfilter-wrapper"},t.createElement("div",{style:{display:"flex",gap:"0px",minWidth:"max-content",paddingBottom:"1px",flexWrap:"nowrap",justifyContent:"center",borderBottom:"1px solid #e0e0e0",width:"auto",height:n?"28px":"45px"},className:"yt-categoryfilter-tabs-container"},["All",...r].map((r=>{const a=o===r;return t.createElement("button",{key:r,onClick:()=>i(r),className:"yt-categoryfilter-tab-button",style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:a?"600":"400",color:a?e.general.primaryColor:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:a?l(e.general.primaryColor,.07):"transparent",borderBottom:a?`2px solid ${e?.general.primaryColor}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:t=>{a||(t.currentTarget.style.color=e?.general.primaryColor)},onMouseLeave:e=>{a||(e.currentTarget.style.color="#666")}},t.createElement("span",{style:{visibility:"hidden",height:0,display:"block",overflow:"hidden",fontWeight:600},"aria-hidden":"true"},r.charAt(0).toUpperCase()+r.slice(1)),t.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},r.charAt(0).toUpperCase()+r.slice(1)))})))):t.createElement("div",{style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"},className:"yt-categoryfilter-wrapper"},t.createElement("div",{style:{display:"flex",gap:"8px",minWidth:"max-content",flexWrap:"nowrap",justifyContent:"center",paddingRight:n?"10px":"0px"},className:"yt-categoryfilter-buttons-container"},["All",...r].map((r=>t.createElement("button",{key:r,onClick:()=>i(r),className:"yt-categoryfilter-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${o===r?e?.general.primaryColor:"#e0e0e0"}`,borderRadius:e?.general.ctaBorderRadius,backgroundColor:o===r?e?.general.primaryColor:"white",color:o===r?"white":"#333",cursor:"pointer",transition:"all 0.3s ease",outline:"none",whiteSpace:"nowrap",minWidth:"fit-content",flexShrink:0},onMouseEnter:t=>{o!==r&&(t.currentTarget.style.borderColor=e?.general.primaryColor,t.currentTarget.style.color=e?.general.primaryColor)},onMouseLeave:e=>{o!==r&&(e.currentTarget.style.borderColor="#e0e0e0",e.currentTarget.style.color="#333")}},r.charAt(0).toUpperCase()+r.slice(1))))))},Zm=({bundle:e,selectedItems:n,setSelectedItems:r,handleAddToCart:i,bundleAddToCartLoading:s,renderingOnPage:d,selectedItemsQuantity:p,handleRemoveItem:u,bundleSubtotal:m})=>{const[f,g]=c(void 0),[h,x]=c(window.innerWidth<450),[y,b]=c(0),[v,w]=c({}),C=e.builderTiers?.type,k=e.customizations,E=e.builderTiers?.productTier??[],T=e.builderTiers?.offerTier??[],[S,$]=c([]),[B,z]=c(!1),[D,I]=c("All"),[_,O]=c(0),P=o(null);l((()=>{const t=new Set;let n=!1;e?.products?.forEach((e=>{const r=e.productDetails;if(r.metafield&&"yourtoken_bundles_app"===r.metafield.namespace&&"categories"===r.metafield.key){let e=[];if(r.metafield.jsonValue&&Array.isArray(r.metafield.jsonValue))e=r.metafield.jsonValue;else if(r.metafield.value)try{const t=JSON.parse(r.metafield.value);Array.isArray(t)&&(e=t)}catch(e){console.error("Failed to parse categories:",e)}e.length>0&&(n=!0,e.forEach((e=>t.add(e))))}})),$(Array.from(t)),z(n)}),[e.products]);const A=((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})))(e.products.filter((e=>"active"===e.productDetails.status?.toLowerCase()||void 0===e.productDetails.status||""===e.productDetails.status)),D),N="productTier"===C?E.reduce(((e,t)=>e+t.minimumQuantity),0):"offerTier"===C?T.reduce(((e,t)=>e+t.minimumQuantity),0):e.minimumQuantity,[F,M]=c(""),[R,L]=c(""),j=((e,t)=>e.filter((e=>e?.productDetails?.title?.toLowerCase().includes(t?.toLowerCase()))))(A,F),V=((e,t)=>[...e].sort(((e,n)=>{const r=e?.productDetails?.title?.toLowerCase(),o=n?.productDetails?.title?.toLowerCase(),a=parseFloat(e?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),i=parseFloat(n?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(t){case"title-asc":return r.localeCompare(o);case"title-desc":return o.localeCompare(r);case"price-low-to-high":return a-i;case"price-high-to-low":return i-a;default:return 0}})))(j,R),H=((e,t,n,r,o)=>(e[o]?.products.filter((e=>t.some((t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))&&t?.productDetails.title.toLowerCase().includes(n?.toLowerCase())))))||[]).sort(((e,n)=>{let o=t.find((t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0])))),a=t.find((e=>e.productId===n.productId&&(n.variantIds.length<1||e.variantIds.includes(n.variantIds[0]))));if(!o||!a)return 0;const i=o.productDetails?.title?.toLowerCase(),l=a.productDetails?.title?.toLowerCase(),c=parseFloat(o?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),s=parseFloat(a?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(r){case"title-asc":return i.localeCompare(l);case"title-desc":return l.localeCompare(i);case"price-low-to-high":return c-s;case"price-high-to-low":return s-c;default:return 0}})))(E,V,F,R,y),[W,U]=Gt(Zu),[G,Q]=c(!1),Y="productTier"===C?H:V,q=Y.slice(0,20*(_+1));l((()=>{setTimeout((()=>{Q(!0)}),100)}),[]);const Z=o(null);l((()=>{const e=()=>{x(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),l((()=>{if(e.coverImageUrl){const t=new Image;t.src=$h(e.coverImageUrl)??"",t.onload=()=>{g(t.width/t.height)}}}),[e.coverImageUrl]),l((()=>{Q(!1),setTimeout((()=>Q(!0)),100)}),[y]);const K=(e,t)=>{if("productTier"===C){let n={...v},r=!1;if(n[t]){const o=n[t].indexOf(e);-1!==o&&(n[t]=[...n[t]],n[t].splice(o,1),r=!0)}if(!r)for(let t=E.length;t>=0;t--){const r=n[t].indexOf(e);if(-1!==r){n[t]=[...n[t]],n[t].splice(r,1);break}}w(n);const o=E.findIndex(((e,t)=>n[t]?.length<e.minimumQuantity));-1!==o&&b(o)}u(e)};l((()=>{if("productTier"===C){const e=Object.fromEntries(E.map((e=>[e.tier,[]])));w(e)}}),[e]),l((()=>{if("productTier"!==C||!E[y])return;if(N===p)return;const e=E.findIndex(((e,t)=>{const n=v[t]||[];return t>=y&&n.length<e.minimumQuantity}));-1!==e&&e!==y&&(b(e),(()=>{const e=document.querySelector(".products-display");e&&e.scrollIntoView({behavior:"smooth"})})())}),[v,E,C]),l((()=>{M("")}),[y]),l((()=>{function e(e){if(!Z.current||!e.target)return;!Z.current.contains(e.target)&&U(void 0)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]);const X=(e,t,o)=>{var a;"productTier"===C&&(a=e,w((e=>{const t={...e},n=E.findIndex(((e,n)=>{const r=t[n]||[];return n>=y&&r.length<e.minimumQuantity}));return-1!==n&&b(n),t[n]||(t[n]=[]),t[n].push(a),t}))),Bh(e,t,o,n,r)},J=(()=>{if(!e?.builderTiers)return e.minimumQuantity;const{type:t,offerTier:n,productTier:r}=e.builderTiers,o="offerTier"===t?n:"productTier"===t?r:null;if(!o)return e.minimumQuantity;let a=0;return o.map((e=>{a+=e.minimumQuantity})),a})(),ee=h&&e.mobileCoverImageUrl?$h(e.mobileCoverImageUrl):$h(e.coverImageUrl??"")||null,te=e.customStoreDetails?.fixedInventoryDetails,ne=e=>{const t=k?.general?.showOutOfStockProducts;if(t||!k?.general.trackInventory)return!0;const n=e?.productDetails?.variants?.edges||[];if(te){if(n.some((e=>te.some((t=>t.variantId===e.node.id&&t.quantity>0)))))return!0}return n.some((e=>e.node.inventoryQuantity>0))},re="bundles"==e.appName?e.pageHeader?.title:e?.title,oe="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;l((()=>{O(0)}),[F,R,D,y]);const ae=a((()=>{q.length<Y.length&&O((e=>e+1))}),[q.length,Y.length]);return l((()=>{const e=new IntersectionObserver((([e])=>{e.isIntersecting&&ae()}),{threshold:.1});return P.current&&e.observe(P.current),()=>{P.current&&e.unobserve(P.current)}}),[ae]),l((()=>console.log(q)),[q]),t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",rowGap:"15px",padding:"20px 0px",marginBottom:"20px",backgroundColor:k.byob.sectionBackgroundColor,..."transparent"!==k.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},ee?t.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",overflow:"hidden",...e?.coverImageVerticalMargin&&{marginBottom:e?.coverImageVerticalMargin,marginTop:e?.coverImageVerticalMargin}}},ee&&t.createElement(Hm,{coverImageUrl:ee,alt:"Background",styles:{width:"100%",height:"auto",display:"block"}}),t.createElement("div",{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)"}},t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.titleFontSize??"3rem",fontWeight:"700",color:k?.byob?.titleTextColor??"#000",marginBottom:"15px",backgroundColor:k?.byob?.titleBackgroundColor??"transparent",width:"100%",textAlign:"center"},className:"bundle-builder-title"},re),t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.subtitleFontSize??"1.5rem",color:k?.byob?.titleTextColor??"#000"},className:"bundle-builder-subtitle"},oe))):(re||oe)&&t.createElement("div",{style:{zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px"}},re&&t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.titleFontSize??"3rem",fontWeight:"700",color:k?.byob?.titleTextColor??"#000",marginBottom:"15px",textAlign:"center",width:"100%",backgroundColor:k?.byob?.titleBackgroundColor??"transparent"}},re),oe&&t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.subtitleFontSize??"1.5rem",color:k?.byob?.titleTextColor??"#000"}},oe)),t.createElement("div",{style:{fontSize:"20px",width:"100%"},className:"products-display"},"productTier"===C&&E.length>0&&k?.byob.productTiersVisibility&&t.createElement(t.Fragment,null,t.createElement("div",null,t.createElement(Qm,{currentStep:y,totalSteps:E.length,tiers:E,isMobile:h,primaryColor:k?.general?.primaryColor,primaryTextColorCta:k?.general?.primaryContrastColor,setCurrentProductTier:b,selectedProductsByTier:v,tierNavigation:k.byob.tierNavigation})))),t.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"column",gap:"20px"}},e?.enableSortAndFilter&&t.createElement(Ym,{isMobile:h,searchTerm:F,setSearchTerm:M,setSortBy:L,styles:k}),e?.customizations?.byob?.enableProductCategories&&B&&t.createElement("div",null,t.createElement(qm,{styles:k,isMobile:h,categories:S,activeCategory:D,onCategoryChange:e=>{I(e)}}))),t.createElement("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"12px",justifyContent:"center",width:"100%"},className:"products-display"},0===Y?.length?t.createElement("p",{style:{fontSize:"20px",color:"#333",textAlign:"center",width:"100%"}},"No products found"):"productTier"===C&&E.length>0?q.filter((e=>ne(V.find((t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))))))).map(((r,o)=>{const a=(E[y]?.minimumQuantity??0)>(v[y]?.length??0),i=V.find((e=>e.productId===r.productId&&(r.variantIds.length<1||e.variantIds.includes(r.variantIds[0]))));return i?t.createElement(Gm,{bundle:e,idx:o,key:r?.variantIds?.[0]??r.productId,product:i?.productDetails,handleAddToBundle:X,hideAddToBundle:!a,remainingQuantity:J-p,themeColor:e?.dealTextColor,handleRemoveItem:e=>K(e,y),selecteditems:n,transitionActive:G,customVariantsQuantity:te}):null})):q.filter(ne).map(((r,o)=>t.createElement(Gm,{bundle:e,idx:o,key:r.productId,product:r?.productDetails,handleAddToBundle:X,hideAddToBundle:p>=J,remainingQuantity:J-p,themeColor:e?.dealTextColor,handleRemoveItem:u,selecteditems:n,transitionActive:G,customVariantsQuantity:te}))),q.length<Y.length&&t.createElement("div",{ref:P,style:{height:"1px",width:"100%",display:"block"}})),!d&&t.createElement(qu,{builderTiers:e?.builderTiers,handleAddToCart:i,minimumQuantity:N,selectedProducts:n,showProductDetailsInTracker:e.showProductDetailsInTracker,handleRemoveItem:u,handleRemoveItemProductTier:K,selectedItemsQuantity:p,percentageOff:e.percentageOff,loading:s,bundleSubtotal:m,amountOff:e.amountOff,styles:e.customizations,dealAmount:e.dealAmount,themeColor:e?.dealTextColor??"#333",primaryTextColorCta:e?.primaryTextColorCta??"#fff",cornerRadiusType:e?.cornerRadiusType??"",selectedProductsByTier:v,renderingOnPage:d})),d&&t.createElement(qu,{handleAddToCart:i,minimumQuantity:N,builderTiers:e?.builderTiers,selectedProducts:n,showProductDetailsInTracker:e.showProductDetailsInTracker,loading:s,handleRemoveItem:u,handleRemoveItemProductTier:K,percentageOff:e.percentageOff,selectedItemsQuantity:p??0,bundleSubtotal:m??{price:0,compareAtPrice:0},amountOff:e.amountOff,styles:e.customizations,dealAmount:e.dealAmount,themeColor:k?.general.primaryColor||"#000",primaryTextColorCta:k.general.primaryContrastColor??"#fff",cornerRadiusType:e?.cornerRadiusType??"",selectedProductsByTier:v,renderingOnPage:d}),W&&void 0!==p&&(()=>{let r=p<e.minimumQuantity;return"productTier"==C?r=(E[y]?.minimumQuantity??0)>(v[y]?.length??0):"offerTier"==C&&(r=p<T.reduce(((e,t)=>e+t.minimumQuantity),0)),t.createElement(Lm,{handleAddToBundle:X,ref:Z,remainingQuantity:e.minimumQuantity-p,hideAddToBundle:!r,disableQuantitySelector:e?.disableQuantitySelector??!1,disableInventoryTracking:!e?.customizations.general.trackInventory,selectedProducts:n,themeColor:k?.general.primaryColor||"#000",primaryTextColorCta:e?.customizations?.general.primaryContrastColor??"#fff",primaryBackgroundColorCta:k?.general.primaryColor||"#000",cornerRadius:e?.customizations.byob.borderRadius,styles:e.customizations,reviewRatingType:e?.reviewRatingType??"none"})})())},Km=({product:e,selectedVariantId:n,onVariantChange:r,styles:o,originalPrice:a,dealPrice:l,isVertical:c=!1,variantOptions:s,storeCurrencyCode:d})=>{const p=e?.productDetails?.variants?.edges?.find((e=>e?.node?.id===n))?.node,u=i((()=>{if(p?.title&&e.productDetails.options){const t=p.title.split(" / ");if(t.length===e.productDetails.options.length)return t}return e.productDetails.options?.map((e=>e.values[0]))||[]}),[p,e.productDetails.options]),m=e=>{r(e)};return c?t.createElement("div",{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"}},t.createElement("div",{style:{position:"relative",width:"100%"}},o.comboBundle.subProductsImageVisibility&&t.createElement(t.Fragment,null,t.createElement("img",{src:$h(p?.image?.url||e?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:e?.productDetails?.featuredMedia?.alt,width:165,height:165,style:{objectFit:"cover",borderRadius:"20px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",height:"100%",aspectRatio:o.general?.imageAspectRatio||"1/1"}}),t.createElement("div",{style:{marginTop:"8px",position:"absolute",bottom:"10px",left:"5px",right:"5px"}},e?.productDetails?.variants?.edges?.length>1&&t.createElement(t.Fragment,null,t.createElement("select",{value:n,onChange:e=>m(e.target.value),style:{padding:"8px 10px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",fontSize:"14px",width:"100%",appearance:"none",marginRight:"30px"}},e?.productDetails?.variants?.edges.map((e=>t.createElement("option",{key:e?.node?.id,value:e?.node?.id,disabled:e.node.inventoryQuantity<=0},e?.node?.title)))),t.createElement("div",{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"}},t.createElement(F,null)))))),(o.comboBundle.subProductsProductTitleVisibility||o.comboBundle.subProductsProductPriceVisibility)&&t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"40px",width:"100%",paddingBlock:"5px"}},o.comboBundle.subProductsProductTitleVisibility&&t.createElement("span",{style:{fontSize:"12px",color:"#333",fontWeight:"600",lineHeight:"normal",textAlign:"center",width:"fit-content"}},e?.productDetails?.title),o.comboBundle.subProductsProductPriceVisibility&&t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",lineHeight:"normal",fontSize:"14px"}},t.createElement("span",{style:{lineHeight:"normal"}},Sh(o.general.currencySymbol,d),Th((Number(""!==p?.compareAtPrice?Number(p?.compareAtPrice):p?.price)/Number(a)*Number(l)).toFixed(2))),t.createElement("span",{style:{textDecoration:"line-through",color:"#999",lineHeight:"normal",fontSize:"12px"}},Sh(o.general.currencySymbol,d),Th(""!==p?.compareAtPrice?p?.compareAtPrice:p?.price))))):t.createElement("div",{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"===o.comboBundle.infoAlignment&&{flexDirection:"row-reverse"},..."center"===o.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"}},o.comboBundle.subProductsImageVisibility&&t.createElement("div",{style:{position:"relative"}},t.createElement("img",{src:$h(p?.image?.url||e?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:e?.productDetails?.featuredMedia?.alt,height:80,style:{objectFit:"cover",borderRadius:"10px",border:"1px solid #DEDEDE",aspectRatio:"1/1",width:"90px",height:"90px"}}),t.createElement("div",{style:{position:"absolute",top:-8,right:-8,backgroundColor:"#f8f8f8",borderRadius:"50%",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid #eee",fontSize:"14px"}},"1")),t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"left"===o.comboBundle?.infoAlignment?"flex-start":"right"===o.comboBundle?.infoAlignment?"flex-end":"center"===o.comboBundle?.infoAlignment?"flex-start":void 0}},o.comboBundle.subProductsProductTitleVisibility&&t.createElement("span",{style:{fontSize:"14px",fontWeight:"600",lineHeight:"normal",display:"flex",alignItems:"center",gap:"8px"}},t.createElement("span",null," ",e?.productDetails?.title," "),e.productDetails.variants.edges.length>1&&s&&u&&t.createElement("span",{style:{fontSize:"10px",color:"#666",backgroundColor:"#F4F4F4",padding:"2px 8px",borderRadius:"10px",border:"1px solid #ddd"}},u.length>1?u.join(" / "):u)),o.comboBundle.subProductsProductPriceVisibility&&t.createElement("div",{style:{display:"flex",gap:"8px",marginTop:"5px",alignItems:"baseline"}},t.createElement("span",{style:{lineHeight:"normal"}},Sh(o.general.currencySymbol,d),Th((Number(""!==p?.compareAtPrice?Number(p?.compareAtPrice):p?.price)/Number(a)*Number(l)).toFixed(2))),t.createElement("span",{style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Sh(o.general.currencySymbol,d),Th(""!==p?.compareAtPrice?p?.compareAtPrice:p?.price))),e.productDetails.variants.edges.length>1&&e.productDetails.options.length>0?t.createElement(t.Fragment,null,e.productDetails.options.map(((n,r)=>t.createElement("div",{key:n.name,style:{marginTop:"10px",display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"}},e.productDetails.options.length>1&&t.createElement("label",{style:{fontSize:"12px",fontWeight:"500",color:"#333"}},n.name,":"),n?.values?.length>1&&t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"}},n.values.map((a=>{const i=s&&s?.options?.find((e=>e.name===n.name));return i&&"color"===i?.type?t.createElement("button",{key:a,onClick:()=>{const t=[...u];t[r]=a;const n=e.productDetails.options.length>0?t.join(" / "):t[r],o=e.productDetails.variants.edges.find((e=>e.node.title===n))?.node.id;o&&m(o)},style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:u[r]===a?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid transparent"}},i?.values.find((e=>e.name===a))?.value?t.createElement("div",{style:{width:u[r]===a?"26px":"24px",height:u[r]===a?"26px":"24px",borderRadius:"50%",backgroundColor:i?.values.find((e=>e.name===a))?.value,cursor:"pointer"}},t.createElement("span",null)):t.createElement("span",{key:a,style:{padding:"4px 8px",border:u[r]===a?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u[r]===a?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"10px",fontWeight:"600"}},a)):i&&"image"===i?.type?t.createElement("button",{key:a,onClick:()=>{const t=[...u];t[r]=a;const n=e.productDetails.options.length>0?t.join(" / "):t[r],o=e.productDetails.variants.edges.find((e=>e.node.title===n))?.node.id;o&&m(o)},style:{border:u[r]===a?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:u[r]===a?"#F7F7F7":"transparent",cursor:"pointer",padding:"0px",width:u[r]===a?"26px":"24px",height:u[r]===a?"26px":"24px",overflow:"hidden"}},i?.values.find((e=>e.name===a))?.value?t.createElement("img",{src:$h(i?.values.find((e=>e.name===a))?.value||"/placeholder.svg"),alt:a,style:{width:u[r]===a?"26px":"24px",height:u[r]===a?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):t.createElement("span",{key:a,style:{padding:"4px 8px",border:u[r]===a?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u[r]===a?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"10px",fontWeight:"600"}},a)):t.createElement("button",{key:a,onClick:()=>{const t=[...u];t[r]=a;const n=e.productDetails.options.length>0?t.join(" / "):t[r],o=e.productDetails.variants.edges.find((e=>e.node.title===n))?.node.id;o&&m(o)},style:{padding:"4px 8px",border:u[r]===a?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u[r]===a?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"10px",fontWeight:"600"}},a)}))))))):t.createElement(t.Fragment,null,e?.productDetails?.variants?.edges?.length>1&&t.createElement("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},e?.productDetails?.variants?.edges.map((e=>t.createElement("button",{key:e?.node?.id,onClick:()=>m(e?.node?.id),disabled:e.node.inventoryQuantity<=0,style:{padding:"4px 8px",border:n===e?.node?.id?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:n===e?.node?.id?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"12px",fontWeight:"500"}},e?.node?.title)))))))},Xm=({bundle:e,addToCartFunction:n})=>{const[r,o]=c(!1),[a,s]=c(window.innerWidth<786),[d,p]=c((()=>{const t={};return e.products.forEach(((e,n)=>{const r=e.productDetails.variants.edges.find((e=>e.node.inventoryQuantity>0))?.node;t[n]=r?r.id:e?.productDetails?.variants?.edges[0]?.node?.id})),t})),u=e.products?.filter((e=>e?.productDetails?.variants?.edges.some((e=>e?.node?.inventoryQuantity>0))))||[],m=Object.keys(d).length===u.length,f=(e,t)=>{p((n=>({...n,[e]:t})))},{originalPrice:g,dealPrice:h,offerValue:x}=i((()=>{const{price:t,compareAtPrice:n}=Object.entries(d).reduce(((t,[n,r])=>{const o=e.products[parseInt(n)],a=o.productDetails.variants.edges?.find((e=>e.node.id===r))?.node,i=parseFloat(a?.price??"0"),l=parseFloat(a?.compareAtPrice||i.toString());return t.price+=i,t.compareAtPrice+=l,t}),{price:0,compareAtPrice:0}),r=Math.max(t,n);let o=Math.min(t,n);e?.percentageOff?o=t*(1-e.percentageOff/100):e?.dealAmount?o=e.dealAmount:e?.amountOff&&(o=t-e.amountOff);const a=n-o;return{originalPrice:r.toFixed(2),dealPrice:o.toFixed(2),offerValue:a.toFixed(2)}}),[d,e.products,e.percentageOff,e.dealAmount,e.amountOff]);l((()=>{const e=()=>{s(window.innerWidth<786)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const y=e.customizations,b=y.comboBundle?.comboCardStyle||"auto",v="vertical"===b||"auto"===b&&!a,w=y.comboBundle?.embedContentVisibility,C="bundles"==e.appName?e.pageHeader?.title:e?.title,k="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement("div",{style:{lineHeight:"normal",maxWidth:"800px",marginBlock:y.comboBundle?.verticalMargin||"0px",display:"flex",flexDirection:"column",alignItems:"left"===y.comboBundle?.infoAlignment?"flex-start":"right"===y.comboBundle?.infoAlignment?"flex-end":"center"===y.comboBundle?.infoAlignment?"center":void 0,textAlign:y.comboBundle?.infoAlignment??"left",fontFamily:"system-ui, -apple-system, sans-serif"}},w&&y.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px"}},t.createElement("h2",{style:{fontSize:y.comboBundle?.productTitleFontSize||"28px",color:y.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},C)),w&&y?.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",color:y.comboBundle?.titleTextColor||"#000",fontSize:(parseInt(y.comboBundle?.productTitleFontSize?.replace("px",""))||28)-4+"px"}},t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"5px",flexWrap:"wrap"}},t.createElement("span",{style:{fontWeight:"bold",lineHeight:"1",minWidth:"fit-content"}},Sh(y.general.currencySymbol,e.storeCurrencyCode),Th(h)),t.createElement("div",{style:{color:y.comboBundle?.titleTextColor||"#666",textDecoration:"line-through",verticalAlign:"middle",display:"inline-block",minWidth:"fit-content"}},Sh(y.general.currencySymbol,e.storeCurrencyCode),Th(g)),t.createElement("span",{style:{backgroundColor:"#D3122A",color:"white",padding:"4px 8px",fontSize:"14px",borderRadius:"20px",fontWeight:"500",lineHeight:"1",minWidth:"fit-content"}},e?.percentageOff?`${e?.percentageOff}% Off`:e?.amountOff?`${Sh(y.general.currencySymbol,e.storeCurrencyCode)}${Th(e?.amountOff)} Off`:`Save ${Sh(y.general.currencySymbol,e.storeCurrencyCode)}${Th(x)}`))),t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",margin:"15px 0px"},className:"yt-comboBundle-checkoutSpecific-container"},t.createElement("div",{style:{display:"flex",width:"12px",height:"12px",justifyContent:"center",alignItems:"center",alignContent:"center",borderRadius:"50%",backgroundColor:y.general?.ctaBackgroundColor||"#1e1e1e",flexShrink:0},className:"yt-comboBundle-checkoutSpecific-dot"},t.createElement("span",null)),t.createElement("p",{style:{fontSize:y.comboBundle.productDescriptionFontSize||"16px",color:y.comboBundle?.descriptionTextColor||"#000",alignItems:"center",margin:0,lineHeight:"1.2"},className:"yt-comboBundle-checkoutSpecific-text"},"Tax included. ",t.createElement("u",null,"Shipping")," calculated at checkout."))),y.comboBundle.subProductsSectionVisibility&&t.createElement(t.Fragment,null,v?t.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"20px",marginTop:"10px",flexWrap:"wrap"}},e.products.map(((n,r)=>{const o=n?.productDetails?.variants?.edges?.find((e=>e?.node?.id===d[r]))?.node;return o?t.createElement(Km,{key:`combo-product-${r}-${n.productId}`,product:n,styles:y,originalPrice:g,dealPrice:h,selectedVariantId:d[r],onVariantChange:e=>f(r,e),isVertical:v,variantOptions:e.variantOptions,storeCurrencyCode:e.storeCurrencyCode}):null}))):t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"10px",width:"100%"}},y.comboBundle.subProductsSectionVisibility&&e.products.map(((n,r)=>t.createElement(Km,{key:`combo-product-horizontal-${r}-${n.productId}`,product:n,styles:y,originalPrice:g,dealPrice:h,selectedVariantId:d[r],onVariantChange:e=>f(r,e),variantOptions:e.variantOptions}))))),t.createElement("div",{style:{borderTop:"1px solid #eee",display:"flex",flexDirection:"column",rowGap:"5px",marginTop:"20px",width:"100%"}},t.createElement("button",{style:{backgroundColor:m?y.general?.ctaBackgroundColor||"#121212":y.general.disabledButtonColor,color:y.general?.ctaTextColor||"#FFFFFF",fontSize:"16px",borderRadius:y.general.ctaBorderRadius??"20px",fontWeight:"bold",cursor:m?"pointer":"not-allowed",border:`1px solid ${m?y.general?.ctaBackgroundColor||"#121212":y.general.disabledButtonColor}`,boxShadow:y.general.ctaShadowType,padding:y.general?.ctaPadding,width:y.general?.ctaWidth,margin:"0"},disabled:!m,onMouseOver:e=>{y.general.customizeHoverState&&m&&(e.currentTarget.style.backgroundColor=y.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=y.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{y.general.customizeHoverState&&m&&(e.currentTarget.style.backgroundColor=y.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=y.general?.ctaTextColor||"#FFFFFF")},onClick:async()=>{try{if(o(!0),!n)return void o(!1);const t=Object.entries(d).map((([t,n])=>{const r=e.products[parseInt(t)],o=r.productDetails.variants.edges.find((e=>e.node.id===n))?.node;return o?{variantId:n,price:Number(o.price)}:null})).filter((e=>null!==e)),r=Object.values(d);await n(Number(g),r,Number(h),t)}catch(e){}o(!1)}},r?t.createElement(Uo,{color:"white",loading:r,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement(t.Fragment,null,m?y.comboBundle?.ctaTitle??"Add Bundle to cart":y.general.outOfStockLabel||"Out of Stock"," "))),w&&y.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&t.createElement("div",{style:{margin:"20px 0px"}},t.createElement("h4",{style:{fontSize:"16px",color:y.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:y.general.primaryColor+"20"}},"Description"),t.createElement("div",{style:{fontSize:y.comboBundle.productDescriptionFontSize||"16px",color:y.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:y.general.primaryColor+"08"}},t.createElement("p",null,k))))},Jm=x.div`
|
|
3533
|
+
`;const Lm=n(((e,n)=>{const[r,o]=Gt(Zu),a=(e.disableInventoryTracking?r?.variants.edges?.filter((t=>t.node.inventoryQuantity>0||e.disableInventoryTracking)):r?.variants.edges)??[],[i,s]=c(a[0]?.node),[d,p]=c(0),[u,m]=c("undefined"!=typeof window&&window.innerWidth<=600),[f,g]=c(1),[h,x]=c("idle"),[y,b]=c(null),[w,C]=c(null);l((()=>{if(r){const t=r.variants.edges?.filter((t=>t.node.inventoryQuantity>0||e.disableQuantitySelector));s(r?.selectedVariant??t[0]?.node)}}),[r]),l((()=>{const t=e.selectedProducts.find((e=>e.variantId===i?.id));g(t?t.quantity:0)}),[f,e.selectedProducts,i]);const k=()=>{i?.id&&r&&(x("check"),e.handleAddToBundle(i?.id,r,1),setTimeout((()=>{x("idle"),o(void 0)}),500))};if(l((()=>{const e=()=>m(window.innerWidth<=600);return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),!r||0===a.length)return null;const{title:E,descriptionHtml:T,media:S,variants:$}=r,B=S.edges.map((e=>e?.node.preview.image??e?.node.image)).filter((e=>e?.url?.length>0));l((()=>{if(r&&i?.image?.url&&Array.isArray(B)){const e=B.findIndex((e=>e?.url===i?.image?.url));-1!==e&&e!==d&&p(e)}}),[i]);const z=t=>{const n=t.target.value,r=a.find((e=>e.node.id===n))?.node;r&&(r.inventoryQuantity>0||e.disableInventoryTracking)&&s(r)};l((()=>{if(r){window.history.pushState({modalOpen:!0},"",window.location.href);const e=e=>{o(void 0),e.preventDefault()};return window.addEventListener("popstate",e),()=>{window.removeEventListener("popstate",e),window.history.state?.modalOpen&&window.history.back()}}}),[r,o]);const D=e=>{b(e.targetTouches[0].clientX),C(null)},I=e=>{C(e.targetTouches[0].clientX)},_=()=>{if(null!==y&&null!==w&&B.length>1){const e=y-w,t=50;e>t?p((e=>e<B.length-1?e+1:0)):e<-t&&p((e=>e>0?e-1:B.length-1))}b(null),C(null)},O=e.hideAddToBundle||(i?.inventoryQuantity??0)<=0&&!e.disableInventoryTracking||e?.disableQuantitySelector&&f>=1||"idle"!==h,P=t.createElement(Fm,null,t.createElement(Mm,{$isSmallScreen:u,ref:n},t.createElement(Rm,{ref:n,className:"yt-variant-selection-modal"},t.createElement("div",{className:"yt-variant-selection-modal "+(u?"small-screen":"large-screen")},t.createElement(Nm,{onClick:()=>{o(void 0)},style:{backgroundColor:"white"}},t.createElement(lt,{size:"25"})),t.createElement("div",{className:"image-section"},t.createElement(t.Fragment,null,t.createElement("div",{onTouchStart:D,onTouchMove:I,onTouchEnd:_},t.createElement(Am,{small:B[d]?.url,medium:B[d]?.url,large:B[d]?.url,hideDownload:!0,className:"main-image",imageBackgroundColor:"#000"})),t.createElement("div",{className:"image-gallery",style:{display:"flex",flexDirection:"row",overflow:"auto",gap:"10px",scrollbarWidth:"none"}},B.length>1&&B.filter((e=>e?.url.length>0)).map(((n,r)=>t.createElement("img",{key:r,src:$h(n?.url),alt:n.altText||`${E} - Image ${r+1}`,onClick:()=>p(r),className:d===r?"active":"",style:{width:"73px",height:"73px",cursor:"pointer",borderRadius:"7px",border:"1px solid lightgray",...d===r&&{border:`2px solid ${e.themeColor||"#111"}`},objectFit:"cover"},loading:"lazy"})))))),t.createElement("div",{className:"details-section",style:{marginLeft:"20px",minHeight:"100%",maxHeight:"70vh",scrollbarWidth:"none",overflowY:"auto",display:"flex",flexDirection:"column"}},t.createElement("h2",null,a.length>1?i?.displayName:r.title),"ratingOnly"===e.reviewRatingType&&(r?.rating?.averageRating??0)>0&&t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Wr,{color:"gold",size:14})," ",t.createElement("span",{style:{marginLeft:6}},r?.rating?.averageRating,"rating")),"ratingAndReviewCount"===e.reviewRatingType&&(r?.rating?.averageRating??0)>0&&t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Wr,{color:"gold",size:14})," ",r?.rating?.averageRating,t.createElement(Qn,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",r?.rating?.ratingCount," reviews)"),t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"2px",marginTop:"20px"}},a.length>1&&t.createElement("div",null,t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",marginBottom:"10px"}},t.createElement("span",{style:{flexShrink:0}},r.options[0].name," :"," ",t.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},i?.title)),t.createElement("select",{value:i?.id||"",onChange:z,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}},a.map((({node:n})=>t.createElement("option",{key:n.id,value:n.id,disabled:!n.inventoryQuantity&&!e.disableInventoryTracking},n.title)))),t.createElement("span",{style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},t.createElement(ao,null)))),t.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},t.createElement("div",{style:{width:"fit-content",minWidth:"fit-content",paddingRight:"10px",display:"flex",flexDirection:"column"}},i?.compareAtPrice&&parseFloat(i.compareAtPrice)>parseFloat(i?.price)&&t.createElement("div",{style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},Sh(e.styles.general.currencySymbol,e.styles.general.currencySymbol),Th(i?.compareAtPrice)),t.createElement("div",null,t.createElement("span",{style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},Sh(e.styles.general.currencySymbol,e.styles.general.currencySymbol),Th(i?.price)))),t.createElement("div",{style:{width:"80%"},className:"yt-product-modal-atc-wrapper"},t.createElement("button",{style:{textTransform:"uppercase",fontWeight:"800",width:"100%",border:"none",backgroundColor:e.themeColor||"#111",borderRadius:e.cornerRadius,color:e.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden",opacity:O?.5:1,cursor:O?"not-allowed":"pointer"},className:"yt-product-modal-atc-button",onClick:e=>{e.stopPropagation(),e.preventDefault(),k()},disabled:O},e.styles.byob.addToBundleCTAText??"Add to bundle")))),t.createElement("div",{style:{height:"10px",minHeight:"10px",border:"none",backgroundColor:"#D9D9D96B",margin:"20px 0 10px 0",display:"block !important"}},t.createElement("span",null)),t.createElement("span",{className:"yt-description-content",style:{scrollBehavior:"smooth"},dangerouslySetInnerHTML:{__html:T}})))))),A=t.createElement(Fm,null,t.createElement(Mm,{style:{padding:"0px",position:"relative"},$isSmallScreen:u,ref:n},t.createElement(Rm,{ref:n,className:"yt-variant-selection-modal"},t.createElement("button",{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:()=>{o(void 0)}},t.createElement(io,{style:{height:"22px",width:"22px",padding:"4px",color:"black"},onMouseEnter:e=>e.currentTarget.style.color="black"})),t.createElement("div",{className:"yt-variant-selection-modal small-screen",style:{padding:"0px"}},t.createElement("div",{className:"image-section"},t.createElement(t.Fragment,null,t.createElement("div",{style:{position:"relative"},onTouchStart:D,onTouchMove:I,onTouchEnd:_},t.createElement(Am,{small:B[d]?.url,medium:B[d]?.url,large:B[d]?.url,hideDownload:!0,className:"main-image",imageBackgroundColor:"#000"}),t.createElement("div",{style:{position:"absolute",bottom:"20px",width:"100%",display:"flex",justifyContent:"center",alignItems:"center"}},B.length>1&&B.map(((e,n)=>t.createElement("span",{style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:d===n?"#FFFFFF":"#EBEBEB",margin:"0 3px",cursor:"pointer",backdropFilter:"blur(10px)"}}))))),t.createElement("div",{className:"image-gallery",style:{display:"flex",flexDirection:"row",overflowX:"auto",padding:"5px 20px",gap:"5px",scrollbarWidth:"none"}},B.length>1&&B.map(((n,r)=>t.createElement("img",{key:r,src:$h(n?.url),alt:n.altText||`${E} - Image ${r+1}`,onClick:()=>p(r),className:d===r?"active":"",style:{width:"60px",height:"60px",cursor:"pointer",borderRadius:"7px",border:"1px solid lightgray",...d===r&&{border:`2px solid ${e.themeColor||"#111"}`},objectFit:"cover"},loading:"lazy"})))))),t.createElement("div",{className:"details-section",style:{padding:"0 30px",margin:"15px 0",paddingBottom:"120px"}},t.createElement("h2",{style:{margin:"0px"}},a.length>1?i?.displayName:r.title),"ratingOnly"===e.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Wr,{color:"gold",size:14})," ",t.createElement("span",{style:{marginLeft:6}},e?.rating?.averageRating," rating")),"ratingAndReviewCount"===e.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Wr,{color:"gold",size:14})," ",e?.rating?.averageRating,t.createElement(Qn,{style:{color:"dodgerblue",marginLeft:"4px"},size:14})," ","(",e?.rating?.ratingCount," reviews)"),t.createElement("div",{style:{opacity:"0.2",border:"none",height:"2px",backgroundColor:"#000000",margin:"10px 0px",display:"block !important"}},t.createElement("span",null)),t.createElement("div",{className:"yt-description-content",style:{scrollbarWidth:"none",scrollBehavior:"smooth",margin:"0px"},dangerouslySetInnerHTML:{__html:T}})))),t.createElement("div",{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}},a.length>1&&t.createElement("div",null,t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",borderBottom:"1px solid #e0e0e0",paddingBottom:"5px",fontSize:"16px",color:"#999",position:"relative",margin:"10px 0"}},t.createElement("span",{style:{flexShrink:0}},r.options[0].name," :"," ",t.createElement("strong",{style:{color:"#000",paddingLeft:"5px"}},i?.title)),t.createElement("select",{value:i?.id||"",onChange:z,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}},a.map((({node:n})=>t.createElement("option",{key:n.id,value:n.id,disabled:!n.inventoryQuantity&&!e.disableInventoryTracking},n.title)))),t.createElement("span",{style:{position:"absolute",right:5,pointerEvents:"none",fontSize:"12px",color:"#000"}},t.createElement(ao,null)))),t.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%"}},t.createElement("div",{style:{width:"fit-content",minWidth:"fit-content",display:"flex",flexDirection:"column",paddingRight:"10px"}},i?.compareAtPrice&&t.createElement("div",{style:{textDecoration:"line-through",opacity:"0.5",lineHeight:"normal"}},Sh(e.styles.general.currencySymbol,e.styles.general.currencySymbol),Th(i?.compareAtPrice)),t.createElement("div",null,t.createElement("span",{style:{fontSize:"20px",fontWeight:"600",color:"#000",textAlign:"center",lineHeight:"normal"}},Sh(e.styles.general.currencySymbol,e.styles.general.currencySymbol),Th(i?.price)))),!e.hideAddToBundle&&((i?.inventoryQuantity??0)>0||e.disableInventoryTracking)&&(!e?.disableQuantitySelector||f<1)&&t.createElement("div",{style:{width:"100%"}},t.createElement("button",{style:{textTransform:"uppercase",fontWeight:"800",width:"100%",cursor:"pointer",border:"none",backgroundColor:e.themeColor||"#111",borderRadius:e.cornerRadius,color:e.primaryTextColorCta||"#fff",minHeight:"40px",padding:"0px 15px",position:"relative",overflow:"hidden"},onClick:e=>{e.stopPropagation(),e.preventDefault(),k()},disabled:"idle"!==h},e.styles.byob.addToBundleCTAText||"Add to Bundle"))))));return v.createPortal(u?A:P,document.body)})),jm=({options:e,selectedValue:n,onChange:r,type:o="text",isOptionAvailable:a,isMobile:i})=>t.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"}},e?.map((e=>{const l=!a||a(e.name);return i&&!l?null:t.createElement("div",{key:e.name,onClick:()=>{l&&r(e)},style:{cursor:l?"pointer":"not-allowed"}},((e,n)=>{const r=!a||a(e.name),i={cursor:r?"pointer":"not-allowed",border:n?"2px solid #333":"1px solid #d1d5db",transition:"all 0.2s ease",opacity:r?1:.5};if("color"===o)return e.value&&(()=>{if(!e.value.trim())return!1;if(e.value===e.name||e.value.length<3)return!1;try{const t=document.createElement("div");return t.style.color=e.value,""!==t.style.color}catch{return!1}})()?t.createElement("div",{style:{...i,width:24,height:24,borderRadius:"50%",backgroundColor:e.value}}):t.createElement("div",{style:{...i,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},e.name);return"image"===o?t.createElement("img",{src:En(e.value,48,85,"webp")||"/placeholder.svg",alt:e.name,style:{...i,width:24,height:24,borderRadius:"50%",objectFit:"cover"}}):t.createElement("div",{style:{...i,padding:"4px 8px",borderRadius:"12px",fontSize:"12px",fontWeight:n?"600":"400",backgroundColor:n?"#f3f4f6":"white",color:"#333",minWidth:"fit-content",textAlign:"center"}},e.name)})(e,n?.name===e.name))}))),Vm=({product:e,isOpen:n,onClose:r,variantOptions:o,cta:a,onConfirm:i,disableInventoryTracking:s})=>{const[d,p]=c((()=>{const t=e.variants.edges.find((e=>s||e.node.inventoryQuantity>0))?.node;return t?.title&&"Default Title"!==t.title?t.title.split(" / "):e.options?.map((e=>e.values[0]))||[]})),[u,m]=c(window.innerWidth<1024);l((()=>{const e=()=>m(window.innerWidth<1024);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),l((()=>{const e=e=>{"Escape"===e.key&&r()};return n&&document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[n,r]);const f=e.variants.edges.find((t=>t.node.title===(e.options?.length>0?d.join(" / "):d[0])))?.node,g=f?.image?.url||e.featuredMedia?.preview?.image?.url,h=En(g,150,85,"webp"),x=e=>{if(!o?.options)return"text";const t=o.options.find((t=>t.name===e));return t?.type||"text"},y=e=>{if(!o?.options)return e.values.map((e=>({name:e,value:e})));const t=o.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}}))},b=(e,t)=>{const n=d[t];if(!n)return null;return y(e).find((e=>e.name===n))||null};if(!n)return null;const w=t.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:"center",justifyContent:"center"},role:"dialog","aria-modal":"true","aria-labelledby":"yt-variant-options-modal-title"},t.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"}}},t.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"),t.createElement("div",{style:{display:"flex",alignItems:"center",gap:12,padding:"16px 20px",borderBottom:"1px solid #f0f0f0"}},t.createElement("img",{src:h,alt:e.title,style:{width:60,height:60,borderRadius:8,objectFit:"cover",flexShrink:0,transition:"opacity 0.3s ease"}}),t.createElement("div",{style:{display:"flex",flexDirection:"column",flex:1,gap:4}},t.createElement("div",{style:{fontSize:14,fontWeight:600,color:"#333"}},e.title))),t.createElement("div",{style:{padding:"20px"}},e.options.map(((n,r)=>t.createElement("div",{key:n.name,style:{display:"flex",flexDirection:"column",gap:8,marginBottom:n?.values?.length>1?16:0}},n?.values?.length>1&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:8}},t.createElement("span",{style:{fontSize:14,fontWeight:500,color:"#333"}},"Select ",n.name),t.createElement("span",{style:{fontSize:12,fontWeight:500,color:"#666",backgroundColor:"#f5f5f5",padding:"4px 12px",borderRadius:16,textTransform:"capitalize"}},b(n,r)?.name||n.values[0])),t.createElement(jm,{options:y(n),selectedValue:b(n,r),onChange:e=>{((e,t)=>{const n=[...d];n[e]=t.name,p(n)})(r,e)},type:x(n.name),isOptionAvailable:t=>((t,n)=>{if(s)return!0;const r=[...d];r[t]=n;const o=e.options?.length>0?r.join(" / "):r[0],a=e.variants.edges.find((e=>e.node.title===o))?.node;return!!a&&a.inventoryQuantity>0})(r,t),isMobile:u})))))),t.createElement("button",{onClick:()=>{const t=e.variants.edges.find((t=>t.node.title===(e.options?.length>0?d.join(" / "):d[0])))?.node,n=t&&(s||t.inventoryQuantity>0);if(t?.id&&n)i(t.id),r();else{console.warn("yt::variant options modal - selected variant not available or out of stock:",d);const t=e.variants.edges.find((e=>s||e.node.inventoryQuantity>0))?.node.id;t&&(i(t),r())}},style:{width:"100%",fontSize:14,fontWeight:600,textTransform:"uppercase",backgroundColor:a.backgroundColor,color:a.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 v.createPortal(w,document.body)},Hm=({coverImageUrl:e,mobileCoverImageUrl:n,alt:r="Background",styles:o})=>{const a=[{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}],i=(e,t)=>{if(e)try{const n=new URL(e),r=n.searchParams;return r.has("format")||r.set("format","webp"),r.has("quality")||r.set("quality","80"),r.set("width",t.toString()),n.toString()}catch{const n=e.includes("?")?"&":"?";return`${e}${n}format=webp&quality=80&width=${t}`}},l=e=>e?a.map((({imageWidth:t,descriptor:n})=>{const r=i(e,t);return r?`${r} ${n}w`:""})).filter(Boolean).join(", "):"";if(!e&&!n)return null;const c=e||n||"",s=i(c,800)||c,d=[];if(n&&n!==e){const e=l(n);e&&d.push(t.createElement("source",{key:"mobile",media:"(max-width: 768px)",srcSet:e}))}if(e){const n=l(e);n&&(d.length>0?d.push(t.createElement("source",{key:"desktop",media:"(min-width: 769px)",srcSet:n})):d.push(t.createElement("source",{key:"desktop",srcSet:n})))}else if(n){const e=l(n);e&&d.push(t.createElement("source",{key:"mobile",srcSet:e}))}return t.createElement("div",{style:{width:"100%",display:"block"}},t.createElement("picture",{style:{display:"block",width:"100%"}},d,t.createElement("img",{src:s,alt:r,style:{width:"100%",height:"auto",display:"block",...o},loading:"eager",fetchPriority:"high",sizes:"100vw"})))};function Wm({quantity:e,setQuantity:n,remainingQuantity:r,handleAddToBundle:o,variantId:a,product:i,handleRemoveItem:l,hideAddToBundle:c,disableInventoryTracking:s,selectedVariantInventoryQty:d}){const p={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"},u=s||e<d;return t.createElement(ru,null,t.createElement("button",{onClick:t=>{t.stopPropagation();const r=Math.max(0,e-1);n(r),l&&a&&l(a,1)},style:p},"-"),t.createElement(ou,null,e," added"),t.createElement("button",{onClick:t=>{t.stopPropagation();const l=Math.min(r,e+1);n(l),o&&a&&i&&o(a,i,1)},disabled:!u||c,style:{...p,cursor:!u||c?"not-allowed":"pointer",opacity:!u||c?.6:1}},"+"))}const Um=({product:e,styles:n,selectedVariant:r})=>{const[o,a]=c(!1),s=i((()=>$h(r?.image?.url||e?.featuredMedia?.preview?.image?.url||e?.media?.edges?.[0]?.node?.image?.url)||""),[r?.image?.url,e?.featuredMedia?.preview?.image?.url,e?.media?.edges]),d=i((()=>e?.media?.edges?.map((e=>$h(e?.node?.preview?.image?.url??e?.node?.image?.url))).filter(Boolean)??[]),[e?.media?.edges]),p=i((()=>d?.[1]??s??""),[d,s]);l((()=>{if(s){(new Image).src=s}}),[s]);const u=i((()=>s||d?.[0]),[s,d]);return t.createElement("div",{style:{position:"relative",width:"100%",overflow:"hidden",aspectRatio:n.general.imageAspectRatio||"1/1"},onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1)},t.createElement("div",{style:{width:"100%",height:"100%",position:"relative"}},t.createElement("img",{loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"top",opacity:o&&u!==p?0:1,transition:d?.length>0?"opacity 300ms ease, transform 300ms ease":"",transform:o?"scale(1.1)":"scale(1)"},src:u,alt:e.title}),u!==p&&t.createElement("img",{loading:"lazy",style:{width:"100%",height:"100%",objectFit:"cover",opacity:o?1:0,transition:"opacity 400ms ease, transform 400ms ease",transform:o?"scale(1.1)":"scale(1)",position:"absolute",top:0,left:0,objectPosition:"top"},src:p,alt:e.title})))},Gm=({product:e,bundle:n,handleAddToBundle:r,hideAddToBundle:o,remainingQuantity:a,themeColor:i,handleRemoveItem:s,transitionActive:d,idx:p,selecteditems:u,customVariantsQuantity:m})=>{const f=Ut(Zu),g=n.customizations,h=g?.byob?.variantSelectorType,[x,y]=c(!1),b=g.general?.variantTitleSuffix?e?.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 r=t[e];let o=0;for(;o<n.length&&o<r.length&&n[n.length-1-o]===r[r.length-1-o];)o++;n=n.slice(n.length-o)}return n.length<1?e:e.map((e=>{const t=e.node.title.split(" "),r=t.slice(0,t.length-n.length).join(" ");return{...e,node:{...e.node,title:r,commonSuffix:n.join(" ")}}}))})(e?.variants?.edges);if(!b||!b.length)return t.createElement(t.Fragment,null);const v=b?.find((e=>e.node.inventoryQuantity>0||!g?.general.trackInventory))?.node?.id;if(!v&&!g.general.showOutOfStockProducts)return t.createElement(t.Fragment,null);const[w,C]=c(b?.find((e=>!g?.general.trackInventory||e.node.inventoryQuantity>0))?.node?.id||b[0]?.node?.id),[k,E]=c(0),[T,S]=c(window.innerWidth<450),[$,B]=c("normal"),z=b?.find((e=>e?.node?.id===w))?.node,D=m&&m.length>0&&m.find((e=>e.variantId==z?.id))?.quantity||z&&z?.inventoryQuantity;l((()=>{const e=u.find((e=>e.variantId===w));E(e?e.quantity:0)}),[k,u,w]),l((()=>{const e=()=>{S(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),l((()=>{CSS.supports("font-weight","500")?B("500"):CSS.supports("font-weight","400")?B("400"):CSS.supports("font-weight","600")&&B("600")}),[]),l((()=>{document.documentElement.style.setProperty("--yt-bundle-font-weight",$)}),[$]),l((()=>{if(w&&!b?.some((e=>e.node.id===w))){const e=b[0]?.node.id;e&&C(e)}}),[w,b]);const I=e.variants&&e.variants.edges?.length>1&&"customOptions"!==h,_="undefined"!=typeof window?(window?.ytapp||window?.ytBundleApp)?.storeId:void 0,O="53933408435"===_,P="75851235630"===_,A=(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[]})(e),N=A.length>0;return t.createElement(t.Fragment,null,t.createElement(lu,{borderRadius:g?.byob.borderRadius,borderColor:g?.byob.borderColor,shadowType:g?.byob.shadowType,backgroundColor:g?.byob.cardBackgroundColor,className:"bundle-builder-product-container "+(d?"yt-product-card-transition-active":p%2==0?"yt-product-card-transition":"yt-product-card-transition-up"),onClick:()=>{if(D<=0&&g?.general.trackInventory)return;const t={...e,variants:{...e.variants,edges:b},selectedVariant:z};f(t)},onMouseEnter:e=>{e.currentTarget.style.transform="scale(1.01)"},onMouseLeave:e=>{e.currentTarget.style.transform="scale(1)"},style:{WebkitTapHighlightColor:"transparent"}},t.createElement(cu,null,t.createElement(Um,{product:e,styles:g,selectedVariant:z}),n?.productCardBadgeText&&t.createElement("div",{style:{position:"absolute",top:"0px",left:"0px",backgroundColor:g?.general.primaryColor||"#111",color:g?.general.primaryContrastColor||"#fff",zIndex:1,margin:"0px",whiteSpace:"pre",padding:"4px 8px",fontSize:"12px",borderTopLeftRadius:g.byob.borderRadius}},n.productCardBadgeText),I&&t.createElement("div",{style:{position:"relative",width:"100%"}},t.createElement(su,{isCoralHaze:O,onClick:e=>{e.preventDefault(),e.stopPropagation()},value:w||"",onChange:e=>{e.stopPropagation(),e.preventDefault(),C(e.target.value)}},b?.map((e=>{const n=window.innerWidth<=320?10:window.innerWidth<=420?15:22,r=e.node.title.length>n?e.node.title.substring(0,n)+"...":e.node.title;return t.createElement("option",{key:e.node.id,value:e.node.id},r)}))),t.createElement("div",{style:{position:"absolute",right:"16px",bottom:"10px",pointerEvents:"none"}},t.createElement(F,null)))),t.createElement("div",null,"enabled"===n?.customizations?.byob?.productCardCategoryVisibility&&N&&t.createElement("div",{style:{padding:"2px 4px"}},t.createElement("div",{style:{display:"flex",flexWrap:"wrap",gap:"4px"}},A.slice(0,2).map(((e,n)=>t.createElement("span",{key:n,style:{fontSize:T?"8px":"12px",color:"#666",fontWeight:"500"}},e.charAt(0).toUpperCase()+e.slice(1)))),A.length>2&&t.createElement("span",{style:{fontSize:"10px",padding:"2px 6px",backgroundColor:"rgba(0, 0, 0, 0.05)",borderRadius:"8px",color:"#666",fontWeight:"500"}},"+",A.length-2," more"))),t.createElement(du,{isMobile:T,showBorder:n?.showBorder??!0,style:{...!g?.byob.productsPriceVisibility&&{padding:"8px"},...g?.byob.productTitleFontSize&&{fontSize:g?.byob.productTitleFontSize}}},P?String(z?.displayName).replace("- Default Title",""):e.title,z?.commonSuffix?" -"+z?.commonSuffix:"")),"ratingOnly"===n?.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Wr,{color:"gold",size:14})," ",t.createElement("span",{style:{marginLeft:6}},e?.rating?.averageRating," rating")),"ratingAndReviewCount"===n?.reviewRatingType&&(e?.rating?.averageRating??0)>0&&t.createElement("div",{style:{display:"flex",alignItems:"center",justifyContent:"start",fontSize:"14px",color:"#333"}},t.createElement(Wr,{color:"gold",size:14})," ",e?.rating?.averageRating,t.createElement(Qn,{size:14,style:{color:"dodgerblue",marginLeft:"4px"}})," ","(",e?.rating?.ratingCount," reviews)"),g?.byob.productsPriceVisibility&&t.createElement("div",{className:"yt-bundle-builder-product-price",style:{marginBottom:"5px",padding:n?.showBorder?"0px 10px":"0 4px"}},parseFloat(z?.price??"0")>0?t.createElement("span",null,Sh(g.general.currencySymbol,n?.storeCurrencyCode)??"Rs.",Th(z?.price)):t.createElement("span",null,"Free"),z?.compareAtPrice&&g?.byob.compareAtPriceVisibility&&parseFloat(z.compareAtPrice)>parseFloat(z?.price)&&t.createElement("span",{className:"yt-fixed-bundle-original-price",style:{fontSize:"14px"}},Sh(g.general.currencySymbol,n?.storeCurrencyCode)??"Rs.",Th(z.compareAtPrice))),(D>0||!g?.general.trackInventory)&&t.createElement(pu,{borderRadius:g?.byob.borderRadius,className:"yt-product-atc-wrapper"},(0===k||void 0===k)&&t.createElement(au,{style:{...!o&&{backgroundColor:g?.general.primaryColor||"#111",color:g?.general.primaryContrastColor||"#fff"}},disabled:o,onClick:t=>{t.stopPropagation(),t.preventDefault(),E(1),(()=>{if(!w)return;"customOptions"===h&&b.length>1?y(!0):r(w,e,1)})()},className:"yt-product-atc-button"},g?.byob.addToBundleCTAText),!n?.disableQuantitySelector&&k>0&&w&&t.createElement(iu,{className:"visible",style:{overflow:"hidden"}},t.createElement(Wm,{remainingQuantity:a,setQuantity:E,quantity:k,handleAddToBundle:r,variantId:w,product:e,handleRemoveItem:s,hideAddToBundle:o,disableInventoryTracking:!g?.general.trackInventory,selectedVariantInventoryQty:D})),n?.disableQuantitySelector&&k>0&&w&&t.createElement(au,{style:{backgroundColor:"#747474",color:g?.general.primaryContrastColor||"#fff",display:"flex",justifyContent:"space-between",overflow:"hidden",height:"40px"},className:"yt-product-atc-single-qty-selector"},t.createElement(uu,{className:"yt-product-atc-single-qty-selector-added"},"ADDED"),t.createElement(mu,{onClick:e=>{e.stopPropagation();const t=Math.max(0,k-1);E(t),s&&w&&s(w,1)},className:"yt-product-atc-single-qty-selector-remove"},t.createElement(no,{style:{color:"#fff",fontSize:"20px"}})))),D<=0&&g?.general.trackInventory&&t.createElement(au,{style:{backgroundColor:g.general.disabledButtonColor,color:"#fff",cursor:"not-allowed",transition:"transform 0.2s ease-in-out"},className:"yt-product-atc-disabled"},g?.general.outOfStockLabel||"Out of Stock")),"customOptions"===h&&x&&b.length>1&&t.createElement(Vm,{product:e,isOpen:x,onClose:()=>y(!1),variantOptions:n.variantOptions,cta:{textColor:g.general.ctaTextColor,backgroundColor:g.general.primaryColor},onConfirm:t=>{C(t),r(t,e,1)},disableInventoryTracking:!g?.general.trackInventory}))},Qm=({currentStep:e,setCurrentProductTier:n,totalSteps:r,tiers:o,isMobile:a,selectedProductsByTier:i,primaryColor:l="#000",primaryTextColorCta:c="#fff",tierNavigation:s})=>t.createElement("div",{style:{textAlign:"center",fontSize:"20px"}},t.createElement("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center"}},Array.from({length:r}).map(((c,d)=>{const p=d+1,u=o[d].minimumQuantity-(i[d]?.length??0)==0,m=d===e;return l="black"===l?"#000000":l,t.createElement(t.Fragment,{key:p},t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:"pointer",gap:a?"4px":"8px"},onClick:()=>!1===s?()=>{}:n(p-1)},t.createElement("div",{style:{fontSize:"14px"}},"Step ",p),t.createElement("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",justifyContent:"center",cursor:"pointer"}},t.createElement("div",{style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",borderTopLeftRadius:"5px",borderBottomLeftRadius:"5px"}}),t.createElement("div",{style:{width:"10px",height:"10px",borderRadius:"50%",backgroundColor:u?`${l}50`:"white",border:`2px solid ${u?l:m?"#666666":"#CBD5E0"}`,display:"flex",alignItems:"center",justifyContent:"center"}}),t.createElement("div",{style:{height:"3px",width:a?"30px":"50px",backgroundColor:u?l:m?"#666666":"#CBD5E0",display:"block",marginRight:d<r?a?"4px":"6px":"",borderTopRightRadius:"5px",borderBottomRightRadius:"5px"}}))))}))),t.createElement("div",{style:{margin:a?"16px 0px":"15px 0px",fontSize:a?"16px":"18px",padding:"4px",background:"rgba(0, 0, 0, 0.03)",borderBottom:"1px solid rgba(130, 130, 130, 0.28)"}},o[e]?.title)),Ym=({isMobile:e,setSearchTerm:n,searchTerm:r,styles:o,setSortBy:a})=>{const[i,s]=c(!1),[d,p]=c(r);return l((()=>{const e=setTimeout((()=>{n(d)}),300);return()=>clearTimeout(e)}),[d,n]),t.createElement("div",{className:"yt-byob-sort-filter-container",style:{display:"flex",flexDirection:e?"column":"row",justifyContent:"space-between",alignItems:e?"flex-end":"center",textAlign:"center",marginBottom:"20px",width:"97%",gap:e?"10px":"0"}},t.createElement("div",{className:"yt-byob-sort-filter-inner",style:{display:"flex",flexDirection:i&&e?"column":e?"row-reverse":"row",justifyContent:"space-between",alignItems:i?"":"center",gap:"12px",width:"100%"}},t.createElement("div",{className:"yt-byob-search-wrapper",style:{position:"relative",display:"flex",alignItems:"center",width:e?i?"100%":"auto":"400px",transition:"width 0.3s ease-in-out"}},e&&!i?t.createElement(to,{className:"yt-byob-search-icon",fontSize:"20px",color:"#555",style:{cursor:"pointer",lineHeight:"normal"},onClick:()=>s(!0)}):t.createElement(t.Fragment,null,t.createElement("input",{className:"yt-byob-search-input",style:{width:"100%",padding:e?"10px 12px":"10px 14px",fontSize:"14px",outline:"none",color:"#333",border:"1px solid #c7c7c7",borderRadius:o?.byob.borderRadius,boxShadow:o?.byob.borderColor?"0 2px 4px rgba(0, 0, 0, 0.1)":"none",textAlign:"start"},placeholder:"Search by Product Name",value:d,onChange:e=>p(e.target.value)}),!i&&t.createElement("span",{className:"yt-byob-search-icon-input",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",display:"flex",alignItems:"center",justifyContent:"center",background:"white",paddingLeft:"5px"}},t.createElement(to,{fontSize:"18px",style:{lineHeight:"normal"}}))),e&&i&&t.createElement("span",{className:"yt-byob-search-close-icon",style:{position:"absolute",right:"12px",color:"#aaa",fontSize:"16px",cursor:"pointer"},onClick:()=>s(!1)},"✖")),t.createElement("div",{className:"yt-byob-filter-wrapper",style:{display:"flex",alignItems:"center",textAlign:"center",border:window.innerWidth>600?"1px solid #d1d5db":"",padding:"8px 12px",fontSize:"14px",cursor:"pointer",borderRadius:o?.byob.borderRadius,boxShadow:o?.byob.borderColor?window.innerWidth>600?"0 2px 4px rgba(0, 0, 0, 0.1)":" ":"none"}},t.createElement("span",{className:"yt-byob-filter-label",style:{fontSize:"14px",color:"#555",marginRight:"6px"}},"Sort:"),t.createElement("select",{className:"yt-byob-filter-select",style:{flex:1,border:"none",height:"auto",padding:"0px",marginBottom:"0px",background:"transparent",fontSize:"14px",color:"#333",fontWeight:"500",width:e?"120px":"",outline:"none",cursor:"pointer",textAlign:"start"},onChange:e=>a(e.target.value)},t.createElement("option",{value:"best-selling"},"Featured"),t.createElement("option",{value:"title-asc"},"Product Title (A-Z)"),t.createElement("option",{value:"title-desc"},"Product Title (Z-A)"),t.createElement("option",{value:"price-low-to-high"},"Price (Low to High)"),t.createElement("option",{value:"price-high-to-low"},"Price (High to Low)")))))},qm=({styles:e,isMobile:n,categories:r,activeCategory:o,onCategoryChange:a})=>{const i=e=>{a(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"===e?.byob?.categoryFilterOnPage?t.createElement("div",{style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",width:"100%"},className:"yt-categoryfilter-wrapper"},t.createElement("div",{style:{display:"flex",gap:"0px",minWidth:"max-content",paddingBottom:"1px",flexWrap:"nowrap",justifyContent:"center",borderBottom:"1px solid #e0e0e0",width:"auto",height:n?"28px":"45px"},className:"yt-categoryfilter-tabs-container"},["All",...r].map((r=>{const a=o===r;return t.createElement("button",{key:r,onClick:()=>i(r),className:"yt-categoryfilter-tab-button",style:{background:"none",border:"none",padding:n?"12px 16px":"12px 20px",fontSize:n?"14px":"16px",fontWeight:a?"600":"400",color:a?e.general.primaryColor:"#666",cursor:"pointer",position:"relative",transition:"all 0.3s ease",backgroundColor:a?l(e.general.primaryColor,.07):"transparent",borderBottom:a?`2px solid ${e?.general.primaryColor}`:"2px solid transparent",marginBottom:"-1px",whiteSpace:"nowrap",minWidth:"fit-content"},onMouseEnter:t=>{a||(t.currentTarget.style.color=e?.general.primaryColor)},onMouseLeave:e=>{a||(e.currentTarget.style.color="#666")}},t.createElement("span",{style:{visibility:"hidden",height:0,display:"block",overflow:"hidden",fontWeight:600},"aria-hidden":"true"},r.charAt(0).toUpperCase()+r.slice(1)),t.createElement("span",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",textAlign:"center"}},r.charAt(0).toUpperCase()+r.slice(1)))})))):t.createElement("div",{style:{overflowX:n?"auto":"visible",scrollbarWidth:"none",msOverflowStyle:"none",marginBottom:"20px",paddingBottom:"5px"},className:"yt-categoryfilter-wrapper"},t.createElement("div",{style:{display:"flex",gap:"8px",minWidth:"max-content",flexWrap:"nowrap",justifyContent:"center",paddingRight:n?"10px":"0px"},className:"yt-categoryfilter-buttons-container"},["All",...r].map((r=>t.createElement("button",{key:r,onClick:()=>i(r),className:"yt-categoryfilter-button",style:{padding:n?"8px 16px":"10px 18px",fontSize:n?"13px":"14px",fontWeight:"500",border:`1px solid ${o===r?e?.general.primaryColor:"#e0e0e0"}`,borderRadius:e?.general.ctaBorderRadius,backgroundColor:o===r?e?.general.primaryColor:"white",color:o===r?"white":"#333",cursor:"pointer",transition:"all 0.3s ease",outline:"none",whiteSpace:"nowrap",minWidth:"fit-content",flexShrink:0},onMouseEnter:t=>{o!==r&&(t.currentTarget.style.borderColor=e?.general.primaryColor,t.currentTarget.style.color=e?.general.primaryColor)},onMouseLeave:e=>{o!==r&&(e.currentTarget.style.borderColor="#e0e0e0",e.currentTarget.style.color="#333")}},r.charAt(0).toUpperCase()+r.slice(1))))))},Zm=({bundle:e,selectedItems:n,setSelectedItems:r,handleAddToCart:i,bundleAddToCartLoading:s,renderingOnPage:d,selectedItemsQuantity:p,handleRemoveItem:u,bundleSubtotal:m})=>{const[f,g]=c(void 0),[h,x]=c(window.innerWidth<450),[y,b]=c(0),[v,w]=c({}),C=e.builderTiers?.type,k=e.customizations,E=e.builderTiers?.productTier??[],T=e.builderTiers?.offerTier??[],[S,$]=c([]),[B,z]=c(!1),[D,I]=c("All"),[_,O]=c(0),P=o(null);l((()=>{const t=new Set;let n=!1;e?.products?.forEach((e=>{const r=e.productDetails;if(r.metafield&&"yourtoken_bundles_app"===r.metafield.namespace&&"categories"===r.metafield.key){let e=[];if(r.metafield.jsonValue&&Array.isArray(r.metafield.jsonValue))e=r.metafield.jsonValue;else if(r.metafield.value)try{const t=JSON.parse(r.metafield.value);Array.isArray(t)&&(e=t)}catch(e){console.error("Failed to parse categories:",e)}e.length>0&&(n=!0,e.forEach((e=>t.add(e))))}})),$(Array.from(t)),z(n)}),[e.products]);const A=((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})))(e.products.filter((e=>"active"===e.productDetails.status?.toLowerCase()||void 0===e.productDetails.status||""===e.productDetails.status)),D),N="productTier"===C?E.reduce(((e,t)=>e+t.minimumQuantity),0):"offerTier"===C?T.reduce(((e,t)=>e+t.minimumQuantity),0):e.minimumQuantity,[F,M]=c(""),[R,L]=c(""),j=((e,t)=>e.filter((e=>e?.productDetails?.title?.toLowerCase().includes(t?.toLowerCase()))))(A,F),V=((e,t)=>[...e].sort(((e,n)=>{const r=e?.productDetails?.title?.toLowerCase(),o=n?.productDetails?.title?.toLowerCase(),a=parseFloat(e?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),i=parseFloat(n?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(t){case"title-asc":return r.localeCompare(o);case"title-desc":return o.localeCompare(r);case"price-low-to-high":return a-i;case"price-high-to-low":return i-a;default:return 0}})))(j,R),H=((e,t,n,r,o)=>(e[o]?.products.filter((e=>t.some((t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))&&t?.productDetails.title.toLowerCase().includes(n?.toLowerCase())))))||[]).sort(((e,n)=>{let o=t.find((t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0])))),a=t.find((e=>e.productId===n.productId&&(n.variantIds.length<1||e.variantIds.includes(n.variantIds[0]))));if(!o||!a)return 0;const i=o.productDetails?.title?.toLowerCase(),l=a.productDetails?.title?.toLowerCase(),c=parseFloat(o?.productDetails?.variants?.edges?.[0]?.node?.price||"0"),s=parseFloat(a?.productDetails?.variants?.edges?.[0]?.node?.price||"0");switch(r){case"title-asc":return i.localeCompare(l);case"title-desc":return l.localeCompare(i);case"price-low-to-high":return c-s;case"price-high-to-low":return s-c;default:return 0}})))(E,V,F,R,y),[W,U]=Gt(Zu),[G,Q]=c(!1),Y="productTier"===C?H:V,q=Y.slice(0,20*(_+1));l((()=>{setTimeout((()=>{Q(!0)}),100)}),[]);const Z=o(null);l((()=>{const e=()=>{x(window.innerWidth<450)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),l((()=>{if(e.coverImageUrl){const t=new Image;t.src=$h(e.coverImageUrl)??"",t.onload=()=>{g(t.width/t.height)}}}),[e.coverImageUrl]),l((()=>{Q(!1),setTimeout((()=>Q(!0)),100)}),[y]);const K=(e,t)=>{if("productTier"===C){let n={...v},r=!1;if(n[t]){const o=n[t].indexOf(e);-1!==o&&(n[t]=[...n[t]],n[t].splice(o,1),r=!0)}if(!r)for(let t=E.length;t>=0;t--){const r=n[t].indexOf(e);if(-1!==r){n[t]=[...n[t]],n[t].splice(r,1);break}}w(n);const o=E.findIndex(((e,t)=>n[t]?.length<e.minimumQuantity));-1!==o&&b(o)}u(e)};l((()=>{if("productTier"===C){const e=Object.fromEntries(E.map((e=>[e.tier,[]])));w(e)}}),[e]),l((()=>{if("productTier"!==C||!E[y])return;if(N===p)return;const e=E.findIndex(((e,t)=>{const n=v[t]||[];return t>=y&&n.length<e.minimumQuantity}));-1!==e&&e!==y&&(b(e),(()=>{const e=document.querySelector(".products-display");e&&e.scrollIntoView({behavior:"smooth"})})())}),[v,E,C]),l((()=>{M("")}),[y]),l((()=>{function e(e){if(!Z.current||!e.target)return;!Z.current.contains(e.target)&&U(void 0)}return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}}),[]);const X=(e,t,o)=>{var a;"productTier"===C&&(a=e,w((e=>{const t={...e},n=E.findIndex(((e,n)=>{const r=t[n]||[];return n>=y&&r.length<e.minimumQuantity}));return-1!==n&&b(n),t[n]||(t[n]=[]),t[n].push(a),t}))),Bh(e,t,o,n,r)},J=(()=>{if(!e?.builderTiers)return e.minimumQuantity;const{type:t,offerTier:n,productTier:r}=e.builderTiers,o="offerTier"===t?n:"productTier"===t?r:null;if(!o)return e.minimumQuantity;let a=0;return o.map((e=>{a+=e.minimumQuantity})),a})(),ee=h&&e.mobileCoverImageUrl?$h(e.mobileCoverImageUrl):$h(e.coverImageUrl??"")||null,te=e.customStoreDetails?.fixedInventoryDetails,ne=e=>{const t=k?.general?.showOutOfStockProducts;if(t||!k?.general.trackInventory)return!0;const n=e?.productDetails?.variants?.edges||[];if(te){if(n.some((e=>te.some((t=>t.variantId===e.node.id&&t.quantity>0)))))return!0}return n.some((e=>e.node.inventoryQuantity>0))},re="bundles"==e.appName?e.pageHeader?.title:e?.title,oe="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;l((()=>{O(0)}),[F,R,D,y]);const ae=a((()=>{q.length<Y.length&&O((e=>e+1))}),[q.length,Y.length]);return l((()=>{const e=new IntersectionObserver((([e])=>{e.isIntersecting&&ae()}),{threshold:.1});return P.current&&e.observe(P.current),()=>{P.current&&e.unobserve(P.current)}}),[ae]),l((()=>console.log(q)),[q]),t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",rowGap:"15px",padding:"20px 0px",marginBottom:"20px",backgroundColor:k.byob.sectionBackgroundColor,..."transparent"!==k.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},ee?t.createElement("div",{style:{position:"relative",width:"100%",display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center",overflow:"hidden",...e?.coverImageVerticalMargin&&{marginBottom:e?.coverImageVerticalMargin,marginTop:e?.coverImageVerticalMargin}}},ee&&t.createElement(Hm,{coverImageUrl:ee,alt:"Background",styles:{width:"100%",height:"auto",display:"block"}}),t.createElement("div",{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)"}},t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.titleFontSize??"3rem",fontWeight:"700",color:k?.byob?.titleTextColor??"#000",marginBottom:"15px",backgroundColor:k?.byob?.titleBackgroundColor??"transparent",width:"100%",textAlign:"center"},className:"bundle-builder-title"},re),t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.subtitleFontSize??"1.5rem",color:k?.byob?.titleTextColor??"#000"},className:"bundle-builder-subtitle"},oe))):(re||oe)&&t.createElement("div",{style:{zIndex:1,display:"flex",flexDirection:"column",alignItems:"center",padding:"20px",width:"90%",maxWidth:"1000px"}},re&&t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.titleFontSize??"3rem",fontWeight:"700",color:k?.byob?.titleTextColor??"#000",marginBottom:"15px",textAlign:"center",width:"100%",backgroundColor:k?.byob?.titleBackgroundColor??"transparent"}},re),oe&&t.createElement("span",{style:{lineHeight:"normal",fontSize:k?.byob?.subtitleFontSize??"1.5rem",color:k?.byob?.titleTextColor??"#000"}},oe)),t.createElement("div",{style:{fontSize:"20px",width:"100%"},className:"products-display"},"productTier"===C&&E.length>0&&k?.byob.productTiersVisibility&&t.createElement(t.Fragment,null,t.createElement("div",null,t.createElement(Qm,{currentStep:y,totalSteps:E.length,tiers:E,isMobile:h,primaryColor:k?.general?.primaryColor,primaryTextColorCta:k?.general?.primaryContrastColor,setCurrentProductTier:b,selectedProductsByTier:v,tierNavigation:k.byob.tierNavigation})))),t.createElement("div",{style:{width:"100%",display:"flex",flexDirection:"column",gap:"20px"}},e?.enableSortAndFilter&&t.createElement(Ym,{isMobile:h,searchTerm:F,setSearchTerm:M,setSortBy:L,styles:k}),e?.customizations?.byob?.enableProductCategories&&B&&t.createElement("div",null,t.createElement(qm,{styles:k,isMobile:h,categories:S,activeCategory:D,onCategoryChange:e=>{I(e)}}))),t.createElement("div",{style:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"12px",justifyContent:"center",width:"100%"},className:"products-display"},0===Y?.length?t.createElement("p",{style:{fontSize:"20px",color:"#333",textAlign:"center",width:"100%"}},"No products found"):"productTier"===C&&E.length>0?q.filter((e=>ne(V.find((t=>t.productId===e.productId&&(e.variantIds.length<1||t.variantIds.includes(e.variantIds[0]))))))).map(((r,o)=>{const a=(E[y]?.minimumQuantity??0)>(v[y]?.length??0),i=V.find((e=>e.productId===r.productId&&(r.variantIds.length<1||e.variantIds.includes(r.variantIds[0]))));return i?t.createElement(Gm,{bundle:e,idx:o,key:r?.variantIds?.[0]??r.productId,product:i?.productDetails,handleAddToBundle:X,hideAddToBundle:!a,remainingQuantity:J-p,themeColor:e?.dealTextColor,handleRemoveItem:e=>K(e,y),selecteditems:n,transitionActive:G,customVariantsQuantity:te}):null})):q.filter(ne).map(((r,o)=>t.createElement(Gm,{bundle:e,idx:o,key:r.productId,product:r?.productDetails,handleAddToBundle:X,hideAddToBundle:p>=J,remainingQuantity:J-p,themeColor:e?.dealTextColor,handleRemoveItem:u,selecteditems:n,transitionActive:G,customVariantsQuantity:te}))),q.length<Y.length&&t.createElement("div",{ref:P,style:{height:"1px",width:"100%",display:"block"}})),!d&&t.createElement(qu,{builderTiers:e?.builderTiers,handleAddToCart:i,minimumQuantity:N,selectedProducts:n,showProductDetailsInTracker:e.showProductDetailsInTracker,handleRemoveItem:u,handleRemoveItemProductTier:K,selectedItemsQuantity:p,percentageOff:e.percentageOff,loading:s,bundleSubtotal:m,amountOff:e.amountOff,styles:e.customizations,dealAmount:e.dealAmount,themeColor:e?.dealTextColor??"#333",primaryTextColorCta:e?.primaryTextColorCta??"#fff",cornerRadiusType:e?.cornerRadiusType??"",selectedProductsByTier:v,renderingOnPage:d})),d&&t.createElement(qu,{handleAddToCart:i,minimumQuantity:N,builderTiers:e?.builderTiers,selectedProducts:n,showProductDetailsInTracker:e.showProductDetailsInTracker,loading:s,handleRemoveItem:u,handleRemoveItemProductTier:K,percentageOff:e.percentageOff,selectedItemsQuantity:p??0,bundleSubtotal:m??{price:0,compareAtPrice:0},amountOff:e.amountOff,styles:e.customizations,dealAmount:e.dealAmount,themeColor:k?.general.primaryColor||"#000",primaryTextColorCta:k.general.primaryContrastColor??"#fff",cornerRadiusType:e?.cornerRadiusType??"",selectedProductsByTier:v,renderingOnPage:d}),W&&void 0!==p&&(()=>{let r=p<e.minimumQuantity;return"productTier"==C?r=(E[y]?.minimumQuantity??0)>(v[y]?.length??0):"offerTier"==C&&(r=p<T.reduce(((e,t)=>e+t.minimumQuantity),0)),t.createElement(Lm,{handleAddToBundle:X,ref:Z,remainingQuantity:e.minimumQuantity-p,hideAddToBundle:!r,disableQuantitySelector:e?.disableQuantitySelector??!1,disableInventoryTracking:!e?.customizations.general.trackInventory,selectedProducts:n,themeColor:k?.general.primaryColor||"#000",primaryTextColorCta:e?.customizations?.general.primaryContrastColor??"#fff",primaryBackgroundColorCta:k?.general.primaryColor||"#000",cornerRadius:e?.customizations.byob.borderRadius,styles:e.customizations,reviewRatingType:e?.reviewRatingType??"none"})})())},Km=({product:e,selectedVariantId:n,onVariantChange:r,styles:o,originalPrice:a,dealPrice:l,isVertical:c=!1,variantOptions:s,storeCurrencyCode:d})=>{const p=e?.productDetails?.variants?.edges?.find((e=>e?.node?.id===n))?.node,u=i((()=>{if(p?.title&&e.productDetails.options){const t=p.title.split(" / ");if(t.length===e.productDetails.options.length)return t}return e.productDetails.options?.map((e=>e.values[0]))||[]}),[p,e.productDetails.options]),m=e=>{r(e)};return c?t.createElement("div",{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"}},t.createElement("div",{style:{position:"relative",width:"100%"}},o.comboBundle.subProductsImageVisibility&&t.createElement(t.Fragment,null,t.createElement("img",{src:$h(p?.image?.url||e?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:e?.productDetails?.featuredMedia?.alt,width:165,height:165,style:{objectFit:"cover",borderRadius:"20px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",height:"100%",aspectRatio:o.general?.imageAspectRatio||"1/1"}}),t.createElement("div",{style:{marginTop:"8px",position:"absolute",bottom:"10px",left:"5px",right:"5px"}},e?.productDetails?.variants?.edges?.length>1&&t.createElement(t.Fragment,null,t.createElement("select",{value:n,onChange:e=>m(e.target.value),style:{padding:"8px 10px",border:"1px solid #ddd",backgroundColor:"#fff",color:"#333",fontSize:"14px",width:"100%",appearance:"none",marginRight:"30px"}},e?.productDetails?.variants?.edges.map((e=>t.createElement("option",{key:e?.node?.id,value:e?.node?.id,disabled:e.node.inventoryQuantity<=0},e?.node?.title)))),t.createElement("div",{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"}},t.createElement(F,null)))))),(o.comboBundle.subProductsProductTitleVisibility||o.comboBundle.subProductsProductPriceVisibility)&&t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"40px",width:"100%",paddingBlock:"5px"}},o.comboBundle.subProductsProductTitleVisibility&&t.createElement("span",{style:{fontSize:"12px",color:"#333",fontWeight:"600",lineHeight:"normal",textAlign:"center",width:"fit-content"}},e?.productDetails?.title),o.comboBundle.subProductsProductPriceVisibility&&t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",lineHeight:"normal",fontSize:"14px"}},t.createElement("span",{style:{lineHeight:"normal"}},Sh(o.general.currencySymbol,d),Th((Number(""!==p?.compareAtPrice?Number(p?.compareAtPrice):p?.price)/Number(a)*Number(l)).toFixed(2))),t.createElement("span",{style:{textDecoration:"line-through",color:"#999",lineHeight:"normal",fontSize:"12px"}},Sh(o.general.currencySymbol,d),Th(""!==p?.compareAtPrice?p?.compareAtPrice:p?.price))))):t.createElement("div",{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"===o.comboBundle.infoAlignment&&{flexDirection:"row-reverse"},..."center"===o.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"}},o.comboBundle.subProductsImageVisibility&&t.createElement("div",{style:{position:"relative"}},t.createElement("img",{src:$h(p?.image?.url||e?.productDetails?.featuredMedia?.preview?.image?.url||"/placeholder.svg"),alt:e?.productDetails?.featuredMedia?.alt,height:80,style:{objectFit:"cover",borderRadius:"10px",border:"1px solid #DEDEDE",aspectRatio:"1/1",width:"90px",height:"90px"}}),t.createElement("div",{style:{position:"absolute",top:-8,right:-8,backgroundColor:"#f8f8f8",borderRadius:"50%",width:"24px",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid #eee",fontSize:"14px"}},"1")),t.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"left"===o.comboBundle?.infoAlignment?"flex-start":"right"===o.comboBundle?.infoAlignment?"flex-end":"center"===o.comboBundle?.infoAlignment?"flex-start":void 0}},o.comboBundle.subProductsProductTitleVisibility&&t.createElement("span",{style:{fontSize:"14px",fontWeight:"600",lineHeight:"normal",display:"flex",alignItems:"center",gap:"8px"}},t.createElement("span",null," ",e?.productDetails?.title," "),e.productDetails.variants.edges.length>1&&s&&u&&t.createElement("span",{style:{fontSize:"10px",color:"#666",backgroundColor:"#F4F4F4",padding:"2px 8px",borderRadius:"10px",border:"1px solid #ddd"}},u.length>1?u.join(" / "):u)),o.comboBundle.subProductsProductPriceVisibility&&t.createElement("div",{style:{display:"flex",gap:"8px",marginTop:"5px",alignItems:"baseline"}},t.createElement("span",{style:{lineHeight:"normal"}},Sh(o.general.currencySymbol,d),Th((Number(""!==p?.compareAtPrice?Number(p?.compareAtPrice):p?.price)/Number(a)*Number(l)).toFixed(2))),t.createElement("span",{style:{textDecoration:"line-through",color:"#999",fontSize:"14px",lineHeight:"normal"}},Sh(o.general.currencySymbol,d),Th(""!==p?.compareAtPrice?p?.compareAtPrice:p?.price))),e.productDetails.variants.edges.length>1&&e.productDetails.options.length>0?t.createElement(t.Fragment,null,e.productDetails.options.map(((n,r)=>t.createElement("div",{key:n.name,style:{marginTop:"10px",display:"flex",flexDirection:"row",gap:"8px",alignItems:"center"}},e.productDetails.options.length>1&&t.createElement("label",{style:{fontSize:"12px",fontWeight:"500",color:"#333"}},n.name,":"),n?.values?.length>1&&t.createElement("div",{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",flexWrap:"wrap"}},n.values.map((a=>{const i=s&&s?.options?.find((e=>e.name===n.name));return i&&"color"===i?.type?t.createElement("button",{key:a,onClick:()=>{const t=[...u];t[r]=a;const n=e.productDetails.options.length>0?t.join(" / "):t[r],o=e.productDetails.variants.edges.find((e=>e.node.title===n))?.node.id;o&&m(o)},style:{borderRadius:"50%",padding:"1px",backgroundColor:"white",border:u[r]===a?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid transparent"}},i?.values.find((e=>e.name===a))?.value?t.createElement("div",{style:{width:u[r]===a?"26px":"24px",height:u[r]===a?"26px":"24px",borderRadius:"50%",backgroundColor:i?.values.find((e=>e.name===a))?.value,cursor:"pointer"}},t.createElement("span",null)):t.createElement("span",{key:a,style:{padding:"4px 8px",border:u[r]===a?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u[r]===a?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"10px",fontWeight:"600"}},a)):i&&"image"===i?.type?t.createElement("button",{key:a,onClick:()=>{const t=[...u];t[r]=a;const n=e.productDetails.options.length>0?t.join(" / "):t[r],o=e.productDetails.variants.edges.find((e=>e.node.title===n))?.node.id;o&&m(o)},style:{border:u[r]===a?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"100%",backgroundColor:u[r]===a?"#F7F7F7":"transparent",cursor:"pointer",padding:"0px",width:u[r]===a?"26px":"24px",height:u[r]===a?"26px":"24px",overflow:"hidden"}},i?.values.find((e=>e.name===a))?.value?t.createElement("img",{src:$h(i?.values.find((e=>e.name===a))?.value||"/placeholder.svg"),alt:a,style:{width:u[r]===a?"26px":"24px",height:u[r]===a?"26px":"24px",objectFit:"cover",borderRadius:"100%",aspectRatio:"1/1"}}):t.createElement("span",{key:a,style:{padding:"4px 8px",border:u[r]===a?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u[r]===a?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"10px",fontWeight:"600"}},a)):t.createElement("button",{key:a,onClick:()=>{const t=[...u];t[r]=a;const n=e.productDetails.options.length>0?t.join(" / "):t[r],o=e.productDetails.variants.edges.find((e=>e.node.title===n))?.node.id;o&&m(o)},style:{padding:"4px 8px",border:u[r]===a?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:u[r]===a?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"10px",fontWeight:"600"}},a)}))))))):t.createElement(t.Fragment,null,e?.productDetails?.variants?.edges?.length>1&&t.createElement("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",lineHeight:"normal",marginTop:"10px"}},e?.productDetails?.variants?.edges.map((e=>t.createElement("button",{key:e?.node?.id,onClick:()=>m(e?.node?.id),disabled:e.node.inventoryQuantity<=0,style:{padding:"4px 8px",border:n===e?.node?.id?`1px solid ${o.general?.ctaBackgroundColor}`:"1px solid #E4E4E4",borderRadius:"16px",backgroundColor:n===e?.node?.id?"#F7F7F7":"transparent",color:"#707070",cursor:"pointer",fontSize:"12px",fontWeight:"500"}},e?.node?.title)))))))},Xm=({bundle:e,addToCartFunction:n})=>{const[r,o]=c(!1),[a,s]=c(window.innerWidth<786),[d,p]=c((()=>{const t={};return e.products.forEach(((e,n)=>{const r=e.productDetails.variants.edges.find((e=>e.node.inventoryQuantity>0))?.node;t[n]=r?r.id:e?.productDetails?.variants?.edges[0]?.node?.id})),t})),u=e.products?.filter((e=>e?.productDetails?.variants?.edges.some((e=>e?.node?.inventoryQuantity>0))))||[],m=Object.keys(d).length===u.length,f=(e,t)=>{p((n=>({...n,[e]:t})))},{originalPrice:g,dealPrice:h,offerValue:x}=i((()=>{const{price:t,compareAtPrice:n}=Object.entries(d).reduce(((t,[n,r])=>{const o=e.products[parseInt(n)],a=o.productDetails.variants.edges?.find((e=>e.node.id===r))?.node,i=parseFloat(a?.price??"0"),l=parseFloat(a?.compareAtPrice||i.toString());return t.price+=i,t.compareAtPrice+=l,t}),{price:0,compareAtPrice:0}),r=Math.max(t,n);let o=Math.min(t,n);e?.percentageOff?o=t*(1-e.percentageOff/100):e?.dealAmount?o=e.dealAmount:e?.amountOff&&(o=t-e.amountOff);const a=n-o;return{originalPrice:r.toFixed(2),dealPrice:o.toFixed(2),offerValue:a.toFixed(2)}}),[d,e.products,e.percentageOff,e.dealAmount,e.amountOff]);l((()=>{const e=()=>{s(window.innerWidth<786)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const y=e.customizations,b=y.comboBundle?.comboCardStyle||"auto",v="vertical"===b||"auto"===b&&!a,w=y.comboBundle?.embedContentVisibility,C="bundles"==e.appName?e.pageHeader?.title:e?.title,k="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement("div",{style:{lineHeight:"normal",maxWidth:"800px",marginBlock:y.comboBundle?.verticalMargin||"0px",display:"flex",flexDirection:"column",alignItems:"left"===y.comboBundle?.infoAlignment?"flex-start":"right"===y.comboBundle?.infoAlignment?"flex-end":"center"===y.comboBundle?.infoAlignment?"center":void 0,textAlign:y.comboBundle?.infoAlignment??"left",fontFamily:"system-ui, -apple-system, sans-serif"}},w&&y.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Title")&&t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"10px"}},t.createElement("h2",{style:{fontSize:y.comboBundle?.productTitleFontSize||"28px",color:y.comboBundle?.titleTextColor||"#000",fontWeight:"bold",lineHeight:"1.6",margin:0}},C)),w&&y?.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Price")&&t.createElement(t.Fragment,null,t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",color:y.comboBundle?.titleTextColor||"#000",fontSize:(parseInt(y.comboBundle?.productTitleFontSize?.replace("px",""))||28)-4+"px"}},t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"5px",flexWrap:"wrap"}},t.createElement("span",{style:{fontWeight:"bold",lineHeight:"1",minWidth:"fit-content"}},Sh(y.general.currencySymbol,e.storeCurrencyCode),Th(h)),t.createElement("div",{style:{color:y.comboBundle?.titleTextColor||"#666",textDecoration:"line-through",verticalAlign:"middle",display:"inline-block",minWidth:"fit-content"}},Sh(y.general.currencySymbol,e.storeCurrencyCode),Th(g)),t.createElement("span",{style:{backgroundColor:"#D3122A",color:"white",padding:"4px 8px",fontSize:"14px",borderRadius:"20px",fontWeight:"500",lineHeight:"1",minWidth:"fit-content"}},e?.percentageOff?`${e?.percentageOff}% Off`:e?.amountOff?`${Sh(y.general.currencySymbol,e.storeCurrencyCode)}${Th(e?.amountOff)} Off`:`Save ${Sh(y.general.currencySymbol,e.storeCurrencyCode)}${Th(x)}`))),t.createElement("div",{style:{display:"flex",alignItems:"center",gap:"8px",margin:"15px 0px"},className:"yt-comboBundle-checkoutSpecific-container"},t.createElement("div",{style:{display:"flex",width:"12px",height:"12px",justifyContent:"center",alignItems:"center",alignContent:"center",borderRadius:"50%",backgroundColor:y.general?.ctaBackgroundColor||"#1e1e1e",flexShrink:0},className:"yt-comboBundle-checkoutSpecific-dot"},t.createElement("span",null)),t.createElement("p",{style:{fontSize:y.comboBundle.productDescriptionFontSize||"16px",color:y.comboBundle?.descriptionTextColor||"#000",alignItems:"center",margin:0,lineHeight:"1.2"},className:"yt-comboBundle-checkoutSpecific-text"},"Tax included. ",t.createElement("u",null,"Shipping")," calculated at checkout."))),y.comboBundle.subProductsSectionVisibility&&t.createElement(t.Fragment,null,v?t.createElement("div",{style:{display:"flex",flexDirection:"row",gap:"20px",marginTop:"10px",flexWrap:"wrap"}},e.products.map(((n,r)=>{const o=n?.productDetails?.variants?.edges?.find((e=>e?.node?.id===d[r]))?.node;return o?t.createElement(Km,{key:`combo-product-${r}-${n.productId}`,product:n,styles:y,originalPrice:g,dealPrice:h,selectedVariantId:d[r],onVariantChange:e=>f(r,e),isVertical:v,variantOptions:e.variantOptions,storeCurrencyCode:e.storeCurrencyCode}):null}))):t.createElement("div",{style:{display:"flex",flexDirection:"column",gap:"10px",width:"100%"}},y.comboBundle.subProductsSectionVisibility&&e.products.map(((n,r)=>t.createElement(Km,{key:`combo-product-horizontal-${r}-${n.productId}`,product:n,styles:y,originalPrice:g,dealPrice:h,selectedVariantId:d[r],onVariantChange:e=>f(r,e),variantOptions:e.variantOptions}))))),t.createElement("div",{style:{borderTop:"1px solid #eee",display:"flex",flexDirection:"column",rowGap:"5px",marginTop:"20px",width:"100%"}},t.createElement("button",{style:{backgroundColor:m?y.general?.ctaBackgroundColor||"#121212":y.general.disabledButtonColor,color:y.general?.ctaTextColor||"#FFFFFF",fontSize:"16px",borderRadius:y.general.ctaBorderRadius??"20px",fontWeight:"bold",cursor:m?"pointer":"not-allowed",border:`1px solid ${m?y.general?.ctaBackgroundColor||"#121212":y.general.disabledButtonColor}`,boxShadow:y.general.ctaShadowType,padding:y.general?.ctaPadding,width:y.general?.ctaWidth,margin:"0"},disabled:!m,onMouseOver:e=>{y.general.customizeHoverState&&m&&(e.currentTarget.style.backgroundColor=y.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=y.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{y.general.customizeHoverState&&m&&(e.currentTarget.style.backgroundColor=y.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=y.general?.ctaTextColor||"#FFFFFF")},onClick:async()=>{try{if(o(!0),!n)return void o(!1);const t=Object.entries(d).map((([t,n])=>{const r=e.products[parseInt(t)],o=r.productDetails.variants.edges.find((e=>e.node.id===n))?.node;return o?{variantId:n,price:Number(o.price)}:null})).filter((e=>null!==e)),r=Object.values(d);await n(Number(g),r,Number(h),t)}catch(e){}o(!1)}},r?t.createElement(Uo,{color:"white",loading:r,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement(t.Fragment,null,m?y.comboBundle?.ctaTitle??"Add Bundle to cart":y.general.outOfStockLabel||"Out of Stock"," "))),w&&y.comboBundle?.selectedEmbedContentVisibilityOptions?.includes("Combo Description")&&t.createElement("div",{style:{margin:"20px 0px"}},t.createElement("h4",{style:{fontSize:"16px",color:y.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",margin:0,padding:"8px",backgroundColor:y.general.primaryColor+"20"}},"Description"),t.createElement("div",{style:{fontSize:y.comboBundle.productDescriptionFontSize||"16px",color:y.comboBundle?.descriptionTextColor||"#000",lineHeight:"1.2",padding:"8px",backgroundColor:y.general.primaryColor+"08"}},t.createElement("p",null,k))))},Jm=x.div`
|
|
3534
3534
|
max-width: 800px;
|
|
3535
3535
|
container-type: inline-size;
|
|
3536
3536
|
margin-top: ${e=>e.verticalMargin||"0px"};
|
|
@@ -4929,4 +4929,4 @@ import*as e from"react";import t,{forwardRef as n,useImperativeHandle as r,useRe
|
|
|
4929
4929
|
}
|
|
4930
4930
|
`,yh=x.span`
|
|
4931
4931
|
font-size: 12px;
|
|
4932
|
-
`,bh=({products:e,isOpen:n,onClose:r,cta:o,variantOptions:a,onVariantChange:i,handleAddToCart:s,primaryProductId:d,variantId:p})=>{const[u,m]=c((()=>{const t={};return e.forEach((({productId:e,productDetails:n})=>{let r=n.options.map((e=>e.values[0]??""));if(e===d&&p){const e=n.variants.edges.find((e=>e.node.id.includes(p)))?.node;e&&(r=e.title.split(" / "))}t[e]=r})),t}));l((()=>{if(!d||!p)return;const t=e.find((e=>e.productId===d));if(!t)return;const n=t.productDetails.variants.edges.find((e=>e.node.id.includes(p)))?.node;if(n){const e=n.title.split(" / ");m((t=>({...t,[d]:e}))),g((e=>({...e,[d]:{node:n}}))),i(d,n.id)}}),[p,d]);const[f,g]=c({}),h=(t,n,r)=>{const o={...u};o[t][r]=n,m(o);const a=e.find((e=>e.productId===t));if(!a?.productDetails)return;const l=a.productDetails.variants.edges.find((e=>e.node.title===o[t].join(" / ")))?.node;l&&(i(t,l.id),g((e=>({...e,[t]:{node:l}}))))};if(!n)return null;const x=t.createElement(oh,{className:"yt-fixedBundle-variant-modal_overlay",onClick:r},t.createElement(ah,{className:"yt-fixedBundle-variant-modal_container",onClick:e=>e.stopPropagation()},t.createElement(ih,{className:"yt-fixedBundle-variant-modal_header",style:{backgroundColor:o.backgroundColor,color:o.textColor}},"Select Options"),e?.map(((n,r)=>t.createElement(t.Fragment,null,t.createElement(ch,{className:"yt-fixedBundle-variant-modal_product-block"},t.createElement(sh,{className:"yt-fixedBundle-variant-modal_thumbnail",src:f[n.productId]?.node?.image.url||n.productDetails.featuredMedia?.preview?.image?.url,alt:n.productDetails.title}),t.createElement(dh,{className:"yt-fixedBundle-variant-modal_product-info"},t.createElement(ph,{className:"yt-fixedBundle-variant-modal_product-name"},n.productDetails.title,n.productDetails.variants.edges.length>1&&t.createElement(mh,{className:"yt-fixedBundle-variant-modal_selected-value"},u[n.productId].join(" / "))),n.productDetails.options.map(((e,r)=>{const o=a&&a?.options?.find((t=>t.name===e.name));return e.values.length<=1?t.createElement(t.Fragment,null):o&&"color"===o?.type?t.createElement(fh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(yh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," : "),e.values.map(((e,a)=>t.createElement(t.Fragment,null,o.values.find((t=>t.name===e))?.value?t.createElement(gh,{className:"yt-fixedBundle-variant-modal_color-swatch",key:a,color:o.values.find((t=>t.name===e))?.value||e,selected:u[n.productId][r]==e,onClick:()=>{h(n.productId,e,r)}},t.createElement("span",null)):t.createElement(hh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:u[n.productId][r]==e,onClick:()=>{h(n.productId,e,r)}},e))))):o&&"image"===o?.type?t.createElement(fh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(yh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," : "),e.values.map(((e,a)=>t.createElement(t.Fragment,null,o.values.find((t=>t.name===e))?.value?t.createElement(xh,{className:"yt-fixedBundle-variant-modal_image-swatch",key:a,selected:u[n.productId][r]==e,onClick:()=>{h(n.productId,e,r)},src:o.values.find((t=>t.name===e))?.value},t.createElement("span",null)):t.createElement(hh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:u[n.productId][r]==e,onClick:()=>{h(n.productId,e,r)}},e))))):t.createElement(fh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(yh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," : "),e.values.map(((e,o)=>t.createElement(hh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:o,selected:u[n.productId][r]==e,onClick:()=>{h(n.productId,e,r)}},e))))})))),r<e.length-1&&t.createElement(uh,{className:"yt-fixedBundle-variant-modal_divider"})))),t.createElement(lh,{className:"yt-fixedBundle-variant-modal_confirm-button",style:{backgroundColor:o.backgroundColor,color:o.textColor},onClick:s},"Add bundle to cart")));return v.createPortal(x,document.body)},vh=({options:e,selectedValue:n,onChange:r,type:a="text"})=>{const[i,s]=c(!1),d=o(null);l((()=>{const e=e=>{d.current&&!d.current.contains(e.target)&&s(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[]);const p=e=>"color"===a?t.createElement(qg,{className:"yt-fixedBundle-variant-dropdown-horizontal_color-swatch",$color:e.value},t.createElement("span",null)):"image"===a?t.createElement(Zg,{className:"yt-fixedBundle-variant-dropdown-horizontal_image-swatch",src:e.value||"/placeholder.svg",alt:e.name},t.createElement("span",null)):null;return t.createElement(Vg,{className:"yt-fixedBundle-variant-dropdown-horizontal_container",ref:d},t.createElement(Hg,{className:"yt-fixedBundle-variant-dropdown-horizontal_header",onClick:()=>s(!i)},t.createElement(Wg,{className:"yt-fixedBundle-variant-dropdown-horizontal_content"},n&&("color"===a||"image"===a)&&p(n),t.createElement("span",{className:"yt-fixedBundle-variant-dropdown-horizontal_selected-text"},n&&n.name)),t.createElement(Ug,{className:"yt-fixedBundle-variant-dropdown-horizontal_chevron-icon",$isOpen:i})),i&&t.createElement(Gg,{className:"yt-fixedBundle-variant-dropdown-horizontal_list"},e?.map((e=>t.createElement(Qg,{className:"yt-fixedBundle-variant-selector_dropdown-item "+(n?.name===e.name?"yt-fixedBundle-variant-selector_dropdown-item--selected":""),key:e.name,$isSelected:n?.name===e.name,onClick:()=>{r(e),s(!1)}},("color"===a||"image"===a)&&p(e),t.createElement(Yg,{className:"yt-fixedBundle-variant-dropdown-horizontal_item-text"},e.name))))))},wh=({product:e,variantOptions:n,selectedVariants:r,onVariantChange:o,variantId:a,primaryProductId:i,variantType:s="dropdown"})=>{const[d,p]=c(r||[]);l((()=>{if(a&&e.variants.edges.some((e=>e.node.id.includes(a)))){const t=e.variants.edges.find((e=>e.node.id.includes(a)))?.node;if(t){const e=t.title.split(" / ");p(e)}}}),[a,e]);const u=e=>{if(!n?.options)return"text";const t=n.options.find((t=>t.name===e));return t?.type||"text"},m=(e,t)=>{if(!n?.options)return e.values.map((e=>({name:e,value:e})));const r=n.options.find((t=>t.name===e.name));return e.values.map((e=>{const t=r?.values?.find((t=>t.name===e));return{name:e,value:t?.value||e}}))},f=(e,t)=>{const n=d[t];if(!n)return null;return m(e).find((e=>e.name===n))||null};return t.createElement(Kg,{className:"yt-fixedBundle-variant-selector-horizontal_container"},e.options.map(((n,r)=>t.createElement(Xg,{className:"yt-fixedBundle-variant-selector-horizontal_option-row",key:n.name,$isFirst:0===r},n?.values?.length>1&&t.createElement(vh,{options:m(n),selectedValue:f(n,r),onChange:t=>{console.log(t),((t,n)=>{const r=[...d];r[t]=n.name,p(r);const a=e.variants.edges.find((n=>n.node.title===(e.options?.length>0?r.join(" / "):r[t])))?.node.id;o(a||"")})(r,t)},type:u(n.name)})))))},Ch=({product:e,selectedVariantId:n,isChecked:r,canCustomize:o,styles:a,onVariantChange:i,onCheckChange:s,isMobile:d,isHorizontal:p,index:u,variantOptions:m,productsLength:f,handleOpenModal:g,storeCurrencyCode:h,primaryProductId:x,variantId:y})=>{const[b,v]=c(e.variants.edges.find((e=>e.node.id===n))?.node),[w]=c(e.options?.map((e=>e.values[0]))||[]),C=e.id===x;l((()=>{if(y&&e.id===x){const t=e.variants.edges.find((e=>e.node.id.includes(y)))?.node;t&&(v(t),i(t.id))}else{const t=e.variants.edges.find((e=>e.node.id===n))?.node;v(t)}}),[e,x,n,y]);const k="undefined"!=typeof window&&"devansh-test123.myshopify.com"===window.ytBundleApp?.storeDomain||"usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain,E=b?.image?.url||e.featuredMedia?.preview?.image?.url;return t.createElement(t.Fragment,null,p?t.createElement("div",{className:""+(e.id===x?"yt-fixedBundle-product-card--horizontal-primary":"yt-fixedBundle-product-card--horizontal-associated"),style:{display:"flex",alignItems:"center",gap:"10px",backgroundColor:a.fixedBundle?.cardBackgroundColor}},o&&t.createElement(nh,{className:"yt-fixedBundle-product-card_checkbox-wrapper--horizontal"},t.createElement(eh,{className:"yt-fixedBundle-product-card_checkbox-hidden",style:{display:"none"},type:"checkbox",id:`checkbox-${e.id}`,defaultChecked:r,onChange:e=>s(e.target.checked),disabled:C}),t.createElement(th,{className:"yt-fixedBundle-product-card_checkbox-label",htmlFor:`checkbox-${e.id}`,isChecked:r,borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.general?.ctaBackgroundColor},t.createElement(rt,null))),t.createElement(fg,{className:"yt-fixedBundle-product-card-horizontal_item",style:{borderRadius:a.fixedBundle?.borderRadius,border:`1px solid ${a.fixedBundle?.borderColor}80`,backgroundColor:a.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`8px 8px 8px -6px ${a.fixedBundle.borderColor}`,"no-spread":`4px 4px 0px -1px ${a.fixedBundle.borderColor}80`}[a.fixedBundle.shadowType]||"none"},canCustomize:o},"undefined"!=typeof window&&"devansh-test123.myshopify.com"!==window.ytBundleApp?.storeDomain&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&t.createElement(gg,{className:"yt-fixedBundle-product-card-horizontal_image",src:$h(E),alt:e.title,style:{borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,aspectRatio:a.general.imageAspectRatio||"1/1",borderTopRightRadius:"0",borderBottomRightRadius:"0"}}),t.createElement(hg,{className:"yt-fixedBundle-product-card-horizontal_details"},t.createElement(xg,{className:"yt-fixedBundle-product-card-horizontal_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(yg,{className:"yt-fixedBundle-product-card-horizontal_price-section"},t.createElement(bg,{className:"yt-fixedBundle-product-card-horizontal_price--new"},Sh(a.general.currencySymbol,h)," ",Th(b?.price)),a.fixedBundle.compareAtPriceVisibility&&b?.compareAtPrice&&parseFloat(b.compareAtPrice)>parseFloat(b?.price)&&t.createElement(vg,{className:"yt-fixedBundle-product-card-horizontal_price--old"},Sh(a.general.currencySymbol,h),Th(b?.compareAtPrice))),t.createElement(wh,{product:e,variantOptions:m,selectedVariants:w,onVariantChange:e=>{i(e)},variantId:y,primaryProductId:x})))):t.createElement(t.Fragment,null,t.createElement(zg,{className:""+(e.id===x?"yt-fixedBundle-product-card--vertical-primary":"yt-fixedBundle-product-card--vertical-associated"),productsLength:f,style:{borderRadius:a.fixedBundle?.borderRadius,border:`1px solid ${a.fixedBundle?.borderColor}50`,backgroundColor:a.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`0 4px 10px -6px ${a.fixedBundle.borderColor}50`,"no-spread":`4px 4px 0px -1px ${a.fixedBundle.borderColor}50`}[a.fixedBundle.shadowType]||"none",...o&&{position:"relative"},...k&&{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",minWidth:"max-content",paddingLeft:"2px"}},borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.fixedBundle?.cardBackgroundColor},o&&t.createElement(rh,{className:"yt-fixedBundle-product-card_checkbox-wrapper--vertical",isImage:k},t.createElement(eh,{className:"yt-fixedBundle-product-card_checkbox-hidden--vertical",style:{display:"none"},type:"checkbox",id:`checkbox-${e.id}`,defaultChecked:r,onChange:e=>s(e.target.checked),disabled:C}),t.createElement(th,{className:"yt-fixedBundle-product-card_checkbox-label--vertical",htmlFor:`checkbox-${e.id}`,isChecked:r,borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.general?.ctaBackgroundColor},t.createElement(rt,{size:10}))),"undefined"!=typeof window&&"devansh-test123.myshopify.com"!==window.ytBundleApp?.storeDomain&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&t.createElement(Dg,{className:"yt-fixedBundle-product-card_image-wrapper--vertical",style:{aspectRatio:a.general.imageAspectRatio,height:"fit-content"}},t.createElement(Ig,{className:"yt-fixedBundle-product-card_image--vertical",src:$h(E),style:{aspectRatio:a.general.imageAspectRatio},alt:e.title}),e.variants.edges.length>1&&t.createElement(_g,{className:"yt-fixedBundle-product-card_badge-container"},t.createElement(Og,{className:"yt-fixedBundle-product-card_circle-button"},t.createElement("span",null)),t.createElement(Pg,{className:"yt-fixedBundle-product-card_circle-button-two"},t.createElement("span",null)),t.createElement(Ag,{className:"yt-fixedBundle-product-card_count-badge"},e.variants.edges.length,"+"))),t.createElement(Ng,{className:"yt-fixedBundle-product-card-vertical_info"},t.createElement(Fg,{className:"yt-fixedBundle-product-card-vertical_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(Rg,{className:"yt-fixedBundle-product-card-vertical_price-line"},t.createElement(Mg,{className:"yt-fixedBundle-product-card-vertical_price--new"},Sh(a.general.currencySymbol,h),Th(b?.price)),a.fixedBundle.compareAtPriceVisibility&&b?.compareAtPrice&&parseFloat(b.compareAtPrice)>parseFloat(b?.price)&&t.createElement(vg,{className:"yt-fixedBundle-product-card-vertical_price--old"},Sh(a.general.currencySymbol,h),Th(b?.compareAtPrice))))),(f<=3||!d)&&u<f-1&&t.createElement(Lg,{className:"yt-fixedBundle-plus-wrapper"}," ",t.createElement(jg,{className:"yt-fixedBundle-plus-icon"},"+")," ")))},kh=({bundle:e,addToCartFunction:n})=>{const[r,o]=c(!1),[a,s]=c(window.innerWidth<786),[d,p]=c(null),u="undefined"!=typeof window?window.location.href:null,m=e?.products?.find((e=>e.productDetails?.handle===u?.split("/").pop()?.split("?")[0])),f=m?.productId,[g,h]=c(Object.fromEntries(e?.products?.map((e=>[e.productId,e.productDetails?.variants?.edges?.find((e=>e.node.inventoryQuantity>0))?.node?.id||e.productDetails?.variants?.edges?.[0]?.node?.id])))),[x,y]=c(!1),b="undefined"!=typeof window&&("usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain||"devansh-test123.myshopify.com"===window.ytBundleApp?.storeDomain),v=e?.showIndividualProductSelector||!0,[w,C]=c(new Set(e.products.filter((e=>!b||(e.productId===f||v))).map((e=>e.productId))));l((()=>{const e=()=>{const e=new URL(window.location.href).searchParams.get("variant");p(e)},t=e=>{const t=history[e];return function(...n){const r=t.apply(this,n);return window.dispatchEvent(new Event(e.toLowerCase())),r}};return history.pushState=t("pushState"),history.replaceState=t("replaceState"),window.addEventListener("pushstate",e),window.addEventListener("replacestate",e),e(),()=>{window.removeEventListener("pushstate",e),window.removeEventListener("replacestate",e)}}),[]),l((()=>{if(d&&f){const t=e?.products?.find((e=>e.productId===f));if(t){const e=t.productDetails?.variants?.edges?.some((e=>e.node.id.includes(d)));e&&h((e=>({...e,[f]:d})))}}}),[d,f,e?.products]),l((()=>{const e=()=>{s(window.innerWidth<600)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const k=(e,t)=>{h((n=>({...n,[e]:t})))},E=(e,t)=>{b&&v&&t===f||C((n=>{const r=new Set(n);return e?r.add(t):r.delete(t),r}))},T=e.disableInventoryTracking||e.products.every((e=>e.productDetails.variants.edges.some((e=>e.node.inventoryQuantity>0)))),S=i((()=>e.products.some((e=>w.has(e.productId)&&e.productDetails.variants.edges.length>1))),[e.products,w]),{originalPrice:$,dealPrice:B,offerValue:z}=i((()=>{const{price:t,compareAtPrice:n}=e.products.reduce(((e,t)=>{if(!w.has(t.productId))return e;const n=t.productDetails.variants.edges?.find((e=>e.node.id===g[t.productId]))?.node,r=parseFloat(n?.price??"0"),o=parseFloat(n?.compareAtPrice||r.toString());return e.price+=r,e.compareAtPrice+=o,e}),{price:0,compareAtPrice:0}),r=Math.max(t,n);let o=Math.min(t,n);w.size===e.products.length&&(e?.percentageOff?o=t*(1-e.percentageOff/100):e?.dealAmount?o=e.dealAmount:e?.amountOff&&(o=t-e.amountOff));const a=n-o;return{originalPrice:r.toFixed(2),dealPrice:o.toFixed(2),offerValue:a.toFixed(2)}}),[e.products,g,w,e.percentageOff,e.dealAmount,e.amountOff]),D=async e=>{e.preventDefault(),e.stopPropagation(),o(!0),y(!1);try{const e=Object.entries(g).filter((([e])=>w.has(e))).map((([e,t])=>t));n&&await n(Number($),e)}catch(e){console.error("Error adding to cart:",e)}o(!1)};if(!n)return t.createElement(t.Fragment,null);if(e?.customizations.general?.trackInventory&&!T)return t.createElement(t.Fragment,null);const I=e.customizations,_=I.fixedBundle?.cardLayoutStyle||"auto",O="horizontal"===_||"auto"===_&&a,P=()=>{y(!0)},A="bundles"==e.appName?e.pageHeader?.title:e?.title,N="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement(dg,{id:"yt-fixedBundle-container",className:"yt-fixedBundle-container",style:{maxWidth:"800px",backgroundColor:I.fixedBundle.sectionBackgroundColor,..."transparent"!==I.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},A&&t.createElement(pg,{id:"yt-fixedBundle-header",className:"yt-fixedBundle-header",style:{backgroundColor:I.fixedBundle?.titleBackgroundColor||"none",color:I.fixedBundle?.titleTextColor||"black",textAlign:I.fixedBundle.infoAlignment??"center",fontSize:I.fixedBundle?.titleFontSize,..."transparent"!==I.fixedBundle.titleBackgroundColor&&{paddingBlock:"7px"},..."left"===I.fixedBundle.infoAlignment&&"transparent"!==I.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===I.fixedBundle.infoAlignment&&"transparent"!==I.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===I.fixedBundle.infoAlignment&&"transparent"===I.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},A),N&&t.createElement(ug,{id:"yt-fixedBundle-subheader",className:"yt-fixedBundle-subheader",style:{color:"#121212",fontSize:I.fixedBundle?.subtitleFontSize,textAlign:I.fixedBundle.infoAlignment??"center",..."left"===I.fixedBundle.infoAlignment&&"transparent"!==I.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===I.fixedBundle.infoAlignment&&"transparent"!==I.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===I.fixedBundle.infoAlignment&&"transparent"===I.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},N),O?t.createElement(mg,{id:"yt-fixedBundle-horizontal-container",className:"yt-fixedBundle-horizontal-container"},e?.products?.map(((n,r)=>t.createElement(t.Fragment,{key:n.productId},t.createElement(Ch,{isChecked:w.has(n.productId),product:n.productDetails,selectedVariantId:g[n.productId],canCustomize:e?.canCustomizeFixedBundle||!1,styles:I,onVariantChange:e=>k(n.productId,e),onCheckChange:e=>{E(e,n.productId)},isMobile:a,index:r,isHorizontal:O,variantOptions:e.variantOptions,productsLength:e.products.length,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:f,variantId:d||void 0}))))):t.createElement($g,{id:"yt-fixedBundle-vertical-container",className:"yt-fixedBundle-vertical-container"},t.createElement(Bg,{id:"yt-fixedBundle-product-list",className:"yt-fixedBundle-product-list",style:{justifyContent:"left"===I.fixedBundle.infoAlignment?"flex-start":"right"===I.fixedBundle.infoAlignment?"flex-end":"center"}},e?.products?.map(((n,r)=>t.createElement(Ch,{isChecked:w.has(n.productId),product:n.productDetails,selectedVariantId:g[n.productId],canCustomize:e?.canCustomizeFixedBundle||!1,styles:I,onVariantChange:e=>k(n.productId,e),onCheckChange:e=>E(e,n.productId),isMobile:a,index:r,isHorizontal:O,productsLength:e.products.length,handleOpenModal:P,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:f,variantId:d||void 0}))),S&&t.createElement(bh,{products:e.products.filter((e=>w.has(e.productId))),isOpen:x,onClose:()=>y(!1),variantOptions:e.variantOptions,cta:{textColor:I.general.ctaTextColor,backgroundColor:I.general.ctaBackgroundColor},onVariantChange:k,handleAddToCart:D,primaryProductId:f,variantId:d||void 0}))),t.createElement(wg,{id:"yt-fixedBundle-summary",className:"yt-fixedBundle-summary",style:{alignItems:"left"===I.fixedBundle.infoAlignment?"flex-start":"right"===I.fixedBundle.infoAlignment?"flex-end":"center"}},Number($)>0&&Number(z)>0&&I.fixedBundle.compareAtPriceVisibility&&t.createElement(Cg,{className:"yt-fixedBundle-summary_original-price"},"Original Price:"," ",t.createElement(Eg,{className:"yt-fixedBundle-summary_price"},Sh(I.general.currencySymbol,e?.storeCurrencyCode),Th($))),0!==w.size&&t.createElement(kg,{className:"yt-fixedBundle-summary_total-price"},"Total Price:"," ",t.createElement(Eg,{className:"yt-fixedBundle-summary_price"},Sh(I.general.currencySymbol,e?.storeCurrencyCode),Th(B))," ",Number(z)>0&&t.createElement(Tg,{className:"yt-fixedBundle-summary_save-tag"},"Save:"," ",Sh(I.general.currencySymbol,e?.storeCurrencyCode),Th(z)))),t.createElement(Sg,{id:"yt-fixedBundle-add-to-cart",className:"yt-fixedBundle-add-to-cart",onClick:e=>{e.preventDefault(),e.stopPropagation(),O||!S?D(e):y(!0)},disabled:w.size<1||r,style:{backgroundColor:I.general?.ctaBackgroundColor||"#121212",color:I.general?.ctaTextColor||"#FFFFFF",border:`1px solid ${I.general?.ctaBackgroundColor||"#121212"}`,boxShadow:I.general.ctaShadowType,paddingTop:I.general?.ctaPadding,paddingBottom:I.general?.ctaPadding,borderRadius:I.general.ctaBorderRadius,width:I.general.ctaWidth||"100%",textAlign:"center"},onMouseOver:e=>{I.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=I.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=I.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{I.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=I.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=I.general?.ctaTextColor||"#FFFFFF")}},r?t.createElement(Uo,{color:"white",loading:r,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement(t.Fragment,null,I.fixedBundle?.ctaTitle??"Add Bundle to cart")))},Eh=window?.Shopify?.currency||{rate:1,active:"INR"},Th=e=>{if(!e)return;const t=navigator.language||"en-US",n=Number((Number(e)*Eh.rate).toFixed(2));return new Intl.NumberFormat(t).format(n)},Sh=(e,t)=>t==Eh.active?e:sn(Eh.active)||Eh.active,$h=e=>{if(!e)return e;try{const t=new URL(e),n=t.searchParams;return n.has("format")||n.set("format","webp"),n.has("quality")||n.set("quality","70"),n.has("width")||n.set("width","600"),t.toString()}catch{const t=e.includes("?")?"&":"?";return e+t+"format=webp&quality=70&width=400"}},Bh=(e,t,n,r,o)=>{const a=r.findIndex((t=>t.variantId===e));o(0===n?e=>e.filter(((e,t)=>t!==a)):-1===a?r=>[...r,{product:t,variantId:e,quantity:n}]:e=>e.map(((e,t)=>t===a?{...e,quantity:e.quantity+n}:e)))},zh=({bundle:e,currentProductId:n,addToCartFunction:r,addCustomBundleToCart:o,selectedItems:a,setSelectedItems:i,bundleAddToCartLoading:l,handleRemoveItem:c,selectedItemsQuantity:s,renderingOnPage:d,bundleSubtotal:p})=>"fixed"!==e.type&&e.type&&0!==e?.type?.length?"builder"===e.type?t.createElement(Zm,{bundleAddToCartLoading:l,bundle:e,selectedItems:a,setSelectedItems:i,handleAddToCart:o,handleRemoveItem:c,renderingOnPage:d,selectedItemsQuantity:s??0,bundleSubtotal:p??{price:0,compareAtPrice:0}}):"combo"===e.type?t.createElement(Xm,{bundle:e,addToCartFunction:r}):"mixnmatch"===e.type?t.createElement(sg,{bundle:e,addToCartFunction:r}):t.createElement(Df,{bundle:e,currentProductId:n,addToCartFunction:r}):t.createElement(kh,{addToCartFunction:r,bundle:e});L(".scene {\n width: 100%;\n height: 60vh;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.floating {\n animation: float 3s ease-in-out infinite;\n}\n\n@keyframes float {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-10px);\n }\n}\n.cube {\n position: relative;\n width: 50px;\n height: 50px;\n transform-style: preserve-3d;\n transform: rotateX(-45deg) rotateY(50deg) rotateZ(0deg);\n}\n\n.side,\n.lid,\n.flap {\n position: absolute;\n width: 100px;\n height: 100px;\n border: 4px solid #333366;\n background: transparent;\n box-sizing: border-box;\n}\n\n.side {\n background: #fff;\n backface-visibility: hidden;\n}\n\n.side.front {\n transform: translateZ(50px);\n}\n\n.side.back {\n transform: rotateY(180deg) translateZ(50px);\n}\n\n.side.left {\n transform: rotateY(-90deg) translateZ(50px);\n}\n\n.side.right {\n transform: rotateY(90deg) translateZ(50px);\n}\n\n.side.bottom {\n transform: rotateX(-90deg) translateZ(50px);\n}\n\n.lid {\n transform: rotateX(90deg) translateZ(50px);\n transform-style: preserve-3d;\n}\n\n.flap.north {\n top: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: top center;\n animation: openNorth 3s ease-in-out infinite;\n}\n\n.flap.south {\n bottom: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: bottom center;\n animation: openSouth 3s ease-in-out infinite;\n}\n\n.flap.east {\n top: 0;\n right: 0;\n width: 50%;\n height: 100%;\n transform-origin: right center;\n animation: openEast 3s ease-in-out infinite;\n}\n\n.flap.west {\n top: 0;\n left: 0;\n width: 50%;\n height: 100%;\n transform-origin: left center;\n animation: openWest 3s ease-in-out infinite;\n}\n\n@keyframes openNorth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(180deg);\n }\n}\n@keyframes openSouth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(-180deg);\n }\n}\n@keyframes openEast {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(180deg);\n }\n}\n@keyframes openWest {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(-180deg);\n }\n}");const Dh=()=>t.createElement("div",{className:"scene"},t.createElement("div",{className:"floating"},t.createElement("div",{className:"cube"},t.createElement("div",{className:"side front"},""),t.createElement("div",{className:"side back"},""),t.createElement("div",{className:"side left"},""),t.createElement("div",{className:"side right"},""),t.createElement("div",{className:"side bottom"},""),t.createElement("div",{className:"lid"},t.createElement("div",{className:"flap north"},""),t.createElement("div",{className:"flap south"},""),t.createElement("div",{className:"flap east"},""),t.createElement("div",{className:"flap west"},"")))));export{zh as Bundle,Dh as BundleLoader,nu as Cart,ra as CouponFrame,Ge as Nudge,Je as SpinnerWheel};
|
|
4932
|
+
`,bh=({products:e,isOpen:n,onClose:r,cta:o,variantOptions:a,onVariantChange:i,handleAddToCart:s,primaryProductId:d,variantId:p})=>{const[u,m]=c((()=>{const t={};return e.forEach((({productId:e,productDetails:n})=>{let r=n.options.map((e=>e.values[0]??""));if(e===d&&p){const e=n.variants.edges.find((e=>e.node.id.includes(p)))?.node;e&&(r=e.title.split(" / "))}t[e]=r})),t}));l((()=>{if(!d||!p)return;const t=e.find((e=>e.productId===d));if(!t)return;const n=t.productDetails.variants.edges.find((e=>e.node.id.includes(p)))?.node;if(n){const e=n.title.split(" / ");m((t=>({...t,[d]:e}))),g((e=>({...e,[d]:{node:n}}))),i(d,n.id)}}),[p,d]);const[f,g]=c({}),h=(t,n,r)=>{const o={...u};o[t][r]=n,m(o);const a=e.find((e=>e.productId===t));if(!a?.productDetails)return;const l=a.productDetails.variants.edges.find((e=>e.node.title===o[t].join(" / ")))?.node;l&&(i(t,l.id),g((e=>({...e,[t]:{node:l}}))))};if(!n)return null;const x=t.createElement(oh,{className:"yt-fixedBundle-variant-modal_overlay",onClick:r},t.createElement(ah,{className:"yt-fixedBundle-variant-modal_container",onClick:e=>e.stopPropagation()},t.createElement(ih,{className:"yt-fixedBundle-variant-modal_header",style:{backgroundColor:o.backgroundColor,color:o.textColor}},"Select Options"),e?.map(((n,r)=>t.createElement(t.Fragment,null,t.createElement(ch,{className:"yt-fixedBundle-variant-modal_product-block"},t.createElement(sh,{className:"yt-fixedBundle-variant-modal_thumbnail",src:f[n.productId]?.node?.image.url||n.productDetails.featuredMedia?.preview?.image?.url,alt:n.productDetails.title}),t.createElement(dh,{className:"yt-fixedBundle-variant-modal_product-info"},t.createElement(ph,{className:"yt-fixedBundle-variant-modal_product-name"},n.productDetails.title,n.productDetails.variants.edges.length>1&&t.createElement(mh,{className:"yt-fixedBundle-variant-modal_selected-value"},u[n.productId].join(" / "))),n.productDetails.options.map(((e,r)=>{const o=a&&a?.options?.find((t=>t.name===e.name));return e.values.length<=1?t.createElement(t.Fragment,null):o&&"color"===o?.type?t.createElement(fh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(yh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," : "),e.values.map(((e,a)=>t.createElement(t.Fragment,null,o.values.find((t=>t.name===e))?.value?t.createElement(gh,{className:"yt-fixedBundle-variant-modal_color-swatch",key:a,color:o.values.find((t=>t.name===e))?.value||e,selected:u[n.productId][r]==e,onClick:()=>{h(n.productId,e,r)}},t.createElement("span",null)):t.createElement(hh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:u[n.productId][r]==e,onClick:()=>{h(n.productId,e,r)}},e))))):o&&"image"===o?.type?t.createElement(fh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(yh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," : "),e.values.map(((e,a)=>t.createElement(t.Fragment,null,o.values.find((t=>t.name===e))?.value?t.createElement(xh,{className:"yt-fixedBundle-variant-modal_image-swatch",key:a,selected:u[n.productId][r]==e,onClick:()=>{h(n.productId,e,r)},src:o.values.find((t=>t.name===e))?.value},t.createElement("span",null)):t.createElement(hh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:a,selected:u[n.productId][r]==e,onClick:()=>{h(n.productId,e,r)}},e))))):t.createElement(fh,{className:"yt-fixedBundle-variant-modal_options-row"},t.createElement(yh,{className:"yt-fixedBundle-variant-modal_option-name"},e.name," : "),e.values.map(((e,o)=>t.createElement(hh,{className:"yt-fixedBundle-variant-modal_text-swatch",key:o,selected:u[n.productId][r]==e,onClick:()=>{h(n.productId,e,r)}},e))))})))),r<e.length-1&&t.createElement(uh,{className:"yt-fixedBundle-variant-modal_divider"})))),t.createElement(lh,{className:"yt-fixedBundle-variant-modal_confirm-button",style:{backgroundColor:o.backgroundColor,color:o.textColor},onClick:s},"Add bundle to cart")));return v.createPortal(x,document.body)},vh=({options:e,selectedValue:n,onChange:r,type:a="text"})=>{const[i,s]=c(!1),d=o(null);l((()=>{const e=e=>{d.current&&!d.current.contains(e.target)&&s(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)}),[]);const p=e=>"color"===a?t.createElement(qg,{className:"yt-fixedBundle-variant-dropdown-horizontal_color-swatch",$color:e.value},t.createElement("span",null)):"image"===a?t.createElement(Zg,{className:"yt-fixedBundle-variant-dropdown-horizontal_image-swatch",src:e.value||"/placeholder.svg",alt:e.name},t.createElement("span",null)):null;return t.createElement(Vg,{className:"yt-fixedBundle-variant-dropdown-horizontal_container",ref:d},t.createElement(Hg,{className:"yt-fixedBundle-variant-dropdown-horizontal_header",onClick:()=>s(!i)},t.createElement(Wg,{className:"yt-fixedBundle-variant-dropdown-horizontal_content"},n&&("color"===a||"image"===a)&&p(n),t.createElement("span",{className:"yt-fixedBundle-variant-dropdown-horizontal_selected-text"},n&&n.name)),t.createElement(Ug,{className:"yt-fixedBundle-variant-dropdown-horizontal_chevron-icon",$isOpen:i})),i&&t.createElement(Gg,{className:"yt-fixedBundle-variant-dropdown-horizontal_list"},e?.map((e=>t.createElement(Qg,{className:"yt-fixedBundle-variant-selector_dropdown-item "+(n?.name===e.name?"yt-fixedBundle-variant-selector_dropdown-item--selected":""),key:e.name,$isSelected:n?.name===e.name,onClick:()=>{r(e),s(!1)}},("color"===a||"image"===a)&&p(e),t.createElement(Yg,{className:"yt-fixedBundle-variant-dropdown-horizontal_item-text"},e.name))))))},wh=({product:e,variantOptions:n,selectedVariants:r,onVariantChange:o,variantId:a,primaryProductId:i,variantType:s="dropdown"})=>{const[d,p]=c(r||[]);l((()=>{if(a&&e.variants.edges.some((e=>e.node.id.includes(a)))){const t=e.variants.edges.find((e=>e.node.id.includes(a)))?.node;if(t){const e=t.title.split(" / ");p(e)}}}),[a,e]);const u=e=>{if(!n?.options)return"text";const t=n.options.find((t=>t.name===e));return t?.type||"text"},m=(e,t)=>{if(!n?.options)return e.values.map((e=>({name:e,value:e})));const r=n.options.find((t=>t.name===e.name));return e.values.map((e=>{const t=r?.values?.find((t=>t.name===e));return{name:e,value:t?.value||e}}))},f=(e,t)=>{const n=d[t];if(!n)return null;return m(e).find((e=>e.name===n))||null};return t.createElement(Kg,{className:"yt-fixedBundle-variant-selector-horizontal_container"},e.options.map(((n,r)=>t.createElement(Xg,{className:"yt-fixedBundle-variant-selector-horizontal_option-row",key:n.name,$isFirst:0===r},n?.values?.length>1&&t.createElement(vh,{options:m(n),selectedValue:f(n,r),onChange:t=>{console.log(t),((t,n)=>{const r=[...d];r[t]=n.name,p(r);const a=e.variants.edges.find((n=>n.node.title===(e.options?.length>0?r.join(" / "):r[t])))?.node.id;o(a||"")})(r,t)},type:u(n.name)})))))},Ch=({product:e,selectedVariantId:n,isChecked:r,canCustomize:o,styles:a,onVariantChange:i,onCheckChange:s,isMobile:d,isHorizontal:p,index:u,variantOptions:m,productsLength:f,handleOpenModal:g,storeCurrencyCode:h,primaryProductId:x,variantId:y})=>{const[b,v]=c(e.variants.edges.find((e=>e.node.id===n))?.node),[w]=c(e.options?.map((e=>e.values[0]))||[]),C=e.id===x;l((()=>{if(y&&e.id===x){const t=e.variants.edges.find((e=>e.node.id.includes(y)))?.node;t&&(v(t),i(t.id))}else{const t=e.variants.edges.find((e=>e.node.id===n))?.node;v(t)}}),[e,x,n,y]);const k="undefined"!=typeof window&&"devansh-test123.myshopify.com"===window.ytBundleApp?.storeDomain||"usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain,E=b?.image?.url||e.featuredMedia?.preview?.image?.url;return t.createElement(t.Fragment,null,p?t.createElement("div",{className:""+(e.id===x?"yt-fixedBundle-product-card--horizontal-primary":"yt-fixedBundle-product-card--horizontal-associated"),style:{display:"flex",alignItems:"center",gap:"10px",backgroundColor:a.fixedBundle?.cardBackgroundColor}},o&&t.createElement(nh,{className:"yt-fixedBundle-product-card_checkbox-wrapper--horizontal"},t.createElement(eh,{className:"yt-fixedBundle-product-card_checkbox-hidden",style:{display:"none"},type:"checkbox",id:`checkbox-${e.id}`,defaultChecked:r,onChange:e=>s(e.target.checked),disabled:C}),t.createElement(th,{className:"yt-fixedBundle-product-card_checkbox-label",htmlFor:`checkbox-${e.id}`,isChecked:r,borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.general?.ctaBackgroundColor},t.createElement(rt,null))),t.createElement(fg,{className:"yt-fixedBundle-product-card-horizontal_item",style:{borderRadius:a.fixedBundle?.borderRadius,border:`1px solid ${a.fixedBundle?.borderColor}80`,backgroundColor:a.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`8px 8px 8px -6px ${a.fixedBundle.borderColor}`,"no-spread":`4px 4px 0px -1px ${a.fixedBundle.borderColor}80`}[a.fixedBundle.shadowType]||"none"},canCustomize:o},"undefined"!=typeof window&&"devansh-test123.myshopify.com"!==window.ytBundleApp?.storeDomain&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&t.createElement(gg,{className:"yt-fixedBundle-product-card-horizontal_image",src:$h(E),alt:e.title,style:{borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,aspectRatio:a.general.imageAspectRatio||"1/1",borderTopRightRadius:"0",borderBottomRightRadius:"0"}}),t.createElement(hg,{className:"yt-fixedBundle-product-card-horizontal_details"},t.createElement(xg,{className:"yt-fixedBundle-product-card-horizontal_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(yg,{className:"yt-fixedBundle-product-card-horizontal_price-section"},t.createElement(bg,{className:"yt-fixedBundle-product-card-horizontal_price--new"},Sh(a.general.currencySymbol,h)," ",Th(b?.price)),a.fixedBundle.compareAtPriceVisibility&&b?.compareAtPrice&&parseFloat(b.compareAtPrice)>parseFloat(b?.price)&&t.createElement(vg,{className:"yt-fixedBundle-product-card-horizontal_price--old"},Sh(a.general.currencySymbol,h),Th(b?.compareAtPrice))),t.createElement(wh,{product:e,variantOptions:m,selectedVariants:w,onVariantChange:e=>{i(e)},variantId:y,primaryProductId:x})))):t.createElement(t.Fragment,null,t.createElement(zg,{className:""+(e.id===x?"yt-fixedBundle-product-card--vertical-primary":"yt-fixedBundle-product-card--vertical-associated"),productsLength:f,style:{borderRadius:a.fixedBundle?.borderRadius,border:`1px solid ${a.fixedBundle?.borderColor}50`,backgroundColor:a.fixedBundle?.cardBackgroundColor,boxShadow:{none:"none",spread:`0 4px 10px -6px ${a.fixedBundle.borderColor}50`,"no-spread":`4px 4px 0px -1px ${a.fixedBundle.borderColor}50`}[a.fixedBundle.shadowType]||"none",...o&&{position:"relative"},...k&&{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",minWidth:"max-content",paddingLeft:"2px"}},borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.fixedBundle?.cardBackgroundColor},o&&t.createElement(rh,{className:"yt-fixedBundle-product-card_checkbox-wrapper--vertical",isImage:k},t.createElement(eh,{className:"yt-fixedBundle-product-card_checkbox-hidden--vertical",style:{display:"none"},type:"checkbox",id:`checkbox-${e.id}`,defaultChecked:r,onChange:e=>s(e.target.checked),disabled:C}),t.createElement(th,{className:"yt-fixedBundle-product-card_checkbox-label--vertical",htmlFor:`checkbox-${e.id}`,isChecked:r,borderRadius:a.fixedBundle?.borderRadius,borderColor:a.fixedBundle?.borderColor,backgroundColor:a.general?.ctaBackgroundColor},t.createElement(rt,{size:10}))),"undefined"!=typeof window&&"devansh-test123.myshopify.com"!==window.ytBundleApp?.storeDomain&&"usee-shop-app.myshopify.com"!==window.ytBundleApp?.storeDomain&&t.createElement(Dg,{className:"yt-fixedBundle-product-card_image-wrapper--vertical",style:{aspectRatio:a.general.imageAspectRatio,height:"fit-content"}},t.createElement(Ig,{className:"yt-fixedBundle-product-card_image--vertical",src:$h(E),style:{aspectRatio:a.general.imageAspectRatio},alt:e.title}),e.variants.edges.length>1&&t.createElement(_g,{className:"yt-fixedBundle-product-card_badge-container"},t.createElement(Og,{className:"yt-fixedBundle-product-card_circle-button"},t.createElement("span",null)),t.createElement(Pg,{className:"yt-fixedBundle-product-card_circle-button-two"},t.createElement("span",null)),t.createElement(Ag,{className:"yt-fixedBundle-product-card_count-badge"},e.variants.edges.length,"+"))),t.createElement(Ng,{className:"yt-fixedBundle-product-card-vertical_info"},t.createElement(Fg,{className:"yt-fixedBundle-product-card-vertical_title"},e.title),a.fixedBundle.productsPriceVisibility&&t.createElement(Rg,{className:"yt-fixedBundle-product-card-vertical_price-line"},t.createElement(Mg,{className:"yt-fixedBundle-product-card-vertical_price--new"},Sh(a.general.currencySymbol,h),Th(b?.price)),a.fixedBundle.compareAtPriceVisibility&&b?.compareAtPrice&&parseFloat(b.compareAtPrice)>parseFloat(b?.price)&&t.createElement(vg,{className:"yt-fixedBundle-product-card-vertical_price--old"},Sh(a.general.currencySymbol,h),Th(b?.compareAtPrice))))),(f<=3||!d)&&u<f-1&&t.createElement(Lg,{className:"yt-fixedBundle-plus-wrapper"}," ",t.createElement(jg,{className:"yt-fixedBundle-plus-icon"},"+")," ")))},kh=({bundle:e,addToCartFunction:n})=>{const[r,o]=c(!1),[a,s]=c(window.innerWidth<786),[d,p]=c(null),u="undefined"!=typeof window?window.location.href:null,m=e?.products?.find((e=>e.productDetails?.handle===u?.split("/").pop()?.split("?")[0])),f=m?.productId,[g,h]=c(Object.fromEntries(e?.products?.map((e=>[e.productId,e.productDetails?.variants?.edges?.find((e=>e.node.inventoryQuantity>0))?.node?.id||e.productDetails?.variants?.edges?.[0]?.node?.id])))),[x,y]=c(!1),b="undefined"!=typeof window&&("usee-shop-app.myshopify.com"===window.ytBundleApp?.storeDomain||"devansh-test123.myshopify.com"===window.ytBundleApp?.storeDomain),v=e?.showIndividualProductSelector||!0,[w,C]=c(new Set(e.products.filter((e=>!b||(e.productId===f||v))).map((e=>e.productId))));l((()=>{const e=()=>{const e=new URL(window.location.href).searchParams.get("variant");p(e)},t=e=>{const t=history[e];return function(...n){const r=t.apply(this,n);return window.dispatchEvent(new Event(e.toLowerCase())),r}};return history.pushState=t("pushState"),history.replaceState=t("replaceState"),window.addEventListener("pushstate",e),window.addEventListener("replacestate",e),e(),()=>{window.removeEventListener("pushstate",e),window.removeEventListener("replacestate",e)}}),[]),l((()=>{if(d&&f){const t=e?.products?.find((e=>e.productId===f));if(t){const e=t.productDetails?.variants?.edges?.some((e=>e.node.id.includes(d)));e&&h((e=>({...e,[f]:d})))}}}),[d,f,e?.products]),l((()=>{const e=()=>{s(window.innerWidth<600)};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]);const k=(e,t)=>{h((n=>({...n,[e]:t})))},E=(e,t)=>{b&&v&&t===f||C((n=>{const r=new Set(n);return e?r.add(t):r.delete(t),r}))},T=e.disableInventoryTracking||e.products.every((e=>e.productDetails.variants.edges.some((e=>e.node.inventoryQuantity>0)))),S=i((()=>e.products.some((e=>w.has(e.productId)&&e.productDetails.variants.edges.length>1))),[e.products,w]),{originalPrice:$,dealPrice:B,offerValue:z}=i((()=>{const{price:t,compareAtPrice:n}=e.products.reduce(((e,t)=>{if(!w.has(t.productId))return e;const n=t.productDetails.variants.edges?.find((e=>e.node.id===g[t.productId]))?.node,r=parseFloat(n?.price??"0"),o=parseFloat(n?.compareAtPrice||r.toString());return e.price+=r,e.compareAtPrice+=o,e}),{price:0,compareAtPrice:0}),r=Math.max(t,n);let o=Math.min(t,n);w.size===e.products.length&&(e?.percentageOff?o=t*(1-e.percentageOff/100):e?.dealAmount?o=e.dealAmount:e?.amountOff&&(o=t-e.amountOff));const a=n-o;return{originalPrice:r.toFixed(2),dealPrice:o.toFixed(2),offerValue:a.toFixed(2)}}),[e.products,g,w,e.percentageOff,e.dealAmount,e.amountOff]),D=async e=>{e.preventDefault(),e.stopPropagation(),o(!0),y(!1);try{const e=Object.entries(g).filter((([e])=>w.has(e))).map((([e,t])=>t));n&&await n(Number($),e)}catch(e){console.error("Error adding to cart:",e)}o(!1)};if(!n)return t.createElement(t.Fragment,null);if(e?.customizations.general?.trackInventory&&!T)return t.createElement(t.Fragment,null);const I=e.customizations,_=I.fixedBundle?.cardLayoutStyle||"auto",O="horizontal"===_||"auto"===_&&a,P=()=>{y(!0)},A="bundles"==e.appName?e.pageHeader?.title:e?.title,N="bundles"==e.appName?e.pageHeader?.description:e?.subtitle;return t.createElement(dg,{id:"yt-fixedBundle-container",className:"yt-fixedBundle-container",style:{maxWidth:"800px",backgroundColor:I.fixedBundle.sectionBackgroundColor,..."transparent"!==I.fixedBundle.sectionBackgroundColor&&{padding:"20px"}}},A&&t.createElement(pg,{id:"yt-fixedBundle-header",className:"yt-fixedBundle-header",style:{backgroundColor:I.fixedBundle?.titleBackgroundColor||"none",color:I.fixedBundle?.titleTextColor||"black",textAlign:I.fixedBundle.infoAlignment??"center",fontSize:I.fixedBundle?.titleFontSize,..."transparent"!==I.fixedBundle.titleBackgroundColor&&{paddingBlock:"7px"},..."left"===I.fixedBundle.infoAlignment&&"transparent"!==I.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===I.fixedBundle.infoAlignment&&"transparent"!==I.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===I.fixedBundle.infoAlignment&&"transparent"===I.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},A),N&&t.createElement(ug,{id:"yt-fixedBundle-subheader",className:"yt-fixedBundle-subheader",style:{color:"#121212",fontSize:I.fixedBundle?.subtitleFontSize,textAlign:I.fixedBundle.infoAlignment??"center",..."left"===I.fixedBundle.infoAlignment&&"transparent"!==I.fixedBundle.titleBackgroundColor&&{paddingLeft:"7px"},..."right"===I.fixedBundle.infoAlignment&&"transparent"!==I.fixedBundle.titleBackgroundColor&&{paddingRight:"7px"},..."left"===I.fixedBundle.infoAlignment&&"transparent"===I.fixedBundle.titleBackgroundColor&&{paddingLeft:"0px"}}},N),O?t.createElement(mg,{id:"yt-fixedBundle-horizontal-container",className:"yt-fixedBundle-horizontal-container"},e?.products?.map(((n,r)=>t.createElement(t.Fragment,{key:n.productId},t.createElement(Ch,{isChecked:w.has(n.productId),product:n.productDetails,selectedVariantId:g[n.productId],canCustomize:e?.canCustomizeFixedBundle||!1,styles:I,onVariantChange:e=>k(n.productId,e),onCheckChange:e=>{E(e,n.productId)},isMobile:a,index:r,isHorizontal:O,variantOptions:e.variantOptions,productsLength:e.products.length,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:f,variantId:d||void 0}))))):t.createElement($g,{id:"yt-fixedBundle-vertical-container",className:"yt-fixedBundle-vertical-container"},t.createElement(Bg,{id:"yt-fixedBundle-product-list",className:"yt-fixedBundle-product-list",style:{justifyContent:"left"===I.fixedBundle.infoAlignment?"flex-start":"right"===I.fixedBundle.infoAlignment?"flex-end":"center"}},e?.products?.map(((n,r)=>t.createElement(Ch,{isChecked:w.has(n.productId),product:n.productDetails,selectedVariantId:g[n.productId],canCustomize:e?.canCustomizeFixedBundle||!1,styles:I,onVariantChange:e=>k(n.productId,e),onCheckChange:e=>E(e,n.productId),isMobile:a,index:r,isHorizontal:O,productsLength:e.products.length,handleOpenModal:P,storeCurrencyCode:e.storeCurrencyCode,primaryProductId:f,variantId:d||void 0}))),S&&t.createElement(bh,{products:e.products.filter((e=>w.has(e.productId))),isOpen:x,onClose:()=>y(!1),variantOptions:e.variantOptions,cta:{textColor:I.general.ctaTextColor,backgroundColor:I.general.ctaBackgroundColor},onVariantChange:k,handleAddToCart:D,primaryProductId:f,variantId:d||void 0}))),t.createElement(wg,{id:"yt-fixedBundle-summary",className:"yt-fixedBundle-summary",style:{alignItems:"left"===I.fixedBundle.infoAlignment?"flex-start":"right"===I.fixedBundle.infoAlignment?"flex-end":"center"}},Number($)>0&&Number(z)>0&&I.fixedBundle.compareAtPriceVisibility&&t.createElement(Cg,{className:"yt-fixedBundle-summary_original-price"},"Original Price:"," ",t.createElement(Eg,{className:"yt-fixedBundle-summary_price"},Sh(I.general.currencySymbol,e?.storeCurrencyCode),Th($))),0!==w.size&&t.createElement(kg,{className:"yt-fixedBundle-summary_total-price"},"Total Price:"," ",t.createElement(Eg,{className:"yt-fixedBundle-summary_price"},Sh(I.general.currencySymbol,e?.storeCurrencyCode),Th(B))," ",Number(z)>0&&t.createElement(Tg,{className:"yt-fixedBundle-summary_save-tag"},"Save:"," ",Sh(I.general.currencySymbol,e?.storeCurrencyCode),Th(z)))),t.createElement(Sg,{id:"yt-fixedBundle-add-to-cart",className:"yt-fixedBundle-add-to-cart",onClick:e=>{e.preventDefault(),e.stopPropagation(),O||!S?D(e):y(!0)},disabled:w.size<1||r,style:{backgroundColor:I.general?.ctaBackgroundColor||"#121212",color:I.general?.ctaTextColor||"#FFFFFF",border:`1px solid ${I.general?.ctaBackgroundColor||"#121212"}`,boxShadow:I.general.ctaShadowType,paddingTop:I.general?.ctaPadding,paddingBottom:I.general?.ctaPadding,borderRadius:I.general.ctaBorderRadius,width:I.general.ctaWidth||"100%",textAlign:"center"},onMouseOver:e=>{I.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=I.general?.ctaHoverBackgroundColor||"#F1F1F1",e.currentTarget.style.color=I.general?.ctaHoverTextColor||"#121212")},onMouseOut:e=>{I.general.customizeHoverState&&(e.currentTarget.style.backgroundColor=I.general?.ctaBackgroundColor||"#121212",e.currentTarget.style.color=I.general?.ctaTextColor||"#FFFFFF")}},r?t.createElement(Uo,{color:"white",loading:r,size:15,"aria-label":"Loading Spinner","data-testid":"loader"}):t.createElement(t.Fragment,null,I.fixedBundle?.ctaTitle??"Add Bundle to cart")))},Eh=window?.Shopify?.currency||{rate:1,active:"INR"},Th=e=>{if(!e)return;const t=navigator.language||"en-US",n=Number((Number(e)*Eh.rate).toFixed(2));return new Intl.NumberFormat(t).format(n)},Sh=(e,t)=>t==Eh.active?e:sn(Eh.active)||Eh.active,$h=e=>{if(!e)return e;try{const t=new URL(e),n=t.searchParams;return n.has("format")||n.set("format","webp"),n.has("quality")||n.set("quality","70"),n.has("width")||n.set("width","600"),t.toString()}catch{const t=e.includes("?")?"&":"?";return e+t+"format=webp&quality=70&width=600"}},Bh=(e,t,n,r,o)=>{const a=r.findIndex((t=>t.variantId===e));o(0===n?e=>e.filter(((e,t)=>t!==a)):-1===a?r=>[...r,{product:t,variantId:e,quantity:n}]:e=>e.map(((e,t)=>t===a?{...e,quantity:e.quantity+n}:e)))},zh=({bundle:e,currentProductId:n,addToCartFunction:r,addCustomBundleToCart:o,selectedItems:a,setSelectedItems:i,bundleAddToCartLoading:l,handleRemoveItem:c,selectedItemsQuantity:s,renderingOnPage:d,bundleSubtotal:p})=>"fixed"!==e.type&&e.type&&0!==e?.type?.length?"builder"===e.type?t.createElement(Zm,{bundleAddToCartLoading:l,bundle:e,selectedItems:a,setSelectedItems:i,handleAddToCart:o,handleRemoveItem:c,renderingOnPage:d,selectedItemsQuantity:s??0,bundleSubtotal:p??{price:0,compareAtPrice:0}}):"combo"===e.type?t.createElement(Xm,{bundle:e,addToCartFunction:r}):"mixnmatch"===e.type?t.createElement(sg,{bundle:e,addToCartFunction:r}):t.createElement(Df,{bundle:e,currentProductId:n,addToCartFunction:r}):t.createElement(kh,{addToCartFunction:r,bundle:e});L(".scene {\n width: 100%;\n height: 60vh;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.floating {\n animation: float 3s ease-in-out infinite;\n}\n\n@keyframes float {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-10px);\n }\n}\n.cube {\n position: relative;\n width: 50px;\n height: 50px;\n transform-style: preserve-3d;\n transform: rotateX(-45deg) rotateY(50deg) rotateZ(0deg);\n}\n\n.side,\n.lid,\n.flap {\n position: absolute;\n width: 100px;\n height: 100px;\n border: 4px solid #333366;\n background: transparent;\n box-sizing: border-box;\n}\n\n.side {\n background: #fff;\n backface-visibility: hidden;\n}\n\n.side.front {\n transform: translateZ(50px);\n}\n\n.side.back {\n transform: rotateY(180deg) translateZ(50px);\n}\n\n.side.left {\n transform: rotateY(-90deg) translateZ(50px);\n}\n\n.side.right {\n transform: rotateY(90deg) translateZ(50px);\n}\n\n.side.bottom {\n transform: rotateX(-90deg) translateZ(50px);\n}\n\n.lid {\n transform: rotateX(90deg) translateZ(50px);\n transform-style: preserve-3d;\n}\n\n.flap.north {\n top: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: top center;\n animation: openNorth 3s ease-in-out infinite;\n}\n\n.flap.south {\n bottom: 0;\n left: 0;\n width: 100%;\n height: 50%;\n transform-origin: bottom center;\n animation: openSouth 3s ease-in-out infinite;\n}\n\n.flap.east {\n top: 0;\n right: 0;\n width: 50%;\n height: 100%;\n transform-origin: right center;\n animation: openEast 3s ease-in-out infinite;\n}\n\n.flap.west {\n top: 0;\n left: 0;\n width: 50%;\n height: 100%;\n transform-origin: left center;\n animation: openWest 3s ease-in-out infinite;\n}\n\n@keyframes openNorth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(180deg);\n }\n}\n@keyframes openSouth {\n 0%, 100% {\n transform: rotateX(0deg);\n }\n 50% {\n transform: rotateX(-180deg);\n }\n}\n@keyframes openEast {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(180deg);\n }\n}\n@keyframes openWest {\n 0%, 100% {\n transform: rotateY(0deg);\n }\n 50% {\n transform: rotateY(-180deg);\n }\n}");const Dh=()=>t.createElement("div",{className:"scene"},t.createElement("div",{className:"floating"},t.createElement("div",{className:"cube"},t.createElement("div",{className:"side front"},""),t.createElement("div",{className:"side back"},""),t.createElement("div",{className:"side left"},""),t.createElement("div",{className:"side right"},""),t.createElement("div",{className:"side bottom"},""),t.createElement("div",{className:"lid"},t.createElement("div",{className:"flap north"},""),t.createElement("div",{className:"flap south"},""),t.createElement("div",{className:"flap east"},""),t.createElement("div",{className:"flap west"},"")))));export{zh as Bundle,Dh as BundleLoader,nu as Cart,ra as CouponFrame,Ge as Nudge,Je as SpinnerWheel};
|