!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="579bb49c-bb97-5059-a9c7-61f14b5f588f")}catch(e){}}(); (()=>{"use strict";var t={5334:(t,e,n)=>{n.d(e,{A:()=>a});var o=n(6343),r=n(2976);const a=async(t,e)=>{try{return await(0,r.xf)(fetch("https://chunk-errors-monitoring.herokuapp.com/api/chunk-error/",{method:"POST",mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify({app_id:t,shop:e})}))}catch(n){(0,o.A)(n)}}},805:(t,e,n)=>{n.r(e),n.d(e,{default:()=>i});var o=n(8806),r=n(7969),a=n(5334);function i(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";window.CandyCart.isLoading&&(document.getElementById("candycart-root")?(0,r.f)("root is already present.",o.c.CANDYCART):n.e(6).then(n.bind(n,4710)).then((n=>{let{default:o}=n;return o(t,e)})).catch((()=>(0,a.A)(o.c.CANDYCART,window.Shopify.shop))))}},3212:(t,e,n)=>{n.d(e,{Hy:()=>i,Qv:()=>c,fz:()=>a,wk:()=>r});var o=n(7969);function r(t){try{const e=t.closest("form"),n=null===e||void 0===e?void 0:e.attributes.getNamedItem("action");return!n||"/checkout"!==n.value}catch(e){return(0,o.v)("filterCheckoutForms",e),!0}}function a(){return[".add-to-cart",".add_to_cart",".add-to-cart-button",".add_to_cart_button",".button-add-to-cart",".button_add_to_cart",".add-to-cart-btn",".add_to_cart_btn",".btn-add-to-cart",".btn_add_to_cart",".addToCart",".AddToCart",".AddtoCart",".addtocart",".btn-addtocart",".btn--sticky_addtocart",".qsc-btn--add-to-cart","#add-to-cart","#add-to-cart-btn","#btn-add-to-cart","#addToCartButton","#addToCartBtn","#btnAddToCart","#AddToCart","#shopify_add_to_cart"].reduce(((t,e)=>(t.push(`button${e}:not(.cr-ignore)`),t.push(`input${e}:not(.cr-ignore)`),t.push(`a${e}:not(.cr-ignore)`),t)),['form[action*="/cart/add"] button[type=submit]:not(.shopify-payment-button__button):not(.shopify-payment-button__more-options)','form[action*="/cart/add"] input[type=submit]','a[href*="/cart/add"]','form[action="/cart/add"] #button-cart',".product-atc-btn",'form[action="/cart/add"] .shg-btn','form[action*="/cart/add"] [data-product-add]',".btn--add-to-cart",".product-form--atc-button",".cart__checkout-btn",".product-atc__button",".complete-design-a",".product_buttonContainer-addToCart a","#mwAddToCart",'button[data-zp-link-type="cart"]','button[data-pf-type="ProductATC"]','[data-action="add-to-cart"]','[data-action="AddToCart"]',"[name=add]","[name=addToCart]","[name=AddToCart]",".g-stickybar-buynow",".product-form--add-to-cart",".product-form__cart-submit",".addCart",".product-form__cart-submit div",".addtocart-button-active","button.product-page-add-to-cart",'.shopify-product-form .buy-buttons button[type="submit"] *'].map((t=>`${t}:not(.cr-ignore)`)).concat(window.CANDYRACK_CUSTOM_BUTTON_SELECTORS||[])).join(", ")}function i(){return['button[name="checkout"]','input[name="checkout"]','form[action="/checkout"] [type="submit"]','[href*="checkout"]','[href$="checkout"]','button[value="Checkout"]','input[value="Checkout"]'].map((t=>`${t}:not(.candy-cloned)`)).concat(window.CANDYCART_CUSTOM_BUTTON_SELECTORS||[]).join(",")}function c(t){return 1===(null===t||void 0===t?void 0:t.length)?t[0]:Array.isArray(t)?t.join(", "):t}},3899:(t,e,n)=>{n.d(e,{Oo:()=>c,Sw:()=>a,if:()=>d,lD:()=>i});var o=n(7338),r=n(2976);async function a(t,e){const n=e||"",a=(0,o.A)()||"";return await(0,r.qF)(fetch(`https://candyrack.digismoothie.app/api/candyrack/offers?shop=${window.Shopify.shop}&product=${t.id}&product_variant=${n}&lang=${a}`))}function i(t,e,n){const o={shop:window.Shopify.shop,discount_codes:t,product_ids:e,variant_ids:n},a=(0,r.Tj)(o);return(0,r.xf)(fetch(`https://candyrack.digismoothie.app/api/candyrack/covered-by-discount?${a}`))}async function c(t,e,n,o){return(await(0,r.xf)(fetch("https://candyrack.digismoothie.app/api/candyrack/generate-discount",{method:"POST",mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"},body:JSON.stringify({shop:t,entitled_product_id:n,offer:e,quantity:o})}))).discount_code}async function d(t){if(!t)return;const e={shop:window.Shopify.shop,variant_id:t},n=(0,r.Tj)(e);return(await(0,r.xf)(fetch(`https://candyrack.digismoothie.app/api/candyrack/product-handle-for-variant?${n}`))).handle}},5801:(t,e,n)=>{n.d(e,{B4:()=>u,FO:()=>f,NL:()=>p,Xl:()=>c,bE:()=>d,dt:()=>s,jA:()=>l,oo:()=>i,t1:()=>h});var o=n(8880),r=n(2976),a=n(7969);async function i(t){const e=window.location.pathname,n=(0,r.mP)(e);let o=await(0,r.qF)(fetch(`${n}/products/${t}.js`),!0);return o||(o=await(0,r.qF)(fetch(`/products/${t}.js`),!0)),o}function c(){return(0,r.xf)(fetch(`/cart.js?_=${(new Date).getTime()}`))}function d(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!t)return;const c=function(t,e,n){if(window.ADD_TO_CART_QUERY_STRING){let o=window.ADD_TO_CART_QUERY_STRING.replace("${productVariantId}",t.toString()).replace("${quantity}",e?e.toString():"1");if(n){const t=Object.keys(n).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(n[t])}`)).join("&");t&&(o+=`&${t}`)}return o}return""}(t,e,n);if(c)return(0,r.xf)(fetch(`/cart/add.js${c}`,{...r.SM}));let d={quantity:e,id:t};return n&&(d.properties=n),i&&(d=window.CANDYRACK_MODIFY_UPGRADE_ADD_TO_CART_BODY(e,t,n),(0,a.f)(`Add.js body modified ${JSON.stringify(d)}`,o.c0.CANDYRACK)),(0,r.xf)(fetch("/cart/add.js",{...r.SM,body:JSON.stringify(d)}))}async function s(t,e){if(!t)return;const n={quantity:e||0,id:String(t)};return(0,r.xf)(fetch("/cart/change.js",{...r.SM,body:JSON.stringify(n)}))}function u(t,e){let n=0,o=0;return t.map((t=>{const r={...t,offer:e[n]};return o+1===e[n].recommended_product_count?(o=0,n++):o++,r}))}function l(t){const e={updates:t};return(0,r.xf)(fetch("/cart/update.js",{...r.SM,body:JSON.stringify(e)}))}function f(t){const e={attributes:t};return fetch("/cart/update.js",{...r.SM,body:JSON.stringify(e)})}async function p(){var t,e;const n=null!==(t="https://candyrack.digismoothie.app/")&&null!==(e=t.trim())&&void 0!==e&&e.length?"https://candyrack.digismoothie.app/":"",o=window.Shopify.shop;return await(0,r.R4)(fetch(`${n}api/apps-info/?shop=${o}`))}async function h(t,e,n,o){const i=(0,r.mP)(window.location.pathname);try{let a=await y(i,t,n,window.CANDYRACK_IS_SMART_OFFER_RELATED_INTENT_PREFERRED?"related":"complementary");if(a.lengtht.id)));for(const a of e)if(!r.has(a.id)&&o.length=n)break;return o}async function y(t,e,n){var o;let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"related";const i=await(0,r.xf)((0,r.Ou)(`${t}/recommendations/products.json?product_id=${e}&intent=${a}`,3e3));return null===i||void 0===i||null===(o=i.products)||void 0===o?void 0:o.filter((t=>!t.tags.includes(n)))}},8460:(t,e,n)=>{n.d(e,{Hr:()=>c,TX:()=>i,Wf:()=>r,hv:()=>a});const o=new Map([["order_cannot_be_edited","We couldn\u2019t add the item to the order. Maybe the order has been fulfilled already? Please contact us for more details."],["invalid_input_data","We couldn\u2019t add the item to the order. Please refresh the page and try it again."],["variant_id_not_unique","We couldn\u2019t add the item to the order. Please contact us for more details."],["offer_does_not_exist","We couldn\u2019t add the item to the order as the offer is not valid anymore. Please contact us for more details."]]);class r{transpile(t){return o.get(t)||t}constructor(t){this.errorCode=void 0,this.errors=void 0,this.message=void 0,i(t)?(this.errorCode=t.name,this.message=t.message):(this.errorCode=t.error_code,this.errors=t.errors,this.message=this.transpile(t.error_code))}static transform(t){return new r(t)}}const a=t=>void 0!==(null===t||void 0===t?void 0:t.error_code),i=t=>void 0!==(null===t||void 0===t?void 0:t.message);let c;!function(t){t.CR_IGNORE="cr-ignore",t.LU_IGNORE="lu-ignore",t.CC_IGNORE="cc-ignore"}(c||(c={}))},2976:(t,e,n)=>{n.d(e,{Ou:()=>l,R4:()=>d,SM:()=>r,Tj:()=>a,kk:()=>s,mP:()=>u,qF:()=>c,xf:()=>i});var o=n(8460);const r={method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json; charset=utf-8"}};function a(t){const e=new URLSearchParams;for(const[n,o]of Object.entries(t))Array.isArray(o)?o.forEach((t=>e.append(n,String(t)))):e.append(n,String(o));return e.toString()}async function i(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=await t;if(n.status>=500)throw Error("Something unexpected happened.");if(404===n.status){if(e){const t=await e;return 404===t.status?null:await t.json()}return null}return await n.json()}async function c(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n=await t;if(null===n||void 0===n||!n.ok){if(404===n.status&&e)return null;throw new Error(`Request failed with status ${n.status}: ${n.statusText}`)}return await n.json()}async function d(t){const e=await t;let n=null,r=!1;try{n=await e.json()}catch(a){r=!0}return e.status>=400&&(!(0,o.hv)(n)||r)?{error_code:"It's not you, it's us!",errors:[]}:n}function s(t,e){if(e)return"";if(t.includes("checkout")){const e=t.split("/"),n=e[e.length-2];return 2===n.split("-")[0].length?n:""}const n=/^\/([a-z]{2}(?:-[a-z]{2})?)(?:\/|$)/gi.exec(t);return n&&n[0]?`${n[1]}`:""}function u(t){const e=s(t,window.CANDYRACK_DISABLE_LOCALE);return e?`/${e}`:""}async function l(t,e){return new Promise(((n,o)=>{if(fetch(t).then(n,o),e){const t=new Error(`Response exceeded ${e/1e3} second threshold`);setTimeout(o,e,t)}}))}},5023:(t,e,n)=>{n.d(e,{$x:()=>u,Gl:()=>l,ek:()=>d,fo:()=>s,g_:()=>o,hB:()=>r,m$:()=>a,n0:()=>c,xR:()=>i});const o="candyrack-discount-code",r="candyrack-discounted-products",a="extensionStorage",i="candyrack-associated-products",c="candycart-discount-code",d="candycart-discounted-product",s="candyrack-offset-value",u="is-candyrack-base-app-for-test-purposes",l="ppp-candyrack-checkbox-layout-offers-added-to-cart"},8353:(t,e,n)=>{n.d(e,{VG:()=>a,pz:()=>c,Ay:()=>d});const o=function(t){let e;try{e=window[t];const n="__storage_test__";return e.setItem(n,n),e.removeItem(n),!0}catch(n){return!1}};function r(){return new Proxy({},{get:function(t,e){return e in t?t[e]:null}})}class a{get length(){return this.__storage?Object.keys(this.__storage).length:window[this.__type].length}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"localStorage";this.__storage=void 0,this.__type=void 0,this.__type=t,this.__storage=o(t)?null:r()}key(t){if(this.__storage){const e=Object.keys(this.__storage);return e.length<=t||t<0?null:e[t]}return window[this.__type].key(t)}getItem(t){return this.__storage?this.__storage[t]:window[this.__type].getItem(t)}clear(){this.__storage&&(this.__storage=r()),window[this.__type].clear()}removeItem(t){this.__storage&&delete this.__storage[t],window[this.__type].removeItem(t)}setItem(t,e){this.__storage?this.__storage[t]=e:window[this.__type].setItem(t,e)}}const i=new a,c=new a("sessionStorage"),d=i},6635:(t,e,n)=>{n.d(e,{S:()=>s,A:()=>u});var o=n(5801),r=n(8353),a=n(4704),i=n(8806),c=(n(3899),n(5023)),d=n(7969);const s="candyrack-tracking";class u{constructor(){this.cartToken=void 0,this.storage=new r.VG("sessionStorage"),this.isCurrentlyFetchingCartToken=!1,this.cartTokenUpdatedEventName="cart-token-updated",this.pppViteApiEndpoint=void 0,this.cartToken=this.storage.getItem(s),window.addEventListener(this.cartTokenUpdatedEventName,(t=>{t.detail&&(t.detail.token?(this.cartToken=t.detail.token,this.storage.setItem(s,t.detail.token)):null===t.detail.token&&(this.storage.removeItem(s),this.cartToken=null))}))}static getInstance(t){return u.instance||(u.instance=new u),t&&(u.instance.pppViteApiEndpoint=t),u.instance}_getApiEndpoint(){let t;if(t=this.pppViteApiEndpoint?this.pppViteApiEndpoint:"https://candyrack.digismoothie.app/",!t)throw new Error("No API hostname configuration found");return`${t}api/candyrack`}async _getCartToken(){if(this.cartToken)return this.cartToken;if(this.isCurrentlyFetchingCartToken)return new Promise((t=>{const e=n=>{n.detail.token&&(window.removeEventListener(this.cartTokenUpdatedEventName,e),t(n.detail.token))};window.addEventListener(this.cartTokenUpdatedEventName,e)}));this.isCurrentlyFetchingCartToken=!0;try{const{token:t}=await(0,o.Xl)();return this.cartToken=t,this.storage.setItem(s,t),window.dispatchEvent(new CustomEvent(this.cartTokenUpdatedEventName,{detail:{token:t}})),t}finally{this.isCurrentlyFetchingCartToken=!1}}async cleanUpCandyRackStorageTrackingInformation(){if(window.Shopify.checkout){this.storage.getItem(s)&&((0,a.Z1)(),(0,d.f)("Clear discount codes information",i.c.CANDYRACK),r.Ay.removeItem(c.g_),r.Ay.removeItem(c.hB),this.storage.removeItem(s),this.cartToken=null,window.dispatchEvent(new CustomEvent(this.cartTokenUpdatedEventName,{detail:{token:null}})))}}}u.instance=null},8806:(t,e,n)=>{var o;n.d(e,{c:()=>o}),function(t){t.CANDYCART="candycart",t.CANDYRACK="candyrack",t.LAST_UPSELL="last_upsell",t.PRODUCT_PAGE_PLACEMENT="product_page_placement"}(o||(o={}))},9282:(t,e,n)=>{let o;n.d(e,{s:()=>o}),function(t){t.CANDY_RACK_PRODUCTS="products",t.CANDY_RACK_COLLECTIONS="collections",t.LAST_UPSELL="checkouts"}(o||(o={}))},8880:(t,e,n)=>{n.d(e,{c0:()=>o.c});var o=n(8806);n(9282)},4704:(t,e,n)=>{n.d(e,{$B:()=>f,Bm:()=>l,EV:()=>v,Hh:()=>g,Z1:()=>y,_g:()=>h,fe:()=>s,k5:()=>p,v5:()=>m});var o=n(5801),r=n(8353),a=n(5023),i=n(8806),c=n(7969),d=n(8230);const s="candyrack-associated-products-for-removal",u="candyrack-translations";function l(t,e,n){t.shopifyProductVariantIdComputedInFE&&(r.Ay.setItem(a.xR,JSON.stringify({...f(),[t.shopifyProductVariantIdComputedInFE]:e})),t.remove_upsell_product_when_parent_product_is_removed&&r.Ay.setItem(s,JSON.stringify({...p(),[t.shopifyProductVariantIdComputedInFE]:{handle:e,quantity:t.quantityComputedInFE,parentProductVariantId:n}})))}function f(){const t=r.Ay.getItem(a.xR);if(t)try{return JSON.parse(t)}catch{return{}}return{}}function p(){const t=r.Ay.getItem(s);if(t)try{return JSON.parse(t)}catch{return{}}return{}}function h(t){r.Ay.setItem(u,JSON.stringify(t))}function m(t){const{cart_discount_note:e}=function(){const t=r.Ay.getItem(u)||"";let e={cart_discount_note:"Discount AMOUNT will be applied at checkout."};try{var n;const o=JSON.parse(t);null!==(n=o.text)&&void 0!==n&&n.cart_discount_note&&(e.cart_discount_note=o.text.cart_discount_note)}catch{}return e}();document.querySelectorAll("[candyrack-cart-info]").forEach((t=>t.remove())),t.forEach((t=>{t.covered_variant_ids.forEach((t=>{var n;const o=null===(n=(0,d.px)().find((e=>e.variantId===t)))||void 0===n?void 0:n.discount;o&&function(t,e){const n=Array.from(document.querySelectorAll(`a[href$="${t}"]`));let o=n.filter((t=>!t.firstElementChild||"IMG"!==t.firstElementChild.tagName));0===o.length&&(o=n);o.length>0&&((0,c.f)(`Attaching discount message ${e} for variant ${t}`,i.c.CANDYRACK),o[o.length-1].insertAdjacentHTML("afterend",`
${e}
`))}(t,e.replace("AMOUNT",o))}))}))}function y(){(0,c.f)("Clear associated storage products information",i.c.CANDYCART),r.Ay.removeItem(a.xR)}async function g(t){v(await(0,o.Xl)(),t)}function v(t,e){for(const n of Object.keys(f()))if(!t.items.find((t=>t.variant_id===Number(n)))){(0,c.f)(`Variant ${n} not found. Removing association info...`,e);const t=f();delete t[n],r.Ay.setItem(a.xR,JSON.stringify(t))}!function(t,e){var n;if(null!==(n=window.CandyRack)&&void 0!==n&&n.popupOpen)return void(0,c.f)("not checking removeUpsellProductWhenParentProductIsRemoved because modal is open",e);const a=p();let i={};const d={};for(const o of Object.keys(a)){(0,c.f)(`Checking variant ${o}`,e);const n=t.items.find((t=>t.handle===a[o].handle&&t.variant_id===a[o].parentProductVariantId)),r=t.items.find((t=>t.variant_id===Number(o))),s=(null===n||void 0===n?void 0:n.variant_id)===Number(o)&&(null===n||void 0===n?void 0:n.quantity)<=a[o].quantity,u=!n||1===t.items.filter((t=>t.variant_id===n.variant_id)).length;if(!n&&r||s&&u){(0,c.f)(`Parent ${a[o].handle} not found. Removing upsell product...`,e);let t=r.quantity-a[o].quantity;t=t<0?0:t,i[r.variant_id]=t}else d[o]=a[o]}r.Ay.setItem(s,JSON.stringify(d)),Object.keys(i).length>0&&Promise.resolve((0,o.jA)(i)).then((()=>window.location.reload()))}(t,e)}},8230:(t,e,n)=>{n.d(e,{w_:()=>R,tk:()=>N,yk:()=>w,px:()=>b,dY:()=>E,_t:()=>A,_A:()=>y,i$:()=>m,l4:()=>p,yc:()=>h,Er:()=>g});var o=n(5801),r=n(3899),a=n(8806),i=n(7969),c=n(8353),d=n(5023),s=n(4704);function u(t,e){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];var o,r,a,i,c=0;return function(){o=this,r=arguments;var t=new Date-c;return i||(t>=e?(n&&d(),i=setTimeout(d,e)):i=setTimeout(d,e-t)),a};function d(){i=0,c=+new Date,a=t.apply(o,r),o=null,r=null}}const l="form[action*='/checkout'], form[action*='/cart'], form[action*='/a/checkout']",f=5;async function p(t,e,n,o,r,s){(0,i.f)(`Saving discount code, discounted price ${n}, discount: ${o}`,a.c.CANDYRACK);const u=c.Ay.getItem(d.g_)||"",l=u.split(",").length;if(!u.includes(t)||l>f){const e=0===u.trim().length?t:`${u},${t}`;c.Ay.setItem(d.g_,e),g(a.c.CANDYRACK)}const p=b();c.Ay.setItem(d.hB,JSON.stringify([...p,{variantId:e,discountedPrice:n,code:t,discount:o,relatedProductId:r,hasParent:s}]))}function h(t,e){const n=c.Ay.getItem(d.g_)||"";(0,i.f)(`Current discounts in storage: ${n}`,a.c.CANDYCART);const o=n.split(",").length;if(o>f)return void(0,i.f)(`Too many discounts: ${o}. Returning.`,a.c.CANDYCART);if(!n.includes(t)){const e=0===n.trim().length?t:`${n},${t}`;(0,i.f)(`Discounts saved in storage after addition: ${e}`,a.c.CANDYCART),c.Ay.setItem(d.g_,e)}const r=JSON.parse(c.Ay.getItem(d.ek)||"[]");c.Ay.setItem(d.ek,JSON.stringify([...r,{variantId:e,discount:t}]))}function m(t,e){const n=c.Ay.getItem(d.g_)||"";(0,i.f)(`Current discounts: ${n}`,a.c.CANDYCART);const o=JSON.parse(c.Ay.getItem(d.ek)||"[]").filter((t=>t.variantId!==e));if(!o.find((e=>e.code===t))){const e=n.split(",").filter((e=>e!==t)).join(",");c.Ay.setItem(d.g_,e),(0,i.f)(`Discount ${t} not used by other products, removed. Updated discounts: ${e}`,a.c.CANDYCART)}c.Ay.setItem(d.ek,JSON.stringify(o))}function y(t,e){const n=c.Ay.getItem(d.g_)||"";(0,i.f)(`Current discounts: ${n}`,a.c.CANDYRACK);const o=b().filter((t=>t.variantId!==e));if(!o.find((e=>e.code===t))){const e=n.split(",").filter((e=>e!==t)).join(",");c.Ay.setItem(d.g_,e),(0,i.f)(`Discount ${t} not used by other products, removed. Updated discounts: ${e}`,a.c.CANDYRACK)}c.Ay.setItem(d.hB,JSON.stringify(o))}function g(t){C(t),k(t)}function v(t){let e=null;return a.c.CANDYRACK===t&&(e=c.Ay.getItem(d.g_)),e||""}const _=()=>{const t=c.Ay.getItem(d.m$);if(t)try{const e=JSON.parse(t),n=Object.keys(e).find((t=>t.includes(d.g_)));if(n&&e[n]){const t=e[n];return Array.from(new Set(t.split(","))).join(",")}}catch{(0,i.f)("Parsing of checkout extension discounts failed")}return""};function A(t){const e=v(t).trim(),n=_();return`${e}${n.length?`,${n}`:""}`.split(",").length>1}function w(t){var e;const n=null===(e=v(t))||void 0===e?void 0:e.trim(),o=_(),r=`${n}${o.length?`,${o}`:""}`;if(!r)return"";return r.split(",").map((t=>encodeURIComponent(t))).join(",")}function C(t){const e=v(t),n=e.split(",");a.c.CANDYRACK===t&&async function(t){if((0,i.f)("Showing discount info in cart",a.c.CANDYRACK),!t.trim())return void(0,i.f)("No discount, returning.",a.c.CANDYRACK);if(!document.querySelector("a[href*='?variant=']"))return void(0,i.f)("No variant, returning.",a.c.CANDYRACK);const e=await(0,o.Xl)();if(0===e.items.length)return;const n=e.items.map((t=>t.product_id)),c=e.items.map((t=>t.variant_id)),d=t.split(","),u=await(0,r.lD)(d,n,c);(0,s.v5)(u)}(e),window.chCouponCode=e;const c=document.querySelectorAll(l);n.length>1||""===n[0]?Array.from(c).forEach((e=>{const n=e.querySelector("[name=discount]");n&&((0,i.f)(`Removing discount input ${n}`,t),n.remove())})):Array.from(c).forEach((n=>{const o=n.querySelector("[name=discount]");if(o){if(""===o.value.trim()&&" "!==e){const n=e?encodeURIComponent(e):e;(0,i.f)(`New discount input value ${n}`,t),o.value=n}}else(0,i.f)(`Inserting discount input ${o}`,t),n.insertAdjacentHTML("beforeend",``)}))}function k(t){const e=w(t),n=window.Weglot&&window.Weglot.getCurrentLang(),o=`/checkout?discount=${e}${n?`&locale=${n}`:""}`;function r(t){t.preventDefault(),t.stopImmediatePropagation(),(0,i.f)(`Checkout click handler, redirecting to ${o}`),window.location.href=o}const a=document.querySelectorAll('[href^="/checkout"],[name=return_to][value^="/checkout"],button[onclick],[data-component-checkout-button]');Array.from(a).forEach((t=>{var e,n;t instanceof HTMLAnchorElement&&(t.href=o),t instanceof HTMLInputElement&&(t.value=o),t instanceof HTMLButtonElement&&null!==(e=t.attributes.getNamedItem("onclick"))&&void 0!==e&&null!==(n=e.value)&&void 0!==n&&n.match(/location.*checkout/)&&(t.onclick=r),t instanceof HTMLButtonElement&&t.attributes.getNamedItem("data-component-checkout-button")&&(t.onclick=r)}))}function b(){const t=c.Ay.getItem(d.hB);if(t)try{return JSON.parse(t)}catch{return[]}return[]}function E(t){g(t),function(t){const e=u((()=>C(t)),1e3,!0),n=u((()=>k(t)),1e3,!0),o=u((()=>(0,s.Hh)(t)),3e3),r=function(t){n(),o();for(const n of t)if("childList"===n.type)for(var r of n.addedNodes)(r.action&&(r.action.indexOf("/cart")>-1||r.action.indexOf("/checkout")>-1||r.action.indexOf("/a/checkout")>-1)||r.querySelector&&r.querySelector("a[href*='?variant=']"))&&e()};try{const t=new MutationObserver(r),e=document.body;t.observe(e,{childList:!0,subtree:!0})}catch(a){(0,i.v)("Failed to setup drawer cart observer",t,a)}}(t)}function R(t,e,n,o,r){if(o){if("percentage"===n){const n=t*(e/100),o=Math.floor(100*n)/100,a=t-o;return(0,i.f)(`Applying percentage discount: ${o}`,r),(0,i.f)(`Final discounted price: ${a}`,r),a}{const n=t-e;return(0,i.f)(`Applying fixed discount: ${e}`,r),(0,i.f)(`Final discounted price: ${n}`,r),n}}return(0,i.f)(`Discount is not set to be applied, returning original variantPrice : ${t}`,r),t}async function N(t,e){b().forEach((n=>{t.items.find((t=>Number(t.variant_id)===Number(n.variantId)))||y(n.code,Number(n.variantId));t.items.find((t=>Number(t.product_id)===Number(n.relatedProductId)||!n.hasParent))||(y(n.code,Number(n.variantId)),(0,i.f)(`Related product ${n.variantId} not found. Removing discount info...`,e),C(e))}))}},7338:(t,e,n)=>{n.d(e,{A:()=>o});const o=()=>{var t;const e={Weglot:()=>{var t;return null===(t=window.Weglot)||void 0===t?void 0:t.getCurrentLang()},langify:()=>{var t,e;return null===(t=window.langify)||void 0===t||null===(e=t.locale)||void 0===e?void 0:e.iso_code},GTranslateGetCurrentLang:()=>window.GTranslateGetCurrentLang(),LangShop:()=>{var t,e,n;return(null===(t=window.LangShop)||void 0===t?void 0:t.currentLanguage)||(null===(e=window.LangShop)||void 0===e||null===(n=e.getCurrentLanguage())||void 0===n?void 0:n.code)}};for(const[n,o]of Object.entries(e))if(window[n])return o()||window.Shopify.locale;return null===(t=window.Shopify)||void 0===t?void 0:t.locale}},7969:(t,e,n)=>{n.d(e,{f:()=>s,v:()=>d});var o=n(8806),r=n(8353);const a="candyrack-debug";let i=!0;try{i=!!r.Ay.getItem(a)}catch{}function c(t){return t?`${t}: `:"Could not determine app: "}function d(t,e){const n="string"===typeof t?c(e)+t:t;for(var o=arguments.length,r=new Array(o>2?o-2:0),a=2;a2?o-2:0),a=2;a{r.Ay.setItem(a,String(!0)),i=!0,s("Enabled console output \ud83d\udd27",o.c.CANDYRACK)}},4980:(t,e,n)=>{n.d(e,{sK:()=>o.s,ai:()=>r,X:()=>a,xv:()=>i});var o=n(9282);const r=t=>{var e;return void 0!==(null===(e=t.buttons)||void 0===e?void 0:e.reject)},a=t=>!(void 0!==t.ajax_cart_watcher_selector)&&"grid"===t.popup_layout,i=t=>a(t)?"-grid":""},5479:(t,e,n)=>{n.d(e,{bf:()=>p,Xh:()=>v,OO:()=>f,G$:()=>h,RS:()=>y,mM:()=>m,FP:()=>g});var o=n(8353),r=n(5023),a=n(4980);function i(){const t=window.location.pathname.match(/[0-9]+\/orders|checkouts\/[A-Za-z0-9]+/);return!(null===t||void 0===t||!t.length)}function c(t){return window.location.pathname.includes(t)}var d=n(3212),s=n(8230),u=n(8806),l=n(7969);function f(){p.isBaseApp()&&(o.Ay.removeItem(r.ek),o.Ay.removeItem(r.n0))}const p={isBaseApp:()=>"true"===o.Ay.getItem(r.$x)||"false"!==o.Ay.getItem(r.$x)&&Boolean("https://candyrack.digismoothie.app/".trim().length>0),isForkedApp:()=>"true"!==o.Ay.getItem(r.$x)&&("false"===o.Ay.getItem(r.$x)||Boolean("false"===o.Ay.getItem(r.$x)||"")),isCandyRackExistingAndNotLoading:t=>{var e,n;return(null===(e=t.candyrack)||void 0===e?void 0:e.is_installed)&&!(null!==(n=window.CandyRack)&&void 0!==n&&n.isLoading)}};function h(t,e){return p.isCandyRackExistingAndNotLoading(t)&&function(t){return t.isEnabled||i()}(e)}function m(t,e){return p.isBaseApp()&&p.isCandyRackExistingAndNotLoading(t)&&e.isEnabled}function y(t){var e,n,o;const r=t.candyrack&&t.candyrack.is_installed&&t.candyrack.is_checkout_button_offers_existing;return null!==(e=(n=window).CANDYRACK_DISABLE_CHECKOUT_BUTTON_LOAD)&&void 0!==e&&e.call(n)?((0,l.f)("Blocking Candy Rack checkout popup loading",u.c.CANDYCART),!1):(p.isBaseApp()&&(r||(0,s._t)(u.c.CANDYRACK))||p.isForkedApp()&&t.candycart.is_installed&&!r)&&!(null!==(o=window.CandyCart)&&void 0!==o&&o.isLoading)&&!i()}function g(t){var e,n;const o=t.candyrack&&t.candyrack.is_installed&&t.candyrack.is_thank_you_page_offers_existing;return(p.isBaseApp()&&o||(null===(e=t.last_upsell)||void 0===e?void 0:e.is_installed)&&p.isForkedApp()&&!o)&&i()&&!(null!==(n=window.LastUpsell)&&void 0!==n&&n.isLoading)}const v=()=>{if(window.CANDYRACK_DISABLE_CANDYRACK_LOAD&&window.CANDYRACK_DISABLE_CANDYRACK_LOAD())return(0,l.f)("Blocking Candy Rack popup loading",u.c.CANDYRACK),{isEnabled:!1,shouldRender:!1};if(c(a.sK.CANDY_RACK_PRODUCTS)||c(a.sK.CANDY_RACK_COLLECTIONS)||(0,d.Hy)().length>0||window.CANDYRACK_FORCE_LOAD)return{isEnabled:!0,shouldRender:!0};if(window.location.pathname.includes("cart")){const t=o.Ay.getItem(r.hB),e=o.Ay.getItem(r.xR),n=o.Ay.getItem(r.g_);return e||n||t?{isEnabled:!0,shouldRender:!1}:{isEnabled:!1,shouldRender:!1}}return{isEnabled:!1,shouldRender:!1}}},6343:(t,e,n)=>{n.d(e,{A:()=>i});var o=n(7969);const r=[];let a=(t,e,i)=>{if(0===r.length&&async function(t){(0,o.f)("Encountered error. Loading Sentry...",t);const{init:e,withScope:i,captureException:c}=await n.e(2).then(n.bind(n,9292));e({dsn:"https://bfd888898e014624a09051192a92ff6d@o187547.ingest.sentry.io/5583637",integrations:t=>t.filter((t=>"ReportingObserver"!==t.name&&"TryCatch"!==t.name&&"GlobalHandlers"!==t.name)).map((t=>("InboundFilters"===t.name&&(t.ignoreErrors=["Failed to fetch","SecurityError","localStorage","fetch","The request timed out.","InvalidStateError","Access is denied.","The operation couldn\u2019t be completed","NetworkError","ChunkLoadError"]),t)))}),a=(t,e,n)=>{n&&i((t=>{Object.keys(n).forEach((e=>{t.setExtra(e,n[e])}))})),c(t)},(0,o.f)("Sentry loaded",t),r.forEach((e=>{let{error:n,errorInfo:r}=e;(0,o.f)("Sending error",t,n),a(n,r)}))}(e),t instanceof Error)r.push({error:t,errorInfo:i});else try{r.push({error:new Error(`Unknown error, please recheck creation: ${JSON.stringify(t)}`),errorInfo:i})}catch(t){r.push({error:new Error("Unknown error, please recheck creation"),errorInfo:i})}};const i=a}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var a=e[o]={exports:{}};return t[o](a,a.exports,n),a.exports}n.m=t,n.F={},n.E=t=>{Object.keys(n.F).map((e=>{n.F[e](t)}))},n.H={},n.G=t=>{Object.keys(n.H).map((e=>{n.H[e](t)}))},n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.f={},n.e=t=>Promise.all(Object.keys(n.f).reduce(((e,o)=>(n.f[o](t,e),e)),[])),n.u=t=>"static/js/"+t+"."+{1:"36f96c27",2:"45adbb5b",3:"edce9609",4:"c8a88833",5:"bca39f4a",6:"2a85cabd",7:"eefc25b2",8:"981510d2",9:"c9ef40be",10:"82fb6256"}[t]+".chunk.js",n.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"===typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t={},e="frontend-client:";n.l=(o,r,a,i)=>{if(t[o])t[o].push(r);else{var c,d;if(void 0!==a)for(var s=document.getElementsByTagName("script"),u=0;u{c.onerror=c.onload=null,clearTimeout(p);var r=t[o];if(delete t[o],c.parentNode&&c.parentNode.removeChild(c),r&&r.forEach((t=>t(n))),e)return e(n)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=f.bind(null,c.onerror),c.onload=f.bind(null,c.onload),d&&document.head.appendChild(c)}}})(),n.r=t=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.p="https://candyrack.ds-cdn.com/",(()=>{var t={0:0};n.f.j=(e,o)=>{var r=n.o(t,e)?t[e]:void 0;if(0!==r)if(r)o.push(r[2]);else{var a=new Promise(((n,o)=>r=t[e]=[n,o]));o.push(r[2]=a);var i=n.p+n.u(e),c=new Error;n.l(i,(o=>{if(n.o(t,e)&&(0!==(r=t[e])&&(t[e]=void 0),r)){var a=o&&("load"===o.type?"missing":o.type),i=o&&o.target&&o.target.src;c.message="Loading chunk "+e+" failed.\n("+a+": "+i+")",c.name="ChunkLoadError",c.type=a,c.request=i,r[1](c)}}),"chunk-"+e,e)}},n.F.j=e=>{if(!n.o(t,e)||void 0===t[e]){t[e]=null;var o=document.createElement("link");n.nc&&o.setAttribute("nonce",n.nc),o.rel="prefetch",o.as="script",o.href=n.p+n.u(e),document.head.appendChild(o)}},n.H.j=e=>{if(!n.o(t,e)||void 0===t[e]){t[e]=null;var o=document.createElement("link");o.charset="utf-8",n.nc&&o.setAttribute("nonce",n.nc),o.rel="preload",o.as="script",o.href=n.p+n.u(e),document.head.appendChild(o)}};var e=(e,o)=>{var r,a,i=o[0],c=o[1],d=o[2],s=0;if(i.some((e=>0!==t[e]))){for(r in c)n.o(c,r)&&(n.m[r]=c[r]);if(d)d(n)}for(e&&e(o);s{var t={1:[4],6:[3],7:[5]};n.f.prefetch=(e,o)=>Promise.all(o).then((()=>{var o=t[e];Array.isArray(o)&&o.map(n.E)}))})(),(()=>{var t={8:[1],9:[8],10:[7]};n.f.preload=e=>{var o=t[e];Array.isArray(o)&&o.map(n.G)}})();var o=n(8460),r=n(6343),a=n(7969),i=n(8806),c=n(5334),d=n(5479),s=n(5801);async function u(){if(await(0,s.Xl)()&&window.Shopify.checkout)try{window.Currency||await(t="https://cdn.shopify.com/s/javascripts/currencies.js",new Promise(((e,n)=>{var o=document.createElement("script");o.onerror=t=>{n(new URIError(t instanceof Event?"The script "+t.target.src+" didn't load correctly.":"The script didn't load correctly. "+t))},o.onload=e,document.head.appendChild(o),o.src=t})))}catch(e){(0,a.v)(e)}var t}var l=n(6635);const f=t=>{var e;if(null!==t&&void 0!==t&&null!==(e=t.candyrack)&&void 0!==e&&e.is_installed&&!window.CANDYRACK_CONFIG_EXECUTED){var n;const e=null===(n=t.candyrack.config)||void 0===n?void 0:n.trim();if(e)try{window.CANDYRACK_CONFIG_EXECUTED=!0,window.eval(e)}catch(s){(0,a.v)("Config file contains an error",i.c.CANDYRACK)}}const o=(0,d.Xh)();var c;((0,d.G$)(t,o)&&u().catch((t=>(0,r.A)(t))),(0,d.mM)(t,o)&&(l.A.getInstance().cleanUpCandyRackStorageTrackingInformation().catch((()=>{})),window.CandyRack=window.CandyRack?{...window.CandyRack,isLoading:!0}:{isLoading:!0},p(o.shouldRender,t.candyrack.storefront_access_token)),(0,d.RS)(t)&&(window.CandyCart=window.CandyCart?{...window.CandyCart,isLoading:!0}:{isLoading:!0},h(t.candyrack.storefront_access_token)),(0,d.FP)(t))&&(null!==(c=t.candyrack)&&void 0!==c&&c.is_installed&&l.A.getInstance().cleanUpCandyRackStorageTrackingInformation().catch((()=>{})),window.LastUpsell=window.LastUpsell?{...window.LastUpsell,isLoading:!0}:{isLoading:!0},m(t.candyrack.storefront_access_token))},p=(t,e)=>{n.e(9).then(n.bind(n,6811)).then((n=>{let{default:o}=n;return o(t,e)})).catch((()=>{(0,c.A)(i.c.CANDYRACK,window.Shopify.shop)}))},h=t=>{Promise.resolve().then(n.bind(n,805)).then((e=>{let{default:n}=e;return n(!0,t)})).catch((()=>{(0,c.A)(i.c.CANDYCART,window.Shopify.shop)}))},m=t=>{n.e(10).then(n.bind(n,6003)).then((e=>{let{default:n}=e;return n(t)})).catch((()=>{(0,c.A)(i.c.LAST_UPSELL,window.Shopify.shop)}))};var y=n(805),g=n(8230);const v=async()=>{const t=await(0,s.NL)();var e;e=t,(0,o.hv)(e)?((0,a.v)(e),(0,r.A)({name:"APIError: installation check",message:e.error_code}),(0,d.OO)()):(0,o.TX)(e)?((0,a.v)(e),(0,d.OO)()):f(e)},_=document.createElement("style");_.textContent="\n .candyrack-body-open {\n position: fixed !important;\n overflow-y: scroll!important;\n width: 100%!important;\n }\n",document.head.appendChild(_),document.addEventListener("candyrack-closed",(()=>{(0,g._t)(i.c.CANDYRACK)&&(window.CandyCart=window.CandyCart?{...window.CandyCart,isLoading:!0}:{isLoading:!0},(0,y.default)(!1))})),"complete"===document.readyState||"interactive"===document.readyState?v():document.addEventListener("DOMContentLoaded",v)})(); //# sourceMappingURL=main.js.map //# debugId=579bb49c-bb97-5059-a9c7-61f14b5f588f