try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="ac33e2f5-0367-4879-a8b2-702c82abd8d9",e._sentryDebugIdIdentifier="sentry-dbid-ac33e2f5-0367-4879-a8b2-702c82abd8d9")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4899],{77948:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,70744,23)),Promise.resolve().then(r.t.bind(r,67873,23)),Promise.resolve().then(r.bind(r,31030)),Promise.resolve().then(r.bind(r,87054)),Promise.resolve().then(r.bind(r,56787)),Promise.resolve().then(r.bind(r,61211)),Promise.resolve().then(r.bind(r,10890))},2061:(e,t,r)=>{"use strict";r.d(t,{ErrorBoundary:()=>s});var o=r(52308);let n=(0,o.createContext)(null),l={didCatch:!1,error:null};class s extends o.Component{static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){let{error:e}=this.state;if(null!==e){for(var t,r,o=arguments.length,n=Array(o),s=0;s0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some((e,r)=>!Object.is(e,t[r]))}(e.resetKeys,o)){var n,s;null===(n=(s=this.props).onReset)||void 0===n||n.call(s,{next:o,prev:e.resetKeys,reason:"keys"}),this.setState(l)}}render(){let{children:e,fallbackRender:t,FallbackComponent:r,fallback:l}=this.props,{didCatch:s,error:a}=this.state,i=e;if(s){let e={error:a,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)i=t(e);else if(r)i=(0,o.createElement)(r,e);else if(void 0!==l)i=l;else throw a}return(0,o.createElement)(n.Provider,{value:{didCatch:s,error:a,resetErrorBoundary:this.resetErrorBoundary}},i)}constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=l}}},31030:(e,t,r)=>{"use strict";r.d(t,{BooksGrid:()=>u});var o=r(3896),n=r(52308),l=r(32944),s=r(70744),a=r.n(s),i=r(25476);let c=(0,n.memo)(function(e){let{book:t,isPriority:r}=e,s=(0,n.useCallback)(e=>{e.preventDefault();let r=document.getElementById(t.slug);r&&r.scrollIntoView({behavior:"smooth"})},[t.slug]);return(0,o.jsx)(a(),{href:"#".concat(t.slug),onClick:s,className:"inline-block","aria-label":"View ".concat(t.title),children:(0,o.jsx)(l.default,{src:t.coverSrc,alt:t.title,width:100,height:150,className:"border border-black rounded-sm shadow-md transition-transform hover:scale-105",priority:r,loading:r?"eager":"lazy"})})}),u=(0,n.memo)(function(){let e=i.b.slice(0,10);return(0,o.jsx)("div",{className:"mx-auto max-w-2xl flex flex-wrap gap-4 md:gap-8 justify-center",children:e.map((e,t)=>(0,o.jsx)(c,{book:e,isPriority:t<3},e.slug))})})},99500:(e,t,r)=>{"use strict";r.d(t,{ReviewCard:()=>f});var o=r(3896),n=r(49948),l=r(17429),s=r(99058),a=r(52308);let i=(0,a.memo)(function(e){var t;let{author:r}=e;if(!r)return null;let n=(null===(t=r.image)||void 0===t?void 0:t.startsWith("/"))?r.image:"/".concat(r.image);return(0,o.jsxs)("div",{className:"flex mx-auto items-center",children:[r.image&&(0,o.jsx)(s.Q,{size:"sm",src:n,alt:"Avatar of ".concat(r.name),className:"border border-slate-400"}),(0,o.jsxs)("div",{className:"".concat(r.image?"ml-2":""),children:[(0,o.jsx)("p",{className:"my-0 text-tiny",children:r.name}),r.description&&(0,o.jsx)("p",{className:"my-0 text-[10px] leading-3 text-slate-400",children:r.description})]})]})});var c=r(52863);let u={active:"text-yellow-400 fill-yellow-400",inactive:"text-gray-300",base:"w-5 h-5"},d=(0,a.memo)(function(e){let{rating:t,maxStars:r=5}=e;return(0,o.jsx)("div",{className:"flex mx-auto mb-2",role:"img","aria-label":"".concat(t," out of ").concat(r," stars"),children:Array.from({length:r},(e,r)=>(0,o.jsx)(c.A,{className:"".concat(u.base," ").concat(r{"use strict";r.d(t,{ReviewsCarousel:()=>u});var o=r(3896),n=r(52308),l=r(99500);let s=e=>{let[t,r]=(0,n.useState)(!1),o=(0,n.useRef)({x:0,scrollLeft:0}),l=(0,n.useCallback)(t=>{if(!e.current)return;r(!0);let n="touches"in t?t.touches[0].clientX:t.clientX;o.current={x:n,scrollLeft:e.current.scrollLeft}},[e]),s=(0,n.useCallback)(()=>{r(!1)},[]),a=(0,n.useCallback)(r=>{if(!t||!e.current)return;r.preventDefault();let n="touches"in r?r.touches[0].clientX:r.clientX,l=o.current.x-n;e.current.scrollLeft=o.current.scrollLeft+l},[t,e]);return{isDragging:t,handleDragStart:l,handleDragEnd:s,handleDragMove:a}},a={SCROLL_AMOUNT:300},i=(0,n.memo)(function(e){let{review:t,showRating:r,isLast:n}=e;return(0,o.jsx)("div",{className:"w-48 md:w-64 flex-shrink-0 ".concat(n?"":"mr-4 md:mr-8"),children:(0,o.jsx)(l.ReviewCard,{review:t,showRating:r})})}),c=(0,n.memo)(function(e){let{direction:t,show:r,onClick:n}=e;return(0,o.jsx)("button",{onClick:n,className:"absolute ".concat(t,"-0 top-0 bottom-0 w-16 bg-transparent\n no-button-style shadow-none focus:ring-0 focus:outline-none active:bg-transparent \n border-none focus:border-none outline-none\n ").concat(r?"bg-gradient-".concat("left"===t?"to-r":"to-l"," from-white to-transparent"):"pointer-events-none"),"aria-label":"Scroll ".concat(t)})}),u=(0,n.memo)(function(e){let{reviews:t,showRatings:r,title:l="Some reviews",width:u,height:d}=e,m=(0,n.useRef)(null),[h,f]=(0,n.useState)(!1),[b,p]=(0,n.useState)(!0),x=(0,n.useCallback)(()=>{let e=m.current;if(!e)return;let{scrollLeft:t,scrollWidth:r,clientWidth:o}=e;f(t>0),p(t{let t=m.current;if(!t)return;let r="left"===e?-a.SCROLL_AMOUNT:a.SCROLL_AMOUNT;t.scrollBy({left:r,behavior:"smooth"})},[]),{isDragging:g,handleDragStart:y,handleDragEnd:w,handleDragMove:k}=s(m),j=(0,n.useCallback)(e=>{(null==e?void 0:e.currentTarget)&&(null==e?void 0:e.target)&&(e.persist(),k(e))},[k]),N=(0,n.useCallback)(e=>{(null==e?void 0:e.currentTarget)&&(null==e?void 0:e.target)&&(e.persist(),y(e))},[y]),B=(0,n.useCallback)(e=>{(null==e?void 0:e.currentTarget)&&(null==e?void 0:e.target)&&(e.persist(),w())},[w]),C=t.length<2,E=t.length<3&&"lg"===u;return(0,o.jsxs)("section",{className:"".concat("sm"===d?"mt-0 mb-0 p-0":""," section-separator"),children:[(0,o.jsx)("h3",{className:"text-2xl font-bold mb-4",children:l}),(0,o.jsxs)("div",{className:"w-full relative",children:[(0,o.jsx)("div",{className:"mx-auto mb-4 relative overflow-x-auto scrollbar-hide select-none\n max-w-[300px] sm:max-w-[380px] md:max-w-[420px] ".concat("lg"===u?"lg:max-w-[600px]":"","\n cursor-grab active:cursor-grabbing ").concat(C?"flex justify-center":""),ref:m,onScroll:x,onMouseDown:N,onMouseUp:B,onMouseLeave:B,onMouseMove:j,onTouchStart:N,onTouchEnd:B,onTouchMove:j,children:(0,o.jsx)("div",{className:"flex ".concat(E?"md:justify-center":""),children:t.map((e,n)=>(0,o.jsx)(i,{review:e,showRating:r,isLast:n===t.length-1},"review-".concat(n)))})}),(0,o.jsx)(c,{direction:"left",show:h,onClick:()=>v("left")}),(0,o.jsx)(c,{direction:"right",show:b,onClick:()=>v("right")})]})]})})},56787:(e,t,r)=>{"use strict";r.d(t,{BookImage:()=>s});var o=r(52308),n=r(6643),l=r(32944);let s=(0,o.memo)(e=>{let{maxRetries:t=3,retryDelay:r=1e3,priority:s=!1,...a}=e,[i,c]=(0,o.useState)(0),u=i{if(!u||0===i)return;let e=setTimeout(()=>c(0),r);return()=>clearTimeout(e)},[i,r,u]);let d=(0,o.useCallback)(()=>{u&&c(e=>e+1)},[u]);return(0,o.createElement)(n.W,{...a,key:i,onError:d,as:l.default,priority:s})});s.displayName="BookImage"},61211:(e,t,r)=>{"use strict";r.d(t,{BuyBookButton:()=>c});var o=r(3896),n=r(42363),l=r(16465),s=r(60157),a=r(52308),i=r(19778);let c=(0,a.memo)(e=>{let{book:t,className:r}=e,{isOpen:a,onOpen:c,onOpenChange:u}=(0,l.j)();return t?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s.T,{color:"primary",onPress:()=>{try{null==c||c()}catch(e){console.error("Error opening modal:",e),n.Cp(e)}},"aria-label":"Buy ".concat(t.title),className:r,children:"Buy Now"}),(0,o.jsx)(i.B,{book:t,isOpen:a,onOpenChange:u})]}):(!function(){let e="BuyBookButton: No book provided";console.warn(e),n.wd(e,{level:"warning",extra:{component:"BuyBookButton"}})}(),null)});c.displayName="BuyBookButton"},19778:(e,t,r)=>{"use strict";r.d(t,{B:()=>f});var o=r(3896),n=r(42363),l=r(85617),s=r(53936),a=r(97406),i=r(32471),c=r(60157),u=r(27240),d=r(60470),m=r(52308);let h="/books/preorder",f=m.memo(e=>{let{book:t,isOpen:r,onOpenChange:f}=e;if(!(null==t?void 0:t.title)){let e=Error("BuyBookModal: Book or book title is missing");return console.error(e),n.Cp(e),null}let b=(0,m.useMemo)(()=>{let e=[];return(t.amazonLink||h)&&e.push({type:"Paperback",href:t.amazonLink||h}),(t.myStoreLink||h)&&e.push({type:"eBook",href:t.myStoreLink||h}),t.hasAudiobook&&t.myStoreLink&&e.push({type:"Audiobook",href:t.myStoreLink}),e},[t.amazonLink,t.myStoreLink,t.hasAudiobook]),p=(0,m.useCallback)(e=>{null==f||f(e)},[f]);if(0===b.length){let e=Error("BuyBookModal: No purchase options available for book: ".concat(t.title));return console.warn(e),n.wd(e.message,{level:"warning"}),null}return(0,o.jsx)(l.Y,{isOpen:r,onOpenChange:p,size:"sm",hideCloseButton:!0,children:(0,o.jsx)(s.g,{className:"pb-0",children:e=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(a.c,{className:"flex flex-col gap-1",children:["Buy ",t.title]}),(0,o.jsx)(i.h,{children:b.map(e=>{let{type:r,href:l}=e;return(0,o.jsx)(c.T,{as:u.h,href:l,color:"primary",className:"w-full mb-2",isExternal:l.startsWith("http"),"aria-label":"Buy ".concat(r," version of ").concat(t.title),onPress:()=>{try{if(!l)return;l.startsWith("http")&&window.open(l,"_blank","noopener,noreferrer")}catch(e){console.error("Error handling button press:",e),n.Cp(e)}},children:r},r)})}),(0,o.jsx)(d.q,{children:(0,o.jsx)(c.T,{color:"primary",variant:"light",onPress:()=>{try{null==e||e()}catch(e){console.error("Error closing modal:",e),n.Cp(e)}},className:"shadow-none text-white","aria-label":"Close purchase options modal",children:"Close"})})]})})})});f.displayName="BuyBookModal"},10890:(e,t,r)=>{"use strict";r.d(t,{default:()=>s});var o=r(3896),n=r(2061),l=r(63485);let s=(0,r(52308).memo)(function(e){let{children:t}=e;return(0,o.jsx)(n.ErrorBoundary,{FallbackComponent:l.default,children:t})})},63485:(e,t,r)=>{"use strict";r.d(t,{default:()=>s});var o=r(3896),n=r(52308),l=r(60157);let s=(0,n.memo)(function(e){let{error:t,resetErrorBoundary:r,message:n="We're sorry, a problem occurred. Please try again later."}=e;return(0,o.jsxs)("div",{role:"alert",className:"p-4 border border-red-500 rounded-lg bg-red-50 max-w-xl mx-auto my-8",children:[(0,o.jsx)("h2",{className:"text-lg font-semibold text-red-800 mb-2",children:"Oops! Something went wrong"}),(0,o.jsx)("p",{className:"text-red-700 mb-4",children:n}),!1,(0,o.jsx)(l.T,{onPress:r,color:"danger",className:"w-full sm:w-auto",children:"Try again"})]})})}},e=>{var t=t=>e(e.s=t);e.O(0,[1796,4555,7873,157,7931,3957,4137,5476,8016,7410,7358],()=>t(77948)),_N_E=e.O()}]);