(${n})`;null==a||a.insertAdjacentHTML("beforeend",o),r.dataset.initialized=!0}}addWindowEventsToDOM(){const e=this;if("shopify_checkout"===e.data.config.type){e.eventHandlers.productRemoveClick=t=>{if(t.target.classList.contains("product__remove")){const n=t.target,r=n.dataset.index,i=e.data.config.language.removing_from_cart;n.innerHTML=`(${i})`,e.removeFromCartAtIndex(r)}};const t=c.DOM.select(".order-summary__section");c.DOM.off("click",e.eventHandlers.productRemoveClick,null,t),c.DOM.on("click",e.eventHandlers.productRemoveClick,null,t)}if("recharge_checkout"===e.data.config.type){e.eventHandlers.productRemoveClick=t=>{if(t.target.classList.contains("product__remove")){const n=t.target,r=n.dataset.index;n.innerHTML="(Removing...)",e.removeFromReChargeCartAtIndex(r)}};const t=c.DOM.select(".order-summary__section--product-list");c.DOM.off("click",e.eventHandlers.productRemoveClick,null,t),c.DOM.on("click",e.eventHandlers.productRemoveClick,null,t)}c.DOM.off("resize",e.eventHandlers.windowResize,null,window),c.DOM.on("resize",e.eventHandlers.windowResize,null,window)}refreshShopifyCheckout(e){const t=this;if(S.Y.isShopifyCheckout()){if(t.polling.summary>t.polling.summary_max_attempts)return console.warn("= = = POLLING COUNT EXHAUSTED: Widget.refreshShopifyCheckout = = ="),t.polling.summary=0,!1;t.polling.summary+=1,e=e||function(){};const n=(0,c.urlAddParameter)(window.location.href,"t",(0,c.timestamp)());fetch(n).then((e=>e.text())).then((n=>{const r=".order-summary__section.order-summary__section--product-list",i=".order-summary__section.order-summary__section--total-lines",a=".order-summary-toggle__total-recap.total-recap",o=".order-summary__section .total-line.total-line--recurring-total",s=n,l=c.DOM.select(r,s).innerHTML,u=c.DOM.select(i,s).innerHTML,d=c.DOM.select(a,s).innerHTML;c.DOM.select(r).innerHTML=l,c.DOM.select(i).innerHTML=u,c.DOM.select(a).innerHTML=d,t.decoratePromotionalProducts(),t.decorateOrderSummary(),t.refreshShopifyCheckoutShipping();if(p.Z.cartHasSubscriptionItems()!==!!c.DOM.select(o,s).length)return t.refreshShopifyCheckout(e),!1;t.polling.summary=0,e(),h.Widget.callbacks.refresh(t)})).catch((n=>{console.error("= = = ERROR: Widget.refreshShopifyCheckout = = =",n),t.refreshShopifyCheckout(e)}))}}refreshShopifyAlternativePayments(e){const t=this;if(e=e||function(){},S.Y.isShopifyCheckout()&&"contact_information"===S.Y.getShopifyCheckoutStep()){const n={alternative_payments:"[data-alternative-payments]",loading:".dynamic-checkout.dynamic-checkout--loading"};if(t.polling.alt_payments>t.polling.alt_payments_max_attempts)return console.warn("= = = POLLING COUNT EXHAUSTED: Widget.refreshShopifyAlternativePayments = = ="),c.DOM.select(n.alternative_payments).style.display="none",t.polling.alt_payments=0,!1;t.polling.alt_payments+=1;if(c.DOM.selectAll(n.loading).length>0){let e=new CustomEvent("lineItemsChanged",{detail:null});document.dispatchEvent(e),e=new CustomEvent("shopify:block:select",{detail:null}),document.dispatchEvent(e),clearTimeout(t.polling.alt_payments_timer),t.polling.alt_payments_timer=setTimeout((function(){t.refreshShopifyAlternativePayments()}),1e3)}else t.polling.alt_payments=0,e(),h.Widget.callbacks.alternativePaymentsRefresh(t)}}refreshShopifyCheckoutShipping(e){const t=this;if(S.Y.isShopifyCheckout()&&"payment_method"===S.Y.getShopifyCheckoutStep()){const n=(0,c.urlAddParameter)(window.location.pathname+"?step=shipping_method","t",(0,c.timestamp)());fetch(n).then((e=>e.text())).then((n=>{const r='input[name="checkout[shipping_rate][id]"]',i=".section.section--shipping-method",a=".order-summary__section .total-line.total-line--taxes",o="[data-shipping-warning]",s=n,l=c.DOM.select(i,s),u=c.DOM.select(a,s).innerHTML;c.DOM.select(a).innerHTML=u;const d=c.DOM.select(a);d.classList.contains("hidden")&&d.classList.remove("hidden");const p=c.DOM.select(r,l);if(c.DOM.select(o,l)&&p){const n=l.closest("form").parentElement.innerHTML;var f;if(1!==c.DOM.select("#shipping-method-options").length)null==(f=c.DOM.select("body"))||f.insertAdjacentHTML("beforeend",'