(()=>{"use strict";const t=t=>{try{return document.querySelectorAll(`${t}`)}catch(t){throw t}},e=function(t){try{const e=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});t.dispatchEvent(e)}catch(t){throw t}};let o,n;if("undefined"!=typeof window&&(n=window.location.href),!n)throw new Error("url is undefined");o=n.indexOf("https://dev.elevatedcollections.com")>-1?"http://localhost:3000":n.indexOf("https://branch.elevatedcollections.com")>-1?"https://flowphantom-andrew-bass-flowphantom.vercel.app":(null==n?void 0:n.indexOf("https://staging.elevatedcollections.com"))>-1?"https://staging.flowphantom.com":"https://cdn.flowphantom.com";const r=(t,e="")=>Object.keys(t).reduce(((o,n)=>{const a=e.length?e+".":"";return t[n]&&"object"==typeof t[n]?Object.assign(o,r(t[n],a+n)):o[a+n]=t[n],o}),{});const a=t=>{return e=void 0,o=void 0,a=function*(){const e=t.map((t=>t.webflow_funnel_offers[0].webflow_product.webflow_product_id));let o=[];e[0]&&(o=yield(t=>{return e=void 0,o=void 0,r=function*(){const e=function(){const t=document.cookie.match("(^|;)\\s*wf-csrf\\s*=\\s*([^;]+)");return t?t.pop():null}(),o=[];t.forEach((t=>{o.push({operationName:"FetchAllVariantsAndMemberships",variables:{productId:t},query:"query FetchAllVariantsAndMemberships($productId: BasicId!) {\n database {\n id\n collections {\n c_sku_ {\n items(filter: {f_product_: {eq: $productId}}) {\n id\n f_price_ {\n value\n unit\n __typename\n }\n f_weight_\n f_width_\n f_length_\n f_height_\n f_sku_\n f_main_image_4dr {\n url\n __typename\n }\n f_more_images_4dr {\n url\n alt\n file {\n origFileName\n __typename\n }\n __typename\n }\n f_sku_values_3dr {\n value {\n id\n __typename\n }\n property {\n id\n __typename\n }\n __typename\n }\n inventory {\n type\n quantity\n __typename\n }\n f_compare_at_price_7dr10dr {\n unit\n value\n __typename\n }\n f_ec_sku_billing_method_2dr6dr14dr\n __typename\n }\n __typename\n }\n c_product_ {\n items(filter: {id: {eq: $productId}}) {\n f_default_sku_7dr {\n id\n __typename\n }\n f_ec_product_type_2dr10dr {\n name\n __typename\n }\n __typename\n }\n __typename\n }\n __typename\n }\n commerceMemberships(productIds: [$productId]) {\n productId\n orderId\n active\n __typename\n }\n __typename\n }\n }"})}));const n=yield fetch(`https://${window.location.host}/.wf_graphql/apollo`,{method:"POST",headers:{"content-type":"application/json",Cookie:document.cookie,"X-Wf-Csrf":e||""},body:JSON.stringify(o)});return yield n.json()},new((n=void 0)||(n=Promise))((function(t,a){function i(t){try{l(r.next(t))}catch(t){a(t)}}function c(t){try{l(r.throw(t))}catch(t){a(t)}}function l(e){var o;e.done?t(e.value):(o=e.value,o instanceof n?o:new n((function(t){t(o)}))).then(i,c)}l((r=r.apply(e,o||[])).next())}));var e,o,n,r})(e));const n=r(o),a=o.filter((t=>{var e,o,n;const r=null===(n=null===(o=null===(e=t.data.database.collections)||void 0===e?void 0:e.c_sku_)||void 0===o?void 0:o.items)||void 0===n?void 0:n.map((t=>t.inventory));if(null==r?void 0:r.find((t=>"infinite"===t.type||!!(t.quantity&&t.quantity>0)||void 0)))return!0})),i=t.filter((t=>{const e=t.webflow_funnel_offers[0].webflow_product.default_sku_id;if(a.some((t=>{var o,n,r,a;if((null===(a=null===(r=null===(n=null===(o=t.data.database)||void 0===o?void 0:o.collections)||void 0===n?void 0:n.c_product_.items)||void 0===r?void 0:r[0].f_default_sku_7dr)||void 0===a?void 0:a.id)===e)return!0})))return!0}));return{inStockProductData:a,inStockFunnels:i,productData:o,flattenedWFProductData:n}},new((n=void 0)||(n=Promise))((function(t,r){function i(t){try{l(a.next(t))}catch(t){r(t)}}function c(t){try{l(a.throw(t))}catch(t){r(t)}}function l(e){var o;e.done?t(e.value):(o=e.value,o instanceof n?o:new n((function(t){t(o)}))).then(i,c)}l((a=a.apply(e,o||[])).next())}));var e,o,n,a},i=t=>{try{let e;e=t||window.document;const o=e.querySelectorAll('[data-node-type="commerce-cart-wrapper"]:not([data-fp-cart-clone])')[0],n=e.querySelectorAll('[data-node-type="commerce-cart-wrapper"]'),r=o.querySelectorAll('[data-node-type="commerce-cart-container-wrapper"]')[0],a=e.querySelectorAll('[data-node-type="commerce-cart-container-wrapper"]'),i=e.querySelectorAll('[data-node-type="commerce-cart-container-wrapper"]'),c=e.querySelectorAll('[data-node-type="commerce-checkout-form-container"]')[0],{olElementArray:l,olOpenArray:u,olCloseArray:d}=(t=>{var e,o;const n=Array.from(t.querySelectorAll("[data-fp-ol],[data-fp-ol-component]"));return{olElementArray:n,olOpenArray:null===(e=n[0])||void 0===e?void 0:e.querySelectorAll('[data-fp="open"],[data-fp-ol-open]'),olCloseArray:null===(o=n[0])||void 0===o?void 0:o.querySelectorAll('[data-fp="close"],[data-fp-ol-close]')}})(e),{atcElementArray:s,atcOpenArray:f,atcCloseArray:p}=((t,e)=>{var o,n,r;let a=Array.from(t.querySelectorAll("[data-fp-atc],[data-fp-atc-component]"));const i=t.querySelectorAll('[data-fp="upsell-wrapper"]')[0];i&&i.setAttribute("data-fp-atc","popup"),!e&&i&&a&&!a[0]&&(a=[i]);let c,l=[],u=[],d=[];return a[0]&&(l=Array.from(null===(o=a[0])||void 0===o?void 0:o.querySelectorAll('[data-fp="open"],[data-fp-atc-open]')),u=Array.from(null===(n=a[0])||void 0===n?void 0:n.querySelectorAll('[data-fp="upsell-open"]')),d=Array.from(null===(r=a[0])||void 0===r?void 0:r.querySelectorAll('[data-fp="close"],[data-fp-atc-close]')),c=Array.from(t.querySelectorAll('[data-fp="upsell-close"]'))),!e&&u&&u[0]&&l&&!l[0]&&(l=u),!e&&c&&c[0]&&d&&!d[0]&&(d=c),{atcElementArray:a,atcOpenArray:l,atcCloseArray:d}})(e,c),{ppElementArray:m,ppOpenArray:v,ppCloseArray:y}=((t,e)=>{var o,n,r;let a=Array.from(t.querySelectorAll("[data-fp-pp],[data-fp-pp-component]"));const i=t.querySelectorAll('[data-fp="upsell-wrapper"]')[0];i&&i.setAttribute("data-fp-pp","popup"),e&&i&&a&&!a[0]&&(a=[i]);let c=[],l=[];a[0]&&(c=Array.from(null===(o=a[0])||void 0===o?void 0:o.querySelectorAll('[data-fp="open"],[data-fp-pp-open]')),l=Array.from(null===(n=a[0])||void 0===n?void 0:n.querySelectorAll('[data-fp="upsell-open"]'))),e&&l&&l[0]&&c&&!c[0]&&(c=l);let u=[],d=[];return a[0]&&(u=Array.from(null===(r=a[0])||void 0===r?void 0:r.querySelectorAll('[data-fp="close"],[data-fp-pp-close]')),d=Array.from(t.querySelectorAll('[data-fp="upsell-close"]'))),e&&d&&d[0]&&u&&!u[0]&&(u=d),{ppElementArray:a,ppOpenArray:c,ppCloseArray:u}})(e,c);return{cartWrapper:o,cartWrapperArray:n,cartModal:r,cartModalArray:a,closeCartArray:i,checkoutDiv:c,olElementArray:l,olOpenArray:u,olCloseArray:d,atcElementArray:s,atcOpenArray:f,atcCloseArray:p,ppElementArray:m,ppOpenArray:v,ppCloseArray:y}}catch(t){throw t}};const c=(t,e)=>{return n=void 0,r=void 0,l=function*(){try{const n=t.map((t=>t.skuId)),r=window.FLOWPHANTOM_SITE_ID,{designProductIds:c}=(()=>{const{olElementArray:t,atcElementArray:e,ppElementArray:o}=i();let n=[];return[...t,...e,...o].forEach((t=>t.querySelectorAll("[data-commerce-product-id]").forEach((t=>{const e=t.getAttribute("data-commerce-product-id");e&&n.push(e)})))),n=[...new Set(n)],{designProductIds:n}})(),l=yield fetch(`${o}/api/get-upsells`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({siteId:r,atcProductIds:e,cartSkuIds:n,designProductIds:c})}),u=yield l.json(),d=u.addToCartFunnels,s=u.olFunnels,f=u.ppFunnels,p=u.designProducts,{inStockFunnels:m,inStockProductData:v}=yield a(s),{inStockFunnels:y,inStockProductData:h}=yield a(d),{inStockFunnels:A,inStockProductData:b}=yield a(f);return{addToCartFunnels:y,olFunnels:m,ppFunnels:A,inStockOffers:[...v,...h,...b],designProducts:p}}catch(t){throw t}},new((c=void 0)||(c=Promise))((function(t,e){function o(t){try{i(l.next(t))}catch(t){e(t)}}function a(t){try{i(l.throw(t))}catch(t){e(t)}}function i(e){var n;e.done?t(e.value):(n=e.value,n instanceof c?n:new c((function(t){t(n)}))).then(o,a)}i((l=l.apply(n,r||[])).next())}));var n,r,c,l};const l=()=>{try{const t=[],{cartWrapper:e}=i(),o=null==e?void 0:e.querySelectorAll('[data-wf-cart-action="update-item-quantity"]');return o&&o[0]&&o.forEach((e=>{const o=e.getAttribute("data-commerce-sku-id"),n=e.getAttribute("value");if(o&&n){const e={skuId:o,quantity:n};t.push(e)}})),t}catch(t){throw t}},u=t=>{try{let e="NO_VARIANTS";const o=t.closest('[data-node-type="commerce-add-to-cart-form"]');if(Array.from(null==o?void 0:o.querySelectorAll('[role="group"]')).find((t=>"none"===t.style.display)))return e="NO_VARIANTS";const n=null==o?void 0:o.querySelectorAll('[data-node-type="commerce-add-to-cart-option-select"]'),r=null==o?void 0:o.querySelectorAll('[role="radiogroup"]');return n&&n[0]&&(null==n||n.forEach((t=>{""===t.value&&(e="VARIANTS_NOT_SELECTED")}))),r&&r[0]&&r.forEach((t=>{Array.from(t.querySelectorAll('[data-node-type="commerce-add-to-cart-pill"]')).some((t=>{if("true"===t.getAttribute("aria-checked"))return!0}))||(e="VARIANTS_NOT_SELECTED")})),e}catch(t){throw t}},d=t=>{let e=Array.from(null==t?void 0:t.querySelectorAll('[data-fp-product="offer"]'));return e&&!e[0]&&(e=[],t.querySelectorAll('[role="list"]').forEach((t=>{const o=Array.from(t.querySelectorAll('[role="listitem"]'));null==o||o.forEach((t=>{const o=t.querySelectorAll('[data-node-type="commerce-add-to-cart-button"]');o&&o[0]&&e.push(t)}))}))),{designOfferListItems:e}};let s,f;"undefined"!=typeof window&&(f=window.location.href),s=f&&(null==f?void 0:f.indexOf("storeflow-landing-page.webflow.io"))>-1?"dev":f&&((null==f?void 0:f.indexOf("flowphantom.com"))>-1||(null==f?void 0:f.indexOf("elevatedcollections.com"))>-1)?"staging":"production","production"!==s&&console.log("WEBFLOW_SCRIPT_ENV",s);const p=t=>{try{const{cartModal:e,cartWrapper:o}=i();if(e&&!o&&"production"!==s)throw new Error("Cart modal found without cart wrapper");if(!e&&o&&"production"!==s)throw new Error("Cart wrapper found without cart modal");if(!e||!o)return;{const e=o.hasAttribute("data-cart-open"),n=o.hasAttribute("data-fp-atc-is-open");if(e||n){const e=new MutationObserver((function(o){o.forEach((function(o){if("data-cart-open"==o.attributeName){const n=o.target;null===(null==n?void 0:n.getAttribute("data-cart-open"))&&(t(),e.disconnect())}}))}));e.observe(o,{attributes:!0,childList:!1,subtree:!1})}else t()}}catch(t){throw t}};const m=t=>{return e=void 0,o=void 0,r=function*(){const e=window.FLOWPHANTOM_SITE_ID;window.Webflow.require("commerce").destroy(),window.Webflow.require("commerce").init({siteId:e,apiUrl:"https://render.webflow.com"}),t.forEach((t=>{const e=Array.from(t.querySelectorAll('[data-node-type="commerce-add-to-cart-option-select"]'));null==e||e.forEach((t=>{var e;const o=null===(e=(null==t?void 0:t.getElementsByTagName("option"))[1])||void 0===e?void 0:e.getAttribute("value");o&&(t.value=o||"",t.dispatchEvent(new Event("change")),t.value="")}));const o=t.querySelectorAll('[data-node-type="commerce-add-to-cart-pill-group"]');null==o||o.forEach((t=>{const e=t.querySelectorAll('[data-node-type="commerce-add-to-cart-pill"]');if(e[0]){const t=document.documentElement.scrollTop,o=document.documentElement.scrollLeft;e[0].click(),window.scrollTo(o,t),e[0].blur(),e[0].classList.remove("w--ecommerce-pill-selected"),e[0].setAttribute("aria-checked","false")}}))}))},new((n=void 0)||(n=Promise))((function(t,a){function i(t){try{l(r.next(t))}catch(t){a(t)}}function c(t){try{l(r.throw(t))}catch(t){a(t)}}function l(e){var o;e.done?t(e.value):(o=e.value,o instanceof n?o:new n((function(t){t(o)}))).then(i,c)}l((r=r.apply(e,o||[])).next())}));var e,o,n,r};const v=t=>{return e=void 0,o=void 0,r=function*(){const e=null==t?void 0:t.webflow_funnel_contains.reduce(((t,e)=>{var o;if(null===(o=e.webflow_product)||void 0===o?void 0:o.skus){const o=e.webflow_product.skus.map((t=>t.sku_id));return[...t,...o]}return t}),[]);var o,n,r,a,i;e&&(yield(o=e,n=void 0,r=void 0,a=void 0,i=function*(){if(o.length>0){const t="(^|;)\\s*wf-csrf\\s*=\\s*([^;]+)";function e(){const e=document.cookie.match(t);return e?e.pop():null}const n=e(),r=[];o.forEach((t=>{r.push({operationName:"AddToCart",variables:{skuId:t,count:0,buyNow:!1},query:"mutation AddToCart($skuId: String!, $count: Int!) {\n ecommerceUpdateCartItem(sku: $skuId, count: $count) {\n ok\n itemId\n itemCount\n __typename\n }\n }"})})),yield fetch(`https://${window.location.host}/.wf_graphql/apollo`,{method:"POST",headers:{"content-type":"application/json",Cookie:document.cookie,"X-Wf-Csrf":n||""},body:JSON.stringify(r)}),"/checkout"!==window.location.pathname&&m([])}},new(a||(a=Promise))((function(t,e){function o(t){try{l(i.next(t))}catch(t){e(t)}}function c(t){try{l(i.throw(t))}catch(t){e(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof a?n:new a((function(t){t(n)}))).then(o,c)}l((i=i.apply(n,r||[])).next())}))))},new((n=void 0)||(n=Promise))((function(t,a){function i(t){try{l(r.next(t))}catch(t){a(t)}}function c(t){try{l(r.throw(t))}catch(t){a(t)}}function l(e){var o;e.done?t(e.value):(o=e.value,o instanceof n?o:new n((function(t){t(o)}))).then(i,c)}l((r=r.apply(e,o||[])).next())}));var e,o,n,r};var y=function(t,e,o,n){return new(o||(o=Promise))((function(r,a){function i(t){try{l(n.next(t))}catch(t){a(t)}}function c(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,c)}l((n=n.apply(t,e||[])).next())}))};const h=(t,e)=>y(void 0,void 0,void 0,(function*(){const o=e=>y(void 0,void 0,void 0,(function*(){const o=e.target.dataset.fpFunnelId,n=t.find((t=>t.id===o));n&&"upsell"===n.offer_type&&(yield v(n))}));e.forEach(((e,n)=>{t[n]&&Array.from(e.querySelectorAll('[data-node-type="commerce-add-to-cart-button"]')).forEach((e=>{e.setAttribute("data-fp-funnel-id",t[n].id),e.addEventListener("click",o)}))}))})),A=({cartModal:t,cartWrapper:e})=>{try{if(t&&!e&&"production"!==s)throw new Error("Cart modal found without cart wrapper");if(!t&&e&&"production"!==s)throw new Error("Cart wrapper found without cart modal");if(t&&e){const o=new MutationObserver((function(n){n.forEach((function(n){if("attributes"==n.type&&"data-cart-open"===n.attributeName){const n=t.getAttributeNode("style"),r=e.getAttributeNode("data-cart-open");n&&r&&(e.removeAttributeNode(r),t.removeAttributeNode(n),t.style.display="none",t.style.opacity="1",o.disconnect())}}))}));return o}return}catch(t){throw t}};const b=t=>{return o=void 0,n=void 0,a=function*(){try{const{cartModal:o,cartWrapper:n,atcOpenArray:r,atcElementArray:a}=i();a[0].setAttribute("data-fp-atc-is-open",""),n.setAttribute("data-fp-atc-is-open","");const c=A({cartModal:o,cartWrapper:n});c&&(c.observe(n,{attributes:!0,childList:!0,subtree:!0}),(()=>{try{const{atcCloseArray:t,atcElementArray:o,cartWrapperArray:n}=i(),r=document.querySelectorAll('[data-node-type="commerce-cart-open-link"]')[0],a=()=>{o.forEach((t=>{t.removeAttribute("data-fp-atc-is-open")})),n.forEach((t=>{t.removeAttribute("data-fp-atc-is-open")})),e(r),t.forEach((t=>{t.removeEventListener("click",a)}))},c=r=>{const a=r.target;if("commerce-add-to-cart-button"===a.getAttribute("data-node-type")&&"VARIANTS_NOT_SELECTED"===u(a))return;a.removeEventListener("click",c),o.forEach((t=>{t.removeAttribute("data-fp-atc-is-open")})),n.forEach((t=>{t.removeAttribute("data-fp-atc-is-open")}));const l=a.closest("[data-fp-atc]"),d=null==l?void 0:l.querySelectorAll('[data-node-type="commerce-add-to-cart-button"]');if(d&&d.length>1){const{cartModal:t,cartWrapper:e}=i();if(e.hasAttribute("data-open-product")){const o=A({cartModal:t,cartWrapper:e});o&&o.observe(e,{attributes:!0,childList:!0,subtree:!0})}}else e(t[0])};o[0].querySelectorAll('[data-node-type="commerce-add-to-cart-button"]').forEach((t=>{t.addEventListener("click",c)})),t.forEach((t=>{t.addEventListener("click",a)}))}catch(t){throw t}})(),yield h(t,a),e(r[0]))}catch(t){throw t}},new((r=void 0)||(r=Promise))((function(t,e){function i(t){try{l(a.next(t))}catch(t){e(t)}}function c(t){try{l(a.throw(t))}catch(t){e(t)}}function l(e){var o;e.done?t(e.value):(o=e.value,o instanceof r?o:new r((function(t){t(o)}))).then(i,c)}l((a=a.apply(o,n||[])).next())}));var o,n,r,a},w=(t,e,o,n,a,i)=>{t.forEach(((t,i)=>{var c;const l=null===(c=e[i])||void 0===c?void 0:c.webflow_funnel_offers[0].webflow_product;if(o&&l){const{flattenedDesignProduct:c,flattenedOfferProduct:u}=((t,e,o,n,a)=>{var i,c,l,u,d;const s=null===(i=t.querySelector("[data-commerce-product-id]"))||void 0===i?void 0:i.getAttribute("data-commerce-product-id"),f=e.find((t=>t.webflow_product_id===s)),p=r({[a]:Object.assign(Object.assign({},null==f?void 0:f.json),null==f?void 0:f.skus)}),m=n.find((t=>{var e,n,r,a;if((null===(a=null===(r=null===(n=null===(e=null==t?void 0:t.data)||void 0===e?void 0:e.database)||void 0===n?void 0:n.collections)||void 0===r?void 0:r.c_product_.items)||void 0===a?void 0:a[0].f_default_sku_7dr.id)===(null==o?void 0:o.default_sku_id))return!0}));let v=null===(l=null===(c=null==m?void 0:m.data.database.collections)||void 0===c?void 0:c.c_sku_.items)||void 0===l?void 0:l.find((t=>{var e;if(t.f_sku_===o.default_sku_id&&(null===(e=t.inventory)||void 0===e?void 0:e.quantity)&&t.inventory.quantity>0)return!0}));v||(v=null===(d=null===(u=null==m?void 0:m.data.database.collections)||void 0===u?void 0:u.c_sku_.items)||void 0===d?void 0:d.find((t=>{var e;if((null===(e=t.inventory)||void 0===e?void 0:e.quantity)&&t.inventory.quantity>0)return!0})));const y=r({[a]:Object.assign(Object.assign({inventory:null==v?void 0:v.inventory},null==o?void 0:o.json),null==o?void 0:o.skus)});return{offerProduct:o,flattenedDesignProduct:p,flattenedOfferProduct:y}})(t,o,l,n,i);((t,e,o,n,r,a,i,c)=>{if(a&&i){const t=e.querySelector('[data-node-type="commerce-add-to-cart-form"]');if(t&&(t.style.display=""),!e.getAttribute("fp-cached")){const t=e.querySelectorAll("*"),o=Object.entries(a);for(const e of t)if(!r.find((t=>t.node.isSameNode(e)))){const t={node:e,offerIdx:n,attrs:[]};for(const[n,r]of o)"string"==typeof e.innerHTML&&""!==e.innerHTML&&e.innerHTML===r&&t.attrs.push({attrName:"",innerHTML:!0,valueMutationObjs:[{value:"",mutation:function(t,e,o){o&&o[n]&&(t.innerHTML=o[n])}}]}),Array.from(e.attributes).forEach((e=>{let o=e.value;if(e.name,o.includes("https://assets.website-files.com/")&&(o=o.replace("https://assets.website-files.com/","https://uploads-ssl.webflow.com/")),o===r){(null==t?void 0:t.attrs.find((t=>t.attrName===e.name)))&&(null==t||t.attrs.shift());const o={attrName:e.name,valueMutationObjs:[{value:e.value,mutation:function(t,o,r){r&&r[n]&&("src"===e.name&&t.removeAttribute("srcset"),t.setAttribute(e.name,r[n]))}}]};null==t||t.attrs.push(o)}}));t.attrs[0]&&r.push(t)}}e.setAttribute("fp-cached","true")}r.forEach((e=>{e.offerIdx===n&&e.attrs.forEach((r=>{r.valueMutationObjs.forEach((r=>{r.mutation(e.node,n,i,o,c,t)}))}))})),((t,e)=>{if(e){const o=e.json["sku-properties"],n=Array.from(t.querySelectorAll('[data-node-type="commerce-add-to-cart-option-list"]'));o&&o[0]&&n[0]&&""===n[0].innerHTML&&n.forEach((t=>{t.innerHTML='
'})),o&&o[0]?o&&o[0]&&t.querySelectorAll('[data-node-type="commerce-add-to-cart-option-list"]').forEach((t=>{Array.from(t.querySelectorAll('[role="group"]:not([data-wf-sku-bindings="%5B%7B%22from%22%3A%22f_sku_values_3dr%22%2C%22to%22%3A%22optionValues%22%7D%5D"])')).forEach(((t,e)=>{0===e?t.style.display="block":t.remove()})),t.querySelectorAll("select").forEach((t=>t.setAttribute("required","")))})):null==n||n.forEach((t=>{Array.from(t.querySelectorAll('[role="group"]')).forEach((t=>{t.style.display="none"})),t.querySelectorAll("option").forEach((t=>{t.setAttribute("value","")})),t.querySelectorAll('[data-node-type="commerce-add-to-cart-pill"]').forEach((t=>{t.setAttribute("data-option-id","")})),t.querySelectorAll("select").forEach((t=>t.removeAttribute("required")))})),n.forEach((t=>{const e=Array.from(null==t?void 0:t.querySelectorAll('[role="group"]'))[0];if(e){const n=Array.from(e.querySelectorAll('[data-node-type="commerce-add-to-cart-option-select"]')),r=n[0],a=Array.from(e.querySelectorAll('[role="radiogroup"]')),i=a[0];r&&o&&o[0]&&(null==o||o.forEach((e=>{const o=r.cloneNode(!0);null==o||o.setAttribute("data-commerce-option-set-id",e.id),null==o||o.setAttribute("id",`option-set-${e.id}`),(null==t?void 0:t.querySelectorAll('[data-wf-bindings="%5B%7B%22innerHTML%22%3A%7B%22type%22%3A%22PlainText%22%2C%22filter%22%3A%7B%22type%22%3A%22identity%22%2C%22params%22%3A%5B%5D%7D%2C%22dataPath%22%3A%22name%22%7D%7D%5D"]')).forEach((t=>{t.innerHTML=e.name}));const n=t.getElementsByTagName("option")[0].cloneNode(!0);o.innerHTML="";const a=null==n?void 0:n.cloneNode(!0);a.innerHTML=`Select ${e.name}`,a.setAttribute("selected",""),o.insertBefore(a,o.firstChild),e.enum.forEach((t=>{const e=null==n?void 0:n.cloneNode(!0);e.removeAttribute("selected"),e.setAttribute("value",t.id),e.innerHTML=t.name,null==o||o.appendChild(e)})),r.insertAdjacentElement("beforebegin",o),n.remove()})),null==n||n.forEach((t=>t.remove()))),i&&(null==o||o.forEach((o=>{const n=i.cloneNode(!0);null==n||n.setAttribute("data-commerce-option-set-id",o.id),null==n||n.setAttribute("id",`option-set-${o.id}`),null==n||n.setAttribute("aria-label",o.name),(null==e?void 0:e.querySelectorAll('[data-wf-bindings="%5B%7B%22innerHTML%22%3A%7B%22type%22%3A%22PlainText%22%2C%22filter%22%3A%7B%22type%22%3A%22identity%22%2C%22params%22%3A%5B%5D%7D%2C%22dataPath%22%3A%22name%22%7D%7D%5D"]')).forEach((t=>{t.innerHTML=o.name}));const r=null==n?void 0:n.querySelectorAll('[data-node-type="commerce-add-to-cart-pill"]')[0];r&&n&&(n.innerHTML="",o.enum.forEach((t=>{const e=r.cloneNode(!0);e.setAttribute("data-option-id",t.id);const o=e.querySelectorAll('[data-wf-bindings="%5B%7B%22innerHTML%22%3A%7B%22type%22%3A%22PlainText%22%2C%22filter%22%3A%7B%22type%22%3A%22identity%22%2C%22params%22%3A%5B%5D%7D%2C%22dataPath%22%3A%22name%22%7D%7D%5D"]')[0];o&&(o.innerHTML=t.name),n.appendChild(e)}))),i.insertAdjacentElement("beforebegin",n),t.appendChild(e),null==r||r.remove()})),a.forEach((t=>t.remove())))}}))}})(e,o)})(e[i],t,l,i,a,c,u)}})),p((()=>m([i])))};var _=function(t,e,o,n){return new(o||(o=Promise))((function(r,a){function i(t){try{l(n.next(t))}catch(t){a(t)}}function c(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,c)}l((n=n.apply(t,e||[])).next())}))};const g=t=>{try{const e=document.querySelectorAll(`${t}`);let o;return e.length>1?("production"!==s&&console.log(`Multiple ${t} found`),o=void 0):o=e[0],o}catch(t){throw t}},E=()=>{const t=g('[data-fp="place-order-button-clone"]');null==t||t.setAttribute("data-node-type","commerce-checkout-place-order-button"),null==t||t.removeAttribute("fp-funnel-id"),null==t||t.removeAttribute("fp-funnel-id-backup"),null==t||t.removeAttribute("fp-offer-id"),null==t||t.removeAttribute("fp-offer-id-backup"),null==t||t.removeAttribute("fp-funnel-priority"),null==t||t.removeAttribute("fp-funnel-priority-backup")};const k=(t,o,n)=>{try{const{cartModal:r,cartWrapper:a,ppElementArray:c}=i(),l=c[0];if(r&&!a&&"production"!==s)throw new Error("Cart modal found without cart wrapper");if(!r&&a&&"production"!==s)throw new Error("Cart wrapper found without cart modal");if(r&&a){const r=new MutationObserver((function(i){i.forEach((i=>{return u=this,d=void 0,f=function*(){if("childList"===i.type&&"none"!==window.getComputedStyle(l).display){a.style.display="none";const l=((t,e)=>{try{let o;if("childList"===t.type&&t.addedNodes[0]){const n=e.length+1;t:for(let e=0;e{return c=void 0,l=void 0,d=function*(){var c,l;try{const u=null==a?void 0:a.find((t=>{if(t.id===o)return!0})),d=null===(l=null===(c=null==u?void 0:u.webflow_funnel_offers[0])||void 0===c?void 0:c.webflow_product.skus)||void 0===l?void 0:l.map((t=>t.sku_id)),s=g('[data-node-type="commerce-checkout-place-order-button"]');if(r&&d&&d[0]){const o=g('[data-node-type="commerce-checkout-error-state"]'),{errorStateObserver:r}=(()=>{try{const t=new MutationObserver((function(o){o.forEach((function(){document.querySelectorAll('[data-node-type="commerce-checkout-place-order-button"]')[0].removeAttribute("data-node-type");const o=g('[data-fp="place-order-button-clone"]');o.removeAttribute("fp-funnel-id"),o.removeAttribute("fp-funnel-id-backup"),o.removeAttribute("fp-offer-id"),o.removeAttribute("fp-offer-id-backup"),o.removeAttribute("fp-funnel-priority"),o.removeAttribute("fp-funnel-priority-backup"),o.setAttribute("data-node-type","commerce-checkout-place-order-button");const{ppCloseArray:n}=i(),r=n[0];e(r),t.disconnect()}))}));return{errorStateObserver:t}}catch(t){throw t}})(),a=k(d,n,u);if(r&&a){(o=>{var n,r,a,c;n=void 0,r=void 0,c=function*(){const{ppCloseArray:n}=i();t('[data-node-type="commerce-add-to-cart-button"]').forEach((t=>{"Add to Cart"===t.getAttribute("value")&&t.setAttribute("value","Add to Order"),"Adding to cart..."===t.getAttribute("data-loading-text")&&t.setAttribute("data-loading-text","Completing purchase ...")}));const r=t=>{t.target.removeEventListener("click",r),e(o)};n.forEach((t=>{t.addEventListener("click",r)}))},new((a=void 0)||(a=Promise))((function(t,e){function o(t){try{l(c.next(t))}catch(t){e(t)}}function i(t){try{l(c.throw(t))}catch(t){e(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof a?n:new a((function(t){t(n)}))).then(o,i)}l((c=c.apply(n,r||[])).next())}))})(s);const{cartWrapper:n,ppOpenArray:c}=i();a.observe(n,{attributes:!0,childList:!0,subtree:!0}),r.observe(o,{attributes:!0,childList:!0,subtree:!0}),e(c[0])}}}catch(t){throw t}},new((u=void 0)||(u=Promise))((function(t,e){function o(t){try{r(d.next(t))}catch(t){e(t)}}function n(t){try{r(d.throw(t))}catch(t){e(t)}}function r(e){var r;e.done?t(e.value):(r=e.value,r instanceof u?r:new u((function(t){t(r)}))).then(o,n)}r((d=d.apply(c,l||[])).next())}));var c,l,u,d};const L=(t,e,o,n,r)=>{const{cartWrapper:a,cartModal:c,checkoutDiv:l,ppElementArray:u,ppOpenArray:s,ppCloseArray:f}=i();let p;if(n&&c&&a&&u&&u[0]&&s&&s[0]&&f&&f[0]&&t&&t[0]&&l){if(l&&t&&t[0]){const{placeOrderButtonClone:e}=(t=>{try{let e;const o=document.querySelectorAll('[data-fp="place-order-button-clone"]'),n=g('[data-node-type="commerce-checkout-place-order-button"]');return o[0]?(e=o[0],{placeOrderButtonClone:e,placeOrderButton:n}):(e=n.cloneNode(!0),n.after(e),t.append(n),e.removeAttribute("data-node-type"),e.setAttribute("data-fp","place-order-button-clone"),n.style.display="none",{placeOrderButtonClone:e,placeOrderButton:n})}catch(t){throw t}})(l);((t,e)=>{try{t.removeAttribute("fp-funnel-id"),t.removeAttribute("fp-funnel-id-backup"),t.removeAttribute("fp-offer-id"),t.removeAttribute("fp-offer-id-backup"),t.removeAttribute("fp-funnel-priority"),t.removeAttribute("fp-funnel-priority-backup"),e.forEach((e=>{var o,n;const r=null===(o=e.webflow_funnel_offers[0])||void 0===o?void 0:o.webflow_product.webflow_product_id,a=null===(n=e.webflow_funnel_offers[0])||void 0===n?void 0:n.webflow_product.shippable,i=t.getAttribute("fp-funnel-priority");if("true"===t.getAttribute("fp-offer-requires-shipping")){const o=t.getAttribute("fp-funnel-priority-backup");if(o){const n=parseInt(o,10);n&&n>e.priority&&(t.setAttribute("fp-funnel-id-backup",e.id),t.setAttribute("fp-offer-id-backup",r),t.setAttribute("fp-funnel-priority-backup",`${e.priority}`))}else t.setAttribute("fp-funnel-id-backup",e.id),t.setAttribute("fp-offer-id-backup",r),t.setAttribute("fp-funnel-priority-backup",`${e.priority}`)}else if(i){const o=parseInt(i,10);o&&o>e.priority&&(t.setAttribute("fp-funnel-id",e.id),t.setAttribute("fp-offer-id",r),t.setAttribute("fp-offer-requires-shipping",a?"true":"false"),t.setAttribute("fp-funnel-priority",`${e.priority}`))}else t.setAttribute("fp-funnel-id",e.id),t.setAttribute("fp-offer-id",r),t.setAttribute("fp-offer-requires-shipping",a?"true":"false"),t.setAttribute("fp-funnel-priority",`${e.priority}`)}))}catch(t){throw t}})(e,t)}l&&t&&!t[0]&&E(),p=a=>{return c=void 0,l=void 0,s=function*(){if(!a.target)return;const c=a.target,l=null==c?void 0:c.closest('[data-fp="place-order-button-clone"]');if(!l)return;const{checkoutFormValidity:u}=(()=>{try{const{customerInfoForm:t,additionalCustomerInfoForm:e,billingAddressForm:o,shippingAddressForm:n}=(()=>{try{const t=g('[data-node-type="commerce-checkout-customer-info-wrapper"]'),e=g('[data-node-type="commerce-checkout-additional-info"]'),o=g('[data-node-type="commerce-checkout-billing-address-wrapper"]'),n=g('[data-node-type="commerce-checkout-shipping-address-wrapper"]'),r=n.classList;let a=!0;return r.forEach((t=>{"w-condition-invisible"===t&&(a=!1)})),{customerInfoForm:t,additionalCustomerInfoForm:e,billingAddressForm:o,shippingAddressForm:n,shippingFormVisible:a}}catch(t){throw t}})(),r=[t,e,o,n],{checkoutFormValidity:a}=(t=>{try{let e=!0;for(const o of t)if(o){let t=!0;if("none"!==window.getComputedStyle(o).display&&"hidden"!==window.getComputedStyle(o).visibility||(t=!1),t&&!o.reportValidity()){e=!1;break}}return{checkoutFormValidity:e}}catch(t){throw t}})(r);return{checkoutFormValidity:a}}catch(t){throw t}})();if(!u)return;const s=null==l?void 0:l.getAttribute("fp-offer-requires-shipping");let f,p,m=!0;if("true"===s&&document.querySelector('[data-node-type="commerce-checkout-shipping-address-wrapper"]').classList.forEach((t=>{"w-condition-invisible"===t&&(m=!1)})),"true"!==s||m?(f=null==l?void 0:l.getAttribute("fp-funnel-id"),p=null==l?void 0:l.getAttribute("fp-offer-id")):(f=null==l?void 0:l.getAttribute("fp-funnel-id-backup"),p=null==l?void 0:l.getAttribute("fp-offer-id-backup")),f&&p){const{ppElementArray:a}=i(),{designOfferListItems:c}=d(a[0]);w(c,t,r,e,n,a[0]),S(f,o,p,t)}else E(),l.click()},new((u=void 0)||(u=Promise))((function(t,e){function o(t){try{r(s.next(t))}catch(t){e(t)}}function n(t){try{r(s.throw(t))}catch(t){e(t)}}function r(e){var r;e.done?t(e.value):(r=e.value,r instanceof u?r:new u((function(t){t(r)}))).then(o,n)}r((s=s.apply(c,l||[])).next())}));var c,l,u,s},document.addEventListener("click",p)}return{ppEventListener:p}};const q=(t,e,o,n)=>{return r=void 0,a=void 0,m=function*(){try{t++;const{cartWrapper:r,atcElementArray:a}=i(),f=l();window.fp_cartState=f;const m=a[0],{atcButtons:v,atcProductIds:y}=yield(({atcComponent:t})=>{return e=void 0,o=void 0,r=function*(){try{const e=null==t?void 0:t.querySelectorAll('[data-node-type="commerce-add-to-cart-button"]');e&&e.forEach((t=>{t.setAttribute("data-fp-offer-list-atc-button","")}));const o=Array.from(document.querySelectorAll('[data-node-type="commerce-add-to-cart-button"]:not([data-fp-offer-list-atc-button])')),n=[];return o&&o.forEach((t=>{t.removeAttribute("fp-funnel-id");const e=t.closest('[data-node-type="commerce-add-to-cart-form"]'),o=null==e?void 0:e.getAttribute("data-commerce-product-id");o&&n.push(o)})),{atcButtons:o,atcProductIds:n}}catch(t){throw t}},new((n=void 0)||(n=Promise))((function(t,a){function i(t){try{l(r.next(t))}catch(t){a(t)}}function c(t){try{l(r.throw(t))}catch(t){a(t)}}function l(e){var o;e.done?t(e.value):(o=e.value,o instanceof n?o:new n((function(t){t(o)}))).then(i,c)}l((r=r.apply(e,o||[])).next())}));var e,o,n,r})({atcComponent:m}),{addToCartFunnels:A,olFunnels:g,ppFunnels:E,inStockOffers:k,designProducts:S}=yield c(f,y),{atcEventListener:C}=yield((t,e,o,n,r)=>_(void 0,void 0,void 0,(function*(){const{cartWrapper:a,cartModal:c,atcElementArray:l,atcOpenArray:s,atcCloseArray:f}=i(),m=l[0];let v;return e&&c&&a&&m&&s&&s[0]&&f&&f[0]&&o&&o[0]&&(p((()=>_(void 0,void 0,void 0,(function*(){((t,e)=>{try{t.forEach((t=>{const o=t.closest('[data-node-type="commerce-add-to-cart-form"]'),n=null==o?void 0:o.getAttribute("data-commerce-product-id");t.removeAttribute("fp-funnel-id"),t.removeAttribute("fp-offer-id"),t.removeAttribute("fp-funnel-priority"),n&&e.forEach((e=>{var o,r;const a=e.webflow_funnel_contains,i=null===(r=null===(o=null==e?void 0:e.webflow_funnel_offers[0])||void 0===o?void 0:o.webflow_product)||void 0===r?void 0:r.webflow_product_id;i&&a.forEach((o=>{var r;if((null===(r=null==o?void 0:o.webflow_product)||void 0===r?void 0:r.webflow_product_id)===n){const o=t.getAttribute("fp-funnel-priority");if(o){const n=parseInt(o,10);n&&n>e.priority&&(t.setAttribute("fp-funnel-id",e.id),t.setAttribute("fp-offer-id",i),t.setAttribute("fp-funnel-priority",`${e.priority}`))}else t.setAttribute("fp-funnel-id",e.id),t.setAttribute("fp-offer-id",i),t.setAttribute("fp-funnel-priority",`${e.priority}`)}}))}))}))}catch(t){throw t}})(t,o)})))),v=t=>_(void 0,void 0,void 0,(function*(){if(!t.target)return;const a=t.target,c=null==a?void 0:a.closest('[data-node-type="commerce-add-to-cart-button"]'),l=null==a?void 0:a.closest('[data-node-type="commerce-add-to-cart-form"]');if(!l||!c)return;if("VARIANTS_NOT_SELECTED"===u(c))return;const s=l.getAttribute("data-commerce-product-id"),f=c.getAttribute("fp-funnel-id");if(s&&f){const{atcElementArray:t}=i(),{designOfferListItems:a}=d(t[0]),c=o.filter((t=>t.webflow_funnel_contains.some((t=>t.webflow_product.webflow_product_id===s))));w(a,c,r,n,e,m),yield b(o)}})),document.addEventListener("click",v)),{atcEventListener:v}})))(v,e,A,k,S),{ppEventListener:T}=L(E,k,f,n,S);((t,e,o,n)=>{var r,a,c,l;r=void 0,a=void 0,l=function*(){if(o){const{olElementArray:r}=i(),{designOfferListItems:a}=d(r[0]);w(a,t,n,e,o,r[0]),yield h(t,r)}},new((c=void 0)||(c=Promise))((function(t,e){function o(t){try{i(l.next(t))}catch(t){e(t)}}function n(t){try{i(l.throw(t))}catch(t){e(t)}}function i(e){var r;e.done?t(e.value):(r=e.value,r instanceof c?r:new c((function(t){t(r)}))).then(o,n)}i((l=l.apply(r,a||[])).next())}))})(g,k,o,S);const O=(({counter:t,cachedATCNodes:e,atcEventListener:o,cachedOLNodes:n,cachedPPNodes:r,ppEventListener:a})=>{try{const{cartWrapper:c,cartModal:u}=i();if(u&&!c&&"production"!==s)throw new Error("Cart modal found without cart wrapper");if(!u&&c&&"production"!==s)throw new Error("Cart wrapper found without cart modal");if(u&&c){const i=new MutationObserver((function(c){c.forEach((function(c){if("childList"===c.type){const c=l(),u=window.fp_cartState;if(u){const l=c.sort(),d=u.sort();JSON.stringify(l)!==JSON.stringify(d)&&(o&&document.removeEventListener("click",o),a&&document.removeEventListener("click",a),q(t,e,n,r),i.disconnect())}}}))}));return i}return}catch(t){throw t}})({counter:t,cachedATCNodes:e,atcEventListener:C,cachedOLNodes:o,cachedPPNodes:n,ppEventListener:T});O&&O.observe(r,{attributes:!0,childList:!0,subtree:!0})}catch(t){throw t}},new((f=void 0)||(f=Promise))((function(t,e){function o(t){try{i(m.next(t))}catch(t){e(t)}}function n(t){try{i(m.throw(t))}catch(t){e(t)}}function i(e){var r;e.done?t(e.value):(r=e.value,r instanceof f?r:new f((function(t){t(r)}))).then(o,n)}i((m=m.apply(r,a||[])).next())}));var r,a,f,m};const C=()=>[{attrName:"data-fp",valueMutationObjs:[{value:"prompt",innerHTML:!0,mutation:function(t,e,o,n,r,a){var i,c,l;let u=null===(i=t.parentNode)||void 0===i?void 0:i.querySelector("[data-fp='default-prompt']");u||(u=t.cloneNode(!0),u.setAttribute("data-fp","default-prompt"),u.classList.add("fp-hidden"),t.insertAdjacentElement("afterend",u)),a&&(null===(c=a.webflow_funnel_prompts[0])||void 0===c?void 0:c.prompt)?(u.classList.add("fp-hidden"),t.classList.remove("fp-hidden"),t.innerHTML=null===(l=a.webflow_funnel_prompts[0])||void 0===l?void 0:l.prompt):(u.classList.remove("fp-hidden"),t.classList.add("fp-hidden"))}}]},{attrName:"data-wf-sku-bindings",valueMutationObjs:[{value:"%5B%7B%22from%22%3A%22f_price_%22%2C%22to%22%3A%22innerHTML%22%7D%5D",innerHTML:!0,mutation:(t,e,o)=>{if(o&&o[`${e}.0.json.price.unit`]&&o[`${e}.0.json.price.value`]){const n=Intl.NumberFormat(navigator.language,{style:"currency",currency:o?o[`${e}.0.json.price.unit`]:"USD",minimumFractionDigits:window.__WEBFLOW_CURRENCY_SETTINGS.fractionDigits}).format(o[`${e}.0.json.price.value`]/100);t.innerHTML=n}}},{value:"%5B%7B%22from%22%3A%22f_compare_at_price_7dr10dr%22%2C%22to%22%3A%22innerHTML%22%7D%5D",innerHTML:!0,mutation:(t,e,o)=>{if(o&&o[`${e}.0.json.compare-at-price.unit`]&&o[`${e}.0.json.compare-at-price.value`]){const n=Intl.NumberFormat(navigator.language,{style:"currency",currency:o?o[`${e}.0.json.compare-at-price.unit`]:"USD",minimumFractionDigits:window.__WEBFLOW_CURRENCY_SETTINGS.fractionDigits}).format(o[`${e}.0.json.compare-at-price.value`]/100);t.innerHTML=n}}},{value:"%5B%7B%22from%22%3A%22ecSkuInventoryQuantity%22%2C%22to%22%3A%22innerHTML%22%7D%5D",innerHTML:!0,mutation:(t,e,o)=>{o&&o[`${e}.inventory.quantity`]&&o[`${e}.inventory.quantity`]>0&&(t.innerHTML=o[`${e}.inventory.quantity`])}},{value:"%5B%7B%22from%22%3A%22f_sku_%22%2C%22to%22%3A%22innerHTML%22%7D%5D",innerHTML:!0,mutation:function(t,e,o){o&&o[`${e}.0.json.sku`]&&(t.innerHTML=o[`${e}.0.json.sku`])}},{value:"%5B%7B%22from%22%3A%22f_length_%22%2C%22to%22%3A%22innerHTML%22%7D%5D",innerHTML:!0,mutation:function(t,e,o){o&&o[`${e}.0.json.length`]&&(t.innerHTML=o[`${e}.0.json.length`])}},{value:"%5B%7B%22from%22%3A%22f_width_%22%2C%22to%22%3A%22innerHTML%22%7D%5D",innerHTML:!0,mutation:function(t,e,o){o&&o[`${e}.0.json.width`]&&(t.innerHTML=o[`${e}.0.json.width`]?o[`${e}.0.json.width`]:"")}},{value:"%5B%7B%22from%22%3A%22f_height_%22%2C%22to%22%3A%22innerHTML%22%7D%5D",innerHTML:!0,mutation:function(t,e,o){o&&o[`${e}.0.json.height`]&&(t.innerHTML=o[`${e}.0.json.height`])}},{value:"%5B%7B%22from%22%3A%22f_weight_%22%2C%22to%22%3A%22innerHTML%22%7D%5D",innerHTML:!0,mutation:function(t,e,o){o&&o[`${e}.0.json.weight`]&&(t.innerHTML=o[`${e}.0.json.weight`])}},{value:"%5B%7B%22from%22%3A%22f_main_image_4dr%22%2C%22to%22%3A%22src%22%7D%5D",mutation:function(t,e,o){o&&o[`${e}.0.json.main-image.url`]&&(t.setAttribute("src",o[`${e}.0.json.main-image.url`]),t.removeAttribute("srcset")),o&&o[`${e}.0.json.main-image.alt`]&&t.setAttribute("alt",o[`${e}.0.json.main-image.alt`])}},{value:"%5B%7B%22from%22%3A%22f_main_image_4dr.url%22%2C%22to%22%3A%22style.background-image%22%7D%5D",mutation:function(t,e,o){o&&o[`${e}.0.json.main-image.url`]&&(t.style.backgroundImage=`url("${o[`${e}.0.json.main-image.url`]}")`)}}]},{attrName:"data-commerce-sku-id",valueMutationObjs:[{value:"",mutation:function(t,e,o,n){n&&n.default_sku_id&&(null==t||t.setAttribute("data-commerce-sku-id",`${n.default_sku_id}`))}}]},{attrName:"data-commerce-product-id",valueMutationObjs:[{value:"",mutation:function(t,e,o){o&&o[`${e}.product._id`]&&(null==t||t.setAttribute("data-commerce-product-id",`${o[`${e}.product._id`]}`))}}]},{attrName:"data-commerce-product-sku-values",valueMutationObjs:[{value:"",mutation:function(t,e,o,n){var r,a,i;if(n&&n.json["sku-properties"]){const e=n.json["sku-properties"];let o="{}";e&&e[0]&&(o=`{"${null===(r=e[0])||void 0===r?void 0:r.id}": "${null===(i=null===(a=e[0])||void 0===a?void 0:a.enum[0])||void 0===i?void 0:i.id}}`);const c=encodeURIComponent(o);null==t||t.setAttribute("data-commerce-product-sku-values",`${c}`)}}}]},{attrName:"href",valueMutationObjs:[{value:"",mutation:function(t,e,o){if(o&&o[`${e}.product.slug`]){const n=t.getAttribute("href");(null==n?void 0:n.includes("/product/"))&&!(null==n?void 0:n.includes(`/product/${o[`${e}.product.slug`]}`))&&t.setAttribute("href",`/product/${o[`${e}.product.slug`]}`)}}}]},{attrName:"data-fp-product",valueMutationObjs:[{value:"name",mutation:function(t,e,o){o&&o[`${e}.name`]&&(t.innerHTML=o[`${e}.name`])}},{value:"atc",mutation:function(t,e,o,n,r){if(r&&o&&o[`${e}.default-sku`]){const e=o=>{return n=this,a=void 0,c=function*(){var n,a;o.preventDefault();const i=t.closest('[data-fp-product="offer"]');if(!i)return;const c=Array.from(i.querySelectorAll('[data-node-type="commerce-add-to-cart-option-select"]')),l=[];null==c||c.forEach((t=>l.push(t.value)));const u=null===(a=null===(n=r.data.database.collections)||void 0===n?void 0:n.c_sku_.items)||void 0===a?void 0:a.filter((t=>{var e;return null===(e=t.f_sku_values_3dr)||void 0===e?void 0:e.every((t=>{if(t)return l.includes(null==t?void 0:t.value.id)}))}));if(u&&u[0]){const o=c.every((t=>t.reportValidity()));o&&(yield(v=[u[0].id],d=void 0,s=void 0,f=void 0,p=function*(){const t=function(){const t=document.cookie.match("(^|;)\\s*wf-csrf\\s*=\\s*([^;]+)");return t?t.pop():null}(),e=[];v.forEach((t=>{e.push({operationName:"AddToCart",variables:{skuId:t,count:1,buyNow:!1},query:"mutation AddToCart($skuId: String!, $count: Int!, $buyNow: Boolean) {\n ecommerceAddToCart(sku: $skuId, count: $count, buyNow: $buyNow) {\n ok\n itemId\n itemCount\n itemPrice {\n unit\n decimalValue\n __typename\n }\n __typename\n }\n }\n "})})),yield fetch(`https://${window.location.host}/.wf_graphql/apollo`,{method:"POST",headers:{"content-type":"application/json",Cookie:document.cookie,"X-Wf-Csrf":t||""},body:JSON.stringify(e)}),m([])},new(f||(f=Promise))((function(t,e){function o(t){try{r(p.next(t))}catch(t){e(t)}}function n(t){try{r(p.throw(t))}catch(t){e(t)}}function r(e){var r;e.done?t(e.value):(r=e.value,r instanceof f?r:new f((function(t){t(r)}))).then(o,n)}r((p=p.apply(d,s||[])).next())}))),t.removeEventListener("click",e))}var d,s,f,p,v},new((i=void 0)||(i=Promise))((function(t,e){function o(t){try{l(c.next(t))}catch(t){e(t)}}function r(t){try{l(c.throw(t))}catch(t){e(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof i?n:new i((function(t){t(n)}))).then(o,r)}l((c=c.apply(n,a||[])).next())}));var n,a,i,c};t.addEventListener("click",e)}}},{value:"option-list",mutation:function(t){t.innerHTML=' '}}]}],T=t=>{const{designOfferListItems:e}=d(t[0]),o=C(),n=[];return e.forEach(((t,e)=>{t.querySelectorAll("*").forEach((t=>{const r=Array.from(t.attributes);o.forEach((o=>{const a=r.find((t=>{if(t.name===o.attrName&&o.valueMutationObjs.find((e=>e.value===t.value)))return!0}));if(a){const r=o.valueMutationObjs.find((t=>t.value===a.value));if(r){const o=n.find((e=>e.node.isSameNode(t)));if(o){const t=o.attrs.find((t=>{t.attrName,a.name}));null==t||t.valueMutationObjs.push(r)}else n.push({node:t,offerIdx:e,attrs:[{attrName:a.name,valueMutationObjs:[r]}]})}}}))}))})),n};var O=function(t,e,o,n){return new(o||(o=Promise))((function(r,a){function i(t){try{l(n.next(t))}catch(t){a(t)}}function c(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,c)}l((n=n.apply(t,e||[])).next())}))};document.onreadystatechange=function(){return o=this,n=void 0,a=function*(){"complete"===document.readyState&&(O(void 0,void 0,void 0,(function*(){let t=0;document.styleSheets[0].insertRule(".fp-hidden { display: none !important; }",0);const e=setInterval((()=>O(void 0,void 0,void 0,(function*(){try{const{cartModal:o,cartWrapper:n,atcElementArray:r,olElementArray:a,ppElementArray:c}=i();if(t++,o&&n){clearInterval(e);const t=r[0]?T(r):null,o=a[0]?T(a):null,n=c[0]?T(c):null;q(0,t,o,n)}else t>50&&clearInterval(e)}catch(t){clearInterval(e)}}))),50)})),(()=>{const o=setInterval((()=>{return n=void 0,r=void 0,i=function*(){try{const n=t('[data-fp="clear-cart"]');if(n){clearInterval(o);const r=()=>{const o=t('[data-wf-cart-action="remove-item"]');for(let t=0;t{t.addEventListener("click",r)}))}}catch(t){throw clearInterval(o),t}},new((a=void 0)||(a=Promise))((function(t,e){function o(t){try{l(i.next(t))}catch(t){e(t)}}function c(t){try{l(i.throw(t))}catch(t){e(t)}}function l(e){var n;e.done?t(e.value):(n=e.value,n instanceof a?n:new a((function(t){t(n)}))).then(o,c)}l((i=i.apply(n,r||[])).next())}));var n,r,a,i}),50)})())},new((r=void 0)||(r=Promise))((function(t,e){function i(t){try{l(a.next(t))}catch(t){e(t)}}function c(t){try{l(a.throw(t))}catch(t){e(t)}}function l(e){var o;e.done?t(e.value):(o=e.value,o instanceof r?o:new r((function(t){t(o)}))).then(i,c)}l((a=a.apply(o,n||[])).next())}));var o,n,r,a}})();
//# sourceMappingURL=index.bundle.js.map