efficient-storefront-blocks 0.75.0 → 0.77.0
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 +46 -0
- package/dist/chunks/EditorPreviewCheckout-GNQP4MQ4.js +4 -0
- package/dist/chunks/{SiteEditorProvider-N4T55FAV.js → SiteEditorProvider-R3HXJAPW.js} +1 -1
- package/dist/chunks/chunk-BOJGJXIU.js +311 -0
- package/dist/chunks/chunk-CAULWKXR.js +1 -0
- package/dist/chunks/chunk-GDR5GGVW.js +1 -0
- package/dist/chunks/chunk-OWYNZAAY.js +1 -0
- package/dist/chunks/chunk-ZIZWJZ5T.js +1 -0
- package/dist/chunks/{fitment-data-5ZSHENM3.js → fitment-data-JNQKYQIB.js} +1 -1
- package/dist/contract.js +2 -2
- package/dist/editor/components/BlogSource.js +1 -1
- package/dist/editor/components/CategoryProductFields.d.ts +22 -0
- package/dist/editor/components/CategoryProductFields.js +1 -0
- package/dist/editor/components/CategorySource.d.ts +12 -0
- package/dist/editor/components/CategorySource.js +1 -1
- package/dist/editor/components/CollectionPicker.js +1 -1
- package/dist/editor/components/CountryShowAsTiles.js +1 -1
- package/dist/editor/components/EditorPreviewChat.js +1 -11
- package/dist/editor/components/EditorPreviewSurface.js +1 -1
- package/dist/editor/components/GalleryProductBinding.js +1 -1
- package/dist/editor/components/GalleryShowcaseSource.js +1 -1
- package/dist/editor/components/HeaderSettingsPanel.d.ts +8 -4
- package/dist/editor/components/HeaderSettingsPanel.js +1 -1
- package/dist/editor/components/MenuPicker.js +1 -1
- package/dist/editor/components/PreviewProductPicker.js +1 -1
- package/dist/editor/components/ProductHeroSource.js +1 -1
- package/dist/editor/components/ProductPicker.js +1 -1
- package/dist/editor/components/SocialLinksDoor.js +1 -1
- package/dist/editor/components/SpecTableSource.js +1 -1
- package/dist/editor/lib/document/block-align-row.d.ts +2 -0
- package/dist/editor/lib/document/block-align-row.js +1 -0
- package/dist/editor/lib/document/blocks/commerce/AccountBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/AlloyWheelsListing/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/BundleOffer/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/CartBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/CatalogFilterBar/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/CheckoutCTA/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/CollectionCard/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/Collections/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/CompatibleTyres/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/CountrySwitchBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/DeliveryOptions/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/DetailRows/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/EuTyreLabel/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/FitmentFinder/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/FitmentTable/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/Gallery/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/GalleryB/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/GalleryItem/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductGallery/fields.d.ts +2 -2
- package/dist/editor/lib/document/blocks/commerce/ProductGallery/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductGrid/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/ProductHero/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/RelatedProducts/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/SearchBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/SpecTable/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/TyreFitment/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/TyreSizes/fields.js +1 -1
- package/dist/editor/lib/document/blocks/commerce/shared-fields.d.ts +1 -0
- package/dist/editor/lib/document/blocks/commerce/shared-fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/AppointmentBooking/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/BookingBox/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/ContactCards/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/ContactRouting/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/Events/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/Footer/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/FooterDivider/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/FooterEmailSignup/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/FooterGroup/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/FooterLogo/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/FooterMenu/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/FooterMessaging/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/FooterPayment/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/FooterSocial/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/FooterText/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/Form/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/MessagingCards/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/OpeningHours/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/RateTable/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/RatingBlock/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/ReviewForm/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/Reviews/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/SiteHeader/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/SubmitBox/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/SubmitBuild/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/Subscribe/fields.js +1 -1
- package/dist/editor/lib/document/blocks/service/SubscribeBlogs/fields.js +1 -1
- package/dist/editor/lib/document/box-header.js +1 -1
- package/dist/editor/lib/document/config.d.ts +16 -16
- package/dist/editor/lib/document/config.js +1 -1
- package/dist/editor/lib/editor-currency-source.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +10 -13
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/editor.css +1 -1
- package/dist/index.js +214 -724
- package/dist/links.js +1 -1
- package/dist/render/app/globals.css +45 -79
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/BoxHeaderBar.js +1 -1
- package/dist/render/components/CartContext.d.ts +1 -0
- package/dist/render/components/CartContext.js +1 -1
- package/dist/render/components/CartDrawer.js +2 -2
- package/dist/render/components/CatalogFilterBarSection.d.ts +1 -1
- package/dist/render/components/CatalogFilterBarSection.js +1 -1
- package/dist/render/components/ChatWidget.js +1 -1
- package/dist/render/components/Collections.js +1 -1
- package/dist/render/components/CompatibleTyres.js +1 -1
- package/dist/render/components/ConsentPanel.js +1 -1
- package/dist/render/components/ContactRouting.js +1 -1
- package/dist/render/components/CouponField.js +1 -1
- package/dist/render/components/CurrencyContext.js +1 -1
- package/dist/render/components/Events.d.ts +2 -1
- package/dist/render/components/Events.js +1 -1
- package/dist/render/components/FitmentTable.js +1 -1
- package/dist/render/components/FooterGroup.d.ts +3 -2
- package/dist/render/components/FooterGroup.js +1 -1
- package/dist/render/components/FooterLogo.d.ts +2 -1
- package/dist/render/components/FooterMenu.js +1 -1
- package/dist/render/components/FooterPayment.d.ts +1 -2
- package/dist/render/components/FooterPayment.js +1 -1
- package/dist/render/components/FooterSocial.d.ts +1 -2
- package/dist/render/components/FooterSocial.js +1 -1
- package/dist/render/components/FormBlock.js +1 -1
- package/dist/render/components/GalleryGrid.d.ts +2 -1
- package/dist/render/components/GalleryGrid.js +1 -1
- package/dist/render/components/GalleryItem.js +1 -1
- package/dist/render/components/GalleryShowcase.js +1 -1
- package/dist/render/components/Header.js +1 -1
- package/dist/render/components/HeaderTools.js +1 -1
- package/dist/render/components/Lightbox.d.ts +2 -2
- package/dist/render/components/Lightbox.js +1 -1
- package/dist/render/components/LinkedProductHero.d.ts +2 -0
- package/dist/render/components/Notice.d.ts +6 -0
- package/dist/render/components/Notice.js +1 -0
- package/dist/render/components/PopupFrame.d.ts +17 -4
- package/dist/render/components/PopupFrame.js +1 -1
- package/dist/render/components/ProductGallery.js +1 -1
- package/dist/render/components/ProductGridSection.d.ts +2 -1
- package/dist/render/components/ProductGridSection.js +1 -1
- package/dist/render/components/ProductHeroPanel.d.ts +3 -1
- package/dist/render/components/ProductHeroPanel.js +1 -1
- package/dist/render/components/ProductLightbox.js +1 -1
- package/dist/render/components/ReviewForm.js +1 -1
- package/dist/render/components/SpecTable.d.ts +2 -1
- package/dist/render/components/SpecTable.js +1 -1
- package/dist/render/components/SubscribePopup.js +2 -2
- package/dist/render/components/TyreFitVerdicts.d.ts +2 -1
- package/dist/render/components/TyreFitVerdicts.js +1 -1
- package/dist/render/components/TyreRenderSvg.js +1 -1
- package/dist/render/components/TyreVehicleFitment.js +1 -1
- package/dist/render/components/WheelCardFrame.d.ts +3 -0
- package/dist/render/components/WheelCardFrame.js +1 -1
- package/dist/render/components/booking/BookingRegions.js +1 -1
- package/dist/render/components/catalog/CatalogFilterBar.d.ts +4 -4
- package/dist/render/components/catalog/CatalogFilterBar.js +1 -1
- package/dist/render/components/catalog/CatalogFilterContext.d.ts +5 -3
- package/dist/render/components/catalog/CatalogFilterContext.js +1 -1
- package/dist/render/components/catalog/FilterPill.d.ts +3 -1
- package/dist/render/components/catalog/FilterPill.js +1 -1
- package/dist/render/components/checkout/CheckoutPageClient.d.ts +4 -0
- package/dist/render/components/checkout/CheckoutPageClient.js +1 -1
- package/dist/render/components/checkout/checkout-parts.js +1 -1
- package/dist/render/components/checkout/checkout-state.d.ts +25 -1
- package/dist/render/components/checkout/checkout-state.js +3 -3
- package/dist/render/components/fitment/StockFitmentCard.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicProductGallery.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicProductHero.d.ts +2 -0
- package/dist/render/components/pdp-dynamic/DynamicRelatedProducts.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicSpecTable.js +1 -1
- package/dist/render/components/pdp-dynamic/RecordPhotoGallery.js +1 -1
- package/dist/render/components/product-hero/TyreHeroFitment.d.ts +2 -1
- package/dist/render/components/product-hero/TyreHeroFitment.js +1 -1
- package/dist/render/components/product-hero/VehicleQuestion.d.ts +1 -6
- package/dist/render/components/product-hero/VehicleQuestion.js +1 -1
- package/dist/render/components/product-hero/WheelHeroFitment.js +1 -1
- package/dist/render/components/product-hero/trust-bullets.d.ts +5 -0
- package/dist/render/components/product-hero/trust-bullets.js +1 -0
- package/dist/render/components/useModalDismiss.d.ts +2 -1
- package/dist/render/components/useModalDismiss.js +1 -1
- package/dist/render/components/useTyreFitAnswer.d.ts +1 -0
- package/dist/render/components/useTyreFitAnswer.js +1 -1
- package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
- package/dist/render/components/wheels-plp/PlpNotifyMeDialog.js +1 -1
- package/dist/render/lib/api/index.d.ts +6 -3
- package/dist/render/lib/api/index.js +1 -1
- package/dist/render/lib/api/types.d.ts +3 -0
- package/dist/render/lib/booking/appointment-time.d.ts +2 -0
- package/dist/render/lib/booking/appointment-time.js +1 -0
- package/dist/render/lib/catalog/from-wheel.js +1 -1
- package/dist/render/lib/catalog/plp-item.js +1 -1
- package/dist/render/lib/checkout/pay-first.d.ts +34 -0
- package/dist/render/lib/checkout/pay-first.js +1 -0
- package/dist/render/lib/checkout/stripe-appearance.d.ts +10 -0
- package/dist/render/lib/checkout/stripe-appearance.js +1 -0
- package/dist/render/lib/checkout/wallet-return.d.ts +1 -1
- package/dist/render/lib/commerce.d.ts +1 -0
- package/dist/render/lib/commerce.js +1 -1
- package/dist/render/lib/content/legacy-block-align.d.ts +2 -0
- package/dist/render/lib/content/legacy-block-align.js +1 -0
- package/dist/render/lib/content/menu-row.d.ts +0 -3
- package/dist/render/lib/content/menu-row.js +1 -1
- package/dist/render/lib/document/blocks/commerce/AlloyWheelsListing/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/BundleOffer/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/CheckoutCTA/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/Collections/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/CompatibleTyres/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/DeliveryOptions/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/DetailRows/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/EuTyreLabel/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/FitmentFinder/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/FitmentTable/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/GalleryB/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductGrid/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductGrid/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductHero/meta.d.ts +6 -0
- package/dist/render/lib/document/blocks/commerce/ProductHero/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/ProductHero/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/RelatedProducts/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/SpecTable/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/SpecTable/render.js +1 -1
- package/dist/render/lib/document/blocks/commerce/TyreFitment/meta.js +1 -1
- package/dist/render/lib/document/blocks/commerce/TyreSizes/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/ContactCards/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/ContactRouting/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/Events/render.js +1 -1
- package/dist/render/lib/document/blocks/service/FooterGroup/render.js +1 -1
- package/dist/render/lib/document/blocks/service/FooterPayment/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/FooterSocial/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/MessagingCards/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/OpeningHours/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/RateTable/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/SubmitBuild/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/Subscribe/meta.js +1 -1
- package/dist/render/lib/document/blocks/service/SubscribeBlogs/meta.js +1 -1
- package/dist/render/lib/document/lazy-draws.js +1 -1
- package/dist/render/lib/document/render-client.d.ts +8 -3
- package/dist/render/lib/document/render-client.js +1 -1
- package/dist/render/lib/document/section-to-box-rows-reviews.js +1 -1
- package/dist/render/lib/document/storefront-root.d.ts +0 -2
- package/dist/render/lib/document/storefront-root.js +1 -1
- package/dist/render/lib/field-input.d.ts +1 -0
- package/dist/render/lib/field-input.js +1 -0
- package/dist/render/lib/sections/content-cap-gutter.d.ts +1 -0
- package/dist/render/lib/sections/content-cap-gutter.js +1 -0
- package/dist/render/lib/sections/hero-trust-bullets.d.ts +2 -0
- package/dist/render/lib/sections/hero-trust-bullets.js +1 -0
- package/dist/render/lib/tyres/spec-sheet.d.ts +17 -0
- package/dist/render/lib/tyres/spec-sheet.js +1 -1
- package/dist/render/lib/tyres/tyre-fit-copy.js +1 -1
- package/dist/render/lib/tyres/tyre-vehicle-fitment.d.ts +3 -1
- package/dist/render/lib/tyres/tyre-vehicle-fitment.js +1 -1
- package/dist/render/lib/use-scope-class.d.ts +1 -0
- package/dist/render/lib/use-scope-class.js +1 -0
- package/dist/render/lib/wheels/catalog-default-layout.d.ts +3 -3
- package/dist/render/lib/wheels/catalog-default-layout.js +1 -1
- package/dist/render/lib/wheels/catalog-filters.d.ts +2 -2
- package/dist/render/lib/wheels/catalog-filters.js +1 -1
- package/dist/render/lib/wheels/grid-source.d.ts +7 -1
- package/dist/render/lib/wheels/grid-source.js +1 -1
- package/dist/render/lib/wheels/plp-hydrate.js +1 -1
- package/dist/words.d.ts +46 -50
- package/dist/words.js +6 -6
- package/package.json +4 -4
- package/dist/chunks/EditorPreviewCheckout-27GNLSNR.js +0 -4
- package/dist/chunks/chunk-3TBLX25X.js +0 -1
- package/dist/chunks/chunk-4V6BLJSG.js +0 -1
- package/dist/chunks/chunk-K26JUDGZ.js +0 -1
- package/dist/chunks/chunk-SJODSVWU.js +0 -1
- package/dist/chunks/chunk-WPHE7RI4.js +0 -246
- package/dist/render/components/product-hero/hero-content.d.ts +0 -7
- package/dist/render/components/product-hero/hero-content.js +0 -1
- package/dist/render/components/useIsLightTheme.d.ts +0 -1
- package/dist/render/components/useIsLightTheme.js +0 -1
- package/dist/render/lib/content/product-hero.d.ts +0 -14
- package/dist/render/lib/content/product-hero.js +0 -1
- package/dist/render/lib/wheels/collections.d.ts +0 -22
- package/dist/render/lib/wheels/collections.js +0 -1
- /package/dist/chunks/{chunk-WPHE7RI4.js.LEGAL.txt → chunk-BOJGJXIU.js.LEGAL.txt} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PREVIEW_TOKEN_HEADER as tt,SITE_HOST_HEADER as et,SITE_SLUG_HEADER as rt}from"../site-headers.js";import{PRODUCT_API_BASE as at,PRODUCT_BACKEND_URL as k}from"./origins.js";import{backendHopHeaders as st,clientIpFromForwardedFor as nt,FORWARDED_FOR_HEADER as ot,hopCachingOf as it}from"../forwarded-for.js";import ct from"efficient-web-builder/format/lib/document/media-manifest.json";import{auth as P}from"../auth.js";import{efficientClientOpen as dt}from"efficient-easel/screen/lib/session";import{listableWheelSummaries as J}from"../wheels/listable-wheels.js";import{dropRenderlessFinishes as L}from"../wheels/renderable-finishes.js";const ut=process.env.NEXT_PUBLIC_API_URL??"http://localhost:8000";class m extends Error{status;data;constructor(e,s,o){super(s),this.status=e,this.data=o}}const U="Unable to reach the server. This could be a problem with your internet connection, or the server may be undergoing maintenance or an upgrade. Please try again shortly.",lt=new Set([502,503,504]),I=0,pt="This editor runs on its host's own backend, which does not serve this request.",yt=5e3,ht=15e3,ft=()=>typeof window>"u"?yt:ht;function D(t){const e=(t.method??"GET").toUpperCase();if(!(t.body!=null||e!=="GET"&&e!=="HEAD")&&!(t.audience!=null&&t.audience!=="shop")&&typeof AbortSignal?.timeout=="function")return AbortSignal.timeout(ft())}const x=t=>t instanceof Error&&t.name==="TimeoutError",H=(t,e)=>lt.has(t)?U:e,gt=["admin","venue"];let M="admin";function ne(t){M=gt.includes(t)?t:"admin"}function mt(){return M}const wt=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let F=null;function oe(t){F=t&&wt.test(t)?t:null}function St(){return F}function Pt(t){if(typeof window>"u"||!t.startsWith("/api/v1/"))return t;const e=j();return!e||/[?&]site=/.test(t)?t:E(t,`site=${encodeURIComponent(e)}`)}async function i(t,e={}){const{token:s,baseUrl:o,headers:l,audience:p,...w}=e;if(typeof window<"u"&&!dt())throw new m(I,pt,null);if(typeof window>"u"&&o===void 0)throw new Error(`apiFetch(${JSON.stringify(t)}) ran on the server without an explicit baseUrl. The API_URL default it would inherit is browser-only (the prod image bakes NEXT_PUBLIC_API_URL="" for same-origin use, which a Node fetch cannot resolve). Pass a base explicitly: \`await backendOpts()\` (or baseUrl: PRODUCT_FETCH_BASE) for product reads, or the server-only PRODUCT_BACKEND_URL env for other backend surfaces.`);const a=typeof FormData<"u"&&w.body instanceof FormData;let r;try{r=await fetch(`${o??ut}${Pt(t)}`,{...w,headers:{...a?{}:{"Content-Type":"application/json"},...s?{Authorization:`Bearer ${s}`}:{},...p===null?{}:{"X-Portal-Audience":p??"shop"},...l},signal:w.signal??D({...w,audience:p})})}catch(y){throw y instanceof TypeError||x(y)?new m(I,U,null):y}let n;try{n=await r.text()}catch(y){throw x(y)?new m(I,U,null):y}let c=null;if(n)try{c=JSON.parse(n)}catch{throw new m(r.status,r.ok?"Expected JSON but received a non-JSON response":H(r.status,r.statusText),n)}if(!r.ok){const y=(c&&typeof c=="object"&&"detail"in c&&typeof c.detail=="string"?c.detail:null)??H(r.status,r.statusText);throw new m(r.status,y,c)}return c}let O=null;async function B(){return O||(O=bt().finally(()=>{O=null}),O)}async function bt(){const t=P.takeLegacyRefresh(),e=await Ot.refresh(t??void 0);return P.setTokens(e.access),e.access}async function q(){return P.getAccess()??B()}async function h(t,e={}){let s;try{s=await q()}catch{throw P.clear(),new m(401,"Not signed in",null)}try{return await i(t,{...e,token:s})}catch(o){if(!(o instanceof m)||o.status!==401)throw o;try{const l=await B();return await i(t,{...e,token:l})}catch{throw P.clear(),o}}}async function G(t,e={}){if(P.getAccess())try{return{data:await h(t,e),asShopper:!0}}catch(s){if(!(s instanceof m)||s.status!==401)throw s}return{data:await i(t,e),asShopper:!1}}async function W(){const t=await h("/api/auth/me/");if(t.portal!=="shop")throw P.clear(),new m(403,"This session is not valid for this shop.",null);return t}const Ot={login:(t,e)=>i("/api/auth/login/",{method:"POST",body:JSON.stringify({email:t,password:e,portal:"shop"}),credentials:"include"}),refresh:t=>i("/api/auth/refresh/",{method:"POST",body:JSON.stringify(t?{refresh:t,portal:"shop"}:{portal:"shop"}),credentials:"include"}),logout:async()=>{P.clear();try{await i("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{const t=await q();return await W(),t},me:W,updateMe:t=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify(t)}),changePassword:(t,e)=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:e,old_password:t})}),changeEmail:(t,e)=>h("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:t,current_password:e})}),myProfile:()=>h("/api/shop-portal/profile/"),updateMyProfile:t=>h("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(t)}),myAddresses:()=>h("/api/shop-portal/delivery-locations/"),createAddress:t=>h("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(t)}),updateAddress:(t,e)=>h(`/api/shop-portal/delivery-locations/${t}/`,{method:"PATCH",body:JSON.stringify(e)}),deleteAddress:t=>h(`/api/shop-portal/delivery-locations/${t}/`,{method:"DELETE"}),passwordResetRequest:t=>i("/api/auth/password-reset/",{method:"POST",body:JSON.stringify({email:t})}),passwordResetConfirm:(t,e,s)=>i("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:t,token:e,new_password:s})}),brands:()=>h("/api/products/brands/"),myOrders:()=>h("/api/shop-portal/orders/").then(t=>t.results),myOrder:t=>h(`/api/shop-portal/orders/${t}/`),cancelOrder:t=>h(`/api/shop-portal/orders/${t}/cancel/`,{method:"POST"}),myReturns:t=>h(`/api/shop-portal/returns/${t?`?order=${encodeURIComponent(t)}`:""}`).then(e=>e.results),createReturn:t=>h("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(t)}),withdrawReturn:t=>h(`/api/shop-portal/returns/${t}/cancel/`,{method:"POST"}),uploadReturnPhoto:(t,e)=>{const s=new FormData;return s.append("claim_item",t),s.append("file",e),s.append("media_type",e.type.startsWith("video/")?"video":"image"),h("/api/shop-portal/return-media/",{method:"POST",body:s})}};import{media as At,absolutizeApiUrl as N}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as Tt,isSvgUrl as Rt}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as Et}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Ct,webRuntimeSiteSlug as j}from"efficient-web-builder/format/lib/web-runtime";function g(t){if(typeof t=="string")return t.startsWith("/media/")?At(t):t;if(Array.isArray(t))return t.map(g);if(t&&typeof t=="object"){const e={};for(const[s,o]of Object.entries(t))e[s]=s==="captions"&&o&&typeof o=="object"&&!Array.isArray(o)?Object.fromEntries(Object.entries(o).map(([l,p])=>[g(l),p])):g(o);return e}return t}import{PRODUCT_API_BASE as we}from"./origins.js";const z=typeof window>"u"&&k!=="",$t=z?k:at,_t=Ct,b=()=>({baseUrl:_t(),audience:null});function d(t,e){const s=e?`?process=${encodeURIComponent(e)}`:"";return`/api/v1${t}${s}`}const Ut=100,K=50;function V(t,e,s){const o=new URLSearchParams;for(const[l,p]of Object.entries(e))p!=null&&p!==""&&o.set(l,String(p));return o.set("pageSize",String(Ut)),s&&o.set("cursor",s),`/api/v1${t}?${o.toString()}`}function It(t,e){return V("/wheels",{process:t},e)}function Nt(t,e,s){return V("/products",{kind:t.join(","),make:e?.make,model:e?.model,year:e?.year,modification:e?.modification},s)}function vt(t){if(!t)return null;try{return new URL(t,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function X(t,e,s=()=>!1){const o=[];let l=null;try{for(let p=0;p<K;p++){const w=await i(await e(l),await u());if(o.push(...w.results),l=vt(w.next),!l)break}l&&console.warn(`[${t}] stopped at ${K} pages (${o.length} rows); catalog may be truncated`)}catch(p){if(s(p))throw p;console.warn(`[${t}] product API unavailable, returning []`,p)}return o}const kt=t=>t instanceof m&&t.status===400;function Jt(t){return t.flatMap(e=>e.kind==="alloy-wheel"?J([e]):[e])}async function Z(){return(await Lt()).host}async function Lt(){try{const{headers:t}=await import("next/headers"),e=await t(),s=p=>p?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,o=s(e.get(et)??e.get("x-forwarded-host")??e.get("host")),l=s(e.get("host"));return{host:o,matchesRequestHost:o!==null&&o===l}}catch{return{host:null,matchesRequestHost:!1}}}async function Dt(){try{const{headers:t}=await import("next/headers");return nt((await t()).get(ot))}catch{return null}}async function xt(){try{const{headers:t}=await import("next/headers");return(await t()).get(rt)||null}catch{return null}}async function Ht(){const t=await xt();if(t)return`site=${encodeURIComponent(t)}`;const e=await Z();return e?`host=${encodeURIComponent(e)}`:""}async function f(t){if(typeof window<"u"){const e=j();return e?E(t,`site=${encodeURIComponent(e)}`):t}return E(t,await Ht())}function E(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const Mt="preview";async function Ft(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(tt)}catch{return null}}async function Bt(){try{const{headers:t}=await import("next/headers");return(await t()).get("user-agent")}catch{return null}}async function v(t,e){const s=await Ft();if(s===null)return[await f(t),await u(e)];const o=E(await f(t),`${Mt}=${encodeURIComponent(s)}`),{next:l,cache:p,...w}=e??{},a=await u({...w,cache:"no-store"}),r=await Bt();return r&&(a.headers={...a.headers,"user-agent":r}),[o,a]}async function qt(t){if(!z)return;const[e,s]=await Promise.all([Z(),Dt()]),o=st(e,s,t);return Object.keys(o).length>0?o:void 0}async function u(t){const e=await qt(it(t)),s={baseUrl:$t,...t};return e&&(s.headers={...e,...t?.headers}),s}const A=typeof window>"u";function T(t,e){const s=new URLSearchParams;for(const[l,p]of Object.entries(e))p!==void 0&&p!==""&&s.set(l,String(p));const o=s.toString();return`/api/v1/fitment${t}${o?`?${o}`:""}`}const le={listMakes:async t=>{if(A){const{fitmentData:s}=await import("./fitment-data.js");return s.makes(t)}return(await i(T("/makes",{region:t}),b())).results},listModels:async(t,e)=>{if(A){const{fitmentData:o}=await import("./fitment-data.js");return o.models(t,e)}return(await i(T("/models",{make:t,region:e}),b())).results},listYears:async(t,e,s)=>{if(A){const{fitmentData:l}=await import("./fitment-data.js");return l.years(t,e,s)}return(await i(T("/years",{make:t,model:e,region:s}),b())).results},listModifications:async(t,e,s,o)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.modifications(t,e,s,o)}return(await i(T("/modifications",{make:t,model:e,year:s,region:o}),b())).results},getStockFitment:async(t,e,s,o,l)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.stockFitment(t,e,s,o,l)}return i(T("/stock-fitment",{make:t,model:e,year:s,modification:o,region:l}),b())}},pe={listWheels:async t=>{const e=await X("products.listWheels",async s=>await f(It(t,s)));return J(g(e))},listCatalog:async(t,e)=>{if(t.length===0)throw new Error("products.listCatalog() needs at least one kind. An empty list would omit `kind`, which the contract reads as `alloy-wheel` — so the call would silently return the wheel catalog instead of nothing.");const s=await X("products.listCatalog",async o=>await f(Nt(t,e,o)),kt);return Jt(g(s))},getWheel:async t=>L(g(await i(await f(d(`/wheels/${t}`)),await u()))),getTyre:async t=>g(await i(await f(d(`/tyres/${t}`)),await u())),listBundles:async()=>{try{return await i(await f(d("/bundles")),await u())}catch{return[]}},getBundle:async t=>i(await f(d(`/bundles/${t}`)),await u()),listGalleryBuilds:async(t={})=>{const{process:e=null,wheelSlug:s=null}=t;if(typeof window>"u"){const{listGalleryBuilds:o}=await import("./gallery-builds-data.js");return g(o(e,s))}try{const o=new URLSearchParams;e&&o.set("process",e),s&&o.set("wheelSlug",s);const l=o.toString(),p=await i(`/api/v1/gallery-builds${l?`?${l}`:""}`,b());return g(p.results)}catch(o){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",o),[]}},getSite:async()=>i(await f(d("/site")),await u()),getSiteBySlug:async t=>i(`${d("/site")}?${new URLSearchParams({site:t})}`,typeof window>"u"?await u():void 0),listPages:async()=>g(await i(await f(d("/pages")),await u())),listPopups:async()=>i(await f(d("/popups")),await u()),listProductTemplates:async()=>{try{return await i(await f(d("/product-templates")),await u())}catch(t){return console.warn("[products.listProductTemplates] unavailable, returning []",t),[]}},listDynamicPages:async t=>{const e=t?`?recordType=${encodeURIComponent(t)}`:"";try{return await i(await f(`${d("/dynamic-pages")}${e}`),await u())}catch(s){if(s instanceof m&&s.status===404)return[];throw s}},getRecord:async(t,e)=>{try{return await i(await f(d(`/records/${encodeURIComponent(t)}/${encodeURIComponent(e)}`)),await u())}catch(s){if(s instanceof m&&s.status===404)return null;throw s}},listRecordKeys:async t=>{try{const e=await i(await f(d(`/records/${encodeURIComponent(t)}`)),await u({cache:"no-store"}));return Array.isArray(e?.keys)?e.keys.filter(s=>typeof s=="string"&&s!==""):[]}catch(e){if(e instanceof m&&e.status===404)return[];throw e}},listProductTypeChoices:async()=>{try{return await i(await f(d("/product-type-choices")),await u())}catch(t){return console.warn("[products.listProductTypeChoices] unavailable, returning []",t),[]}},listFieldUsage:async()=>{try{return await i(await f(d("/field-usage")),await u())}catch(t){return console.warn("[products.listFieldUsage] unavailable, returning []",t),[]}},getPage:async(t,e={})=>{const s=e.record?`?record=${encodeURIComponent(e.record)}`:"",[o,l]=await v(d(`/pages/${t}`)+s,e.revalidate!==void 0?{next:{revalidate:e.revalidate}}:void 0);return g(await i(o,l))},listBlogPosts:async(t={})=>{const e=t.category?`?category=${encodeURIComponent(t.category)}`:"";try{return(await i(d("/blog-posts")+e,await u())).map(o=>({...o,coverImage:N(o.coverImage)??""}))}catch(s){return console.warn("[products.listBlogPosts] blog API unavailable, returning []",s),[]}},getBlogPost:async t=>{const e=await i(d(`/blog-posts/${t}`),await u());return{...e,coverImage:N(e.coverImage)??""}},createOrder:async t=>i(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),createOrderAuthed:async t=>h(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),lookupOrder:async t=>i(d("/orders/lookup"),await u({method:"POST",body:JSON.stringify(t)})),createPaymentIntent:async t=>i(d("/payments/intent"),await u({method:"POST",body:JSON.stringify(t)})),createPaypalOrder:async t=>i(d("/payments/paypal/order"),await u({method:"POST",body:JSON.stringify(t)})),capturePaypalOrder:async t=>i(d("/payments/paypal/capture"),await u({method:"POST",body:JSON.stringify(t)})),createAfterpayCheckout:async t=>i(d("/payments/afterpay/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureAfterpayPayment:async t=>i(d("/payments/afterpay/capture"),await u({method:"POST",body:JSON.stringify(t)})),chargeSquare:async t=>i(d("/payments/square/charge"),await u({method:"POST",body:JSON.stringify(t)})),createGocardlessBillingRequest:async t=>i(d("/payments/gocardless/billing-request"),await u({method:"POST",body:JSON.stringify(t)})),completeGocardlessPayment:async t=>i(d("/payments/gocardless/complete"),await u({method:"POST",body:JSON.stringify(t)})),createZipCheckout:async t=>i(d("/payments/zip/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureZipPayment:async t=>i(d("/payments/zip/capture"),await u({method:"POST",body:JSON.stringify(t)})),createKlarnaCheckout:async t=>i(d("/payments/klarna/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureKlarnaPayment:async t=>i(d("/payments/klarna/capture"),await u({method:"POST",body:JSON.stringify(t)})),createStockAlert:async t=>i(d("/stock-alerts"),await u({method:"POST",body:JSON.stringify(t)})),createPreOrderIntent:async t=>i(d("/pre-order-intents"),await u({method:"POST",body:JSON.stringify(t)})),createNewsletterSubscription:async t=>i(d("/newsletter-subscriptions"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeNewsletter:async t=>i(d("/newsletter-unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),captureCart:async t=>i(d("/carts"),await u({method:"POST",body:JSON.stringify(t)})),restoreCart:async t=>i(d("/carts/restore"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeCartReminders:async t=>i(d("/carts/unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),listReviews:async(t={})=>{const e=new URLSearchParams;t.limit&&e.set("limit",String(t.limit)),t.designCode&&e.set("designCode",t.designCode);const s=d("/reviews"),o=e.toString();try{return await i(await f(o?`${s}?${o}`:s),await u())}catch(l){return console.warn("[products.listReviews] product API unavailable, returning []",l),[]}},submitReview:async t=>i(d("/reviews"),await u({method:"POST",body:JSON.stringify(t)})),getForm:async t=>i(d(`/forms/${encodeURIComponent(t)}`),await u()),submitForm:async(t,e)=>i(d(`/forms/${encodeURIComponent(t)}/submissions`),await u({method:"POST",body:JSON.stringify(e)})),listShippingMethods:async()=>{try{return await i(d("/shipping-methods"),await u())}catch(t){return console.warn("[products.listShippingMethods] product API unavailable, returning []",t),[]}},listCountrySubdivisions:async t=>{try{return await i(d(`/countries/${encodeURIComponent(t)}/subdivisions`),await u())}catch(e){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",e),[]}},quoteCart:async t=>{const e=d("/cart/quote"),s=await u({method:"POST",body:JSON.stringify(t)});return t.couponCode?(await G(e,s)).data:i(e,s)},validateCoupon:async t=>{const{data:e,asShopper:s}=await G(d("/coupons/validate"),await u({method:"POST",body:JSON.stringify(t)}));return{...e,askedAsShopper:s}},getHeaderSettings:async()=>{const t=D({method:"GET"}),e=await i(...await v(d("/header-settings"),{signal:t})),s=N(e.logoUrl);let o=null,l=null;if(s&&Rt(s)){const p=await Tt(s,t);p&&(o=p.reversed,l=p.inkIsDark)}return{...e,logoUrl:s,logoReversed:o,logoInkIsDark:l}},getThemeSettings:async()=>i(...await v(d("/theme-settings"))),getChatSettings:async()=>i(await f(d("/chat-settings")),await u())},ye={listServices:async()=>{try{return await i(d("/bookings/services"),await u())}catch(t){return console.warn("[bookings.listServices] API unavailable, returning []",t),{results:[],currency:"USD"}}},getAvailability:async(t,e)=>i(d(`/bookings/availability?service=${encodeURIComponent(t)}&date=${e}`),await u()),create:async t=>i(d("/bookings"),await u({method:"POST",body:JSON.stringify(t)})),get:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}`),await u()),cancel:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}/cancel`),await u({method:"POST"})),createPaymentIntent:async t=>i(d("/bookings/payments/intent"),await u({method:"POST",body:JSON.stringify({manageToken:t})}))};class Gt extends Error{slug;count;constructor(e,s){super(`Slug "${e}" exists on ${s} websites; a site is required to pick one.`),this.slug=e,this.count=s,this.name="AmbiguousPageSlugError"}}const C=(t,e,s)=>{const o=new URLSearchParams({...e?{site:e}:{},...s?{draft:"1"}:{}}).toString();return`/api/storefront/${t}/${o?`?${o}`:""}`},$=t=>`/api/storefront/sites/${encodeURIComponent(t)}/`,Wt=t=>`${$(t)}currencies/`,jt="/api/storefront/media/ingest/";class zt extends Error{constructor(){super("This editor is not connected to a website, so an upload has nowhere to go. Open the page from the website the file should belong to, then try again."),this.name="MediaUploadDestinationError"}}function Kt(){const t=Et();if(!t)throw new zt;return`${jt}?${new URLSearchParams({site:t})}`}const Vt="X-Puck-Media-Manifest",Y=ct.contentHash,_={"X-Media-Manifest":Y,[Vt]:Y},he=Q({});function Q(t){return(e,s={})=>{const o=St(),l=t.headers||o?{...o?{"Accept-Language":o}:{},...t.headers,...s.headers}:void 0;return i(e,{...s,...t.baseUrl!==void 0?{baseUrl:t.baseUrl}:{},...l?{headers:l}:{},audience:t.audience??mt()})}}function Xt(t={}){const e=Q(t),s=t.siteDrafts===!0,o=a=>C("header-settings",a,s),l=a=>C("theme-settings",a,s),p=a=>C("chat-settings",a,s),w=a=>C("social-settings",a,s);return{findPageBySlug:async(a,r,n)=>{const c=new URLSearchParams({slug:a});n&&c.set("site",n);const y=await e(`/api/storefront/pages/?${c.toString()}`,{token:r}),S=Array.isArray(y)?y:y.results??[];if(!n&&S.length>1)throw new Gt(a,S.length);return S[0]??null},getPageById:(a,r)=>e(`/api/storefront/pages/${a}/`,{token:r}),saveLayout:(a,r,n,c,y)=>e(`/api/storefront/pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r,expected_updated_at:c,...y?{client_id:y}:{}}),token:n}),duplicatePage:(a,r,n)=>e(`/api/storefront/pages/${a}/duplicate/`,{method:"POST",body:JSON.stringify({title:r.title,slug:r.slug}),token:n}),geocode:(a,r,n)=>e(`/api/storefront/geocode/?${new URLSearchParams(n?{q:a,country:n}:{q:a})}`,{token:r}),listBlockSources:a=>e("/api/storefront/block-sources/",{token:a}),listRecordTypes:a=>e("/api/storefront/record-types/",{token:a}),createPagePreviewLink:(a,r)=>e(`/api/storefront/pages/${a}/preview-link/`,{method:"POST",token:r}),claimPageEditLock:(a,r,n,c=!1)=>e(`/api/storefront/pages/${a}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:n,takeover:c}),token:r}),releasePageEditLock:(a,r)=>e(`/api/storefront/pages/${a}/edit-lock/`,{method:"DELETE",token:r}),createTemplate:(a,r,n)=>e("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:a,layout:r}),headers:_,token:n}),getTemplate:(a,r)=>e(`/api/storefront/page-templates/${a}/`,{token:r}),saveTemplateLayout:(a,r,n)=>e(`/api/storefront/page-templates/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:_,token:n}),listTemplatePages:async(a,r)=>{const n=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(a)}`,{token:r});return Array.isArray(n)?n:n.results??[]},findTemplatePageBySlug:async(a,r,n)=>{const c=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(a)}&slug=${encodeURIComponent(r)}`,{token:n});return(Array.isArray(c)?c:c.results??[])[0]??null},createTemplatePage:(a,r,n)=>e("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:a,...r}),headers:_,token:n}),saveTemplatePageLayout:(a,r,n)=>e(`/api/storefront/template-pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:_,token:n}),deleteTemplatePage:(a,r,n)=>e(`/api/storefront/template-pages/${a}/`,{method:"DELETE",token:r,...n?.keepalive?{keepalive:!0}:{}}),listPages:async(a,r)=>{const n=new URLSearchParams({no_page:"true"});r&&n.set("site",r);const c=await e(`/api/storefront/pages/?${n.toString()}`,{token:a});return Array.isArray(c)?c:c.results??[]},createPage:(a,r,n,c)=>e("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:a,slug:r,layout:n}),token:c}),deletePage:(a,r)=>e(`/api/storefront/pages/${a}/`,{method:"DELETE",token:r}),getHeaderSettings:(a,r)=>e(o(r),{token:a}),listMenus:async(a,r)=>{const n=new URLSearchParams({no_page:"true"});r&&n.set("site",r);const c=await e(`/api/storefront/menus/?${n}`,{token:a});return Array.isArray(c)?c:c.results??[]},listBlogPosts:async(a,r={})=>{const n=new URLSearchParams({no_page:"true"});r.visibleOnly&&n.set("is_visible","true"),r.siteId&&n.set("site",r.siteId);const c=await e(`/api/storefront/blog-posts/?${n.toString()}`,{token:a});return Array.isArray(c)?c:c.results??[]},listFieldUsage:async(a,r)=>{const n=await e(`/api/storefront/field-usage/?site=${encodeURIComponent(r)}`,{token:a});return Array.isArray(n?.entries)?n.entries:[]},listCategories:async(a,r={})=>{const n=new URLSearchParams({no_page:"true"});r.visibleOnly&&n.set("is_visible","true"),r.siteId&&n.set("site",r.siteId);const c=await e(`/api/storefront/categories/?${n.toString()}`,{token:a});return[...Array.isArray(c)?c:c.results??[]].sort((S,R)=>S.sort_order-R.sort_order||S.name.localeCompare(R.name))},listForms:async(a,r={})=>{const n=new URLSearchParams({no_page:"true"});r.siteId&&n.set("site",r.siteId);const c=await e(`/api/storefront/forms/?${n.toString()}`,{token:a});return[...Array.isArray(c)?c:c.results??[]].sort((S,R)=>S.title.localeCompare(R.title))},listWheelSummaries:async(a,r={})=>{const n=new URLSearchParams;r.siteId&&n.set("site",r.siteId);const c=n.toString(),y=await e(`/api/storefront/wheel-curations/summaries/${c?`?${c}`:""}`,{token:a});return g(y)},listProducts:async(a,r={})=>{const n=new URLSearchParams;r.kinds?.length&&n.set("kind",r.kinds.join(",")),r.siteId&&n.set("site",r.siteId);const c=n.toString(),y=await e(`/api/storefront/products/${c?`?${c}`:""}`,{token:a});return g(y)},getWheelDetail:async(a,r,n={})=>{const c=new URLSearchParams({slug:r});return n.siteId&&c.set("site",n.siteId),L(g(await e(`/api/storefront/wheel-curations/detail/?${c.toString()}`,{token:a})))},updateHeaderSettings:(a,r,n)=>e(o(n),{method:"PATCH",body:JSON.stringify(a),token:r}),getSite:(a,r)=>e($(a),{token:r}),listSites:async a=>{const r=await e("/api/storefront/sites/?no_page=true",{token:a});return Array.isArray(r)?r:r.results??[]},listSiteCurrencies:async(a,r)=>{const n=await e(Wt(a),{token:r});return Array.isArray(n)?n:[]},publishSite:(a,r)=>e(`${$(a)}publish/`,{method:"POST",token:r}),getSiteLiveState:(a,r)=>e(`${$(a)}live-state/`,{token:r}),getThemeSettings:(a,r)=>e(l(r),{token:a}),updateThemeSettings:(a,r,n)=>e(l(n),{method:"PATCH",body:JSON.stringify(a),token:r}),getChatSettings:(a,r)=>e(p(r),{token:a}),updateChatSettings:(a,r,n)=>e(p(n),{method:"PATCH",body:JSON.stringify(a),token:r}),getSocialSettings:(a,r)=>e(w(r),{token:a}),updateSocialSettings:(a,r,n)=>e(w(n),{method:"PATCH",body:JSON.stringify(a),token:r}),uploadHeaderLogo:(a,r,n)=>{const c=new FormData;return c.append("logo",a),e(o(n),{method:"PATCH",body:c,token:r})},clearHeaderLogo:(a,r)=>e(o(r),{method:"PATCH",body:JSON.stringify({logo:null}),token:a}),setHeaderLogoFromAsset:(a,r,n)=>e(o(n),{method:"PATCH",body:JSON.stringify({logo_asset_id:a}),token:r}),uploadMedia:async(a,r)=>{const n=new FormData;return n.append("file",a),e(Kt(),{method:"POST",body:n,token:r})},listMedia:async(a,r)=>{const n=new URLSearchParams({no_page:"true"});r&&n.set("kind",r);const c=await e(`/api/storefront/media-assets/?${n.toString()}`,{token:a});return Array.isArray(c)?c:c.results??[]}}}const fe=Xt({siteDrafts:!0});export{ut as API_URL,Gt as AmbiguousPageSlugError,m as ApiError,ht as BROWSER_READ_TIMEOUT_MS,pt as EFFICIENT_CLIENT_CLOSED_MESSAGE,zt as MediaUploadDestinationError,Mt as PREVIEW_PARAM,we as PRODUCT_API_BASE,yt as SERVER_READ_TIMEOUT_MS,U as SERVER_UNREACHABLE_MESSAGE,I as STATUS_NETWORK_ERROR,he as adminFetch,Ot as api,i as apiFetch,E as appendSiteQuery,ye as bookings,Xt as createStorefrontAdmin,D as defaultRequestDeadline,Kt as editorMediaUploadPath,mt as editorPortalAudience,St as editorRequestLanguage,le as fitment,pe as products,ft as readDeadlineMs,Dt as resolveClientIp,g as resolveMediaUrls,Ft as resolvePreviewToken,Z as resolveSiteHost,Lt as resolveSiteHostSource,xt as resolveSiteSlug,oe as setEditorLanguage,ne as setEditorPortalAudience,fe as storefrontAdmin};
|
|
1
|
+
import{PREVIEW_TOKEN_HEADER as tt,SITE_HOST_HEADER as et,SITE_SLUG_HEADER as rt}from"../site-headers.js";import{PRODUCT_API_BASE as at,PRODUCT_BACKEND_URL as k}from"./origins.js";import{backendHopHeaders as st,clientIpFromForwardedFor as nt,FORWARDED_FOR_HEADER as ot,hopCachingOf as it}from"../forwarded-for.js";import ct from"efficient-web-builder/format/lib/document/media-manifest.json";import{auth as P}from"../auth.js";import{efficientClientOpen as dt}from"efficient-easel/screen/lib/session";import{listableWheelSummaries as J}from"../wheels/listable-wheels.js";import{dropRenderlessFinishes as L}from"../wheels/renderable-finishes.js";const ut=process.env.NEXT_PUBLIC_API_URL??"http://localhost:8000";class m extends Error{status;data;constructor(e,s,o){super(s),this.status=e,this.data=o}}const U="Unable to reach the server. This could be a problem with your internet connection, or the server may be undergoing maintenance or an upgrade. Please try again shortly.",lt=new Set([502,503,504]),I=0,pt="This editor runs on its host's own backend, which does not serve this request.",yt=5e3,ht=15e3,ft=()=>typeof window>"u"?yt:ht;function D(t){const e=(t.method??"GET").toUpperCase();if(!(t.body!=null||e!=="GET"&&e!=="HEAD")&&!(t.audience!=null&&t.audience!=="shop")&&typeof AbortSignal?.timeout=="function")return AbortSignal.timeout(ft())}const x=t=>t instanceof Error&&t.name==="TimeoutError",H=(t,e)=>lt.has(t)?U:e,gt=["admin","venue"];let F="admin";function ne(t){F=gt.includes(t)?t:"admin"}function mt(){return F}const wt=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let M=null;function oe(t){M=t&&wt.test(t)?t:null}function St(){return M}function Pt(t){if(typeof window>"u"||!t.startsWith("/api/v1/"))return t;const e=j();return!e||/[?&]site=/.test(t)?t:E(t,`site=${encodeURIComponent(e)}`)}async function i(t,e={}){const{token:s,baseUrl:o,headers:l,audience:p,...w}=e;if(typeof window<"u"&&!dt())throw new m(I,pt,null);if(typeof window>"u"&&o===void 0)throw new Error(`apiFetch(${JSON.stringify(t)}) ran on the server without an explicit baseUrl. The API_URL default it would inherit is browser-only (the prod image bakes NEXT_PUBLIC_API_URL="" for same-origin use, which a Node fetch cannot resolve). Pass a base explicitly: \`await backendOpts()\` (or baseUrl: PRODUCT_FETCH_BASE) for product reads, or the server-only PRODUCT_BACKEND_URL env for other backend surfaces.`);const a=typeof FormData<"u"&&w.body instanceof FormData;let r;try{r=await fetch(`${o??ut}${Pt(t)}`,{...w,headers:{...a?{}:{"Content-Type":"application/json"},...s?{Authorization:`Bearer ${s}`}:{},...p===null?{}:{"X-Portal-Audience":p??"shop"},...l},signal:w.signal??D({...w,audience:p})})}catch(y){throw y instanceof TypeError||x(y)?new m(I,U,null):y}let n;try{n=await r.text()}catch(y){throw x(y)?new m(I,U,null):y}let c=null;if(n)try{c=JSON.parse(n)}catch{throw new m(r.status,r.ok?"Expected JSON but received a non-JSON response":H(r.status,r.statusText),n)}if(!r.ok){const y=(c&&typeof c=="object"&&"detail"in c&&typeof c.detail=="string"?c.detail:null)??H(r.status,r.statusText);throw new m(r.status,y,c)}return c}let b=null;async function B(){return b||(b=Ot().finally(()=>{b=null}),b)}async function Ot(){const t=P.takeLegacyRefresh(),e=await bt.refresh(t??void 0);return P.setTokens(e.access),e.access}async function q(){return P.getAccess()??B()}async function h(t,e={}){let s;try{s=await q()}catch{throw P.clear(),new m(401,"Not signed in",null)}try{return await i(t,{...e,token:s})}catch(o){if(!(o instanceof m)||o.status!==401)throw o;try{const l=await B();return await i(t,{...e,token:l})}catch{throw P.clear(),o}}}async function G(t,e={}){if(P.getAccess())try{return{data:await h(t,e),asShopper:!0}}catch(s){if(!(s instanceof m)||s.status!==401)throw s}return{data:await i(t,e),asShopper:!1}}async function W(){const t=await h("/api/auth/me/");if(t.portal!=="shop")throw P.clear(),new m(403,"This session is not valid for this shop.",null);return t}const bt={login:(t,e)=>i("/api/auth/login/",{method:"POST",body:JSON.stringify({email:t,password:e,portal:"shop"}),credentials:"include"}),refresh:t=>i("/api/auth/refresh/",{method:"POST",body:JSON.stringify(t?{refresh:t,portal:"shop"}:{portal:"shop"}),credentials:"include"}),logout:async()=>{P.clear();try{await i("/api/auth/logout/",{method:"POST",body:JSON.stringify({portal:"shop"}),credentials:"include"})}catch{}},restoreSession:async()=>{const t=await q();return await W(),t},me:W,updateMe:t=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify(t)}),changePassword:(t,e)=>h("/api/auth/me/",{method:"PATCH",body:JSON.stringify({password:e,old_password:t})}),changeEmail:(t,e)=>h("/api/shop-portal/change-email/",{method:"POST",body:JSON.stringify({new_email:t,current_password:e})}),myProfile:()=>h("/api/shop-portal/profile/"),updateMyProfile:t=>h("/api/shop-portal/profile/",{method:"PATCH",body:JSON.stringify(t)}),myAddresses:()=>h("/api/shop-portal/delivery-locations/"),createAddress:t=>h("/api/shop-portal/delivery-locations/",{method:"POST",body:JSON.stringify(t)}),updateAddress:(t,e)=>h(`/api/shop-portal/delivery-locations/${t}/`,{method:"PATCH",body:JSON.stringify(e)}),deleteAddress:t=>h(`/api/shop-portal/delivery-locations/${t}/`,{method:"DELETE"}),passwordResetRequest:t=>i("/api/auth/password-reset/",{method:"POST",body:JSON.stringify({email:t})}),passwordResetConfirm:(t,e,s)=>i("/api/auth/password-reset/confirm/",{method:"POST",body:JSON.stringify({uid:t,token:e,new_password:s})}),brands:()=>h("/api/products/brands/"),myOrders:()=>h("/api/shop-portal/orders/").then(t=>t.results),myOrder:t=>h(`/api/shop-portal/orders/${t}/`),cancelOrder:t=>h(`/api/shop-portal/orders/${t}/cancel/`,{method:"POST"}),myReturns:t=>h(`/api/shop-portal/returns/${t?`?order=${encodeURIComponent(t)}`:""}`).then(e=>e.results),createReturn:t=>h("/api/shop-portal/returns/",{method:"POST",body:JSON.stringify(t)}),withdrawReturn:t=>h(`/api/shop-portal/returns/${t}/cancel/`,{method:"POST"}),uploadReturnPhoto:(t,e)=>{const s=new FormData;return s.append("claim_item",t),s.append("file",e),s.append("media_type",e.type.startsWith("video/")?"video":"image"),h("/api/shop-portal/return-media/",{method:"POST",body:s})}};import{media as At,absolutizeApiUrl as N}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as Tt,isSvgUrl as Rt}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as Et}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Ct,webRuntimeSiteSlug as j}from"efficient-web-builder/format/lib/web-runtime";function g(t){if(typeof t=="string")return t.startsWith("/media/")?At(t):t;if(Array.isArray(t))return t.map(g);if(t&&typeof t=="object"){const e={};for(const[s,o]of Object.entries(t))e[s]=s==="captions"&&o&&typeof o=="object"&&!Array.isArray(o)?Object.fromEntries(Object.entries(o).map(([l,p])=>[g(l),p])):g(o);return e}return t}import{PRODUCT_API_BASE as we}from"./origins.js";const z=typeof window>"u"&&k!=="",$t=z?k:at,_t=Ct,O=()=>({baseUrl:_t(),audience:null});function d(t,e){const s=e?`?process=${encodeURIComponent(e)}`:"";return`/api/v1${t}${s}`}const Ut=100,K=50;function V(t,e,s){const o=new URLSearchParams;for(const[l,p]of Object.entries(e))p!=null&&p!==""&&o.set(l,String(p));return o.set("pageSize",String(Ut)),s&&o.set("cursor",s),`/api/v1${t}?${o.toString()}`}function It(t,e){return V("/wheels",{process:t},e)}function Nt(t,e,s){return V("/products",{kind:t.join(","),make:e?.make,model:e?.model,year:e?.year,modification:e?.modification},s)}function vt(t){if(!t)return null;try{return new URL(t,"http://cursor.invalid").searchParams.get("cursor")}catch{return null}}async function X(t,e,s=()=>!1){const o=[];let l=null;try{for(let p=0;p<K;p++){const w=await i(await e(l),await u());if(o.push(...w.results),l=vt(w.next),!l)break}l&&console.warn(`[${t}] stopped at ${K} pages (${o.length} rows); catalog may be truncated`)}catch(p){if(s(p))throw p;console.warn(`[${t}] product API unavailable, returning []`,p)}return o}const kt=t=>t instanceof m&&t.status===400;function Jt(t){return t.flatMap(e=>e.kind==="alloy-wheel"?J([e]):[e])}async function Z(){return(await Lt()).host}async function Lt(){try{const{headers:t}=await import("next/headers"),e=await t(),s=p=>p?.split(",")[0]?.split(":")[0]?.trim().toLowerCase()||null,o=s(e.get(et)??e.get("x-forwarded-host")??e.get("host")),l=s(e.get("host"));return{host:o,matchesRequestHost:o!==null&&o===l}}catch{return{host:null,matchesRequestHost:!1}}}async function Dt(){try{const{headers:t}=await import("next/headers");return nt((await t()).get(ot))}catch{return null}}async function xt(){try{const{headers:t}=await import("next/headers");return(await t()).get(rt)||null}catch{return null}}async function Ht(){const t=await xt();if(t)return`site=${encodeURIComponent(t)}`;const e=await Z();return e?`host=${encodeURIComponent(e)}`:""}async function f(t){if(typeof window<"u"){const e=j();return e?E(t,`site=${encodeURIComponent(e)}`):t}return E(t,await Ht())}function E(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const Ft="preview";async function Mt(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(tt)}catch{return null}}async function Bt(){try{const{headers:t}=await import("next/headers");return(await t()).get("user-agent")}catch{return null}}async function v(t,e){const s=await Mt();if(s===null)return[await f(t),await u(e)];const o=E(await f(t),`${Ft}=${encodeURIComponent(s)}`),{next:l,cache:p,...w}=e??{},a=await u({...w,cache:"no-store"}),r=await Bt();return r&&(a.headers={...a.headers,"user-agent":r}),[o,a]}async function qt(t){if(!z)return;const[e,s]=await Promise.all([Z(),Dt()]),o=st(e,s,t);return Object.keys(o).length>0?o:void 0}async function u(t){const e=await qt(it(t)),s={baseUrl:$t,...t};return e&&(s.headers={...e,...t?.headers}),s}const A=typeof window>"u";function T(t,e){const s=new URLSearchParams;for(const[l,p]of Object.entries(e))p!==void 0&&p!==""&&s.set(l,String(p));const o=s.toString();return`/api/v1/fitment${t}${o?`?${o}`:""}`}const le={listMakes:async t=>{if(A){const{fitmentData:s}=await import("./fitment-data.js");return s.makes(t)}return(await i(T("/makes",{region:t}),O())).results},listModels:async(t,e)=>{if(A){const{fitmentData:o}=await import("./fitment-data.js");return o.models(t,e)}return(await i(T("/models",{make:t,region:e}),O())).results},listYears:async(t,e,s)=>{if(A){const{fitmentData:l}=await import("./fitment-data.js");return l.years(t,e,s)}return(await i(T("/years",{make:t,model:e,region:s}),O())).results},listModifications:async(t,e,s,o)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.modifications(t,e,s,o)}return(await i(T("/modifications",{make:t,model:e,year:s,region:o}),O())).results},getStockFitment:async(t,e,s,o,l)=>{if(A){const{fitmentData:p}=await import("./fitment-data.js");return p.stockFitment(t,e,s,o,l)}return i(T("/stock-fitment",{make:t,model:e,year:s,modification:o,region:l}),O())}},pe={listWheels:async(t,e={})=>{const s=await X("products.listWheels",async o=>await f(It(t,o)),e.throwOnFailure?()=>!0:void 0);return J(g(s))},listCatalog:async(t,e)=>{if(t.length===0)throw new Error("products.listCatalog() needs at least one kind. An empty list would omit `kind`, which the contract reads as `alloy-wheel` — so the call would silently return the wheel catalog instead of nothing.");const s=await X("products.listCatalog",async o=>await f(Nt(t,e,o)),kt);return Jt(g(s))},getWheel:async t=>L(g(await i(await f(d(`/wheels/${t}`)),await u()))),getTyre:async t=>g(await i(await f(d(`/tyres/${t}`)),await u())),listBundles:async(t={})=>{try{return await i(await f(d("/bundles")),await u())}catch(e){if(t.throwOnFailure)throw e;return[]}},getBundle:async t=>i(await f(d(`/bundles/${t}`)),await u()),listGalleryBuilds:async(t={})=>{const{process:e=null,wheelSlug:s=null}=t;if(typeof window>"u"){const{listGalleryBuilds:o}=await import("./gallery-builds-data.js");return g(o(e,s))}try{const o=new URLSearchParams;e&&o.set("process",e),s&&o.set("wheelSlug",s);const l=o.toString(),p=await i(`/api/v1/gallery-builds${l?`?${l}`:""}`,O());return g(p.results)}catch(o){return console.warn("[products.listGalleryBuilds] product API unavailable, returning []",o),[]}},getSite:async()=>i(await f(d("/site")),await u()),getSiteBySlug:async t=>i(`${d("/site")}?${new URLSearchParams({site:t})}`,typeof window>"u"?await u():void 0),listPages:async()=>g(await i(await f(d("/pages")),await u())),listPopups:async()=>i(await f(d("/popups")),await u()),listProductTemplates:async()=>{try{return await i(await f(d("/product-templates")),await u())}catch(t){return console.warn("[products.listProductTemplates] unavailable, returning []",t),[]}},listDynamicPages:async t=>{const e=t?`?recordType=${encodeURIComponent(t)}`:"";try{return await i(await f(`${d("/dynamic-pages")}${e}`),await u())}catch(s){if(s instanceof m&&s.status===404)return[];throw s}},getRecord:async(t,e)=>{try{return await i(await f(d(`/records/${encodeURIComponent(t)}/${encodeURIComponent(e)}`)),await u())}catch(s){if(s instanceof m&&s.status===404)return null;throw s}},listRecordKeys:async t=>{try{const e=await i(await f(d(`/records/${encodeURIComponent(t)}`)),await u({cache:"no-store"}));return Array.isArray(e?.keys)?e.keys.filter(s=>typeof s=="string"&&s!==""):[]}catch(e){if(e instanceof m&&e.status===404)return[];throw e}},listProductTypeChoices:async()=>{try{return await i(await f(d("/product-type-choices")),await u())}catch(t){return console.warn("[products.listProductTypeChoices] unavailable, returning []",t),[]}},listFieldUsage:async()=>{try{return await i(await f(d("/field-usage")),await u())}catch(t){return console.warn("[products.listFieldUsage] unavailable, returning []",t),[]}},getPage:async(t,e={})=>{const s=e.record?`?record=${encodeURIComponent(e.record)}`:"",[o,l]=await v(d(`/pages/${t}`)+s,e.revalidate!==void 0?{next:{revalidate:e.revalidate}}:void 0);return g(await i(o,l))},listBlogPosts:async(t={},{throwOnFailure:e=!1}={})=>{const s=t.category?`?category=${encodeURIComponent(t.category)}`:"";try{return(await i(d("/blog-posts")+s,await u())).map(l=>({...l,coverImage:N(l.coverImage)??""}))}catch(o){if(e)throw o;return console.warn("[products.listBlogPosts] blog API unavailable, returning []",o),[]}},getBlogPost:async t=>{const e=await i(d(`/blog-posts/${t}`),await u());return{...e,coverImage:N(e.coverImage)??""}},createOrder:async t=>i(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),createOrderAuthed:async t=>h(d("/orders"),await u({method:"POST",body:JSON.stringify(t)})),lookupOrder:async t=>i(d("/orders/lookup"),await u({method:"POST",body:JSON.stringify(t)})),createPaymentIntent:async t=>i(d("/payments/intent"),await u({method:"POST",body:JSON.stringify(t)})),createPaypalOrder:async t=>i(d("/payments/paypal/order"),await u({method:"POST",body:JSON.stringify(t)})),capturePaypalOrder:async t=>i(d("/payments/paypal/capture"),await u({method:"POST",body:JSON.stringify(t)})),createAfterpayCheckout:async t=>i(d("/payments/afterpay/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureAfterpayPayment:async t=>i(d("/payments/afterpay/capture"),await u({method:"POST",body:JSON.stringify(t)})),chargeSquare:async t=>i(d("/payments/square/charge"),await u({method:"POST",body:JSON.stringify(t)})),createGocardlessBillingRequest:async t=>i(d("/payments/gocardless/billing-request"),await u({method:"POST",body:JSON.stringify(t)})),completeGocardlessPayment:async t=>i(d("/payments/gocardless/complete"),await u({method:"POST",body:JSON.stringify(t)})),createZipCheckout:async t=>i(d("/payments/zip/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureZipPayment:async t=>i(d("/payments/zip/capture"),await u({method:"POST",body:JSON.stringify(t)})),createKlarnaCheckout:async t=>i(d("/payments/klarna/checkout"),await u({method:"POST",body:JSON.stringify(t)})),captureKlarnaPayment:async t=>i(d("/payments/klarna/capture"),await u({method:"POST",body:JSON.stringify(t)})),createStockAlert:async t=>i(d("/stock-alerts"),await u({method:"POST",body:JSON.stringify(t)})),createPreOrderIntent:async t=>i(d("/pre-order-intents"),await u({method:"POST",body:JSON.stringify(t)})),createNewsletterSubscription:async t=>i(d("/newsletter-subscriptions"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeNewsletter:async t=>i(d("/newsletter-unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),captureCart:async t=>i(d("/carts"),await u({method:"POST",body:JSON.stringify(t)})),restoreCart:async t=>i(d("/carts/restore"),await u({method:"POST",body:JSON.stringify(t)})),unsubscribeCartReminders:async t=>i(d("/carts/unsubscribe"),await u({method:"POST",body:JSON.stringify(t)})),listReviews:async(t={})=>{const e=new URLSearchParams;t.limit&&e.set("limit",String(t.limit)),t.designCode&&e.set("designCode",t.designCode);const s=d("/reviews"),o=e.toString();try{return await i(await f(o?`${s}?${o}`:s),await u())}catch(l){return console.warn("[products.listReviews] product API unavailable, returning []",l),[]}},submitReview:async t=>i(d("/reviews"),await u({method:"POST",body:JSON.stringify(t)})),getForm:async t=>i(d(`/forms/${encodeURIComponent(t)}`),await u()),submitForm:async(t,e)=>i(d(`/forms/${encodeURIComponent(t)}/submissions`),await u({method:"POST",body:JSON.stringify(e)})),listShippingMethods:async()=>{try{return await i(d("/shipping-methods"),await u())}catch(t){return console.warn("[products.listShippingMethods] product API unavailable, returning []",t),[]}},listCountrySubdivisions:async t=>{try{return await i(d(`/countries/${encodeURIComponent(t)}/subdivisions`),await u())}catch(e){return console.warn("[products.listCountrySubdivisions] unavailable, returning []",e),[]}},quoteCart:async t=>{const e=d("/cart/quote"),s=await u({method:"POST",body:JSON.stringify(t)});return t.couponCode?(await G(e,s)).data:i(e,s)},validateCoupon:async t=>{const{data:e,asShopper:s}=await G(d("/coupons/validate"),await u({method:"POST",body:JSON.stringify(t)}));return{...e,askedAsShopper:s}},getHeaderSettings:async()=>{const t=D({method:"GET"}),e=await i(...await v(d("/header-settings"),{signal:t})),s=N(e.logoUrl);let o=null,l=null;if(s&&Rt(s)){const p=await Tt(s,t);p&&(o=p.reversed,l=p.inkIsDark)}return{...e,logoUrl:s,logoReversed:o,logoInkIsDark:l}},getThemeSettings:async()=>i(...await v(d("/theme-settings"))),getChatSettings:async()=>i(await f(d("/chat-settings")),await u())},ye={listServices:async()=>{try{return await i(d("/bookings/services"),await u())}catch(t){return console.warn("[bookings.listServices] API unavailable, returning []",t),{results:[],currency:"USD"}}},getAvailability:async(t,e)=>i(d(`/bookings/availability?service=${encodeURIComponent(t)}&date=${e}`),await u()),create:async t=>i(d("/bookings"),await u({method:"POST",body:JSON.stringify(t)})),get:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}`),await u()),cancel:async t=>i(d(`/bookings/manage/${encodeURIComponent(t)}/cancel`),await u({method:"POST"})),createPaymentIntent:async t=>i(d("/bookings/payments/intent"),await u({method:"POST",body:JSON.stringify({manageToken:t})}))};class Gt extends Error{slug;count;constructor(e,s){super(`Slug "${e}" exists on ${s} websites; a site is required to pick one.`),this.slug=e,this.count=s,this.name="AmbiguousPageSlugError"}}const C=(t,e,s)=>{const o=new URLSearchParams({...e?{site:e}:{},...s?{draft:"1"}:{}}).toString();return`/api/storefront/${t}/${o?`?${o}`:""}`},$=t=>`/api/storefront/sites/${encodeURIComponent(t)}/`,Wt=t=>`${$(t)}currencies/`,jt="/api/storefront/media/ingest/";class zt extends Error{constructor(){super("This editor is not connected to a website, so an upload has nowhere to go. Open the page from the website the file should belong to, then try again."),this.name="MediaUploadDestinationError"}}function Kt(){const t=Et();if(!t)throw new zt;return`${jt}?${new URLSearchParams({site:t})}`}const Vt="X-Puck-Media-Manifest",Y=ct.contentHash,_={"X-Media-Manifest":Y,[Vt]:Y},he=Q({});function Q(t){return(e,s={})=>{const o=St(),l=t.headers||o?{...o?{"Accept-Language":o}:{},...t.headers,...s.headers}:void 0;return i(e,{...s,...t.baseUrl!==void 0?{baseUrl:t.baseUrl}:{},...l?{headers:l}:{},audience:t.audience??mt()})}}function Xt(t={}){const e=Q(t),s=t.siteDrafts===!0,o=a=>C("header-settings",a,s),l=a=>C("theme-settings",a,s),p=a=>C("chat-settings",a,s),w=a=>C("social-settings",a,s);return{findPageBySlug:async(a,r,n)=>{const c=new URLSearchParams({slug:a});n&&c.set("site",n);const y=await e(`/api/storefront/pages/?${c.toString()}`,{token:r}),S=Array.isArray(y)?y:y.results??[];if(!n&&S.length>1)throw new Gt(a,S.length);return S[0]??null},getPageById:(a,r)=>e(`/api/storefront/pages/${a}/`,{token:r}),saveLayout:(a,r,n,c,y)=>e(`/api/storefront/pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r,expected_updated_at:c,...y?{client_id:y}:{}}),token:n}),duplicatePage:(a,r,n)=>e(`/api/storefront/pages/${a}/duplicate/`,{method:"POST",body:JSON.stringify({title:r.title,slug:r.slug}),token:n}),geocode:(a,r,n)=>e(`/api/storefront/geocode/?${new URLSearchParams(n?{q:a,country:n}:{q:a})}`,{token:r}),listBlockSources:a=>e("/api/storefront/block-sources/",{token:a}),listRecordTypes:a=>e("/api/storefront/record-types/",{token:a}),createPagePreviewLink:(a,r)=>e(`/api/storefront/pages/${a}/preview-link/`,{method:"POST",token:r}),claimPageEditLock:(a,r,n,c=!1)=>e(`/api/storefront/pages/${a}/edit-lock/`,{method:"POST",body:JSON.stringify({client_id:n,takeover:c}),token:r}),releasePageEditLock:(a,r)=>e(`/api/storefront/pages/${a}/edit-lock/`,{method:"DELETE",token:r}),createTemplate:(a,r,n)=>e("/api/storefront/page-templates/",{method:"POST",body:JSON.stringify({name:a,layout:r}),headers:_,token:n}),getTemplate:(a,r)=>e(`/api/storefront/page-templates/${a}/`,{token:r}),saveTemplateLayout:(a,r,n)=>e(`/api/storefront/page-templates/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:_,token:n}),listTemplatePages:async(a,r)=>{const n=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(a)}`,{token:r});return Array.isArray(n)?n:n.results??[]},findTemplatePageBySlug:async(a,r,n)=>{const c=await e(`/api/storefront/template-pages/?template=${encodeURIComponent(a)}&slug=${encodeURIComponent(r)}`,{token:n});return(Array.isArray(c)?c:c.results??[])[0]??null},createTemplatePage:(a,r,n)=>e("/api/storefront/template-pages/",{method:"POST",body:JSON.stringify({template:a,...r}),headers:_,token:n}),saveTemplatePageLayout:(a,r,n)=>e(`/api/storefront/template-pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:_,token:n}),deleteTemplatePage:(a,r,n)=>e(`/api/storefront/template-pages/${a}/`,{method:"DELETE",token:r,...n?.keepalive?{keepalive:!0}:{}}),listPages:async(a,r)=>{const n=new URLSearchParams({no_page:"true"});r&&n.set("site",r);const c=await e(`/api/storefront/pages/?${n.toString()}`,{token:a});return Array.isArray(c)?c:c.results??[]},createPage:(a,r,n,c)=>e("/api/storefront/pages/",{method:"POST",body:JSON.stringify({title:a,slug:r,layout:n}),token:c}),deletePage:(a,r)=>e(`/api/storefront/pages/${a}/`,{method:"DELETE",token:r}),getHeaderSettings:(a,r)=>e(o(r),{token:a}),listMenus:async(a,r)=>{const n=new URLSearchParams({no_page:"true"});r&&n.set("site",r);const c=await e(`/api/storefront/menus/?${n}`,{token:a});return Array.isArray(c)?c:c.results??[]},listBlogPosts:async(a,r={})=>{const n=new URLSearchParams({no_page:"true"});r.visibleOnly&&n.set("is_visible","true"),r.siteId&&n.set("site",r.siteId);const c=await e(`/api/storefront/blog-posts/?${n.toString()}`,{token:a});return Array.isArray(c)?c:c.results??[]},listFieldUsage:async(a,r)=>{const n=await e(`/api/storefront/field-usage/?site=${encodeURIComponent(r)}`,{token:a});return Array.isArray(n?.entries)?n.entries:[]},listCategories:async(a,r={})=>{const n=new URLSearchParams({no_page:"true"});r.visibleOnly&&n.set("is_visible","true"),r.siteId&&n.set("site",r.siteId);const c=await e(`/api/storefront/categories/?${n.toString()}`,{token:a});return[...Array.isArray(c)?c:c.results??[]].sort((S,R)=>S.sort_order-R.sort_order||S.name.localeCompare(R.name))},listForms:async(a,r={})=>{const n=new URLSearchParams({no_page:"true"});r.siteId&&n.set("site",r.siteId);const c=await e(`/api/storefront/forms/?${n.toString()}`,{token:a});return[...Array.isArray(c)?c:c.results??[]].sort((S,R)=>S.title.localeCompare(R.title))},listWheelSummaries:async(a,r={})=>{const n=new URLSearchParams;r.siteId&&n.set("site",r.siteId);const c=n.toString(),y=await e(`/api/storefront/wheel-curations/summaries/${c?`?${c}`:""}`,{token:a});return g(y)},listProducts:async(a,r={})=>{const n=new URLSearchParams;r.kinds?.length&&n.set("kind",r.kinds.join(",")),r.siteId&&n.set("site",r.siteId);const c=n.toString(),y=await e(`/api/storefront/products/${c?`?${c}`:""}`,{token:a});return g(y)},getWheelDetail:async(a,r,n={})=>{const c=new URLSearchParams({slug:r});return n.siteId&&c.set("site",n.siteId),L(g(await e(`/api/storefront/wheel-curations/detail/?${c.toString()}`,{token:a})))},updateHeaderSettings:(a,r,n)=>e(o(n),{method:"PATCH",body:JSON.stringify(a),token:r}),getSite:(a,r)=>e($(a),{token:r}),listSites:async a=>{const r=await e("/api/storefront/sites/?no_page=true",{token:a});return Array.isArray(r)?r:r.results??[]},listSiteCurrencies:async(a,r)=>{const n=await e(Wt(a),{token:r});return Array.isArray(n)?n:[]},publishSite:(a,r)=>e(`${$(a)}publish/`,{method:"POST",token:r}),getSiteLiveState:(a,r)=>e(`${$(a)}live-state/`,{token:r}),getThemeSettings:(a,r)=>e(l(r),{token:a}),updateThemeSettings:(a,r,n)=>e(l(n),{method:"PATCH",body:JSON.stringify(a),token:r}),getChatSettings:(a,r)=>e(p(r),{token:a}),updateChatSettings:(a,r,n)=>e(p(n),{method:"PATCH",body:JSON.stringify(a),token:r}),getSocialSettings:(a,r)=>e(w(r),{token:a}),updateSocialSettings:(a,r,n)=>e(w(n),{method:"PATCH",body:JSON.stringify(a),token:r}),uploadHeaderLogo:(a,r,n)=>{const c=new FormData;return c.append("logo",a),e(o(n),{method:"PATCH",body:c,token:r})},clearHeaderLogo:(a,r)=>e(o(r),{method:"PATCH",body:JSON.stringify({logo:null}),token:a}),setHeaderLogoFromAsset:(a,r,n)=>e(o(n),{method:"PATCH",body:JSON.stringify({logo_asset_id:a}),token:r}),uploadMedia:async(a,r)=>{const n=new FormData;return n.append("file",a),e(Kt(),{method:"POST",body:n,token:r})},listMedia:async(a,r)=>{const n=new URLSearchParams({no_page:"true"});r&&n.set("kind",r);const c=await e(`/api/storefront/media-assets/?${n.toString()}`,{token:a});return Array.isArray(c)?c:c.results??[]}}}const fe=Xt({siteDrafts:!0});export{ut as API_URL,Gt as AmbiguousPageSlugError,m as ApiError,ht as BROWSER_READ_TIMEOUT_MS,pt as EFFICIENT_CLIENT_CLOSED_MESSAGE,zt as MediaUploadDestinationError,Ft as PREVIEW_PARAM,we as PRODUCT_API_BASE,yt as SERVER_READ_TIMEOUT_MS,U as SERVER_UNREACHABLE_MESSAGE,I as STATUS_NETWORK_ERROR,he as adminFetch,bt as api,i as apiFetch,E as appendSiteQuery,ye as bookings,Xt as createStorefrontAdmin,D as defaultRequestDeadline,Kt as editorMediaUploadPath,mt as editorPortalAudience,St as editorRequestLanguage,le as fitment,pe as products,ft as readDeadlineMs,Dt as resolveClientIp,g as resolveMediaUrls,Mt as resolvePreviewToken,Z as resolveSiteHost,Lt as resolveSiteHostSource,xt as resolveSiteSlug,oe as setEditorLanguage,ne as setEditorPortalAudience,fe as storefrontAdmin};
|
|
@@ -1677,6 +1677,7 @@ export interface components {
|
|
|
1677
1677
|
fbp?: string;
|
|
1678
1678
|
fbc?: string;
|
|
1679
1679
|
adConsent?: "granted" | "denied";
|
|
1680
|
+
checkoutFlow?: 1 | 2;
|
|
1680
1681
|
};
|
|
1681
1682
|
PaymentIntentRequest: {
|
|
1682
1683
|
idempotencyKey: string;
|
|
@@ -1885,6 +1886,8 @@ export interface components {
|
|
|
1885
1886
|
};
|
|
1886
1887
|
OrderConfirmation: {
|
|
1887
1888
|
orderNumber: string;
|
|
1889
|
+
checkoutNumber: string;
|
|
1890
|
+
expiresAt: string | null;
|
|
1888
1891
|
status: string;
|
|
1889
1892
|
total: string;
|
|
1890
1893
|
currency: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const r=void 0,n={hour:"numeric",minute:"2-digit"},o={weekday:"long",day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"};function i(t,e){try{return new Intl.DateTimeFormat(void 0,{...n,timeZone:e}).format(new Date(t))}catch{return new Date(t).toLocaleTimeString([],n)}}function m(t,e){try{return new Intl.DateTimeFormat(void 0,{...o,timeZone:e}).format(new Date(t))}catch{return new Date(t).toLocaleString()}}export{m as formatAppointment,i as formatAppointmentTime};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{variantsFittingVehicle as
|
|
1
|
+
import{variantsFittingVehicle as P}from"../wheels/plp-fitment-match.js";import{FALLBACK_FINISH as B}from"../wheels/finish-defaults.js";import{variantEtKey as y,variantSizeGroupKey as V,variantSizeGroupLabel as F,variantSizeGroupNote as N}from"../wheels/variant-spec.js";import{trimDecimal as S}from"../wheels/spec-format.js";import{findVariant as D,isVariantOutOfStock as O}from"../wheels/variants.js";import{HAND_WORDS as x,NOT_HANDED_WORDS as A,variantIsHanded as b}from"../wheels/set-mode.js";const g="handed",k="plain";function T(t){const l=t.variants??[],i=t.finishes.map(e=>({value:e.name,label:e.name,swatch:e.color}));function s(e){const a=[];for(const v of l){const h=e(v);!h||a.some(z=>z.value===h.value)||a.push(h)}return a}const f=s(e=>({value:V(e),label:F(e),note:N(e)})),p=s(e=>e.boltPattern?{value:e.boltPattern,label:e.boltPattern}:null),m=s(e=>{const a=y(e);return a===null?null:{value:a,label:`ET ${a}`}}),n=s(e=>e.centreBore==null?null:{value:S(e.centreBore),label:`${S(e.centreBore)} mm`}),o=l.some(b),r=o?s(e=>({value:b(e)?g:k,label:b(e)?x:A})):[],c=l.map(e=>({id:`${e.finishName}|${e.size}`,options:{finish:e.finishName,size:V(e),variantSize:e.size,...e.boltPattern?{boltPattern:e.boltPattern}:{},...y(e)!==null?{et:y(e)}:{},...e.centreBore==null?{}:{centreBore:S(e.centreBore)},...o?{pairing:b(e)?g:k}:{}},inStock:!O(e),image:null,components:e.components})),u=((t.defaultFinish?i.find(e=>e.value===t.defaultFinish):void 0)??i[0])?.value;return{kind:"alloy-wheel",source:t,slug:t.slug,name:t.name,eyebrow:t.process,badge:t.badge==="new"?"New 2026":t.badge?"Bestseller":"",href:`/wheels/${t.slug}`,crumbs:[{label:"Home",href:"/"},{label:"Wheels",href:"/wheels"},{label:t.process,href:"/wheels"},{label:t.name}],cover:t.coverImage??null,inStock:t.inStock===!0,mediaGroups:t.mediaGroups,optionFields:[{key:"finish",label:"Finish",prompt:"Select a finish",role:"resolves",display:"swatch",defaultValue:u},{key:"size",label:"Size",prompt:"Select a size",role:"resolves",display:"pill",empty:{text:"This wheel isn't available to order online in this finish.",linkText:"Contact us about it →",href:"/contact"}},{key:"boltPattern",label:"Bolt pattern",prompt:"Select a bolt pattern",role:"describes",display:"pill"},{key:"et",label:"Offset",prompt:"Select an offset",role:"describes",display:"pill"},{key:"centreBore",label:"Centre bore",prompt:"Select a centre bore",role:"describes",display:"pill"},{key:"pairing",label:"Wheels",prompt:"Select a pairing",role:"describes",display:"pill"}],optionValues:{finish:i,size:f,boltPattern:p,et:m,centreBore:n,pairing:r},parts:c,anchorPrices:t.prices,anchorMsrpPrices:t.msrpPrices??{}}}function _(t,l){if(t.kind!=="alloy-wheel"||l===null)return t;const i=new Set(P(t.source.variants??[],l));if(i.size===0)return t;const s=t.parts.filter(n=>{const o=H(t.source,n);return o!==null&&i.has(o)});if(s.length===0||s.length===t.parts.length)return t;const f=(n,o)=>new Set(n.map(r=>r.options[o]).filter(r=>r!==void 0)),p={},m=[];for(const n of t.optionFields){const o=f(t.parts,n.key),r=f(s,n.key),c=(t.optionValues[n.key]??[]).filter(u=>r.has(u.value)||!o.has(u.value));p[n.key]=c;const d=n.defaultValue!==void 0&&!c.some(u=>u.value===n.defaultValue)?c[0]?.value:n.defaultValue;m.push(d===n.defaultValue?n:{...n,defaultValue:d})}return{...t,optionFields:m,optionValues:p,parts:s}}function H(t,l){return l?D(t.variants??[],l.options.finish,l.options.variantSize)??null:null}function C(t,l){return t.finishes.find(i=>i.name===l)??t.finishes[0]??B}export{T as fromWheel,H as partVariant,C as wheelFinish,_ as wheelForVehicle};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseTyreSize as l}from"../tyres/tyre-size.js";const s=["alloy-wheel","tyre"],u=["alloy-wheel"],
|
|
1
|
+
import{parseTyreSize as l}from"../tyres/tyre-size.js";const s=["alloy-wheel","tyre"],u=["alloy-wheel"],p={"alloy-wheel":"Alloy wheels",tyre:"Tyres"},m="All products",x="All product types";function P(e){return e.length===1&&e[0]==="alloy-wheel"?{one:"wheel",many:"wheels"}:e.length===1&&e[0]==="tyre"?{one:"tyre",many:"tyres"}:{one:"product",many:"products"}}const d=s.map(e=>({value:e,label:p[e]}));function w(e){return e==null?[...u]:Array.isArray(e)?s.filter(r=>e.includes(r)):[...u]}const t=e=>e;function o(e){return t(e).kind==="tyre"?"tyre":"alloy-wheel"}function A(e,r){return e.filter(n=>r.includes(o(n)))}function L(e){return t(e).slug??""}function h(e){return t(e).name??""}function c(e){return t(e).brand??""}function S(e){const r=new Set;for(const n of e)if(r.add(c(n)),r.size>1)return!0;return!1}function f(e){return t(e).process??""}function _(e){const r=new Set;for(const n of e)if(r.add(f(n)),r.size>1)return!0;return!1}function g(e){return t(e).prices??void 0}function T(e){return t(e).inStock!==!1}function N(e){const r=t(e),n=o(e)==="tyre"?r.rimDiameters:r.sizes;return Array.isArray(n)?n.filter(i=>typeof i=="number"&&Number.isFinite(i)):[]}function D(e){return o(e)!=="tyre"&&t(e).badge==="new"}function a(e){return o(e)==="tyre"?[]:(t(e).finishes??[]).filter(r=>typeof r?.family=="string").map(r=>({family:r.family,color:r.color??null}))}function I(e){return a(e).map(r=>r.family)}function K(e){if(o(e)==="tyre")return[];const r=t(e);return Array.isArray(r.categories)?r.categories:r.process?[r.process]:[]}function z(e){return o(e)==="tyre"?[]:t(e).spec?.pcds??[]}function E(e){return o(e)!=="tyre"?[]:t(e).tyreTypes??[]}function B(e){return o(e)!=="tyre"?[]:t(e).speedRatings??[]}function F(e){if(o(e)!=="tyre")return[];const r=t(e).sizes;return Array.isArray(r)?r.map(n=>l(typeof n=="string"?n:null)).filter(n=>n!==null):[]}export{x as PLP_ALL_TYPES_LABEL,m as PLP_ANY_TYPE_LABEL,u as PLP_DEFAULT_KINDS,s as PLP_KINDS,p as PLP_KIND_LABELS,d as PRODUCT_KIND_OPTIONS,c as itemBrand,K as itemCollections,N as itemDiameters,I as itemFinishFamilies,a as itemFinishes,T as itemInStock,D as itemIsNew,o as itemKind,h as itemName,z as itemPcds,g as itemPrices,f as itemProcess,L as itemSlug,B as itemSpeedRatings,F as itemTyreSizes,E as itemTyreTypes,S as plpBrandVaries,A as plpItemsOfKinds,P as plpKindNoun,_ as plpProcessVaries,w as resolvePlpKinds};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type OrderConfirmation } from "../api/index.js";
|
|
2
|
+
import type { LandingOrder } from "./wallet-return.js";
|
|
3
|
+
export declare const PAY_FIRST_FLOW = 2;
|
|
4
|
+
export declare function paysFirst(method: string | null): boolean;
|
|
5
|
+
export declare const CHECKOUT_UNAVAILABLE = "checkout_unavailable";
|
|
6
|
+
export declare const NOT_CHECKED = "We could not check your payment. Please try again.";
|
|
7
|
+
export declare const INTENT_READ_MS = 10000;
|
|
8
|
+
export declare function readIntentStatus(intent: {
|
|
9
|
+
publishableKey: string;
|
|
10
|
+
clientSecret: string;
|
|
11
|
+
}, ms?: number): Promise<string | undefined>;
|
|
12
|
+
export declare const DROPPABLE_INTENT: Set<string>;
|
|
13
|
+
export declare function checkoutGone(err: unknown): boolean;
|
|
14
|
+
export declare function orderReference(conf: Pick<OrderConfirmation, "orderNumber" | "checkoutNumber">): string;
|
|
15
|
+
export type PayFirstResult = {
|
|
16
|
+
kind: "pending" | "processing" | "refunded" | "expired";
|
|
17
|
+
checkoutNumber: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function payFirstOutcome(conf: OrderConfirmation): {
|
|
20
|
+
kind: "placed";
|
|
21
|
+
order: OrderConfirmation;
|
|
22
|
+
} | PayFirstResult;
|
|
23
|
+
export interface PayFirstPage {
|
|
24
|
+
setConfirming(on: boolean): void;
|
|
25
|
+
land(order: LandingOrder): void;
|
|
26
|
+
markPaid(): void;
|
|
27
|
+
track(order: OrderConfirmation): void;
|
|
28
|
+
unplaced(result: PayFirstResult): void;
|
|
29
|
+
}
|
|
30
|
+
export declare function settlePayFirst({ checkoutNumber, resend, page, }: {
|
|
31
|
+
checkoutNumber: string;
|
|
32
|
+
resend: () => Promise<OrderConfirmation>;
|
|
33
|
+
page: PayFirstPage;
|
|
34
|
+
}): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{loadStripe as c}from"@stripe/stripe-js";import{ApiError as i}from"../api/index.js";const m=2;function y(e){return e==="card"}const u="checkout_unavailable",f="We could not check your payment. Please try again.",d=1e4;async function k(e,n=d){let t;const r=new Promise(o=>{t=setTimeout(()=>o(void 0),n)}),a=(async()=>{try{return(await(await c(e.publishableKey))?.retrievePaymentIntent(e.clientSecret))?.paymentIntent?.status}catch{return}})();try{return await Promise.race([a,r])}finally{clearTimeout(t)}}const x=new Set(["none","requires_payment_method","canceled"]);function N(e){return e instanceof i&&typeof e.data=="object"&&e.data!==null&&e.data.code===u}function h(e){return e.orderNumber||e.checkoutNumber}function s(e){return e.orderNumber?{kind:"placed",order:e}:{kind:e.status==="released"?"refunded":e.status==="expired"?"expired":"pending",checkoutNumber:e.checkoutNumber}}async function _({checkoutNumber:e,resend:n,page:t}){t.setConfirming(!0);let r;try{r=s(await n())}catch{r={kind:"pending",checkoutNumber:e}}r.kind==="placed"?(t.markPaid(),t.track(r.order),t.land(r.order)):t.unplaced({...r,checkoutNumber:r.checkoutNumber||e}),t.setConfirming(!1)}export{u as CHECKOUT_UNAVAILABLE,x as DROPPABLE_INTENT,d as INTENT_READ_MS,f as NOT_CHECKED,m as PAY_FIRST_FLOW,N as checkoutGone,h as orderReference,s as payFirstOutcome,y as paysFirst,k as readIntentStatus,_ as settlePayFirst};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface StripeAppearance {
|
|
2
|
+
theme: "night" | "stripe";
|
|
3
|
+
variables: {
|
|
4
|
+
colorPrimary: string;
|
|
5
|
+
colorBackground: string;
|
|
6
|
+
colorText: string;
|
|
7
|
+
borderRadius: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export declare function stripeAppearance(): StripeAppearance | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{rootIsDark as a}from"efficient-shell/format";function f(){if(typeof document>"u")return;const r=getComputedStyle(document.documentElement),t=(o,n)=>r.getPropertyValue(o).trim()||n,e=a({whenUnset:!0});return{theme:e?"night":"stripe",variables:{colorPrimary:t("--accent",e?"#c9a461":"#8a6a2a"),colorBackground:t("--site-surface",e?"#131313":"#ffffff"),colorText:t("--fg",e?"#f5f1e8":"#0a0a0a"),borderRadius:"0px"}}}export{f as stripeAppearance};
|
|
@@ -8,7 +8,7 @@ export interface WalletContext {
|
|
|
8
8
|
idempotencyKey: string;
|
|
9
9
|
confirmation: OrderConfirmation;
|
|
10
10
|
}
|
|
11
|
-
export type LandingOrder = Pick<OrderConfirmation, "orderNumber"
|
|
11
|
+
export type LandingOrder = Pick<OrderConfirmation, "orderNumber"> & Partial<Pick<OrderConfirmation, "currency" | "grandTotal" | "freightCharge" | "discountAmount" | "shippingMethod" | "couponCode">>;
|
|
12
12
|
export type WalletReturn<C> = {
|
|
13
13
|
action: "ignore";
|
|
14
14
|
} | {
|
|
@@ -38,5 +38,6 @@ export declare function packLabel(choice: PurchaseChoice): string;
|
|
|
38
38
|
export declare const ADD_TO_BASKET_ATTR = "data-add-to-basket";
|
|
39
39
|
export declare const MAX_QTY_PER_LINE = 9;
|
|
40
40
|
export declare const PRICE_LOCALE = "en";
|
|
41
|
+
export declare function currencyFormat(currency: string, minimumFractionDigits?: number, maximumFractionDigits?: number): Intl.NumberFormat;
|
|
41
42
|
export declare function formatPrice(amount: number, currency: string, decimalPlaces?: number): string;
|
|
42
43
|
export declare function formatMoneyInCurrency(amount: number, currency: string): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const E=4;function x(e,t){return e.map(r=>({partNumber:r.partNumber,quantity:r.wheels*t}))}function S(e,t){if(e.length===0)return null;let r=0;for(const s of e){const n=s.prices?.[t];if(typeof n!="number"||!Number.isFinite(n)||n<=0)return null;r+=n*s.wheels}return r}const u=4,_=1,h={unit:"set",spares:0,spareSide:"left"};function f(e){return e.unit==="single"?1:u+e.spares}function P(e,t){return[{partNumber:e.partNumber,wheels:f(t),prices:e.prices}]}function T(e,t){const r=f(t)-u;if(r<=0||e.length===0)return e;const s=l(e),n=s?s[t.spareSide]:0;return e.map((o,a)=>a===n?{...o,wheels:o.wheels+r}:o)}function l(e){let t,r;for(let s=0;s<e.length;s+=1){const n=e[s].hand;if(n!=="left"&&n!=="right")continue;if((n==="left"?t:r)!==void 0)return null;n==="left"?t=s:r=s}return t!==void 0&&r!==void 0?{left:t,right:r}:null}function y(e){const t=typeof e.spares=="number"?e.spares:e.spare?1:0;return{unit:e.unit,spares:t,spareSide:e.spareSide??"left"}}function c(e,t){return t.spares>0?`${e} + spare`:e}function b(e){return e.unit==="single"?"Single":c(`Set of ${u}`,e)}const A="data-add-to-basket",C=9,d="en",p=new Map;function i(e,t,r){const s=`${e}|${t??""}|${r??""}`;let n=p.get(s);return n||(n=new Intl.NumberFormat(d,{style:"currency",currency:e,...t===void 0?{}:{minimumFractionDigits:t},...r===void 0?{}:{maximumFractionDigits:r}}),p.set(s,n)),n}function g(e,t,r=0){return i(t,0,r).format(e)}function w(e,t){return i(t).format(e)}export{A as ADD_TO_BASKET_ATTR,h as DEFAULT_PURCHASE_CHOICE,C as MAX_QTY_PER_LINE,_ as MAX_SPARES,d as PRICE_LOCALE,u as UNITS_PER_SET,E as WHEELS_PER_SET,i as currencyFormat,w as formatMoneyInCurrency,g as formatPrice,x as orderLinesForSets,P as packComposition,b as packLabel,y as purchaseChoiceFromPack,T as setPackComposition,S as setPrice,l as spareTargetsByHand,f as unitsPerPack,c as withSpare};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={left:"left",start:"left",center:"center",right:"right",end:"right"},n=t=>typeof t=="string"&&Object.hasOwn(e,t)?e[t]:null;export{n as legacyBlockAlignOf};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
export type MenuLinkAlign = "start" | "center" | "end";
|
|
2
|
-
export declare const MENU_LINK_ALIGNS: readonly MenuLinkAlign[];
|
|
3
|
-
export declare const resolveMenuLinkAlign: (v: unknown) => MenuLinkAlign | null;
|
|
4
1
|
export interface MenuLinkRange {
|
|
5
2
|
from: number;
|
|
6
3
|
to?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const t=e=>typeof e=="number"&&Number.isInteger(e)&&e>=1?e:void 0;function u(e){if(!e||typeof e!="object")return null;const n=t(e.from)??1,o=t(e.to);return o!==void 0&&o<n||n===1&&o===void 0?null:o===void 0?{from:n}:{from:n,to:o}}const r=(e,n)=>n>=e.from&&(e.to===void 0||n<=e.to);export{r as menuLinkInRange,u as resolveMenuLinkRange};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PLP_DEFAULT_KINDS as
|
|
1
|
+
import{PLP_DEFAULT_KINDS as e}from"../../../../catalog/plp-item.js";import{PLP_COLUMNS_DEFAULT as o}from"../../../../wheels/plp-grid.js";import{DEFAULT_COVER_INDEX as t}from"../../../../wheels/cover-rendering.js";const l={heading:"Alloy wheels",intro:"Filter by brand, colour, size and fitment to find your set."},s={label:"List",defaultProps:{heading:"",intro:"",askForCar:!0,gateHeading:"",gateIntro:"",kinds:[...e],perPage:24,columns:o,defaultSort:"recommended",coverIndex:String(t),showInStock:!0,showCollection:!0,showPrice:!0}};export{l as ALLOYWHEELSLISTING_PH,s as AlloyWheelsListingMeta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const e={label:"Bundle Products",defaultProps:{num:"",title:"",description:"",columns:3}};export{e as BundleOfferMeta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={title:"Ready when *you are.*",secondary:"Questions? Talk to us"},t={label:"Ready-to-Order Banner",
|
|
1
|
+
const e={title:"Ready when *you are.*",secondary:"Questions? Talk to us"},t={label:"Ready-to-Order Banner",defaultProps:{eyebrow:"",title:"",body:"",ctaText:"",ctaHref:"",secondaryText:"",secondaryHref:""}};export{e as CHECKOUT_CTA_PH,t as CheckoutCTAMeta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const l={cards:{type:"slot"}},o={label:"Collections",fields:l,defaultProps:{columns:3,limit:6}};export{o as CollectionsMeta,l as CollectionsSlots};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PH as t}from"efficient-web-builder/format/lib/document/blocks/placeholders";const e={num:t.sectionNumber,title:"Compatible *tyres.*",description:t.body,footnote:"Tyres shown are fitment-matched companions.",footnoteLinkText:"Enquire about tyres"},n={label:"Compatible Tyres",
|
|
1
|
+
import{PH as t}from"efficient-web-builder/format/lib/document/blocks/placeholders";const e={num:t.sectionNumber,title:"Compatible *tyres.*",description:t.body,footnote:"Tyres shown are fitment-matched companions.",footnoteLinkText:"Enquire about tyres"},n={label:"Compatible Tyres",defaultProps:{num:"",title:"",description:"",footnote:"",footnoteLinkText:"",footnoteLinkHref:""}};export{e as COMPATIBLETYRES_PH,n as CompatibleTyresMeta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={title:"Delivery, your way",badge:"Recommended"},t={label:"Delivery Options",
|
|
1
|
+
const e={title:"Delivery, your way",badge:"Recommended"},t={label:"Delivery Options",defaultProps:{eyebrow:"",title:"",body:"",options:[],live:!0,highlightBadge:""}};export{e as DELIVERY_PH,t as DeliveryOptionsMeta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=[{image:"",eyebrow:"Feature eyebrow",title:"Feature *one.*",copy:"Describe this feature in a sentence or two.",tag:"01 · Detail"},{image:"",eyebrow:"Feature eyebrow",title:"Feature *two.*",copy:"Describe this feature in a sentence or two.",tag:"02 · Detail"},{image:"",eyebrow:"Feature eyebrow",title:"Feature *three.*",copy:"Describe this feature in a sentence or two.",tag:"03 · Detail"}],t={label:"Feature Rows",
|
|
1
|
+
const e=[{image:"",eyebrow:"Feature eyebrow",title:"Feature *one.*",copy:"Describe this feature in a sentence or two.",tag:"01 · Detail"},{image:"",eyebrow:"Feature eyebrow",title:"Feature *two.*",copy:"Describe this feature in a sentence or two.",tag:"02 · Detail"},{image:"",eyebrow:"Feature eyebrow",title:"Feature *three.*",copy:"Describe this feature in a sentence or two.",tag:"03 · Detail"}],t={label:"Feature Rows",defaultProps:{dynamic:!1,rows:[],startLeft:!1,layout:"even",padTop:100,padBottom:100}};export{e as DETAILROWS_SCAFFOLD_ROWS,t as DetailRowsMeta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={label:"EU Tyre Label",
|
|
1
|
+
const e={label:"EU Tyre Label",defaultProps:{num:""}};export{e as EuTyreLabelMeta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PH as t}from"efficient-web-builder/format/lib/document/blocks/placeholders";const
|
|
1
|
+
import{PH as t}from"efficient-web-builder/format/lib/document/blocks/placeholders";const o={num:t.sectionNumber,title:"Find your *match.*",description:"A few quick picks and we show the right option for you.",ctaText:"Browse all products"},i={label:"Fitment Form",defaultProps:{num:"",title:"",description:"",ctaText:"",ctaHref:"",layout:"full"}};export{o as FITMENTFINDER_PH,i as FitmentFinderMeta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PH as t}from"efficient-web-builder/format/lib/document/blocks/placeholders";const
|
|
1
|
+
import{PH as t}from"efficient-web-builder/format/lib/document/blocks/placeholders";const o={num:t.sectionNumber,title:"Specifications *table.*",description:t.body,footnote:"Add a short footnote here.",footnoteLinkText:"Contact us"},n={label:"Fitment Table",defaultProps:{dynamic:!1,num:"",title:"",description:"",wheel:"",showFilter:!0,tooltipDefaultOn:!0,footnote:"",footnoteLinkText:"",footnoteLinkHref:""}};export{o as FITMENTTABLE_PH,n as FitmentTableMeta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as m}from"react/jsx-runtime";import y,{SourcedGalleryGrid as
|
|
1
|
+
import{jsx as m}from"react/jsx-runtime";import{phoneKey as y}from"efficient-easel/draw";import f,{SourcedGalleryGrid as r}from"../../../../../components/pdp-dynamic/DynamicGalleryGrid.js";import{declaredBlockSource as c,sourcedRows as H}from"efficient-web-builder/format/lib/content/block-sources";import g from"../../../../../components/GalleryGrid.js";import{hidableText as d}from"efficient-easel/screen/lib/document/hidable";import{parseSectionHeadPlacement as k}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as i}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{GalleryBMeta as T,GALLERY_B_PH as n}from"./meta.js";const D={...T,render:e=>{const l=k(e.headPlacement)==="own-box",t=a=>l?void 0:a;if(c(e)!==""){const a=!!e.editor?.isEditing,{rows:o,sample:u}=H(e,a);return m(r,{num:t(i(e.num,n.num,e.editor)),title:t(i(e.title,n.title,e.editor)),linkText:t(i(e.linkText,n.link,e.editor)),linkHref:t(d(e.linkHref)||"/contact"),omitHead:l,rows:u?[]:o,limit:e.limit,layout:e.layout,editing:a,padTop:typeof e.padTop=="number"?e.padTop:void 0,padBottom:typeof e.padBottom=="number"?e.padBottom:void 0})}return e.dynamic?m(f,{num:t(i(e.num,n.num,e.editor)),title:t(i(e.title,n.title,e.editor)),linkText:t(i(e.linkText,n.link,e.editor)),linkHref:t(d(e.linkHref)||"/contact"),omitHead:l,galleryHref:d(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.editor?.isEditing,padTop:typeof e.padTop=="number"?e.padTop:void 0,padBottom:typeof e.padBottom=="number"?e.padBottom:void 0}):m(g,{num:t(i(e.num,n.num,e.editor)),title:t(i(e.title,n.title,e.editor)),omitHead:l,linkText:t(i(e.linkText,n.link,e.editor)),linkHref:t(d(e.linkHref)||"/contact"),galleryHref:d(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,gapPhone:e[y("gap")],items:e.items,padTop:typeof e.padTop=="number"?e.padTop:void 0,padBottom:typeof e.padBottom=="number"?e.padBottom:void 0,editing:e.editor?.isEditing})}};export{D as GalleryBRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{DEFAULT_TITLE_SIZE as t}from"../../../../sections/product-grid-title.js";import{DEFAULT_COVER_INDEX as o}from"../../../../wheels/cover-rendering.js";import{DEFAULT_CARD_OUTLINE as e,DEFAULT_CARD_INDEX_FORMAT as r}from"efficient-web-builder/format/lib/sections/product-card-style";const i={products:{type:"slot"}},s={label:"Product Grid",fields:i,defaultProps:{dynamic:!1,num:"",title:"",titleSize:t,padTop:120,description:"",linkText:"",linkHref:"",columns:4,limit:8,showAll:!1,spinOnHover:!0,coverIndex:String(o),outline:e,indexBadge:r,showBadge:!0,source:null}};export{s as ProductGridMeta,i as ProductGridSlots};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as m}from"react/jsx-runtime";import h from"../../../../../components/pdp-dynamic/DynamicRelatedProducts.js";import{DEFAULT_RELATIONSHIP as
|
|
1
|
+
import{jsx as m}from"react/jsx-runtime";import{phoneKey as h}from"efficient-easel/draw";import w from"../../../../../components/pdp-dynamic/DynamicRelatedProducts.js";import{DEFAULT_RELATIONSHIP as f}from"../../../../catalog/relationships.js";import{resolveWidth as s}from"efficient-web-builder/format/lib/content/section-width";import C from"../../../../../components/ProductGridSection.js";import{resolveBoundCardImageBackground as B}from"efficient-web-builder/format/lib/content/card-image-background";import{hidableText as P}from"efficient-easel/screen/lib/document/hidable";import{parseCoverIndex as x}from"../../../../wheels/cover-rendering.js";import{parseSectionHeadPlacement as k}from"efficient-web-builder/format/lib/sections/section-head-placement";import{parseCardOutline as c,parseCardIndexFormat as u}from"efficient-web-builder/format/lib/sections/product-card-style";import{PH as n}from"efficient-web-builder/format/lib/document/blocks/placeholders";import{phHide as i}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{PRODUCTGRID_PH as t}from"../placeholders.js";import{ProductGridMeta as I}from"./meta.js";const j={...I,render:e=>{if(e.dynamic)return m(w,{num:i(e.num,t.num,e.editor),title:i(e.title,n.sectionHeading,e.editor),description:i(e.description,n.body,e.editor),columns:typeof e.columns=="number"?e.columns:3,relationship:f,cardImage:e.cardImage,outline:c(e.outline),indexBadge:u(e.indexBadge),showBadge:e.showBadge??!0,imageBackground:B(e.imageBackground),showCardPrice:e.showCardPrice,showCardFinishes:e.showCardFinishes,showCardSizes:e.showCardSizes,showCardBuy:e.showCardBuy,showCardPage:e.showCardPage,editing:e.editor?.isEditing});const a=i(e.linkText,t.link,e.editor),o=e.source,g=s(e,"full"),r=k(e.headPlacement)==="own-box",d=l=>r?void 0:l;return m(C,{gap:e.gap,gapPhone:e[h("gap")],contentCapped:g.mode==="page",num:d(i(e.num,t.num,e.editor)),title:d(i(e.title,n.sectionHeading,e.editor)),titleSize:e.titleSize,padTop:r?0:e.padTop,description:d(i(e.description,n.body,e.editor)),link:d(a?{text:a,href:P(e.linkHref)||"#"}:void 0),products:e.products,wheels:e.wheels,source:o?.slug?o:void 0,catalog:e.catalog,kinds:e.kinds,fieldUsage:e.fieldUsage,columns:e.columns,limit:e.showAll?void 0:e.limit,editing:e.editor?.isEditing,imageBackground:e.imageBackground,cardImage:e.cardImage,spinOnHover:e.spinOnHover,coverIndex:x(e.coverIndex),outline:c(e.outline),indexBadge:u(e.indexBadge),showBadge:e.showBadge??!0,showCardPrice:e.showCardPrice,showCardFinishes:e.showCardFinishes,showCardSizes:e.showCardSizes,showCardBuy:e.showCardBuy,showCardPage:e.showCardPage})}};export{j as ProductGridRender};
|
|
@@ -1,2 +1,8 @@
|
|
|
1
1
|
import type { BlockRender } from "efficient-web-builder/format/lib/document/blocks/block-types";
|
|
2
|
+
export declare const ProductHeroSlots: {
|
|
3
|
+
trustBullets: {
|
|
4
|
+
type: "slot";
|
|
5
|
+
allow: string[];
|
|
6
|
+
};
|
|
7
|
+
};
|
|
2
8
|
export declare const ProductHeroMeta: Omit<BlockRender, "render">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_HERO_PRICE_PLACEMENT as e}from"../../../../sections/hero-price-placement.js";import{DEFAULT_HERO_LAYOUT as
|
|
1
|
+
import{DEFAULT_HERO_PRICE_PLACEMENT as e}from"../../../../sections/hero-price-placement.js";import{DEFAULT_HERO_LAYOUT as t,DEFAULT_HERO_RATIO as r,DEFAULT_HERO_TEXT_ALIGN as E}from"../../../../sections/hero-arrangement.js";import{DEFAULT_HERO_GALLERY_MODE as T,DEFAULT_HERO_IMAGE_FIT as _}from"../../../../sections/hero-gallery.js";import{TRUST_BULLETS_ALLOW as L,TRUST_BULLETS_SLOT as o}from"../../../../sections/hero-trust-bullets.js";const l={[o]:{type:"slot",allow:L}},a={label:"Product Hero",fields:l,defaultProps:{source:null,pricePlacement:e,showVehicleFitment:!0,heroLayout:t,imageRatio:r,textAlign:E,showSpecTable:!0,showPriceQuote:!0,galleryMode:T,imageFit:_,[o]:[]}};export{a as ProductHeroMeta,l as ProductHeroSlots};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{SITE_WIDTH_CAP as T}from"efficient-web-builder/format/lib/content/page-width";import{resolveWidth as _}from"efficient-web-builder/format/lib/content/section-width";import h from"../../../../../components/LinkedProductHero.js";import n from"../../../../../components/pdp-dynamic/DynamicProductHero.js";import H from"../../../../../components/SectionNotice.js";import{trustBulletsRow as L,trustBulletsSlot as P}from"../../../../../components/product-hero/trust-bullets.js";import{TRUST_BULLETS_SLOT as g}from"../../../../sections/hero-trust-bullets.js";import{useCurrentProduct as A}from"../../../current-product.js";import{isEditorOnDynamicPage as R}from"efficient-web-builder/format/lib/document/editor-page-context";import{DEFAULT_HERO_PRICE_PLACEMENT as F,parseHeroPricePlacement as O}from"../../../../sections/hero-price-placement.js";import{DEFAULT_HERO_LAYOUT as w,DEFAULT_HERO_RATIO as y,DEFAULT_HERO_TEXT_ALIGN as D,parseHeroLayout as U,parseHeroRatio as p,parseHeroTextAlign as I}from"../../../../sections/hero-arrangement.js";import{DEFAULT_HERO_GALLERY_MODE as S,DEFAULT_HERO_IMAGE_FIT as M,parseHeroGalleryMode as x,parseHeroImageFit as B}from"../../../../sections/hero-gallery.js";import{say as C}from"efficient-web-builder/format/lib/editor-words";import{ProductHeroMeta as k}from"./meta.js";function G({source:e,editing:t=!1,pricePlacement:o=F,showVehicleFitment:i=!0,heroLayout:l=w,imageRatio:u=y,textAlign:a=D,showSpecTable:c=!0,showPriceQuote:s=!0,galleryMode:f=S,imageFit:E=M,trustBullets:d}){const m={heroLayout:l,imageRatio:u,textAlign:a,showSpecTable:c,showPriceQuote:s,galleryMode:f,imageFit:E,trustBullets:L(d,t)};return A()||t&&R()?r(n,{editing:t,pricePlacement:o,showVehicleFitment:i,...m}):e?.slug?r(h,{slug:e.slug,kind:e.kind??"wheel",editing:t,pricePlacement:o,showVehicleFitment:i,...m}):t?r(H,{size:"tall",children:C("Pick a product in the panel to fill this hero.")}):r(n,{pricePlacement:o,showVehicleFitment:i,...m})}function N(e,t){return _(e,"full").mode!=="page"?t:r("div",{style:{"--sf-content-cap":T},children:t})}const re={...k,render:e=>N(e,r(G,{source:e.source,editing:e.editor?.isEditing,pricePlacement:O(e.pricePlacement),showVehicleFitment:e.showVehicleFitment??!0,heroLayout:U(e.heroLayout),imageRatio:p(e.imageRatio),textAlign:I(e.textAlign),showSpecTable:e.showSpecTable??!0,showPriceQuote:e.showPriceQuote??!0,galleryMode:x(e.galleryMode),imageFit:B(e.imageFit),trustBullets:P(e[g])}))};export{re as ProductHeroRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{RELATED_CARDS_DEFAULT as o}from"../../../../catalog/related-cards.js";import{DEFAULT_RELATIONSHIP as t}from"../../../../catalog/relationships.js";const r={footnote:"A note about how these are matched.",footnoteLinkText:"Enquire"},i={label:"Related Products",
|
|
1
|
+
import{RELATED_CARDS_DEFAULT as o}from"../../../../catalog/related-cards.js";import{DEFAULT_RELATIONSHIP as t}from"../../../../catalog/relationships.js";const r={footnote:"A note about how these are matched.",footnoteLinkText:"Enquire"},i={label:"Related Products",defaultProps:{num:"",title:"",description:"",footnote:"",footnoteLinkText:"",footnoteLinkHref:"",cardCount:o,columns:3,relationship:t}};export{r as RELATEDPRODUCTS_PH,i as RelatedProductsMeta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PH as e}from"efficient-web-builder/format/lib/document/blocks/placeholders";const i={num:e.sectionNumber,title:"Specifications *table.*",description:e.body},o={label:"Spec Table",
|
|
1
|
+
import{PH as e}from"efficient-web-builder/format/lib/document/blocks/placeholders";const i={num:e.sectionNumber,title:"Specifications *table.*",description:e.body},o={label:"Spec Table",defaultProps:{dynamic:!1,num:"",title:"",description:"",source:null,finish:"",size:"",showDiagram:!0,rows:[]}};export{i as SPECTABLE_PH,o as SpecTableMeta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as g}from"react/jsx-runtime";import
|
|
1
|
+
import{jsx as g}from"react/jsx-runtime";import h from"../../../../../components/pdp-dynamic/DynamicSpecTable.js";import w from"../../../../../components/SpecTable.js";import{buildSpecSheet as b,buildLegacySpecSheet as y}from"../../../../wheels/spec-sheet.js";import{parseSectionHeadPlacement as S}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as n}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{SpecTableMeta as x,SPECTABLE_PH as d}from"./meta.js";const z={...x,render:e=>{const o=S(e.headPlacement)==="own-box",t=i=>o?void 0:i;if(e.dynamic)return g(h,{nodeId:typeof e.id=="string"?e.id:void 0,num:t(n(e.num,d.num,e.editor)),title:t(n(e.title,d.title,e.editor)),description:t(n(e.description,d.description,e.editor)),showDiagram:e.showDiagram!==!1,omitHead:o,editing:e.editor?.isEditing});const a=e.source??null,m=e.wheel,r=!a?.slug&&typeof m=="string"?m:"",s=typeof e.finish=="string"?e.finish:"",f=typeof e.size=="string"?e.size:"";let l,u=!0,c=null;if(a?.slug&&a.spec){const i=b(a,s,f);l=i.rows,c=e.showDiagram===!1?null:i.diagram}else if(r){const i=y(r,s,f);l=i.rows,c=e.showDiagram===!1?null:i.diagram}else l=e.rows??[],u=!1;return g(w,{capped:!1,nodeId:typeof e.id=="string"?e.id:void 0,num:t(n(e.num,d.num,e.editor)),title:t(n(e.title,d.title,e.editor)),description:t(n(e.description,d.description,e.editor)),rows:l,builtInLabels:u,diagram:c,omitHead:o,editing:e.editor?.isEditing})}};export{z as SpecTableRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={label:"Tyre Fitment Form",
|
|
1
|
+
const e={label:"Tyre Fitment Form",defaultProps:{num:"",title:"",description:"",escapeText:"",escapeHref:""}};export{e as TyreFitmentMeta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={label:"Tyre Sizes",
|
|
1
|
+
const e={label:"Tyre Sizes",defaultProps:{num:"",title:"",description:""}};export{e as TyreSizesMeta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CONTACT_KIND_NAMES as o,CONTACT_KINDS as C}from"../../../../sections/messaging.js";const
|
|
1
|
+
import{CONTACT_KIND_NAMES as o,CONTACT_KINDS as C}from"../../../../sections/messaging.js";const N=C.map(t=>({label:o[t],value:t})),c="phone",e={label:"Contact cards",defaultProps:{title:"Who to ask",description:"",contacts:[]}};export{c as CONTACT_KIND_FALLBACK,N as CONTACT_KIND_OPTIONS,e as ContactCardsMeta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CONTACT_ROUTING_DEFAULTS as t}from"efficient-web-builder/format/lib/content/contact";const r={label:"Contact Form",
|
|
1
|
+
import{CONTACT_ROUTING_DEFAULTS as t}from"efficient-web-builder/format/lib/content/contact";const r={label:"Contact Form",defaultProps:{routingNumber:t.routingNumber,routingTagline:t.routingTagline,groups:t.groups,formSlug:"",formNumber:t.formNumber,formHeading:t.formHeading,metaItems:t.metaLines.map(e=>({text:e})),showOther:t.showOther,otherLabel:t.otherLabel,otherNoteTitle:t.otherNoteTitle,otherNoteBody:t.otherNoteBody,buttonText:t.buttonText,consent:t.consent,channels:t.channels}};export{r as ContactRoutingMeta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as y}from"react/jsx-runtime";import h,{readFacets as k,readTags as
|
|
1
|
+
import{jsx as y}from"react/jsx-runtime";import{phoneKey as h}from"efficient-easel/draw";import g,{readFacets as k,readTags as b}from"../../../../../components/Events.js";import{BLOCK_SOURCE_ROWS_PROP as x,declaredBlockSource as A,sourcedRows as E}from"efficient-web-builder/format/lib/content/block-sources";import{hidableText as S}from"efficient-easel/screen/lib/document/hidable";import{parseSectionHeadPlacement as T}from"efficient-web-builder/format/lib/sections/section-head-placement";import{phHide as m}from"efficient-web-builder/render/lib/document/blocks/scaffold";import{say as n}from"efficient-web-builder/format/lib/editor-words";import{EventsMeta as v,EVENTS_PH as u}from"./meta.js";const B=()=>[{key:"sample-1",title:n("First card"),excerpt:n("A line about it appears here.")},{key:"sample-2",title:n("Second card"),excerpt:n("A line about it appears here.")},{key:"sample-3",title:n("Third card"),excerpt:n("A line about it appears here.")},{key:"sample-4",title:n("Fourth card"),excerpt:n("A line about it appears here.")}],f=(e,i,a)=>({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||"#",...a?.facets?{facets:a.facets}:{},...a?.tags?{tags:a.tags}:{}});function P(e){const i=e[x],a=new Map,r=[];if(!Array.isArray(i))return{byKey:a,byIndex:r};for(const d of i){if(!d||typeof d!="object"||Array.isArray(d))continue;const t=d;if(!Object.values(t).some(s=>typeof s=="string"&&s))continue;const l={facets:k(t.facets),tags:b(t.tags)};r.push(l),typeof t.key=="string"&&t.key&&a.set(t.key,l)}return{byKey:a,byIndex:r}}const K={...v,render:e=>{const i=T(e.headPlacement)==="own-box",a=o=>i?void 0:o,r=m(e.linkText,u.link,e.editor),t=A(e)!==""?E(e,!!e.editor?.isEditing,B()):null,l=t&&!t.sample?P(e):null,s=t?t.sample?[]:t.rows.map((o,c)=>f(o,c,o.key?l?.byKey.get(o.key):l?.byIndex[c])):e.posts;return y(g,{num:a(m(e.num,u.num,e.editor)),title:a(m(e.title,u.title,e.editor)),link:a(r?{text:r,href:S(e.linkHref)||"/journal"}:void 0),omitHead:i,posts:s,sample:t?.sample?t.rows.map((o,c)=>f(o,c)):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,gapPhone:e[h("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.editor?.isEditing})}};export{K as EventsRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import{phoneKey as m}from"efficient-easel/draw";import i from"../../../../../components/FooterGroup.js";import{FooterGroupMeta as a}from"./meta.js";const d={...a,render:({direction:o,gap:r,align:e,blocks:t,...p})=>n(i,{direction:o,gap:r,gapPhone:p[m("gap")],align:e,content:t})};export{d as FooterGroupRender};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{FOOTER_PAYMENT_PH as
|
|
1
|
+
import{FOOTER_PAYMENT_PH as e}from"efficient-web-builder/format/lib/content/footer";const o=e.lead,a={label:"Payment Logos",defaultProps:{lead:o,methods:[],size:"sm",align:"left"}};export{o as FOOTER_PAYMENT_LEAD,a as FooterPaymentMeta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SOCIAL_GAP_DEFAULT as o}from"../../../../sections/footer-social-gap.js";import{DEFAULT_SOCIAL_ICON_STYLE as
|
|
1
|
+
import{SOCIAL_GAP_DEFAULT as o}from"../../../../sections/footer-social-gap.js";import{DEFAULT_SOCIAL_ICON_STYLE as e}from"efficient-web-builder/render/components/socialIcons";const l={label:"Social Logos",defaultProps:{iconStyle:e,iconSize:"medium",align:"left",gap:o}};export{l as FooterSocialMeta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{MESSAGING_SOURCE as
|
|
1
|
+
import{MESSAGING_SOURCE as s}from"../../../../sections/messaging.js";const a={label:"Messaging cards",defaultProps:{title:"Message us",description:"",dataSource:s}};export{a as MessagingCardsMeta};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="location-opening",
|
|
1
|
+
const e="location-opening",n=[{label:"Open now badge",value:"badge"},{label:"The week",value:"week"}],o="week",t={label:"Opening hours",defaultProps:{show:o,title:"Opening hours",dataSource:e}};export{n as OPENING_HOURS_SHOWS,o as OPENING_HOURS_SHOW_FALLBACK,e as OPENING_HOURS_SOURCE,t as OpeningHoursMeta};
|