import{w as A,b as D}from"./chunk-LFPYN7LY-BBzdRvLF.js";import{j as e}from"./jsx-runtime-C35QZyMw.js";import{c as P}from"./clsx-B-dksMZM.js";import{R as T}from"./index-CChS_xIc.js";import{R as o}from"./rta-CWsRFxpt.js";import{T as S}from"./testimonials-CAQQVBVb.js";import{u as m}from"./money-T-TDS_ve.js";import{C as k,S as R,I as n}from"./_layout-BNJ68AEo.js";import{a as d,b as B}from"./use_date_formatter-Cr9OEzCp.js";import{E as C,a as F}from"./event_signup_form-DbNIXD_z.js";import{S as L}from"./seats_remaining_badge-rmHSnhDC.js";import{u as h}from"./useTranslation-Dc8c5s9c.js";import"./index-BdpIwg40.js";import"./index.es-B9AeAEQu.js";import"./index-DzGUYBzK.js";import"./index-Nq6i3Apf.js";import"./index-C4yKd876.js";import"./utils-0exNfmSl.js";import"./context-CP2rsCe9.js";import"./container-C4F3RlnX.js";import"./testimonial-QcW4ydJr.js";import"./user_image-DbuAi9pg.js";import"./index-Butpa68k.js";import"./banner_write_publish-tb4zvDW8.js";import"./banner_guarantee_happiness-CciJq_bh.js";import"./subheader-CtidEmzH.js";import"./errors-IAFTSjsJ.js";import"./conditional_render-ByK4f_-f.js";import"./header_navigation_link_data-C731rLKo.js";import"./index-Cn2cppKJ.js";import"./r_submit-U2UFH8kv.js";import"./r_button-4RWxHxg3.js";import"./rc_form-BYELXq4t.js";import"./r_error_alert-D98_m9co.js";import"./use_recaptcha-BUKy0-kG.js";import"./r_form-B_q4jhG5.js";import"./r_toaster-DWpqLxr2.js";import"./r_hidden-ZUf5Wb6e.js";import"./rc_hidden-CF6RK3PH.js";import"./helpers-DCvJqcYI.js";import"./_rollupPluginBabelHelpers-BAPqdPRJ.js";import"./form-I_xcoDes.js";import"./r_text_input-DScy6Ibb.js";import"./index-C1HDAmvx.js";import"./index-GTZDPbkC.js";import"./label-Bl9lipeB.js";import"./use-sync-refs-BVOyhIhP.js";import"./description-L7M3MMUj.js";import"./field-CM87aVBf.js";import"./form-fields-CMYcAy6_.js";import"./index-DkQvyDfJ.js";import"./hidden-BBJayvbf.js";import"./service_credit_cta-DBW4NzRg.js";import"./terms_acceptance-DXlmlbi8.js";import"./hooks-pV1BYUlI.js";import"./submission-fqzDCdHo.js";import"./parse-DN-KmNTY.js";import"./_rollupPluginBabelHelpers-DsGIkDcD.js";import"./types-Cy4-ZnvU.js";const Ze=()=>[{title:"Book Workshop - Leanpub"}],qe=A(function({loaderData:{isLoggedIn:a,hasTicket:_,userEmail:u,serviceBalance:g,price:i,productVariantId:j,discount:s,soldOut:f,showRemaining:w,nextEvent:r,testimonials:N},actionData:v}){const{t}=h("author");s==null||s.discountedPrice;const c=d({weekday:"long",year:"numeric",month:"long",day:"numeric"}),p=d({hour:"numeric",minute:"2-digit",timeZone:"America/Los_Angeles"}),x=d({hour:"numeric",minute:"2-digit"}),l=B(),y=l==="PDT"||l==="PST";return e.jsxs(e.Fragment,{children:[e.jsxs(k,{title:t("book_workshop_title"),children:[e.jsx("p",{className:"mx-auto mb-10 max-w-2xl text-center text-xl leading-relaxed text-slate-600 dark:text-slate-300",children:t("book_workshop_tagline")}),r&&e.jsxs("div",{className:"mx-auto mb-10 max-w-2xl rounded-lg border border-blue-200 bg-blue-50 px-6 py-4 text-center dark:border-blue-800 dark:bg-blue-900/30",children:[e.jsx("p",{className:"text-lg font-semibold text-blue-900 dark:text-blue-100",children:t("book_workshop_next_event")}),e.jsx("p",{className:"text-2xl font-bold text-blue-700 dark:text-blue-300",children:c.format(new Date(r.startsAt))}),e.jsxs("p",{className:"text-lg text-blue-600 dark:text-blue-400",children:[p.format(new Date(r.startsAt))," — ",p.format(new Date(r.endsAt))," ","Pacific Time"]}),!y&&e.jsxs("p",{className:"text-sm text-blue-500 dark:text-blue-400",children:["(",x.format(new Date(r.startsAt))," — ",x.format(new Date(r.endsAt))," ",l,")"]}),e.jsx(C,{startsAt:r.startsAt,endsAt:r.endsAt}),e.jsx("div",{className:"mt-3",children:e.jsx(L,{seatsRemaining:r.seatsRemaining,capacity:r.capacity,forceShow:w,translationPrefix:"book_workshop"})})]}),e.jsx(R,{src:"/images/events/book_workshop.png",alt:t("book_workshop_title")}),e.jsxs(n,{title:t("book_workshop_what_is_title"),children:[e.jsx("p",{children:e.jsx(o,{k:"book_workshop_p1",components:{strong:e.jsx("strong",{})}})}),e.jsx("p",{children:e.jsx(o,{k:"book_workshop_p2",components:{strong:e.jsx("strong",{})}})}),e.jsx("p",{children:e.jsx(o,{k:"book_workshop_p3",components:{strong:e.jsx("strong",{})}})})]}),e.jsx("section",{className:"mx-auto mb-10 max-w-3xl",children:e.jsxs("div",{className:"mx-auto max-w-xl rounded-lg border-2 border-blue-200 bg-white p-8 shadow-sm dark:border-blue-800 dark:bg-slate-800",children:[e.jsx("h3",{className:"mb-2 text-center text-2xl font-bold tracking-tight dark:text-white",children:t("book_workshop_value_stack_title")}),e.jsxs("div",{className:"mb-6 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-md bg-slate-50 px-4 py-3 dark:bg-slate-700/50",children:[e.jsx("span",{className:"text-sm font-medium dark:text-slate-200",children:t("book_workshop_value_stack_event")}),e.jsx("span",{className:"text-sm font-semibold text-slate-500 dark:text-slate-400",children:t("book_workshop_value_stack_event_value")})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-md bg-slate-50 px-4 py-3 dark:bg-slate-700/50",children:[e.jsx("span",{className:"text-sm font-medium dark:text-slate-200",children:t("book_workshop_value_stack_membership")}),e.jsx("span",{className:"text-sm font-semibold text-slate-500 dark:text-slate-400",children:t("book_workshop_value_stack_membership_value")})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-md bg-slate-50 px-4 py-3 dark:bg-slate-700/50",children:[e.jsx("span",{className:"text-sm font-medium dark:text-slate-200",children:t("book_workshop_value_stack_discount")}),e.jsx("span",{className:"text-sm font-semibold text-slate-500 dark:text-slate-400",children:t("book_workshop_value_stack_discount_value")})]}),e.jsxs("div",{className:"flex items-center justify-between border-t-2 border-slate-300 px-4 pt-3 dark:border-slate-600",children:[e.jsx("span",{className:"text-sm font-bold dark:text-white",children:t("book_workshop_value_stack_total")}),e.jsx("span",{className:"text-lg font-bold line-through opacity-60 dark:text-slate-400",children:t("book_workshop_value_stack_total_value")})]})]}),e.jsxs("div",{className:"mb-4 text-center",children:[e.jsx("span",{className:P("text-4xl font-bold",s&&"line-through opacity-60"),children:m(i)}),s&&e.jsxs(e.Fragment,{children:[" ",e.jsx("span",{className:"text-4xl font-bold text-green-600 dark:text-green-400",children:m(s.discountedPrice)})]})]}),s&&e.jsxs("p",{className:"mb-4 text-center text-sm text-green-700 dark:text-green-400",children:[s.sourceDescription," discount (-",m(s.discountAmount),")"]}),f?e.jsxs("div",{className:"mt-6 rounded-lg border border-red-200 bg-red-50 px-4 py-4 text-center dark:border-red-800 dark:bg-red-900/20",children:[e.jsx("p",{className:"text-sm font-semibold text-red-800 dark:text-red-300",children:t("book_workshop_sold_out")}),e.jsxs("p",{className:"mt-1 text-xs text-red-600 dark:text-red-400",children:["All ",r==null?void 0:r.capacity," spots have been claimed. Check back for the next event!"]})]}):_?e.jsxs("div",{className:"mt-6 rounded-lg border border-green-200 bg-green-50 px-4 py-6 text-center dark:border-green-800 dark:bg-green-900/20",children:[e.jsx("span",{className:"mb-3 inline-flex h-10 w-10 items-center justify-center rounded-full bg-green-500 text-lg text-white",children:"✓"}),e.jsx("h3",{className:"mb-1 text-lg font-bold text-green-900 dark:text-green-100",children:t("book_workshop_already_registered_title")}),e.jsxs("p",{className:"text-sm text-green-800 dark:text-green-300",children:["You already have a ticket for the"," ",r?e.jsx("strong",{children:c.format(new Date(r.startsAt))}):"upcoming"," ","Book Workshop for ",e.jsx("strong",{children:u}),". See you soon!"]})]}):e.jsx(F,{actionData:v,productVariantId:j,price:i,discount:s,isLoggedIn:a,serviceBalance:g,formIdPrefix:"book-workshop",translationPrefix:"book_workshop",registerMode:"register_and_purchase"})]})}),e.jsx(n,{title:t("book_workshop_what_is_leanpub_title"),children:e.jsx("p",{children:e.jsx(o,{k:"book_workshop_what_is_leanpub_p1",components:{strong:e.jsx("strong",{})}})})}),e.jsx(n,{title:"",children:e.jsx("p",{className:"text-center",children:e.jsx(o,{k:"book_workshop_cta_upgrade",links:{membershipLink:"/authors",fulldayLink:"/events/full_day",bootcampLink:"/events/book_bootcamp"},components:{strong:e.jsx("strong",{})}})})})]}),e.jsx("div",{className:"relative right-1/2 left-1/2 -mx-[50vw] w-screen",children:e.jsx(S,{testimonials:N})})]})}),Ge=D(function(){const{t:a}=h("author");return e.jsx(k,{title:a("book_workshop_title"),children:e.jsx("div",{className:"mb-12",children:e.jsx(T,{level:"warning",message:a("service_is_currently_unavailable")})})})});export{Ge as ErrorBoundary,qe as default,Ze as meta};