efficient-storefront-blocks 0.60.0 → 0.62.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 +79 -1
- package/README.md +2 -1
- package/dist/chunks/{EditorPreviewCheckout-XY2PLPBD.js → EditorPreviewCheckout-BQFPYYBS.js} +1 -1
- package/dist/chunks/{SiteEditorProvider-XF374NLZ.js → SiteEditorProvider-3E6XWZIS.js} +1 -1
- package/dist/chunks/chunk-4BQ44OLC.js +250 -0
- package/dist/chunks/chunk-MT5KWSYX.js +1 -0
- package/dist/chunks/chunk-OJ4OD3N6.js +1 -0
- package/dist/chunks/{fitment-data-RORHKBID.js → fitment-data-PWZAAUFK.js} +1 -1
- package/dist/editor/components/EditorPreviewChat.js +4 -4
- package/dist/editor/components/PreviewHeader.d.ts +1 -1
- package/dist/editor/components/PreviewHeader.js +4 -4
- package/dist/editor/lib/efficient-backend.d.ts +1 -0
- package/dist/editor/lib/efficient-backend.js +1 -1
- package/dist/editor/lib/efficient-block-sources.d.ts +2 -0
- package/dist/editor/lib/efficient-block-sources.js +1 -0
- package/dist/editor/lib/puck/blocks/commerce/EuTyreLabelBlock/fields.d.ts +2 -0
- package/dist/editor/lib/puck/blocks/commerce/EuTyreLabelBlock/fields.js +1 -0
- package/dist/editor/lib/puck/blocks/commerce/ProductGallery/fields.d.ts +6 -0
- package/dist/editor/lib/puck/blocks/commerce/ProductGallery/fields.js +1 -0
- package/dist/editor/lib/puck/blocks/commerce/ProductHero/fields.js +1 -1
- package/dist/editor/lib/puck/blocks/commerce/index.d.ts +1 -1
- package/dist/editor/lib/puck/blocks/commerce/index.js +1 -1
- package/dist/editor/lib/puck/blocks/service/RatingBlock/fields.d.ts +2 -0
- package/dist/editor/lib/puck/blocks/service/RatingBlock/fields.js +1 -0
- package/dist/editor/lib/puck/blocks/service/index.d.ts +1 -1
- package/dist/editor/lib/puck/blocks/service/index.js +1 -1
- package/dist/editor/lib/puck/config.js +1 -1
- package/dist/editor/lib/storefront-editor-words.d.ts +1 -0
- package/dist/editor/lib/storefront-editor-words.js +1 -1
- package/dist/editor.css +1 -1
- package/dist/fitment.d.ts +56 -0
- package/dist/fitment.js +1 -0
- package/dist/index.d.ts +36 -6
- package/dist/index.js +101 -81
- package/dist/links.js +1 -1
- package/dist/render/app/globals.css +70 -14
- package/dist/render/built-with.json +1 -1
- package/dist/render/components/CartContext.d.ts +1 -0
- package/dist/render/components/CartContext.js +1 -1
- package/dist/render/components/CartDrawer.d.ts +0 -8
- package/dist/render/components/CartDrawer.js +2 -2
- package/dist/render/components/ChatWidget.js +1 -1
- package/dist/render/components/EuTyreLabels.d.ts +3 -0
- package/dist/render/components/EuTyreLabels.js +1 -1
- package/dist/render/components/FitmentTable.js +1 -1
- package/dist/render/components/FooterMenu.js +1 -1
- package/dist/render/components/FormBlock.js +1 -1
- package/dist/render/components/GalleryItem.js +1 -1
- package/dist/render/components/Header.js +1 -1
- package/dist/render/components/LegalLine.js +1 -1
- package/dist/render/components/PopupFrame.d.ts +2 -1
- package/dist/render/components/PopupFrame.js +1 -1
- package/dist/render/components/PopupHost.d.ts +17 -0
- package/dist/render/components/PopupHost.js +1 -0
- package/dist/render/components/ProductCard.js +1 -1
- package/dist/render/components/ProductGallery.d.ts +15 -0
- package/dist/render/components/ProductGallery.js +1 -0
- package/dist/render/components/ProductHeroPanel.js +1 -1
- package/dist/render/components/RatingStars.d.ts +4 -0
- package/dist/render/components/RatingStars.js +1 -0
- package/dist/render/components/Reviews.js +1 -1
- package/dist/render/components/StorefrontProviders.d.ts +1 -3
- package/dist/render/components/StorefrontProviders.js +1 -1
- package/dist/render/components/SubscribePopupContext.d.ts +3 -15
- package/dist/render/components/SubscribePopupContext.js +1 -1
- package/dist/render/components/TyrePlpCard.js +1 -1
- package/dist/render/components/WheelCardFrame.d.ts +3 -27
- package/dist/render/components/WheelCardFrame.js +1 -1
- package/dist/render/components/card-pieces/CardBuyButton.d.ts +7 -0
- package/dist/render/components/card-pieces/CardBuyButton.js +1 -0
- package/dist/render/components/card-pieces/CardFinishSwatches.d.ts +5 -0
- package/dist/render/components/card-pieces/CardFinishSwatches.js +1 -0
- package/dist/render/components/card-pieces/CardPrice.d.ts +7 -0
- package/dist/render/components/card-pieces/CardPrice.js +1 -0
- package/dist/render/components/card-pieces/CardProductBadge.d.ts +7 -0
- package/dist/render/components/card-pieces/CardProductBadge.js +1 -0
- package/dist/render/components/card-pieces/CardSizes.d.ts +9 -0
- package/dist/render/components/card-pieces/CardSizes.js +1 -0
- package/dist/render/components/card-pieces/ProductCardState.d.ts +53 -0
- package/dist/render/components/card-pieces/ProductCardState.js +1 -0
- package/dist/render/components/card-pieces/card-row.d.ts +20 -0
- package/dist/render/components/card-pieces/card-row.js +1 -0
- package/dist/render/components/cart/drawer-parts.d.ts +28 -0
- package/dist/render/components/cart/drawer-parts.js +1 -0
- package/dist/render/components/pdp-dynamic/DynamicEuTyreLabel.d.ts +3 -0
- package/dist/render/components/pdp-dynamic/DynamicEuTyreLabel.js +1 -1
- package/dist/render/components/pdp-dynamic/DynamicProductGallery.d.ts +9 -0
- package/dist/render/components/pdp-dynamic/DynamicProductGallery.js +1 -0
- package/dist/render/components/useHeaderBar.js +1 -1
- package/dist/render/components/useIsLightTheme.d.ts +1 -0
- package/dist/render/components/useIsLightTheme.js +1 -0
- package/dist/render/components/wheels-plp/AlloyWheelsListing.d.ts +2 -1
- package/dist/render/components/wheels-plp/AlloyWheelsListing.js +1 -1
- package/dist/render/components/wheels-plp/PlpCard.d.ts +3 -2
- package/dist/render/components/wheels-plp/PlpCard.js +1 -1
- package/dist/render/components/wheels-plp/usePlpCardSelection.d.ts +1 -1
- package/dist/render/components/wheels-plp/usePlpCardSelection.js +1 -1
- package/dist/render/components/wheels-plp/usePlpFiltersInUrl.d.ts +2 -1
- package/dist/render/components/wheels-plp/usePlpFiltersInUrl.js +1 -1
- package/dist/render/lib/api/index.d.ts +4 -2
- package/dist/render/lib/api/index.js +1 -1
- package/dist/render/lib/api/types.d.ts +48 -1
- package/dist/render/lib/chrome-load.d.ts +1 -1
- package/dist/render/lib/chrome-load.js +1 -1
- package/dist/render/lib/content/field-usage.d.ts +0 -1
- package/dist/render/lib/content/field-usage.js +1 -1
- package/dist/render/lib/content/product-hero.d.ts +1 -0
- package/dist/render/lib/content/product-hero.js +1 -1
- package/dist/render/lib/header-fit.d.ts +2 -0
- package/dist/render/lib/header-fit.js +1 -0
- package/dist/render/lib/popup/popup-stores.d.ts +2 -0
- package/dist/render/lib/popup/popup-stores.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/EuTyreLabelBlock/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/commerce/EuTyreLabelBlock/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/EuTyreLabelBlock/render.d.ts +2 -0
- package/dist/render/lib/puck/blocks/commerce/EuTyreLabelBlock/render.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/ProductGallery/meta.d.ts +2 -0
- package/dist/render/lib/puck/blocks/commerce/ProductGallery/meta.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/ProductGallery/render.d.ts +2 -0
- package/dist/render/lib/puck/blocks/commerce/ProductGallery/render.js +1 -0
- package/dist/render/lib/puck/blocks/commerce/metas.d.ts +2 -0
- package/dist/render/lib/puck/blocks/commerce/metas.js +1 -1
- package/dist/render/lib/puck/blocks/commerce/renders.d.ts +2 -0
- package/dist/render/lib/puck/blocks/commerce/renders.js +1 -1
- package/dist/render/lib/puck/blocks/service/RatingBlock/meta.d.ts +3 -0
- package/dist/render/lib/puck/blocks/service/RatingBlock/meta.js +1 -0
- package/dist/render/lib/puck/blocks/service/RatingBlock/render.d.ts +2 -0
- package/dist/render/lib/puck/blocks/service/RatingBlock/render.js +1 -0
- package/dist/render/lib/puck/blocks/service/metas.d.ts +1 -0
- package/dist/render/lib/puck/blocks/service/metas.js +1 -1
- package/dist/render/lib/puck/blocks/service/renders.d.ts +1 -0
- package/dist/render/lib/puck/blocks/service/renders.js +1 -1
- package/dist/render/lib/puck/lazy-draws.js +1 -1
- package/dist/render/lib/storefront-page-groups.js +1 -1
- package/dist/render/lib/wheels/fitment-columns.d.ts +6 -1
- package/dist/render/lib/wheels/fitment-columns.js +1 -1
- package/dist/render/lib/wheels/plp-fitment-match.d.ts +4 -0
- package/dist/render/lib/wheels/plp-fitment-match.js +1 -1
- package/dist/render/lib/wheels/plp-hydrate.d.ts +2 -0
- package/dist/render/lib/wheels/plp-hydrate.js +1 -1
- package/dist/render/lib/wheels/spec-sheet.js +1 -1
- package/dist/words.d.ts +2 -2
- package/dist/words.js +3 -3
- package/package.json +11 -4
- package/dist/chunks/chunk-EZQTUHPN.js +0 -1
- package/dist/chunks/chunk-FCCEAXMM.js +0 -1
- package/dist/chunks/chunk-YNI65Q6Z.js +0 -250
- package/dist/render/components/wheels-plp/useWheelCardBottom.d.ts +0 -20
- package/dist/render/components/wheels-plp/useWheelCardBottom.js +0 -1
- package/dist/render/lib/popup/popup-rules.d.ts +0 -25
- package/dist/render/lib/popup/popup-rules.js +0 -1
- /package/dist/chunks/{chunk-YNI65Q6Z.js.LEGAL.txt → chunk-4BQ44OLC.js.LEGAL.txt} +0 -0
- /package/dist/chunks/{chunk-VT346MLP.js → chunk-FZFBLN7K.js} +0 -0
- /package/dist/chunks/{chunk-I6VNNXUI.js → chunk-TRUOK5AD.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{PREVIEW_TOKEN_HEADER as Y,SITE_HOST_HEADER as tt,SITE_SLUG_HEADER as et}from"../site-headers.js";import{PRODUCT_API_BASE as rt,PRODUCT_BACKEND_URL as k}from"./origins.js";import{backendHopHeaders as at,clientIpFromForwardedFor as st,FORWARDED_FOR_HEADER as nt,hopCachingOf as ot}from"../forwarded-for.js";import it from"efficient-web-builder/format/lib/puck/media-manifest.json";import{auth as P}from"../auth.js";import{efficientClientOpen as ct}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 dt=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 _="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.",ut=new Set([502,503,504]),N=0,lt="This editor runs on its host's own backend, which does not serve this request.",pt=5e3,yt=15e3,ht=()=>typeof window>"u"?pt:yt;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(ht())}const x=t=>t instanceof Error&&t.name==="TimeoutError",H=(t,e)=>ut.has(t)?_:e,ft=["admin","venue"];let F="admin";function ae(t){F=ft.includes(t)?t:"admin"}function gt(){return F}const mt=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let M=null;function se(t){M=t&&mt.test(t)?t:null}function wt(){return M}function St(t){if(typeof window>"u"||!t.startsWith("/api/v1/"))return t;const e=j();return!e||/[?&]site=/.test(t)?t:C(t,`site=${encodeURIComponent(e)}`)}async function i(t,e={}){const{token:s,baseUrl:o,headers:l,audience:p,...w}=e;if(typeof window<"u"&&!ct())throw new m(N,lt,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??dt}${St(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(N,_,null):y}let n;try{n=await r.text()}catch(y){throw x(y)?new m(N,_,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=Pt().finally(()=>{b=null}),b)}async function Pt(){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 bt,absolutizeApiUrl as v}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as Tt,isSvgUrl as At}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as Rt}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Et,webRuntimeSiteSlug as j}from"efficient-web-builder/format/lib/web-runtime";function g(t){if(typeof t=="string")return t.startsWith("/media/")?bt(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 ge}from"./origins.js";const z=typeof window>"u"&&k!=="",Ct=z?k:rt,$t=Et,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 _t(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 It=t=>t instanceof m&&t.status===400;function kt(t){return t.flatMap(e=>e.kind==="alloy-wheel"?J([e]):[e])}async function Z(){return(await Jt()).host}async function Jt(){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(tt)??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 Lt(){try{const{headers:t}=await import("next/headers");return st((await t()).get(nt))}catch{return null}}async function Dt(){try{const{headers:t}=await import("next/headers");return(await t()).get(et)||null}catch{return null}}async function xt(){const t=await Dt();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?C(t,`site=${encodeURIComponent(e)}`):t}return C(t,await xt())}function C(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const Ht="preview";async function Ft(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(Y)}catch{return null}}async function Mt(){try{const{headers:t}=await import("next/headers");return(await t()).get("user-agent")}catch{return null}}async function I(t,e){const s=await Ft();if(s===null)return[await f(t),await u(e)];const o=C(await f(t),`${Ht}=${encodeURIComponent(s)}`),{next:l,cache:p,...w}=e??{},a=await u({...w,cache:"no-store"}),r=await Mt();return r&&(a.headers={...a.headers,"user-agent":r}),[o,a]}async function Bt(t){if(!z)return;const[e,s]=await Promise.all([Z(),Lt()]),o=at(e,s,t);return Object.keys(o).length>0?o:void 0}async function u(t){const e=await Bt(ot(t)),s={baseUrl:Ct,...t};return e&&(s.headers={...e,...t?.headers}),s}const T=typeof window>"u";function A(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 de={listMakes:async t=>{if(T){const{fitmentData:s}=await import("./fitment-data.js");return s.makes(t)}return(await i(A("/makes",{region:t}),O())).results},listModels:async(t,e)=>{if(T){const{fitmentData:o}=await import("./fitment-data.js");return o.models(t,e)}return(await i(A("/models",{make:t,region:e}),O())).results},listYears:async(t,e,s)=>{if(T){const{fitmentData:l}=await import("./fitment-data.js");return l.years(t,e,s)}return(await i(A("/years",{make:t,model:e,region:s}),O())).results},listModifications:async(t,e,s,o)=>{if(T){const{fitmentData:p}=await import("./fitment-data.js");return p.modifications(t,e,s,o)}return(await i(A("/modifications",{make:t,model:e,year:s,region:o}),O())).results},getStockFitment:async(t,e,s,o,l)=>{if(T){const{fitmentData:p}=await import("./fitment-data.js");return p.stockFitment(t,e,s,o,l)}return i(A("/stock-fitment",{make:t,model:e,year:s,modification:o,region:l}),O())}},ue={listWheels:async t=>{const e=await X("products.listWheels",async s=>await f(_t(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)),It);return kt(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}`:""}`,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())),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 I(d(`/pages/${t}`)+s,e.revalidate!==void 0?{next:{revalidate:e.revalidate}}:void 0);return g(await i(o,l))},listBlogPosts:async()=>{try{return(await i(d("/blog-posts"),await u())).map(e=>({...e,coverImage:v(e.coverImage)??""}))}catch(t){return console.warn("[products.listBlogPosts] blog API unavailable, returning []",t),[]}},getBlogPost:async t=>{const e=await i(d(`/blog-posts/${t}`),await u());return{...e,coverImage:v(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 I(d("/header-settings"),{signal:t})),s=v(e.logoUrl);let o=null,l=null;if(s&&At(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 I(d("/theme-settings"))),getChatSettings:async()=>i(await f(d("/chat-settings")),await u())},le={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 qt 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 $=(t,e,s)=>{const o=new URLSearchParams({...e?{site:e}:{},...s?{draft:"1"}:{}}).toString();return`/api/storefront/${t}/${o?`?${o}`:""}`},R=t=>`/api/storefront/sites/${encodeURIComponent(t)}/`,Gt=t=>`${R(t)}currencies/`,Wt="/api/storefront/media/ingest/";class jt 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 zt(){const t=Rt();if(!t)throw new jt;return`${Wt}?${new URLSearchParams({site:t})}`}const U={"X-Puck-Media-Manifest":it.contentHash},pe=Q({});function Q(t){return(e,s={})=>{const o=wt(),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??gt()})}}function Kt(t={}){const e=Q(t),s=t.siteDrafts===!0,o=a=>$("header-settings",a,s),l=a=>$("theme-settings",a,s),p=a=>$("chat-settings",a,s),w=a=>$("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 qt(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}),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:U,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:U,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:U,token:n}),saveTemplatePageLayout:(a,r,n)=>e(`/api/storefront/template-pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:U,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,E)=>S.sort_order-E.sort_order||S.name.localeCompare(E.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,E)=>S.title.localeCompare(E.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(R(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(Gt(a),{token:r});return Array.isArray(n)?n:[]},publishSite:(a,r)=>e(`${R(a)}publish/`,{method:"POST",token:r}),getSiteLiveState:(a,r)=>e(`${R(a)}live-state/`,{token:r}),updateSite:(a,r,n)=>e(R(a),{method:"PATCH",body:JSON.stringify(r),token:n}),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(zt(),{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 ye=Kt({siteDrafts:!0});export{dt as API_URL,qt as AmbiguousPageSlugError,m as ApiError,yt as BROWSER_READ_TIMEOUT_MS,lt as EFFICIENT_CLIENT_CLOSED_MESSAGE,jt as MediaUploadDestinationError,Ht as PREVIEW_PARAM,ge as PRODUCT_API_BASE,pt as SERVER_READ_TIMEOUT_MS,_ as SERVER_UNREACHABLE_MESSAGE,N as STATUS_NETWORK_ERROR,pe as adminFetch,Ot as api,i as apiFetch,C as appendSiteQuery,le as bookings,Kt as createStorefrontAdmin,D as defaultRequestDeadline,zt as editorMediaUploadPath,gt as editorPortalAudience,wt as editorRequestLanguage,de as fitment,ue as products,ht as readDeadlineMs,Lt as resolveClientIp,g as resolveMediaUrls,Ft as resolvePreviewToken,Z as resolveSiteHost,Jt as resolveSiteHostSource,Dt as resolveSiteSlug,se as setEditorLanguage,ae as setEditorPortalAudience,ye as storefrontAdmin};
|
|
1
|
+
import{PREVIEW_TOKEN_HEADER as Y,SITE_HOST_HEADER as tt,SITE_SLUG_HEADER as et}from"../site-headers.js";import{PRODUCT_API_BASE as rt,PRODUCT_BACKEND_URL as k}from"./origins.js";import{backendHopHeaders as at,clientIpFromForwardedFor as st,FORWARDED_FOR_HEADER as nt,hopCachingOf as ot}from"../forwarded-for.js";import it from"efficient-web-builder/format/lib/puck/media-manifest.json";import{auth as P}from"../auth.js";import{efficientClientOpen as ct}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 dt=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 _="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.",ut=new Set([502,503,504]),N=0,lt="This editor runs on its host's own backend, which does not serve this request.",pt=5e3,yt=15e3,ht=()=>typeof window>"u"?pt:yt;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(ht())}const x=t=>t instanceof Error&&t.name==="TimeoutError",H=(t,e)=>ut.has(t)?_:e,ft=["admin","venue"];let F="admin";function ae(t){F=ft.includes(t)?t:"admin"}function gt(){return F}const mt=/^[A-Za-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$/;let M=null;function se(t){M=t&&mt.test(t)?t:null}function wt(){return M}function St(t){if(typeof window>"u"||!t.startsWith("/api/v1/"))return t;const e=j();return!e||/[?&]site=/.test(t)?t:C(t,`site=${encodeURIComponent(e)}`)}async function i(t,e={}){const{token:s,baseUrl:o,headers:l,audience:p,...w}=e;if(typeof window<"u"&&!ct())throw new m(N,lt,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??dt}${St(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(N,_,null):y}let n;try{n=await r.text()}catch(y){throw x(y)?new m(N,_,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 q(){return b||(b=Pt().finally(()=>{b=null}),b)}async function Pt(){const t=P.takeLegacyRefresh(),e=await Ot.refresh(t??void 0);return P.setTokens(e.access),e.access}async function B(){return P.getAccess()??q()}async function h(t,e={}){let s;try{s=await B()}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 q();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 B();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 bt,absolutizeApiUrl as v}from"efficient-web-builder/render/lib/media";import{analyzeLogoSvg as Tt,isSvgUrl as At}from"efficient-web-builder/format/lib/logo/reverse-svg";import{getEditorSiteId as Rt}from"efficient-web-builder/render/lib/editor-site";import{shopRouteBase as Et,webRuntimeSiteSlug as j}from"efficient-web-builder/format/lib/web-runtime";function g(t){if(typeof t=="string")return t.startsWith("/media/")?bt(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 ge}from"./origins.js";const z=typeof window>"u"&&k!=="",Ct=z?k:rt,$t=Et,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 _t(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 It=t=>t instanceof m&&t.status===400;function kt(t){return t.flatMap(e=>e.kind==="alloy-wheel"?J([e]):[e])}async function Z(){return(await Jt()).host}async function Jt(){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(tt)??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 Lt(){try{const{headers:t}=await import("next/headers");return st((await t()).get(nt))}catch{return null}}async function Dt(){try{const{headers:t}=await import("next/headers");return(await t()).get(et)||null}catch{return null}}async function xt(){const t=await Dt();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?C(t,`site=${encodeURIComponent(e)}`):t}return C(t,await xt())}function C(t,e){return e?`${t}${t.includes("?")?"&":"?"}${e}`:t}const Ht="preview";async function Ft(){if(typeof window<"u")return null;try{const{headers:t}=await import("next/headers");return(await t()).get(Y)}catch{return null}}async function Mt(){try{const{headers:t}=await import("next/headers");return(await t()).get("user-agent")}catch{return null}}async function I(t,e){const s=await Ft();if(s===null)return[await f(t),await u(e)];const o=C(await f(t),`${Ht}=${encodeURIComponent(s)}`),{next:l,cache:p,...w}=e??{},a=await u({...w,cache:"no-store"}),r=await Mt();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(),Lt()]),o=at(e,s,t);return Object.keys(o).length>0?o:void 0}async function u(t){const e=await qt(ot(t)),s={baseUrl:Ct,...t};return e&&(s.headers={...e,...t?.headers}),s}const T=typeof window>"u";function A(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 de={listMakes:async t=>{if(T){const{fitmentData:s}=await import("./fitment-data.js");return s.makes(t)}return(await i(A("/makes",{region:t}),O())).results},listModels:async(t,e)=>{if(T){const{fitmentData:o}=await import("./fitment-data.js");return o.models(t,e)}return(await i(A("/models",{make:t,region:e}),O())).results},listYears:async(t,e,s)=>{if(T){const{fitmentData:l}=await import("./fitment-data.js");return l.years(t,e,s)}return(await i(A("/years",{make:t,model:e,region:s}),O())).results},listModifications:async(t,e,s,o)=>{if(T){const{fitmentData:p}=await import("./fitment-data.js");return p.modifications(t,e,s,o)}return(await i(A("/modifications",{make:t,model:e,year:s,region:o}),O())).results},getStockFitment:async(t,e,s,o,l)=>{if(T){const{fitmentData:p}=await import("./fitment-data.js");return p.stockFitment(t,e,s,o,l)}return i(A("/stock-fitment",{make:t,model:e,year:s,modification:o,region:l}),O())}},ue={listWheels:async t=>{const e=await X("products.listWheels",async s=>await f(_t(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)),It);return kt(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}`:""}`,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 I(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:v(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:v(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 I(d("/header-settings"),{signal:t})),s=v(e.logoUrl);let o=null,l=null;if(s&&At(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 I(d("/theme-settings"))),getChatSettings:async()=>i(await f(d("/chat-settings")),await u())},le={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 Bt 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 $=(t,e,s)=>{const o=new URLSearchParams({...e?{site:e}:{},...s?{draft:"1"}:{}}).toString();return`/api/storefront/${t}/${o?`?${o}`:""}`},R=t=>`/api/storefront/sites/${encodeURIComponent(t)}/`,Gt=t=>`${R(t)}currencies/`,Wt="/api/storefront/media/ingest/";class jt 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 zt(){const t=Rt();if(!t)throw new jt;return`${Wt}?${new URLSearchParams({site:t})}`}const U={"X-Puck-Media-Manifest":it.contentHash},pe=Q({});function Q(t){return(e,s={})=>{const o=wt(),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??gt()})}}function Kt(t={}){const e=Q(t),s=t.siteDrafts===!0,o=a=>$("header-settings",a,s),l=a=>$("theme-settings",a,s),p=a=>$("chat-settings",a,s),w=a=>$("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 Bt(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}),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:U,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:U,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:U,token:n}),saveTemplatePageLayout:(a,r,n)=>e(`/api/storefront/template-pages/${a}/`,{method:"PATCH",body:JSON.stringify({layout:r}),headers:U,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,E)=>S.sort_order-E.sort_order||S.name.localeCompare(E.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,E)=>S.title.localeCompare(E.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(R(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(Gt(a),{token:r});return Array.isArray(n)?n:[]},publishSite:(a,r)=>e(`${R(a)}publish/`,{method:"POST",token:r}),getSiteLiveState:(a,r)=>e(`${R(a)}live-state/`,{token:r}),updateSite:(a,r,n)=>e(R(a),{method:"PATCH",body:JSON.stringify(r),token:n}),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(zt(),{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 ye=Kt({siteDrafts:!0});export{dt as API_URL,Bt as AmbiguousPageSlugError,m as ApiError,yt as BROWSER_READ_TIMEOUT_MS,lt as EFFICIENT_CLIENT_CLOSED_MESSAGE,jt as MediaUploadDestinationError,Ht as PREVIEW_PARAM,ge as PRODUCT_API_BASE,pt as SERVER_READ_TIMEOUT_MS,_ as SERVER_UNREACHABLE_MESSAGE,N as STATUS_NETWORK_ERROR,pe as adminFetch,Ot as api,i as apiFetch,C as appendSiteQuery,le as bookings,Kt as createStorefrontAdmin,D as defaultRequestDeadline,zt as editorMediaUploadPath,gt as editorPortalAudience,wt as editorRequestLanguage,de as fitment,ue as products,ht as readDeadlineMs,Lt as resolveClientIp,g as resolveMediaUrls,Ft as resolvePreviewToken,Z as resolveSiteHost,Jt as resolveSiteHostSource,Dt as resolveSiteSlug,se as setEditorLanguage,ae as setEditorPortalAudience,ye as storefrontAdmin};
|
|
@@ -287,6 +287,22 @@ export interface paths {
|
|
|
287
287
|
patch?: never;
|
|
288
288
|
trace?: never;
|
|
289
289
|
};
|
|
290
|
+
"/popups": {
|
|
291
|
+
parameters: {
|
|
292
|
+
query?: never;
|
|
293
|
+
header?: never;
|
|
294
|
+
path?: never;
|
|
295
|
+
cookie?: never;
|
|
296
|
+
};
|
|
297
|
+
get: operations["listPopups"];
|
|
298
|
+
put?: never;
|
|
299
|
+
post?: never;
|
|
300
|
+
delete?: never;
|
|
301
|
+
options?: never;
|
|
302
|
+
head?: never;
|
|
303
|
+
patch?: never;
|
|
304
|
+
trace?: never;
|
|
305
|
+
};
|
|
290
306
|
"/dynamic-pages": {
|
|
291
307
|
parameters: {
|
|
292
308
|
query?: never;
|
|
@@ -1409,6 +1425,13 @@ export interface components {
|
|
|
1409
1425
|
title: string;
|
|
1410
1426
|
seoTitle: string;
|
|
1411
1427
|
};
|
|
1428
|
+
PopupStub: {
|
|
1429
|
+
slug: string;
|
|
1430
|
+
title: string;
|
|
1431
|
+
settings: {
|
|
1432
|
+
[key: string]: unknown;
|
|
1433
|
+
};
|
|
1434
|
+
};
|
|
1412
1435
|
Page: {
|
|
1413
1436
|
slug: string;
|
|
1414
1437
|
title: string;
|
|
@@ -2603,6 +2626,28 @@ export interface operations {
|
|
|
2603
2626
|
};
|
|
2604
2627
|
};
|
|
2605
2628
|
};
|
|
2629
|
+
listPopups: {
|
|
2630
|
+
parameters: {
|
|
2631
|
+
query?: {
|
|
2632
|
+
site?: components["parameters"]["SiteSlug"];
|
|
2633
|
+
host?: components["parameters"]["SiteHost"];
|
|
2634
|
+
};
|
|
2635
|
+
header?: never;
|
|
2636
|
+
path?: never;
|
|
2637
|
+
cookie?: never;
|
|
2638
|
+
};
|
|
2639
|
+
requestBody?: never;
|
|
2640
|
+
responses: {
|
|
2641
|
+
200: {
|
|
2642
|
+
headers: {
|
|
2643
|
+
[name: string]: unknown;
|
|
2644
|
+
};
|
|
2645
|
+
content: {
|
|
2646
|
+
"application/json": components["schemas"]["PopupStub"][];
|
|
2647
|
+
};
|
|
2648
|
+
};
|
|
2649
|
+
};
|
|
2650
|
+
};
|
|
2606
2651
|
listDynamicPages: {
|
|
2607
2652
|
parameters: {
|
|
2608
2653
|
query?: {
|
|
@@ -2723,7 +2768,9 @@ export interface operations {
|
|
|
2723
2768
|
};
|
|
2724
2769
|
listBlogPosts: {
|
|
2725
2770
|
parameters: {
|
|
2726
|
-
query?:
|
|
2771
|
+
query?: {
|
|
2772
|
+
category?: string;
|
|
2773
|
+
};
|
|
2727
2774
|
header?: never;
|
|
2728
2775
|
path?: never;
|
|
2729
2776
|
cookie?: never;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const CHROME_LOAD_NAMES: readonly ["footer", "subscribe", "cartDrawer", "consentBanner", "header", "site", "theme", "chat"];
|
|
1
|
+
export declare const CHROME_LOAD_NAMES: readonly ["footer", "subscribe", "cartDrawer", "consentBanner", "popups", "header", "site", "theme", "chat"];
|
|
2
2
|
export type ChromeLoadName = (typeof CHROME_LOAD_NAMES)[number];
|
|
3
3
|
export declare const CHROME_ABSENT_STATUS = 404;
|
|
4
4
|
export type ChromeLoadOutcome = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ApiError as a}from"./api/index.js";const c=["footer","subscribe","cartDrawer","consentBanner","header","site","theme","chat"],i=404;function u(t){if(t instanceof a&&t.status===i)return{state:"absent"};const e=t instanceof a?t.status:-1,r=t instanceof Error?t.message:String(t);return{state:"failed",status:e,detail:r}}const f="[storefront:chrome-load-failed]";function d(t,e){console.error(`${f} ${t} status=${e.status} — serving fallback chrome`,e.detail)}async function h(t,e,r,s){try{const o=await e();return s?.(o)?{value:o,outcome:{state:"absent"}}:{value:o,outcome:{state:"ok"}}}catch(o){const n=u(o);return n.state==="failed"&&d(t,n),{value:r,outcome:n}}}const E=t=>({value:t,outcome:{state:"ok"}});function x(t){return c.filter(e=>t[e]?.state==="failed")}function l(t){return t.length>0?t.join(","):void 0}function O(t){const e=l(t);return e===void 0?{}:{"data-sf-chrome-failed":e}}function
|
|
1
|
+
import{ApiError as a}from"./api/index.js";const c=["footer","subscribe","cartDrawer","consentBanner","popups","header","site","theme","chat"],i=404;function u(t){if(t instanceof a&&t.status===i)return{state:"absent"};const e=t instanceof a?t.status:-1,r=t instanceof Error?t.message:String(t);return{state:"failed",status:e,detail:r}}const f="[storefront:chrome-load-failed]";function d(t,e){console.error(`${f} ${t} status=${e.status} — serving fallback chrome`,e.detail)}async function h(t,e,r,s){try{const o=await e();return s?.(o)?{value:o,outcome:{state:"absent"}}:{value:o,outcome:{state:"ok"}}}catch(o){const n=u(o);return n.state==="failed"&&d(t,n),{value:r,outcome:n}}}const E=t=>({value:t,outcome:{state:"ok"}});function x(t){return c.filter(e=>t[e]?.state==="failed")}function l(t){return t.length>0?t.join(","):void 0}function O(t){const e=l(t);return e===void 0?{}:{"data-sf-chrome-failed":e}}function p(t){return t==="production"?"silent":"banner"}const _=p(process.env.NODE_ENV);export{i as CHROME_ABSENT_STATUS,f as CHROME_LOAD_FAILED_TOKEN,c as CHROME_LOAD_NAMES,_ as CHROME_SIGNAL_MODE,l as chromeFailedAttr,O as chromeFailedProps,x as chromeLoadFailures,E as chromeLoadOk,p as chromeSignalMode,u as classifyChromeLoadError,h as loadChrome,d as reportChromeLoadFailure};
|
|
@@ -18,7 +18,6 @@ export declare function applyCardAnswers<T extends {
|
|
|
18
18
|
}>(facts: readonly T[], answers: readonly FieldUsageAnswer[]): readonly T[];
|
|
19
19
|
export declare function answerOrder(answers: readonly FieldUsageAnswer[], place: "filter" | "card"): (fieldKey: string | undefined) => number | undefined;
|
|
20
20
|
export declare function keepForSpec(answers: readonly FieldUsageAnswer[]): (fieldKey: string | undefined) => boolean;
|
|
21
|
-
export declare function keepForFitment(answers: readonly FieldUsageAnswer[]): (fieldKey: string | undefined) => boolean;
|
|
22
21
|
export declare function applySpecAnswers<T extends {
|
|
23
22
|
fieldKey?: string;
|
|
24
23
|
}>(rows: T[], answers: readonly FieldUsageAnswer[]): T[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function g(e,n){return e.length===0?e:e.filter(o=>o.kind===void 0||o.kind===n)}function k(e,n){if(n.length===0)return e;const o=y(n);return s(e.filter(r=>o(r.fieldKey)),r=>r.fieldKey,n,"cardOrder")}function K(e,n){const o=n==="filter"?"filterOrder":"cardOrder",r=new Map;for(const t of e){const d=t[o];if(typeof d!="number"||!Number.isFinite(d))continue;const l=r.get(t.fieldKey);(l===void 0||d<l)&&r.set(t.fieldKey,d)}return t=>t?r.get(t):void 0}function a(e){return c(e,"spec")}function w(e,n){if(n.length===0)return e;const o=a(n),r=e.filter(t=>o(t.fieldKey));return s(r,t=>t.fieldKey,n,"specOrder")}function s(e,n,o,r){const t=new Map;for(const i of o){const f=i[r];typeof f=="number"&&t.set(i.fieldKey,f)}if(t.size===0)return e;const d=[],l=[];e.forEach((i,f)=>{const p=n(i);p&&(d.push(f),l.push({item:i,index:f,order:t.get(p)}))}),l.sort((i,f)=>i.order!==void 0&&f.order!==void 0?i.order-f.order||i.index-f.index:i.order!==void 0?-1:f.order!==void 0?1:i.index-f.index);const u=[...e];return d.forEach((i,f)=>{u[i]=l[f].item}),u.every((i,f)=>i===e[f])?e:u}function y(e){return c(e,"card")}function F(e){return c(e,"filter")}const h="collection";function m(e,n){return{tyreSizes:{},brands:{"alloy-wheel":"brand",tyre:"brand"},finishes:{"alloy-wheel":"wheel_finish_ref"},diameters:{"alloy-wheel":"diameter",tyre:"rim_diameter"},collections:{"alloy-wheel":h},pcds:{"alloy-wheel":"pcd"},tyreTypes:{tyre:"tire_type"},speedRatings:{tyre:"speed_rating"}}[e]?.[n]}function x(e){return{size:"size",finish:"wheel_finish_ref",loadIndex:"load_index",speedRating:"speed_rating",tyreType:"tire_type",boltPattern:"bolt_pattern",et:"et",centreBore:"center_bore"}[e]}function _(e,n,o){const r=x(e);if(!r)return n;const t=o.find(d=>d.fieldKey===r)?.variant;return t===void 0?n:t==="none"?null:t}function O(e,n){if(n.length===0)return e;const o=[];let r=!1;for(const t of e){const d=_(t.key,t.role,n);if(d===null){r=!0;continue}if(d===t.role){o.push(t);continue}r=!0,o.push({...t,role:d})}return r?o:e}function c(e,n){const o=new Set(e.filter(r=>r[n]===!1).map(r=>r.fieldKey));return r=>!r||!o.has(r)}export{h as COLLECTION_FIELD_KEY,K as answerOrder,g as answersForKind,k as applyCardAnswers,w as applySpecAnswers,O as applyVariantAnswers,m as facetFieldKey,y as keepForCard,F as keepForFilter,a as keepForSpec,x as optionFieldKey,s as orderByAnswers,_ as variantRoleFor};
|
|
@@ -8,6 +8,7 @@ export interface ProductHeroContent {
|
|
|
8
8
|
export declare const PRODUCT_HERO_BULLETS_PROP = "heroBullets";
|
|
9
9
|
export declare const HERO_BULLET_SEPARATOR = "\u00B7";
|
|
10
10
|
export declare const PRODUCT_HERO_DEFAULTS: ProductHeroContent;
|
|
11
|
+
export declare const HERO_BULLET_EXAMPLE: ProductHeroBullet;
|
|
11
12
|
export declare function heroBulletLine(bullet: ProductHeroBullet): string;
|
|
12
13
|
export declare function parseHeroBullet(line: string): ProductHeroBullet | null;
|
|
13
14
|
export declare function resolveProductHeroContent(rootProps: Record<string, unknown> | undefined | null): ProductHeroContent;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{authoredString as
|
|
1
|
+
import{authoredString as o}from"efficient-web-builder/format/lib/content/authored-props";const i="heroBullets",n="·",s={bullets:[]},c={label:"Free shipping",detail:"USA, UK, AUS"};function p(t){return t.detail?`${t.label} ${n} ${t.detail}`:t.label}function a(t){const e=t.trim();if(!e)return null;const l=e.indexOf(n);return l<0?{label:e,detail:""}:{label:e.slice(0,l).trim(),detail:e.slice(l+n.length).trim()}}function E(t){const e=(t??{})[i];return Array.isArray(e)?{bullets:e.map(r=>a(typeof r=="string"?r:o(r?.text,""))).filter(r=>r!==null)}:s}export{c as HERO_BULLET_EXAMPLE,n as HERO_BULLET_SEPARATOR,i as PRODUCT_HERO_BULLETS_PROP,s as PRODUCT_HERO_DEFAULTS,p as heroBulletLine,a as parseHeroBullet,E as resolveProductHeroContent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const i="data-header-fit",f=.5;function l(e){e.removeAttribute(i);const n=e.ownerDocument.defaultView;if(!n)return!1;let o=!1;for(const t of e.querySelectorAll("[data-header-band]")){if(n.getComputedStyle(t).display==="none")continue;const r=t.parentElement?.clientWidth??0,s=t.style.width;t.style.width="max-content";const d=t.offsetWidth;if(t.style.width=s,d>r+.5){o=!0;break}}return o&&e.setAttribute(i,"phone"),o}export{i as HEADER_FIT_ATTR,l as fitHeaderToRow};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{safeLocalStorage as o,safeSessionStorage as s}from"efficient-web-builder/format/lib/safe-storage";const a={session:s,local:o};export{a as POPUP_STORES};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={label:"EU Tyre Label"};export{e as EuTyreLabelBlockMeta};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import{DynamicEuTyreLabelBlock as o}from"../../../../../components/pdp-dynamic/DynamicEuTyreLabel.js";import{EuTyreLabelBlockMeta as i}from"./meta.js";const c={...i,render:e=>r(o,{editing:e.puck?.isEditing})};export{c as EuTyreLabelBlockRender};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DEFAULT_HERO_GALLERY_MODE as e,DEFAULT_HERO_IMAGE_FIT as l}from"../../../../sections/hero-gallery.js";const o={label:"Product Gallery",defaultProps:{galleryMode:e,imageFit:l}};export{o as ProductGalleryMeta};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as r}from"react/jsx-runtime";import o from"../../../../../components/pdp-dynamic/DynamicProductGallery.js";import{parseHeroGalleryMode as i,parseHeroImageFit as t}from"../../../../sections/hero-gallery.js";import{ProductGalleryMeta as a}from"./meta.js";const y={...a,render:e=>r(o,{editing:e.puck?.isEditing,galleryMode:i(e.galleryMode),imageFit:t(e.imageFit)})};export{y as ProductGalleryRender};
|
|
@@ -13,12 +13,14 @@ export declare const COMMERCE_METAS: {
|
|
|
13
13
|
DeliveryOptions: Omit<BlockRender, "render">;
|
|
14
14
|
DetailRows: Omit<BlockRender, "render">;
|
|
15
15
|
EuTyreLabel: Omit<BlockRender, "render">;
|
|
16
|
+
EuTyreLabelBlock: Omit<BlockRender, "render">;
|
|
16
17
|
FitmentFinder: Omit<BlockRender, "render">;
|
|
17
18
|
FitmentTable: Omit<BlockRender, "render">;
|
|
18
19
|
Gallery: Omit<BlockRender, "render">;
|
|
19
20
|
GalleryB: Omit<BlockRender, "render">;
|
|
20
21
|
GalleryItem: Omit<BlockRender, "render">;
|
|
21
22
|
Header: Omit<BlockRender, "render">;
|
|
23
|
+
ProductGallery: Omit<BlockRender, "render">;
|
|
22
24
|
ProductGrid: Omit<BlockRender, "render">;
|
|
23
25
|
ProductHero: Omit<BlockRender, "render">;
|
|
24
26
|
ProductRef: Omit<BlockRender, "render">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AccountBlockMeta as t}from"./AccountBlock/meta.js";import{AlloyWheelsListingMeta as e}from"./AlloyWheelsListing/meta.js";import{BundleOfferMeta as r}from"./BundleOffer/meta.js";import{CartBlockMeta as o}from"./CartBlock/meta.js";import{CatalogFilterBarMeta as m}from"./CatalogFilterBar/meta.js";import{CheckoutCTAMeta as
|
|
1
|
+
import{AccountBlockMeta as t}from"./AccountBlock/meta.js";import{AlloyWheelsListingMeta as e}from"./AlloyWheelsListing/meta.js";import{BundleOfferMeta as r}from"./BundleOffer/meta.js";import{CartBlockMeta as o}from"./CartBlock/meta.js";import{CatalogFilterBarMeta as m}from"./CatalogFilterBar/meta.js";import{CheckoutCTAMeta as a}from"./CheckoutCTA/meta.js";import{CollectionCardMeta as i}from"./CollectionCard/meta.js";import{CollectionsMeta as l}from"./Collections/meta.js";import{CompatibleTyresMeta as c}from"./CompatibleTyres/meta.js";import{CountrySwitchBlockMeta as p}from"./CountrySwitchBlock/meta.js";import{DeliveryOptionsMeta as f}from"./DeliveryOptions/meta.js";import{DetailRowsMeta as M}from"./DetailRows/meta.js";import{EuTyreLabelMeta as y}from"./EuTyreLabel/meta.js";import{EuTyreLabelBlockMeta as n}from"./EuTyreLabelBlock/meta.js";import{FitmentFinderMeta as d}from"./FitmentFinder/meta.js";import{FitmentTableMeta as u}from"./FitmentTable/meta.js";import{GalleryBMeta as C}from"./GalleryB/meta.js";import{GalleryItemMeta as T}from"./GalleryItem/meta.js";import{GalleryMeta as B}from"./Gallery/meta.js";import{HeaderMeta as s}from"./Header/meta.js";import{ProductGalleryMeta as k}from"./ProductGallery/meta.js";import{ProductGridMeta as h}from"./ProductGrid/meta.js";import{ProductHeroMeta as S}from"./ProductHero/meta.js";import{ProductRefMeta as b}from"./ProductRef/meta.js";import{RelatedProductsMeta as F}from"./RelatedProducts/meta.js";import{SearchBlockMeta as G}from"./SearchBlock/meta.js";import{SpecTableMeta as P}from"./SpecTable/meta.js";import{ThemeSwitchBlockMeta as A}from"./ThemeSwitchBlock/meta.js";import{TyreFitmentMeta as E}from"./TyreFitment/meta.js";import{TyreSizesMeta as R}from"./TyreSizes/meta.js";const it={AccountBlock:t,AlloyWheelsListing:e,BundleOffer:r,CartBlock:o,CatalogFilterBar:m,CheckoutCTA:a,CollectionCard:i,Collections:l,CompatibleTyres:c,CountrySwitchBlock:p,DeliveryOptions:f,DetailRows:M,EuTyreLabel:y,EuTyreLabelBlock:n,FitmentFinder:d,FitmentTable:u,Gallery:B,GalleryB:C,GalleryItem:T,Header:s,ProductGallery:k,ProductGrid:h,ProductHero:S,ProductRef:b,RelatedProducts:F,SearchBlock:G,SpecTable:P,ThemeSwitchBlock:A,TyreFitment:E,TyreSizes:R};export{it as COMMERCE_METAS};
|
|
@@ -13,12 +13,14 @@ export declare const COMMERCE_RENDERS: {
|
|
|
13
13
|
DeliveryOptions: BlockRender;
|
|
14
14
|
DetailRows: BlockRender;
|
|
15
15
|
EuTyreLabel: BlockRender;
|
|
16
|
+
EuTyreLabelBlock: BlockRender;
|
|
16
17
|
FitmentFinder: BlockRender;
|
|
17
18
|
FitmentTable: BlockRender;
|
|
18
19
|
Gallery: BlockRender;
|
|
19
20
|
GalleryB: BlockRender;
|
|
20
21
|
GalleryItem: BlockRender;
|
|
21
22
|
Header: BlockRender;
|
|
23
|
+
ProductGallery: BlockRender;
|
|
22
24
|
ProductGrid: BlockRender;
|
|
23
25
|
ProductHero: BlockRender;
|
|
24
26
|
ProductRef: BlockRender;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AccountBlockRender as e}from"./AccountBlock/render.js";import{AlloyWheelsListingRender as r}from"./AlloyWheelsListing/render.js";import{BundleOfferRender as o}from"./BundleOffer/render.js";import{CartBlockRender as t}from"./CartBlock/render.js";import{CatalogFilterBarRender as m}from"./CatalogFilterBar/render.js";import{CheckoutCTARender as i}from"./CheckoutCTA/render.js";import{CollectionCardRender as l}from"./CollectionCard/render.js";import{CollectionsRender as n}from"./Collections/render.js";import{CompatibleTyresRender as d}from"./CompatibleTyres/render.js";import{CountrySwitchBlockRender as c}from"./CountrySwitchBlock/render.js";import{DeliveryOptionsRender as R}from"./DeliveryOptions/render.js";import{DetailRowsRender as p}from"./DetailRows/render.js";import{EuTyreLabelRender as
|
|
1
|
+
import{AccountBlockRender as e}from"./AccountBlock/render.js";import{AlloyWheelsListingRender as r}from"./AlloyWheelsListing/render.js";import{BundleOfferRender as o}from"./BundleOffer/render.js";import{CartBlockRender as t}from"./CartBlock/render.js";import{CatalogFilterBarRender as m}from"./CatalogFilterBar/render.js";import{CheckoutCTARender as i}from"./CheckoutCTA/render.js";import{CollectionCardRender as l}from"./CollectionCard/render.js";import{CollectionsRender as n}from"./Collections/render.js";import{CompatibleTyresRender as d}from"./CompatibleTyres/render.js";import{CountrySwitchBlockRender as c}from"./CountrySwitchBlock/render.js";import{DeliveryOptionsRender as R}from"./DeliveryOptions/render.js";import{DetailRowsRender as p}from"./DetailRows/render.js";import{EuTyreLabelRender as a}from"./EuTyreLabel/render.js";import{EuTyreLabelBlockRender as f}from"./EuTyreLabelBlock/render.js";import{FitmentFinderRender as y}from"./FitmentFinder/render.js";import{FitmentTableRender as u}from"./FitmentTable/render.js";import{GalleryRender as C}from"./Gallery/render.js";import{GalleryBRender as B}from"./GalleryB/render.js";import{GalleryItemRender as T}from"./GalleryItem/render.js";import{HeaderRender as s}from"./Header/render.js";import{ProductGalleryRender as k}from"./ProductGallery/render.js";import{ProductGridRender as h}from"./ProductGrid/render.js";import{ProductHeroRender as S}from"./ProductHero/render.js";import{ProductRefRender as b}from"./ProductRef/render.js";import{RelatedProductsRender as F}from"./RelatedProducts/render.js";import{SearchBlockRender as G}from"./SearchBlock/render.js";import{SpecTableRender as P}from"./SpecTable/render.js";import{ThemeSwitchBlockRender as E}from"./ThemeSwitchBlock/render.js";import{TyreFitmentRender as w}from"./TyreFitment/render.js";import{TyreSizesRender as A}from"./TyreSizes/render.js";const le={AccountBlock:e,AlloyWheelsListing:r,BundleOffer:o,CartBlock:t,CatalogFilterBar:m,CheckoutCTA:i,CollectionCard:l,Collections:n,CompatibleTyres:d,CountrySwitchBlock:c,DeliveryOptions:R,DetailRows:p,EuTyreLabel:a,EuTyreLabelBlock:f,FitmentFinder:y,FitmentTable:u,Gallery:C,GalleryB:B,GalleryItem:T,Header:s,ProductGallery:k,ProductGrid:h,ProductHero:S,ProductRef:b,RelatedProducts:F,SearchBlock:G,SpecTable:P,ThemeSwitchBlock:E,TyreFitment:w,TyreSizes:A};export{le as COMMERCE_RENDERS};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=0,a={label:"Rating",defaultProps:{rating:0}};export{t as RATING_NONE,a as RatingBlockMeta};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import r,{RATING_STARS as o}from"../../../../../components/RatingStars.js";import{RATING_NONE as t,RatingBlockMeta as a}from"./meta.js";function c(i){return typeof i=="number"&&Number.isFinite(i)&&i>t?i:t}function g({rating:i,editing:e}){return i>t?n(r,{rating:i}):e?n("div",{className:"opacity-60",children:n(r,{rating:o})}):null}const l={...a,render:i=>n(g,{rating:c(i.rating),editing:!!i.puck?.isEditing})};export{l as RatingBlockRender};
|
|
@@ -14,6 +14,7 @@ export declare const SERVICE_METAS: {
|
|
|
14
14
|
FooterText: Omit<BlockRender, "render">;
|
|
15
15
|
Form: Omit<BlockRender, "render">;
|
|
16
16
|
LegalLineBlock: Omit<BlockRender, "render">;
|
|
17
|
+
RatingBlock: Omit<BlockRender, "render">;
|
|
17
18
|
ReviewForm: Omit<BlockRender, "render">;
|
|
18
19
|
Reviews: Omit<BlockRender, "render">;
|
|
19
20
|
SiteFooter: Omit<BlockRender, "render">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SITE_FOOTER_TYPE as o,SITE_HEADER_TYPE as t}from"efficient-web-builder/format/lib/puck/section-groups";import{AppointmentBookingMeta as r}from"./AppointmentBooking/meta.js";import{BookingBoxMeta as e}from"./BookingBox/meta.js";import{ContactRoutingMeta as i}from"./ContactRouting/meta.js";import{EventsMeta as m}from"./Events/meta.js";import{FooterDividerMeta as
|
|
1
|
+
import{SITE_FOOTER_TYPE as o,SITE_HEADER_TYPE as t}from"efficient-web-builder/format/lib/puck/section-groups";import{AppointmentBookingMeta as r}from"./AppointmentBooking/meta.js";import{BookingBoxMeta as e}from"./BookingBox/meta.js";import{ContactRoutingMeta as i}from"./ContactRouting/meta.js";import{EventsMeta as m}from"./Events/meta.js";import{FooterDividerMeta as a}from"./FooterDivider/meta.js";import{FooterEmailSignupMeta as p}from"./FooterEmailSignup/meta.js";import{FooterGroupMeta as M}from"./FooterGroup/meta.js";import{FooterLogoMeta as f}from"./FooterLogo/meta.js";import{FooterMenuMeta as n}from"./FooterMenu/meta.js";import{FooterMeta as F}from"./Footer/meta.js";import{FooterSocialMeta as u}from"./FooterSocial/meta.js";import{FooterTextMeta as S}from"./FooterText/meta.js";import{FormMeta as g}from"./Form/meta.js";import{LegalLineBlockMeta as B}from"./LegalLineBlock/meta.js";import{RatingBlockMeta as l}from"./RatingBlock/meta.js";import{ReviewFormMeta as E}from"./ReviewForm/meta.js";import{ReviewsMeta as c}from"./Reviews/meta.js";import{SiteFooterMeta as b}from"./SiteFooter/meta.js";import{SiteHeaderMeta as s}from"./SiteHeader/meta.js";import{SubmitBoxMeta as R}from"./SubmitBox/meta.js";import{SubmitBuildMeta as k}from"./SubmitBuild/meta.js";import{SubscribeBlogsMeta as v}from"./SubscribeBlogs/meta.js";import{SubscribeMeta as T}from"./Subscribe/meta.js";const U={AppointmentBooking:r,BookingBox:e,ContactRouting:i,Events:m,Footer:F,FooterDivider:a,FooterEmailSignup:p,FooterGroup:M,FooterLogo:f,FooterMenu:n,FooterSocial:u,FooterText:S,Form:g,LegalLineBlock:B,RatingBlock:l,ReviewForm:E,Reviews:c,[o]:b,[t]:s,SubmitBox:R,SubmitBuild:k,Subscribe:T,SubscribeBlogs:v};export{U as SERVICE_METAS};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SITE_FOOTER_TYPE as o,SITE_HEADER_TYPE as r}from"efficient-web-builder/format/lib/puck/section-groups";import{AppointmentBookingRender as e}from"./AppointmentBooking/render.js";import{BookingBoxRender as t}from"./BookingBox/render.js";import{ContactRoutingRender as i}from"./ContactRouting/render.js";import{EventsRender as m}from"./Events/render.js";import{FooterRender as n}from"./Footer/render.js";import{FooterDividerRender as R}from"./FooterDivider/render.js";import{FooterEmailSignupRender as p}from"./FooterEmailSignup/render.js";import{FooterGroupRender as d}from"./FooterGroup/render.js";import{FooterLogoRender as f}from"./FooterLogo/render.js";import{FooterMenuRender as F}from"./FooterMenu/render.js";import{FooterSocialRender as u}from"./FooterSocial/render.js";import{FooterTextRender as S}from"./FooterText/render.js";import{FormRender as
|
|
1
|
+
import{SITE_FOOTER_TYPE as o,SITE_HEADER_TYPE as r}from"efficient-web-builder/format/lib/puck/section-groups";import{AppointmentBookingRender as e}from"./AppointmentBooking/render.js";import{BookingBoxRender as t}from"./BookingBox/render.js";import{ContactRoutingRender as i}from"./ContactRouting/render.js";import{EventsRender as m}from"./Events/render.js";import{FooterRender as n}from"./Footer/render.js";import{FooterDividerRender as R}from"./FooterDivider/render.js";import{FooterEmailSignupRender as p}from"./FooterEmailSignup/render.js";import{FooterGroupRender as d}from"./FooterGroup/render.js";import{FooterLogoRender as f}from"./FooterLogo/render.js";import{FooterMenuRender as F}from"./FooterMenu/render.js";import{FooterSocialRender as u}from"./FooterSocial/render.js";import{FooterTextRender as S}from"./FooterText/render.js";import{FormRender as g}from"./Form/render.js";import{LegalLineBlockRender as B}from"./LegalLineBlock/render.js";import{RatingBlockRender as E}from"./RatingBlock/render.js";import{ReviewFormRender as l}from"./ReviewForm/render.js";import{ReviewsRender as c}from"./Reviews/render.js";import{SiteFooterRender as b}from"./SiteFooter/render.js";import{SiteHeaderRender as a}from"./SiteHeader/render.js";import{SubmitBoxRender as s}from"./SubmitBox/render.js";import{SubmitBuildRender as k}from"./SubmitBuild/render.js";import{SubscribeRender as v}from"./Subscribe/render.js";import{SubscribeBlogsRender as x}from"./SubscribeBlogs/render.js";const U={AppointmentBooking:e,BookingBox:t,ContactRouting:i,Events:m,Footer:n,FooterDivider:R,FooterEmailSignup:p,FooterGroup:d,FooterLogo:f,FooterMenu:F,FooterSocial:u,FooterText:S,Form:g,LegalLineBlock:B,RatingBlock:E,ReviewForm:l,Reviews:c,[o]:b,[r]:a,SubmitBox:s,SubmitBuild:k,Subscribe:v,SubscribeBlogs:x};export{U as SERVICE_RENDERS};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as i}from"react/jsx-runtime";import t from"next/dynamic";import{SITE_FOOTER_TYPE as d,SITE_HEADER_TYPE as m}from"efficient-web-builder/format/lib/puck/section-groups";function r(e){return function(o){return e.render(o)}}const p={Banner:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Banner/render").then(e=>r(e.BannerRender))),Breadcrumb:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Breadcrumb/render").then(e=>r(e.BreadcrumbRender))),ButtonBlock:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/ButtonBlock/render").then(e=>r(e.ButtonBlockRender))),Cards:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Cards/render").then(e=>r(e.CardsRender))),CategoryBar:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/CategoryBar/render").then(e=>r(e.CategoryBarRender))),Chart:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Chart/render").then(e=>r(e.ChartRender))),ContactLocations:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/ContactLocations/render").then(e=>r(e.ContactLocationsRender))),CustomHTML:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/CustomHTML/render").then(e=>r(e.CustomHTMLRender))),Divider:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Divider/render").then(e=>r(e.DividerRender))),DocBody:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/DocBody/render").then(e=>r(e.DocBodyRender))),DocMasthead:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/DocMasthead/render").then(e=>r(e.DocMastheadRender))),DocMetaCards:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/DocMetaCards/render").then(e=>r(e.DocMetaCardsRender))),DocTabs:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/DocTabs/render").then(e=>r(e.DocTabsRender))),Eyebrow:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Eyebrow/render").then(e=>r(e.EyebrowRender))),FAQ:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/FAQ/render").then(e=>r(e.FAQRender))),FeaturedCover:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/FeaturedCover/render").then(e=>r(e.FeaturedCoverRender))),Flex:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Flex/render").then(e=>r(e.FlexRender))),Footprint:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Footprint/render").then(e=>r(e.FootprintRender))),Grid:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Grid/render").then(e=>r(e.GridRender))),Heading:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Heading/render").then(e=>r(e.HeadingRender))),Hero:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Hero/render").then(e=>r(e.HeroRender))),HeroGroup:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/HeroGroup/render").then(e=>r(e.HeroGroupRender))),HeroSingle:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/HeroSingle/render").then(e=>r(e.HeroSingleRender))),HeroSlide:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/HeroSlide/render").then(e=>r(e.HeroSlideRender))),ImageBlock:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/ImageBlock/render").then(e=>r(e.ImageBlockRender))),Integrations:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Integrations/render").then(e=>r(e.IntegrationsRender))),IntroBleed:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/IntroBleed/render").then(e=>r(e.IntroBleedRender))),Countdown:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Countdown/render").then(e=>r(e.CountdownRender))),KeyFeatures:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/KeyFeatures/render").then(e=>r(e.KeyFeaturesRender))),LogoBlock:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/LogoBlock/render").then(e=>r(e.LogoBlockRender))),Logos:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Logos/render").then(e=>r(e.LogosRender))),LongRead:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/LongRead/render").then(e=>r(e.LongReadRender))),Manifesto:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Manifesto/render").then(e=>r(e.ManifestoRender))),Masthead:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Masthead/render").then(e=>r(e.MastheadRender))),Mockup:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Mockup/render").then(e=>r(e.MockupRender))),OrderSummary:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/OrderSummary/render").then(e=>r(e.OrderSummaryRender))),ParagraphsA:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/ParagraphsA/render").then(e=>r(e.ParagraphsARender))),PaymentBadges:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/PaymentBadges/render").then(e=>r(e.PaymentBadgesRender))),PostCard:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/PostCard/render").then(e=>r(e.PostCardRender))),ProcessSteps:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/ProcessSteps/render").then(e=>r(e.ProcessStepsRender))),Prose:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Prose/render").then(e=>r(e.ProseRender))),SectionHeader:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/SectionHeader/render").then(e=>r(e.SectionHeaderRender))),Series:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Series/render").then(e=>r(e.SeriesRender))),Spacer:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Spacer/render").then(e=>r(e.SpacerRender))),SpecStrip:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/SpecStrip/render").then(e=>r(e.SpecStripRender))),Split:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Split/render").then(e=>r(e.SplitRender))),Stats:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Stats/render").then(e=>r(e.StatsRender))),StatsParagraph:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/StatsParagraph/render").then(e=>r(e.StatsParagraphRender))),Testimonials:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Testimonials/render").then(e=>r(e.TestimonialsRender))),Text:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Text/render").then(e=>r(e.TextRender))),Ticker:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Ticker/render").then(e=>r(e.TickerRender))),Timeline:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Timeline/render").then(e=>r(e.TimelineRender))),TimelineTrack:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/TimelineTrack/render").then(e=>r(e.TimelineTrackRender))),TitleWithButtons:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/TitleWithButtons/render").then(e=>r(e.TitleWithButtonsRender))),AccountBlock:t(()=>import("./blocks/commerce/AccountBlock/render.js").then(e=>r(e.AccountBlockRender))),AlloyWheelsListing:t(()=>import("./blocks/commerce/AlloyWheelsListing/render.js").then(e=>r(e.AlloyWheelsListingRender))),BundleOffer:t(()=>import("./blocks/commerce/BundleOffer/render.js").then(e=>r(e.BundleOfferRender))),CartBlock:t(()=>import("./blocks/commerce/CartBlock/render.js").then(e=>r(e.CartBlockRender))),CatalogFilterBar:t(()=>import("./blocks/commerce/CatalogFilterBar/render.js").then(e=>r(e.CatalogFilterBarRender))),CheckoutCTA:t(()=>import("./blocks/commerce/CheckoutCTA/render.js").then(e=>r(e.CheckoutCTARender))),CollectionCard:t(()=>import("./blocks/commerce/CollectionCard/render.js").then(e=>r(e.CollectionCardRender))),Collections:t(()=>import("./blocks/commerce/Collections/render.js").then(e=>r(e.CollectionsRender))),CompatibleTyres:t(()=>import("./blocks/commerce/CompatibleTyres/render.js").then(e=>r(e.CompatibleTyresRender))),CountrySwitchBlock:t(()=>import("./blocks/commerce/CountrySwitchBlock/render.js").then(e=>r(e.CountrySwitchBlockRender))),DeliveryOptions:t(()=>import("./blocks/commerce/DeliveryOptions/render.js").then(e=>r(e.DeliveryOptionsRender))),DetailRows:t(()=>import("./blocks/commerce/DetailRows/render.js").then(e=>r(e.DetailRowsRender))),EuTyreLabel:t(()=>import("./blocks/commerce/EuTyreLabel/render.js").then(e=>r(e.EuTyreLabelRender))),FitmentFinder:t(()=>import("./blocks/commerce/FitmentFinder/render.js").then(e=>r(e.FitmentFinderRender))),FitmentTable:t(()=>import("./blocks/commerce/FitmentTable/render.js").then(e=>r(e.FitmentTableRender))),Gallery:t(()=>import("./blocks/commerce/Gallery/render.js").then(e=>r(e.GalleryRender))),GalleryB:t(()=>import("./blocks/commerce/GalleryB/render.js").then(e=>r(e.GalleryBRender))),GalleryItem:t(()=>import("./blocks/commerce/GalleryItem/render.js").then(e=>r(e.GalleryItemRender))),Header:t(()=>import("./blocks/commerce/Header/render.js").then(e=>r(e.HeaderRender))),ProductGrid:t(()=>import("./blocks/commerce/ProductGrid/render.js").then(e=>r(e.ProductGridRender))),ProductHero:t(()=>import("./blocks/commerce/ProductHero/render.js").then(e=>r(e.ProductHeroRender))),ProductRef:t(()=>import("./blocks/commerce/ProductRef/render.js").then(e=>r(e.ProductRefRender))),RelatedProducts:t(()=>import("./blocks/commerce/RelatedProducts/render.js").then(e=>r(e.RelatedProductsRender))),SearchBlock:t(()=>import("./blocks/commerce/SearchBlock/render.js").then(e=>r(e.SearchBlockRender))),SpecTable:t(()=>import("./blocks/commerce/SpecTable/render.js").then(e=>r(e.SpecTableRender))),ThemeSwitchBlock:t(()=>import("./blocks/commerce/ThemeSwitchBlock/render.js").then(e=>r(e.ThemeSwitchBlockRender))),TyreFitment:t(()=>import("./blocks/commerce/TyreFitment/render.js").then(e=>r(e.TyreFitmentRender))),TyreSizes:t(()=>import("./blocks/commerce/TyreSizes/render.js").then(e=>r(e.TyreSizesRender))),AppointmentBooking:t(()=>import("./blocks/service/AppointmentBooking/render.js").then(e=>r(e.AppointmentBookingRender))),BookingBox:t(()=>import("./blocks/service/BookingBox/render.js").then(e=>r(e.BookingBoxRender))),ContactRouting:t(()=>import("./blocks/service/ContactRouting/render.js").then(e=>r(e.ContactRoutingRender))),Events:t(()=>import("./blocks/service/Events/render.js").then(e=>r(e.EventsRender))),Footer:t(()=>import("./blocks/service/Footer/render.js").then(e=>r(e.FooterRender))),FooterDivider:t(()=>import("./blocks/service/FooterDivider/render.js").then(e=>r(e.FooterDividerRender))),FooterEmailSignup:t(()=>import("./blocks/service/FooterEmailSignup/render.js").then(e=>r(e.FooterEmailSignupRender))),FooterGroup:t(()=>import("./blocks/service/FooterGroup/render.js").then(e=>r(e.FooterGroupRender))),FooterLogo:t(()=>import("./blocks/service/FooterLogo/render.js").then(e=>r(e.FooterLogoRender))),FooterMenu:t(()=>import("./blocks/service/FooterMenu/render.js").then(e=>r(e.FooterMenuRender))),FooterSocial:t(()=>import("./blocks/service/FooterSocial/render.js").then(e=>r(e.FooterSocialRender))),FooterText:t(()=>import("./blocks/service/FooterText/render.js").then(e=>r(e.FooterTextRender))),Form:t(()=>import("./blocks/service/Form/render.js").then(e=>r(e.FormRender))),LegalLineBlock:t(()=>import("./blocks/service/LegalLineBlock/render.js").then(e=>r(e.LegalLineBlockRender))),ReviewForm:t(()=>import("./blocks/service/ReviewForm/render.js").then(e=>r(e.ReviewFormRender))),Reviews:t(()=>import("./blocks/service/Reviews/render.js").then(e=>r(e.ReviewsRender))),[d]:t(()=>import("./blocks/service/SiteFooter/render.js").then(e=>r(e.SiteFooterRender))),[m]:t(()=>import("./blocks/service/SiteHeader/render.js").then(e=>r(e.SiteHeaderRender))),SubmitBox:t(()=>import("./blocks/service/SubmitBox/render.js").then(e=>r(e.SubmitBoxRender))),SubmitBuild:t(()=>import("./blocks/service/SubmitBuild/render.js").then(e=>r(e.SubmitBuildRender))),Subscribe:t(()=>import("./blocks/service/Subscribe/render.js").then(e=>r(e.SubscribeRender))),SubscribeBlogs:t(()=>import("./blocks/service/SubscribeBlogs/render.js").then(e=>r(e.SubscribeBlogsRender)))},l=Object.fromEntries(Object.entries(p).map(([e,n])=>[e,o=>i(n,{...o})]));export{l as LAZY_DRAWS};
|
|
1
|
+
import{jsx as i}from"react/jsx-runtime";import t from"next/dynamic";import{SITE_FOOTER_TYPE as d,SITE_HEADER_TYPE as m}from"efficient-web-builder/format/lib/puck/section-groups";function r(e){return function(o){return e.render(o)}}const p={Banner:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Banner/render").then(e=>r(e.BannerRender))),Breadcrumb:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Breadcrumb/render").then(e=>r(e.BreadcrumbRender))),ButtonBlock:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/ButtonBlock/render").then(e=>r(e.ButtonBlockRender))),Cards:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Cards/render").then(e=>r(e.CardsRender))),CategoryBar:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/CategoryBar/render").then(e=>r(e.CategoryBarRender))),Chart:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Chart/render").then(e=>r(e.ChartRender))),ContactLocations:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/ContactLocations/render").then(e=>r(e.ContactLocationsRender))),CustomHTML:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/CustomHTML/render").then(e=>r(e.CustomHTMLRender))),Divider:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Divider/render").then(e=>r(e.DividerRender))),DocBody:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/DocBody/render").then(e=>r(e.DocBodyRender))),DocMasthead:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/DocMasthead/render").then(e=>r(e.DocMastheadRender))),DocMetaCards:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/DocMetaCards/render").then(e=>r(e.DocMetaCardsRender))),DocTabs:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/DocTabs/render").then(e=>r(e.DocTabsRender))),Eyebrow:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Eyebrow/render").then(e=>r(e.EyebrowRender))),FAQ:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/FAQ/render").then(e=>r(e.FAQRender))),FeaturedCover:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/FeaturedCover/render").then(e=>r(e.FeaturedCoverRender))),Flex:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Flex/render").then(e=>r(e.FlexRender))),Footprint:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Footprint/render").then(e=>r(e.FootprintRender))),Grid:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Grid/render").then(e=>r(e.GridRender))),Heading:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Heading/render").then(e=>r(e.HeadingRender))),Hero:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Hero/render").then(e=>r(e.HeroRender))),HeroGroup:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/HeroGroup/render").then(e=>r(e.HeroGroupRender))),HeroSingle:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/HeroSingle/render").then(e=>r(e.HeroSingleRender))),HeroSlide:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/HeroSlide/render").then(e=>r(e.HeroSlideRender))),ImageBlock:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/ImageBlock/render").then(e=>r(e.ImageBlockRender))),Integrations:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Integrations/render").then(e=>r(e.IntegrationsRender))),IntroBleed:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/IntroBleed/render").then(e=>r(e.IntroBleedRender))),Countdown:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Countdown/render").then(e=>r(e.CountdownRender))),KeyFeatures:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/KeyFeatures/render").then(e=>r(e.KeyFeaturesRender))),LogoBlock:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/LogoBlock/render").then(e=>r(e.LogoBlockRender))),Logos:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Logos/render").then(e=>r(e.LogosRender))),LongRead:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/LongRead/render").then(e=>r(e.LongReadRender))),Manifesto:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Manifesto/render").then(e=>r(e.ManifestoRender))),Masthead:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Masthead/render").then(e=>r(e.MastheadRender))),Mockup:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Mockup/render").then(e=>r(e.MockupRender))),OrderSummary:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/OrderSummary/render").then(e=>r(e.OrderSummaryRender))),ParagraphsA:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/ParagraphsA/render").then(e=>r(e.ParagraphsARender))),PaymentBadges:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/PaymentBadges/render").then(e=>r(e.PaymentBadgesRender))),PostCard:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/PostCard/render").then(e=>r(e.PostCardRender))),ProcessSteps:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/ProcessSteps/render").then(e=>r(e.ProcessStepsRender))),Prose:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Prose/render").then(e=>r(e.ProseRender))),SectionHeader:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/SectionHeader/render").then(e=>r(e.SectionHeaderRender))),Series:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Series/render").then(e=>r(e.SeriesRender))),Spacer:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Spacer/render").then(e=>r(e.SpacerRender))),SpecStrip:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/SpecStrip/render").then(e=>r(e.SpecStripRender))),Split:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Split/render").then(e=>r(e.SplitRender))),Stats:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Stats/render").then(e=>r(e.StatsRender))),StatsParagraph:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/StatsParagraph/render").then(e=>r(e.StatsParagraphRender))),Testimonials:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Testimonials/render").then(e=>r(e.TestimonialsRender))),Text:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Text/render").then(e=>r(e.TextRender))),Ticker:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Ticker/render").then(e=>r(e.TickerRender))),Timeline:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/Timeline/render").then(e=>r(e.TimelineRender))),TimelineTrack:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/TimelineTrack/render").then(e=>r(e.TimelineTrackRender))),TitleWithButtons:t(()=>import("efficient-web-builder/render/lib/puck/blocks/general/TitleWithButtons/render").then(e=>r(e.TitleWithButtonsRender))),AccountBlock:t(()=>import("./blocks/commerce/AccountBlock/render.js").then(e=>r(e.AccountBlockRender))),AlloyWheelsListing:t(()=>import("./blocks/commerce/AlloyWheelsListing/render.js").then(e=>r(e.AlloyWheelsListingRender))),BundleOffer:t(()=>import("./blocks/commerce/BundleOffer/render.js").then(e=>r(e.BundleOfferRender))),CartBlock:t(()=>import("./blocks/commerce/CartBlock/render.js").then(e=>r(e.CartBlockRender))),CatalogFilterBar:t(()=>import("./blocks/commerce/CatalogFilterBar/render.js").then(e=>r(e.CatalogFilterBarRender))),CheckoutCTA:t(()=>import("./blocks/commerce/CheckoutCTA/render.js").then(e=>r(e.CheckoutCTARender))),CollectionCard:t(()=>import("./blocks/commerce/CollectionCard/render.js").then(e=>r(e.CollectionCardRender))),Collections:t(()=>import("./blocks/commerce/Collections/render.js").then(e=>r(e.CollectionsRender))),CompatibleTyres:t(()=>import("./blocks/commerce/CompatibleTyres/render.js").then(e=>r(e.CompatibleTyresRender))),CountrySwitchBlock:t(()=>import("./blocks/commerce/CountrySwitchBlock/render.js").then(e=>r(e.CountrySwitchBlockRender))),DeliveryOptions:t(()=>import("./blocks/commerce/DeliveryOptions/render.js").then(e=>r(e.DeliveryOptionsRender))),DetailRows:t(()=>import("./blocks/commerce/DetailRows/render.js").then(e=>r(e.DetailRowsRender))),EuTyreLabel:t(()=>import("./blocks/commerce/EuTyreLabel/render.js").then(e=>r(e.EuTyreLabelRender))),EuTyreLabelBlock:t(()=>import("./blocks/commerce/EuTyreLabelBlock/render.js").then(e=>r(e.EuTyreLabelBlockRender))),FitmentFinder:t(()=>import("./blocks/commerce/FitmentFinder/render.js").then(e=>r(e.FitmentFinderRender))),FitmentTable:t(()=>import("./blocks/commerce/FitmentTable/render.js").then(e=>r(e.FitmentTableRender))),Gallery:t(()=>import("./blocks/commerce/Gallery/render.js").then(e=>r(e.GalleryRender))),GalleryB:t(()=>import("./blocks/commerce/GalleryB/render.js").then(e=>r(e.GalleryBRender))),GalleryItem:t(()=>import("./blocks/commerce/GalleryItem/render.js").then(e=>r(e.GalleryItemRender))),Header:t(()=>import("./blocks/commerce/Header/render.js").then(e=>r(e.HeaderRender))),ProductGrid:t(()=>import("./blocks/commerce/ProductGrid/render.js").then(e=>r(e.ProductGridRender))),ProductGallery:t(()=>import("./blocks/commerce/ProductGallery/render.js").then(e=>r(e.ProductGalleryRender))),ProductHero:t(()=>import("./blocks/commerce/ProductHero/render.js").then(e=>r(e.ProductHeroRender))),ProductRef:t(()=>import("./blocks/commerce/ProductRef/render.js").then(e=>r(e.ProductRefRender))),RelatedProducts:t(()=>import("./blocks/commerce/RelatedProducts/render.js").then(e=>r(e.RelatedProductsRender))),SearchBlock:t(()=>import("./blocks/commerce/SearchBlock/render.js").then(e=>r(e.SearchBlockRender))),SpecTable:t(()=>import("./blocks/commerce/SpecTable/render.js").then(e=>r(e.SpecTableRender))),ThemeSwitchBlock:t(()=>import("./blocks/commerce/ThemeSwitchBlock/render.js").then(e=>r(e.ThemeSwitchBlockRender))),TyreFitment:t(()=>import("./blocks/commerce/TyreFitment/render.js").then(e=>r(e.TyreFitmentRender))),TyreSizes:t(()=>import("./blocks/commerce/TyreSizes/render.js").then(e=>r(e.TyreSizesRender))),AppointmentBooking:t(()=>import("./blocks/service/AppointmentBooking/render.js").then(e=>r(e.AppointmentBookingRender))),BookingBox:t(()=>import("./blocks/service/BookingBox/render.js").then(e=>r(e.BookingBoxRender))),ContactRouting:t(()=>import("./blocks/service/ContactRouting/render.js").then(e=>r(e.ContactRoutingRender))),Events:t(()=>import("./blocks/service/Events/render.js").then(e=>r(e.EventsRender))),Footer:t(()=>import("./blocks/service/Footer/render.js").then(e=>r(e.FooterRender))),FooterDivider:t(()=>import("./blocks/service/FooterDivider/render.js").then(e=>r(e.FooterDividerRender))),FooterEmailSignup:t(()=>import("./blocks/service/FooterEmailSignup/render.js").then(e=>r(e.FooterEmailSignupRender))),FooterGroup:t(()=>import("./blocks/service/FooterGroup/render.js").then(e=>r(e.FooterGroupRender))),FooterLogo:t(()=>import("./blocks/service/FooterLogo/render.js").then(e=>r(e.FooterLogoRender))),FooterMenu:t(()=>import("./blocks/service/FooterMenu/render.js").then(e=>r(e.FooterMenuRender))),FooterSocial:t(()=>import("./blocks/service/FooterSocial/render.js").then(e=>r(e.FooterSocialRender))),FooterText:t(()=>import("./blocks/service/FooterText/render.js").then(e=>r(e.FooterTextRender))),Form:t(()=>import("./blocks/service/Form/render.js").then(e=>r(e.FormRender))),LegalLineBlock:t(()=>import("./blocks/service/LegalLineBlock/render.js").then(e=>r(e.LegalLineBlockRender))),RatingBlock:t(()=>import("./blocks/service/RatingBlock/render.js").then(e=>r(e.RatingBlockRender))),ReviewForm:t(()=>import("./blocks/service/ReviewForm/render.js").then(e=>r(e.ReviewFormRender))),Reviews:t(()=>import("./blocks/service/Reviews/render.js").then(e=>r(e.ReviewsRender))),[d]:t(()=>import("./blocks/service/SiteFooter/render.js").then(e=>r(e.SiteFooterRender))),[m]:t(()=>import("./blocks/service/SiteHeader/render.js").then(e=>r(e.SiteHeaderRender))),SubmitBox:t(()=>import("./blocks/service/SubmitBox/render.js").then(e=>r(e.SubmitBoxRender))),SubmitBuild:t(()=>import("./blocks/service/SubmitBuild/render.js").then(e=>r(e.SubmitBuildRender))),Subscribe:t(()=>import("./blocks/service/Subscribe/render.js").then(e=>r(e.SubscribeRender))),SubscribeBlogs:t(()=>import("./blocks/service/SubscribeBlogs/render.js").then(e=>r(e.SubscribeBlogsRender)))},l=Object.fromEntries(Object.entries(p).map(([e,n])=>[e,o=>i(n,{...o})]));export{l as LAZY_DRAWS};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SUBSCRIBE_POPUP_SLUG as _,isSystemPageSlug as i}from"efficient-web-builder/format/lib/content/subscribe";import{CART_DRAWER_SLUG as S}from"efficient-web-builder/format/lib/content/cart-drawer";import{CONSENT_BANNER_SLUG as E}from"efficient-web-builder/format/lib/content/consent-banner";import{layoutDeclaredProductKind as G}from"efficient-web-builder/format/lib/content/product-page";import{SITE_FOOTER_SLUG as A}from"efficient-web-builder/format/lib/content/footer";import{orderPages as R}from"./storefront-page-order.js";import{isDynamicPageRow as
|
|
1
|
+
import{SUBSCRIBE_POPUP_SLUG as _,isSystemPageSlug as i}from"efficient-web-builder/format/lib/content/subscribe";import{CART_DRAWER_SLUG as S}from"efficient-web-builder/format/lib/content/cart-drawer";import{CONSENT_BANNER_SLUG as E}from"efficient-web-builder/format/lib/content/consent-banner";import{layoutDeclaredProductKind as G}from"efficient-web-builder/format/lib/content/product-page";import{SITE_FOOTER_SLUG as A}from"efficient-web-builder/format/lib/content/footer";import{orderPages as R}from"./storefront-page-order.js";import{isDynamicPageRow as y}from"efficient-web-builder/format/lib/editor-page-rows";import{isPopupPageLayout as d}from"efficient-web-builder/format/lib/popup/new-popup";import{DYNAMIC_PAGES_GROUP as h,DYNAMIC_PAGES_GROUP_KEY as B,DYNAMIC_PAGE_KIND as Y,MAIN_PAGES_GROUP as F,bucketEditorPageRows as K,isDynamicPageRow as $}from"efficient-web-builder/format/lib/editor-page-rows";const g="Popups",f="Site";function L(o){return y(o)||d(o.layout)?!1:G(o.layout)===null}const c={[_]:{label:"Site popup",group:g},[A]:{label:"Footer",group:f},[S]:{label:"Cart drawer",group:f},[E]:{label:"Cookie banner",group:g}};function M(o){return c[o.slug]?.label||o.title||o.slug}function a(o){const t=o.group?.trim();return t||null}function P(o,t){const e=new Map;for(const u of o){const s=t(u),n=e.get(s);n?n.push(u):e.set(s,[u])}return e}function k(o){const t=R(o),e=[],u=t.filter(r=>!i(r.slug)),s=u.filter(r=>!a(r));s.length&&e.push({key:"top",group:null,pages:s});const n=u.filter(r=>a(r));for(const[r,p]of P(n,l=>a(l)))e.push({key:`folder:${r}`,group:r,pages:p});const m=t.filter(r=>i(r.slug));for(const[r,p]of P(m,l=>c[l.slug]?.group??g))e.push({key:`system:${r}`,group:r,pages:p});return e}export{h as DYNAMIC_PAGES_GROUP,B as DYNAMIC_PAGES_GROUP_KEY,Y as DYNAMIC_PAGE_KIND,g as LIGHTBOX_GROUP,F as MAIN_PAGES_GROUP,f as SITE_GROUP,K as bucketEditorPageRows,k as groupPagesForMenu,$ as isDynamicPageRow,L as pageAnswersAtOwnSlug,a as pageGroup,M as pageMenuLabel};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { type FieldUsageAnswer } from "../content/field-usage.js";
|
|
2
2
|
import type { FitmentRow } from "./fitments.js";
|
|
3
|
+
export type LoadUnit = "kg" | "lbs";
|
|
3
4
|
export interface FitmentColumn {
|
|
4
5
|
fieldKey: string;
|
|
5
6
|
header: string;
|
|
6
|
-
|
|
7
|
+
shownByDefault: boolean;
|
|
8
|
+
cell: (row: FitmentRow, unit: LoadUnit) => string | number;
|
|
7
9
|
}
|
|
10
|
+
export declare function loadUnitFor(country: string): LoadUnit;
|
|
11
|
+
export declare function formatLoad(text: string, unit: LoadUnit): string;
|
|
8
12
|
export declare const FITMENT_COLUMNS: readonly FitmentColumn[];
|
|
13
|
+
export declare function fitmentColumnShown(column: FitmentColumn, answers: readonly Pick<FieldUsageAnswer, "fieldKey" | "fitment">[]): boolean;
|
|
9
14
|
export declare function fitmentColumns(answers: readonly FieldUsageAnswer[]): readonly FitmentColumn[];
|