1window.BAO.sectionRenderer=new class{async fetch(sections,sectionsUrl=this.sectionsUrl){typeof sections=="string"&&(sections=[sections]);const[path,querystring=""]=sectionsUrl.split("?"),params=new URLSearchParams(querystring);return params.append("sections",sections.join(",")),(await fetch(`${path}?${params.toString()}`)).json()}async fetchSingle(section,sectionsUrl=window.location.pathname){const[path,querystring=""]=sectionsUrl.split("?"),params=new URLSearchParams(querystring);return params.set("section_id",section),(await fetch(`${path}?${params.toString()}`)).text()}render(section){if("dontRender"in section&§ion.dontRender)return;this.validate(section);const elementToReplace=document.getElementById(section.id)?.querySelector(section.selector)||document.getElementById(section.id);if(!elementToReplace){console.info(`Can't find ${section.id} even though we are trying to render it`);return}const newHTML=this.getOuterHtml(section.html,{id:section.id,selector:section.selector}),oldHTML=elementToReplace.outerHTML;elementToReplace.outerHTML=typeof section.convertor=="function"?section.convertor(oldHTML,newHTML):newHTML,this.scheduleAffirmRefresh()}renderMultiple(sections){sections.forEach(section=>this.render(section)),this.scheduleAffirmRefresh()}scheduleAffirmRefresh(){this._affirmRefreshScheduled||(this._affirmRefreshScheduled=!0,requestAnimationFrame(()=>{try{typeof window<"u"&&window.affirm&&window.affirm.ui&&typeof window.affirm.ui.refresh=="function"&&window.affirm.ui.refresh()}finally{this._affirmRefreshScheduled=!1}}))}getOuterHtml(html,{id="",selector=".shopify-section"}={}){const dom=this.convertToDOM(html);return(dom.getElementById(id)?.querySelector(selector)||dom.getElementById(id))?.outerHTML}convertToDOM(html){return new DOMParser().parseFromString(html,"text/html")}validate(section){const isValid=this.expectedKeys.every(key=>key in section);if(!isValid)throw new Error(`section is missing these keys: "${this.expectedKeys.filter(k=>!(k in section)).join(", ")}"`);return isValid}get expectedKeys(){return["id","selector","html"]}get pushCartSections(){return[{id:"navbar-cart-count",section:"navbar",selector:'[data-cart-count-el="navbar-count"]'},{id:"push-cart-title-count",section:"push-cart",selector:'[data-push-cart-el="title-count"]'},{id:"push-cart-items",section:"push-cart",selector:'[data-push-cart-el="items"]'},{id:"push-cart-notification",section:"push-cart",selector:'[data-push-cart-el="notification"]'},{id:"push-cart-footer",section:"push-cart",selector:'[data-push-cart-el="footer"]'}]}get cartSections(){return[{id:"navbar-cart-count",section:"navbar",selector:'[data-cart-count-el="navbar-count"]'},{id:"template-cart-header",section:"template-cart",selector:'[data-template-cart-el="header-title"]'},{id:"template-cart-items",section:"template-cart",selector:'[data-template-cart-el="items"]'},{id:"template-cart-summary",section:"template-cart",selector:'[data-template-cart-el="summary"]'}]}get swatchBuilderMoreInfoSections(){return[{id:"template-swatch-builder-more-info-header",section:"swatch-builder-more-info",selector:'[data-swatch-builder-more-info-el="header"]'},{id:"template-swatch-builder-more-info",section:"swatch-builder-more-info",selector:'[data-swatch-builder-more-info-el="content"]'},{id:"template-swatch-builder-more-info-footer",section:"swatch-builder-more-info",selector:'[data-swatch-builder-more-info-el="footer"]'}]}get swatchBuilderFixedBarSections(){return[{id:"swatch-builder-fixed-bar-content",section:"bao-swatch-builder-grid",selector:'[data-swatch-builder-fixed-bar-el="content"]'}]}get sectionsUrl(){return`${window.location.pathname}${window.location.search}`}}; 2//# sourceMappingURL=/cdn/shop/t/105/assets/bao-section-rendering.js.map?v=17832550391134152091768387183
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.