PageSourceSearch

https://autojunket.com/_next/static/chunks/pages/payment/success-c3861a89b1ceb49f.js

js autojunket.com collected 2026-10-10 02:24:12 UTC 37,563 bytes, 36 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7638],{1331:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/payment/success",function(){return s(590)}])},7288:function(e,t,s){"use strict";s.d(t,{z:function(){return d}});var a=s(5893),i=s(7294),r=s(8426),n=s(2003),c=s(4819);let l=(0,n.j)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),d=i.forwardRef((e,t)=>{let{className:s,variant:i,size:n,asChild:d=!1,...o}=e,m=d?r.g7:"button";return(0,a.jsx)(m,{className:(0,c.cn)(l({variant:i,size:n,className:s})),ref:t,...o})});d.displayName="Button"},6008:function(e,t,s){"use strict";s.d(t,{Ol:function(){return c},Zb:function(){return n},aY:function(){return d},ll:function(){return l}});var a=s(5893),i=s(7294),r=s(4819);let n=i.forwardRef((e,t)=>{let{className:s,...i}=e;return(0,a.jsx)("div",{ref:t,className:(0,r.cn)("rounded-xl border bg-card text-card-foreground shadow",s),...i})});n.displayName="Card";let c=i.forwardRef((e,t)=>{let{className:s,...i}=e;return(0,a.jsx)("div",{ref:t,className:(0,r.cn)("flex flex-col space-y-1.5 p-6",s),...i})});c.displayName="CardHeader";let l=i.forwardRef((e,t)=>{let{className:s,...i}=e;return(0,a.jsx)("div",{ref:t,className:(0,r.cn)("font-semibold leading-none tracking-tight",s),...i})});l.displayName="CardTitle",i.forwardRef((e,t)=>{let{className:s,...i}=e;return(0,a.jsx)("div",{ref:t,className:(0,r.cn)("text-sm text-muted-foreground",s),...i})}).displayName="CardDescription";let d=i.forwardRef((e,t)=>{let{className:s,...i}=e;return(0,a.jsx)("div",{ref:t,className:(0,r.cn)("p-6 pt-0",s),...i})});d.displayName="CardContent",i.forwardRef((e,t)=>{let{className:s,...i}=e;return(0,a.jsx)("div",{ref:t,className:(0,r.cn)("flex items-center p-6 pt-0",s),...i})}).displayName="CardFooter"},8137:function(e,t,s){"use strict";s.d(t,{I:function(){return n}});var a=s(5893),i=s(7294),r=s(4819);let n=i.forwardRef((e,t)=>{let{className:s,type:i,...n}=e;return(0,a.jsx)("input",{type:i,className:(0,r.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",s),ref:t,...n})});n.displayName="Input"},7512:function(e,t,s){"use strict";s.d(t,{_:function(){return d}});var a=s(5893),i=s(7294),r=s(9489),n=s(2003),c=s(4819);let l=(0,n.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=i.forwardRef((e,t)=>{let{className:s,...i}=e;return(0,a.jsx)(r.f,{ref:t,className:(0,c.cn)(l(),s),...i})});d.displayName=r.f.displayName},4356:function(e,t,s){"use strict";s.d(t,{Bw:function(){return u},Ph:function(){return o},Ql:function(){return f},i4:function(){return x},ki:function(){return m}});var a=s(5893),i=s(7294),r=s(8615),n=s(1568),c=s(4098),l=s(3785),d=s(4819);let o=r.fC;r.ZA;let m=r.B4,x=i.forwardRef((e,t)=>{let{className:s,children:i,...c}=e;return(0,a.jsxs)(r.xz,{ref:t,className:(0,d.cn)("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",s),...c,children:[i,(0,a.jsx)(r.JO,{asChild:!0,children:(0,a.jsx)(n.Z,{className:"h-4 w-4 opacity-50"})})]})});x.displayName=r.xz.displayName;let h=i.forwardRef((e,t)=>
1{let{className:s,...i}=e;return(0,a.jsx)(r.u_,{ref:t,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",s),...i,children:(0,a.jsx)(c.Z,{className:"h-4 w-4"})})});h.displayName=r.u_.displayName;let p=i.forwardRef((e,t)=>{let{className:s,...i}=e;return(0,a.jsx)(r.$G,{ref:t,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",s),...i,children:(0,a.jsx)(n.Z,{className:"h-4 w-4"})})});p.displayName=r.$G.displayName;let u=i.forwardRef((e,t)=>{let{className:s,children:i,position:n="popper",...c}=e;return(0,a.jsx)(r.h_,{children:(0,a.jsxs)(r.VY,{ref:t,className:(0,d.cn)("relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",s),position:n,...c,children:[(0,a.jsx)(h,{}),(0,a.jsx)(r.l_,{className:(0,d.cn)("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:i}),(0,a.jsx)(p,{})]})})});u.displayName=r.VY.displayName,i.forwardRef((e,t)=>{let{className:s,...i}=e;return(0,a.jsx)(r.__,{ref:t,className:(0,d.cn)("px-2 py-1.5 text-sm font-semibold",s),...i})}).displayName=r.__.displayName;let f=i.forwardRef((e,t)=>{let{className:s,children:i,...n}=e;return(0,a.jsxs)(r.ck,{ref:t,className:(0,d.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...n,children:[(0,a.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(r.wU,{children:(0,a.jsx)(l.Z,{className:"h-4 w-4"})})}),(0,a.jsx)(r.eT,{children:i})]})});f.displayName=r.ck.displayName,i.forwardRef((e,t)=>{let{className:s,...i}=e;return(0,a.jsx)(r.Z0,{ref:t,className:(0,d.cn)("-mx-1 my-1 h-px bg-muted",s),...i})}).displayName=r.Z0.displayName},4819:function(e,t,s){"use strict";s.d(t,{cn:function(){return r}});var a=s(512),i=s(8388);function r(){for(var e=arguments.length,t=Array(e),s=0;s<e;s++)t[s]=arguments[s];return(0,i.m6)((0,a.W)(t))}},3364:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/**
2 * @license lucide-react v0.294.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */let a=(0,s(4370).Z)("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},5875:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/**
7 * @license lucide-react v0.294.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */let a=(0,s(4370).Z)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},3594:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/**
12 * @license lucide-react v0.294.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */let a=(0,s(4370).Z)("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]])},7886:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/**
17 * @license lucide-react v0.294.0 - ISC
18 *
19 * This source code is licensed under the ISC license.
20 * See the LICENSE file in the root directory of this source tree.
21 */let a=(0,s(4370).Z)("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]])},5677:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/**
22 * @license lucide-react v0.294.0 - ISC
23 *
24 * This source code is licensed under the ISC license.
25 * See the LICENSE file in the root directory of this source tree.
26 */let a=(0,s(4370).Z)("MapPin",[["path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z",key:"2oe9fu"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]])},1880:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/**
27 * @license lucide-react v0.294.0 - ISC
28 *
29 * This source code is licensed under the ISC license.
30 * See the LICENSE file in the root directory of this source tree.
31 */let a=(0,s(4370).Z)("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]])},637:function(e,t,s){"use strict";s.d(t,{Z:function(){return a}});/**
32 * @license lucide-react v0.294.0 - ISC
33 *
34 * This source code is licensed under the ISC license.
35 * See the LICENSE file in the root directory of this source tree.
36 */let a=(0,s(4370).Z)("Truck",[["path",{d:"M5 18H3c-.6 0-1-.4-1-1V7c0-.6.4-1 1-1h10c.6 0 1 .4 1 1v11",key:"hs4xqm"}],["path",{d:"M14 9h4l4 4v4c0 .6-.4 1-1 1h-2",key:"11fp61"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}]])},590:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return _}});var a=s(5893),i=s(7294),r=s(1163),n=s(7066),c=s(6030),l=s(3364),d=s(3785),o=s(7188),m=s(7886),x=s(5875),h=s(1880),p=s(5677),u=s(637),f=s(3594),g=s(7288),j=s(8137),N=s(7512),b=s(6008),w=s(4356),v=s(4712),y=s(4819);
36let A="/api",k=[{code:"AL",name:"Alabama"},{code:"AK",name:"Alaska"},{code:"AZ",name:"Arizona"},{code:"AR",name:"Arkansas"},{code:"CA",name:"California"},{code:"CO",name:"Colorado"},{code:"CT",name:"Connecticut"},{code:"DE",name:"Delaware"},{code:"FL",name:"Florida"},{code:"GA",name:"Georgia"},{code:"HI",name:"Hawaii"},{code:"ID",name:"Idaho"},{code:"IL",name:"Illinois"},{code:"IN",name:"Indiana"},{code:"IA",name:"Iowa"},{code:"KS",name:"Kansas"},{code:"KY",name:"Kentucky"},{code:"LA",name:"Louisiana"},{code:"ME",name:"Maine"},{code:"MD",name:"Maryland"},{code:"MA",name:"Massachusetts"},{code:"MI",name:"Michigan"},{code:"MN",name:"Minnesota"},{code:"MS",name:"Mississippi"},{code:"MO",name:"Missouri"},{code:"MT",name:"Montana"},{code:"NE",name:"Nebraska"},{code:"NV",name:"Nevada"},{code:"NH",name:"New Hampshire"},{code:"NJ",name:"New Jersey"},{code:"NM",name:"New Mexico"},{code:"NY",name:"New York"},{code:"NC",name:"North Carolina"},{code:"ND",name:"North Dakota"},{code:"OH",name:"Ohio"},{code:"OK",name:"Oklahoma"},{code:"OR",name:"Oregon"},{code:"PA",name:"Pennsylvania"},{code:"RI",name:"Rhode Island"},{code:"SC",name:"South Carolina"},{code:"SD",name:"South Dakota"},{code:"TN",name:"Tennessee"},{code:"TX",name:"Texas"},{code:"UT",name:"Utah"},{code:"VT",name:"Vermont"},{code:"VA",name:"Virginia"},{code:"WA",name:"Washington"},{code:"WV",name:"West Virginia"},{code:"WI",name:"Wisconsin"},{code:"WY",name:"Wyoming"},{code:"DC",name:"Washington DC"}];function _(){var e,t,s,_;let F=(0,r.useRouter)(),{id:C,session_id:Z}=F.query,[D,P]=(0,i.useState)(null),[S,I]=(0,i.useState)(null),[M,O]=(0,i.useState)([]),[R,Y]=(0,i.useState)(!0),[B,E]=(0,i.useState)(!1),[T,z]=(0,i.useState)(null),[$,V]=(0,i.useState)(null),[W,q]=(0,i.useState)("MAIL"),[L,G]=(0,i.useState)(!1),[H,U]=(0,i.useState)(1),[J,K]=(0,i.useState)({name:"",street1:"",street2:"",city:"",state_code:"",postcode:"",email:"",phone_number:""}),[X,Q]=(0,i.useState)(!1);(0,i.useEffect)(()=>{ee(),et(),O([{id:"MAIL",name:"Standard Mail",description:"7-14 business days",price:null},{id:"PRIORITY_MAIL",name:"Priority Mail",description:"4-7 business days",price:null},{id:"GROUND",name:"Ground Shipping",description:"5-10 business days",price:null}])},[C]),(0,i.useEffect)(()=>{Z&&ea(Z)},[Z]),(0,i.useEffect)(()=>{2===H&&J.city&&J.state_code&&J.postcode&&es()},[H,J.city,J.state_code,J.postcode]);let ee=async()=>{if(!C){Y(!1);return}try{let e=await n.Z.get("".concat(A,"/guidebooks/").concat(C));P(e.data),e.data.custom_cover_image?V("custom_cover"):V("generic_cover")}catch(e){console.error("Error fetching book:",e),v.Am.error("Failed to load guidebook"),F.push("/my-books")}finally{Y(!1)}},et=async()=>{try{let e=await n.Z.get("".concat(A,"/pricing"));I(e.data.packages)}catch(e){console.error("Error fetching pricing:",e)}},es=async()=>{Q(!0);try{let e=await n.Z.post("".concat(A,"/lulu/shipping-quotes"),{city:J.city,state_code:J.state_code,postcode:J.postcode,country_code:"US"});e.data.quotes&&O(e.data.quotes)}catch(e){console.error("Error fetching shipping quotes:",e)}finally{Q(!1)}},ea=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(t>=10){z({status:"timeout",message:"Payment status check timed out. Please check your email for confirmation."}),E(!1);return}E(!0);try{let s=(await n.Z.get("".concat(A,"/checkout/status/").concat(e))).data;if("paid"===s.payment_status){v.Am.success("Payment successful! Submitting order to printer...");let t=localStorage.getItem("shipping_".concat(s.guidebook_id||C)),a=t?JSON.parse(t):null;if(a)try{let t=await n.Z.post("".concat(A,"/orders/process"),{guidebook_id:s.guidebook_id||C,session_id:e,shipping_address:{name:a.name,street1:a.street1,street2:a.street2||"",city:a.city,state_code:a.state_code,postcode:a.postcode,email:a.email,phone_number:a.phone_number||""},shipping_level:a.shipping_level||"MAIL"});"success"===t.data.status?(v.Am.success("Order submitted successfully!"),localStorage.removeItem("shipping_".concat(s.guidebook_id||C))):"lulu_error"===t.data.status&&v.Am.warning("Payment received, but order processing delayed. We'll handle it shortly.")}catch(e){console.error("Order processing error:",e),v.Am.warning("Payment received! We'll process your order shortly.")}z({status:"success",message:"Payment successful! Your order is being processed."}),E(!1);return}if("expired"===s.status){z({status:"expired",message:"Payment session expired. Please try again."}),E(!1);return}setTimeout(()=>ea(e,t+1),2e3)}catch(e){console.error("Error checking payment status:",e),z({status:"error",message:"Error checking payment status. Please try again."}),E(!1)}},ei=()=>{for(let t of["name","street1","city","state_code","postcode","email"]){var e;if(!(null===(e=J[t])||void 0===e?void 0:e.trim()))return v.Am.error("Please enter ".concat(t.replace("_"," "))),!1}return/^\d{5}(-\d{4})?$/.test(J.postcode)?!!/\S+@\S+\.\S+/.test(J.email)||(v.Am.error("Please enter a valid email address"),!1):(v.Am.error("Please enter a valid ZIP code"),!1)},er=async()=>
36{if(!$){v.Am.error("Please select a package");return}if(!ei())return;let e=(null==el?void 0:el.price)||0;G(!0);try{localStorage.setItem("shipping_".concat(C),JSON.stringify({...J,shipping_level:W}));let t=await n.Z.post("".concat(A,"/checkout/create-session"),{guidebook_id:C,package_type:$,origin_url:window.location.origin,shipping_cost:e,shipping_level:W});if(t.data.url)window.location.href=t.data.url;else throw Error("No checkout URL received")}catch(e){var t,s;console.error("Checkout error:",e),v.Am.error((null===(s=e.response)||void 0===s?void 0:null===(t=s.data)||void 0===t?void 0:t.detail)||"Failed to start checkout. Please try again.")}finally{G(!1)}},en=()=>{let e=(null==D?void 0:D.cover_theme)||"midnight";return"".concat(A,"/guidebooks/").concat(C,"/cover-preview?package_type=").concat($,"&theme=").concat(e,"&t=").concat(Date.now())};if(R)return(0,a.jsx)("div",{className:"flex items-center justify-center min-h-[60vh]",children:(0,a.jsx)(c.Z,{className:"w-8 h-8 text-[#D4AF71] animate-spin"})});if(!D)return(0,a.jsxs)("div",{className:"text-center py-20",children:[(0,a.jsx)(l.Z,{className:"w-12 h-12 text-[#FF2A2A] mx-auto mb-4"}),(0,a.jsx)("p",{className:"text-[#A1A1AA]",children:"Guidebook not found"})]});if((null==T?void 0:T.status)==="success"){let e=(null==T?void 0:T.package_type)==="pdf_download";return(0,a.jsx)("div",{className:"max-w-2xl mx-auto space-y-8 animate-fade-in","data-testid":"payment-success",children:(0,a.jsx)(b.Zb,{className:"bg-[#0F0F10] border-[#00FF94]/30",children:(0,a.jsxs)(b.aY,{className:"p-12 text-center",children:[(0,a.jsx)("div",{className:"w-20 h-20 bg-[#00FF94]/20 rounded-full flex items-center justify-center mx-auto mb-6",children:(0,a.jsx)(d.Z,{className:"w-10 h-10 text-[#00FF94]"})}),(0,a.jsx)("h2",{className:"text-3xl font-bold font-['Barlow_Condensed'] uppercase text-white mb-4",children:e?"Purchase Complete!":"Order Confirmed!"}),(0,a.jsxs)("p",{className:"text-[#A1A1AA] mb-6",children:["Your guidebook for ",(0,a.jsxs)("span",{className:"text-white",children:[D.year," ",D.make," ",D.model]})," ",e?"is ready for download.":"is being prepared for printing."]}),e?(0,a.jsxs)("div",{className:"space-y-4 mb-8",children:[(0,a.jsx)("p",{className:"text-sm text-[#71717A]",children:"Download your PDF files:"}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[(0,a.jsxs)(g.z,{onClick:()=>window.open("".concat(A,"/guidebooks/").concat(C,"/download-purchased?file_type=interior"),"_blank"),className:"h-12 px-6 font-mono uppercase tracking-wider bg-[#D4AF71] text-black hover:bg-[#D4AF71]/90","data-testid":"download-interior-btn",children:[(0,a.jsx)(o.Z,{className:"w-4 h-4 mr-2"}),"Download Interior PDF"]}),(0,a.jsxs)(g.z,{onClick:()=>window.open("".concat(A,"/guidebooks/").concat(C,"/download-purchased?file_type=cover"),"_blank"),variant:"outline",className:"h-12 px-6 font-mono uppercase tracking-wider border-white/20 text-white hover:bg-white/5","data-testid":"download-cover-btn",children:[(0,a.jsx)(m.Z,{className:"w-4 h-4 mr-2"}),"Download Cover PDF"]})]})]}):(0,a.jsx)("p",{className:"text-sm text-[#71717A] mb-8",children:"You will receive an email with tracking information once your order ships."}),(0,a.jsx)(g.z,{onClick:()=>F.push("/book/".concat(C)),variant:e?"outline":"default",className:(0,y.cn)("h-12 px-8 font-mono uppercase tracking-wider",e?"border-white/20 text-white hover:bg-white/5":"bg-[#D4AF71] text-black hover:bg-[#D4AF71]/90"),"data-testid":"back-to-book-btn",children:"Back to Guidebook"})]})})})}if(B)return(0,a.jsx)("div",{className:"max-w-2xl mx-auto space-y-8 animate-fade-in","data-testid":"checking-payment",children:(0,a.jsx)(b.Zb,{className:"bg-[#0F0F10] border-white/5",children:(0,a.jsxs)(b.aY,{className:"p-12 text-center",children:[(0,a.jsx)(c.Z,{className:"w-12 h-12 text-[#D4AF71] animate-spin mx-auto mb-6"}),(0,a.jsx)("h2",{className:"text-2xl font-bold font-['Barlow_Condensed'] uppercase text-white mb-4",children:"Verifying Payment..."}),(0,a.jsx)("p",{className:"text-[#A1A1AA]",children:"Please wait while we confirm your payment."})]})})});let ec=null==S?void 0:S.find(e=>e.id===$),el=null==M?void 0:M.find(e=>e.id===W);
36return(0,a.jsxs)("div",{className:"max-w-4xl mx-auto space-y-8 animate-fade-in","data-testid":"order-print-page",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("button",{onClick:()=>H>1?U(H-1):F.push("/book/".concat(C)),className:"flex items-center gap-2 text-[#71717A] hover:text-white transition-colors mb-4","data-testid":"back-btn",children:[(0,a.jsx)(x.Z,{className:"w-4 h-4"}),(0,a.jsx)("span",{className:"text-xs font-mono",children:H>1?"Back":"Back to Editor"})]}),(0,a.jsx)("h1",{className:"text-4xl font-bold tracking-tighter text-white font-['Barlow_Condensed'] uppercase",children:"Order Printed Copy"}),(0,a.jsxs)("p",{className:"mt-2 text-[#A1A1AA] text-sm",children:[D.year," ",D.make," ",D.model," Guidebook"]})]}),(0,a.jsx)("div",{className:"flex items-center gap-4",children:[1,2,3].map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:(0,y.cn)("w-8 h-8 rounded-full flex items-center justify-center font-mono text-sm",H>=e?"bg-[#D4AF71] text-black":"bg-white/10 text-[#71717A]"),children:e}),(0,a.jsx)("span",{className:(0,y.cn)("text-sm font-mono hidden sm:block",H>=e?"text-white":"text-[#71717A]"),children:1===e?"Package":2===e?"Shipping":"Review"}),e<3&&(0,a.jsx)("div",{className:"w-8 h-px bg-white/10"})]},e))}),1===H&&(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("h2",{className:"text-xl font-['Barlow_Condensed'] uppercase tracking-wide text-white",children:"Select Package"}),null==S?void 0:S.map(e=>(0,a.jsx)(b.Zb,{className:(0,y.cn)("bg-[#0F0F10] border-2 cursor-pointer transition-all hover:border-white/30",$===e.id?"border-[#D4AF71] shadow-[0_0_20px_rgba(0,240,255,0.2)]":"border-white/5"),onClick:()=>V(e.id),"data-testid":"package-".concat(e.id),children:(0,a.jsxs)(b.aY,{className:"p-6",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:["pdf_download"===e.id?(0,a.jsx)(o.Z,{className:"w-6 h-6 text-[#D4AF71]"}):"custom_cover"===e.id?(0,a.jsx)(m.Z,{className:"w-6 h-6 text-[#9333EA]"}):(0,a.jsx)(h.Z,{className:"w-6 h-6 text-[#C9A227]"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-['Barlow_Condensed'] text-lg uppercase text-white",children:e.name}),(0,a.jsx)("p",{className:"text-xs text-[#71717A] mt-1",children:e.description})]})]}),(0,a.jsx)("div",{className:(0,y.cn)("w-6 h-6 rounded-full border-2 flex items-center justify-center",$===e.id?"border-[#D4AF71] bg-[#D4AF71]":"border-white/30"),children:$===e.id&&(0,a.jsx)(d.Z,{className:"w-4 h-4 text-black"})})]}),(0,a.jsxs)("div",{className:"flex items-baseline gap-1 mb-4",children:[(0,a.jsxs)("span",{className:"text-3xl font-bold text-white",children:["$",e.price.toFixed(2)]}),(0,a.jsx)("span",{className:"text-sm text-[#71717A]",children:"USD"}),e.is_digital&&(0,a.jsx)("span",{className:"ml-2 text-xs bg-[#D4AF71]/20 text-[#D4AF71] px-2 py-0.5 rounded",children:"INSTANT"})]}),(0,a.jsx)("ul",{className:"space-y-2",children:e.features.map((e,t)=>(0,a.jsxs)("li",{className:"flex items-center gap-2 text-sm text-[#A1A1AA]",children:[(0,a.jsx)(d.Z,{className:"w-4 h-4 text-[#00FF94]"}),e]},t))})]})},e.id))]}),(0,a.jsx)("div",{children:(0,a.jsxs)(b.Zb,{className:"bg-[#0F0F10] border-white/5",children:[(0,a.jsx)(b.Ol,{children:(0,a.jsx)(b.ll,{className:"text-lg font-['Barlow_Condensed'] uppercase text-white",children:"Cover Preview"})}),(0,a.jsxs)(b.aY,{className:"space-y-4",children:[(0,a.jsx)("div",{className:"flex justify-center",children:(0,a.jsx)("div",{className:"relative",children:(0,a.jsx)("img",{src:en(),alt:"Cover Preview",className:"w-40 h-60 object-cover border border-white/10 shadow-lg transition-all duration-300",style:{boxShadow:"0 10px 30px rgba(0,0,0,0.5)"}})})}),(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("h3",{className:"font-['Barlow_Condensed'] uppercase text-white",children:D.title||"".concat(D.year," ").concat(D.make," ").concat(D.model)}),(0,a.jsxs)("p",{className:"text-xs text-[#71717A]",children:[(null===(e=D.chapters)||void 0===e?void 0:e.length)||0,' 
36chapters • 6" x 9" Paperback']})]}),(0,a.jsxs)("div",{className:"border-t border-white/5 pt-4",children:[(0,a.jsxs)("div",{className:"flex justify-between text-sm mb-2",children:[(0,a.jsx)("span",{className:"text-[#71717A]",children:"Package"}),(0,a.jsx)("span",{className:"text-white",children:(null==ec?void 0:ec.name)||"Select a package"})]}),(0,a.jsxs)("div",{className:"flex justify-between text-lg font-bold mt-4",children:[(0,a.jsx)("span",{className:"text-white",children:"Subtotal"}),(0,a.jsxs)("span",{className:"text-[#D4AF71]",children:["$",(null==ec?void 0:ec.price.toFixed(2))||"0.00"]})]}),(null==ec?void 0:ec.is_digital)?(0,a.jsx)("p",{className:"text-xs text-[#00FF94] mt-2",children:"Instant digital download - no shipping needed!"}):(0,a.jsx)("p",{className:"text-xs text-[#71717A] mt-2",children:"+ Shipping (calculated next)"})]}),(0,a.jsx)(g.z,{onClick:()=>{(null==ec?void 0:ec.is_digital)?er():U(2)},disabled:!$||!(null===(t=D.chapters)||void 0===t?void 0:t.length)||L,className:"w-full h-12 font-mono uppercase tracking-wider bg-[#D4AF71] text-black hover:bg-[#D4AF71]/90","data-testid":"continue-to-shipping-btn",children:L?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.Z,{className:"w-4 h-4 mr-2 animate-spin"}),"Processing..."]}):(null==ec?void 0:ec.is_digital)?"Purchase & Download":"Continue to Shipping"}),!(null===(s=D.chapters)||void 0===s?void 0:s.length)&&(0,a.jsx)("p",{className:"text-xs text-[#FF2A2A] text-center",children:"Please generate content before ordering"})]})]})})]}),2===H&&(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("h2",{className:"text-xl font-['Barlow_Condensed'] uppercase tracking-wide text-white flex items-center gap-2",children:[(0,a.jsx)(p.Z,{className:"w-5 h-5 text-[#D4AF71]"}),"Shipping Address"]}),(0,a.jsx)(b.Zb,{className:"bg-[#0F0F10] border-white/5",children:(0,a.jsx)(b.aY,{className:"p-6 space-y-4",children:(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"col-span-2",children:[(0,a.jsx)(N._,{className:"text-xs text-[#71717A]",children:"Full Name *"}),(0,a.jsx)(j.I,{value:J.name,onChange:e=>K({...J,name:e.target.value}),placeholder:"John Doe",className:"mt-1 bg-black/20 border-white/10","data-testid":"shipping-name"})]}),(0,a.jsxs)("div",{className:"col-span-2",children:[(0,a.jsx)(N._,{className:"text-xs text-[#71717A]",children:"Email *"}),(0,a.jsx)(j.I,{type:"email",value:J.email,onChange:e=>K({...J,email:e.target.value}),placeholder:"[email protected]",className:"mt-1 bg-black/20 border-white/10","data-testid":"shipping-email"})]}),(0,a.jsxs)("div",{className:"col-span-2",children:[(0,a.jsx)(N._,{className:"text-xs text-[#71717A]",children:"Street Address *"}),(0,a.jsx)(j.I,{value:J.street1,onChange:e=>K({...J,street1:e.target.value}),placeholder:"123 Main St",className:"mt-1 bg-black/20 border-white/10","data-testid":"shipping-street1"})]}),(0,a.jsxs)("div",{className:"col-span-2",children:[(0,a.jsx)(N._,{className:"text-xs text-[#71717A]",children:"Apt, Suite, etc."}),(0,a.jsx)(j.I,{value:J.street2,onChange:e=>K({...J,street2:e.target.value}),placeholder:"Apt 4B",className:"mt-1 bg-black/20 border-white/10","data-testid":"shipping-street2"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(N._,{className:"text-xs text-[#71717A]",children:"City *"}),(0,a.jsx)(j.I,{value:J.city,onChange:e=>K({...J,city:e.target.value}),placeholder:"New York",className:"mt-1 bg-black/20 border-white/10","data-testid":"shipping-city"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(N._,{className:"text-xs text-[#71717A]",children:"State *"}),(0,a.jsxs)(w.Ph,{value:J.state_code,onValueChange:e=>K({...J,state_code:e}),children:[(0,a.jsx)(w.i4,{className:"mt-1 bg-black/20 border-white/10","data-testid":"shipping-state",children:(0,a.jsx)(w.ki,{placeholder:"Select state"})}),(0,a.jsx)(w.Bw,{className:"bg-[#1A1A1C] border-white/10 max-h-[200px]",children:k.map(e=>(0,a.jsx)(w.Ql,{value:e.code,className:"text-white hover:bg-white/10",children:e.name},e.code))})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(N._,{className:"text-xs text-[#71717A]",children:"ZIP Co
36de *"}),(0,a.jsx)(j.I,{value:J.postcode,onChange:e=>K({...J,postcode:e.target.value}),placeholder:"10001",className:"mt-1 bg-black/20 border-white/10","data-testid":"shipping-zip"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(N._,{className:"text-xs text-[#71717A]",children:"Phone"}),(0,a.jsx)(j.I,{value:J.phone_number,onChange:e=>K({...J,phone_number:e.target.value}),placeholder:"(555) 123-4567",className:"mt-1 bg-black/20 border-white/10","data-testid":"shipping-phone"})]})]})})}),(0,a.jsxs)("h2",{className:"text-xl font-['Barlow_Condensed'] uppercase tracking-wide text-white flex items-center gap-2",children:[(0,a.jsx)(u.Z,{className:"w-5 h-5 text-[#D4AF71]"}),"Shipping Method",X&&(0,a.jsx)(c.Z,{className:"w-4 h-4 animate-spin text-[#D4AF71]"})]}),(0,a.jsx)(b.Zb,{className:"bg-[#0F0F10] border-white/5",children:(0,a.jsxs)(b.aY,{className:"p-4 space-y-2",children:[M.map(e=>(0,a.jsx)("div",{onClick:()=>q(e.id),className:(0,y.cn)("p-3 border rounded cursor-pointer transition-colors",W===e.id?"border-[#D4AF71] bg-[#D4AF71]/10":"border-white/10 hover:border-white/30"),"data-testid":"shipping-".concat(e.id),children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-white",children:e.name}),(0,a.jsx)("p",{className:"text-xs text-[#71717A]",children:e.description})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[null!==e.price?(0,a.jsxs)("span",{className:"text-sm font-mono text-[#00FF94]",children:["$",e.price.toFixed(2)]}):(0,a.jsx)("span",{className:"text-xs text-[#71717A]",children:"Enter address for price"}),(0,a.jsx)("div",{className:(0,y.cn)("w-5 h-5 rounded-full border-2 flex items-center justify-center",W===e.id?"border-[#D4AF71] bg-[#D4AF71]":"border-white/30"),children:W===e.id&&(0,a.jsx)(d.Z,{className:"w-3 h-3 text-black"})})]})]})},e.id)),J.city&&J.state_code&&J.postcode?null:(0,a.jsx)("p",{className:"text-xs text-[#C9A227] text-center pt-2",children:"Enter city, state, and ZIP above to see shipping prices"})]})})]}),(0,a.jsx)("div",{children:(0,a.jsxs)(b.Zb,{className:"bg-[#0F0F10] border-white/5 sticky top-8",children:[(0,a.jsx)(b.Ol,{children:(0,a.jsx)(b.ll,{className:"text-lg font-['Barlow_Condensed'] uppercase text-white",children:"Order Summary"})}),(0,a.jsxs)(b.aY,{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,a.jsx)("span",{className:"text-[#71717A]",children:"Package"}),(0,a.jsx)("span",{className:"text-white",children:null==ec?void 0:ec.name})]}),(0,a.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,a.jsxs)("span",{className:"text-[#71717A]",children:["Shipping (",null==el?void 0:el.name,")"]}),(0,a.jsx)("span",{className:"text-white",children:(null==el?void 0:el.price)!==null&&(null==el?void 0:el.price)!==void 0?"$".concat(el.price.toFixed(2)):"TBD"})]}),(0,a.jsxs)("div",{className:"border-t border-white/5 pt-4",children:[(0,a.jsxs)("div",{className:"flex justify-between text-sm mb-2",children:[(0,a.jsx)("span",{className:"text-[#71717A]",children:"Product"}),(0,a.jsxs)("span",{className:"text-white",children:["$",null==ec?void 0:ec.price.toFixed(2)]})]}),(0,a.jsxs)("div",{className:"flex justify-between text-sm mb-2",children:[(0,a.jsx)("span",{className:"text-[#71717A]",children:"Shipping"}),(0,a.jsx)("span",{className:"text-white",children:(null==el?void 0:el.price)!==null&&(null==el?void 0:el.price)!==void 0?"$".concat(el.price.toFixed(2)):"Enter address"})]}),(0,a.jsxs)("div",{className:"flex justify-between text-lg font-bold mt-2 pt-2 border-t border-white/5",children:[(0,a.jsx)("span",{className:"text-white",children:"Total"}),(0,a.jsx)("span",{className:"text-[#D4AF71]",children:(null==el?void 0:el.price)!==null&&(null==el?void 0:el.price)!==void 0?"$".concat(((null==ec?void 0:ec.price)+el.price).toFixed(2)):"$".concat(null==ec?void 0:ec.price.toFixed(2),"+")})]})]}),(0,a.jsx)(g.z,{onClick:()=>U(3),className:"w-full h-12 font-mono uppercase tracking-wider bg-[#D4AF71] text-black hover:bg-[#D4AF71]/90","data-testid":"continue-to-review-btn",children:"Review Order"})]})]})})]}),3===H&&(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("h2",{className:"text-xl font-['Barlow_Condensed'] uppercase tracking-wide text-white",children:"Review Your Order"}),(0,a.jsxs)(b.Zb,{className:"bg-[#0F0F10] border-white/5",children:[(0,a.jsx)(b.Ol,{className:"border-b border-white/5",children:(0,a.jsx)(b.ll,{className:"text-sm font-mono text-[#71717A] uppercase",children:"Product"})}),(0,a.jsx)(b.aY,{className:"p-4",children:(0,a.jsxs)("div",{className:"flex gap-4",children:[(0,a.jsx)("img",{src:en(),alt:"Cover Preview",className:"w-20 h-30 object-cover border border-white/10"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-['Barlow_Condensed'] uppercase text-white",children:null==ec?void 0:ec.name}),(0,a.jsx)("p",{className:"text-sm text-[#71717A]",children:D.title||"".concat(D.year," ").concat(D.make," ").concat(D.model)}),(0,a.jsxs)("p",{className:"text-lg font-bold text-[#D4AF71] mt-2",children:["$",null==ec?void 0:ec.price.toFixed(2)]})]})]})})]}),(0,a.jsxs)(b.Zb,{className:"bg-[#0F0F10] border-white/5",children:[(0,a.jsx)(b.Ol,{className:"border-b border-white/5",children:(0,a.jsx)(b.ll,{className:"text-sm font-mono text-[#71717A] uppercase",children:"Ship To"})}),(0,a.jsxs)(b.aY,{className:"p-4",children:[(0,a.jsx)("p",{className:"text-white",children:J.name}),(0,a.jsx)("p",{className:"text-[#A1A1AA] text-sm",children:J.street1}),J.street2&&(0,a.jsx)("p",{className:"text-[#A1A1AA] text-sm",children:J.street2}),(0,a.jsxs)("p",{className:"text-[#A1A1AA] text-sm",children:[J.city,", ",J.state_code," ",J.postcode]}),(0,a.jsx)("p",{className:"text-[#A1A1AA] text-sm mt-2",children:J.email}),J.phone_number&&(0,a.jsx)("p",{className:"text-[#A1A1AA] text-sm",children:J.phone_number})]})]}),(0,a.jsxs)(b.Zb,{className:"bg-[#0F0F10] border-white/5",children:[(0,a.jsx)(b.Ol,{className:"border-b border-white/5",children:(0,a.jsx)(b.ll,{className:"text-sm font-mono text-[#71717A] uppercase",children:"Shipping Method"})}),(0,a.jsx)(b.aY,{className:"p-4",children:(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-white",children:null==el?void 0:el.name}),(0,a.jsx)("p",{className:"text-[#A1A1AA] text-sm",children:null==el?void 0:el.description})]}),(0,a.jsxs)("p",{className:"text-[#00FF94] font-mono",children:["$",(null==el?void 0:null===(_=el.price)||void 0===_?void 0:_.toFixed(2))||"0.00"]})]})})]})]}),(0,a.jsx)("div",{children:(0,a.jsxs)(b.Zb,{className:"bg-[#0F0F10] border-white/5 sticky top-8",children:[(0,a.jsx)(b.Ol,{children:(0,a.jsx)(b.ll,{className:"text-lg font-['Barlow_Condensed'] uppercase text-white",children:"Payment"})}),(0,a.jsxs)(b.aY,{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,a.jsx)("span",{className:"text-[#71717A]",children:"Subtotal"}),(0,a.jsxs)("span",{className:"text-white",children:["$",null==ec?void 0:ec.price.toFixed(2)]})]}),(0,a.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,a.jsxs)("span",{className:"text-[#71717A]",children:["Shipping (",null==el?void 0:el.name,")"]}),(0,a.jsx)("span",{className:"text-white",children:(null==el?void 0:el.price)!==null&&(null==el?void 0:el.price)!==void 0?"$".concat(el.price.toFixed(2)):"TBD"})]}),(0,a.jsx)("div",{className:"border-t border-white/5 pt-4",children:(0,a.jsxs)("div",{className:"flex justify-between text-xl font-bold",children:[(0,a.jsx)("span",{className:"text-white",children:"Total"}),(0,a.jsx)("span",{className:"text-[#D4AF71]",children:(null==el?void 0:el.price)!==null&&(null==el?void 0:el.price)!==void 0?"$".concat(((null==ec?void 0:ec.price)+el.price).toFixed(2)):"$".concat(null==ec?void 0:ec.price.toFixed(2),"+")})]})}),(0,a.jsx)(g.z,{onClick:er,disabled:L,className:"w-full h-14 font-mono uppercase tracking-wider bg-[#D4AF71] text-black hover:bg-[#D4AF71]/90 text-lg","data-testid":"checkout-btn",children:L?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.Z,{className:"w-5 h-5 mr-2 animate-spin"}),"Processing..."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(f.Z,{className:"w-5 h-5 mr-2"}),"Proceed to Payment"]})}),(0,a.jsx)("p",{className:"text-xs text-[#71717A] text-center",children:"Secure checkout"}),(0,a.jsxs)("div",{className:"pt-4 border-t border-white/5",children:[(0,a.jsx)("h4",{className:"text-xs font-mono text-[#71717A] uppercase mb-2",children:"What's Included"}),(0,a.jsxs)("ul",{className:"space-y-1 text-xs text-[#A1A1AA]",children:[(0,a.jsxs)("li",{className:"flex items-center gap-2",children:[(0,a.jsx)(d.Z,{className:"w-3 h-3 text-[#00FF94]"}
36),"Professional quality printing"]}),(0,a.jsxs)("li",{className:"flex items-center gap-2",children:[(0,a.jsx)(d.Z,{className:"w-3 h-3 text-[#00FF94]"}),"Premium 60# white paper"]}),(0,a.jsxs)("li",{className:"flex items-center gap-2",children:[(0,a.jsx)(d.Z,{className:"w-3 h-3 text-[#00FF94]"}),"Gloss laminated cover"]}),(0,a.jsxs)("li",{className:"flex items-center gap-2",children:[(0,a.jsx)(d.Z,{className:"w-3 h-3 text-[#00FF94]"}),"Order tracking via email"]})]})]})]})]})})]})]})}}},function(e){e.O(0,[6110,6746,4100,2888,9774,179],function(){return e(e.s=1331)}),_N_E=e.O()}]);

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.