PageSourceSearch

https://www.hbgresources.com/wp-content/themes/hachette-book-group…?ver=a40a77ffbd0528787dcc

js hbgresources.com collected 2026-10-06 13:04:17 UTC 10,665 bytes, 2 lines download raw bytes

1!function(){var t={432:function(){const{hostname:t}=window.location;let n="shop.hachettebookgroup.com",e="fdf7a12aac6fc02a21b014e8b569ad8a",o=7655547470002;"hbg-develop.go-vip.co"!==t&&"hbglocal.vipdev.lndo.site"!==t&&"dev.novelsuspects.com"!==t||(n="hbgusadev.myshopify.com/",e="47e8b2f8bcd90ed1007965c47234e5e6",o=8250823901359);const r=Object.entries(window).filter((t=>{let[n]=t;return n.startsWith("addToCart_")}));let a={},i="";function c(t,n,e){n&&braze.getUser().addToCustomAttributeArray(t,n+e)}function d(t,n,e){if(arguments.length>3&&void 0!==arguments[3]&&arguments[3])for(let o=0;o<n.length;o+=1)c(t,n[o],e);else c(t,n,e)}function s(t){var n=0,e=0,o=t.lineItems.length;for(let o=0;o<t.lineItems.length;++o){var r=t.lineItems[o];n=t.lineItems[o].quantity+n,e+=parseFloat(t.lineItems[o].variant.price.amount||0)*r.quantity}o=n,document.getElementById("cart-count").textContent=o>0?o:"0";var a=document.querySelector(".shopify-buy__cart__subtotal__price");a&&(a.innerHTML=e>0?"$"+e.toFixed(2):"$0.00")}function u(t,o,r){const c=document.getElementById(`product-component-add-to-cart${o}`);let u="";u=c?getComputedStyle(c).getPropertyValue("--color-accent"):"#d93a17";const l=ShopifyBuy.buildClient({domain:n,storefrontAccessToken:e});ShopifyBuy.UI.onReady(l).then((r=>{document.querySelector("#shopify-cart").addEventListener("click",(t=>{t.stopPropagation(),r.openCart()})),r.createComponent("product",{id:t,node:document.getElementById(`product-component-add-to-cart${o}`),moneyFormat:"%24%7B%7Bamount%7D%7D",options:{product:{classes:{button:"title-add-to-cart__button title-add-to-cart__button--fill"},iframe:!1,DOMEvents:{"click .shopify-buy__btn-wrapper":function(){""!==function(t){const n=`; ${document.cookie}`.split("; brazeUser=");return 2===n.length?n.pop().split(";").shift():""}()&&function(){const t=function(t){const n=new URL(t);return{name:n.searchParams.get("utm_campaign"),source:n.searchParams.get("utm_source"),medium:n.searchParams.get("utm_medium")}}(window.location.href),n=document.querySelector("#hachetteJsonLinkingData"),e=JSON.parse(n.innerText),o=" (atc)";d("ISBNs",e.isbn,o),d("Referral Titles",e.name,o),d("Referral Authors",e.author,o,!0),d("Product Formats",e.bookFormat.name,o),d("Series Name",e.series,o),d("Publisher",e.publisher.name,o),d("Campaign Name",t.name,o),d("Campaign Sources",t.source,o),d("Campaign Media",t.medium,o),d("Genre",e.genre,o,!0)}()}},styles:{product:{"@media (min-width: 601px)":{"max-width":"calc(25% - 20px)","margin-left":"20px","margin-bottom":"50px"}},button:a,quantityInput:{"font-size":"16px","padding-top":"16px","padding-bottom":"16px"}},contents:{img:!1,title:!1,price:!1,button:"000000000000"!==o},text:{button:i}},productSet:{styles:{products:{"@media (min-width: 601px)":{"margin-left":"-20px"}}}},modalProduct:{contents:{img:!1,imgWithCarousel:!0,button:!1,buttonWithQuantity:!0},styles:{product:{"@media (min-width: 601px)":{"max-width":"100%","margin-left":"0px","margin-bottom":"0px"}},button:{"font-weight":"bold","font-size":"16px","padding-top":"16px","padding-bottom":"16px",":hover":{"background-color":"#cb2f21"},"background-color":"#e13425",":focus":{"background-color":"#cb2f21"}},quantityInput:{"font-size":"16px","padding-top":"16px","padding-bottom":"16px"}},text:{button:i}},option:{},cart:{iframe:!1,events:{updateItemQuantity:function(t){s(t)},beforeRender(){},afterRender:function(t){s(t),jQuery(".shopify-buy__cart__title").after('<div id="freeShippingMsg"></div>'),async function(){let t=await async function(){const t=function(){for(let t=0;t<localStorage.length;t++){const n=localStorage.key(t);if(n&&n.endsWith(".checkoutId"))return localStorage.getItem(n)}return null}();if(!t)return void console.warn("Cart ID (checkoutId) not found.");const o=await fetch(`https://${n}/api/2025-01/graphql.json`,{method:"POST",headers:{"X-Shopify-Storefront-Access-Token":e,"Content-Type":"application/json"},body:JSON.stringify({query:"\n\n    query GetCartItems($cartId: ID!) {\n\n      cart(id: $cartId) {\n\n        id\n\n        lines(first: 50) {\n\n          edges {\n\n            node {\n\n              id\n\n              quantity\n\n              cost {\n\n                totalAmount {\n\n                  amount\n\n                  currencyCode\n\n                }\n\n              }\n\n              merchandise {\n\n                ... on ProductVariant {\n\n                  id\n\n                  title\n\n                  price {\n\n                    amount\n\n                    currencyCode\n\n                  }\n\n                  product {\n\n                    id\n\n                    title\n\n                    productType\n\n                  }\n\n                }\n\n              }\n\n            }\n\n          }\n\n        }\n\n      }\n\n    }\n\n  ",variables:{cartId:t}})}),r=await o.json(),a=r?.data?.cart?.lines?.edges||[];let i=0;return a.forEach((t=>{let{node:n}=t;const e=n.merchandise.product,o=n.cost.totalAmount,r=n.quantity;i+=parseFloat(o.amount*r),1!==a.length||"Audiobook (via Podcast App)"!==e.productType&&"Audiobook (Via Podcast Player)"!==e.productType?document.getElementById("freeShippingMsg").style.display="block":document.getElementById("freeShippingMsg").style.display="none"})),document.querySelector(".shopify-buy__cart__subtotal__price"),i}();if(!t)return void console.warn("Unable to calculate freeshipping without cart data.");let o=parseFloat(40)-parseFloat(t);o=o.toFixed(2);let r="";r=o>0?`You are $${o} away from free shipping!`:"You've got free shipping!",document.getElementById("freeShippingMsg").innerHTML=r}();const o=document.querySelector(".shopify-buy__cart__note__text-area");if(o&&o.setAttribute("maxlength","150"),!window.__pendingATC||!t?.lineItems?.length)return;const r=t.lineItems[t.lineItems.length-1];r.__klaviyoTracked||(r.__klaviyoTracked=!0,function(t,n){window._learnq=window._learnq||[];const e={$event_id:`${n.id}-${t.id}`,ProductName:window.__pendingATC.ProductName,ISBN:window.__pendingATC.ISBN,Author:window.__pendingATC.Author,Publisher:window.__pendingATC.Publisher,Genre:window.__pendingATC.Genre,Quantity:t.quantity,VariantID:t.variant?.id,CartID:n.id,Price:window.__pendingATC.Price,Currency:window.__pendingATC.Currency,ImageURL:window.__pendingATC.ImageURL,ProductURL:window.__pendingATC.ProductURL,Locale:window.__pendingATC.Locale};_learnq.push(["track","Added to Cart",e])}(r,t),window.__pendingATC=null)}},text:{title:"Shopping Cart",total:"Subtotal",button:"Checkout",noteDescription:"Add an optional Gift Message (150 character limit)"},popup:!1,contents:{note:!0},styles:{button:{"background-color":u,"border-radius":"9999px","font-size":"15px","font-weight":"700","letter-spacing":"unset","line-height":"1.2",padding:"12px 17px",":hover":{"background-color":"#000000"},":focus":{"background-color":"#000000"}}}},toggle:{styles:{toggle:{display:"none"}}}}})}))}async function l(t){const o=`\n\t{\n\t  products(first: 1, query: "metafield:books.isbn:${t}") {\n\t\tedges {\n\t\t  node {\n\t\t\tid\n\t\t\ttitle\n\t\t\thandle\n\t\t\tdescription\n\t\t\tpublicationDate: metafield(namespace: "custom", key: "publication_date") { value }
1\n\t\t\tvariants(first: 10) {\n\t\t\t  edges {\n\t\t\t\tnode {\n\t\t\t\t  id\n\t\t\t\t  sku\n\t\t\t\t  availableForSale\n\t\t\t\t}\n\t\t\t  }\n\t\t\t}\n\t\t  }\n\t\t}\n\t  }\n\t}\n  `,r=await fetch(`https://${n}/api/2025-10/graphql.json`,{method:"POST",headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":e},body:JSON.stringify({query:o})});return await r.json()}function p(t){if(!t)return!1;const n=(new Date(t)-new Date)/864e5;return n>0&&n<=180}function g(t){return!!t&&(new Date(t)-new Date)/864e5>180}window.__pendingATC=null,0===r.length?(u(o,"000000000000"),a={"font-size":"13px","padding-top":"14.5px","padding-bottom":"14.5px","border-radius":"0px","padding-left":"0px","padding-right":"0px"},i=""):(a={"font-weight":"bold","font-size":"16px","padding-top":"16px","padding-bottom":"16px",":hover":{"background-color":"#cb2f21"},"background-color":"#e13425",":focus":{"background-color":"#cb2f21"}},i="Add to Cart"),r.length&&async function(){!function(){let t="";if(window.dataLayer&&Array.isArray(window.dataLayer)){const n=window.dataLayer[window.dataLayer.length-1];n&&"object"==typeof n&&"format"in n&&(t=n.format,console.log(n.format))}}();const t=await async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!t.length)return{success:!1,data:{}};const n=[];t.forEach((t=>{const e=t[1];e?.isbn&&n.push(e.isbn)}));const e=[...new Set(n)];if(!e.length)return{success:!1,data:{}};try{const t=await fetch("/wp-json/isbns/v1/isbn-batch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({isbns:e})});if(!t.ok)return console.error("API error status:",t.status),{success:!1,data:{}};const n=await t.text();return n?JSON.parse(n):(console.warn("Empty API response"),{success:!1,data:{}})}catch(t){return console.error("ISBN API error:",t),{success:!1,data:{}}}}(r);console.log(t);for(const[n,e]of r){let n=e.isbn;const o=String(e.isbn);if(!0===(t.data?.[o]?.disableAtc??!1))continue;let r=await l(n);const a=r?.data?.products?.edges?.[0]?.node??{},c=a?.variants?.edges?.[0]?.node??{},d=(a.id??"").replace("gid://shopify/Product/",""),s=a?.publicationDate?.value??null,f=c?.availableForSale??!1;f&&!g(s)?(i=!0===p(s)?"Preorder":"Add to Cart",u(d,n)):!1!==f&&!1!==p(s)||(i="Add to Cart",u(d,n),document.getElementById(`product-component-add-to-cart${n}`).style.display="none")}}(),document.addEventListener("click",(function(t){if(!t.target.closest(".title-add-to-cart__button"))return;const n=document.querySelector("#hachetteJsonLinkingData");if(!n)return;const e=JSON.parse(n.innerText),o=Array.isArray(e.author)?e.author.map((t=>t.name)).join(", "):"",r=Array.isArray(e.genre)?e.genre.join(", "):"",a=Array.isArray(e.offers)?e.offers[0]:e.offers;window.__pendingATC={ProductName:e.name,ISBN:e.isbn,Author:o,Publisher:e.publisher?.name||"",Genre:r,Price:a?.price||null,Currency:a?.priceCurrency||"USD",ImageURL:Array.isArray(e.image)?e.image[0]:"",ProductURL:a?.url||window.location.href,Locale:navigator.language||"en-US"}}),!0)}},n={};function e(o){var r=n[o];if(void 0!==r)return r.exports;var a=n[o]={exports:{}};return t[o](a,a.exports,e),a.exports}e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,{a:n}),n},e.d=function(t,n){for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},function(){"use strict";e(432)}()}();
2//# sourceMappingURL=ecommerce.bundle.min.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.