!function(){const e={keys:["rating_count","rating"],namespace:"reviews"},t=async function(e,t=[],n={}){try{let o=`query {\n ${e.map((e,n)=>`_${n}: product(id: "gid://shopify/Product/${e}") {\n handle\n featuredImage {\n url\n }\n ${t?.length?`metafields(identifiers: [${t.map(e=>`{key: "${e.key}", namespace: "${e.namespace}"}`).join(",")}]){\n value\n key\n type\n namespace\n }`:""}\n }`).join("\n")}\n }`,r=window.location.origin+(window.Shopify?.routes?.root||"/")+`api/${n.API_VERSION}/graphql.json`,a=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":window.lbupsellToken},body:JSON.stringify({query:o})}),i=await a.json();return i?.data}catch(e){return}};function n(e=[]){e.forEach(e=>{try{e()}catch(e){}})}function o(e=[],t=void 0){if(e?.length||(e=document.querySelectorAll("lb-upsell-widget")),e.length)for(const n of e){const e=n.getAttribute("widget");if(!n?.lbPayload?.widget?.configs?.matchVariant)continue;n.setAttribute("lb-match-variant","true");const o=["widget#ccpa","widget#ccpf","widget#icuc"].includes(e);let r=t;if(!r){const e=n.lbPayload.widget.triggers?.[0],t=o?e?.variant_id:location.href.split("variant=")[1]?.split("&")[0];r=o?{id:t,title:e?.variant_title,options:e?.variant_options}:t?e?.variants?.find(e=>`${e.id}`==`${t}`):e?.variants?.[0]}r?.title&&"Default Title"!==r.title&&n.querySelectorAll("lb-variant-picker").forEach(e=>{const t=e.querySelector(".lb-variant-picker"),n=e?.lbPayload?.product?.variants||[];let o=n.find(e=>(r.options||[]).every(t=>(e.options||[]).some(e=>e.toLowerCase()===t.toLowerCase())));if(!o){let e=null,t=0;const a=(r.options||[]).map(e=>e.toLowerCase());for(const o of n){let n=0;for(const e of o.options||[]){const t=e.toLowerCase();for(const e of a)if(t===e){n++;break}}n>t&&(t=n,e=o)}e&&t>0&&(o=e)}if(o){const e=Array.from(t.options).find(e=>e.value==o.id);e&&(t.value=e.value,t.dispatchEvent(new Event("change")))}})}}function r(e){let t=document.querySelectorAll('form[action="/cart/add"]');t.length&&t.forEach(t=>{t.querySelector('input[name="properties[_lb-product]"]')||t.insertAdjacentHTML("beforeend",``)})}let a={};window.lbSelleasyUtils={drawerRefresh:async function(e=!1){let t=[window.SLIDECART_UPDATE,window.SLIDECART_OPEN,window.theme?.ajaxCart?.update,window.theme?.Cart?.updateCart,window.theme?.Cart?.updateCart?.bind(window.theme?.Cart),window.theme?.Cart?.showPopup,window.updateMiniCartContents,window.loadEgCartDrawer,window.cart?.getCart,window.cart?.getCart?.bind(window.cart),window.cart?.openCartDropdown,window.ajaxCart?.load,window.icartCartActivityEvent,window.HsCartDrawer?.updateSlideCart,window.HS_SLIDE_CART_OPEN,window.CartJS?.getCart,window.Shopify?.theme?.jsAjaxCart?.updateView,window.theme?.MiniCart?.update,window.STICKY_CART_UPDATE,window.Alpine?.store?.("xMiniCart")?.reLoad,window.Alpine?.store?.("xMiniCart")?.openCart,window.Alpine?.store?.("modals")?.open?.("cart"),window.opusRefreshCart,window.opusOpen,window.EliteCart?.openDrawerWithDataRefresh,window.openCartDrawer,window.theme?.cart?.updateTotals,window.theme?.cart?.updateAllHtml,window.getCart,window.monster_refresh,window.openCart,window.prepareDataForDisplayWidgetByRule,window.refreshCart,window.refreshCartDrawer,window.MinimogTheme?.Cart?.refreshCart,window.MinimogTheme?.Cart?.renderNewCart,window.MinimogTheme?.Cart?.openCartDrawer,window.AMP_API?.OPEN_CART,window.fetchCart,window.liquidAjaxCart?.update,window.theme?.cart?.fetchTotals,window.theme?.cart?.updateAllHtml,window.triggerSideCart,window._pf_ajaxCartUpdate,window._SwymAJAXCart,window.theme?.miniCart?.updateElements,window.theme?.miniCart?.generateCart,window.PXUTheme?.jsAjaxCart?.showDrawer,window.PXUTheme?.jsAjaxCart?.updateView,()=>{document.querySelector("m-cart-drawer")?.onCartDrawerUpdate?.(),document.querySelector("m-cart-drawer")?.open?.(),void 0!==window.emit&&window.emit?.(["quick-cart:updated","quick-view:close","quick-cart:open"]),document.querySelector("cart-form")?.refresh?.(),document.querySelector(".js-cart-drawer")?.open?.(),window.eventBus?.emit("render:cart:drawer"),window.eventBus?.emit("open:cart:drawer"),document.querySelector("product-form")?.dispatchEvent(new CustomEvent("product:added",{bubbles:!0,detail:{}})),document.querySelector("product-form")?.toggleCartDrawer?.(),document.querySelector("coretex-dialog")?.open?.(),window.updateMiniCart?.(!0),document.querySelector("cart-drawer-component")?.open?.(),document.querySelector("mini-cart")?.updateSectionContents?.(),document.querySelector("mini-cart")?.open?.(),document.querySelector("cart-drawer")?.refetchContents?.(),document.querySelector("cart-drawer")?.update?.(),document.querySelector("cart-drawer")?.open?.(),$?.("body")?.trigger?.("added.ajaxProduct"),window.theme?.updateCartSummaries?.(!0,!1,!1),window.themeCore?.CartApi?.makeRequest?.(window.themeCore?.CartApi?.actions?.GET_CART)}];["cart:build","cart:update","cart:open","cart:open","dispatch:cart-drawer:refresh","dispatch:cart-drawer:open","fluco:modal:cartDrawer:open","obsidian:upsell:refresh","obsidian:upsell:open","update_cart","updateCart","product:added-to-cart","quickshop-add","theme:update:cart","apps:product-added-to-cart","baseline:modalcart:afteradditem","product:added","on:cart:change","theme:cart:refresh","openCartDrawer","octane.quiz.addToCart"].forEach(e=>{try{let t={bubbles:!0,detail:{data:{},open:!0}};document.documentElement.dispatchEvent(new CustomEvent(e,t)),document.dispatchEvent(new CustomEvent(e,t)),window.dispatchEvent(new CustomEvent(e,t)),document.body.dispatchEvent(new CustomEvent(e,t))}catch(e){}}),n(t);let o=[["cart-drawer","cart-notification-product","cart-notification-button"],["cart-counter","cart-icon-bubble","mini-cart"],["ajax-cart","ajax-cart-icon"]],r=await fetch((window.Shopify?.routes?.root||"/")+"cart.js").then(e=>e.json()).catch(e=>{}),a=[()=>{document.querySelector(".cart__drawer")?.dispatchEvent(new CustomEvent("theme:drawer:toggle"))}];["cart:refresh","theme:cart:change"].forEach(e=>{document.documentElement.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:{cart:r,openMiniCart:!0,open:!0}}))}),a.forEach(e=>{try{e()}catch(e){}});try{var i=document.querySelector("cart-notification, ajax-cart");if(null!==i){let t=o.map(e=>fetch((window.Shopify?.routes?.root||"/")+`cart?sections=${e.join(",")}`).then(function(e){return e.clone().json().then(function(e){return e})}));Promise.all(t).then(function(t){let n=t.reduce((e,t)=>({...e,...t}),{});if(r?.items?.length){var o={sections:n,key:r?.items[0]?.key,id:r?.items[0]?.id};"function"==typeof i.renderContents&&i.renderContents(o,!e),i.classList[0===r?.items?.length?"add":"remove"]("is-empty");let t=document.querySelector("#CartCount");t&&(t.innerText=r?.item_count)}else document.querySelector(".cart-count-bubble")?.remove()})}}catch(e){}try{var d=document.querySelectorAll("cart-drawer, mini-cart");if(d.length>0){let t=o.map(e=>fetch((window.Shopify?.routes?.root||"/")+`cart?sections=${e.join(",")}`).then(function(e){return e.clone().json().then(function(e){return e})}));Promise.all(t).then(function(t){let n=t.reduce((e,t)=>({...e,...t}),{});if(r?.items?.length){var o={sections:n,...r.items[0]};d.forEach(t=>{"function"==typeof t.renderContents&&t.renderContents(o,!e),t.classList.contains("is-empty")&&t.classList.remove("is-empty")})}else document.querySelector(".cart-count-bubble")?.remove()})}}catch(e){}const c=["cart:refresh","cart-add","cart-change","product:added"],w=[window.buildCart,window.DoublyGlobalCurrency?.convertAll];fetch((window.Shopify?.routes?.root||"/")+`cart?sections=${["ajax-cart"].join(",")}`).then(function(e){return e.clone().json().then(function(e){if(r?.items?.length){var t={sections:e,...r.items[0],item_count:r.item_count};n(w),c.forEach(e=>{document.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:t}))})}else document.querySelector(".cart-count-bubble")?.remove()})})},productReviews:async function(n=void 0,o=!1,r={}){if(n&&o){let a=o.integrations?.topics?.reviews;if(a?.isEnabled){let o=e,a=n?.lbPayload?.widget?.offers,i=o?.keys?.map(e=>({key:e,namespace:o?.namespace})),d=await t(a.map(e=>e.id),i,r);a.forEach((e,t)=>{e.lbMetafields=d?.[`_${t}`]?.metafields}),n.updateWidgetState({},a)}}},matchVariant:o,getProducts:t,init:()=>{!function(){let e=!1;function t(){e||(e=!0,window.lbHandlers?.widget?.registerListeners?.("checkout"),window.bndlr?.preventBundlerCheckout?.(),window.lbPreCheckout=async e=>{e?.getAttribute("lb-checkout-listener")&&window.bndlr?.enableBundlerCheckout?.()})}document.addEventListener("bundler:loaded",function(e){t()}),window.bndlr&&t(),window.OpusNoShadowRoot=!0,window.addEventListener("icartAddToCartEvent",e=>{let t=e.detail;t?.handle&&window.location.href.includes(t?.handle)&&window.lbHandlers.action(void 0,!0)});let r=[()=>{setTimeout(()=>{window.codeblackbelt?.["currency-converter-plusApi"]?.convertPrices()},1e3)}],a=[()=>{window.addEventListener("aftersell-upcart:public-events:added-to-cart",e=>{window.lbHandlers.action(void 0,!0),n(a)},{once:!0})}];n(a),window.addEventListener("lbWidgetRendered",e=>{e?.detail?.widgetSrcElement?.getAttribute("lb-variant-matched")||o([e?.detail?.widgetSrcElement]),n(r)}),window.addEventListener("change",e=>{e?.target?.classList?.contains("lb-variant-picker")||o()}),"boolean"==typeof window.ZapietCheckoutEnabled&&(window.lbValidateCheckout=()=>window.ZapietCheckoutEnabled),window.pickeasy&&"function"==typeof window.handleCheckoutClick&&(window.lbValidateCheckout=()=>window.handleCheckoutClick())}()},renderHelper:async()=>{(document.querySelectorAll("*")||[]).forEach(e=>{e?.textContent?.trim()?.startsWith("_lb-product")&&(e.style.display="none")});try{if(function(e=!1){return window.location.pathname.indexOf(e?"/cart":"/products/")>-1}()){let e=decodeURIComponent(new URLSearchParams(window.location.search).get("lbId"));e&&"null"!==e&&r(e);let t,n=window.location.pathname.split("/").filter(e=>e).pop(),o=window.location.origin+(window.Shopify?.routes?.root||"/")+"products/"+n+".js";if(a[n])t=a[n];else{let e=await fetch(o,{method:"GET",headers:{"Content-Type":"application/json","Access-Control-Allow-Origin":"*"}});t=200===e.status?await e.json():void 0,a[n]=t}let i=localStorage.getItem("lb-track-ids")||"{}";i=JSON.parse(i);let d=i[t?.id];d&&r(d)}}catch{}}}}();