1 2!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0d799d3c-a3e5-546e-8c4f-9aea798994d5")}catch(e){}}(); 3import{j as e,r as v,b as te}from"./vendor-react-D7BZ9ZKA.js";import{aR as ae,s as re,aS as le,u as ne,aT as ie,aU as oe,a2 as Q}from"./index-p6KOfqs7.js";import{F as N}from"./index.es-Duu2oIUt.js";import{R as M,a as O,c as ce}from"./index-BMM2qUXc.js";import{R as i}from"./index-DApr_EBF.js";import{C as de}from"./cartable_form-DA2X3IOg.js";import{S as E}from"./conditional_render-MvKXUs-w.js";import{P as W}from"./product_cover_image-CouFhogV.js";import{A as K}from"./author_names-CURGax1b.js";import{P as ue}from"./progress_bar-CfNN8vQ0.js";import{S as T}from"./star_rating-Dr3YH1b0.js";import{u as xe}from"./shopping_cart-Bvy_KG5z.js";import{R as me}from"./r_button-DgfKCiG2.js";import{R as A}from"./index-BkZrcuyr.js";import{R}from"./index-CYA8lmjV.js";import{U as q}from"./user_image-DwRqNp6U.js";import{T as he}from"./testimonial-gq5zaWVJ.js";import{B as pe}from"./book_about_author_social-DVOphPoA.js";import{B as fe,W as je,d as ge,j as be,K as ke}from"./tabs-Cc4D2zuV.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};s.SENTRY_RELEASE={id:"e34a2f9468e4617a77893c27d98e903c140fca28"}}catch{}})();const we=({recentProgress:s,className:t})=>{if(!s)return null;const{metric:a,delta:r,days:l}=s,u=a==="words";return e.jsx("div",{className:`flex justify-center ${t??""}`.trim(),children:e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-emerald-50 px-2.5 py-1 text-xs font-medium text-emerald-700 ring-1 ring-emerald-600/20 ring-inset dark:bg-emerald-500/10 dark:text-emerald-400 dark:ring-emerald-400/20",children:[e.jsx(N,{icon:ae,className:"h-3 w-3"}),u?e.jsx(i,{k:"w_recent_progress_words",opts:{count:r.toLocaleString(),days:l}}):e.jsx(i,{k:"w_recent_progress_percent",opts:{delta:r,days:l}})]})})},ve=(s,t)=>s instanceof Node&&t instanceof Node?s.contains(t):!1,Ne=s=>{if(!(s.state==="unpublished"&&!!s.unpublishedSample||s.state==="published"&&!!s.hasSample))return[];const a=[];return s.hasPdfSample&&s.samplePdfUrl&&a.push({key:"pdf",label:"PDF",icon:le,href:s.samplePdfUrl}),s.hasEpubSample&&s.sampleEpubUrl&&a.push({key:"epub",label:"EPUB",icon:ne,href:s.sampleEpubUrl}),s.audiobookSampleUrl&&a.push({key:"audio",label:"AUDIOBOOK",icon:ie,href:s.audiobookSampleUrl}),a},ye=({book:s})=>{const[t,a]=v.useState(!1),r=v.useRef(null);v.useEffect(()=>{if(!t)return;const o=j=>{r.current&&!r.current.contains(j.target)&&a(!1)},h=j=>{j.key==="Escape"&&a(!1)};return document.addEventListener("mousedown",o),document.addEventListener("keydown",h),()=>{document.removeEventListener("mousedown",o),document.removeEventListener("keydown",h)}},[t]);const l=Ne(s);if(l.length===0)return null;const u=l.length>1,n=o=>{ve(o.currentTarget,o.relatedTarget)||a(!1)},c=()=>{if(u){a(o=>!o);return}window.location.href=l[0].href},m=u?re:l[0].icon;return e.jsxs("div",{ref:r,className:"relative",onBlurCapture:n,children:[e.jsxs(me,{className:"px-2",color:"secondary",onClick:c,type:"button","aria-haspopup":u?"true":void 0,"aria-expanded":u?t:void 0,children:[e.jsx(N,{icon:m,className:"h-4 text-neutral-500"}),e.jsx("div",{className:"text-xs font-medium",children:e.jsx(i,{k:"w_read_free_sample"})})]}),u&&e.jsx("div",{className:`absolute top-full left-1/2 z-10 mt-2 w-max -translate-x-1/2 transform rounded-full border border-neutral-200 bg-white px-4 py-2 text-xs font-medium text-neutral-700 shadow-lg transition-all duration-150 ease-out dark:border-neutral-700 dark:bg-neutral-900 dark:text-white ${t?"pointer-events-auto translate-y-0 opacity-100":"pointer-events-none -translate-y-1 opacity-0"}`,role:"menu","aria-hidden":!t,children:e.jsx("div",{className:"flex items-center gap-4",children:l.map((o,h)=>e.jsxs("div",{className:"contents",children:[h>0&&e.jsx("span",{className:"h-4 w-px bg-neutral-200 dark:bg-neutral-700"}),e.jsxs("a",{href:o.href,className:"inline-flex items-center gap-2 whitespace-nowrap hover:text-blue-600 focus:outline-hidden focu
3s-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-600 dark:hover:text-blue-400",target:"_blank",rel:"noreferrer noopener",onClick:()=>a(!1),role:"menuitem","data-sample-option":o.key,children:[e.jsx(N,{icon:o.icon,className:"text-sm"}),o.label]})]},o.key))})})]})},z="prose prose-sm dark:prose-invert prose-a:text-blue-600 dark:prose-a:text-blue-400 max-w-full! prose-headings:scroll-mt-0";function _e({children:s,to:t}){const a="inline-flex items-center rounded-full bg-blue-50 px-3 py-1 text-xs font-medium text-blue-700 ring-1 ring-blue-600/20 ring-inset dark:bg-blue-950/40 dark:text-blue-300 dark:ring-blue-400/20";return t?e.jsx(R,{to:t,hideDefaultStyles:!0,className:`${a} transition-colors hover:bg-blue-100 dark:hover:bg-blue-900/40`,children:s}):e.jsx("span",{className:a,children:s})}function G({name:s,username:t,avatarUrl:a,blurbHtml:r,social:l,subtitle:u}){const n=t?e.jsx(R,{to:`/u/${t}`,hideDefaultStyles:!0,className:"font-semibold text-zinc-900 hover:text-blue-600 dark:text-white dark:hover:text-blue-400",children:s}):e.jsx("span",{className:"font-semibold text-zinc-900 dark:text-white",children:s});return e.jsxs("div",{className:"flex gap-4",children:[e.jsx(q,{className:"h-14 w-14 shrink-0 overflow-hidden rounded-full border border-slate-200 bg-slate-50 object-cover dark:border-zinc-700 dark:bg-zinc-800",src:a}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-baseline gap-x-3 gap-y-1",children:[n,u&&e.jsx("span",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:u})]}),l&&e.jsx(pe,{user:l,className:"mt-1 [&_svg]:text-lg!"}),r&&e.jsx("div",{className:`${z} mt-2`,dangerouslySetInnerHTML:{__html:r}})]})]})}function Se({aboutText:s,teaserText:t,languageCode:a}){const r=(s==null?void 0:s.trim())||(t==null?void 0:t.trim());return r?e.jsx("div",{lang:a,className:z,dangerouslySetInnerHTML:{__html:r}}):null}function Pe({authors:s}){return e.jsx("div",{className:"space-y-6",children:s.map(t=>{var a,r;return e.jsx(G,{name:t.name,username:t.user.username,avatarUrl:(a=t.user.avatarOriginal)==null?void 0:a.url,blurbHtml:((r=t.blurb)==null?void 0:r.trim())||t.user.profileBlurb,social:t.user},t.id)})})}function ze({contributors:s}){return e.jsx("div",{className:"space-y-6",children:s.map(t=>{var a,r;return e.jsx(G,{name:t.name,username:(a=t.user)==null?void 0:a.username,avatarUrl:(r=t.avatarOriginal)==null?void 0:r.url,subtitle:t.title,blurbHtml:t.blurb,social:t},t.id)})})}function Re({publisher:s}){var t;return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[((t=s.logo)==null?void 0:t.url)&&e.jsx(A,{src:s.logo.url,alt:s.name,className:"h-12 w-auto max-w-[8rem] object-contain"}),e.jsx(R,{to:s.university?`/universities/${s.slug}`:`/p/${s.slug}`,hideDefaultStyles:!0,className:"font-semibold text-zinc-900 hover:text-blue-600 dark:text-white dark:hover:text-blue-400",children:s.name})]}),s.defaultLandingPageBlurb&&e.jsx("div",{className:z,dangerouslySetInnerHTML:{__html:s.defaultLandingPageBlurb}})]})}function Be(s){if(!Array.isArray(s))return[];const t=[];for(const a of s){const r={title:a.title,section_num:a.section_num,children:[]};a.level===2||t.length===0?t.push(r):t[t.length-1].children.push(r)}return t}function Te({jsonToc:s,toc:t,languageCode:a,languageDirection:r}){let l=null;try{const n=JSON.parse(s||"null");l=Array.isArray(n)?n:n==null?void 0:n.toc}catch{l=null}const u=Be(l);return u.length===0?t?e.jsx("article",{lang:a,dir:r,className:"prose prose-sm dark:prose-invert max-w-full! [&>.toc>li]:list-none",dangerouslySetInnerHTML:{__html:t}}):null:e.jsx("article",{dir:r,lang:a,className:"prose-code:rounded-md prose-code:bg-slate-200/70 dark:prose-code:bg-slate-700/60 prose-code:px-1.5 prose-code:py-0.5 space-y-6 text-start",children:u.map((n,c)=>e.jsxs("div",{children:[e.jsxs("h3",{className:"flex gap-2 text-base font-semibold tracking-tight text-slate-900 dark:text-white",children:[n.section_num!=null&&n.section_num!==""&&e.jsx("span",{className:"shrink-0 text-slate-500 dark:text-slate-400",children:n.section_num}),e.jsx("span",{dangerouslySetInnerHTML:{__html:n.title}})]}),n.children.length>0&&e.jsx("ol",{className:"mt-2 divide-y divide-slate-200/70 rounded-xl bg-slate-50 px-5 py-1 text-sm dark:divide-slate-700/60 dark:bg-zinc-800/50",children:n.children.map((m,o)=>e.jsxs("li",{className:"flex gap-3 py-2.5",children:[m.section_num!=null&&m.section_num!==""&&e.jsx("span",{className:"shrink-0 text-slate-400 dark:text-slate-500",children:m.section_num}),e.jsx("span",{className:"font-medium text-slate-700 dark:text-slate-200",dangerouslySetInnerHTML:{__html:m.title}}
3)]},o))})]},c))})}function Ae({review:s}){return e.jsxs("li",{className:"flex flex-col rounded-xl bg-white p-4 shadow-sm ring-1 ring-neutral-900/5 dark:bg-zinc-800 dark:ring-zinc-700",children:[e.jsx(T,{rating:s.starRating??0}),s.body&&e.jsx("p",{className:"mt-3 flex-1 text-sm text-neutral-700 dark:text-neutral-300",children:s.body.length>320?`${s.body.slice(0,320)}â¦`:s.body}),e.jsxs("div",{className:"mt-3 flex items-center justify-between border-t border-neutral-100 pt-3 dark:border-zinc-700",children:[e.jsx("span",{className:"text-sm font-medium text-neutral-900 dark:text-neutral-100",children:s.user.name}),e.jsx("span",{className:"text-xs text-neutral-400 dark:text-neutral-500",children:s.createdAt.slice(0,10)})]})]})}function Ce({testimonials:s,bigTestimonial:t}){var a;return e.jsxs("div",{className:"space-y-8",children:[t&&e.jsxs("figure",{className:"rounded-2xl bg-slate-50 p-6 dark:bg-zinc-800/60",children:[t.numStars>0&&e.jsx("div",{className:"mb-3",children:e.jsx(T,{rating:t.numStars})}),e.jsxs("blockquote",{className:"font-display text-xl font-medium tracking-tight text-slate-900 dark:text-white",children:["â",t.text,"â"]}),e.jsxs("figcaption",{className:"mt-4 flex items-center gap-3",children:[e.jsx(q,{className:"size-10 overflow-hidden rounded-full object-cover",src:(a=t.avatar)==null?void 0:a.url}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-slate-900 dark:text-white",children:t.name}),t.title&&e.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-400",children:t.title})]})]})]}),s.length>0&&e.jsx("ul",{className:"grid grid-cols-1 gap-5 sm:grid-cols-2",children:s.map(r=>e.jsx("li",{className:"flex",children:e.jsx(he,{id:r.id,name:r.name,text:r.text,title:r.title,avatar:r.avatar})},r.id))})]})}function Le({aggregate:s,reviews:t}){return e.jsxs("div",{className:"space-y-6",children:[((s==null?void 0:s.totalCount)??0)>0&&s&&e.jsxs("div",{className:"flex flex-wrap items-center gap-x-5 gap-y-2 rounded-xl border border-neutral-200 px-4 py-3 dark:border-zinc-700",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(T,{rating:s.averageRating}),e.jsx("span",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:s.averageRating.toFixed(1)})]}
3),e.jsxs("span",{className:"text-sm text-neutral-600 dark:text-neutral-300",children:[s.totalCount," ",e.jsx(i,{k:"w_reviews",opts:{defaultValue:"reviews"}})]}),s.wouldRecommendPercentage>0&&e.jsxs("span",{className:"text-sm text-emerald-700 dark:text-emerald-400",children:[s.wouldRecommendPercentage,"%"," ",e.jsx(i,{k:"w_would_recommend",opts:{defaultValue:"would recommend"}})]})]}),t.length>0&&e.jsx("ul",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2",children:t.map(a=>e.jsx(Ae,{review:a},a.id))})]})}function J({to:s,coverUrl:t,cover2xUrl:a,title:r,subtitle:l}){return e.jsx("li",{children:e.jsxs(R,{to:s,hideDefaultStyles:!0,className:"group block space-y-1.5",children:[t&&e.jsx(A,{src:t,src2x:a,alt:r,className:"w-full rounded-sm border border-neutral-200 shadow-sm transition-shadow group-hover:shadow-md dark:border-zinc-700"}),e.jsx("div",{className:"line-clamp-2 text-xs font-medium text-zinc-900 group-hover:text-blue-600 dark:text-white dark:group-hover:text-blue-400",children:r}),l&&e.jsx("div",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:l})]})})}function Ee({translations:s}){return e.jsx("ul",{className:"grid grid-cols-3 gap-4 sm:grid-cols-4 lg:grid-cols-5",children:s.map(t=>{var a,r,l;return e.jsx(J,{to:t.landingPagePath,coverUrl:(a=t.coverFeatured)==null?void 0:a.url,cover2xUrl:(r=t.coverFeatured2x)==null?void 0:r.url,t
3itle:t.title,subtitle:(l=t.language)==null?void 0:l.name},t.id)})})}function De({books:s}){return e.jsx("ul",{className:"grid grid-cols-3 gap-4 sm:grid-cols-4 lg:grid-cols-5",children:s.map(t=>{var a,r;return e.jsx(J,{to:t.landingPagePath,coverUrl:(a=t.coverFeatured)==null?void 0:a.url,cover2xUrl:(r=t.coverFeatured2x)==null?void 0:r.url,title:t.title,subtitle:t.authors.map(l=>l.name).join(", ")},t.id)})})}function Fe({videos:s}){return e.jsx("div",{className:"space-y-5",children:s.map((t,a)=>e.jsx("div",{className:"relative w-full overflow-hidden rounded-lg pt-[56.25%] shadow-md",children:e.jsx("iframe",{title:`launch-video-${a}`,src:`https://www.youtube.com/embed/${t}`,className:"absolute inset-0 h-full w-full",allowFullScreen:!0})},t))})}function Ie({causes:s}){return e.jsx("div",{className:"space-y-8",children:s.map(t=>{var a;return e.jsxs("section",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[((a=t.logo)==null?void 0:a.url)&&e.jsx(A,{src:t.logo.url,alt:t.name,className:"h-12 w-auto max-w-[8rem] object-contain"}),e.jsxs("div",{children:[e.jsxs("div",{className:"font-semibold text-zinc-900 dark:text-white",children:[t.name,t.abbrev?` (${t.abbrev})`:""]}),t.slogan&&e.jsx("div",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:t.slogan}),t.url&&e.jsx("a",{href:t.url,target:"_blank",rel:"noreferrer",className:"text-xs text-blue-600 hover:underline dark:text-blue-400",children:t.url})]})]}),t.shortDescription&&e.jsx("div",{className:z,dangerouslySetInnerHTML:{__html:t.shortDescription}}),t.longDescription&&e.jsx("div",{className:z,dangerouslySetInnerHTML:{__html:t.longDescription}})]},t.id)})})}function P({label:s,value:t}){return e.jsxs("div",{className:"flex items-baseline justify-between gap-3 py-1.5",children:[e.jsx("dt",{className:"text-xs font-semibold tracking-wide text-neutral-500 uppercase dark:text-neutral-400",children:s}),e.jsx("dd",{className:"text-right text-sm font-medium text-neutral-900 dark:text-neutral-100",children:t})]})}function Ue({children:s}){return e.jsx("h4",{className:"text-xs font-semibold tracking-wide text-neutral-500 uppercase dark:text-neutral-400",children:s})}function $e({details:s}){var r;const t=[s.pdfAvailable&&"PDF",s.epubAvailable&&"EPUB",s.leanpubAppAvailable&&"WEB"].filter(
3Boolean),a=s.showNumReaders&&s.exceedsMinimumDisplayReaders&&s.totalCopiesSold>0;return e.jsxs("div",{className:"space-y-5",children:[e.jsxs("dl",{className:"divide-y divide-neutral-100 dark:divide-zinc-700/60",children:[t.length>0&&e.jsx(P,{label:e.jsx(i,{k:"w_formats",opts:{defaultValue:"Formats"}}),value:t.join(" · ")}),s.pageCount>0&&e.jsx(P,{label:e.jsx(i,{k:"w_pages"}),value:s.pageCount.toLocaleString()}),s.wordCount>0&&e.jsx(P,{label:e.jsx(i,{k:"w_words"}),value:s.wordCount.toLocaleString()}),((r=s.language)==null?void 0:r.name)&&e.jsx(P,{label:e.jsx(i,{k:"w_language",count:1}),value:s.language.name}),a&&e.jsx(P,{label:e.jsx(i,{k:"w_readers"}),value:s.totalCopiesSold.toLocaleString()})]}),s.categories.length>0&&e.jsxs("section",{className:"space-y-2",children:[e.jsx(Ue,{children:e.jsx(i,{k:"w_categories",opts:{defaultValue:"Categories"}})}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s.categories.map(l=>e.jsx(_e,{to:`/store/books?category=${l.slug}`,children:l.name},l.slug))})]})]})}function He({bundledProducts:s}){return e.jsx("ul",{className:"space-y-3",children:s.map(t=>{var a;return e.jsx("li",{children:e.jsxs(R,{to:t.landingPagePath,hideDefaultStyles:!0,className:"flex gap-4 rounded-xl border border-neutral-200 p-3 transition-colors hover:border-blue-400 hover:bg-blue-50/40 dark:border-zinc-700 dark:hover:border-blue-500 dark:hover:bg-zinc-800",children:[((a=t.coverHero)==null?void 0:a.url)&&e.jsx(A,{src:t.coverHero.url,alt:t.title,className:"h-20 w-auto shrink-0 rounded-sm object-contain shadow-sm"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"font-medium text-zinc-900 dark:text-white",children:t.title}),t.authors.length>0&&e.jsx("div",{className:"mt-0.5 text-xs text-neutral-500 dark:text-neutral-400",children:t.authors.map(r=>r.name).join(", ")}),t.sanitizedTeaserText&&e.jsx("div",{className:"mt-1 line-clamp-2 text-xs text-neutral-600 dar
3k:text-neutral-400",dangerouslySetInnerHTML:{__html:t.sanitizedTeaserText}})]})]})},t.id)})})}function Y(s){const t="reviewAggregate"in s?s.reviewAggregate??null:null,a="featuredReviews"in s?s.featuredReviews:[];return{showReviewsSection:"showReviewsSection"in s?s.showReviewsSection:!1,aggregate:t,reviews:a}}function Ve({details:s,pricePanel:t}){var c,m,o,h,j;const{showReviewsSection:a,aggregate:r,reviews:l}=Y(s),u="launchVideos"in s&&s.showLaunchVideos?s.launchVideos:[],n=[{key:"price",label:e.jsx(i,{k:"w_price"}),panel:t}];return((c=s.aboutText)!=null&&c.trim()||(m=s.sanitizedTeaserText)!=null&&m.trim())&&n.push({key:"about",label:e.jsx(i,{k:"w_about"}),panel:e.jsx(Se,{aboutText:s.aboutText,teaserText:s.sanitizedTeaserText,languageCode:((o=s.language)==null?void 0:o.code2)??"en"})}),s.bundledProducts.length>0&&n.push({key:"included",label:e.jsx(i,{k:"w_whats_included",opts:{defaultValue:"What's Included"}}),panel:e.jsx(He,{bundledProducts:s.bundledProducts})}),s.authors.length>0&&n.push({key:"authors",label:e.jsx(i,{k:s.authors.length===1?"w_author":"w_authors"}),panel:e.jsx(Pe,{authors:s.authors})}),u.length>0&&n.push({key:"launch-video",label:e.jsx(i,{k:"w_launch_video"}),panel:e.jsx(Fe,{videos:u})}),s.translations.length>0&&n.push({key:"translations",label:e.jsx(i,{k:"w_translation"}),panel:e.jsx(Ee,{translations:s.translations})}),(s.testimonials.length>0||s.bigTestimonial)&&n.push({key:"testimonials",label:e.jsx(i,{k:"w_testimonials"}),panel:e.jsx(Ce,{testimonials:s.testimonials,bigTestimonial:s.bigTestimonial})}),a&&l.length>0&&n.push({key:"reviews",label:e.jsx(i,{k:"w_reviews"}),panel:e.jsx(Le,{aggregate:r,reviews:l})}),(s.toc||s.jsonToc)&&n.push({key:"contents",label:e.jsx(i,{k:"w_contents"}),panel:e.jsx(Te,{jsonToc:s.jsonToc,toc:s.toc,languageCode:((h=s.language)==null?void 0:h.code2)??"en",languageDirection:((j=s.language)==null?void 0:j.direction)??"ltr"})}),s.contributors.length>0&&n.push({key:"contributors",label:e.jsx(i,{k:"w_contributors",count:s.contributors.length}),panel:e.jsx(ze,{contributors:s.contributors})}),s.showAlsoByAuthors&&s.otherBooksFromAuthors.length>0&&n.push({key:"also-by",label:e.jsx(i,{k:s.authors.length===1?"w_also_by_the_author":"w_also_by_the_authors"}),panel:e.jsx(De,{books:s.otherBooksFromAuthors})}),s.causes.length>0&&n.push({key:"causes",label:e.jsx(i,{k:"w_causes"}),panel:e.jsx(Ie,{causes:s.causes})}),s.publisher&&s.publisher.name!=="Leanpub"&&n.push({key:"publisher",label:e.jsx(i,{k:"w_publisher"}),panel:e.jsx(Re,{publisher:s.publisher})}),e.jsxs(fe,{as:"div",className:"flex min-w-0 flex-col md:min-h-0 md:flex-1",children:[e.jsx(je,{className:"sticky top-0 z-10 flex shrink-0 gap-1 overflow-x-auto border-b border-neutral-200 bg-white/95 px-4 backdrop-blur md:static md:px-6 dark:border-zinc-700 dark:bg-zinc-900/95",children:n.map(g=>e.jsx(ge,{className:"-mb-px shrink-0 cursor-pointer border-b-2 border-transparent px-3 py-3 text-sm font-medium whitespace-nowrap text-neutral-500 transition-colors hover:text-neutral-800 focus:outline-hidden data-[selected]:border-blue-600 data-[selected]:text-blue-700 dark:text-neutral-400 dark:hover:text-neutral-200 dark:data-[selected]:border-blue-400 dark:data-[selected]:text-blue-300",children:g.label},g.key))}),e.jsx(be,{className:"md:min-h-0 md:flex-1 md:overflow-y-auto",children:n.map(g=>e.jsx(ke,{unmount:g.key!=="price",className:"px-4 py-4 focus:outline-hidden md:px-6",children:g.panel},g.key))})]})}const Me=({onClose:s})=>e.jsxs("button",{type:"button",onClick:s,className:"focus-visible:ring-azure-500 absolute top-1.5 right-3 z-30 flex h-9 w-9 items-center justify-center rounded-full bg-white/80 text-neutral-600 backdrop-blur transition-colors hover:bg-neutral-100 hover:text-black focus:outline-hidden focus-visible:ring-2 dark:bg-zinc-800/80 dark:text-neutral-300 dark:hover:bg-zinc-700 dark:hover:text-white",children:[e.jsx("span",{className:"sr-only",children:e.jsx(i,{k:"w_close"})}),e.jsx(N,{icon:Q,className:"h-4 w-4"})]}),ds=({cartable:s,action:t,authors:a=[],coupon:r,onPackageChange:l,showPackageSelection:u,productVariantDiscount:n=null,product:c,show:m,onClose:o,onAddedToCart:h,redirectToCartAfterAdd:j=!1,replaceInCart:g=!1,showBorder:D=!0,editMode:y,hideCredits:X=!1,details:d})=>{var B,U,$,H,V;
3const{causes:Z,coverHero:k,coverHero2x:w,title:_}=c,F=(s==null?void 0:s.name)||_;c.__typename==="StoreBundleProduct"&&c.boughtSeparatelyCombinedSuggestedPrice;const S=c.__typename==="StoreBundleProduct"?"bundle":c.__typename==="StoreCourseProduct"?"course":c.__typename==="StoreTrackProduct"?"track":"book",p=te({key:"cartableForm"}),C=xe(),ee={id:((U=(B=s.id)==null?void 0:B.toString)==null?void 0:U.call(B))??"",...c},L=v.useRef(!1);v.useEffect(()=>{const x=p.formData;if(p.state!=="submitting"||!x)return;const f=x.get("submit")==="shopping_cart"&&x.get("productVariantId")===s.id,b=!!y&&x.get("action")==="update";(f||b)&&(L.current=!0)},[p.state,p.formData,s.id,y]),v.useEffect(()=>{var f,b;if(!L.current||p.state!=="idle")return;L.current=!1,(y?!!((f=p.data)!=null&&f.ok):!!((b=p.data)!=null&&b.cart))&&(o(),y||h==null||h())},[p.state,p.data]);const I=(x,f=!1,b=!1)=>e.jsx(de,{compactPricing:f,inlineBuyRow:b,action:t,authors:a,cartable:s,causes:Z,coupon:r,showPackageSelection:u,onPackageChange:se=>l==null?void 0:l(se),productVariantDiscount:n,product:ee,alreadyOnWishlist:c.onWishlist,redirectToCartAfterWishlistAdd:!1,redirectToCartAfterAdd:j,replaceInCart:g,onWishlistAdded:o,productType:S,timestamp:C==null?void 0:C.updatedAt,quickBuyHeader:!0,editMode:y,hideCredits:X,showQuantity:x});if(d){const x=Y(d).aggregate,f=e.jsxs("div",{className:"space-y-5",children:[e.jsx($e,{details:d}),e.jsx(ye,{book:{state:d.state,hasSample:d.hasSample,hasPdfSample:d.hasPdfSample,samplePdfUrl:d.samplePdfUrl,hasEpubSample:d.hasEpubSample,sampleEpubUrl:d.sampleEpubUrl}}),e.jsxs("div",{className:"flex items-center gap-2.5 text-left text-xs text-neutral-500 dark:text-neutral-400",children:[e.jsx(N,{icon:oe,className:"shrink-0 text-base text-blue-500"}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsxs("div",{children:[e.jsx(i,{k:"w_happiness_guarantee_title"}),":"]}),e.jsx("div",{children:e.jsx(i,{k:"w_happiness_guarantee_tagline",opts:{defaultValue:"Satisfaction guaranteed or one click refund."}})})]})]})]}),b=e.jsxs("div",{className:"max-w-2xl",children:[e.jsx("h3",{className:"mb-2 text-base leading-6 font-extrabold text-zinc-950 dark:text-white",children:e.jsx(i,{k:"w_pick_your_price"})}),I(!0,!0,!0)]});return e.jsxs(M,{size:"5xl",open:m,onClose:o,className:"relative flex h-[88vh] max-h-[1000px] flex-col p-0!",children:[e.jsx(O,{className:"sr-only",children:F}),e.jsx(Me,{onClose:o}),e.jsxs("header",{className:"shrink-0 border-b border-neutral-200 px-14 pt-5 pb-4 text-center dark:border-zinc-700",children:[e.jsx("h2",{lang:($=d.language)==null?void 0:$.code2,className:"text-[28px]/9 font-extrabold text-balance text-slate-900 sm:text-[34px]/10 dark:text-white",children:_}),d.subtitle&&e.jsx("p",{lang:(H=d.language)==null?void 0:H.code2,className:"mt-1 text-sm font-medium text-pretty text-slate-600 sm:text-base dark:text-slate-300",children:d.subtitle})]}),e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col overflow-y-auto md:flex-row md:overflow-y-hidden",children:[e.jsx("aside",{className:"border-b border-neutral-200 md:w-[21rem] md:shrink-0 md:overflow-y-auto md:border-r md:border-b-0 lg:w-[23rem] dark:border-zinc-700",children:e.jsxs("div",{className:"space-y-5 p-5 sm:p-6",children:[e.jsx(W,{productType:S,src:k==null?void 0:k.url,src2x:w==null?void 0:w.url,alt:_??"",className:`mx-auto ${S==="book"?"w-32 sm:w-40":"w-full rounded-md"} ${D?"border border-gray-200 shadow-sm dark:border-zinc-700":""}`}),e.jsx(ue,{percentComplete:d.percentComplete,lastPublishedAt:d.lastPublishedAt??void 0,type:S==="course"?"AuthorCourse":"AuthorBook",compact:!0,className:"w-full px-0"}),e.jsx(we,{recentProgress:d.recentProgress}),e.jsx(E,{test:a.length>0,children:e.jsx("div",{className:"flex justify-center",children:e.jsx(K,{authors:a,size:"sm"})})}),x&&x.totalCount>0&&e.jsxs("div",{className:"flex items-center justify-center gap-1.5 text-xs text-neutral-500 dark:text-neutral-400",children:[e.jsx(T,{rating:x.averageRating}),e.jsx("span",{className:"font-semibold text-neutral-700 dark:text-neutral-200",children:x.averageRating.toFixed(1)}),e.jsxs("span",{children:["(",x.totalCount,")"]})]}),e.jsxs("div",{className:"hidden space-y-5 md:block",children:[e.jsx("hr",{className:"border-neutral-200 dark:border-zinc-700"}),f]})]})}),e.jsxs("div",{className:"flex min-w-0 flex-col md:min-h-0 md:flex-1",children:[d.sanitizedTeaserText&&e.jsx("div",{className:"content shrink-0 px-4 pt-4 pb-3 text-xs/5 text-pretty text-neutral-600 md:px-6 dark:text-neutral-400",dangerouslySetInnerHTML:{__html:d.sanitizedTeaserText}}),e.jsx(Ve,{details:d,pricePanel:b}),e.jsx("div",{className:"border-t border-neutral-200 px-4 py-6 md:hidden dark:border-zinc-700",children:f})]})]})]})}return e.jsx(M,{size:"4xl",open:m,onClose:o,children:e.jsxs(ce,{children:[e.jsxs("section",{className:"mx-auto flex max-w-3xl justify-between",children:[e.jsx(O,{className:"text-2xl text-black md:text-3xl dark:text-white",children:F}),e.jsxs("button",{className:"focus-within:ring-azure-500 rounded-sm bg-white text-2xl text-black focus-within:ring-2 focus-within:ring-offset-2 focus-within:outline-hidden focu
3s:outline-hidden md:text-3xl dark:bg-transparent dark:text-white",onClick:o,children:[e.jsx("span",{className:"sr-only",children:e.jsx(i,{k:"w_close"})}),e.jsx(N,{width:"24px",height:"24px",icon:Q})]})]}),e.jsxs("section",{className:"mx-auto flex max-w-3xl flex-col gap-x-8 gap-y-8 pt-8 md:flex-row",children:[e.jsxs("div",{className:"hidden flex-col justify-start gap-2 md:flex md:w-48 md:shrink-0",children:[e.jsx(W,{productType:S,src:k==null?void 0:k.url,src2x:w==null?void 0:w.url,alt:_??"",className:`w-full ${D?"border border-gray-300 dark:border-zinc-600":""}`}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-left text-sm text-black rtl:text-right dark:text-white",children:_}),e.jsx(E,{test:a.length>0,children:e.jsx(K,{authors:a})}),e.jsx(E,{test:!!c.books,children:e.jsx("p",{className:"text-xs text-neutral-600 dark:text-neutral-400",children:e.jsx(i,{k:"w_book_count",count:(V=c.books)==null?void 0:V.length})})}),c.sanitizedTeaserText&&e.jsx("div",{className:"content mt-2 text-left text-xs text-pretty text-neutral-600 dar
3k:text-neutral-400",dangerouslySetInnerHTML:{__html:c.sanitizedTeaserText}})]})]}),e.jsxs("div",{className:"flex w-full flex-col",children:[e.jsx("h2",{className:"flex justify-center text-2xl leading-8 font-extrabold text-nowrap text-zinc-950 md:justify-start dark:text-white",children:e.jsx(i,{k:"w_pick_your_price"})}),I(!1)]})]})]})})};export{ye as B,ds as Q,we as R}; 4 5//# debugId=0d799d3c-a3e5-546e-8c4f-9aea798994d5
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.