efficient-storefront-blocks 0.65.0 → 0.66.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +59 -0
- package/README.md +0 -1
- package/dist/chunks/EditorPreviewCheckout-HAUEGHGC.js +4 -0
- package/dist/chunks/{SiteEditorProvider-ZYGNRWSB.js → SiteEditorProvider-KOPR3UDU.js} +1 -1
- package/dist/chunks/{chunk-I7BIOONR.js → chunk-S66TL4Z3.js} +1 -1
- package/dist/chunks/{chunk-YAO6XQYA.js → chunk-TAGGXC3A.js} +1 -1
- package/dist/chunks/chunk-VEI75RPM.js +1 -0
- package/dist/chunks/{chunk-OU2WWXMT.js → chunk-Z7PJKX2P.js} +1 -1
- package/dist/chunks/{fitment-data-IKFCBT6E.js → fitment-data-UQDOQP66.js} +1 -1
- package/dist/consent.js +1 -1
- package/dist/editor/components/CollectionPicker.js +1 -1
- package/dist/editor/components/EditProductLink.js +1 -1
- package/dist/editor/components/FormPicker.js +1 -1
- package/dist/editor/components/GalleryProductBinding.d.ts +1 -1
- package/dist/editor/components/GalleryProductBinding.js +1 -1
- package/dist/editor/components/GalleryShowcaseSource.d.ts +1 -1
- package/dist/editor/components/GalleryShowcaseSource.js +1 -1
- package/dist/editor/components/HeaderSettingsPanel.js +1 -1
- package/dist/editor/components/MenuLinkRangeField.js +1 -1
- package/dist/editor/components/PerViewStepperField.js +1 -1
- package/dist/editor/lib/puck/blocks/service/ContactRouting/fields.js +1 -1
- package/dist/editor/lib/puck/config.d.ts +0 -4
- package/dist/editor/lib/puck/config.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +2 -4
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/index.d.ts +0 -17
- package/dist/index.js +43 -43
- package/dist/render/app/globals.css +18 -4
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/CartContext.d.ts +5 -0
- package/dist/render/components/CartContext.js +1 -1
- package/dist/render/components/ContactRouting.d.ts +11 -1
- package/dist/render/components/ContactRouting.js +1 -1
- package/dist/render/components/DetailRows.d.ts +2 -0
- package/dist/render/components/DetailRows.js +1 -1
- package/dist/render/components/Events.d.ts +11 -1
- package/dist/render/components/Events.js +1 -1
- package/dist/render/components/GalleryGrid.d.ts +4 -1
- package/dist/render/components/GalleryGrid.js +1 -1
- package/dist/render/components/GalleryItem.d.ts +1 -0
- package/dist/render/components/GalleryItem.js +1 -1
- package/dist/render/components/ProductGallery.js +1 -1
- package/dist/render/components/ProductGridSection.js +1 -1
- package/dist/render/components/checkout/CheckoutPageClient.js +3 -3
- package/dist/render/components/fitment/FitmentPickerGrid.js +1 -1
- package/dist/render/components/fitment/PickerField.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicDetailRows.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicGalleryGrid.d.ts +2 -0
- package/dist/render/components/pdp-dynamic/DynamicGalleryGrid.js +1 -1
- package/dist/render/components/pdp-dynamic/RecordPhotoGallery.d.ts +12 -0
- package/dist/render/components/pdp-dynamic/RecordPhotoGallery.js +1 -0
- package/dist/render/lib/api/types.d.ts +1 -0
- package/dist/render/lib/checkout/match-subdivision.d.ts +2 -0
- package/dist/render/lib/checkout/match-subdivision.js +1 -0
- package/dist/render/lib/consent/choice.d.ts +0 -2
- package/dist/render/lib/consent/choice.js +1 -1
- package/dist/render/lib/consent/rules.d.ts +0 -1
- package/dist/render/lib/consent/rules.js +1 -1
- package/dist/render/lib/content/source-values.d.ts +4 -0
- package/dist/render/lib/content/source-values.js +1 -0
- package/dist/render/lib/content/stock-words.d.ts +0 -4
- package/dist/render/lib/content/stock-words.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/GalleryB/render.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/GalleryItem/render.js +1 -1
- package/dist/render/lib/puck/blocks/service/Events/render.js +1 -1
- package/dist/render/lib/puck/blocks/text-part-shapes.json +6 -3
- package/dist/render/lib/puck/current-record.d.ts +1 -0
- package/dist/render/lib/puck/current-record.js +1 -1
- package/dist/render/lib/sections/fill-row.d.ts +8 -0
- package/dist/render/lib/sections/fill-row.js +1 -1
- package/dist/render/lib/sections/grid-no-hole.d.ts +12 -0
- package/dist/render/lib/sections/grid-no-hole.js +1 -0
- package/dist/render/lib/sections/own-padding.d.ts +3 -0
- package/dist/render/lib/sections/own-padding.js +1 -0
- package/dist/render/lib/wheels/catalog-filters-to-listing.d.ts +0 -1
- package/dist/render/lib/wheels/catalog-filters-to-listing.js +1 -1
- package/dist/render/lib/wheels/catalog-filters.d.ts +0 -1
- package/dist/render/lib/wheels/catalog-filters.js +1 -1
- package/dist/words.d.ts +3 -4
- package/dist/words.js +2 -2
- package/package.json +1 -1
- package/dist/chunks/EditorPreviewCheckout-4KZCYPQT.js +0 -4
- package/dist/chunks/chunk-GR7OHU32.js +0 -1
- /package/dist/chunks/{chunk-B44XQA2J.js → chunk-IHYVLVY3.js} +0 -0
- /package/dist/chunks/{chunk-YAO6XQYA.js.LEGAL.txt → chunk-TAGGXC3A.js.LEGAL.txt} +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use client";import{jsx as e,Fragment as
|
|
2
|
-
`);return o===-1?[n,""]:[n.slice(0,o),n.slice(o+1)]}function
|
|
3
|
-
${me.trim()}`:de;async function St(){if(d||z||i.length===0||a.repricing)return;const t=i.filter(et).flatMap(c=>Ft(c.components,c.qty));if(t.length===0){J("Pick a size on each wheel's product page before checking out.");return}se(!0),J(null);try{const c=$?S.createOrderAuthed:S.createOrder,p=Bt(),b=await c({customer:{email:Z,name:`${X} ${le}`.trim(),phone:ye.trim()||void 0,address:Qe,city:fe,state:Ne||void 0,zipCode:he,country:F},items:t,currency:a.currency,idempotencyKey:_,shippingMethodId:g??void 0,couponCode:Xt(l),...p==="denied"?{}:qt(),...p?{adConsent:p}:{}});if($t({confirmation:b,lines:i,adsSendTo:n.googleAdsId&&n.googleAdsConversionLabel?`${n.googleAdsId}/${n.googleAdsConversionLabel}`:null}),Yt({confirmation:b,lines:i}),N(),$&&Ce&&ee==="new")try{await Q.createAddress({label:ze.trim()||"Home",contact_name:`${X} ${le}`.trim(),phone:ye.trim(),address:Qe,city:fe,zip_code:he,country:F}),Me("Address saved to your account.")}catch{Me("We couldn't save the address to your account — you can add it under Account → Addresses.")}if(y==="card"&&n.paymentMethods.includes("card")){const f=await S.createPaymentIntent({idempotencyKey:_});Pe(b),ut(f)}else if(y==="paypal"&&n.paymentMethods.includes("paypal"))Pe(b),gt(!0);else if(y==="afterpay"&&n.paymentMethods.includes("afterpay")){const f=window.location.origin,E=await S.createAfterpayCheckout({idempotencyKey:_,confirmUrl:`${f}/checkout?afterpay=confirm`,cancelUrl:`${f}/checkout?afterpay=cancel`}),B={idempotencyKey:_,confirmation:b};L.setItem(Ut,JSON.stringify(B)),window.location.assign(E.redirectCheckoutUrl);return}else if(y==="square"&&n.paymentMethods.includes("square"))Pe(b),xt(!0);else if(y==="gocardless"&&n.paymentMethods.includes("gocardless")){const f=window.location.origin,E=await S.createGocardlessBillingRequest({idempotencyKey:_,confirmUrl:`${f}/checkout?gocardless=confirm`,cancelUrl:`${f}/checkout?gocardless=cancel`}),B={idempotencyKey:_,confirmation:b};L.setItem(Ie,JSON.stringify(B)),window.location.assign(E.authorisationUrl);return}else if(y==="zip"&&n.paymentMethods.includes("zip")){const f=window.location.origin,E=await S.createZipCheckout({idempotencyKey:_,redirectUrl:`${f}/checkout?zip=return`}),B={idempotencyKey:_,confirmation:b};L.setItem(Ht,JSON.stringify(B)),window.location.assign(E.redirectUrl);return}else if(y==="klarna"&&n.paymentMethods.includes("klarna")){const f=window.location.origin,E=await S.createKlarnaCheckout({idempotencyKey:_,confirmUrl:`${f}/checkout?klarna=confirm`,cancelUrl:`${f}/checkout?klarna=cancel`}),B={idempotencyKey:_,confirmation:b};L.setItem(_e,JSON.stringify(B)),window.location.assign(E.redirectUrl);return}else j(b)}catch(c){const p=Jt(c);p?(u(p),J(`${p} Your order has not been placed. Place it again to continue without the code.`)):J(c instanceof Ee?c.message:"Could not place the order. Please try again."),se(!1)}}return ne?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:He?"Payment received":"Order received"}),r("p",{className:"text-fg-dim",children:[He?r(A,{children:["Thank you — your payment for order"," ",e("span",{className:"font-mono text-fg",children:ne.orderNumber})," has gone through."," "]}):r(A,{children:["Thank you — your order ",e("span",{className:"font-mono text-fg",children:ne.orderNumber})," is being reviewed by our team."," "]}),$?r(A,{children:["Track it under"," ",e(U,{href:"/account/orders",className:"text-accent underline",children:"your orders"}),"."]}):e(A,{children:"We’ve emailed you a link to set a password and track it."})]}),Ge&&e("p",{className:"text-sm text-fg-dim",children:Ge}),Fe&&e("p",{className:"text-sm text-fg-dim",children:Fe}),!$&&r("p",{className:"text-sm text-fg-dim",children:["You can also"," ",e(U,{href:`/track?order=${encodeURIComponent(ne.orderNumber)}`,className:"text-accent underline",children:"track this order"})," ","anytime with just your order number and email — no password needed."]}),e(U,{href:"/wheels",className:"mt-2 border-2 border-line px-6 py-3 font-mono text-[12px] uppercase tracking-[0.24em] hover:border-accent",children:"Continue browsing"})]}):yt?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Confirming your payment…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Afterpay — one moment."})]}):kt?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Setting up your direct debit…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Confirming with GoCardless — one moment."})]}):Nt?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Confirming your payment…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Zip — one moment."})]}):wt?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Confirming your payment…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Klarna — one moment."})]}):De?e(an,{payment:De,onPaid:()=>{G(!0),j(q)},onSkip:()=>j(q)}):ft&&q?e(sn,{confirmation:q,clientId:n.paypalClientId??"",idemKey:_,onPaid:()=>{G(!0),j(q)},onSkip:()=>j(q)}):ht&&q?e(dn,{confirmation:q,applicationId:n.squareApplicationId??"",locationId:n.squareLocationId??"",environment:n.squareEnvironment??"production",idemKey:_,onPaid:()=>{G(!0),j(q)},onSkip:()=>j(q)}):r("div",{ref:Je,className:"bg-bg text-fg",children:[r("header",{ref:Ct,className:"sticky top-0 z-30 grid grid-cols-[1fr_auto_1fr] items-center gap-8 border-b border-line px-[var(--sf-site-gutter,40px)] py-6 backdrop-blur-md max-[640px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[640px]:py-4",style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[r(U,{href:"/",className:"inline-flex items-center gap-3 font-mono text-[13px] uppercase tracking-[0.26em] text-fg-dim transition-colors hover:text-accent",children:["←",e("span",{className:"max-[640px]:hidden",children:"Back to shop"})]}),e(U,{href:"/","aria-label":`${n.name} home`,className:"inline-flex items-center justify-center",children:e(tn,{variant:"header",scrolled:!0,src:o?.url??null,reverse:o?.reverse??!1,reversedSrc:o?.reversed??null,inkIsDark:o?.inkIsDark??null,size:o?.size??"medium",sizePx:o?.sizePx??null,siteName:n.name})}),n.cardPayments?r("span",{className:"flex items-center justify-end gap-3 font-mono text-[12px] uppercase tracking-[0.26em] text-fg-dim",children:[e("span",{className:"text-green",children:"●"}),e("span",{className:"max-[640px]:hidden",children:"Encrypted ·"})," Stripe"]}):e("span",{})]}),r("section",{className:"mx-auto flex max-w-[var(--sf-site-width,1600px)] flex-wrap items-center justify-between gap-x-8 gap-y-3 border-b border-line bg-surface px-[var(--sf-site-gutter,40px)] py-4 font-mono text-[13px] font-medium uppercase tracking-[0.24em] text-fg max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",children:[e("span",{className:"inline-flex items-center bg-accent px-3 py-1 font-bold text-bg",children:"Checkout"}),e("nav",{"aria-label":"Checkout steps",className:"flex flex-wrap items-center gap-5",children:[{n:"01",label:"Cart",state:"done"},{n:"02",label:"Ship & pay",state:"active"},{n:"03",label:"Confirmed",state:"pending"}].map(t=>r("span",{className:["relative flex items-center gap-2 transition-colors",t.state==="pending"?"text-fg-dim":"text-fg",t.state==="active"?"font-bold after:absolute after:inset-x-0 after:-bottom-1 after:h-[2px] after:bg-accent":""].join(" "),children:[e("span",{className:t.state==="done"?"text-accent font-bold":"",children:t.n}),e("span",{children:t.label})]},t.n))})]}),r("main",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[1fr_420px] items-start gap-16 px-[var(--sf-site-gutter,40px)] pt-10 pb-[100px] max-[1100px]:grid-cols-1 max-[1100px]:gap-10 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[1100px]:pt-8 max-[1100px]:pb-20",children:[r("div",{children:[r(ie,{num:"N° 01",title:"Contact",children:[e(T,{label:"Email",hint:$?r(A,{children:["Signed in ·"," ",e("button",{type:"button",onClick:Pt,className:"underline transition-colors hover:text-accent",children:"Not you? Sign out"})]}):void 0,children:e("input",{type:"email",value:Z,onChange:t=>Ke(t.target.value),placeholder:"you@example.com",readOnly:$!==null,className:K+($?" opacity-70":"")})}),r(ct,{children:[e(T,{label:"First name",children:e("input",{type:"text",value:X,onChange:t=>Te(t.target.value),className:K})}),e(T,{label:"Last name",children:e("input",{type:"text",value:le,onChange:t=>Oe(t.target.value),className:K})})]})]}),r(ie,{num:"N° 02",title:m?"Collection":"Shipping address",children:[m?r("div",{className:"grid gap-2 text-[14px] leading-[1.6]",children:[e("span",{className:"font-medium",children:m.name}),[m.address,m.city,m.state,m.zipCode,m.country].filter(Boolean).length>0&&e("span",{className:"opacity-80",children:[m.address,m.city,m.state,m.zipCode,m.country].filter(Boolean).join(", ")}),m.openingHours&&e("span",{className:"opacity-80",children:m.openingHours}),m.instructions&&e("span",{className:"opacity-80",children:m.instructions}),e("span",{className:"mt-1 font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"No delivery address needed"})]}):r(A,{children:[$!==null&&Le.length>0&&r("div",{className:"grid gap-3",children:[Le.map(t=>e(ce,{active:ee===t.id,onClick:()=>{te(t.id),Ve(t)},title:t.label,body:t.formatted_address,price:null},t.id)),e(ce,{active:ee==="new",onClick:()=>te("new"),title:"New address",body:null,price:null})]}),e(T,{label:"Address line 1",children:e("input",{type:"text",value:de,onChange:t=>pe(t.target.value),className:K})}),e(T,{label:"Address line 2",children:e("input",{type:"text",value:me,onChange:t=>ue(t.target.value),placeholder:"Apartment, unit, garage bay…",className:K})}),r(ct,{cols:"three",children:[e(T,{label:"City",children:e("input",{type:"text",value:fe,onChange:t=>ge(t.target.value),className:K})}),e(T,{label:dt,children:e("input",{type:"text",value:he,onChange:t=>xe(t.target.value),className:K})}),e(T,{label:"Country",separate:!0,children:e(rt,{value:F,onChange:t=>ke(t.target.value),className:K+" pr-10",style:it,children:I.map(t=>e("option",{value:t.code,children:t.name},t.code))})})]}),e(T,{label:pt,separate:!0,children:we.length>0?r(rt,{value:Ne,onChange:t=>ve(t.target.value),className:K+" pr-10",style:it,children:[e("option",{value:"",children:"Select…"}),we.map(t=>e("option",{value:t.code||t.name,children:t.name},t.code||t.name))]}):e("input",{type:"text",value:Ne,onChange:t=>ve(t.target.value),className:K})})]}),e(T,{label:"Phone",children:e("input",{type:"tel",value:ye,onChange:t=>be(t.target.value),placeholder:"+44 7700 900000",className:K})}),!m&&$!==null&&ee==="new"&&r(A,{children:[e(pn,{checked:Ce,onChange:Ye,label:"Save this address to my account"}),Ce&&e(T,{label:"Address label",children:e("input",{type:"text",value:ze,onChange:t=>mt(t.target.value),placeholder:"Home",className:K})})]})]}),e(ie,{num:"N° 03",title:"Shipping",children:r("div",{className:"grid gap-3",children:[h.map(t=>{const c=t.pickupLocation,p=c?[c.address,c.city,c.state,c.zipCode].filter(Boolean).join(", "):null;return e(ce,{active:g===t.id,onClick:()=>x(t.id),title:c?`${t.name} — ${c.name}`:t.name,body:c?[p,c.openingHours,c.instructions,t.description].filter(Boolean).join(" · "):t.description||null,price:a.freeShipping||t.amount===0?Ae:v(t.amount,a.currency),tag:t.tag||void 0},t.id)}),h.length===0&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Shipping is arranged after your order is reviewed."})]})}),r(ie,{num:"N° 04",title:"Payment",children:[e("div",{className:"grid gap-3",children:ae.map(t=>e(ce,{active:y===t.key,onClick:()=>O(t.key),title:t.title,body:t.body,price:t.price,tag:t.tag},t.key))}),y==="card"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll enter card details on the secure payment step after placing the order."}):y==="paypal"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll approve the payment with PayPal on the payment step after placing the order."}):y==="afterpay"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Afterpay to approve four interest-free payments, then brought straight back."}):y==="square"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll enter card details on the secure payment step after placing the order."}):y==="gocardless"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll set up a bank direct debit with GoCardless, then be brought straight back. Direct debits clear in a few days."}):y==="zip"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Zip to approve four instalments, then brought straight back."}):y==="klarna"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Klarna to choose how to pay, then brought straight back."}):e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Our team emails you the invoice and bank details after review."})]})]}),r("aside",{className:"sticky top-[var(--sf-checkout-header-h,88px)] border border-line max-[1100px]:static",style:{background:"linear-gradient(180deg, color-mix(in oklab, var(--site-surface) 70%, var(--bg)) 0%, var(--bg) 100%)"},children:[r("header",{className:"flex items-center justify-between border-b border-accent bg-accent px-6 py-4 font-mono text-[13px] font-bold uppercase tracking-[0.28em] text-bg",children:[e("span",{children:"Your order"}),e(U,{href:"/wheels",className:"text-bg/80 transition-colors hover:text-bg",children:"Edit ↗"})]}),e("div",{className:"flex flex-col px-6 py-2",children:i.length===0?r("div",{className:"py-8 text-center font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:["Your cart is empty. ",e(U,{href:"/wheels",className:"text-accent underline-offset-4 hover:underline",children:"Browse the catalog →"})]}):i.map(t=>e(mn,{slug:t.slug,name:t.name,qty:t.qty,config:t.config,configSummary:un(t.config),price:Tt(t,a.currency)??0,currency:a.currency},t.id))}),e("div",{className:"border-t border-line px-6 pt-5",children:e(Wt,{customerEmail:Z})}),r("div",{className:"flex flex-col gap-2 border-t border-line mt-5 px-6 pt-5",children:[e(H,{label:"Subtotal",value:v(a.subtotal,a.currency)}),a.discount>0&&l?.valid&&e(H,{label:`Coupon · ${l.code}`,value:r("span",{className:"font-semibold text-green",children:["− ",v(a.discount,a.currency)]})}),l?.deferred&&e(H,{label:`Coupon · ${l.code}`,value:Zt}),l?.valid&&l.effects?.gift&&e(H,{label:`Free gift · ${l.effects.gift.partNumber}${l.effects.gift.quantity>1?` ×${l.effects.gift.quantity}`:""}`,value:e("span",{className:"font-semibold text-green",children:Ae})}),e(H,{label:"Shipping",value:a.shippingStatus==="free"?e("span",{className:"font-semibold text-green",children:Ae}):Vt(a.shippingStatus)??v(a.shipping,a.currency)}),a.tax&&(a.tax.charged?e(H,{label:a.tax.inclusive?`${a.tax.name} included · ${a.tax.rate}%`:a.tax.name,value:v(a.tax.amount,a.currency)}):a.tax.name?e(H,{label:a.tax.name,value:Qt}):null)]}),r("div",{className:"mt-4 flex items-end justify-between border-y-2 border-accent px-6 py-4",style:{background:"color-mix(in oklab, var(--accent) 10%, var(--bg))"},children:[e("span",{className:"font-display text-[20px] font-bold uppercase tracking-[0.04em] text-fg",children:"Total"}),e("span",{className:"text-right font-display text-[34px] font-bold leading-none tracking-[-0.025em] text-fg",children:a.repricing?"…":v(a.grand,a.currency)})]}),r("div",{className:"flex flex-col gap-3 px-6 pt-5 pb-6",children:[Ue&&e("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:Ue}),a.hasUnpricedLine&&r("p",{className:"border border-amber-300 bg-amber-50 px-3 py-2 text-[13px] text-amber-800",children:["One or more items have no price in ",a.currency,". Remove them, or switch region, to continue."]}),e("button",{type:"button",onClick:St,disabled:z||i.length===0||a.hasUnpricedLine||a.repricing,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",i.length===0||z||a.hasUnpricedLine||a.repricing?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:z?r(A,{children:["Building order… ",e("span",{children:"·"})]}):a.repricing?r(A,{children:["Updating total… ",e("span",{children:"·"})]}):r(A,{children:[y==="bank"?"Place order":"Continue to payment"," ·"," ",v(a.grand,a.currency),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]})})]})]})]}),e("footer",{className:"flex flex-wrap items-center justify-between gap-4 border-t border-line px-[var(--sf-site-gutter,40px)] py-6 font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim max-[640px]:px-[min(20px,var(--sf-site-gutter,40px))]",children:e("span",{children:Ot({legalName:n.legalName,foundedYear:n.foundedYear,siteName:n.name})})})]})}const K="w-full border-2 border-line bg-bg px-4 py-4 font-display text-[17px] tracking-[-0.005em] text-fg outline-none transition-colors placeholder:text-fg-dim hover:border-fg-dim focus:border-accent",it={backgroundImage:"linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%)",backgroundPosition:"calc(100% - 18px) 50%, calc(100% - 12px) 50%",backgroundSize:"6px 6px",backgroundRepeat:"no-repeat"};function ie({num:n,title:o,children:d}){return r("section",{className:"mb-6 border border-line bg-bg",children:[r("header",{className:"flex items-center gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:n}),e("h2",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:o})]}),e("div",{className:"flex flex-col gap-4 px-6 py-6",children:d})]})}function ct({cols:n="two",children:o}){return e("div",{className:["grid gap-3 max-[640px]:grid-cols-1",n==="two"?"grid-cols-2":"grid-cols-[1.2fr_1fr_1fr]"].join(" "),children:o})}function ce({active:n,onClick:o,title:d,body:i,price:a,tag:l}){return r("button",{type:"button",onClick:o,"aria-pressed":n,className:["relative grid grid-cols-[auto_1fr_auto] items-center gap-5 border bg-bg px-6 py-5 text-left transition-colors",n?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-line hover:border-[color-mix(in_oklab,var(--accent)_50%,var(--site-line))]"].join(" "),style:n?{background:"color-mix(in oklab, var(--accent) 14%, var(--bg))"}:void 0,children:[n&&e("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),e("span",{className:["flex h-[18px] w-[18px] items-center justify-center rounded-full border-2",n?"border-accent":"border-fg-dim"].join(" "),children:n&&e("span",{className:"block h-2.5 w-2.5 rounded-full bg-accent"})}),r("span",{className:"flex min-w-0 flex-col gap-1",children:[r("span",{className:"flex flex-wrap items-baseline gap-3 font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:[d,l&&e("span",{className:"border px-2 py-0.5 font-mono text-[11px] font-normal uppercase tracking-[0.24em] text-accent",style:{background:"color-mix(in oklab, var(--accent) 14%, transparent)",borderColor:"color-mix(in oklab, var(--accent) 45%, var(--site-line))"},children:l})]}),i&&e("span",{className:"font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim",children:i})]}),e("span",{className:"whitespace-nowrap font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:a})]})}function an({payment:n,onPaid:o,onSkip:d}){const{formatMoney:i}=W(),a=oe(()=>Kt(n.publishableKey),[n.publishableKey]),l=oe(()=>{if(typeof document>"u")return;const u=getComputedStyle(document.documentElement),h=(x,w)=>u.getPropertyValue(x).trim()||w,g=document.documentElement.getAttribute("data-theme")!=="light";return{theme:g?"night":"stripe",variables:{colorPrimary:h("--accent",g?"#c9a461":"#8a6a2a"),colorBackground:h("--site-surface",g?"#131313":"#ffffff"),colorText:h("--fg",g?"#f5f1e8":"#0a0a0a"),borderRadius:"0px"}}},[]);return e("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:r("div",{className:"w-full max-w-xl border border-line bg-bg",children:[r("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:n.orderNumber}),e("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Payment"})]}),r("div",{className:"flex flex-col gap-4 px-6 py-6",children:[r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",e("span",{className:"text-fg",children:i(Number(n.amount),n.currency)})," ","by card to confirm it now."]}),e(It,{stripe:a,options:{clientSecret:n.clientSecret,appearance:l},children:e(on,{payment:n,onPaid:o,onSkip:d})})]})]})})}function on({payment:n,onPaid:o,onSkip:d}){const{formatMoney:i}=W(),a=Rt(),l=jt(),[u,h]=s(!1),[g,x]=s(null);async function w(){if(!a||!l||u)return;h(!0),x(null);const N=await a.confirmPayment({elements:l,redirect:"if_required"});if(N.error){x(N.error.message??"Payment failed. Please try again."),h(!1);return}const m=N.paymentIntent?.status;if(m==="succeeded"||m==="processing"){o();return}x("Payment did not complete. Please try again."),h(!1)}return r("div",{className:"flex flex-col gap-4",children:[e(_t,{}),g&&e("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:g}),e("button",{type:"button",onClick:w,disabled:!a||!l||u,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!a||!l||u?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:u?r(A,{children:["Processing… ",e("span",{children:"·"})]}):r(A,{children:["Pay ",i(Number(n.amount),n.currency),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]})}),e("button",{type:"button",onClick:d,disabled:u,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later — our team will be in touch"})]})}const st="paypal-sdk-js";let je=null;function cn(n,o){const d=`${n}|${o}`;if(je?.key===d)return je.promise;const i=new Promise((a,l)=>{document.getElementById(st)?.remove();const u=document.createElement("script");u.id=st;const h=new URLSearchParams({"client-id":n,currency:o,intent:"capture"});u.src=`https://www.paypal.com/sdk/js?${h}`,u.onload=()=>{const g=window.paypal;g?a(g):l(new Error("PayPal SDK loaded without its namespace"))},u.onerror=()=>l(new Error("PayPal SDK failed to load")),document.head.appendChild(u)});return je={key:d,promise:i},i}function sn({confirmation:n,clientId:o,idemKey:d,onPaid:i,onSkip:a}){const{formatMoney:l}=W(),u=D(null),[h,g]=s(!1),[x,w]=s(null),N=D(i);return N.current=i,R(()=>{let m=!1,P=null;return cn(o,n.currency).then(I=>{if(!(m||!u.current))return P=I.Buttons({style:{layout:"vertical",color:"gold",shape:"rect",label:"paypal"},createOrder:async()=>(await S.createPaypalOrder({idempotencyKey:d})).paypalOrderId,onApprove:async k=>{try{if((await S.capturePaypalOrder({idempotencyKey:d,paypalOrderId:k.orderID})).status==="paid"){N.current();return}w("PayPal did not complete the payment. Please try again.")}catch(v){w(v instanceof Ee?v.message:"PayPal payment failed. Please try again.")}},onError:()=>{w("PayPal could not process the payment. Please try again.")}}),P.render(u.current).then(()=>{m||g(!0)})}).catch(()=>{m||w("PayPal could not be loaded. You can pay later — your order stands either way.")}),()=>{m=!0,P?.close?.()}},[o,n.currency,d]),e("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:r("div",{className:"w-full max-w-xl border border-line bg-bg",children:[r("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:n.orderNumber}),e("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"PayPal"})]}),r("div",{className:"flex flex-col gap-4 px-6 py-6",children:[r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",e("span",{className:"text-fg",children:l(Number(n.grandTotal),n.currency)})," ","with PayPal to confirm it now."]}),!h&&!x&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading PayPal…"}),e("div",{ref:u}),x&&e("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:x}),e("button",{type:"button",onClick:a,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later — our team will be in touch"})]})]})})}const lt="square-web-sdk";let Re=null;function ln(n){const o=n==="sandbox"?"sandbox":"production";if(Re?.key===o)return Re.promise;const d=new Promise((i,a)=>{document.getElementById(lt)?.remove();const l=document.createElement("script");l.id=lt,l.src=o==="sandbox"?"https://sandbox.web.squarecdn.com/v1/square.js":"https://web.squarecdn.com/v1/square.js",l.onload=()=>{const u=window.Square;u?i(u):a(new Error("Square SDK loaded without its namespace"))},l.onerror=()=>a(new Error("Square SDK failed to load")),document.head.appendChild(l)});return Re={key:o,promise:d},d}function dn({confirmation:n,applicationId:o,locationId:d,environment:i,idemKey:a,onPaid:l,onSkip:u}){const{formatMoney:h}=W(),g=D(null),x=D(null),w=D(null),[N,m]=s(!1),[P,I]=s(!1),[k,v]=s(null);R(()=>{let O=!1,C=null;return ln(i).then(async M=>{if(O||!g.current)return;const z=M.payments(o,d);w.current=z,C=await z.card(),await C.attach(g.current),x.current=C,O||m(!0)}).catch(()=>{O||v("Square could not be loaded. You can pay later — your order stands either way.")}),()=>{O=!0,C?.destroy?.()}},[o,d,i]);async function y(){const O=x.current;if(!(!O||P)){I(!0),v(null);try{const C=await O.tokenize();if(C.status!=="OK"||!C.token){v(C.errors?.[0]?.message??"Please check the card details and try again."),I(!1);return}let M;try{M=(await w.current?.verifyBuyer?.(C.token,{amount:String(n.grandTotal),currencyCode:n.currency,intent:"CHARGE"}))?.token}catch{}if((await S.chargeSquare({idempotencyKey:a,sourceId:C.token,...M?{verificationToken:M}:{}})).status==="paid"){l();return}v("Square did not complete the payment. Please try again.")}catch(C){v(C instanceof Ee?C.message:"Square payment failed. Please try again.")}I(!1)}}return e("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:r("div",{className:"w-full max-w-xl border border-line bg-bg",children:[r("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:n.orderNumber}),e("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Card"})]}),r("div",{className:"flex flex-col gap-4 px-6 py-6",children:[r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",e("span",{className:"text-fg",children:h(Number(n.grandTotal),n.currency)})," ","by card to confirm it now."]}),!N&&!k&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading card form…"}),e("div",{ref:g}),k&&e("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:k}),e("button",{type:"button",onClick:y,disabled:!N||P,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!N||P?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:P?r(A,{children:["Processing… ",e("span",{children:"·"})]}):r(A,{children:["Pay ",h(Number(n.grandTotal),n.currency),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]})}),e("button",{type:"button",onClick:u,disabled:P,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later — our team will be in touch"})]})]})})}function pn({checked:n,onChange:o,label:d,sub:i}){return r("div",{className:"flex items-start gap-3 border-t border-line py-4 first:border-t-0 first:pt-0",children:[e("button",{type:"button",onClick:()=>o(!n),"aria-pressed":n,"aria-label":d,className:["mt-px flex h-5 w-5 flex-shrink-0 items-center justify-center border transition-colors",n?"border-accent":"border-line"].join(" "),style:n?{background:"color-mix(in oklab, var(--accent) 18%, transparent)"}:void 0,children:n&&e("span",{className:"text-[13px] text-accent",children:"✓"})}),r("span",{className:"flex-1 font-display text-[16px] leading-[1.5] text-fg",children:[d,i&&e("small",{className:"mt-1 block font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim",children:i})]})]})}function mn({slug:n,name:o,qty:d,config:i,configSummary:a,price:l,currency:u}){const{catalog:h}=tt(),{formatMoney:g}=W(),x=h.find(k=>k.slug===n),w=x?.spokes??5,N=x?.mesh??!1,m=i.find(k=>k.gold)?.label,P=x?.finishes.find(k=>k.name===m&&k.src)??x?.finishes.find(k=>k.src),I=x?.finishes[0]?.color??en;return r("div",{className:"grid grid-cols-[60px_1fr_auto] items-center gap-4 border-b border-line py-4 last:border-b-0",children:[r("div",{className:"relative flex aspect-square items-center justify-center overflow-hidden border border-line bg-surface",children:[e("span",{className:"absolute -right-1.5 -top-1.5 z-[2] flex h-[18px] w-[18px] items-center justify-center rounded-full bg-accent font-mono text-[11px] font-bold text-bg",children:d}),P?.src?e(Et,{src:P.src,alt:`${o.lead}${o.accent} — ${P.name}`,width:120,height:120,sizes:"60px",className:"relative block h-full w-full object-contain p-2"}):e("div",{className:"block w-[78%]",style:{color:I},children:e(nn,{spokes:w,mesh:N,className:"block w-full"})})]}),r("div",{className:"flex min-w-0 flex-col gap-0.5",children:[r("span",{className:"font-display text-[17px] font-bold uppercase leading-none tracking-[-0.005em] text-fg",children:[o.lead,e("em",{className:"font-serif font-normal italic text-accent tracking-[-0.005em] normal-case",children:o.accent})]}),e("span",{className:"font-mono text-[12px] uppercase leading-[1.5] tracking-[0.18em] text-fg-dim",children:a})]}),e("span",{className:"text-right font-display text-[17px] font-bold tracking-[-0.005em] text-fg",children:g(l,u)})]})}function H({label:n,value:o}){return r("div",{className:"flex items-center justify-between font-mono text-[13px] font-medium uppercase tracking-[0.18em] text-fg",children:[e("span",{children:n}),e("strong",{className:"font-display text-[16px] font-medium tracking-[-0.005em] normal-case text-fg",children:o})]})}function un(n){return n.map(o=>o.label).join(" · ")}export{ot as buildPayOptions,rn as default};
|
|
1
|
+
"use client";import{jsx as e,Fragment as E,jsxs as r}from"react/jsx-runtime";import Kt from"next/image";import M from"next/link";import{useEffect as S,useMemo as pe,useRef as U,useState as s}from"react";import{Elements as Tt,PaymentElement as Ot,useElements as qt,useStripe as Bt}from"@stripe/react-stripe-js";import{loadStripe as Lt}from"@stripe/stripe-js";import{isOrderable as ot,lineTotal as $t,useCart as it}from"../CartContext.js";import{useCurrency as W}from"../CurrencyContext.js";import{FREE_PRICE as _e}from"../../lib/wheels/price-display.js";import{resolveCopyright as Yt}from"../../lib/content/site.js";import{getClickIds as zt}from"../../lib/click-ids.js";import{adConsentForOrder as Ft}from"../../lib/consent/choice.js";import{trackBeginCheckout as Mt,trackPurchase as Ut}from"../../lib/google-tag.js";import{trackMetaPurchase as Dt}from"../../lib/meta-pixel.js";import{ApiError as je,api as ne,products as A}from"../../lib/api/index.js";import{uuid as Ht}from"../../lib/uuid.js";import{orderLinesForSets as Gt}from"../../lib/commerce.js";import{canPersist as Wt,safeSessionStorage as B}from"efficient-web-builder/format/lib/safe-storage";import{AFTERPAY_CONTEXT_KEY as Zt,AFTERPAY_RETURN as Xt,GOCARDLESS_CONTEXT_KEY as Re,KLARNA_CONTEXT_KEY as Ke,ZIP_CONTEXT_KEY as Jt,ZIP_RETURN as Qt,runWalletReturn as ct}from"../../lib/checkout/wallet-return.js";import{matchSubdivision as Vt}from"../../lib/checkout/match-subdivision.js";import en from"../CouponField.js";import{COUPON_DEFERRED_TOTAL as tn,couponCodeForOrder as nn,couponRefusedByOrder as rn}from"../../lib/cart/coupon-preview.js";import{shippingWords as an,TAX_PENDING as on}from"../../lib/cart/shipping-status.js";import{DEFAULT_FINISH_COLOR as cn}from"../../lib/wheels/finish-defaults.js";import sn from"efficient-web-builder/render/components/Logo";import st from"../ThemedSelect.js";import T from"../WebFormField.js";import ln from"../WheelSvg.js";function lt(n){const o=n.indexOf(`
|
|
2
|
+
`);return o===-1?[n,""]:[n.slice(0,o),n.slice(o+1)]}function dt(n,{canParkContext:o}={canParkContext:!0}){const d=n.paymentMethods,i=[];return d.includes("card")&&i.push({key:"card",title:"Card",body:null,price:e("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA · MC · AMEX"})}),d.includes("paypal")&&n.paypalClientId&&i.push({key:"paypal",title:"PayPal",body:null,price:e("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAYPAL · CARDS"})}),d.includes("afterpay")&&i.push({key:"afterpay",title:"Afterpay",body:null,price:e("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"4 × INTEREST-FREE"})}),d.includes("square")&&n.squareApplicationId&&n.squareLocationId&&i.push({key:"square",title:"Card (Square)",body:null,price:e("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"VISA · MC · AMEX"})}),d.includes("gocardless")&&o&&i.push({key:"gocardless",title:"Bank Direct Debit",body:null,price:e("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY BY BANK"})}),d.includes("zip")&&i.push({key:"zip",title:"Zip",body:null,price:e("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY IN 4"})}),d.includes("klarna")&&o&&i.push({key:"klarna",title:"Klarna",body:null,price:e("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-accent",children:"PAY LATER"})}),i.push({key:"bank",title:"Bank transfer",body:null,price:e("span",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Invoiced"})}),i}function dn({site:n,logo:o,preview:d=!1}){const{items:i,totals:a,coupon:l,refuseCoupon:m,deliveryOptions:x,shippingMethodId:h,setShippingMethodId:y,setQuoteDestination:N,identify:P,clearCapturedCart:w}=it(),u=x.find(t=>t.id===h)?.pickupLocation??null,{country:L,countries:b,activeCountry:_,formatMoney:$}=W(),[f,C]=s(()=>dt(n)[0].key),[F,Z]=s(!0);S(()=>{Z(Wt(B))},[]);const[X,qe]=s(!1),[J,Be]=s(""),[Q,Le]=s(""),[fe,$e]=s(""),[ge,he]=s(""),[xe,ye]=s(""),[be,ke]=s(""),[Ne,ve]=s(""),[we,Ce]=s(""),[v,Pe]=s(()=>L||b[0]?.code||""),[H,re]=s(""),[V,Ye]=s([]),[ze,Se]=s(null),[ae,oe]=s(null),gt=pe(()=>b.find(t=>t.code===v)??_,[b,v,_])?.postalLabel||"Postal Code",ht=V[0]?.divisionType||"State / Province";S(()=>{if(!v){Ye([]),Se(v);return}Se(null);let t=!1;return A.listCountrySubdivisions(v).then(c=>{t||(Ye(c),Se(v),re(""))}),()=>{t=!0}},[v]),S(()=>{N(v?{country:v,subdivision:H}:null)},[v,H,N]),S(()=>()=>N(null),[N]);const[Y,Fe]=s(null),[Me,Ue]=s([]),[ie,ce]=s("new"),[Ae,De]=s(!1),[He,xt]=s("Home"),[Ge,We]=s(null),[j]=s(()=>Ht()),[se,R]=s(null),[Ze,ee]=s(null),[Xe,yt]=s(null),[bt,kt]=s(!1),[Nt,vt]=s(!1),[O,Ee]=s(null),[Je,G]=s(!1),[Qe,z]=s(null),[wt,Ct]=s(!1),[Pt,Ve]=s(!1),[St,At]=s(!1),[Et,et]=s(!1),tt=U(!1);S(()=>{d||tt.current||!i.some(ot)||(tt.current=!0,Mt({lines:i,currency:a.currency,value:a.subtotal-a.discount,coupon:l?.valid?l.code:void 0}))},[i,a,l,d]),S(()=>{P(J,Q.trim()||void 0)},[J,Q,P]);const nt=U(null),[le,It]=s(null);S(()=>{const t=nt.current;if(!le||!t)return;const c=()=>t.style.setProperty("--sf-checkout-header-h",`${le.offsetHeight}px`);c();const p=new ResizeObserver(c);return p.observe(le),()=>p.disconnect()},[le]),S(()=>{const t=p=>({setConfirming:p,land:R,markPaid:()=>G(!0),note:z,fail:ee,clearCart:w}),c={search:window.location.search,storage:B,scrubQuery:()=>window.history.replaceState(null,"",window.location.pathname)};ct(Xt,{...c,capture:A.captureAfterpayPayment,page:t(Ct)}),ct(Qt,{...c,capture:A.captureZipPayment,page:t(At)})},[]),S(()=>{const c=new URLSearchParams(window.location.search).get("gocardless");if(c!=="confirm"&&c!=="cancel")return;const p=B.getItem(Re);if(B.removeItem(Re),window.history.replaceState(null,"",window.location.pathname),!p)return;let k;try{k=JSON.parse(p)}catch{return}if(w(),c==="cancel"){z("The direct debit was not set up — our team will follow up on payment."),R(k.confirmation);return}Ve(!0),A.completeGocardlessPayment({idempotencyKey:k.idempotencyKey}).then(g=>{g.status==="paid"?G(!0):g.status==="declined"?z("The direct debit was declined — our team will follow up on payment."):z("Your direct debit is set up — the payment is collecting and will clear in a few days.")}).catch(()=>{z("We could not confirm the direct debit — our team will follow up on payment.")}).finally(()=>{R(k.confirmation),Ve(!1)})},[]),S(()=>{const t=new URLSearchParams(window.location.search),c=t.get("klarna");if(c!=="confirm"&&c!=="cancel")return;const p=B.getItem(Ke);B.removeItem(Ke);const k=t.get("authorization_token");if(window.history.replaceState(null,"",window.location.pathname),!p)return;let g;try{g=JSON.parse(p)}catch{return}if(w(),c==="cancel"||!k){z("The Klarna payment was not completed — our team will follow up on payment."),R(g.confirmation);return}et(!0),A.captureKlarnaPayment({idempotencyKey:g.idempotencyKey,authorizationToken:k}).then(I=>{I.status==="paid"?G(!0):I.status==="declined"?z("Klarna declined the payment — our team will follow up on payment."):z("Your Klarna payment is being reviewed — we'll confirm the outcome shortly.")}).catch(()=>{z("We could not confirm the Klarna payment — our team will follow up on payment.")}).finally(()=>{R(g.confirmation),et(!1)})},[]);function rt(t){const[c,p]=lt(t.address);he(c),ye(p),ke(t.city),ve(t.zip_code),t.country&&Pe(t.country),t.phone&&Ce(t.phone),oe({country:t.country||null,state:t.state??""})}S(()=>{if(ae){if((ae.country||v)!==v){oe(null);return}ze===v&&(re(Vt(v,ae.state,V)),oe(null))}},[ae,v,ze,V]),S(()=>{let t=!1;return(async()=>{try{const[c,p,k]=await Promise.all([ne.me(),ne.myProfile().catch(()=>null),ne.myAddresses().catch(()=>[])]);if(t)return;Fe(c);const g=k.filter(te=>te.is_active);Ue(g),Be(c.email);const I=(p?.contact_name??"").split(/\s+/);Le(c.first_name||I[0]||""),$e(c.last_name||I.slice(1).join(" "));const q=c.phone||p?.phone;q&&Ce(q);const Ie=g.find(te=>te.id===c.default_delivery_location)??g[0];if(Ie)ce(Ie.id),rt(Ie);else if(p){const[te,Rt]=lt(p.address??"");he(te),ye(Rt),ke(p.city??""),ve(p.zip_code??""),p.country&&Pe(p.country),oe({country:p.country||null,state:p.state??""})}}catch{}})(),()=>{t=!0}},[]);function _t(){ne.logout(),Fe(null),Ue([]),ce("new"),De(!1)}const de=pe(()=>dt(n,{canParkContext:F}),[n,F]);S(()=>{de.some(t=>t.key===f)||C(de[0].key)},[de,f]);const at=xe.trim()?`${ge}
|
|
3
|
+
${xe.trim()}`:ge;async function jt(){if(d||X||i.length===0||a.repricing)return;const t=i.filter(ot).flatMap(c=>Gt(c.components,c.qty));if(t.length===0){ee("Pick a size on each wheel's product page before checking out.");return}qe(!0),ee(null);try{const c=Y?A.createOrderAuthed:A.createOrder,p=Ft(),k=await c({customer:{email:J,name:`${Q} ${fe}`.trim(),phone:we.trim()||void 0,address:at,city:be,state:H||void 0,zipCode:Ne,country:v},items:t,currency:a.currency,idempotencyKey:j,shippingMethodId:h??void 0,couponCode:nn(l),...p==="denied"?{}:zt(),...p?{adConsent:p}:{}});if(Ut({confirmation:k,lines:i,adsSendTo:n.googleAdsId&&n.googleAdsConversionLabel?`${n.googleAdsId}/${n.googleAdsConversionLabel}`:null}),Dt({confirmation:k,lines:i}),w(),Y&&Ae&&ie==="new")try{await ne.createAddress({label:He.trim()||"Home",contact_name:`${Q} ${fe}`.trim(),phone:we.trim(),address:at,city:be,zip_code:Ne,state:H,country:v}),We("Address saved to your account.")}catch{We("We couldn't save the address to your account — you can add it under Account → Addresses.")}if(f==="card"&&n.paymentMethods.includes("card")){const g=await A.createPaymentIntent({idempotencyKey:j});Ee(k),yt(g)}else if(f==="paypal"&&n.paymentMethods.includes("paypal"))Ee(k),kt(!0);else if(f==="afterpay"&&n.paymentMethods.includes("afterpay")){const g=window.location.origin,I=await A.createAfterpayCheckout({idempotencyKey:j,confirmUrl:`${g}/checkout?afterpay=confirm`,cancelUrl:`${g}/checkout?afterpay=cancel`}),q={idempotencyKey:j,confirmation:k};B.setItem(Zt,JSON.stringify(q)),window.location.assign(I.redirectCheckoutUrl);return}else if(f==="square"&&n.paymentMethods.includes("square"))Ee(k),vt(!0);else if(f==="gocardless"&&n.paymentMethods.includes("gocardless")){const g=window.location.origin,I=await A.createGocardlessBillingRequest({idempotencyKey:j,confirmUrl:`${g}/checkout?gocardless=confirm`,cancelUrl:`${g}/checkout?gocardless=cancel`}),q={idempotencyKey:j,confirmation:k};B.setItem(Re,JSON.stringify(q)),window.location.assign(I.authorisationUrl);return}else if(f==="zip"&&n.paymentMethods.includes("zip")){const g=window.location.origin,I=await A.createZipCheckout({idempotencyKey:j,redirectUrl:`${g}/checkout?zip=return`}),q={idempotencyKey:j,confirmation:k};B.setItem(Jt,JSON.stringify(q)),window.location.assign(I.redirectUrl);return}else if(f==="klarna"&&n.paymentMethods.includes("klarna")){const g=window.location.origin,I=await A.createKlarnaCheckout({idempotencyKey:j,confirmUrl:`${g}/checkout?klarna=confirm`,cancelUrl:`${g}/checkout?klarna=cancel`}),q={idempotencyKey:j,confirmation:k};B.setItem(Ke,JSON.stringify(q)),window.location.assign(I.redirectUrl);return}else R(k)}catch(c){const p=rn(c);p?(m(p),ee(`${p} Your order has not been placed. Place it again to continue without the code.`)):ee(c instanceof je?c.message:"Could not place the order. Please try again."),qe(!1)}}return se?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:Je?"Payment received":"Order received"}),r("p",{className:"text-fg-dim",children:[Je?r(E,{children:["Thank you — your payment for order"," ",e("span",{className:"font-mono text-fg",children:se.orderNumber})," has gone through."," "]}):r(E,{children:["Thank you — your order ",e("span",{className:"font-mono text-fg",children:se.orderNumber})," is being reviewed by our team."," "]}),Y?r(E,{children:["Track it under"," ",e(M,{href:"/account/orders",className:"text-accent underline",children:"your orders"}),"."]}):e(E,{children:"We’ve emailed you a link to set a password and track it."})]}),Qe&&e("p",{className:"text-sm text-fg-dim",children:Qe}),Ge&&e("p",{className:"text-sm text-fg-dim",children:Ge}),!Y&&r("p",{className:"text-sm text-fg-dim",children:["You can also"," ",e(M,{href:`/track?order=${encodeURIComponent(se.orderNumber)}`,className:"text-accent underline",children:"track this order"})," ","anytime with just your order number and email — no password needed."]}),e(M,{href:"/wheels",className:"mt-2 border-2 border-line px-6 py-3 font-mono text-[12px] uppercase tracking-[0.24em] hover:border-accent",children:"Continue browsing"})]}):wt?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Confirming your payment…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Afterpay — one moment."})]}):Pt?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Setting up your direct debit…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Confirming with GoCardless — one moment."})]}):St?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Confirming your payment…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Zip — one moment."})]}):Et?r("div",{className:"flex min-h-screen flex-col items-center justify-center gap-4 bg-bg px-6 text-center text-fg",children:[e("h1",{className:"font-display text-3xl",children:"Confirming your payment…"}),e("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:"Checking with Klarna — one moment."})]}):Xe?e(pn,{payment:Xe,onPaid:()=>{G(!0),R(O)},onSkip:()=>R(O)}):bt&&O?e(fn,{confirmation:O,clientId:n.paypalClientId??"",idemKey:j,onPaid:()=>{G(!0),R(O)},onSkip:()=>R(O)}):Nt&&O?e(hn,{confirmation:O,applicationId:n.squareApplicationId??"",locationId:n.squareLocationId??"",environment:n.squareEnvironment??"production",idemKey:j,onPaid:()=>{G(!0),R(O)},onSkip:()=>R(O)}):r("div",{ref:nt,className:"bg-bg text-fg",children:[r("header",{ref:It,className:"sticky top-0 z-30 grid grid-cols-[1fr_auto_1fr] items-center gap-8 border-b border-line px-[var(--sf-site-gutter,40px)] py-6 backdrop-blur-md max-[640px]:px-[min(20px,var(--sf-site-gutter,40px))] max-[640px]:py-4",style:{background:"color-mix(in oklab, var(--bg) 92%, transparent)"},children:[r(M,{href:"/",className:"inline-flex items-center gap-3 font-mono text-[13px] uppercase tracking-[0.26em] text-fg-dim transition-colors hover:text-accent",children:["←",e("span",{className:"max-[640px]:hidden",children:"Back to shop"})]}),e(M,{href:"/","aria-label":`${n.name} home`,className:"inline-flex items-center justify-center",children:e(sn,{variant:"header",scrolled:!0,src:o?.url??null,reverse:o?.reverse??!1,reversedSrc:o?.reversed??null,inkIsDark:o?.inkIsDark??null,size:o?.size??"medium",sizePx:o?.sizePx??null,siteName:n.name})}),n.cardPayments?r("span",{className:"flex items-center justify-end gap-3 font-mono text-[12px] uppercase tracking-[0.26em] text-fg-dim",children:[e("span",{className:"text-green",children:"●"}),e("span",{className:"max-[640px]:hidden",children:"Encrypted ·"})," Stripe"]}):e("span",{})]}),r("section",{className:"mx-auto flex max-w-[var(--sf-site-width,1600px)] flex-wrap items-center justify-between gap-x-8 gap-y-3 border-b border-line bg-surface px-[var(--sf-site-gutter,40px)] py-4 font-mono text-[13px] font-medium uppercase tracking-[0.24em] text-fg max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))]",children:[e("span",{className:"inline-flex items-center bg-accent px-3 py-1 font-bold text-bg",children:"Checkout"}),e("nav",{"aria-label":"Checkout steps",className:"flex flex-wrap items-center gap-5",children:[{n:"01",label:"Cart",state:"done"},{n:"02",label:"Ship & pay",state:"active"},{n:"03",label:"Confirmed",state:"pending"}].map(t=>r("span",{className:["relative flex items-center gap-2 transition-colors",t.state==="pending"?"text-fg-dim":"text-fg",t.state==="active"?"font-bold after:absolute after:inset-x-0 after:-bottom-1 after:h-[2px] after:bg-accent":""].join(" "),children:[e("span",{className:t.state==="done"?"text-accent font-bold":"",children:t.n}),e("span",{children:t.label})]},t.n))})]}),r("main",{className:"mx-auto grid max-w-[var(--sf-site-width,1600px)] grid-cols-[1fr_420px] items-start gap-16 px-[var(--sf-site-gutter,40px)] pt-10 pb-[100px] max-[1100px]:grid-cols-1 max-[1100px]:gap-10 max-[1100px]:px-[min(24px,var(--sf-site-gutter,40px))] max-[1100px]:pt-8 max-[1100px]:pb-20",children:[r("div",{children:[r(ue,{num:"N° 01",title:"Contact",children:[e(T,{label:"Email",hint:Y?r(E,{children:["Signed in ·"," ",e("button",{type:"button",onClick:_t,className:"underline transition-colors hover:text-accent",children:"Not you? Sign out"})]}):void 0,children:e("input",{type:"email",value:J,onChange:t=>Be(t.target.value),placeholder:"you@example.com",readOnly:Y!==null,className:K+(Y?" opacity-70":"")})}),r(ut,{children:[e(T,{label:"First name",children:e("input",{type:"text",value:Q,onChange:t=>Le(t.target.value),className:K})}),e(T,{label:"Last name",children:e("input",{type:"text",value:fe,onChange:t=>$e(t.target.value),className:K})})]})]}),r(ue,{num:"N° 02",title:u?"Collection":"Shipping address",children:[u?r("div",{className:"grid gap-2 text-[14px] leading-[1.6]",children:[e("span",{className:"font-medium",children:u.name}),[u.address,u.city,u.state,u.zipCode,u.country].filter(Boolean).length>0&&e("span",{className:"opacity-80",children:[u.address,u.city,u.state,u.zipCode,u.country].filter(Boolean).join(", ")}),u.openingHours&&e("span",{className:"opacity-80",children:u.openingHours}),u.instructions&&e("span",{className:"opacity-80",children:u.instructions}),e("span",{className:"mt-1 font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"No delivery address needed"})]}):r(E,{children:[Y!==null&&Me.length>0&&r("div",{className:"grid gap-3",children:[Me.map(t=>e(me,{active:ie===t.id,onClick:()=>{ce(t.id),rt(t)},title:t.label,body:t.formatted_address,price:null},t.id)),e(me,{active:ie==="new",onClick:()=>ce("new"),title:"New address",body:null,price:null})]}),e(T,{label:"Address line 1",children:e("input",{type:"text",value:ge,onChange:t=>he(t.target.value),className:K})}),e(T,{label:"Address line 2",children:e("input",{type:"text",value:xe,onChange:t=>ye(t.target.value),placeholder:"Apartment, unit, garage bay…",className:K})}),r(ut,{cols:"three",children:[e(T,{label:"City",children:e("input",{type:"text",value:be,onChange:t=>ke(t.target.value),className:K})}),e(T,{label:gt,children:e("input",{type:"text",value:Ne,onChange:t=>ve(t.target.value),className:K})}),e(T,{label:"Country",separate:!0,children:e(st,{value:v,onChange:t=>Pe(t.target.value),className:K+" pr-10",style:pt,children:b.map(t=>e("option",{value:t.code,children:t.name},t.code))})})]}),e(T,{label:ht,separate:!0,children:V.length>0?r(st,{value:H,onChange:t=>re(t.target.value),className:K+" pr-10",style:pt,children:[e("option",{value:"",children:"Select…"}),V.map(t=>e("option",{value:t.code||t.name,children:t.name},t.code||t.name))]}):e("input",{type:"text",value:H,onChange:t=>re(t.target.value),className:K})})]}),e(T,{label:"Phone",children:e("input",{type:"tel",value:we,onChange:t=>Ce(t.target.value),placeholder:"+44 7700 900000",className:K})}),!u&&Y!==null&&ie==="new"&&r(E,{children:[e(xn,{checked:Ae,onChange:De,label:"Save this address to my account"}),Ae&&e(T,{label:"Address label",children:e("input",{type:"text",value:He,onChange:t=>xt(t.target.value),placeholder:"Home",className:K})})]})]}),e(ue,{num:"N° 03",title:"Shipping",children:r("div",{className:"grid gap-3",children:[x.map(t=>{const c=t.pickupLocation,p=c?[c.address,c.city,c.state,c.zipCode].filter(Boolean).join(", "):null;return e(me,{active:h===t.id,onClick:()=>y(t.id),title:c?`${t.name} — ${c.name}`:t.name,body:c?[p,c.openingHours,c.instructions,t.description].filter(Boolean).join(" · "):t.description||null,price:a.freeShipping||t.amount===0?_e:$(t.amount,a.currency),tag:t.tag||void 0},t.id)}),x.length===0&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Shipping is arranged after your order is reviewed."})]})}),r(ue,{num:"N° 04",title:"Payment",children:[e("div",{className:"grid gap-3",children:de.map(t=>e(me,{active:f===t.key,onClick:()=>C(t.key),title:t.title,body:t.body,price:t.price,tag:t.tag},t.key))}),f==="card"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll enter card details on the secure payment step after placing the order."}):f==="paypal"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll approve the payment with PayPal on the payment step after placing the order."}):f==="afterpay"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Afterpay to approve four interest-free payments, then brought straight back."}):f==="square"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll enter card details on the secure payment step after placing the order."}):f==="gocardless"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll set up a bank direct debit with GoCardless, then be brought straight back. Direct debits clear in a few days."}):f==="zip"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Zip to approve four instalments, then brought straight back."}):f==="klarna"?e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"You’ll be taken to Klarna to choose how to pay, then brought straight back."}):e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Our team emails you the invoice and bank details after review."})]})]}),r("aside",{className:"sticky top-[var(--sf-checkout-header-h,88px)] border border-line max-[1100px]:static",style:{background:"linear-gradient(180deg, color-mix(in oklab, var(--site-surface) 70%, var(--bg)) 0%, var(--bg) 100%)"},children:[r("header",{className:"flex items-center justify-between border-b border-accent bg-accent px-6 py-4 font-mono text-[13px] font-bold uppercase tracking-[0.28em] text-bg",children:[e("span",{children:"Your order"}),e(M,{href:"/wheels",className:"text-bg/80 transition-colors hover:text-bg",children:"Edit ↗"})]}),e("div",{className:"flex flex-col px-6 py-2",children:i.length===0?r("div",{className:"py-8 text-center font-serif text-[16px] italic leading-[1.5] text-fg-dim",children:["Your cart is empty. ",e(M,{href:"/wheels",className:"text-accent underline-offset-4 hover:underline",children:"Browse the catalog →"})]}):i.map(t=>e(yn,{slug:t.slug,name:t.name,qty:t.qty,config:t.config,configSummary:bn(t.config),price:$t(t,a.currency)??0,currency:a.currency},t.id))}),e("div",{className:"border-t border-line px-6 pt-5",children:e(en,{customerEmail:J})}),r("div",{className:"flex flex-col gap-2 border-t border-line mt-5 px-6 pt-5",children:[e(D,{label:"Subtotal",value:$(a.subtotal,a.currency)}),a.discount>0&&l?.valid&&e(D,{label:`Coupon · ${l.code}`,value:r("span",{className:"font-semibold text-green",children:["− ",$(a.discount,a.currency)]})}),l?.deferred&&e(D,{label:`Coupon · ${l.code}`,value:tn}),l?.valid&&l.effects?.gift&&e(D,{label:`Free gift · ${l.effects.gift.partNumber}${l.effects.gift.quantity>1?` ×${l.effects.gift.quantity}`:""}`,value:e("span",{className:"font-semibold text-green",children:_e})}),e(D,{label:"Shipping",value:a.shippingStatus==="free"?e("span",{className:"font-semibold text-green",children:_e}):an(a.shippingStatus)??$(a.shipping,a.currency)}),a.tax&&(a.tax.charged?e(D,{label:a.tax.inclusive?`${a.tax.name} included · ${a.tax.rate}%`:a.tax.name,value:$(a.tax.amount,a.currency)}):a.tax.name?e(D,{label:a.tax.name,value:on}):null)]}),r("div",{className:"mt-4 flex items-end justify-between border-y-2 border-accent px-6 py-4",style:{background:"color-mix(in oklab, var(--accent) 10%, var(--bg))"},children:[e("span",{className:"font-display text-[20px] font-bold uppercase tracking-[0.04em] text-fg",children:"Total"}),e("span",{className:"text-right font-display text-[34px] font-bold leading-none tracking-[-0.025em] text-fg",children:a.repricing?"…":$(a.grand,a.currency)})]}),r("div",{className:"flex flex-col gap-3 px-6 pt-5 pb-6",children:[Ze&&e("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:Ze}),a.hasUnpricedLine&&r("p",{className:"border border-amber-300 bg-amber-50 px-3 py-2 text-[13px] text-amber-800",children:["One or more items have no price in ",a.currency,". Remove them, or switch region, to continue."]}),e("button",{type:"button",onClick:jt,disabled:X||i.length===0||a.hasUnpricedLine||a.repricing,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",i.length===0||X||a.hasUnpricedLine||a.repricing?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:X?r(E,{children:["Building order… ",e("span",{children:"·"})]}):a.repricing?r(E,{children:["Updating total… ",e("span",{children:"·"})]}):r(E,{children:[f==="bank"?"Place order":"Continue to payment"," ·"," ",$(a.grand,a.currency),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]})})]})]})]}),e("footer",{className:"flex flex-wrap items-center justify-between gap-4 border-t border-line px-[var(--sf-site-gutter,40px)] py-6 font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim max-[640px]:px-[min(20px,var(--sf-site-gutter,40px))]",children:e("span",{children:Yt({legalName:n.legalName,foundedYear:n.foundedYear,siteName:n.name})})})]})}const K="w-full border-2 border-line bg-bg px-4 py-4 font-display text-[17px] tracking-[-0.005em] text-fg outline-none transition-colors placeholder:text-fg-dim hover:border-fg-dim focus:border-accent",pt={backgroundImage:"linear-gradient(45deg, transparent 50%, var(--accent) 50%), linear-gradient(135deg, var(--accent) 50%, transparent 50%)",backgroundPosition:"calc(100% - 18px) 50%, calc(100% - 12px) 50%",backgroundSize:"6px 6px",backgroundRepeat:"no-repeat"};function ue({num:n,title:o,children:d}){return r("section",{className:"mb-6 border border-line bg-bg",children:[r("header",{className:"flex items-center gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:n}),e("h2",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:o})]}),e("div",{className:"flex flex-col gap-4 px-6 py-6",children:d})]})}function ut({cols:n="two",children:o}){return e("div",{className:["grid gap-3 max-[640px]:grid-cols-1",n==="two"?"grid-cols-2":"grid-cols-[1.2fr_1fr_1fr]"].join(" "),children:o})}function me({active:n,onClick:o,title:d,body:i,price:a,tag:l}){return r("button",{type:"button",onClick:o,"aria-pressed":n,className:["relative grid grid-cols-[auto_1fr_auto] items-center gap-5 border bg-bg px-6 py-5 text-left transition-colors",n?"border-accent outline outline-1 outline-accent -outline-offset-1":"border-line hover:border-[color-mix(in_oklab,var(--accent)_50%,var(--site-line))]"].join(" "),style:n?{background:"color-mix(in oklab, var(--accent) 14%, var(--bg))"}:void 0,children:[n&&e("span",{"aria-hidden":!0,className:"absolute inset-y-0 left-0 w-[3px] bg-accent"}),e("span",{className:["flex h-[18px] w-[18px] items-center justify-center rounded-full border-2",n?"border-accent":"border-fg-dim"].join(" "),children:n&&e("span",{className:"block h-2.5 w-2.5 rounded-full bg-accent"})}),r("span",{className:"flex min-w-0 flex-col gap-1",children:[r("span",{className:"flex flex-wrap items-baseline gap-3 font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:[d,l&&e("span",{className:"border px-2 py-0.5 font-mono text-[11px] font-normal uppercase tracking-[0.24em] text-accent",style:{background:"color-mix(in oklab, var(--accent) 14%, transparent)",borderColor:"color-mix(in oklab, var(--accent) 45%, var(--site-line))"},children:l})]}),i&&e("span",{className:"font-mono text-[12px] uppercase tracking-[0.22em] text-fg-dim",children:i})]}),e("span",{className:"whitespace-nowrap font-display text-[18px] font-medium tracking-[-0.01em] text-fg",children:a})]})}function pn({payment:n,onPaid:o,onSkip:d}){const{formatMoney:i}=W(),a=pe(()=>Lt(n.publishableKey),[n.publishableKey]),l=pe(()=>{if(typeof document>"u")return;const m=getComputedStyle(document.documentElement),x=(y,N)=>m.getPropertyValue(y).trim()||N,h=document.documentElement.getAttribute("data-theme")!=="light";return{theme:h?"night":"stripe",variables:{colorPrimary:x("--accent",h?"#c9a461":"#8a6a2a"),colorBackground:x("--site-surface",h?"#131313":"#ffffff"),colorText:x("--fg",h?"#f5f1e8":"#0a0a0a"),borderRadius:"0px"}}},[]);return e("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:r("div",{className:"w-full max-w-xl border border-line bg-bg",children:[r("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:n.orderNumber}),e("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Payment"})]}),r("div",{className:"flex flex-col gap-4 px-6 py-6",children:[r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",e("span",{className:"text-fg",children:i(Number(n.amount),n.currency)})," ","by card to confirm it now."]}),e(Tt,{stripe:a,options:{clientSecret:n.clientSecret,appearance:l},children:e(un,{payment:n,onPaid:o,onSkip:d})})]})]})})}function un({payment:n,onPaid:o,onSkip:d}){const{formatMoney:i}=W(),a=Bt(),l=qt(),[m,x]=s(!1),[h,y]=s(null);async function N(){if(!a||!l||m)return;x(!0),y(null);const P=await a.confirmPayment({elements:l,redirect:"if_required"});if(P.error){y(P.error.message??"Payment failed. Please try again."),x(!1);return}const w=P.paymentIntent?.status;if(w==="succeeded"||w==="processing"){o();return}y("Payment did not complete. Please try again."),x(!1)}return r("div",{className:"flex flex-col gap-4",children:[e(Ot,{}),h&&e("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:h}),e("button",{type:"button",onClick:N,disabled:!a||!l||m,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!a||!l||m?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:m?r(E,{children:["Processing… ",e("span",{children:"·"})]}):r(E,{children:["Pay ",i(Number(n.amount),n.currency),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]})}),e("button",{type:"button",onClick:d,disabled:m,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later — our team will be in touch"})]})}const mt="paypal-sdk-js";let Te=null;function mn(n,o){const d=`${n}|${o}`;if(Te?.key===d)return Te.promise;const i=new Promise((a,l)=>{document.getElementById(mt)?.remove();const m=document.createElement("script");m.id=mt;const x=new URLSearchParams({"client-id":n,currency:o,intent:"capture"});m.src=`https://www.paypal.com/sdk/js?${x}`,m.onload=()=>{const h=window.paypal;h?a(h):l(new Error("PayPal SDK loaded without its namespace"))},m.onerror=()=>l(new Error("PayPal SDK failed to load")),document.head.appendChild(m)});return Te={key:d,promise:i},i}function fn({confirmation:n,clientId:o,idemKey:d,onPaid:i,onSkip:a}){const{formatMoney:l}=W(),m=U(null),[x,h]=s(!1),[y,N]=s(null),P=U(i);return P.current=i,S(()=>{let w=!1,u=null;return mn(o,n.currency).then(L=>{if(!(w||!m.current))return u=L.Buttons({style:{layout:"vertical",color:"gold",shape:"rect",label:"paypal"},createOrder:async()=>(await A.createPaypalOrder({idempotencyKey:d})).paypalOrderId,onApprove:async b=>{try{if((await A.capturePaypalOrder({idempotencyKey:d,paypalOrderId:b.orderID})).status==="paid"){P.current();return}N("PayPal did not complete the payment. Please try again.")}catch(_){N(_ instanceof je?_.message:"PayPal payment failed. Please try again.")}},onError:()=>{N("PayPal could not process the payment. Please try again.")}}),u.render(m.current).then(()=>{w||h(!0)})}).catch(()=>{w||N("PayPal could not be loaded. You can pay later — your order stands either way.")}),()=>{w=!0,u?.close?.()}},[o,n.currency,d]),e("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:r("div",{className:"w-full max-w-xl border border-line bg-bg",children:[r("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:n.orderNumber}),e("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"PayPal"})]}),r("div",{className:"flex flex-col gap-4 px-6 py-6",children:[r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",e("span",{className:"text-fg",children:l(Number(n.grandTotal),n.currency)})," ","with PayPal to confirm it now."]}),!x&&!y&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading PayPal…"}),e("div",{ref:m}),y&&e("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:y}),e("button",{type:"button",onClick:a,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later — our team will be in touch"})]})]})})}const ft="square-web-sdk";let Oe=null;function gn(n){const o=n==="sandbox"?"sandbox":"production";if(Oe?.key===o)return Oe.promise;const d=new Promise((i,a)=>{document.getElementById(ft)?.remove();const l=document.createElement("script");l.id=ft,l.src=o==="sandbox"?"https://sandbox.web.squarecdn.com/v1/square.js":"https://web.squarecdn.com/v1/square.js",l.onload=()=>{const m=window.Square;m?i(m):a(new Error("Square SDK loaded without its namespace"))},l.onerror=()=>a(new Error("Square SDK failed to load")),document.head.appendChild(l)});return Oe={key:o,promise:d},d}function hn({confirmation:n,applicationId:o,locationId:d,environment:i,idemKey:a,onPaid:l,onSkip:m}){const{formatMoney:x}=W(),h=U(null),y=U(null),N=U(null),[P,w]=s(!1),[u,L]=s(!1),[b,_]=s(null);S(()=>{let f=!1,C=null;return gn(i).then(async F=>{if(f||!h.current)return;const Z=F.payments(o,d);N.current=Z,C=await Z.card(),await C.attach(h.current),y.current=C,f||w(!0)}).catch(()=>{f||_("Square could not be loaded. You can pay later — your order stands either way.")}),()=>{f=!0,C?.destroy?.()}},[o,d,i]);async function $(){const f=y.current;if(!(!f||u)){L(!0),_(null);try{const C=await f.tokenize();if(C.status!=="OK"||!C.token){_(C.errors?.[0]?.message??"Please check the card details and try again."),L(!1);return}let F;try{F=(await N.current?.verifyBuyer?.(C.token,{amount:String(n.grandTotal),currencyCode:n.currency,intent:"CHARGE"}))?.token}catch{}if((await A.chargeSquare({idempotencyKey:a,sourceId:C.token,...F?{verificationToken:F}:{}})).status==="paid"){l();return}_("Square did not complete the payment. Please try again.")}catch(C){_(C instanceof je?C.message:"Square payment failed. Please try again.")}L(!1)}}return e("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-bg px-6 py-16 text-fg",children:r("div",{className:"w-full max-w-xl border border-line bg-bg",children:[r("header",{className:"flex items-center justify-between gap-4 border-b border-line bg-surface px-6 py-4",children:[e("span",{className:"inline-flex items-center justify-center bg-accent px-3 py-1 font-mono text-[11px] font-bold uppercase tracking-[0.24em] text-bg",children:n.orderNumber}),e("h1",{className:"font-display text-[26px] font-medium uppercase leading-none tracking-[-0.02em] text-fg",children:"Card"})]}),r("div",{className:"flex flex-col gap-4 px-6 py-6",children:[r("p",{className:"font-mono text-[12px] uppercase tracking-[0.2em] text-fg-dim",children:["Your order is placed. Pay"," ",e("span",{className:"text-fg",children:x(Number(n.grandTotal),n.currency)})," ","by card to confirm it now."]}),!P&&!b&&e("p",{className:"font-mono text-[11px] uppercase tracking-[0.2em] text-fg-dim",children:"Loading card form…"}),e("div",{ref:h}),b&&e("p",{className:"border border-red-300 bg-red-50 px-3 py-2 text-[13px] text-red-700",children:b}),e("button",{type:"button",onClick:$,disabled:!P||u,className:["group flex items-center justify-between border px-5 py-5 font-mono text-[14px] font-medium uppercase tracking-[0.3em] transition-all",!P||u?"cursor-not-allowed border-line bg-surface text-fg-dim":"border-btn bg-btn text-btn-ink hover:border-fg hover:bg-fg"].join(" "),children:u?r(E,{children:["Processing… ",e("span",{children:"·"})]}):r(E,{children:["Pay ",x(Number(n.grandTotal),n.currency),e("span",{className:"transition-transform group-hover:translate-x-1",children:"→"})]})}),e("button",{type:"button",onClick:m,disabled:u,className:"self-center font-mono text-[11px] uppercase tracking-[0.24em] text-fg-dim underline-offset-4 transition-colors hover:text-accent hover:underline",children:"Pay later — our team will be in touch"})]})]})})}function xn({checked:n,onChange:o,label:d,sub:i}){return r("div",{className:"flex items-start gap-3 border-t border-line py-4 first:border-t-0 first:pt-0",children:[e("button",{type:"button",onClick:()=>o(!n),"aria-pressed":n,"aria-label":d,className:["mt-px flex h-5 w-5 flex-shrink-0 items-center justify-center border transition-colors",n?"border-accent":"border-line"].join(" "),style:n?{background:"color-mix(in oklab, var(--accent) 18%, transparent)"}:void 0,children:n&&e("span",{className:"text-[13px] text-accent",children:"✓"})}),r("span",{className:"flex-1 font-display text-[16px] leading-[1.5] text-fg",children:[d,i&&e("small",{className:"mt-1 block font-mono text-[12px] uppercase tracking-[0.18em] text-fg-dim",children:i})]})]})}function yn({slug:n,name:o,qty:d,config:i,configSummary:a,price:l,currency:m}){const{catalog:x}=it(),{formatMoney:h}=W(),y=x.find(b=>b.slug===n),N=y?.spokes??5,P=y?.mesh??!1,w=i.find(b=>b.gold)?.label,u=y?.finishes.find(b=>b.name===w&&b.src)??y?.finishes.find(b=>b.src),L=y?.finishes[0]?.color??cn;return r("div",{className:"grid grid-cols-[60px_1fr_auto] items-center gap-4 border-b border-line py-4 last:border-b-0",children:[r("div",{className:"relative flex aspect-square items-center justify-center overflow-hidden border border-line bg-surface",children:[e("span",{className:"absolute -right-1.5 -top-1.5 z-[2] flex h-[18px] w-[18px] items-center justify-center rounded-full bg-accent font-mono text-[11px] font-bold text-bg",children:d}),u?.src?e(Kt,{src:u.src,alt:`${o.lead}${o.accent} — ${u.name}`,width:120,height:120,sizes:"60px",className:"relative block h-full w-full object-contain p-2"}):e("div",{className:"block w-[78%]",style:{color:L},children:e(ln,{spokes:N,mesh:P,className:"block w-full"})})]}),r("div",{className:"flex min-w-0 flex-col gap-0.5",children:[r("span",{className:"font-display text-[17px] font-bold uppercase leading-none tracking-[-0.005em] text-fg",children:[o.lead,e("em",{className:"font-serif font-normal italic text-accent tracking-[-0.005em] normal-case",children:o.accent})]}),e("span",{className:"font-mono text-[12px] uppercase leading-[1.5] tracking-[0.18em] text-fg-dim",children:a})]}),e("span",{className:"text-right font-display text-[17px] font-bold tracking-[-0.005em] text-fg",children:h(l,m)})]})}function D({label:n,value:o}){return r("div",{className:"flex items-center justify-between font-mono text-[13px] font-medium uppercase tracking-[0.18em] text-fg",children:[e("span",{children:n}),e("strong",{className:"font-display text-[16px] font-medium tracking-[-0.005em] normal-case text-fg",children:o})]})}function bn(n){return n.map(o=>o.label).join(" · ")}export{dt as buildPayOptions,dn as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as r,jsxs as t}from"react/jsx-runtime";import{PickerField as a}from"./PickerField.js";import{vehicleLevelStates as m}from"./vehicle-level-state.js";import{VEHICLE_FIELD_LABEL as n}from"../../lib/wheels/vehicle-field-focus.js";function p({cascade:e,compact:i=!1,editing:d=!1}){const{vehicle:o}=e,l=m(e),s=t("div",{className:["grid gap-[2px] border border-line bg-line",i?"grid-cols-1 @min-[20rem]:grid-cols-2 @min-[39rem]:grid-cols-4":"grid-cols-4 max-[1100px]:grid-cols-2 max-[700px]:grid-cols-1"].join(" "),children:[r(a,{label:n.make,placeholder:l.make.placeholder,disabled:l.make.disabled,value:o.make,options:e.makeOptions,onChange:e.setMake,compact:i,editing:d}),r(a,{label:n.model,placeholder:l.model.placeholder,disabled:l.model.disabled,value:o.model,options:e.modelOptions,onChange:e.setModel,compact:i,editing:d}),r(a,{label:n.year,placeholder:l.year.placeholder,disabled:l.year.disabled,value:o.year!==null?String(o.year):"",options:e.yearOptions,onChange:e.setYear,compact:i,editing:d}),r(a,{label:n.trim,placeholder:l.trim.placeholder,disabled:l.trim.disabled,value:o.modification,options:e.modOptions,onChange:e.setModification,compact:i,editing:d})]});return i?r("div",{className:"@container",children:s}):s}export{p as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as a,jsxs as
|
|
1
|
+
"use client";import{jsx as a,jsxs as f}from"react/jsx-runtime";import g from"efficient-web-builder/render/components/PartStyledKind";import{ThemedSelectList as y,useThemedSelect as I}from"../ThemedSelect.js";import{PART_KIND_ATTR as u}from"efficient-web-builder/render/lib/puck/text-parts";import{TEXT_KIND_BODY as b,TEXT_KIND_NAME as h}from"efficient-web-builder/format/lib/sections/section-text-kinds";const n={body:"text-[length:var(--size-body,15px)]",headingSmall:"text-[length:var(--size-headingSmall,24px)]",labelXs:"text-[length:var(--size-label,10px)]",labelSmall:"text-[length:var(--size-label,11px)]",labelLarge:"text-[length:var(--size-label,12px)]",labelXl:"text-[length:var(--size-label,14px)]"};function T(o,l){return[{value:"",label:l??"—"},...o.map(i=>({value:i.value,label:i.label}))]}function z({label:o,value:l,options:i,onChange:v,placeholder:p,disabled:t,compact:s=!1,editing:d=!1}){const m=(i.find(r=>r.value===l)?.label??l)||p||"—",x=T(i,p),e=I({items:x,value:l,onPick:v}),c=e.open;return f("div",{ref:e.wrapRef,className:"relative min-w-0",children:[f("div",{ref:r=>{e.triggerRef.current=r},role:"button",tabIndex:t?-1:0,"aria-haspopup":"listbox","aria-expanded":c,"aria-controls":c?e.listId:void 0,"aria-activedescendant":e.activeId,"aria-label":o,"aria-disabled":t||void 0,onClick:()=>!t&&e.toggle(),onKeyDown:r=>!t&&e.onTriggerKeyDown(r),className:["relative flex h-full flex-col bg-bg transition-colors",s?"gap-1 px-3 py-3":"min-h-[160px] gap-4 px-6 py-8",t?"opacity-50":"cursor-pointer hover:bg-surface"].join(" "),children:[a("span",{...d?{[u]:h}:{},className:["font-mono uppercase text-accent",s?`${n.labelXs} tracking-[0.2em]`:`${n.labelLarge} tracking-[0.3em]`].join(" "),children:a(g,{kind:h,children:o})}),a("span",{title:m,className:["truncate font-display font-medium tracking-[-0.02em]",s?`${n.body} leading-[1.2]`:`mt-auto ${n.headingSmall} leading-[1.1]`,l?"text-fg":"text-fg-dim"].join(" "),...d?{[u]:b}:{},children:a(g,{kind:b,children:m})}),a("span",{className:["pointer-events-none absolute font-mono text-accent",s?`right-3 top-3 ${n.labelSmall}`:`right-[22px] top-[22px] ${n.labelXl}`].join(" "),children:"▾"})]}),c&&!t&&a(y,{id:e.listId,tone:"cell",items:x,value:l,focusIdx:e.focusIdx,onFocus:e.setFocusIdx,onPick:e.pick,listRef:e.listRef})]})}export{z as PickerField,T as pickerItems};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as s}from"react/jsx-runtime";import
|
|
1
|
+
"use client";import{jsx as s}from"react/jsx-runtime";import y from"../SectionBand.js";import f from"../DetailRows.js";import R from"./KindGate.js";import x from"./RecordPhotoGallery.js";import{useCurrentProduct as D}from"../../lib/puck/current-product.js";import{SAMPLE_RECORD as b,recordFacts as k,recordPictures as p,useCurrentRecord as S,useDrawsOtherRecord as B}from"../../lib/puck/current-record.js";import{detailShotTag as P,pickDetailShots as T}from"../../lib/wheels/detail-shots.js";import{selectedStuds as N}from"../../lib/wheels/selected-studs.js";import{useSampleProduct as v}from"./useSampleProduct.js";import{say as C}from"efficient-web-builder/format/lib/editor-words";const F=["alloy-wheel"];function h(e,n){return e.finishes.find(t=>t.name===n)??e.finishes[0]}function L(e,n){return(h(e,n)?.features??[]).map(t=>({eyebrow:t.eyebrow,title:t.heading,copy:t.description,tag:t.mark,image:t.image||void 0}))}function j(e,n,t){const r=T(h(e,n),t);return r.rows.map(i=>({eyebrow:i.eyebrow?.trim()||void 0,title:i.title,copy:i.line||void 0,image:i.url,tag:P(i,r,t),imageShape:"square"}))}function E(e){return B(!!e.editing)?s(G,{...e}):s(R,{kinds:F,type:"DetailRows",editing:e.editing,children:s(K,{...e})})}function w(e){const n=k(e),t=p(e)[0];return!n.length&&!t&&!e.title.trim()?[]:[{title:e.title,specs:n,image:t?.url||void 0}]}function G({startLeft:e,padTop:n,padBottom:t,editing:r=!1}){const i=S(),o=i?w(i):r?w(b):[];if(o.length===0)return null;const a=i?p(i,{firstField:!0}):[];return a.length&&(o[0]={...o[0],media:s(x,{pictures:a,name:i?.title??"",editing:r,fit:"column"})}),s(f,{rows:o,startLeft:e,padTop:n,padBottom:t,editing:r})}function K({rowsFrom:e,startLeft:n,padTop:t,padBottom:r,editing:i=!1}){const o=D(),a=v(i&&!o),c=o?.product??a,l=c?.kind==="alloy-wheel"?c.source:null,u=o?o.selection.shown.finish:void 0,g=o?N(o.selection):null,d=e==="details",m=l?d?j(l,u,g):L(l,u):[];return d&&m.length===0?i?s(y,{className:"border-b border-line py-14 max-[1100px]:py-10",children:s("p",{className:"font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:C("No detail shots on this finish yet. Tick a close-up on the design's renderings and give it a title. This section is hidden on the live page until then.")})}):null:s(f,{rows:m,startLeft:n,padTop:t,padBottom:r,editing:i})}export{E as default,w as recordDetailRows,F as supportedKinds};
|
|
@@ -14,5 +14,7 @@ export interface DynamicGalleryGridProps {
|
|
|
14
14
|
styleOwner?: string;
|
|
15
15
|
editing?: boolean;
|
|
16
16
|
omitHead?: boolean;
|
|
17
|
+
padTop?: number;
|
|
18
|
+
padBottom?: number;
|
|
17
19
|
}
|
|
18
20
|
export default function DynamicGalleryGrid(props: DynamicGalleryGridProps): import("react").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as t,jsxs as _}from"react/jsx-runtime";import
|
|
1
|
+
"use client";import{jsx as t,jsxs as _}from"react/jsx-runtime";import L from"efficient-web-builder/render/components/Btn";import M,{GALLERY_GRID_ATTR as B,GalleryLinksContext as C}from"../GalleryItem.js";import{SharedPartKinds as H}from"efficient-web-builder/render/components/PublishedPartStylesContext";import{renderHeadline as j}from"efficient-web-builder/render/components/goldPhrases";import D from"efficient-web-builder/render/components/SectionHeader";import F from"./KindGate.js";import K from"./RecordPhotoGallery.js";import{headIsEmpty as U,ownPadding as Z}from"../../lib/sections/own-padding.js";import{PLP_KINDS as $}from"../../lib/catalog/plp-item.js";import{useCurrentProduct as z}from"../../lib/puck/current-product.js";import{SAMPLE_PICTURE_COUNT as V,SAMPLE_RECORD as W,recordPictures as X,useCurrentRecord as Y,useDrawsOtherRecord as q}from"../../lib/puck/current-record.js";import{mediaGroupVehicle as J}from"../../lib/content/source-values.js";import{useSampleProduct as Q}from"./useSampleProduct.js";import{say as R}from"efficient-web-builder/format/lib/editor-words";const ee=$,E=["photos","lifestyle","accessories","others"];function re(e,o){if(!e)return[];if(o==="all")return E.flatMap(n=>e[n]??[]);const a=E.includes(o)?o:null;return a?e[a]??[]:[]}const S="relative z-[2] bg-bg py-[120px] max-[800px]:py-[70px]",A="relative z-[2] bg-bg pt-0 pb-[120px] max-[800px]:pt-0 max-[800px]:pb-[70px]",O="mx-auto max-w-[var(--sf-site-width,1600px)] px-[var(--sf-site-gutter,40px)] max-[800px]:px-[min(20px,var(--sf-site-gutter,40px))]";function te(e){return q(!!e.editing)?t(ie,{...e}):t(F,{kinds:ee,type:"GalleryB",editing:e.editing,children:t(ae,{...e})})}function ie(e){const{editing:o=!1}=e,a=Y(),n=a?X(a,{firstField:!0}).map(s=>({images:[s.url],eyebrow:s.alt&&s.alt!==a.title?s.alt:void 0,...s.video?{video:s.video}:{}})):o?Array.from({length:V},()=>({images:[""]})):[];return t(T,{...e,tiles:n,owner:{name:(a??W).title},photosOnly:!0,emptyHint:R("This record’s pictures appear here on its page. A record with no pictures draws nothing.")})}function ae({omitHead:e=!1,num:o,title:a,linkText:n,linkHref:s,galleryHref:u="/gallery",submitHref:y="/contact",zone:v="all",photoDisplay:h="covers",previewHover:b,display:N,displayPhone:d,styleOwner:c,editing:m=!1,padTop:w,padBottom:p}){const g=z(),G=Q(m&&!g),l=g?.product??G,f=re(l?.mediaGroups,v).map(r=>({images:(r.items??[]).filter(i=>i.kind==="image").map(i=>i.url),vehicle:J(r),finish:r.finish})).filter(r=>r.images.length>0),x=(h==="auto"?f.length>=4?"covers":"all":h)==="all"?f.flatMap(r=>r.images.map(i=>({images:[i],vehicle:r.vehicle,finish:r.finish}))):f;return t(T,{omitHead:e,num:o,title:a,linkText:n,linkHref:s,galleryHref:u,submitHref:y,previewHover:b,display:N,displayPhone:d,styleOwner:c,editing:m,padTop:w,padBottom:p,tiles:l?x.map(r=>({images:r.images,eyebrow:r.vehicle||void 0,meta:r.finish})):[],owner:{name:l?.name??"",href:l?.href,process:l?.eyebrow},emptyHint:R("This product’s photos appear here on a product page. Add media groups in the product’s Media tab.")})}function T({omitHead:e=!1,num:o,title:a,linkText:n,linkHref:s,galleryHref:u="/gallery",submitHref:y="/contact",previewHover:v,display:h,displayPhone:b,styleOwner:N,editing:d=!1,tiles:c,owner:m,emptyHint:w,photosOnly:p=!1,padTop:g,padBottom:G}){const l=n?{text:n,href:s||"#"}:void 0,f=a?j(a,!1):void 0,P=e?null:t(D,{num:o,title:f,link:l}),x=!d&&U(o,a,l?.text)?null:P,r=Z(g,G);return c.length===0?d?t("section",{className:e?A:S,style:r,children:_("div",{className:O,children:[x,t("p",{className:"mt-8 border-t border-line py-6 font-mono text-[length:var(--size-label,13px)] uppercase tracking-[0.18em] text-fg-dim",children:w})]})}):null:t("section",{className:e?A:S,style:r,children:_("div",{className:O,children:[x,p?t(K,{pictures:c.map(i=>({url:i.images[0]??"",alt:i.eyebrow,video:i.video})),name:m.name,editing:d}):t(C.Provider,{value:{galleryHref:u,submitHref:y,previewHover:v,display:h,displayPhone:b,styleOwner:N,photosOnly:p},children:t(H,{children:t("div",{[B]:"",className:"grid grid-cols-4 gap-2 max-[1500px]:grid-cols-3 max-[800px]:grid-cols-1 max-[800px]:gap-1",children:c.map((i,k)=>t(M,{image:i.images[0],photos:i.images.slice(1).map(I=>({src:I})),href:m.href,process:m.process,eyebrow:i.eyebrow,name:m.name,meta:i.meta,editing:d},`${i.eyebrow}-${k}`))})})}),!p&&t("div",{className:"mt-12 flex flex-col items-center gap-3",children:t(L,{href:u,variant:"ghost",children:"See Gallery"})})]})})}export{te as default,ee as supportedKinds};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface GalleryPicture {
|
|
2
|
+
url: string;
|
|
3
|
+
alt?: string;
|
|
4
|
+
video?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function pictureLabel(picture: GalleryPicture, name: string): string;
|
|
7
|
+
export default function RecordPhotoGallery({ pictures, name, editing, fit, }: {
|
|
8
|
+
pictures: readonly GalleryPicture[];
|
|
9
|
+
fit?: "section" | "column";
|
|
10
|
+
name: string;
|
|
11
|
+
editing?: boolean;
|
|
12
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";import{jsx as t,Fragment as b,jsxs as c}from"react/jsx-runtime";import{useCallback as C,useRef as I,useState as N}from"react";import{sizedImage as M}from"efficient-web-builder/format/lib/sized-image";import P from"efficient-web-builder/render/components/Placeholder";import S,{LightboxClose as A}from"../Lightbox.js";import{GALLERY_GRID_ATTR as B}from"../GalleryItem.js";const O="(max-width: 1600px) 100vw, 1600px",U="(max-width: 1100px) 100vw, 50vw",z="(max-width: 800px) 30vw, 200px",R="100vw";function h(r,o){return r.video?o?`Play video of ${o}`:"Play video":o?`Open photo of ${o}`:"Open photo"}function T({small:r=!1}){return t("span",{"aria-hidden":!0,"data-play-badge":"",className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:t("span",{className:`flex items-center justify-center rounded-full bg-bg/75 text-fg ${r?"h-8 w-8 text-[length:12px]":"h-16 w-16 text-[length:22px]"}`,children:"▶"})})}const D="relative block w-full overflow-hidden bg-surface-2",G="block h-[min(78vh,820px)] w-full object-cover max-[800px]:h-[min(70vh,560px)]",H="block aspect-[4/5] max-h-[80vh] w-full object-cover",F="grid grid-cols-4 gap-2",Z="relative block aspect-square w-full overflow-hidden bg-surface-2",W="block h-full w-full object-cover",X="grid grid-cols-6 gap-2 max-[800px]:grid-cols-4",q="cursor-pointer text-left focus:outline-none focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent focus-visible:outline-offset-2",_="absolute top-1/2 z-[2] flex h-14 w-14 -translate-y-1/2 cursor-pointer items-center justify-center border border-fg-dim/40 bg-overlay-scrim/40 font-mono text-[length:var(--size-label,22px)] text-fg-dim transition-colors hover:border-accent hover:text-accent max-[700px]:h-11 max-[700px]:w-11";function Y({pictures:r,name:o,editing:p=!1,fit:$="section"}){const[j,m]=N(!1),[i,u]=N(0),d=I(null),E=C(e=>{e?d.current=e:(d.current?.pause(),d.current=null)},[]),l=r.length,v=$==="column";if(l===0)return null;const g=()=>u(e=>(e-1+l)%l),w=()=>u(e=>(e+1)%l),L=e=>{u(e),m(!0)},n=r[Math.min(i,l-1)],f=(e,a,s,x)=>e.url?t("span",{className:`${s} relative`,children:t(P,{label:e.alt||o||"photo",src:e.url,alt:e.alt||o,sizes:a,objectFit:"cover",showBackground:!1})}):t("span",{"aria-hidden":!0,className:`${s} bg-surface-2`}),y=(e,a,s)=>{const x=c(b,{children:[s?v?f(e,U,H,1200):f(e,O,G,1600):f(e,z,W,400),e.video&&t(T,{small:!s})]}),k=s?D:Z;return p?t("div",{className:k,children:x}):t("button",{type:"button","aria-label":h(e,o),onClick:()=>L(a),className:`${k} ${q}`,children:x})};return c(b,{children:[c("div",{[B]:"","data-record-gallery":"",className:"flex flex-col gap-2",children:[y(r[0],0,!0),l>1&&t("ul",{className:v?F:X,children:r.slice(1).map((e,a)=>t("li",{children:y(e,a+1,!1)},`${e.url}-${a+1}`))})]}),!p&&t(S,{open:j,onClose:()=>m(!1),label:h(n,o),onPrev:l>1?g:void 0,onNext:l>1?w:void 0,className:"flex items-center justify-center p-6 backdrop-blur-[8px] max-[700px]:p-3",style:{background:"color-mix(in oklab, var(--bg) 86%, transparent)"},children:c("div",{onClick:e=>e.stopPropagation(),className:"relative flex h-full w-full items-center justify-center",children:[t(A,{className:"absolute right-0 top-0 z-[3] flex h-12 w-12 cursor-pointer items-center justify-center border border-line font-mono text-[length:var(--size-label,18px)] text-fg-dim transition-colors hover:border-accent hover:text-fg",style:{background:"color-mix(in oklab, var(--bg) 70%, transparent)"},children:"✕"}),n.video?t("video",{ref:E,controls:!0,playsInline:!0,preload:"metadata",poster:n.url,src:n.video,"aria-label":h(n,o),className:"block max-h-[calc(100vh-120px)] max-w-full bg-bg"},`video-${i}`):t("img",{...M(n.url,{fallbackWidth:1600}),sizes:R,alt:`${n.alt||o||"Photo"} — ${i+1} of ${l}`,className:"block max-h-[calc(100vh-120px)] max-w-full object-contain"},`photo-${i}`),l>1&&c(b,{children:[t("button",{type:"button","aria-label":"Previous photo",onClick:g,className:`${_} left-0`,children:"◁"}),t("button",{type:"button","aria-label":"Next photo",onClick:w,className:`${_} right-0`,children:"▷"}),c("span",{"data-gallery-counter":"",className:"absolute bottom-0 left-1/2 -translate-x-1/2 border border-fg-dim/30 bg-overlay-scrim/50 px-4 py-1.5 font-mono text-[length:var(--size-label,14px)] uppercase tracking-[0.22em] text-fg-dim backdrop-blur-[4px]",children:[i+1," / ",l]})]})]})})]})}export{Y as default,h as pictureLabel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function d(c,i,t){const n=(i??"").trim();if(!n)return"";if(t.length===0)return n;const o=n.toUpperCase(),r=`${c.toUpperCase()}-${o}`,p=t.find(e=>e.code&&e.code.toUpperCase()===o)??t.find(e=>e.code&&e.code.toUpperCase()===r)??t.find(e=>e.name.toUpperCase()===o);return p?p.code||p.name:""}export{d as matchSubdivision};
|
|
@@ -28,8 +28,6 @@ export declare function resolveConsent({ asked, region, stored, gpc, }: {
|
|
|
28
28
|
stored: StoredChoice | null;
|
|
29
29
|
gpc: boolean;
|
|
30
30
|
}): ConsentState;
|
|
31
|
-
export declare function getConsent(): ConsentState;
|
|
32
31
|
export declare function setConsent(next: ConsentState): void;
|
|
33
|
-
export declare function subscribeConsent(listener: () => void): () => void;
|
|
34
32
|
export declare function adConsentForOrder(state?: ConsentState): "granted" | "denied" | undefined;
|
|
35
33
|
export declare function googleConsentMode(state: ConsentState): Record<"ad_storage" | "ad_user_data" | "ad_personalization" | "analytics_storage", "granted" | "denied">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{safeLocalStorage as
|
|
1
|
+
import{safeLocalStorage as s}from"efficient-web-builder/format/lib/safe-storage";import{CONSENT_RULES as c,CONSENT_RULES_VERSION as i}from"./rules.js";const l="sf:consent",d={asked:!1,region:"other",model:"opt-in",analytics:!0,ads:!0,chosen:!0,gpc:!1};function y(){const e=s.getItem(l);if(!e)return null;try{const t=JSON.parse(e);return t.v!==i||typeof t.analytics!="boolean"||typeof t.ads!="boolean"?null:{v:t.v,analytics:t.analytics,ads:t.ads,t:typeof t.t=="number"?t.t:0}}catch{return null}}function p(e,t=Date.now()){s.setItem(l,JSON.stringify({v:i,analytics:e.analytics,ads:e.ads,t}))}function S(){return typeof navigator>"u"?!1:navigator.globalPrivacyControl===!0}function _({asked:e,region:t,stored:o,gpc:a}){if(!e)return{...d,region:t,gpc:a};const r=c[t].model;return o?{asked:e,region:t,model:r,analytics:o.analytics,ads:o.ads&&!a,chosen:!0,gpc:a}:r==="opt-out"?{asked:e,region:t,model:r,analytics:!0,ads:!a,chosen:!1,gpc:a}:{asked:e,region:t,model:r,analytics:!1,ads:!1,chosen:!1,gpc:a}}let n=d;function g(e){e.asked===n.asked&&e.region===n.region&&e.analytics===n.analytics&&e.ads===n.ads&&e.chosen===n.chosen&&e.gpc===n.gpc||(n=e)}function m(e=n){if(e.asked)return e.ads?"granted":"denied"}function C(e){const t=e.ads?"granted":"denied";return{ad_storage:t,ad_user_data:t,ad_personalization:t,analytics_storage:e.analytics?"granted":"denied"}}export{l as CONSENT_STORAGE_KEY,d as NOT_ASKED,m as adConsentForOrder,S as browserSendsGpc,C as googleConsentMode,y as readStoredChoice,_ as resolveConsent,g as setConsent,p as writeStoredChoice};
|
|
@@ -45,7 +45,6 @@ export declare const PANEL_ROWS: {
|
|
|
45
45
|
readonly bodyNoSale: "Google Ads and Meta (Facebook, Instagram) tags, which measure our ads.";
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
|
-
export declare const PANEL_HEADING = "Your privacy choices.";
|
|
49
48
|
export declare const GPC_HONOURED: {
|
|
50
49
|
readonly title: "Opt-out request honoured";
|
|
51
50
|
readonly body: "Your browser sent a Global Privacy Control signal. We have turned off sale and sharing of your information for ads.";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const m=1,s="Ads on. Shopper can opt out.",i="Ads and analytics off until Accept",r={us:{region:"us",name:"United States",model:"opt-out",law:"California CCPA / CPRA, other state laws",beforeChoice:s,footerLink:"Do Not Sell or Share My Personal Information",panelEyebrow:"Do not sell or share",adsRowName:"Sale or sharing for ads"},ca:{region:"ca",name:"Canada",model:"opt-in",law:"PIPEDA, Quebec Law 25",beforeChoice:i,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},au:{region:"au",name:"Australia",model:"opt-out",law:"Privacy Act 1988 (APPs)",beforeChoice:s,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},nz:{region:"nz",name:"New Zealand",model:"opt-out",law:"Privacy Act 2020",beforeChoice:s,footerLink:"Privacy choices",panelEyebrow:"Privacy choices",adsRowName:"Advertising"},uk:{region:"uk",name:"United Kingdom",model:"opt-in",law:"PECR, UK GDPR",beforeChoice:i,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},eu:{region:"eu",name:"European Union",model:"opt-in",law:"ePrivacy Directive, GDPR",beforeChoice:i,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"},other:{region:"other",name:"All other countries",model:"opt-in",law:"Safe default",beforeChoice:i,footerLink:"Cookie settings",panelEyebrow:"Cookie settings",adsRowName:"Advertising"}},p="Honoured: ads off",l=new Set(["AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","GR","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE","IS","LI","NO"]),c={US:"us",PR:"us",GU:"us",VI:"us",AS:"us",MP:"us",CA:"ca",AU:"au",NZ:"nz",GB:"uk"};function u(o){const e=(o??"").trim().toUpperCase();return e?c[e]?c[e]:l.has(e)?"eu":"other":"other"}const h=new Set(["Pacific/Honolulu","Pacific/Guam","Pacific/Saipan","Pacific/Pago_Pago","America/Puerto_Rico","America/St_Thomas"]),d=new Set(["New_York","Chicago","Denver","Los_Angeles","Phoenix","Anchorage","Adak","Boise","Detroit","Juneau","Sitka","Metlakatla","Yakutat","Nome","Menominee","Indianapolis","Louisville","Fort_Wayne","Knox_IN"]),f=new Set(["Toronto","Vancouver","Edmonton","Winnipeg","Halifax","St_Johns","Regina","Montreal","Moncton","Glace_Bay","Goose_Bay","Iqaluit","Whitehorse","Dawson","Dawson_Creek","Fort_Nelson","Creston","Cambridge_Bay","Inuvik","Rankin_Inlet","Resolute","Swift_Current","Atikokan","Blanc-Sablon","Nipigon","Thunder_Bay","Rainy_River","Pangnirtung","Yellowknife","Coral_Harbour"]);function y(o){const e=(o??"").trim();if(!e)return"other";if(e==="Europe/London"||e==="Europe/Belfast"||e==="GB"||e==="GB-Eire"||e==="Europe/Guernsey"||e==="Europe/Jersey"||e==="Europe/Isle_of_Man")return"uk";if(e.startsWith("Europe/")||e==="Atlantic/Canary"||e==="Atlantic/Madeira"||e==="Atlantic/Azores"||e==="Atlantic/Reykjavik"||e==="Atlantic/Faroe")return"eu";if(e.startsWith("Australia/")||e==="Antarctica/Macquarie")return"au";if(e==="Pacific/Auckland"||e==="Pacific/Chatham"||e==="NZ"||e==="NZ-CHAT")return"nz";if(e.startsWith("US/")||h.has(e))return"us";if(e.startsWith("Canada/"))return"ca";if(e.startsWith("America/")){const n=e.slice(8),t=n.split("/")[0];if(t==="Indiana"||t==="Kentucky"||t==="North_Dakota"||d.has(n))return"us";if(f.has(n))return"ca"}return"other"}function C(o,e){const n=y(o);if(!e)return n;const t=u(e);return r[n].model==="opt-in"?n:(r[t].model==="opt-in",t)}function A(o){const e=new Set,n=[];for(const t of o){const a=u(t);a==="other"||e.has(a)||(e.add(a),n.push(r[a]))}return n.push(r.other),n}function g(o){const e=[...o.googleAds?["Google"]:[],...o.meta?["Facebook","Instagram"]:[]];return e.length<=1?e.join(""):`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}function k(o,e,n){const t=g(n),a=t?`We use cookies to count visits and to show you ${e} ads on ${t}.`:"We use cookies to count visits.";return o.model==="opt-in"?{heading:t?"Cookies and ads":"Cookies",before:`${a} Nothing loads until you choose. You can change this at any time with `,link:o.footerLink,after:" at the bottom of every page."}:{heading:t?"Cookies and ads":"Cookies",before:`${a} You can say no at any time: choose Privacy choices, or use `,link:o.footerLink,after:" at the bottom of every page."}}const w={necessary:{name:"Necessary",body:"Cart, checkout, your country and currency, sign-in, and this choice. The site cannot work without them.",bodyNoSale:"What the site needs to work, such as remembering this choice. The site cannot work without them."},analytics:{name:"Analytics",body:"Counts visits and pages so we can improve the site. Google Analytics and our own visit count."},ads:{body:"Google Ads and Meta (Facebook, Instagram) tags, and the order details we send to them to measure our ads.",bodyNoSale:"Google Ads and Meta (Facebook, Instagram) tags, which measure our ads."}},E={title:"Opt-out request honoured",body:"Your browser sent a Global Privacy Control signal. We have turned off sale and sharing of your information for ads."},P={accept:"Accept all",reject:"Reject all",choose:"Choose",save:"Save",ok:"OK",privacyChoices:"Privacy choices",privacyPolicy:"Privacy Policy",alwaysOn:"Always on"};export{P as CONSENT_BUTTONS,p as CONSENT_GPC_RULE,r as CONSENT_RULES,m as CONSENT_RULES_VERSION,E as GPC_HONOURED,w as PANEL_ROWS,g as adPlaces,k as bannerWords,u as regionOfCountry,y as regionOfTimeZone,A as rulesForCountries,C as visitorRegion};
|
|
@@ -35,9 +35,13 @@ export interface GalleryProductValue {
|
|
|
35
35
|
href?: string;
|
|
36
36
|
cover?: string;
|
|
37
37
|
photos?: string[];
|
|
38
|
+
vehicle?: string;
|
|
38
39
|
eyebrow?: string;
|
|
39
40
|
hideName?: boolean;
|
|
40
41
|
hideProcess?: boolean;
|
|
41
42
|
hideEyebrow?: boolean;
|
|
42
43
|
hideFinish?: boolean;
|
|
43
44
|
}
|
|
45
|
+
export declare function mediaGroupVehicle(group: {
|
|
46
|
+
vehicle?: string | null;
|
|
47
|
+
} | null | undefined): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function i(e){return(e?.vehicle??"").trim()}export{i as mediaGroupVehicle};
|
|
@@ -3,8 +3,4 @@ export declare const STOCK_WORDS: {
|
|
|
3
3
|
readonly outOfStock: "Out of stock";
|
|
4
4
|
readonly notInStockHere: "Not in stock here";
|
|
5
5
|
};
|
|
6
|
-
export declare function unitsInStock(n: number): string;
|
|
7
|
-
export declare function setsInStock(n: number): string;
|
|
8
|
-
export declare function pickupAt(place: string): string;
|
|
9
|
-
export declare function pickupAtCount(n: number): string;
|
|
10
6
|
export declare function stockWord(inStock: boolean): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const o={inStock:"In stock",outOfStock:"Out of stock",notInStockHere:"Not in stock here"};function
|
|
1
|
+
const o={inStock:"In stock",outOfStock:"Out of stock",notInStockHere:"Not in stock here"};function c(t){return t?o.inStock:o.outOfStock}export{o as STOCK_WORDS,c as stockWord};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as d}from"react/jsx-runtime";import u from"../../../../../components/pdp-dynamic/DynamicGalleryGrid.js";import o from"../../../../../components/GalleryGrid.js";import{hidableText as l}from"efficient-easel/screen/lib/puck/hidable";import{parseSectionHeadPlacement as y}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as t}from"efficient-web-builder/render/lib/puck/blocks/scaffold";import{GalleryBMeta as c,GALLERY_B_PH as n}from"./meta.js";const x={...c,render:e=>{const a=y(e.headPlacement)==="own-box",i=m=>a?void 0:m;return e.dynamic?d(u,{num:i(t(e.num,n.num,e.puck)),title:i(t(e.title,n.title,e.puck)),linkText:i(t(e.linkText,n.link,e.puck)),linkHref:i(l(e.linkHref)||"/contact"),omitHead:a,galleryHref:l(e.galleryHref)||"/gallery",zone:e.mediaZone||"all",photoDisplay:e.photoDisplay||"covers",previewHover:e.previewHover,display:e.display,displayPhone:e.displayPhone,styleOwner:e.id,editing:e.puck?.isEditing,padTop:typeof e.padTop=="number"?e.padTop:void 0,padBottom:typeof e.padBottom=="number"?e.padBottom:void 0}):d(o,{num:i(t(e.num,n.num,e.puck)),title:i(t(e.title,n.title,e.puck)),omitHead:a,linkText:i(t(e.linkText,n.link,e.puck)),linkHref:i(l(e.linkHref)||"/contact"),galleryHref:l(e.galleryHref)||"/gallery",previewHover:e.previewHover,display:e.display,displayPhone:e.displayPhone,styleOwner:e.id,layout:e.layout,columns:e.columns,columnsMobile:e.columnsMobile,gap:e.gap,items:e.items,padTop:typeof e.padTop=="number"?e.padTop:void 0,padBottom:typeof e.padBottom=="number"?e.padBottom:void 0,editing:e.puck?.isEditing})}};export{x as GalleryBRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as c}from"react/jsx-runtime";import d,{GALLERY_ITEM_HINTS as
|
|
1
|
+
import{jsx as c}from"react/jsx-runtime";import d,{GALLERY_ITEM_HINTS as n}from"../../../../../components/GalleryItem.js";import{phHide as r}from"efficient-web-builder/render/lib/puck/blocks/scaffold";import{GalleryItemMeta as f}from"./meta.js";function o(e,t){if(typeof e=="string")return e.trim()===t?"":e;if(e&&typeof e=="object"){const i=e;if(typeof i.text=="string"&&i.text.trim()===t)return{...i,text:""}}return e}const s={...f,render:e=>{const t=e.product??{},i=e.fromProduct===!0&&!!t.code;return c(d,{image:i?t.cover:e.image,photos:i?(t.photos??[]).map(m=>({src:m})):e.photos,href:i?t.href:e.href,process:i?t.hideProcess?void 0:t.category:r(o(e.process,n.process),n.process,e.puck),eyebrow:i?t.hideEyebrow?void 0:t.vehicle||void 0:r(o(e.eyebrow,n.eyebrow),n.eyebrow,e.puck),name:i?t.hideName?void 0:t.name:r(o(e.name,n.name),n.name,e.puck),meta:i?t.hideFinish?void 0:t.finish:r(o(e.meta,n.meta),n.meta,e.puck),previewHover:e.previewHover,ratio:e.ratio,captionPlace:e.captionPlace,editing:e.puck?.isEditing})}};export{s as GalleryItemRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as y}from"react/jsx-runtime";import k,{readFacets as h}from"../../../../../components/Events.js";import{BLOCK_SOURCE_ROWS_PROP as b,declaredBlockSource as x,sourcedRows as g}from"efficient-web-builder/format/lib/content/block-sources";import{hidableText as v}from"efficient-easel/screen/lib/puck/hidable";import{parseSectionHeadPlacement as A}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as u}from"efficient-web-builder/render/lib/puck/blocks/scaffold";import{say as a}from"efficient-web-builder/format/lib/editor-words";import{EventsMeta as p,EVENTS_PH as s}from"./meta.js";const E=()=>[{key:"sample-1",title:a("First card"),excerpt:a("A line about it appears here.")},{key:"sample-2",title:a("Second card"),excerpt:a("A line about it appears here.")},{key:"sample-3",title:a("Third card"),excerpt:a("A line about it appears here.")},{key:"sample-4",title:a("Fourth card"),excerpt:a("A line about it appears here.")}],f=(e,i,n)=>({slug:e.key||`card-${i}`,title:e.title??"",excerpt:e.excerpt??"",cover:e.cover??"",meta:e.meta||void 0,dateLabel:e.dateLabel||void 0,href:e.href||"#",...n?{facets:n}:{}});function S(e){const i=e[b],n=new Map,c=[];if(!Array.isArray(i))return{byKey:n,byIndex:c};for(const o of i){if(!o||typeof o!="object"||Array.isArray(o))continue;const t=o;if(!Object.values(t).some(l=>typeof l=="string"&&l))continue;const d=h(t.facets);c.push(d),d&&typeof t.key=="string"&&t.key&&n.set(t.key,d)}return{byKey:n,byIndex:c}}const R={...p,render:e=>{const i=A(e.headPlacement)==="own-box",n=r=>i?void 0:r,c=u(e.linkText,s.link,e.puck),t=x(e)!==""?g(e,!!e.puck?.isEditing,E()):null,d=t&&!t.sample?S(e):null,l=t?t.sample?[]:t.rows.map((r,m)=>f(r,m,r.key?d?.byKey.get(r.key):d?.byIndex[m])):e.posts;return y(k,{num:n(u(e.num,s.num,e.puck)),title:n(u(e.title,s.title,e.puck)),link:n(c?{text:c,href:v(e.linkHref)||"/journal"}:void 0),omitHead:i,posts:l,sample:t?.sample?t.rows.map((r,m)=>f(r,m)):void 0,columns:e.columns,limit:e.limit,showAll:e.showAll,layout:e.layout,featuredWidth:e.featuredWidth,listCover:e.listCover,featuredDarken:e.featuredDarken,cardImage:e.cardImage,gap:e.gap,nameFilter:e.nameFilter===!0,padTop:typeof e.padTop=="number"?e.padTop:void 0,padBottom:typeof e.padBottom=="number"?e.padBottom:void 0,editing:e.puck?.isEditing})}};export{R as EventsRender};
|
|
@@ -1131,14 +1131,16 @@
|
|
|
1131
1131
|
"type": "custom",
|
|
1132
1132
|
"__text": {
|
|
1133
1133
|
"control": "plainText",
|
|
1134
|
-
"label": "Label"
|
|
1134
|
+
"label": "Label",
|
|
1135
|
+
"placeholder": "Label"
|
|
1135
1136
|
}
|
|
1136
1137
|
},
|
|
1137
1138
|
"value": {
|
|
1138
1139
|
"type": "custom",
|
|
1139
1140
|
"__text": {
|
|
1140
1141
|
"control": "plainText",
|
|
1141
|
-
"label": "Value"
|
|
1142
|
+
"label": "Value",
|
|
1143
|
+
"placeholder": "Value"
|
|
1142
1144
|
}
|
|
1143
1145
|
},
|
|
1144
1146
|
"href": {
|
|
@@ -1152,7 +1154,8 @@
|
|
|
1152
1154
|
"type": "custom",
|
|
1153
1155
|
"__text": {
|
|
1154
1156
|
"control": "plainText",
|
|
1155
|
-
"label": "Sub line"
|
|
1157
|
+
"label": "Sub line",
|
|
1158
|
+
"placeholder": "Sub line"
|
|
1156
1159
|
}
|
|
1157
1160
|
}
|
|
1158
1161
|
}
|
|
@@ -15,6 +15,7 @@ export interface RecordFieldSpec {
|
|
|
15
15
|
export interface RecordPicture {
|
|
16
16
|
url: string;
|
|
17
17
|
alt: string;
|
|
18
|
+
video?: string;
|
|
18
19
|
}
|
|
19
20
|
export declare function recordFieldSpecs(record: CurrentRecord | null | undefined): readonly RecordFieldSpec[];
|
|
20
21
|
export declare function recordPictures(record: CurrentRecord | null | undefined, { firstField }?: {
|