https://www.worldofbooks.com/cdn/shop/t/183/assets/membership-add-…?v=104488175044993363131789135490
1function createAddToCartForm(f,g,w,v){const u=document.querySelector(`.${f}-price-button`);if(u.dataset.productInCart==="true")return;const t=document.createElement("form");t.method="post",t.action="/en-gb/cart/add",t.id="product-form-template--24116462092561__main",t.acceptCharset="UTF-8",t.classList.add("form"),t.enctype="multipart/form-data",t.setAttribute("novalidate","novalidate"),t.setAttribute("data-type","add-to-cart-form");const C=[{type:"hidden",name:"form_type",value:"product"},{type:"hidden",name:"utf8",value:"\u2713"},{type:"hidden",name:"id",value:"51264739344657",class:"product-variant-id"},{type:"hidden",name:"product-id",value:"10338952151313"},{type:"hidden",name:"section-id",value:"template--24116462092561__main"},{type:"hidden",name:"selling_plan",value:"12369232145"},{type:"hidden",name:"sections",value:"cart-notification-product,cart-notification-button,cart-icon-bubble"},{type:"hidden",name:"sections_url",value:"/en-gb/products/world-of-books-plus-1"}];for(const e of C){const s=document.createElement("input");Object.assign(s,{type:e.type,name:e.name,value:e.value}),e.class&&s.classList.add(e.class),t.appendChild(s)}const p=document.createElement("div");p.classList.add("product-form__buttons");const n=document.createElement("button");n.id="ProductSubmitButton-template--24116462092561__main",n.type="submit",n.name="add",n.classList.add("product-form__submit","button","button--fullwidth","button--primary","promo-button"),Object.assign(n.style,{width:"160px",marginBottom:"0"});const l=document.createElement("span");l.textContent=u.dataset.buttonText;const m=document.createElement("div");m.classList.add("loading-overlay__spinner","hidden");const a=document.createElementNS("http://www.w3.org/2000/svg","svg");a.setAttribute("aria-hidden","true"),a.setAttribute("focusable","false"),a.classList.add("spinner"),a.setAttribute("viewBox","0 0 66 66"),a.setAttribute("xmlns","http://www.w3.org/2000/svg");const r=document.createElementNS("http://www.w3.org/2000/svg","circle");r.classList.add("path"),r.setAttribute("fill","none"),r.setAttribute("stroke-width","6"),r.setAttribute("cx","33"),r.setAttribute("cy","33"),r.setAttribute("r","30"),a.appendChild(r),m.appendChild(a),n.appendChild(l),n.appendChild(m),p.appendChild(n);const o=document.createElement("div");o.classList.add("product-form__error-message-wrapper"),o.setAttribute("role","alert"),o.setAttribute("hidden","");const i=document.createElementNS("http://www.w3.org/2000/svg","svg");i.setAttribute("xmlns","http://www.w3.org/2000/svg"),i.setAttribute("width","24"),i.setAttribute("height","24"),i.setAttribute("viewBox","0 0 24 24"),i.setAttribute("fill","none");const d=document.createElementNS("http://www.w3.org/2000/svg","path");d.setAttribute("d","M12 16H12.01M12 8V12M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"),d.setAttribute("stroke","#BD0000"),d.setAttribute("stroke-width","2"),d.setAttribute("stroke-miterlimit","3.8637"),d.setAttribute("stroke-linecap","square"),i.appendChild(d),o.appendChild(i);const h=document.createElement("span");h.classList.add("product-form__error-message"),o.appendChild(h),t.appendChild(p),t.appendChild(o),u.appendChild(t);const A=()=>{t.remove();const e=document.createElement("a");e.href=w,e.classList.add(...g),e.textContent=v,u.appendChild(e)};subscribe("membership-cta-clicked",A),t.addEventListener("submit",e=>{e.preventDefault(),n.disabled=!0;const s=t.querySelector(".loading-overlay__spinner");s.classList.remove("hidden"),l.textContent="";const b=new FormData(t);fetch(t.action,{method:t.method,body:b,headers:{Accept:"application/javascript","Accept-Language":"en-US,en;q=0.9,hu;q=0.8,da;q=0.7","X-Requested-With":"XMLHttpRequest"},credentials:"include"}).then(c=>{if(!c.ok)throw new Error("Failed to add product to cart");return c.json()}).then(c=>{document.querySelector("cart-notification").renderContents(c),typeof publish=="function"&&typeof PUB_SUB_EVENTS<"u"&&publish(PUB_SUB_EVENTS.cartUpdate,{source:"membership-add-to-cart-button",productVariantId:b.get("id"),cartData:c})}).catch(()=>{}).finally(()=>{publish("membership-cta-clicked"),n.disabled=!1,s.classList.add("hidden")})})} 2//# sourceMappingURL=membership-add-to-cart-button.js.map
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.